转库单原材料到中储仓转库、中储仓退回原材料转库

This commit is contained in:
2024-07-23 18:21:08 +08:00
parent 5059ae3e55
commit d7a0b557c7
7 changed files with 399 additions and 84 deletions

View File

@@ -152,11 +152,14 @@ namespace Tnb.WarehouseMgr
return result;
}
[HttpPost]
public async Task CarryMaterialBind(CarryMaterialBindInput input)
public async Task CarryMaterialBind(CarryMaterialBindInput input, ISqlSugarClient dbConn = null)
{
var db = _db;
if (dbConn != null)
db = dbConn;
try
{
WmsCarryH? carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.carrycode);
WmsCarryH? carry = await db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.carrycode);
List<WmsCarryCode> WmsCarryCodes = new List<WmsCarryCode>();
foreach (var detail in input.details)
{
@@ -170,7 +173,7 @@ namespace Tnb.WarehouseMgr
}
int rows = 0;
if (WmsCarryCodes.Count > 0)
rows = await _db.Insertable(WmsCarryCodes).ExecuteCommandAsync();
rows = await db.Insertable(WmsCarryCodes).ExecuteCommandAsync();
if (rows == 0)
{
throw new Exception($"物料列表为空,不能提交绑定,可能的原因;1.需要检查扫码设置(新PDA) 2.未扫到有效的二维码 详细信息:接收到{input.details.Count}个条码 但是成功绑定的条码数量为0个");