Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
2023-07-19 11:45:25 +08:00

View File

@@ -104,7 +104,8 @@ namespace Tnb.WarehouseMgr
//根据每个载具的起始库位做路径运算 //根据每个载具的起始库位做路径运算
if (carrys?.Count > 0) if (carrys?.Count > 0)
{ {
for (int i = 0; i < setQty.qty; i++) int min = (carrys.Count > setQty.qty) ? setQty.qty : carrys.Count;
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);
@@ -121,26 +122,29 @@ namespace Tnb.WarehouseMgr
var sPoint = it.FirstOrDefault(); var sPoint = it.FirstOrDefault();
var ePoint = it.LastOrDefault(); var ePoint = it.LastOrDefault();
WmsPretaskH preTask = new(); WmsPretaskH preTask = new()
preTask.org_id = _userManager.User.OrganizeId; {
preTask.startlocation_id = sPoint?.location_id!; org_id = _userManager.User.OrganizeId,
preTask.startlocation_code = sPoint?.location_code!; startlocation_id = sPoint?.location_id!,
preTask.endlocation_id = ePoint?.location_id!; startlocation_code = sPoint?.location_code!,
preTask.endlocation_code = ePoint?.location_code!; endlocation_id = ePoint?.location_id!,
preTask.start_floor = sPoint?.floor.ToString(); endlocation_code = ePoint?.location_code!,
preTask.end_floor = ePoint?.floor.ToString(); start_floor = sPoint?.floor.ToString(),
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(); end_floor = ePoint?.floor.ToString(),
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID; bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID; status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID; biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID,
preTask.carry_id = carrys![i].id; task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID,
preTask.carry_code = carrys![i].carry_code; carry_id = carrys![i].id,
preTask.area_id = sPoint?.area_id!; carry_code = carrys![i].carry_code,
preTask.area_code = it.Key; area_id = sPoint?.area_id!,
preTask.require_id = input.data["ReturnIdentity"].ToString(); area_code = it.Key,
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!; require_id = input.data["ReturnIdentity"].ToString(),
preTask.create_id = _userManager.UserId; require_code = input.data[nameof(preTask.bill_code)]?.ToString()!,
preTask.create_time = DateTime.Now; create_id = _userManager.UserId,
create_time = DateTime.Now
};
return preTask; return preTask;
}).ToList(); }).ToList();
//更新页面 //更新页面
@@ -153,24 +157,28 @@ namespace Tnb.WarehouseMgr
} }
if (isOk) if (isOk)
{ {
var preTaskUpInput = new GenPreTaskUpInput(); GenPreTaskUpInput preTaskUpInput = new()
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!; {
preTaskUpInput.CarryId = carrys![i].id; RquireId = input.data["ReturnIdentity"].ToString()!,
preTaskUpInput.CarryStartLocationId = points!.FirstOrDefault()!.location_id!; CarryId = carrys![i].id,
preTaskUpInput.CarryStartLocationCode = points!.FirstOrDefault()!.location_code!; CarryStartLocationId = points!.FirstOrDefault()!.location_id!,
preTaskUpInput.LocationIds = points!.Select(x => x.location_id).ToList()!; CarryStartLocationCode = points!.FirstOrDefault()!.location_code!,
LocationIds = points!.Select(x => x.location_id).ToList()!
};
//更新明细表 //更新明细表
WmsEmptyOutstockD wmsEmptyOutstockD = new(); WmsEmptyOutstockD wmsEmptyOutstockD = new()
wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId(); {
wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId; id = SnowflakeIdHelper.NextId(),
wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID; bill_id = preTaskUpInput.RquireId,
wmsEmptyOutstockD.location_id = ePoint.location_id!; biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID,
wmsEmptyOutstockD.status = WmsWareHouseConst.BILLSTATUS_ON_ID; location_id = ePoint.location_id!,
wmsEmptyOutstockD.carry_id = carrys[i].id; status = WmsWareHouseConst.BILLSTATUS_ON_ID,
wmsEmptyOutstockD.carry_code = carrys[i].carry_code; carry_id = carrys[i].id,
wmsEmptyOutstockD.create_id = _userManager.UserId; carry_code = carrys[i].carry_code,
wmsEmptyOutstockD.create_time = DateTime.Now; create_id = _userManager.UserId,
create_time = DateTime.Now
};
await _db.Insertable(wmsEmptyOutstockD) await _db.Insertable(wmsEmptyOutstockD)
.ExecuteCommandAsync(); .ExecuteCommandAsync();