生成预任务时,新增任务属性逻辑判断
This commit is contained in:
@@ -161,5 +161,9 @@ public partial class WmsPretaskH : BaseEntity<string>
|
||||
/// 优先级
|
||||
/// </summary>
|
||||
public int is_sign { get; set; } = 1;
|
||||
/// <summary>
|
||||
/// 任务属性
|
||||
/// </summary>
|
||||
public string chain_type { get; set; } = "3";
|
||||
|
||||
}
|
||||
|
||||
@@ -240,19 +240,18 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
x.is_chain = 0;
|
||||
|
||||
x.chain_type = "0";
|
||||
});
|
||||
}
|
||||
else if ((moveNum > areaPreTasks.Count && areaPreTasks.Count > 1) || moveNum < areaPreTasks.Count)
|
||||
{
|
||||
items.ForEach(x => x.is_chain = 1);
|
||||
items[0].chain_type = "1";
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
{
|
||||
if (i == 0 || i == items.Count - 1) continue;
|
||||
items[i].chain_type = "2";
|
||||
}
|
||||
items[^1].chain_type = "3";
|
||||
//items[0].chain_type = "1";
|
||||
//for (int i = 0; i < items.Count; i++)
|
||||
//{
|
||||
// if (i == 0 || i == items.Count - 1) continue;
|
||||
// items[i].chain_type = "2";
|
||||
//}
|
||||
//items[^1].chain_type = "3";
|
||||
}
|
||||
});
|
||||
|
||||
@@ -288,7 +287,7 @@ namespace Tnb.WarehouseMgr
|
||||
items.ForEach(x =>
|
||||
{
|
||||
x.is_chain = 0;
|
||||
x.chain_type = "0";
|
||||
x.chain_type = "3";
|
||||
});
|
||||
}
|
||||
else if (moveNum > 1)
|
||||
@@ -461,18 +460,10 @@ namespace Tnb.WarehouseMgr
|
||||
var disTaskCodes = await _db.Queryable<WmsDistaskCode>().Where(it => it.bill_id == dt.id).ToListAsync();
|
||||
var upInput = new WareHouseUpInput { bizTypeId = dt.biz_type, requireId = dt.require_id, distaskCodes = disTaskCodes, carryIds = disTasks.Select(x => x.carry_id).ToList() };
|
||||
upInput.loginType = !_userManager.LoginType.IsNullOrEmpty() ? "app" : "web";
|
||||
if (dt.is_sign == 1) //区分出入库操作
|
||||
if (dt.is_sign == 1 && dt.chain_type == "3")
|
||||
{
|
||||
if (dt.is_chain == 0)
|
||||
{
|
||||
await DoUpdate(upInput);
|
||||
}
|
||||
else if (dt.is_chain == 1 && dt.chain_type == "3")
|
||||
{
|
||||
await DoUpdate(upInput);
|
||||
}
|
||||
await DoUpdate(upInput);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,6 +486,19 @@ namespace Tnb.WarehouseMgr
|
||||
/// <returns></returns>
|
||||
public async Task<bool> GenPreTask(List<WmsPretaskH> preTasks, List<WmsPretaskCode> preTaskCodes)
|
||||
{
|
||||
var grpList = preTasks.OrderBy(o => o.bill_code).GroupBy(g => g.carry_id).ToList();
|
||||
if (grpList?.Count > 0)
|
||||
{
|
||||
foreach (var grp in grpList)
|
||||
{
|
||||
var arr = grp.ToArray();
|
||||
if (arr.Length > 1)
|
||||
{
|
||||
var subArr = arr[..^1];
|
||||
Array.ForEach(subArr, a => a.chain_type = "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
var row = await _db.Insertable(preTasks).ExecuteCommandAsync();
|
||||
if (preTaskCodes?.Count > 0)
|
||||
{
|
||||
|
||||
@@ -143,8 +143,8 @@ namespace Tnb.WarehouseMgr
|
||||
List<string> locIds = new();
|
||||
foreach (var carry in carrys)
|
||||
{
|
||||
WmsPointH sPoint = null;
|
||||
WmsPointH ePoint = null;
|
||||
WmsPointH sPoint = null!;
|
||||
WmsPointH ePoint = null!;
|
||||
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
|
||||
{
|
||||
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id);
|
||||
@@ -168,10 +168,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
WmsPretaskH preTask = new();
|
||||
preTask.org_id = _userManager.User.OrganizeId;
|
||||
preTask.startlocation_id = sPoint?.location_id;
|
||||
preTask.startlocation_code = sPoint?.location_code;
|
||||
preTask.endlocation_id = ePoint?.location_id;
|
||||
preTask.endlocation_code = ePoint?.location_code;
|
||||
preTask.startlocation_id = sPoint?.location_id!;
|
||||
preTask.startlocation_code = sPoint?.location_code!;
|
||||
preTask.endlocation_id = ePoint?.location_id!;
|
||||
preTask.endlocation_code = ePoint?.location_code!;
|
||||
preTask.start_floor = sPoint?.floor.ToString();
|
||||
preTask.end_floor = ePoint?.floor.ToString();
|
||||
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
|
||||
|
||||
@@ -49,7 +49,6 @@ namespace Tnb.WarehouseMgr
|
||||
var isOk = false;
|
||||
try
|
||||
{
|
||||
var isOk = false;
|
||||
await _db.Ado.BeginTranAsync();
|
||||
var carryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
||||
var feedBoxCode = input.data.ContainsKey("feedbox_code") ? input.data["feedbox_code"]?.ToString() : "";
|
||||
|
||||
Reference in New Issue
Block a user