换电小步

master
lxw 1 month ago
parent b466d8c677
commit 02c57fb650

@ -54,12 +54,8 @@ public class CommonMgr
machine.StepModel[stepModel.StepNo.ToString()] = stepModel; machine.StepModel[stepModel.StepNo.ToString()] = stepModel;
if (machine.SwapOrder != null) _swapOrderStepService.InsertSwapStepForSwapMain(step, machine.StepSort++, machine.SwapOrder!.Sn,
{ desc, param, type);
if (!string.IsNullOrEmpty(machine.SwapOrder.Sn))
_swapOrderStepService.InsertSwapStepForSwapMain(step, machine.StepSort++, machine.SwapOrder.Sn,
desc, param, type);
}
} }
@ -189,11 +185,12 @@ public class CommonMgr
InBin(orderBatteryInfo, machine); InBin(orderBatteryInfo, machine);
_log.Info($"InBin orderBatteryInfo={JsonConvert.SerializeObject(orderBatteryInfo)}"); _log.Info($"InBin orderBatteryInfo={JsonConvert.SerializeObject(orderBatteryInfo)}");
if (orderBatteryInfo.CanSwap != InfoEnum.SelectBinStatusInfo.Success) if (orderBatteryInfo.CanSwap != InfoEnum.SelectBinStatusInfo.Success)
{ {
return orderBatteryInfo; return orderBatteryInfo;
} }
//手动选包 //手动选包
ManualSelectPack(machine, orderBatteryInfo); ManualSelectPack(machine, orderBatteryInfo);
@ -212,7 +209,7 @@ public class CommonMgr
orderBatteryInfo.InBinInfo.Soh = carInfoBatteryInfos[0].Soh; orderBatteryInfo.InBinInfo.Soh = carInfoBatteryInfos[0].Soh;
} }
} }
return orderBatteryInfo; return orderBatteryInfo;
} }
@ -292,12 +289,11 @@ public class CommonMgr
public void InBin(SwapOrderBatteryInfo orderBatteryInfo, SwappingStateMachine machine) public void InBin(SwapOrderBatteryInfo orderBatteryInfo, SwappingStateMachine machine)
{ {
orderBatteryInfo.CanSwap = InfoEnum.SelectBinStatusInfo.WaitSelectDownBin; orderBatteryInfo.CanSwap = InfoEnum.SelectBinStatusInfo.WaitSelectDownBin;
SelectPackDto selectPackDto= _binInfoRepository.SelectPackInBin(); SelectPackDto selectPackDto = _binInfoRepository.SelectPackInBin();
orderBatteryInfo.CanDownBin = selectPackDto.CanSwapBinInfo; orderBatteryInfo.CanDownBin = selectPackDto.CanSwapBinInfo;
orderBatteryInfo.InBinInfo = selectPackDto.BinInfo; orderBatteryInfo.InBinInfo = selectPackDto.BinInfo;
orderBatteryInfo.CanSwap = selectPackDto.Info; orderBatteryInfo.CanSwap = selectPackDto.Info;
} }
@ -328,9 +324,8 @@ public class CommonMgr
if (binInfo != null) if (binInfo != null)
{ {
orderBatteryInfo.CanSwap =InfoEnum.SelectBinStatusInfo.WaitSelectDownBin; orderBatteryInfo.CanSwap = InfoEnum.SelectBinStatusInfo.WaitSelectDownBin;
orderBatteryInfo.UpBinInfo = binInfo; orderBatteryInfo.UpBinInfo = binInfo;
} }
} }
@ -341,12 +336,10 @@ public class CommonMgr
if (binInfo != null) if (binInfo != null)
{ {
orderBatteryInfo.CanSwap =InfoEnum.SelectBinStatusInfo.Success; orderBatteryInfo.CanSwap = InfoEnum.SelectBinStatusInfo.Success;
orderBatteryInfo.InBinInfo = binInfo; orderBatteryInfo.InBinInfo = binInfo;
} }
} }
} }
/// <summary> /// <summary>
@ -367,9 +360,9 @@ public class CommonMgr
/// <param name="machine"></param> /// <param name="machine"></param>
public void UpdateSwapOrder(SwappingStateMachine machine) public void UpdateSwapOrder(SwappingStateMachine machine)
{ {
_swapOrderRepository.Update(BuildParamForSwap(machine)); _swapOrderRepository.Update(BuildParamForSwap(machine));
} }
//赋值换电相关的数据,防止更新掉其他任务插入的数据 //赋值换电相关的数据,防止更新掉其他任务插入的数据
private SwapOrder BuildParamForSwap(SwappingStateMachine machine) private SwapOrder BuildParamForSwap(SwappingStateMachine machine)
{ {
@ -418,7 +411,7 @@ public class CommonMgr
i => new BinInfo() i => new BinInfo()
{ {
BatteryEnterSeq = inBinInfo.BatteryEnterSeq, BatteryEnterSeq = inBinInfo.BatteryEnterSeq,
InTime=inBinInfo.InTime InTime = inBinInfo.InTime
}, },
it => it.Id == inBinInfo.Id); it => it.Id == inBinInfo.Id);
var upBinInfo = machineSwapOrderBatteryInfo.UpBinInfo; var upBinInfo = machineSwapOrderBatteryInfo.UpBinInfo;
@ -429,11 +422,10 @@ public class CommonMgr
i => new BinInfo() i => new BinInfo()
{ {
Soc = -1, Soc = -1,
Soe= -1, Soe = -1,
BatteryNo="-1" BatteryNo = "-1"
}, },
it => it.Id == upBinInfo.Id); it => it.Id == upBinInfo.Id);
} }
} }

@ -92,7 +92,7 @@ public class SwapOrderStepService : BaseServices<SwapOrderStep>
/// <summary> /// <summary>
/// 换电小步新增---换电主流程 /// 换电小步新增---换电主流程
/// </summary> /// </summary>
public void InsertSwapStepForSwapMain(InfoEnum.BusinessSwappingStep step, int sort, String swapOrderSn, public void InsertSwapStepForSwapMain(InfoEnum.BusinessSwappingStep step, int sort, String? swapOrderSn,
string desc="" ,string param=null,int type=(int)SwapConstant.StepType.AUTO) string desc="" ,string param=null,int type=(int)SwapConstant.StepType.AUTO)
{ {
SwapOrderStep swapOrderStep = new () SwapOrderStep swapOrderStep = new ()

Loading…
Cancel
Save