添加入仓时间

master
lxw 5 months ago
parent 064cdef4f8
commit 36419e8b24

@ -165,7 +165,7 @@ namespace Entity.DbModel.Station
[SugarColumn(ColumnName = "status")] [SugarColumn(ColumnName = "status")]
public int? Status { get; set; } public int? Status { get; set; }
/// <summary> /// <summary>
/// Desc:最后结束充电时间 结束充电后更新 /// Desc:最后结束充电时间 结束充电后更新
/// Default: /// Default:
@ -174,7 +174,6 @@ namespace Entity.DbModel.Station
[SugarColumn(ColumnName = "last_charge_finish_time")] [SugarColumn(ColumnName = "last_charge_finish_time")]
public DateTime? LastChargeFinishTime { get; set; } public DateTime? LastChargeFinishTime { get; set; }
/// <summary> /// <summary>
/// 缓存仓标记 0:不是 1:是 /// 缓存仓标记 0:不是 1:是
@ -193,5 +192,12 @@ namespace Entity.DbModel.Station
/// </summary> /// </summary>
[SugarColumn(ColumnName = "can_charge_flag")] [SugarColumn(ColumnName = "can_charge_flag")]
public int? CanChargeFlag { get; set; } public int? CanChargeFlag { get; set; }
/// <summary>
/// 电池入仓时间
/// </summary>
[SugarColumn(ColumnName = "int_time")]
public DateTime? InTime { get; set; }
} }
} }

@ -21,7 +21,7 @@ public class CommonMgr
public BinInfoRepository _binInfoRepository { get; set; } public BinInfoRepository _binInfoRepository { get; set; }
public SwapAmtOrderRepository _amtOrderRepository { get; set; } public SwapAmtOrderRepository _amtOrderRepository { get; set; }
public SwapOrderBatteryRepository _swapOrderBatteryRepository { get; set; } public SwapOrderBatteryRepository _swapOrderBatteryRepository { get; set; }
public SwapOrderReportCloudRepository _swapOrderReportCloudRepository { get; set; } public SwapOrderReportCloudRepository _swapOrderReportCloudRepository { get; set; }
/// <summary> /// <summary>
@ -50,8 +50,8 @@ public class CommonMgr
swapOrder.SwapWay = (int)StationConstant.StationWay.Auto; swapOrder.SwapWay = (int)StationConstant.StationWay.Auto;
swapOrder.CloudReportStatus = 0; swapOrder.CloudReportStatus = 0;
swapOrder.SwapWay = 1; swapOrder.SwapWay = 1;
swapOrder.CreatedTime=DateTime.Now; swapOrder.CreatedTime = DateTime.Now;
_swapOrderRepository.Insert(swapOrder); _swapOrderRepository.Insert(swapOrder);
return swapOrder; return swapOrder;
} }
@ -69,7 +69,7 @@ public class CommonMgr
UpBatteryBinNo = int.Parse(UpBin.No), UpBatteryBinNo = int.Parse(UpBin.No),
DownBatteryBinNo = int.Parse(InBin.No), DownBatteryBinNo = int.Parse(InBin.No),
}; };
swapOrderBattery= _swapOrderBatteryRepository.Insert(swapOrderBattery); swapOrderBattery = _swapOrderBatteryRepository.Insert(swapOrderBattery);
} }
/// <summary> /// <summary>
@ -171,10 +171,10 @@ public class CommonMgr
{ {
List<BinInfo> list = List<BinInfo> list =
_binInfoRepository.QueryListByClause(i => _binInfoRepository.QueryListByClause(i =>
i.CacheBinFlag==0 && i.CacheBinFlag == 0 &&
i.Status == 1 && i.AmtLock == (int)InfoEnum.AmtBatLockStatus.UnLock i.Status == 1 && i.AmtLock == (int)InfoEnum.AmtBatLockStatus.UnLock
&& i.Exists == 0); && i.Exists == 0);
if (list.Count <= 0) if (list.Count <= 0)
{ {
orderBatteryInfo.CanSwap = InfoEnum.SelectBinStatusInfo.LessOfEmptyBin; orderBatteryInfo.CanSwap = InfoEnum.SelectBinStatusInfo.LessOfEmptyBin;
@ -205,7 +205,7 @@ public class CommonMgr
{ {
_swapOrderRepository.Update(machine.SwapOrder); _swapOrderRepository.Update(machine.SwapOrder);
} }
/// <summary> /// <summary>
/// 更新预约订单 /// 更新预约订单
/// </summary> /// </summary>
@ -230,21 +230,22 @@ public class CommonMgr
inBinInfo.Soe = -1; inBinInfo.Soe = -1;
inBinInfo.BatteryNo = "-1"; inBinInfo.BatteryNo = "-1";
//修改入仓顺序 //修改入仓顺序
BinInfo binInfo = _binInfoRepository.QueryListByClause(i=>i.BatteryEnterSeq!=null,"battery_enter_seq desc").First(); BinInfo binInfo = _binInfoRepository
.QueryListByClause(i => i.BatteryEnterSeq != null, "battery_enter_seq desc").First();
inBinInfo.BatteryEnterSeq = binInfo.BatteryEnterSeq + 1; inBinInfo.BatteryEnterSeq = binInfo.BatteryEnterSeq + 1;
inBinInfo.InTime = DateTime.Now;
_binInfoRepository.Update(inBinInfo); _binInfoRepository.Update(inBinInfo);
var upBinInfo = machineSwapOrderBatteryInfo.UpBinInfo; var upBinInfo = machineSwapOrderBatteryInfo.UpBinInfo;
upBinInfo.Soc = -1; upBinInfo.Soc = -1;
upBinInfo.Soe = -1; upBinInfo.Soe = -1;
upBinInfo.BatteryNo = "-1"; upBinInfo.BatteryNo = "-1";
_binInfoRepository.Update(upBinInfo); _binInfoRepository.Update(upBinInfo);
} }
} }
/// <summary> /// <summary>
/// 换电完成新增上报云平台记录 /// 换电完成新增上报云平台记录
/// </summary> /// </summary>
@ -260,5 +261,4 @@ public class CommonMgr
Vin = machineSwapOrder.VehicleVin Vin = machineSwapOrder.VehicleVin
}); });
} }
} }

@ -64,13 +64,6 @@ public class BatteryMoveTask : ITask
//查询人物状态 //查询人物状态
if (success.IsSuccess) if (success.IsSuccess)
{ {
bool readPlcTaskStatus9000 = false;
while (!readPlcTaskStatus9000)
{
Thread.Sleep(1000);
readPlcTaskStatus9000 = PlcMgr.ReadPlcTaskStatus() == 9000;
}
Log.Info($"execute BatteryMoveTask success from binNo ={binInfo.No}"); Log.Info($"execute BatteryMoveTask success from binNo ={binInfo.No}");
} }
} }

@ -32,7 +32,7 @@ public class MonitorService
var configBinInfo = var configBinInfo =
new MapperConfiguration(cfg => cfg.CreateMap<StepModel, SwappingStateInfoResp>().ReverseMap()); new MapperConfiguration(cfg => cfg.CreateMap<StepModel, SwappingStateInfoResp>().ReverseMap());
IMapper mapperBinInfo = configBinInfo.CreateMapper(); IMapper mapperBinInfo = configBinInfo.CreateMapper();
List<SwappingStateInfoResp> stateInfoList = List<SwappingStateInfoResp> stateInfoList =
mapperBinInfo.Map<List<SwappingStateInfoResp>>(StationSoftMgr.SwappingStateMachine.StepModel); mapperBinInfo.Map<List<SwappingStateInfoResp>>(StationSoftMgr.SwappingStateMachine.StepModel);
@ -198,9 +198,12 @@ public class MonitorService
putBin.Soc = removeBin.Soc; putBin.Soc = removeBin.Soc;
putBin.Soe = removeBin.Soe; putBin.Soe = removeBin.Soe;
putBin.Soh = removeBin.Soh; putBin.Soh = removeBin.Soh;
putBin.BatteryEnterSeq = removeBin.BatteryEnterSeq;
putBin.InTime = removeBin.InTime;
BinInfoRepository.Update(putBin); BinInfoRepository.Update(putBin);
} }
if (removeBin.CacheBinFlag == 1) if (removeBin.CacheBinFlag == 1)
{ {
removeBin.Exists = 0; removeBin.Exists = 0;
@ -208,12 +211,13 @@ public class MonitorService
removeBin.Soc = -1; removeBin.Soc = -1;
removeBin.Soe = -1; removeBin.Soe = -1;
removeBin.Soh = -1; removeBin.Soh = -1;
BinInfoRepository.Update(removeBin);
} }
return Result<bool>.Success(); removeBin.BatteryEnterSeq = 0;
BinInfoRepository.Update(removeBin);
return Result<bool>.Success();
} }

@ -41,4 +41,7 @@ CREATE TABLE `emeter_energy_change` (
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='电表小时'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='电表小时';
-- 添加换电类型 -- 添加换电类型
ALTER TABLE swap_order_report_cloud ADD `upload_time` datetime DEFAULT NULL COMMENT "上报时间" ; ALTER TABLE swap_order_report_cloud ADD `upload_time` datetime DEFAULT NULL COMMENT "上报时间" ;
-- 添加入仓时间
ALTER TABLE bin_info ADD `in_time` datetime DEFAULT NULL COMMENT "入仓时间" ;

Loading…
Cancel
Save