半自动换电

master
lxw 2 months ago
parent a17b8c3d68
commit 00a0f3585a

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

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

Loading…
Cancel
Save