齐套出库,寄存出库,业务回更新增清空载具
This commit is contained in:
@@ -39,13 +39,15 @@ namespace Tnb.WarehouseMgr
|
|||||||
private readonly IWareHouseService _wareHouseService;
|
private readonly IWareHouseService _wareHouseService;
|
||||||
private readonly IBillRullService _billRullService;
|
private readonly IBillRullService _billRullService;
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
|
private readonly IWmsCarryService _wmsCarryService;
|
||||||
public WmsOutBaleService(
|
public WmsOutBaleService(
|
||||||
ISqlSugarRepository<WmsCarryH> repository,
|
ISqlSugarRepository<WmsCarryH> repository,
|
||||||
IRunService runService,
|
IRunService runService,
|
||||||
IVisualDevService visualDevService,
|
IVisualDevService visualDevService,
|
||||||
IWareHouseService wareHouseService,
|
IWareHouseService wareHouseService,
|
||||||
IUserManager userManager,
|
IUserManager userManager,
|
||||||
IBillRullService billRullService)
|
IBillRullService billRullService,
|
||||||
|
IWmsCarryService wmsCarryService)
|
||||||
{
|
{
|
||||||
_db = repository.AsSugarClient();
|
_db = repository.AsSugarClient();
|
||||||
_runService = runService;
|
_runService = runService;
|
||||||
@@ -53,6 +55,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
_wareHouseService = wareHouseService;
|
_wareHouseService = wareHouseService;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
_billRullService = billRullService;
|
_billRullService = billRullService;
|
||||||
|
_wmsCarryService = wmsCarryService;
|
||||||
OverideFuncs.CreateAsync = CarryOutBale;
|
OverideFuncs.CreateAsync = CarryOutBale;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,8 +157,25 @@ namespace Tnb.WarehouseMgr
|
|||||||
public override async Task ModifyAsync(WareHouseUpInput input)
|
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||||
{
|
{
|
||||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||||
var isOk = await _db.Updateable<WmsOutbale>().SetColumns(it => new WmsOutbale { 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<WmsOutbale>().SetColumns(it => new WmsOutbale { 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);
|
||||||
|
var row = await _wmsCarryService.UpdateNullCarry(carry);
|
||||||
|
isOk = row > 0;
|
||||||
|
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||||
|
|
||||||
|
await _db.Ado.CommitTranAsync();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
await _db.Ado.RollbackTranAsync();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,13 +33,15 @@ namespace Tnb.WarehouseMgr
|
|||||||
private readonly IWareHouseService _warehouseService;
|
private readonly IWareHouseService _warehouseService;
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
private readonly IBillRullService _billRullService;
|
private readonly IBillRullService _billRullService;
|
||||||
|
private readonly IWmsCarryService _carryService;
|
||||||
private const string BizTypeId = "26169472620837";
|
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();
|
_db = repository.AsSugarClient();
|
||||||
_warehouseService = warehouseService;
|
_warehouseService = warehouseService;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
_billRullService = billRullService;
|
_billRullService = billRullService;
|
||||||
|
_carryService = carryService;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 齐套出库(新增状态)
|
/// 齐套出库(新增状态)
|
||||||
@@ -193,8 +195,27 @@ namespace Tnb.WarehouseMgr
|
|||||||
public override async Task ModifyAsync(WareHouseUpInput input)
|
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||||
{
|
{
|
||||||
if (input == null) throw new ArgumentNullException(nameof(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();
|
try
|
||||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
{
|
||||||
|
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