master
tq 1 month ago
parent 500d246e91
commit c8acd882f1

@ -38,7 +38,7 @@ public class SwapOrderSettleAnAccountTask : ITask
public int Interval() public int Interval()
{ {
return 1000 * 2; return 1000 * 10;
} }
public void Handle() public void Handle()
@ -61,12 +61,13 @@ public class SwapOrderSettleAnAccountTask : ITask
List<SwapOrder> swapOrderList = SwapOrderRepository List<SwapOrder> swapOrderList = SwapOrderRepository
.QueryListByClause(swapOrder => list.Contains(swapOrder.Sn)); .QueryListByClause(swapOrder => list.Contains(swapOrder.Sn));
if (swapOrderList.Count<=0)
if (swapOrderList.Count <= 0)
{ {
return; return;
} }
// 电费单价 // 电费单价
decimal electricityTotalFee = StaticStationInfo.ElectricityTotalFee; decimal electricityTotalFee = StaticStationInfo.ElectricityTotalFee;
// 换电服务费用 // 换电服务费用
@ -82,7 +83,7 @@ public class SwapOrderSettleAnAccountTask : ITask
decimal? upNominalEnergy = swapOrderBattery.UpBatterySoc * swapOrderBattery.UpNominalEnergy; decimal? upNominalEnergy = swapOrderBattery.UpBatterySoc * swapOrderBattery.UpNominalEnergy;
// 换下的亏电包soc*亏电包的电池标量 // 换下的亏电包soc*亏电包的电池标量
decimal? downNominalEnergy = swapOrderBattery.DownBatterySoc * swapOrderBattery.DownNominalEnergy; decimal? downNominalEnergy = swapOrderBattery.DownBatterySoc * swapOrderBattery.DownNominalEnergy;
// 电量费用 // 电量费用
decimal? electricCharge = (upNominalEnergy - downNominalEnergy) * electricityTotalFee; decimal? electricCharge = (upNominalEnergy - downNominalEnergy) * electricityTotalFee;
@ -101,18 +102,14 @@ public class SwapOrderSettleAnAccountTask : ITask
updateSwapOrderBatteryList.Add(swapOrderBattery); updateSwapOrderBatteryList.Add(swapOrderBattery);
updateSwapOrderList.Add(matchingOrder); updateSwapOrderList.Add(matchingOrder);
} }
} }
} }
if (updateSwapOrderBatteryList.Count>0) if (updateSwapOrderList.Count > 0 && updateSwapOrderBatteryList.Count>0)
{
SwapOrderBatteryRepository.Update(updateSwapOrderBatteryList);
}
if (updateSwapOrderList.Count>0)
{ {
SwapOrderRepository.Update(updateSwapOrderList); SwapOrderRepository.Update(updateSwapOrderList);
SwapOrderBatteryRepository.Update(updateSwapOrderBatteryList);
} }
} }

Loading…
Cancel
Save