|
|
|
|
@@ -12,12 +12,15 @@ using Aspose.Cells;
|
|
|
|
|
using JNPF;
|
|
|
|
|
using JNPF.Common.Contracts;
|
|
|
|
|
using JNPF.Common.Core.Manager;
|
|
|
|
|
using JNPF.Common.Dtos.VisualDev;
|
|
|
|
|
using JNPF.Common.Enums;
|
|
|
|
|
using JNPF.Common.Extension;
|
|
|
|
|
using JNPF.Common.Manager;
|
|
|
|
|
using JNPF.Common.Security;
|
|
|
|
|
using JNPF.FriendlyException;
|
|
|
|
|
using JNPF.Systems.Interfaces.System;
|
|
|
|
|
using JNPF.VisualDev.Entitys;
|
|
|
|
|
using JNPF.VisualDev.Interfaces;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
@@ -48,6 +51,7 @@ using Tnb.WarehouseMgr.Entities.Dto.Queries;
|
|
|
|
|
using Tnb.WarehouseMgr.Entities.Entity;
|
|
|
|
|
using Tnb.WarehouseMgr.Entities.Enums;
|
|
|
|
|
using Tnb.WarehouseMgr.Interfaces;
|
|
|
|
|
using static NPOI.HSSF.Util.HSSFColor;
|
|
|
|
|
|
|
|
|
|
namespace Tnb.WarehouseMgr
|
|
|
|
|
{
|
|
|
|
|
@@ -68,6 +72,8 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
private static Dictionary<string, object> locMap = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
|
|
|
|
|
private readonly IConfiguration _configuration;
|
|
|
|
|
private readonly RedisData _redisData;
|
|
|
|
|
private readonly IVisualDevService _visualDevService;
|
|
|
|
|
private readonly IRunService _runService;
|
|
|
|
|
|
|
|
|
|
public static SemaphoreSlim s_floor2CreatePretask = new(1);
|
|
|
|
|
|
|
|
|
|
@@ -76,7 +82,9 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
|
|
|
|
|
public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService, RedisData redisData,
|
|
|
|
|
IBillRullService billRullService, IUserManager userManager, ICacheManager cacheManager, IElevatorControlService elevatorControlService,
|
|
|
|
|
IWmsCarryBindService wmsCarryBindService
|
|
|
|
|
IWmsCarryBindService wmsCarryBindService,
|
|
|
|
|
IRunService runService,
|
|
|
|
|
IVisualDevService visualDevService
|
|
|
|
|
//IConfiguration configuration
|
|
|
|
|
) : base(repository.AsSugarClient())
|
|
|
|
|
{
|
|
|
|
|
@@ -88,6 +96,8 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
_elevatorControlService = elevatorControlService;
|
|
|
|
|
_redisData = redisData;
|
|
|
|
|
_wmsCarryBindService = wmsCarryBindService;
|
|
|
|
|
_runService = runService;
|
|
|
|
|
_visualDevService = visualDevService;
|
|
|
|
|
//_configuration = configuration;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@@ -530,12 +540,14 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<bool> Floor2MechanicalComplete(WmsDistaskH disTask, string action)
|
|
|
|
|
{
|
|
|
|
|
List<string> rackAreaPoints = new List<string>();
|
|
|
|
|
// 二楼料架区点位
|
|
|
|
|
rackAreaPoints.Add("AS01");
|
|
|
|
|
rackAreaPoints.Add("AS02");
|
|
|
|
|
rackAreaPoints.Add("AX01");
|
|
|
|
|
rackAreaPoints.Add("AX02");
|
|
|
|
|
List<string> rackAreaPointsUp = new List<string>();
|
|
|
|
|
List<string> rackAreaPointsDown = new List<string>();
|
|
|
|
|
// 二楼上升降区料架区点位
|
|
|
|
|
rackAreaPointsUp.Add("AS01");
|
|
|
|
|
rackAreaPointsUp.Add("AS02");
|
|
|
|
|
// 二楼下升降区料架区点位
|
|
|
|
|
rackAreaPointsDown.Add("AX01");
|
|
|
|
|
rackAreaPointsDown.Add("AX02");
|
|
|
|
|
if (disTask.area_code == "E")
|
|
|
|
|
{
|
|
|
|
|
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】收到到货完成信号 传入参数: {disTask.bill_code} {action}");
|
|
|
|
|
@@ -544,7 +556,7 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
if (action == "UNLOAD")
|
|
|
|
|
{
|
|
|
|
|
// 去料架区放货
|
|
|
|
|
if (rackAreaPoints.Contains(disTask.endlocation_code))
|
|
|
|
|
if (rackAreaPointsUp.Contains(disTask.endlocation_code) || rackAreaPointsDown.Contains(disTask.endlocation_code))
|
|
|
|
|
{
|
|
|
|
|
ISugarQueryable<WmsMechanicalArmH> WmsMechanicalArmHs = db.Queryable<WmsMechanicalArmH>().Where(r => r.point_code == disTask.endpoint_code);
|
|
|
|
|
if (WmsMechanicalArmHs.Count() == 0)
|
|
|
|
|
@@ -561,7 +573,46 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
rackid = disTask.carry_id,
|
|
|
|
|
rackcode = disTask.carry_code
|
|
|
|
|
}).Where(r => r.id == target.id).ExecuteCommandAsync();
|
|
|
|
|
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】{disTask.bill_code} AGV已到货");
|
|
|
|
|
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】{disTask.bill_code} AGV已到货 {disTask.endpoint_code} 更新缓存表{target.id}");
|
|
|
|
|
|
|
|
|
|
// 下升降机写满托数量和送到信号
|
|
|
|
|
if (rackAreaPointsDown.Contains(disTask.endlocation_code))
|
|
|
|
|
{
|
|
|
|
|
int LXCount = db.Queryable<WmsCarryD>().Where(a => a.carry_id == disTask.carry_id).Count();
|
|
|
|
|
|
|
|
|
|
bool result = await Floor2UpDownMachinecode_SetTag($"下升降机满托{target.stackingposition}数量", LXCount.ToString());
|
|
|
|
|
Logger.LogInformation($@"【送满托到下升降区】设定下升降机满托{target.stackingposition}满托数量为 {LXCount} 结果为 {result}");
|
|
|
|
|
if (!result)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 尝试写入满托送到信号
|
|
|
|
|
bool result下升降机空托送到 = await Floor2UpDownMachinecode_SetTag($"下升降机满托{target.stackingposition}送到", "true");
|
|
|
|
|
Logger.LogInformation($@"【送满托到下升降区】回写 下升降机满托{target.stackingposition}送到 结果为{result下升降机空托送到}");
|
|
|
|
|
if (!result下升降机空托送到)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 绑定料架
|
|
|
|
|
await db.Updateable<WmsMechanicalArmH>().SetColumns(r => new WmsMechanicalArmH
|
|
|
|
|
{
|
|
|
|
|
mechanicalconfirm = 1,
|
|
|
|
|
maxnum = LXCount
|
|
|
|
|
}).Where(r => r.id == target.id).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
Logger.LogInformation($@"【送满托到下升降区】 料架{target.rackid}下的料箱开始生成预任务");
|
|
|
|
|
bool pretask_result = await Floor2EmptyCarryCreateZZCPretask(disTask.carry_id);
|
|
|
|
|
if (pretask_result)
|
|
|
|
|
{
|
|
|
|
|
Logger.LogInformation($@"【送满托到下升降区】 料架{target.rackid}下的料箱生成预任务完成");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Logger.LogInformation($@"【送满托到下升降区】 料架{target.rackid}下的料箱生成预任务失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else // 去暂存仓放货
|
|
|
|
|
{
|
|
|
|
|
@@ -581,7 +632,7 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// 去暂存仓取货
|
|
|
|
|
if (rackAreaPoints.Contains(disTask.endlocation_code))
|
|
|
|
|
if (rackAreaPointsUp.Contains(disTask.endlocation_code) || rackAreaPointsDown.Contains(disTask.endlocation_code))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】{disTask.bill_code} AGV在暂存仓取货完成");
|
|
|
|
|
@@ -1150,7 +1201,7 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
}
|
|
|
|
|
await db.Ado.CommitTranAsync();
|
|
|
|
|
//判断
|
|
|
|
|
Logger.Information($"【CTUTaskExecute】 判断单据状态(status)是否为26126851525157 {JsonConvert.SerializeObject(DistaskHs)}");
|
|
|
|
|
Logger.Information($"【CTUTaskExecute】 判断单据状态(status)是否为待执行 {JsonConvert.SerializeObject(DistaskHs)}");
|
|
|
|
|
if (DistaskHs.Where(p => p.status == WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID).Any())
|
|
|
|
|
{
|
|
|
|
|
var time = int.Parse(db.Queryable<BasFactoryConfig>().Where(P => P.key == "getinterval").First().value);
|
|
|
|
|
@@ -2250,6 +2301,7 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
foreach (WmsCarryD wmsCarryD in wmsCarryCodes)
|
|
|
|
|
{
|
|
|
|
|
await s_floor2CreatePretask.WaitAsync();
|
|
|
|
|
|
|
|
|
|
//入库取终点 //出库起点
|
|
|
|
|
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_ZC_ID, Size = 1 };
|
|
|
|
|
List<BasLocation> endLocations = await InStockStrategy(inStockStrategyInput);
|
|
|
|
|
@@ -2258,107 +2310,69 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
Logger.LogWarning("没有可用的入库库位");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
WmsPointH sPoint = null!;
|
|
|
|
|
WmsPointH ePoint = null!;
|
|
|
|
|
|
|
|
|
|
// todo 11、12线 分配方式暂定,待更改
|
|
|
|
|
BasLocation basLocation011 = _db.Queryable<BasLocation>().Where(r => r.id == WmsWareHouseConst.ZZCSSX111011).First();
|
|
|
|
|
BasLocation basLocation012 = _db.Queryable<BasLocation>().Where(r => r.id == WmsWareHouseConst.ZZCSSX111012).First();
|
|
|
|
|
|
|
|
|
|
BasLocation startLocation = basLocation011.task_nums >= basLocation012.task_nums ? basLocation012 : basLocation011;
|
|
|
|
|
BasLocation endLocation = endLocations[0];
|
|
|
|
|
|
|
|
|
|
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == startLocation.id);
|
|
|
|
|
if (endLocations?.Count > 0)
|
|
|
|
|
WmsCarryH carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == wmsCarryD.membercarry_code);
|
|
|
|
|
await _db.Updateable<WmsCarryH>().SetColumns(r => new WmsCarryH
|
|
|
|
|
{
|
|
|
|
|
WmsCarryH carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == wmsCarryD.membercarry_code);
|
|
|
|
|
await _db.Updateable<WmsCarryH>().SetColumns(r => new WmsCarryH
|
|
|
|
|
{
|
|
|
|
|
location_id = startLocation.id,
|
|
|
|
|
location_code = startLocation.location_code,
|
|
|
|
|
}).Where(r => r.id == carry.id).ExecuteCommandAsync();
|
|
|
|
|
//if (carry.carry_status == "1")
|
|
|
|
|
//{
|
|
|
|
|
// throw new AppFriendlyException("载具已占用!", 500);
|
|
|
|
|
//}
|
|
|
|
|
//if (carry.is_lock == 1)
|
|
|
|
|
//{
|
|
|
|
|
// throw new AppFriendlyException("载具已锁定!", 500);
|
|
|
|
|
//}
|
|
|
|
|
BasLocation loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == endLocations[0].id);
|
|
|
|
|
bool isMatch = await IsCarryAndLocationMatchByCarryStd(carry, loc);
|
|
|
|
|
if (!isMatch)
|
|
|
|
|
{
|
|
|
|
|
Logger.LogWarning("库位与载具规格不匹配");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == endLocations[0].id);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
location_id = startLocation.id,
|
|
|
|
|
location_code = startLocation.location_code,
|
|
|
|
|
}).Where(r => r.id == carry.id).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
bool isMatch = await IsCarryAndLocationMatchByCarryStd(carry, endLocation);
|
|
|
|
|
if (!isMatch)
|
|
|
|
|
{
|
|
|
|
|
Logger.LogWarning($"库位{endLocations[0].location_code}未在点位表中维护对应点位");
|
|
|
|
|
Logger.LogWarning("库位与载具规格不匹配");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CommonCreatePretaskInput commonCreatePretaskInput = new CommonCreatePretaskInput();
|
|
|
|
|
commonCreatePretaskInput.startlocation_id = startLocation.id;
|
|
|
|
|
commonCreatePretaskInput.endlocation_id = endLocation.id;
|
|
|
|
|
commonCreatePretaskInput.carry_id = wmsCarryD.membercarry_id;
|
|
|
|
|
commonCreatePretaskInput.carry_code = wmsCarryD.membercarry_code;
|
|
|
|
|
commonCreatePretaskInput.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
|
|
|
|
|
commonCreatePretaskInput.biz_type = WmsWareHouseConst.BIZTYPE_WMSEMPTYINSTOCK_ID;
|
|
|
|
|
commonCreatePretaskInput.isExcuteMission = false;
|
|
|
|
|
|
|
|
|
|
VisualDevModelDataCrInput visualDevInput = new VisualDevModelDataCrInput();
|
|
|
|
|
visualDevInput.data = new Dictionary<string, object>();
|
|
|
|
|
visualDevInput.data.Add("bill_code", "");
|
|
|
|
|
visualDevInput.data.Add("biz_type", WmsWareHouseConst.BIZTYPE_WMSEMPTYINSTOCK_ID);
|
|
|
|
|
visualDevInput.data.Add("carry_code", wmsCarryD.membercarry_code);
|
|
|
|
|
visualDevInput.data.Add("carry_id", wmsCarryD.membercarry_id);
|
|
|
|
|
//visualDevInput.data.Add("create_id", "");
|
|
|
|
|
visualDevInput.data.Add("create_time", "");
|
|
|
|
|
visualDevInput.data.Add("flowId", "");
|
|
|
|
|
visualDevInput.data.Add("id", "");
|
|
|
|
|
visualDevInput.data.Add("location_id", startLocation.id);
|
|
|
|
|
visualDevInput.data.Add("modify_id", "");
|
|
|
|
|
visualDevInput.data.Add("modify_time", "");
|
|
|
|
|
//visualDevInput.data.Add("org_id", "");
|
|
|
|
|
visualDevInput.data.Add("status", WmsWareHouseConst.BILLSTATUS_ADD_ID);
|
|
|
|
|
visualDevInput.data.Add("warehouse_id", WmsWareHouseConst.WAREHOUSE_ZC_ID);
|
|
|
|
|
commonCreatePretaskInput.visualDevInput = visualDevInput;
|
|
|
|
|
|
|
|
|
|
Logger.LogInformation($"【送满托到下升降区】 开始生成一楼CTU'预任务 起点{sPoint.point_code} 终点{ePoint.point_code} 料箱 {wmsCarryD.membercarry_code}");
|
|
|
|
|
List<WmsPointH> points = new List<WmsPointH>();
|
|
|
|
|
points.Add(sPoint);
|
|
|
|
|
points.Add(ePoint);
|
|
|
|
|
Logger.LogInformation($"【送满托到下升降区】 开始生成一楼CTU预任务 起点{startLocation.location_code} 终点{endLocation.location_code} 料箱 {wmsCarryD.membercarry_code}");
|
|
|
|
|
|
|
|
|
|
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
|
|
|
|
WmsPretaskH preTask = null;
|
|
|
|
|
string bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
|
|
|
|
|
List<WmsPretaskH> preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
|
|
|
|
|
await _db.Updateable<BasLocation>().SetColumns(it => it.is_lock == 1).Where(r => r.id == endLocations[0].id).ExecuteCommandAsync();
|
|
|
|
|
await _db.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(r => r.id == startLocation.id).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
Entities.Dto.Outputs.Result res = await CommonCreatePretask(commonCreatePretaskInput);
|
|
|
|
|
if (res.code == JNPF.Common.Enums.HttpStatusCode.OK)
|
|
|
|
|
{
|
|
|
|
|
WmsPointH? sPoint = it.FirstOrDefault();
|
|
|
|
|
WmsPointH? ePoint = it.LastOrDefault();
|
|
|
|
|
|
|
|
|
|
preTask = new()
|
|
|
|
|
{
|
|
|
|
|
org_id = "",
|
|
|
|
|
startlocation_id = sPoint?.location_id!,
|
|
|
|
|
startlocation_code = sPoint?.location_code!,
|
|
|
|
|
endlocation_id = ePoint?.location_id!,
|
|
|
|
|
endlocation_code = ePoint?.location_code!,
|
|
|
|
|
start_floor = sPoint?.floor.ToString(),
|
|
|
|
|
end_floor = ePoint?.floor.ToString(),
|
|
|
|
|
startpoint_id = sPoint?.id!,
|
|
|
|
|
startpoint_code = sPoint?.point_code!,
|
|
|
|
|
endpoint_id = ePoint?.id!,
|
|
|
|
|
endpoint_code = ePoint?.point_code!,
|
|
|
|
|
bill_code = bill_code,
|
|
|
|
|
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
|
|
|
|
|
biz_type = WmsWareHouseConst.BIZTYPE_WMSEMPTYINSTOCK_ID,
|
|
|
|
|
task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID,
|
|
|
|
|
carry_id = wmsCarryD.membercarry_id,
|
|
|
|
|
carry_code = wmsCarryD.membercarry_code,
|
|
|
|
|
area_id = sPoint?.area_id!,
|
|
|
|
|
area_code = it.Key,
|
|
|
|
|
require_id = "",
|
|
|
|
|
require_code = "",
|
|
|
|
|
create_id = "",
|
|
|
|
|
create_time = DateTime.Now
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return preTask;
|
|
|
|
|
}).ToList();
|
|
|
|
|
//更新页面
|
|
|
|
|
//赋值签收状态
|
|
|
|
|
|
|
|
|
|
Logger.LogInformation($"开始执行 GenPreTask {JsonConvert.SerializeObject(preTasks)}");
|
|
|
|
|
bool result = await GenPreTask(preTasks, null!);
|
|
|
|
|
Logger.LogInformation($"GenPreTask 结果 {result}");
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
|
|
|
|
_ = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(r => r.id == endLocations[0].id).ExecuteCommandAsync();
|
|
|
|
|
_ = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { task_nums = it.task_nums + 1 }).Where(r => r.id == startLocation.id).ExecuteCommandAsync();
|
|
|
|
|
Logger.LogInformation($"成功生成预任务:{preTasks.First().bill_code}");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Logger.LogInformation($"【二楼kiva把料架送到下升降机后生成中储仓入库任务】 未成功生成预任务 起点{sPoint.point_code} 终点{ePoint.point_code} 料箱 {wmsCarryD.membercarry_code}");
|
|
|
|
|
Logger.LogInformation($"【二楼kiva把料架送到下升降机后生成中储仓入库任务】 未成功生成预任务 起点{startLocation.location_code} 终点{endLocation.location_code} 料箱 {wmsCarryD.membercarry_code}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s_floor2CreatePretask.Release();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
@@ -2419,7 +2433,7 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
|
|
|
|
|
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
|
|
|
|
WmsPretaskH preTask = null;
|
|
|
|
|
string bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
|
|
|
|
|
string bill_code = await _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE);
|
|
|
|
|
|
|
|
|
|
string carry_id = "";
|
|
|
|
|
string carry_code = "";
|
|
|
|
|
@@ -2459,6 +2473,15 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
throw new AppFriendlyException("起点库位上没有载具", 500);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (input.visualDevInput != null)
|
|
|
|
|
{
|
|
|
|
|
//在线开发
|
|
|
|
|
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYINSTOCK_ID, true);
|
|
|
|
|
await _runService.Create(templateEntity, input.visualDevInput);
|
|
|
|
|
input.require_id = input.visualDevInput.data["ReturnIdentity"].ToString() ?? "";
|
|
|
|
|
input.require_code = input.visualDevInput.data["bill_code"].ToString() ?? "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<WmsPretaskH> preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
|
|
|
|
|
{
|
|
|
|
|
@@ -2468,7 +2491,7 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
|
|
|
|
|
preTask = new()
|
|
|
|
|
{
|
|
|
|
|
org_id = _userManager.User.OrganizeId,
|
|
|
|
|
org_id = _userManager.User?.OrganizeId,
|
|
|
|
|
startlocation_id = sPoint?.location_id!,
|
|
|
|
|
startlocation_code = sPoint?.location_code!,
|
|
|
|
|
endlocation_id = ePoint?.location_id!,
|
|
|
|
|
@@ -2488,7 +2511,7 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
area_id = sPoint?.area_id!,
|
|
|
|
|
area_code = it.Key,
|
|
|
|
|
require_id = input.require_id,
|
|
|
|
|
require_code = "",
|
|
|
|
|
require_code = input.require_code,
|
|
|
|
|
create_id = _userManager.UserId,
|
|
|
|
|
create_time = DateTime.Now
|
|
|
|
|
};
|
|
|
|
|
@@ -2498,12 +2521,12 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
//更新页面
|
|
|
|
|
//赋值签收状态
|
|
|
|
|
|
|
|
|
|
Logger.LogInformation($"【createPretask】 开始执行 GenPreTask {JsonConvert.SerializeObject(preTasks)}");
|
|
|
|
|
Logger.LogInformation($"【CommonCreatePretask】 开始执行 GenPreTask {JsonConvert.SerializeObject(preTasks)}");
|
|
|
|
|
bool result = await GenPreTask(preTasks, null!);
|
|
|
|
|
Logger.LogInformation($"【createPretask】 GenPreTask 结果 {result}");
|
|
|
|
|
Logger.LogInformation($"【CommonCreatePretask】 GenPreTask 结果 {result}");
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
|
|
|
|
Logger.LogInformation($"【createPretask】 成功生成预任务:{preTasks.First().bill_code}");
|
|
|
|
|
Logger.LogInformation($"【CommonCreatePretask】 成功生成预任务:{preTasks.First().bill_code}");
|
|
|
|
|
return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.OK, "成功");
|
|
|
|
|
}
|
|
|
|
|
return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, "生成预任务失败");
|
|
|
|
|
@@ -2514,7 +2537,10 @@ namespace Tnb.WarehouseMgr
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
GenTaskExecute();
|
|
|
|
|
if (input.isExcuteMission)
|
|
|
|
|
{
|
|
|
|
|
GenTaskExecute();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|