修改空载具出库回更状态

This commit is contained in:
2023-06-20 14:27:02 +08:00
parent ed75869276
commit d082c464c9
3 changed files with 15 additions and 4 deletions

View File

@@ -28,6 +28,10 @@ namespace Tnb.WarehouseMgr.Entities.Dto
/// 任务执行条码表
/// </summary>
public List<WmsDistaskCode> distaskCodes { get; set; }
/// <summary>
/// 载具
/// </summary>
public List<String> carryIds { get; set; }

View File

@@ -459,7 +459,7 @@ namespace Tnb.WarehouseMgr
foreach (var dt in disTasks)
{
var disTaskCodes = await _db.Queryable<WmsDistaskCode>().Where(it => it.bill_id == dt.id).ToListAsync();
var upInput = new WareHouseUpInput { bizTypeId = dt.biz_type, requireId = dt.require_id, distaskCodes = disTaskCodes };
var upInput = new WareHouseUpInput { bizTypeId = dt.biz_type, requireId = dt.require_id, distaskCodes = disTaskCodes , carryIds = disTasks.Select(x=>x.carry_id).ToList()};
upInput.loginType = !_userManager.LoginType.IsNullOrEmpty() ? "app" : "web";
if (dt.is_sign == 1) //区分出入库操作
{

View File

@@ -152,10 +152,10 @@ namespace Tnb.WarehouseMgr
//更新明细表
WmsEmptyOutstockD wmsEmptyOutstockD = new ();
wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId();
wmsEmptyOutstockD.bill_id = input.data[nameof(WmsEmptyOutstockH.bill_code)]?.ToString()!;
wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId;
wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID;
wmsEmptyOutstockD.location_id = ePoint.location_id;
wmsEmptyOutstockD.status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID;
wmsEmptyOutstockD.status = WmsWareHouseConst.BILLSTATUS_ON_ID;
wmsEmptyOutstockD.carry_id = carrys[i].id;
wmsEmptyOutstockD.carry_code = carrys[i].carry_code;
wmsEmptyOutstockD.create_id = _userManager.UserId;
@@ -186,7 +186,14 @@ namespace Tnb.WarehouseMgr
public async override Task ModifyAsync(WareHouseUpInput input)
{
if (input == null) throw new ArgumentNullException(nameof(input));
var isOk = await _db.Updateable<WmsEmptyInstock>().SetColumns(it => new WmsEmptyInstock { status = input.bizTypeId }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync();
//根据载具更新明细表状态
var isOk = await _db.Updateable<WmsEmptyOutstockD>().SetColumns(it => new WmsEmptyOutstockD { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.bill_id == input.requireId && input.carryIds.Contains(it.carry_id)).ExecuteCommandHasChangeAsync();
var emptyCarrys = await _db.Queryable<WmsEmptyOutstockD>().Where(it => it.bill_id == input.requireId).ToListAsync();
// 判断所有明细是否都完成
if (emptyCarrys.All(x=> x.status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID)) {
await _db.Updateable<WmsEmptyOutstockH>().SetColumns(it=> new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync();
}
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
}
}