erp转库单的同步,签收逻辑修改

This commit is contained in:
2024-07-04 16:34:04 +08:00
parent 7d9abfd6c8
commit 9ea9b4378d
11 changed files with 285 additions and 80 deletions

View File

@@ -204,9 +204,14 @@ namespace Tnb.WarehouseMgr
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="AppFriendlyException"></exception>
[NonAction]
public async Task<Result> CarryCodeUnbind(CarryCodeUnbindInput input)
public async Task<Result> CarryCodeUnbind(CarryCodeUnbindInput input, ISqlSugarClient dbConn = null)
{
bool isOk = false;
var db = _db;
if (dbConn != null)
db = dbConn;
try
{
if (input == null)
@@ -214,16 +219,17 @@ namespace Tnb.WarehouseMgr
throw new ArgumentNullException(nameof(input));
}
WmsCarryH? carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.carry_id);
WmsCarryH? carry = await db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.carry_id);
if (carry != null)
{
int row = await _db.Deleteable<WmsCarryCode>().Where(r => r.carry_id == input.carry_id).ExecuteCommandAsync();
int row = await db.Deleteable<WmsCarryCode>().Where(r => r.carry_id == input.carry_id).ExecuteCommandAsync();
isOk = row > 0;
if (!isOk)
{
throw Oops.Oh(ErrorCode.COM1001);
}
Logger.LogInformation($"【CarryCodeUnbind】载具{carry.carry_code}已解绑,解绑条数{row}");
//if (!isOk)
//{
// throw Oops.Oh(ErrorCode.COM1001);
//}
}
else
{