生产退料,暂存仓配送优化

This commit is contained in:
2024-06-29 13:23:21 +08:00
parent 4d890e2ca2
commit 958d1deb25
11 changed files with 172 additions and 64 deletions

View File

@@ -89,14 +89,23 @@ namespace Tnb.WarehouseMgr
{
try
{
JObject queryJson = null;
if (!string.IsNullOrEmpty(input.queryJson))
{
queryJson = JObject.Parse(input.queryJson);
}
SqlSugarPagedList<WmsMaterialTransfer> result = await _db.Queryable<WmsMaterialTransfer>()
.InnerJoin<DictionaryDataEntity>((a, b) => a.status == b.Id)
.InnerJoin<UserEntity>((a, b, c) => c.Id == a.create_id)
.InnerJoin<BasWarehouse>((a, b, c, d) => d.id == a.warehouse_outstock)
.InnerJoin<BasWarehouse>((a, b, c, d, e) => e.id == a.warehouse_instock)
.InnerJoin<DictionaryDataEntity>((a, b, c, d, e, f) => a.type == f.EnCode)
// 只显示未完成的单据
.Where( a => a.status != "25065149810453")
.Select((a, b, c, d, e) => new WmsMaterialTransfer
.Where(a => a.status != "25065149810453")
.WhereIF(queryJson != null, a => a.type == queryJson["type"].ToString())
.Select((a, b, c, d, e, f) => new WmsMaterialTransfer
{
id = a.id,
create_id = c.RealName,
@@ -111,7 +120,7 @@ namespace Tnb.WarehouseMgr
bill_date = a.bill_date,
warehouse_outstock = d.whname,
warehouse_instock = e.whname,
type = a.type,
type = f.FullName,
biller_out = a.biller_out,
depart_out = a.depart_out,
biller_in = a.biller_in,
@@ -967,6 +976,13 @@ namespace Tnb.WarehouseMgr
{
try
{
List<WmsCarryD> wmsCarryDs = _db.Queryable<WmsCarryD>().Where(r => r.carry_id == wmsCarryH.id).ToList();
if (wmsCarryDs.Count > 0)
{
Logger.LogWarning($"【RackInstock】料架{wmsCarryH.carry_code}下有料箱未解绑!");
throw new AppFriendlyException($"【RackInstock】料架{wmsCarryH.carry_code}下有料箱未解绑!", 500);
}
BasLocation startlocation = _db.Queryable<BasLocation>().Where(r => r.id == input.startlocation_id).First();
if (startlocation == null)
{