|
|
|
@ -73,27 +73,27 @@ public class CommonMgr
|
|
|
|
|
{
|
|
|
|
|
List<BinInfo> upBin = machine.SwapOrderBatteryInfo.UpBinInfo;
|
|
|
|
|
List<BinInfo> inBin = machine.SwapOrderBatteryInfo.InBinInfo;
|
|
|
|
|
|
|
|
|
|
List<SwapOrderBattery> swapOrderBatteryList = new List<SwapOrderBattery>();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < upBin.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
SwapOrderBattery swapOrderBattery = new SwapOrderBattery()
|
|
|
|
|
{
|
|
|
|
|
SwapOrderSn = machine.SwapOrder.Sn,
|
|
|
|
|
UpBatterySoc = upBin[i].Soc,
|
|
|
|
|
UpBatteryNo = upBin[i].BatteryNo,
|
|
|
|
|
UpBatterySoe = upBin[i].Soe,
|
|
|
|
|
UpBatteryBinNo = int.Parse(upBin[i].No),
|
|
|
|
|
DownBatteryBinNo = int.Parse(inBin[i].No),
|
|
|
|
|
DownBatteryNo = inBin[i].BatteryNo,
|
|
|
|
|
DownBatterySoc = inBin[i].Soc,
|
|
|
|
|
DownBatterySoe = inBin[i].Soe,
|
|
|
|
|
CreatedTime = DateTime.Now
|
|
|
|
|
};
|
|
|
|
|
SwapOrderBattery swapOrderBattery = new SwapOrderBattery();
|
|
|
|
|
|
|
|
|
|
swapOrderBattery.SwapOrderSn = machine.SwapOrder.Sn;
|
|
|
|
|
swapOrderBattery.UpBatterySoc = upBin[i].Soc;
|
|
|
|
|
swapOrderBattery.UpBatteryNo = upBin[i].BatteryNo;
|
|
|
|
|
swapOrderBattery.UpBatterySoe = upBin[i].Soe;
|
|
|
|
|
swapOrderBattery.UpBatteryBinNo = int.Parse(upBin[i].No);
|
|
|
|
|
|
|
|
|
|
swapOrderBattery.DownBatteryBinNo = int.Parse(inBin[i].No);
|
|
|
|
|
swapOrderBattery.DownBatteryNo = "-1"; //inBin[i].BatteryNo;
|
|
|
|
|
swapOrderBattery.DownBatterySoc = -1; //inBin[i].Soc;
|
|
|
|
|
swapOrderBattery.DownBatterySoe = -1; //inBin[i].Soe;
|
|
|
|
|
swapOrderBattery.CreatedTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
swapOrderBatteryList.Add(swapOrderBattery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_swapOrderBatteryRepository.Insert(swapOrderBatteryList);
|
|
|
|
|
}
|
|
|
|
@ -176,7 +176,8 @@ public class CommonMgr
|
|
|
|
|
|
|
|
|
|
return orderBatteryInfo;
|
|
|
|
|
}
|
|
|
|
|
orderBatteryInfo.UpBinInfo=new List<BinInfo> { UpBin , UpBin2 };
|
|
|
|
|
|
|
|
|
|
orderBatteryInfo.UpBinInfo = new List<BinInfo> { UpBin, UpBin2 };
|
|
|
|
|
|
|
|
|
|
InBin(orderBatteryInfo, machine);
|
|
|
|
|
return orderBatteryInfo;
|
|
|
|
@ -191,15 +192,15 @@ public class CommonMgr
|
|
|
|
|
{
|
|
|
|
|
SelectPackDto selectPack =
|
|
|
|
|
_binInfoRepository.SelectPack(StaticStationInfo.SwapSoc, StaticStationInfo.SwapFinishChargeTime,
|
|
|
|
|
QueryMoveBinNo()[0],BatteryGroupRepository);
|
|
|
|
|
QueryMoveBinNo()[0], BatteryGroupRepository);
|
|
|
|
|
|
|
|
|
|
if (selectPack != null)
|
|
|
|
|
if (selectPack != null && selectPack.BinInfo != null)
|
|
|
|
|
{
|
|
|
|
|
//第二块电池信息去第一块电池编号+10
|
|
|
|
|
int no = Convert.ToInt32(selectPack.BinInfo.No) + 10;
|
|
|
|
|
BinInfo UpBin2 = _binInfoRepository.QueryByClause(i => i.No == no.ToString());
|
|
|
|
|
BinInfo UpBin = _binInfoRepository.QueryByClause(i => i.No == no.ToString());
|
|
|
|
|
|
|
|
|
|
orderBatteryInfo.UpBinInfo = new List<BinInfo>() { selectPack.BinInfo, UpBin2 };
|
|
|
|
|
orderBatteryInfo.UpBinInfo = new List<BinInfo>() { selectPack.BinInfo, UpBin };
|
|
|
|
|
orderBatteryInfo.CanSwap = selectPack.Info;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -248,6 +249,7 @@ public class CommonMgr
|
|
|
|
|
{
|
|
|
|
|
list = list.Where(i => i.No != value).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (list.Count <= 0)
|
|
|
|
|
{
|
|
|
|
|
orderBatteryInfo.CanSwap = InfoEnum.SelectBinStatusInfo.LessOfEmptyBin;
|
|
|
|
@ -256,9 +258,9 @@ public class CommonMgr
|
|
|
|
|
|
|
|
|
|
//第二块电池信息去第一块电池编号+10
|
|
|
|
|
int no = Convert.ToInt32(list[0].No) + 10;
|
|
|
|
|
BinInfo UpBin2 = _binInfoRepository.QueryByClause(i => i.No == no.ToString());
|
|
|
|
|
BinInfo UpBin = _binInfoRepository.QueryByClause(i => i.No == no.ToString());
|
|
|
|
|
|
|
|
|
|
orderBatteryInfo.InBinInfo = new List<BinInfo>() { list[0], UpBin2 };
|
|
|
|
|
orderBatteryInfo.InBinInfo = new List<BinInfo>() { list[0], UpBin };
|
|
|
|
|
|
|
|
|
|
orderBatteryInfo.CanSwap = InfoEnum.SelectBinStatusInfo.Success;
|
|
|
|
|
}
|
|
|
|
|