出库申请预任务生成后变更单据状态

This commit is contained in:
FanLian
2023-07-13 14:17:09 +08:00
parent adbef09153
commit 2b4c3a985b

View File

@@ -306,7 +306,7 @@ namespace Tnb.WarehouseMgr
//报错, 提示数据不全。 //报错, 提示数据不全。
throw new AppFriendlyException("数据不全!", 500); throw new AppFriendlyException("数据不全!", 500);
} }
// 生成库申请数据,添加其他数据 主表 // 生成库申请数据,添加其他数据 主表
outstock.id = SnowflakeIdHelper.NextId(); outstock.id = SnowflakeIdHelper.NextId();
outstock.location_id = location.id; outstock.location_id = location.id;
outstock.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID; outstock.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID;
@@ -483,10 +483,16 @@ namespace Tnb.WarehouseMgr
pretaskCodes.AddRange(curPreTaskCodes); pretaskCodes.AddRange(curPreTaskCodes);
} }
var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes); var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes);
GenPreTaskUpInput genPreTaskAfterUpInput = new(); if(isOk)
genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList(); {
genPreTaskAfterUpInput.LocationIds = new HashSet<string>(locIds).ToList(); await _db.Updateable(outstockDs).SetColumns(it => new WmsOutstockD{line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).ExecuteCommandAsync();
await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1 }, it => new BasLocation { is_lock = 1 }); await _db.Updateable(outstock).SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).ExecuteCommandAsync();
GenPreTaskUpInput genPreTaskAfterUpInput = new();
genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList();
genPreTaskAfterUpInput.LocationIds = new HashSet<string>(locIds).ToList();
await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1 }, it => new BasLocation { is_lock = 1 });
}
} }
else throw new AppFriendlyException("库存不足", 500); else throw new AppFriendlyException("库存不足", 500);
} }