|
|
|
@ -1,10 +1,14 @@
|
|
|
|
|
using Autofac;
|
|
|
|
|
using AutoMapper;
|
|
|
|
|
using Common.Util;
|
|
|
|
|
using Entity.Constant;
|
|
|
|
|
using Entity.DbModel.Station;
|
|
|
|
|
using Entity.Dto;
|
|
|
|
|
using HybirdFrameworkCore.Autofac;
|
|
|
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
|
using log4net;
|
|
|
|
|
using NewLife.Serialization;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Repository.Station;
|
|
|
|
|
using Service.Execute.Api;
|
|
|
|
|
using Service.Execute.Model;
|
|
|
|
@ -18,6 +22,7 @@ namespace Service.Execute.Utils;
|
|
|
|
|
[Scope("SingleInstance")]
|
|
|
|
|
public class CommonMgr
|
|
|
|
|
{
|
|
|
|
|
private static readonly ILog _log = LogManager.GetLogger(typeof(CommonMgr));
|
|
|
|
|
public SwapOrderStepService _swapOrderStepService { get; set; }
|
|
|
|
|
public SwapOrderRepository _swapOrderRepository { get; set; }
|
|
|
|
|
|
|
|
|
@ -125,13 +130,14 @@ public class CommonMgr
|
|
|
|
|
{
|
|
|
|
|
SwapOrderBatteryInfo orderBatteryInfo = new SwapOrderBatteryInfo();
|
|
|
|
|
UpBin(orderBatteryInfo);
|
|
|
|
|
_log.Info($"UpBin orderBatteryInfo={JsonConvert.SerializeObject(orderBatteryInfo)}");
|
|
|
|
|
if (orderBatteryInfo.CanSwap != InfoEnum.SelectBinStatusInfo.Success)
|
|
|
|
|
{
|
|
|
|
|
return orderBatteryInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InBin(orderBatteryInfo, machine);
|
|
|
|
|
|
|
|
|
|
_log.Info($"InBin orderBatteryInfo={JsonConvert.SerializeObject(orderBatteryInfo)}");
|
|
|
|
|
return orderBatteryInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -168,27 +174,28 @@ public class CommonMgr
|
|
|
|
|
{
|
|
|
|
|
SelectPackDto selectPack =
|
|
|
|
|
_binInfoRepository.SelectPack(StaticStationInfo.SwapSoc, StaticStationInfo.SwapFinishChargeTime,
|
|
|
|
|
queryMoveBinNo()[0]);
|
|
|
|
|
QueryMoveBinNo()[0]);
|
|
|
|
|
|
|
|
|
|
orderBatteryInfo.UpBinInfo = selectPack.BinInfo;
|
|
|
|
|
orderBatteryInfo.CanSwap = selectPack.Info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<string> queryMoveBinNo()
|
|
|
|
|
private List<string> QueryMoveBinNo()
|
|
|
|
|
{
|
|
|
|
|
string moveUp = "";
|
|
|
|
|
string moveIn = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//当前有移仓任务
|
|
|
|
|
if (PlcMgr.PlcClient.ReadTaskNo() == 2)
|
|
|
|
|
if (PlcMgr.PlcClient?.ReadTaskNo() == 2)
|
|
|
|
|
{
|
|
|
|
|
MoveBinRecord queryByClause = MoveBinRecordRepository.QueryByClause(i => i.Status == 0 || i.Status == 1,
|
|
|
|
|
i => i.CreatedTime,
|
|
|
|
|
OrderByType.Desc);
|
|
|
|
|
if (queryByClause != null)
|
|
|
|
|
{
|
|
|
|
|
moveUp = queryByClause.UpBinNo;
|
|
|
|
|
moveIn = queryByClause.InBinNo;
|
|
|
|
|
moveUp = queryByClause?.UpBinNo;
|
|
|
|
|
moveIn = queryByClause?.InBinNo;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -216,7 +223,7 @@ public class CommonMgr
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var value = queryMoveBinNo()[1];
|
|
|
|
|
var value = QueryMoveBinNo()[1];
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(value))
|
|
|
|
|
{
|
|
|
|
|
list = list.Where(i => i.No != value).ToList();
|
|
|
|
|