箱库存
This commit is contained in:
@@ -20,7 +20,7 @@ namespace WMS.Web.Domain.Services
|
||||
/// <summary>
|
||||
/// 出入库回退上下架:服务接口
|
||||
/// </summary>
|
||||
public class BackRecordService: IBackRecordService
|
||||
public class BackRecordService : IBackRecordService
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly ILoginService _loginService;
|
||||
@@ -60,29 +60,28 @@ namespace WMS.Web.Domain.Services
|
||||
entity.Create(loginInfo.UserInfo.StaffId);
|
||||
entity = await _backRecordRepositories.Add(entity, isTransaction);
|
||||
|
||||
|
||||
|
||||
if (entity == null)
|
||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
//保存成功后:序列号跟踪流程添加
|
||||
var serialNumber_result = await _serialNumberService.BackRecord(entity, loginInfo, isTransaction);
|
||||
if (!serialNumber_result.IsSuccess)
|
||||
return serialNumber_result;
|
||||
|
||||
//保存成功后:变更库存
|
||||
var entitys = new List<BackRecord>();
|
||||
entitys.Add(entity);
|
||||
var boxInventoryResult = await _boxInventoryService.GenerateBackBox(entitys, isTransaction);
|
||||
if (!boxInventoryResult.IsSuccess)
|
||||
return boxInventoryResult;
|
||||
|
||||
//提交事务
|
||||
var isSuccess = _basicsRepositories.CommitTransaction(isRollback, _transaction);
|
||||
if (!isSuccess)
|
||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
return Result.ReSuccess();
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
//保存成功后:序列号跟踪流程添加
|
||||
var serialNumber_result = await _serialNumberService.BackRecord(entity, loginInfo, isTransaction);
|
||||
if (!serialNumber_result.IsSuccess)
|
||||
return serialNumber_result;
|
||||
|
||||
//保存成功后:变更库存
|
||||
var entitys = new List<BackRecord>();
|
||||
entitys.Add(entity);
|
||||
var boxInventoryResult= await _boxInventoryService.GenerateBackBox(entitys, isTransaction);
|
||||
if (!boxInventoryResult.IsSuccess)
|
||||
return boxInventoryResult;
|
||||
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
else
|
||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user