erp仓库映射关系、erp同步完善、库存报表添加箱号 批次号查询;载具库存报表添加箱号 批次号查询
This commit is contained in:
@@ -16,6 +16,7 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.HPSF;
|
||||
using Senparc.Weixin.Work.AdvancedAPIs.OaDataOpen;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
@@ -96,10 +97,19 @@ namespace Tnb.WarehouseMgr
|
||||
WmsRawmatTransferoutstockH wmsRawmatTransferoutstockH = await _db.Queryable<WmsRawmatTransferoutstockH>().FirstAsync(it => it.id == wmsRawmatTransferoutstockD.bill_id);
|
||||
|
||||
List<WmsCarryH> items = await _db.Queryable<WmsCarryH>().Where(r => input.carrys.Contains(r.carry_code)).ToListAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (item.is_lock == 1)
|
||||
{
|
||||
throw new AppFriendlyException($"载具{item.carry_code}已锁定", 500);
|
||||
}
|
||||
BasLocation carrryLoc = await _db.Queryable<BasLocation>().Where(r => r.id == item.location_id).FirstAsync();
|
||||
if (carrryLoc == null || carrryLoc.is_type != "0")
|
||||
{
|
||||
throw new Exception($"托盘{item.carry_code}已经不在存储库位中,不能出库!");
|
||||
}
|
||||
}
|
||||
|
||||
List<WmsCarryCode> wmsCarryCodes = await _db.Queryable<WmsCarryCode>().Where(r => items.Select(c => c.id).Contains(r.carry_id)
|
||||
&& r.material_id == wmsRawmatTransferoutstockD.matcode_id && r.code_batch == wmsRawmatTransferoutstockD.code_batch).ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user