齐套出库,寄存出库,业务回更新增清空载具
This commit is contained in:
@@ -33,13 +33,15 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly IWareHouseService _warehouseService;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IWmsCarryService _carryService;
|
||||
private const string BizTypeId = "26169472620837";
|
||||
public WmskittingOutService(ISqlSugarRepository<WmsKittingoutH> repository, IWareHouseService warehouseService, IUserManager userManager, IBillRullService billRullService)
|
||||
public WmskittingOutService(ISqlSugarRepository<WmsKittingoutH> repository, IWareHouseService warehouseService, IUserManager userManager, IBillRullService billRullService, IWmsCarryService carryService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_warehouseService = warehouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
_carryService = carryService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 齐套出库(新增状态)
|
||||
@@ -193,8 +195,27 @@ namespace Tnb.WarehouseMgr
|
||||
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
var isOk = await _db.Updateable<WmsKittingoutH>().SetColumns(it => new WmsKittingoutH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync();
|
||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
var isOk = await _db.Updateable<WmsKittingoutH>().SetColumns(it => new WmsKittingoutH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync();
|
||||
var carryId = input.carryIds[^input.carryIds.Count];
|
||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId);
|
||||
if (carry != null)
|
||||
{
|
||||
var row = await _carryService.UpdateNullCarry(carry);
|
||||
isOk = row > 0;
|
||||
}
|
||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user