去除日志分割线,看着眼花
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||||
|
{
|
||||||
|
public class CTUUnloadConfirmInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -149,7 +149,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
[HttpPost, NonUnify, AllowAnonymous]
|
[HttpPost, NonUnify, AllowAnonymous]
|
||||||
public async Task<Result> UnloadConfirm(ConfirmInput input)//
|
public async Task<Result> UnloadConfirm(ConfirmInput input)//
|
||||||
{
|
{
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
Logger.Information("放货确认..................");
|
Logger.Information("放货确认..................");
|
||||||
Logger.Information($"输入参数:{JsonConvert.SerializeObject(input)}");
|
Logger.Information($"输入参数:{JsonConvert.SerializeObject(input)}");
|
||||||
try
|
try
|
||||||
@@ -223,7 +222,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!");
|
return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!");
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -233,7 +231,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
[HttpPost, NonUnify, AllowAnonymous]
|
[HttpPost, NonUnify, AllowAnonymous]
|
||||||
public async Task<Result> TaskChainCallBack(TaskChainCallBackInput input)
|
public async Task<Result> TaskChainCallBack(TaskChainCallBackInput input)
|
||||||
{
|
{
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -298,7 +295,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
return await ToApiResult(HttpStatusCode.InternalServerError, "请重试!");
|
return await ToApiResult(HttpStatusCode.InternalServerError, "请重试!");
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||||
|
|
||||||
|
|
||||||
@@ -312,7 +308,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
[HttpPost, NonUnify, AllowAnonymous]
|
[HttpPost, NonUnify, AllowAnonymous]
|
||||||
public async Task<Result> TaskCallback(TaskCallBackInput input)
|
public async Task<Result> TaskCallback(TaskCallBackInput input)
|
||||||
{
|
{
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
|
|
||||||
Logger.Information($"任务状态上报->接收参数:{JsonConvert.SerializeObject(input)}");
|
Logger.Information($"任务状态上报->接收参数:{JsonConvert.SerializeObject(input)}");
|
||||||
try
|
try
|
||||||
@@ -373,7 +368,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
_ = InvokeGenPretaskExcute();
|
_ = InvokeGenPretaskExcute();
|
||||||
}
|
}
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -464,5 +458,26 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// CTU放货申请
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost, NonUnify, AllowAnonymous]
|
||||||
|
public Task<Result> CTUUnloadConfirm(ConfirmInput input)
|
||||||
|
{
|
||||||
|
var data = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data = "允许放货";
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
data = "不允许放货";
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
return ToApiResult(HttpStatusCode.OK, data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
private readonly IElevatorControlService _elevatorControlService;
|
private readonly IElevatorControlService _elevatorControlService;
|
||||||
private static readonly Dictionary<string, int> _elevatorAgvCtlStatusMap = new(StringComparer.OrdinalIgnoreCase);
|
private static readonly Dictionary<string, int> _elevatorAgvCtlStatusMap = new(StringComparer.OrdinalIgnoreCase);
|
||||||
private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build<ElevatorControlConfiguration>();
|
private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build<ElevatorControlConfiguration>();
|
||||||
|
private static Dictionary<string, object> locMap = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
|
||||||
public Func<string, int, Task> AddUnExecuteTask { get; set; }
|
public Func<string, int, Task> AddUnExecuteTask { get; set; }
|
||||||
|
|
||||||
public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService,
|
public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService,
|
||||||
@@ -215,6 +216,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
List<WmsCarryH> items = await cyDb.Queryable<WmsCarryH>().LeftJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
List<WmsCarryH> items = await cyDb.Queryable<WmsCarryH>().LeftJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
||||||
.LeftJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
.LeftJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
||||||
.Where(whereExpr)
|
.Where(whereExpr)
|
||||||
|
//.OrderByIF((a,b,c)=>SqlFunc.IsNullOrEmpty())
|
||||||
.OrderBy(policy.policy)
|
.OrderBy(policy.policy)
|
||||||
.Select<WmsCarryH>()
|
.Select<WmsCarryH>()
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
@@ -318,8 +320,11 @@ namespace Tnb.WarehouseMgr
|
|||||||
|
|
||||||
if (areaPreTasks.Any(x => x.third_eqp_type.ToEnum<EnumTaskChainType>() != EnumTaskChainType.CTU))
|
if (areaPreTasks.Any(x => x.third_eqp_type.ToEnum<EnumTaskChainType>() != EnumTaskChainType.CTU))
|
||||||
{
|
{
|
||||||
foreach (var x in items)
|
Logger.Information("非CTU任务链生成");
|
||||||
|
for (int i = 0; i < items.Count; i++)
|
||||||
{
|
{
|
||||||
|
var num = (i + 1);
|
||||||
|
var x = items[i];
|
||||||
string groupCode = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_TASK_EXECUTE_ENCODE).Result;
|
string groupCode = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_TASK_EXECUTE_ENCODE).Result;
|
||||||
x.is_chain = 0;
|
x.is_chain = 0;
|
||||||
x.groups = groupCode;
|
x.groups = groupCode;
|
||||||
@@ -328,6 +333,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
else if ((moveNum >= areaPreTasks.Count && areaPreTasks.Count > 1) || moveNum <= areaPreTasks.Count)
|
else if ((moveNum >= areaPreTasks.Count && areaPreTasks.Count > 1) || moveNum <= areaPreTasks.Count)
|
||||||
{
|
{
|
||||||
|
Logger.Information("CTU任务链生成");
|
||||||
|
|
||||||
string groupCode = await _billRullService.GetBillNumber(WmsWareHouseConst.WMS_TASK_EXECUTE_ENCODE);
|
string groupCode = await _billRullService.GetBillNumber(WmsWareHouseConst.WMS_TASK_EXECUTE_ENCODE);
|
||||||
items.ForEach(x => x.is_chain = 1);
|
items.ForEach(x => x.is_chain = 1);
|
||||||
|
|
||||||
@@ -445,15 +452,16 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
await ExecuteTargetFloorTask(elevatorTask);
|
await ExecuteTargetFloorTask(elevatorTask);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
////调用AGV创建任务链接口
|
////调用AGV创建任务链接口
|
||||||
List<WmsDistaskH> agvTasks = disTasks.Where(it => !it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList();
|
List<WmsDistaskH> agvTasks = disTasks.Where(it => !it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
if (agvTasks?.Count > 0)
|
if (agvTasks?.Count > 0)
|
||||||
{
|
{
|
||||||
|
Logger.Information($"Agv任务数量:{agvTasks.Count},taskCodes:{string.Join(",", agvTasks.Select(x => x.bill_code).Distinct())}");
|
||||||
await AgvDispatch(agvTasks, agvCts.Token);
|
await AgvDispatch(agvTasks, agvCts.Token);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -481,7 +489,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task CallingLanding(List<(string endlocation_code, string device_id, string id, int floorNO)> endLocCodes)
|
private async Task CallingLanding(List<(string endlocation_code, string device_id, string id, int floorNO)> endLocCodes)
|
||||||
{
|
{
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
Logger.Information($" 开始呼梯操作.............");
|
Logger.Information($" 开始呼梯操作.............");
|
||||||
Logger.Information($"电梯信息:{JsonConvert.SerializeObject(s_elevatorMap)}");
|
Logger.Information($"电梯信息:{JsonConvert.SerializeObject(s_elevatorMap)}");
|
||||||
try
|
try
|
||||||
@@ -559,7 +566,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
Logger.Error($"呼梯操作错误堆栈跟踪:{Environment.NewLine}{ex.StackTrace}");
|
Logger.Error($"呼梯操作错误堆栈跟踪:{Environment.NewLine}{ex.StackTrace}");
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -569,7 +575,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task ExecuteTargetFloorTask(WmsDistaskH disTask)
|
private async Task ExecuteTargetFloorTask(WmsDistaskH disTask)
|
||||||
{
|
{
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
//收到放货确认通知,向电梯发送到3楼的指令
|
//收到放货确认通知,向电梯发送到3楼的指令
|
||||||
Logger.Information($"开始执行电梯任务,任务ID:{disTask.id}");
|
Logger.Information($"开始执行电梯任务,任务ID:{disTask.id}");
|
||||||
try
|
try
|
||||||
@@ -648,7 +653,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
Logger.Error("执行到目标楼层电梯任务失败", ex);
|
Logger.Error("执行到目标楼层电梯任务失败", ex);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
Logger.Information("--------------------------------------------------------");
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Agv调度
|
/// Agv调度
|
||||||
@@ -1167,6 +1171,10 @@ namespace Tnb.WarehouseMgr
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region dijkstra
|
#region dijkstra
|
||||||
|
List<WmsPointH> results = new();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
List<WmsPointH>? points = await _db.Queryable<WmsPointH>().ToListAsync();
|
List<WmsPointH>? points = await _db.Queryable<WmsPointH>().ToListAsync();
|
||||||
WmsPointH? startObj = points.Find(x => x.id == pStartId);
|
WmsPointH? startObj = points.Find(x => x.id == pStartId);
|
||||||
WmsPointH? endObj = points.Find(x => x.id == pEndId);
|
WmsPointH? endObj = points.Find(x => x.id == pEndId);
|
||||||
@@ -1189,6 +1197,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
|
|
||||||
Dijkstra pG = new(vexs, edges);
|
Dijkstra pG = new(vexs, edges);
|
||||||
|
|
||||||
|
|
||||||
int[] prev = new int[pG.mVexs.Length];
|
int[] prev = new int[pG.mVexs.Length];
|
||||||
int[] dist = new int[pG.mVexs.Length];
|
int[] dist = new int[pG.mVexs.Length];
|
||||||
List<WmsPointH> vertexs = new() { startObj };
|
List<WmsPointH> vertexs = new() { startObj };
|
||||||
@@ -1197,7 +1207,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
Stack<string> result = new();
|
Stack<string> result = new();
|
||||||
GetPoints(pointIds, prev, result, eIndex);
|
GetPoints(pointIds, prev, result, eIndex);
|
||||||
|
|
||||||
List<WmsPointH> results = new() { startObj };
|
results = new() { startObj };
|
||||||
if (points?.Count > 0)
|
if (points?.Count > 0)
|
||||||
{
|
{
|
||||||
//points.Where(it => result.Contains(it.id));
|
//points.Where(it => result.Contains(it.id));
|
||||||
@@ -1210,6 +1220,12 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Error("路径算法错误", ex);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Threading.Channels;
|
using System.Threading.Channels;
|
||||||
|
using Aop.Api.Domain;
|
||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
using JNPF.Common.Dtos.VisualDev;
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
@@ -12,6 +13,8 @@ using JNPF.VisualDev.Entitys;
|
|||||||
using JNPF.VisualDev.Interfaces;
|
using JNPF.VisualDev.Interfaces;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using NPOI.SS.Formula.PTG;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.WarehouseMgr.Entities;
|
using Tnb.WarehouseMgr.Entities;
|
||||||
@@ -79,6 +82,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
WmsCarryH carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.data[nameof(WmsCarryD.carry_id)].ToString());
|
WmsCarryH carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.data[nameof(WmsCarryD.carry_id)].ToString());
|
||||||
BasLocation loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == endLocations[0].id);
|
BasLocation loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == endLocations[0].id);
|
||||||
|
Logger.Information($"loc.location_code={loc?.location_code}");
|
||||||
bool isMatch = await IsCarryAndLocationMatchByCarryStd(carry, loc);
|
bool isMatch = await IsCarryAndLocationMatchByCarryStd(carry, loc);
|
||||||
if (!isMatch)
|
if (!isMatch)
|
||||||
{
|
{
|
||||||
@@ -92,8 +96,10 @@ namespace Tnb.WarehouseMgr
|
|||||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYINSTOCK_ID, true);
|
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYINSTOCK_ID, true);
|
||||||
await _runService.Create(templateEntity, input);
|
await _runService.Create(templateEntity, input);
|
||||||
|
|
||||||
|
|
||||||
if (sPoint != null && ePoint != null)
|
if (sPoint != null && ePoint != null)
|
||||||
{
|
{
|
||||||
|
Logger.Information($"sPoint.id={sPoint.id},ePoint.id={ePoint.id}");
|
||||||
List<WmsPointH> points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
List<WmsPointH> points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
||||||
if (points.Count <= 2)
|
if (points.Count <= 2)
|
||||||
{
|
{
|
||||||
@@ -123,21 +129,24 @@ namespace Tnb.WarehouseMgr
|
|||||||
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
|
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
|
||||||
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
|
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
|
||||||
biz_type = WmsWareHouseConst.BIZTYPE_WMSEMPTYINSTOCK_ID,
|
biz_type = WmsWareHouseConst.BIZTYPE_WMSEMPTYINSTOCK_ID,
|
||||||
task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID
|
task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID,
|
||||||
|
carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!,
|
||||||
|
carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!,
|
||||||
|
area_id = sPoint?.area_id!,
|
||||||
|
area_code = it.Key,
|
||||||
|
require_id = input.data["ReturnIdentity"].ToString(),
|
||||||
|
require_code = input.data[nameof(preTask.bill_code)]?.ToString()!,
|
||||||
|
create_id = _userManager.UserId,
|
||||||
|
create_time = DateTime.Now,
|
||||||
};
|
};
|
||||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
|
||||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
|
||||||
preTask.area_id = sPoint?.area_id!;
|
|
||||||
preTask.area_code = it.Key;
|
|
||||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
|
||||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
|
||||||
preTask.create_id = _userManager.UserId;
|
|
||||||
preTask.create_time = DateTime.Now;
|
|
||||||
return preTask;
|
return preTask;
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
bool isOk = await _wareHouseService.GenPreTask(preTasks, null!);
|
bool isOk = await _wareHouseService.GenPreTask(preTasks, null!);
|
||||||
if (isOk)
|
if (isOk)
|
||||||
{
|
{
|
||||||
|
|
||||||
GenPreTaskUpInput preTaskUpInput = new()
|
GenPreTaskUpInput preTaskUpInput = new()
|
||||||
{
|
{
|
||||||
RquireId = input.data["ReturnIdentity"].ToString()!,
|
RquireId = input.data["ReturnIdentity"].ToString()!,
|
||||||
@@ -167,6 +176,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
//根据空载具入库Id,回更单据状态
|
//根据空载具入库Id,回更单据状态
|
||||||
_ = await _db.Updateable<WmsEmptyInstock>().SetColumns(it => new WmsEmptyInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
_ = await _db.Updateable<WmsEmptyInstock>().SetColumns(it => new WmsEmptyInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
|
||||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||||
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
it => new WmsCarryH { is_lock = 1, location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||||
it => new BasLocation { is_lock = 1 });
|
it => new BasLocation { is_lock = 1 });
|
||||||
@@ -186,8 +196,9 @@ namespace Tnb.WarehouseMgr
|
|||||||
|
|
||||||
await _db.Ado.CommitTranAsync();
|
await _db.Ado.CommitTranAsync();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Logger.Error("空载具入库失败", ex);
|
||||||
await _db.Ado.RollbackTranAsync();
|
await _db.Ado.RollbackTranAsync();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,14 +72,15 @@ namespace Tnb.WarehouseMgr
|
|||||||
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/
|
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);*/
|
||||||
//判断目标库位是否自动签收
|
//判断目标库位是否自动签收
|
||||||
BasLocation loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
|
BasLocation loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||||
|
|
||||||
//出库取起点,获取所有符合输入的载具规格的载具
|
//出库取起点,获取所有符合输入的载具规格的载具
|
||||||
OutStockStrategyQuery OutStockStrategyInput = new()
|
OutStockStrategyQuery OutStockStrategyInput = new()
|
||||||
{
|
{
|
||||||
carrystd_id = input.data[nameof(OutStockStrategyQuery.carrystd_id)].ToString(),
|
carrystd_id = input.data[nameof(OutStockStrategyQuery.carrystd_id)].ToString(),
|
||||||
warehouse_id = input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString(),
|
warehouse_id = input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString(),
|
||||||
|
|
||||||
};
|
};
|
||||||
List<WmsCarryH>? carrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
|
List<WmsCarryH>? carrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
|
||||||
|
Logger.Information($"根据出库策略获取的载具数量:{carrys?.Count}");
|
||||||
//var carrys = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
|
//var carrys = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
|
||||||
// .Where((a, b) => a.carrystd_id == input.data[nameof(WmsEmptyOutstockH.carrystd_id)].ToString()
|
// .Where((a, b) => a.carrystd_id == input.data[nameof(WmsEmptyOutstockH.carrystd_id)].ToString()
|
||||||
// && a.carry_status == ((int)EnumCarryStatus.空闲).ToString() && a.is_lock == 0 && b.is_lock == 0 && b.is_type == ((int)EnumLocationType.存储库位).ToString())
|
// && a.carry_status == ((int)EnumCarryStatus.空闲).ToString() && a.is_lock == 0 && b.is_lock == 0 && b.is_type == ((int)EnumLocationType.存储库位).ToString())
|
||||||
@@ -100,7 +101,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WmsEmptyOutstockH setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
|
|
||||||
WmsPointH? sPoint = null;
|
WmsPointH? sPoint = null;
|
||||||
WmsPointH? ePoint = null;
|
WmsPointH? ePoint = null;
|
||||||
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
|
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
|
||||||
@@ -110,7 +110,11 @@ namespace Tnb.WarehouseMgr
|
|||||||
//根据每个载具的起始库位做路径运算
|
//根据每个载具的起始库位做路径运算
|
||||||
if (carrys?.Count > 0)
|
if (carrys?.Count > 0)
|
||||||
{
|
{
|
||||||
|
WmsEmptyOutstockH setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
|
||||||
|
|
||||||
int min = (carrys.Count > setQty.qty) ? setQty.qty : carrys.Count;
|
int min = (carrys.Count > setQty.qty) ? setQty.qty : carrys.Count;
|
||||||
|
Logger.Information($"min={min}");
|
||||||
|
|
||||||
for (int i = 0; i < min; i++)
|
for (int i = 0; i < min; i++)
|
||||||
{
|
{
|
||||||
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carrys[i].location_id);
|
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carrys[i].location_id);
|
||||||
@@ -162,6 +166,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
}).ToList();
|
}).ToList();
|
||||||
//更新页面
|
//更新页面
|
||||||
//赋值签收状态
|
//赋值签收状态
|
||||||
|
Logger.Information($"空载具出库生成的预任务数量:{preTasks.Count}");
|
||||||
if (loc.is_sign == 0)
|
if (loc.is_sign == 0)
|
||||||
{
|
{
|
||||||
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
|
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
|
||||||
|
|||||||
Reference in New Issue
Block a user