增加存储库位判断,限制条件
This commit is contained in:
@@ -226,7 +226,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
if (input.IsNull()) throw new ArgumentNullException("input");
|
if (input.IsNull()) throw new ArgumentNullException("input");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.location_code);
|
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.location_code && it.is_type != EnumLocationType.存储库位.ToString());
|
||||||
var dic = new Dictionary<string, object>();
|
var dic = new Dictionary<string, object>();
|
||||||
dic[nameof(WmsEmptyOutstockH.id)] = SnowflakeIdHelper.NextId();
|
dic[nameof(WmsEmptyOutstockH.id)] = SnowflakeIdHelper.NextId();
|
||||||
dic[nameof(WmsEmptyOutstockH.org_id)] = input.org_id;
|
dic[nameof(WmsEmptyOutstockH.org_id)] = input.org_id;
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
//入库申请条码明细表
|
//入库申请条码明细表
|
||||||
List<WmsInstockCode> instockcodes = input.instockcodes.Adapt<List<WmsInstockCode>>();
|
List<WmsInstockCode> instockcodes = input.instockcodes.Adapt<List<WmsInstockCode>>();
|
||||||
|
|
||||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.instock.location_code);
|
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.instock.location_code && it.is_type != EnumLocationType.存储库位.ToString());
|
||||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.instock.carry_code);
|
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.instock.carry_code);
|
||||||
//如果数据不全,
|
//如果数据不全,
|
||||||
if (carry.IsNull() || loc.IsNull() || instockds?.Count < 1 || instockcodes?.Count < 1)
|
if (carry.IsNull() || loc.IsNull() || instockds?.Count < 1 || instockcodes?.Count < 1)
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
//出库申请明细表
|
//出库申请明细表
|
||||||
List<WmsOutstockD> outstockDs = input.outstockDs.Adapt<List<WmsOutstockD>>();
|
List<WmsOutstockD> outstockDs = input.outstockDs.Adapt<List<WmsOutstockD>>();
|
||||||
|
|
||||||
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.outstock.location_code);
|
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.outstock.location_code && it.is_type != EnumLocationType.存储库位.ToString());
|
||||||
//如果数据不全,
|
//如果数据不全,
|
||||||
if (location.IsNull() || outstockDs?.Count < 1)
|
if (location.IsNull() || outstockDs?.Count < 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using JNPF.Common.Enums;
|
|||||||
using JNPF.Common.Extension;
|
using JNPF.Common.Extension;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
|
using JNPF.LinqBuilder;
|
||||||
using JNPF.Logging;
|
using JNPF.Logging;
|
||||||
using JNPF.Systems.Interfaces.System;
|
using JNPF.Systems.Interfaces.System;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
@@ -70,20 +71,25 @@ namespace Tnb.WarehouseMgr
|
|||||||
// var set = true ; 如果有 把set修改为false
|
// var set = true ; 如果有 把set修改为false
|
||||||
var items = await _db.Queryable<WmsKittingoutH>().Where(it => it.status == WmsWareHouseConst.BILLSTATUS_CALLED_ID).ToListAsync();
|
var items = await _db.Queryable<WmsKittingoutH>().Where(it => it.status == WmsWareHouseConst.BILLSTATUS_CALLED_ID).ToListAsync();
|
||||||
var isCalled = items?.Count > 0;
|
var isCalled = items?.Count > 0;
|
||||||
|
|
||||||
if (kittingOuts?.Count > 0)
|
if (kittingOuts?.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var ko in kittingOuts)
|
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>()
|
var carrys = await _db.Queryable<WmsCarryH>()
|
||||||
.InnerJoin<WmsCollocationSchemeH>((a, b) => a.collocation_scheme_id == b.id)
|
.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)
|
.OrderBy((a, b) => b.seq)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
if (carrys?.Count > 0)
|
if (carrys?.Count > 0)
|
||||||
{
|
{
|
||||||
var firstCarry = carrys.FirstOrDefault();
|
var firstCarry = carrys.FirstOrDefault();
|
||||||
GenPreTaskUpInput genPreTaskInput = new() { CarryId = firstCarry?.id };
|
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.status = WmsWareHouseConst.BILLSTATUS_TOBESHIPPED_ID;
|
||||||
ko.carry_id = firstCarry?.id;
|
ko.carry_id = firstCarry?.id;
|
||||||
ko.carry_code = firstCarry?.carry_code;
|
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.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
|
||||||
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
|
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
|
||||||
preTask.biz_type = ko.biz_type;
|
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_id = ko!.carry_id!;
|
||||||
preTask.carry_code = ko!.carry_code!;
|
preTask.carry_code = ko!.carry_code!;
|
||||||
preTask.area_id = sPoint?.area_id!;
|
preTask.area_id = sPoint?.area_id!;
|
||||||
|
|||||||
Reference in New Issue
Block a user