二楼细节完善 bug处理
This commit is contained in:
@@ -129,9 +129,14 @@ namespace Tnb.WarehouseMgr
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
/// <exception cref="AppFriendlyException"></exception>
|
||||
[NonAction]
|
||||
public async Task<Result> CarryUnbind(CarryBindInput input)
|
||||
public async Task<Result> CarryUnbind(CarryBindInput input, ISqlSugarClient dbConn = null)
|
||||
{
|
||||
bool isOk = false;
|
||||
|
||||
var db = _db;
|
||||
if (dbConn != null)
|
||||
db = dbConn;
|
||||
|
||||
try
|
||||
{
|
||||
if (input == null)
|
||||
@@ -139,7 +144,7 @@ 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)
|
||||
{
|
||||
|
||||
@@ -160,7 +165,7 @@ namespace Tnb.WarehouseMgr
|
||||
//await _runService.Create(templateEntity, visualDevModelCrInput);
|
||||
|
||||
|
||||
int row = await _db.Deleteable<WmsCarryD>().Where(r => r.carry_id == input.carry_id).ExecuteCommandAsync();
|
||||
int row = await db.Deleteable<WmsCarryD>().Where(r => r.carry_id == input.carry_id).ExecuteCommandAsync();
|
||||
//isOk = row > 0;
|
||||
|
||||
//if (!isOk)
|
||||
@@ -170,7 +175,7 @@ namespace Tnb.WarehouseMgr
|
||||
Logger.LogInformation($"【CarryUnbind】料架{carry.carry_code}已解绑,解绑条数{row}");
|
||||
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
await db.Ado.CommitTranAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -184,7 +189,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
Logger.LogError($"【CarryUnbind】 {ex.Message}");
|
||||
Logger.LogError($"【CarryUnbind】 {ex.StackTrace}");
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
await db.Ado.RollbackTranAsync();
|
||||
return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user