diff --git a/Service/MyTask/SwapOrderSettleAnAccountTask.cs b/Service/MyTask/SwapOrderSettleAnAccountTask.cs index e9fbb40..17386c0 100644 --- a/Service/MyTask/SwapOrderSettleAnAccountTask.cs +++ b/Service/MyTask/SwapOrderSettleAnAccountTask.cs @@ -38,7 +38,7 @@ public class SwapOrderSettleAnAccountTask : ITask public int Interval() { - return 1000 * 60; + return 1000 * 2; } public void Handle() @@ -73,6 +73,9 @@ public class SwapOrderSettleAnAccountTask : ITask decimal serviceTotalFee = StaticStationInfo.ServiceTotalFee; // 附加费用 decimal appendTotalFee = StaticStationInfo.AppendTotalFee; + + List updateSwapOrderBatteryList = new List(); + List updateSwapOrderList = new List(); foreach (var swapOrderBattery in listSwapOrderBattery) { // 换上的满电包soc*满电包的电池标量 @@ -95,12 +98,23 @@ public class SwapOrderSettleAnAccountTask : ITask matchingOrder.AppendTotalFee; // 标记换电订单已经算了订单价钱 swapOrderBattery.SettleAnAccountFlag = 1; + updateSwapOrderBatteryList.Add(swapOrderBattery); + updateSwapOrderList.Add(matchingOrder); + } } } + + if (updateSwapOrderBatteryList.Count>0) + { + SwapOrderBatteryRepository.Update(updateSwapOrderBatteryList); + } + + if (updateSwapOrderList.Count>0) + { + SwapOrderRepository.Update(updateSwapOrderList); + } - SwapOrderRepository.Update(swapOrderList); - SwapOrderBatteryRepository.Update(listSwapOrderBattery); } }