This commit is contained in:
alex
2023-07-11 16:51:59 +08:00
parent ff225db2e1
commit ace324bc5f

View File

@@ -297,16 +297,16 @@ namespace Tnb.WarehouseMgr
//出库申请明细表 //出库申请明细表
List<WmsOutstockD> outstockDs = input.outstockDs.Adapt<List<WmsOutstockD>>(); List<WmsOutstockD> outstockDs = input.outstockDs.Adapt<List<WmsOutstockD>>();
var loc = 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);
//如果数据不全, //如果数据不全,
if (loc.IsNull() || outstockDs?.Count < 1) if (location.IsNull() || outstockDs?.Count < 1)
{ {
//报错, 提示数据不全。 //报错, 提示数据不全。
throw new AppFriendlyException("数据不全!", 500); throw new AppFriendlyException("数据不全!", 500);
} }
// 生成入库申请数据,添加其他数据 主表 // 生成入库申请数据,添加其他数据 主表
outstock.id = SnowflakeIdHelper.NextId(); outstock.id = SnowflakeIdHelper.NextId();
outstock.location_id = loc.id; outstock.location_id = location.id;
outstock.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID; outstock.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID;
outstock.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_OUTSTOCK_ENCODE).GetAwaiter().GetResult(); outstock.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_OUTSTOCK_ENCODE).GetAwaiter().GetResult();
outstock.generate_type = "1";// 自动 outstock.generate_type = "1";// 自动
@@ -326,7 +326,7 @@ namespace Tnb.WarehouseMgr
outstock.create_id = outstock.create_id; outstock.create_id = outstock.create_id;
} }
await _db.Insertable(outstockDs).ExecuteCommandAsync(); await _db.Insertable(outstockDs).ExecuteCommandAsync();
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == outstock.location_id.ToString()); //var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == outstock.location_id.ToString());
var carryIds = new List<string>(); var carryIds = new List<string>();
//tablefield120 出库物料明细 //tablefield120 出库物料明细
var outStockDList = outstockDs.ToObject<List<WmsOutstockD>>(); var outStockDList = outstockDs.ToObject<List<WmsOutstockD>>();
@@ -456,7 +456,7 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now; preTask.create_time = DateTime.Now;
return preTask; return preTask;
}).ToList(); }).ToList();
if (loc.is_sign == 0) if (location.is_sign == 0)
{ {
curPreTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值 curPreTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
} }