增加存储库位判断,限制条件

This commit is contained in:
FanLian
2023-07-17 17:06:57 +08:00
parent 0a1d4db247
commit 2509eb739d
4 changed files with 13 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ using JNPF.Common.Enums;
using JNPF.Common.Extension;
using JNPF.Common.Security;
using JNPF.FriendlyException;
using JNPF.LinqBuilder;
using JNPF.Logging;
using JNPF.Systems.Interfaces.System;
using Mapster;
@@ -70,20 +71,25 @@ namespace Tnb.WarehouseMgr
// var set = true ; 如果有 把set修改为false
var items = await _db.Queryable<WmsKittingoutH>().Where(it => it.status == WmsWareHouseConst.BILLSTATUS_CALLED_ID).ToListAsync();
var isCalled = items?.Count > 0;
if (kittingOuts?.Count > 0)
{
foreach (var ko in kittingOuts)
{
//a.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID
Expression<Func<WmsCarryH, bool>> whereExp = (ko.carry_id != null) ? a=>a.id == ko.carry_id : a => a.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID;
var carrys = await _db.Queryable<WmsCarryH>()
.InnerJoin<WmsCollocationSchemeH>((a, b) => a.collocation_scheme_id == b.id)
.Where(a => a.collocation_scheme_id == ko.collocation_scheme_id && a.is_lock == 0)
.Where(whereExp.And(a => a.collocation_scheme_id == ko.collocation_scheme_id && a.is_lock == 0))
.OrderBy((a, b) => b.seq)
.ToListAsync();
if (carrys?.Count > 0)
{
var firstCarry = carrys.FirstOrDefault();
GenPreTaskUpInput genPreTaskInput = new() { CarryId = firstCarry?.id };
await _warehouseService.GenInStockTaskHandleAfter(genPreTaskInput, it => new WmsCarryH { is_lock = 1 }, null!);
await _warehouseService.GenInStockTaskHandleAfter(genPreTaskInput, it => new WmsCarryH { is_lock = 1 , out_status = EnumOutStatus..ToString()}, null!);
ko.status = WmsWareHouseConst.BILLSTATUS_TOBESHIPPED_ID;
ko.carry_id = firstCarry?.id;
ko.carry_code = firstCarry?.carry_code;
@@ -185,7 +191,7 @@ namespace Tnb.WarehouseMgr
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = ko.biz_type;
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
preTask.carry_id = ko!.carry_id!;
preTask.carry_code = ko!.carry_code!;
preTask.area_id = sPoint?.area_id!;