优化接口

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 IChangeMoveBoxService _changeMoveBoxService;
private readonly ISerialNumbersRepositories _serialNumbersRepositories;
private readonly IInStockTaskBoxService _inStockTaskBoxService;
public BackRecordService(IMapper mapper, ILoginService loginService,
IBasicsRepositories basicsRepositories,
IBoxInventoryService boxInventoryService,
ISerialNumberService serialNumberService,
IChangeMoveBoxService changeMoveBoxService,
ISerialNumbersRepositories serialNumbersRepositories,
IBackRecordRepositories backRecordRepositories)
IBackRecordRepositories backRecordRepositories,
IInStockTaskBoxService inStockTaskBoxService)
{
_mapper = mapper;
_loginService = loginService;
_inStockTaskBoxService = inStockTaskBoxService;
_changeMoveBoxService = changeMoveBoxService;
_serialNumberService = serialNumberService;
_boxInventoryService = boxInventoryService;
@@ -140,6 +143,15 @@ namespace WMS.Web.Domain.Services
if (!boxInventoryResult.IsSuccess)
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);
if (!isSuccess)