优化接口

This commit is contained in:
tongfei
2024-01-03 15:21:17 +08:00
parent ee39854850
commit 0c26ff7602

View File

@@ -31,16 +31,19 @@ namespace WMS.Web.Domain.Services
private readonly IBoxInventoryService _boxInventoryService; private readonly IBoxInventoryService _boxInventoryService;
private readonly IChangeMoveBoxService _changeMoveBoxService; private readonly IChangeMoveBoxService _changeMoveBoxService;
private readonly ISerialNumbersRepositories _serialNumbersRepositories; private readonly ISerialNumbersRepositories _serialNumbersRepositories;
private readonly IInStockTaskBoxService _inStockTaskBoxService;
public BackRecordService(IMapper mapper, ILoginService loginService, public BackRecordService(IMapper mapper, ILoginService loginService,
IBasicsRepositories basicsRepositories, IBasicsRepositories basicsRepositories,
IBoxInventoryService boxInventoryService, IBoxInventoryService boxInventoryService,
ISerialNumberService serialNumberService, ISerialNumberService serialNumberService,
IChangeMoveBoxService changeMoveBoxService, IChangeMoveBoxService changeMoveBoxService,
ISerialNumbersRepositories serialNumbersRepositories, ISerialNumbersRepositories serialNumbersRepositories,
IBackRecordRepositories backRecordRepositories) IBackRecordRepositories backRecordRepositories,
IInStockTaskBoxService inStockTaskBoxService)
{ {
_mapper = mapper; _mapper = mapper;
_loginService = loginService; _loginService = loginService;
_inStockTaskBoxService = inStockTaskBoxService;
_changeMoveBoxService = changeMoveBoxService; _changeMoveBoxService = changeMoveBoxService;
_serialNumberService = serialNumberService; _serialNumberService = serialNumberService;
_boxInventoryService = boxInventoryService; _boxInventoryService = boxInventoryService;
@@ -140,6 +143,15 @@ namespace WMS.Web.Domain.Services
if (!boxInventoryResult.IsSuccess) if (!boxInventoryResult.IsSuccess)
return boxInventoryResult; return boxInventoryResult;
//下架:需要解绑收货过的箱子
if (entity.Type == BackRecordType.InstockOff)
{
var boxIds= entity.Details.GroupBy(x => x.BoxId).Select(x => x.Key).ToList();
var unBindResult= await _inStockTaskBoxService.UnBind(boxIds, isTransaction);
if (!unBindResult.IsSuccess)
return unBindResult;
}
//提交事务 //提交事务
var isSuccess = _basicsRepositories.CommitTransaction(isRollback, _transaction); var isSuccess = _basicsRepositories.CommitTransaction(isRollback, _transaction);
if (!isSuccess) if (!isSuccess)