半自动换电

master
lxw 2 months ago
parent a17b8c3d68
commit 00a0f3585a

@ -33,6 +33,9 @@ public class CommonMgr
public MoveBinRecordRepository MoveBinRecordRepository { get; set; }
public SwapOrderStepRepository SwapOrderStepRepository { get; set; }
/// <summary>
/// 新增小步状态
/// </summary>
@ -88,6 +91,7 @@ public class CommonMgr
UpBatterySoc = upBin.Soc,
UpBatteryNo = upBin.BatteryNo,
UpBatterySoe = upBin.Soe,
//TODO::添加 换上电池的容量
UpBatteryBinNo = int.Parse(upBin.No),
UpNominalEnergy = upBin.NominalEnergy,
DownBatteryBinNo = int.Parse(inBin.No),
@ -100,6 +104,15 @@ public class CommonMgr
_swapOrderBatteryRepository.Insert(swapOrderBattery);
}
//查询是否有手动操作
public bool QueryHasManual(String swapOrderSn)
{
return SwapOrderStepRepository.GetCount(i =>
i.SwapOrderSn == swapOrderSn && i.StepType == (int)SwapConstant.StepType.MANUAL) > 0;
}
/// <summary>
/// 1.锁仓
/// 2.更改预约单

@ -33,6 +33,15 @@ public class SwapDoneState : IState
machine.SwapOrder!.SwapResult = machine.SwapStatus;
machine.SwapOrder.SwapEndTime = DateTime.Now;
machine.SwapOrder.FailReason = machine.SwapFailReason;
//查询是否有手动操作数据
if (_CommonMgr.QueryHasManual(machine.SwapOrder.Sn))
{
//半自动
machine.SwapOrder.SwapWay = 2;
}
;
_CommonMgr.UpdateSwapOrder(machine);
////修改预约单

Loading…
Cancel
Save