This commit is contained in:
FanLian
2023-06-16 09:20:49 +08:00
4 changed files with 38 additions and 32 deletions

View File

@@ -36,12 +36,14 @@ namespace Tnb.WarehouseMgr
} }
} }
protected async Task DoUpdate(WareHouseUpInput input) protected async Task DoUpdate(WareHouseUpInput input)
{ {
if (_serviceMap.ContainsKey(input.bizTypeId)) if (_serviceMap.ContainsKey(input.bizTypeId))
{ {
await _serviceMap[input.bizTypeId].ModifyAsync(input); await _serviceMap[input.bizTypeId].ModifyAsync(input);
} }
} }
public virtual Task ModifyAsync(WareHouseUpInput input) public virtual Task ModifyAsync(WareHouseUpInput input)

View File

@@ -228,26 +228,30 @@ namespace Tnb.WarehouseMgr
//任务链属性处理内部函数 //任务链属性处理内部函数
async Task _taskChainAttrHandle(List<WmsDistaskH> items, List<WmsPretaskH> areaPreTasks, int moveNum) async Task _taskChainAttrHandle(List<WmsDistaskH> items, List<WmsPretaskH> areaPreTasks, int moveNum)
{ {
if (moveNum == 1 || (moveNum > areaPreTasks.Count && areaPreTasks.Count == 1)) await Task.Run(() =>
{ {
items.ForEach(x => if (moveNum == 1 || (moveNum > areaPreTasks.Count && areaPreTasks.Count == 1))
{ {
x.is_chain = 0; items.ForEach(x =>
{
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[items.Count - 1].chain_type = "3";
}
});
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[items.Count - 1].chain_type = "3";
}
} }
//获取所有未下发的预任务申请 //获取所有未下发的预任务申请
@@ -485,16 +489,16 @@ namespace Tnb.WarehouseMgr
await _db.Insertable(input.PreTaskHandleCodes).ExecuteCommandAsync(); await _db.Insertable(input.PreTaskHandleCodes).ExecuteCommandAsync();
} }
//根据载具ID更新是否锁定和赋值起始库位 //根据载具ID更新是否锁定和赋值起始库位
if (!input.IsCheck.HasValue) //if (!input.IsCheck.HasValue)
{ //{
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync(); // await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
} //}
else //else
{ //{
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_check = input.IsCheck.Value, is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync(); // await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_check = input.IsCheck.Value, is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
} //}
//根据所有库位更新库位的锁定状态为“锁定” ////根据所有库位更新库位的锁定状态为“锁定”
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => input.LocationIds.Contains(it.id)).ExecuteCommandAsync(); //await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => input.LocationIds.Contains(it.id)).ExecuteCommandAsync();
await _db.Ado.CommitTranAsync(); await _db.Ado.CommitTranAsync();
} }
catch (Exception) catch (Exception)

View File

@@ -140,7 +140,7 @@ namespace Tnb.WarehouseMgr
handleH.create_time = DateTime.Now; handleH.create_time = DateTime.Now;
preTaskUpInput.PreTaskRecord = handleH; preTaskUpInput.PreTaskRecord = handleH;
//根据空载具入库Id回更单据状态 //根据空载具入库Id回更单据状态
await _db.Updateable<WmsEmptyInstock>().SetColumns(it => new WmsEmptyInstock { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.PreTaskId).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);
} }

View File

@@ -151,7 +151,7 @@ namespace Tnb.WarehouseMgr
var materialId = jo.Value<string>(nameof(WmsHandleCode.material_id)); var materialId = jo.Value<string>(nameof(WmsHandleCode.material_id));
WmsHandleCode handleCode = new(); WmsHandleCode handleCode = new();
handleCode.bill_id = operBillId; handleCode.bill_id = operBillId;
handleCode.material_id = jo.Value<string>(nameof(WmsHandleCode.material_id)); handleCode.material_id = materialId;
handleCode.material_code = jo.Value<string>(nameof(WmsHandleCode.material_code)); handleCode.material_code = jo.Value<string>(nameof(WmsHandleCode.material_code));
handleCode.barcode = jo.Value<string>(nameof(WmsHandleCode.barcode)); handleCode.barcode = jo.Value<string>(nameof(WmsHandleCode.barcode));
handleCode.code_batch = jo.Value<string>(nameof(WmsHandleCode.code_batch)); handleCode.code_batch = jo.Value<string>(nameof(WmsHandleCode.code_batch));