This commit is contained in:
alex
2023-07-13 15:29:27 +08:00
parent b7fa16b8e1
commit 30c67925e1

View File

@@ -257,9 +257,9 @@ namespace Tnb.WarehouseMgr
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[NonUnify]
public async Task<dynamic> MESCreateInstock(MESCreateInstockInput input)
{
var isSuccessFul = false;
try
{
await _db.Ado.BeginTranAsync();
@@ -445,6 +445,7 @@ namespace Tnb.WarehouseMgr
await _db.Updateable<WmsInstockD>().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCOdes.Select(x => x.bill_d_id).Contains(it.id)).ExecuteCommandAsync();
await _db.Updateable<WmsInstockH>().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == instock!.id).ExecuteCommandAsync();
}
isSuccessFul = true;
}
}
}
@@ -453,11 +454,12 @@ namespace Tnb.WarehouseMgr
}
catch (Exception ex)
{
isSuccessFul = false;
JNPF.Logging.Log.Error(ex.Message);
await _db.Ado.RollbackTranAsync();
return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, ex.Message);
//return await ToApiResult(JNPF.Common.Enums.HttpStatusCode.InternalServerError, ex.Message);
}
return await ToApiResult();
return isSuccessFul;
}
}
}