|
|
@ -16,7 +16,7 @@ using Win_in.Sfs.Wms.Store.Application; |
|
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|
|
|
using Win_in.Sfs.Wms.Store.Domain.Shared; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs.CoatingIssueJobs; |
|
|
|
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs; |
|
|
|
|
|
|
|
[Authorize] |
|
|
|
[Route($"{StoreConsts.RootPath}coatingissue-job")] |
|
|
@ -171,7 +171,6 @@ public class CoatingIssueJobAppService |
|
|
|
var detail = job.Details.FirstOrDefault(p => p.RecommendPackingCode == input.FromPackingCode); /*&& p.HandledQty == input.FromQty*/ |
|
|
|
if (detail == null) |
|
|
|
{ |
|
|
|
//throw new UserFriendlyException($"根据HandledPackingCode={input.FromPackingCode}取CoatingIssueJobDetail表为空!");
|
|
|
|
throw new UserFriendlyException($"根据RecommendPackingCode={input.FromPackingCode}取CoatingIssueJobDetail表为空!"); |
|
|
|
} |
|
|
|
//插入目标箱
|
|
|
@ -192,89 +191,5 @@ public class CoatingIssueJobAppService |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="jobNumber"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("accept")] |
|
|
|
public override async Task AcceptAsync(string jobNumber) |
|
|
|
{ |
|
|
|
var input = new IssueJobCheckInput |
|
|
|
{ |
|
|
|
JobStatuses = new List<EnumJobStatus>() { EnumJobStatus.New }, |
|
|
|
}; |
|
|
|
var dto = await CheckAsync(jobNumber, input); |
|
|
|
await _issueJobManager.AcceptAsync(dto.Id, CurrentUser.Id ?? Guid.Empty); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 执行任务时,修改实际数量
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="dto"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpPost("handle")] |
|
|
|
public override async Task HandleAsync(IssueJobDTO dto) |
|
|
|
{ |
|
|
|
var input = new IssueJobCheckInput |
|
|
|
{ |
|
|
|
JobStatuses = new List<EnumJobStatus>() { EnumJobStatus.Pending }, |
|
|
|
}; |
|
|
|
|
|
|
|
await CheckAsync(dto.Number, input); |
|
|
|
|
|
|
|
var entity = ObjectMapper.Map<IssueJobDTO, IssueJob>(dto); |
|
|
|
await _issueJobManager.HandleAsync(entity, CurrentUser.Id ?? Guid.Empty); |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("check")] |
|
|
|
public override async Task<IssueJobDTO> CheckAsync(string jobNumber, IssueJobCheckInput input) |
|
|
|
{ |
|
|
|
var result = new AbpValidationResult(); |
|
|
|
_issueJobManager.CheckFormat(jobNumber); |
|
|
|
var dto = await GetByNumberAsync(jobNumber); |
|
|
|
var entity = ObjectMapper.Map<IssueJobDTO, IssueJob>(dto); |
|
|
|
_issueJobManager.CheckJobStatus(entity, input.JobStatuses, result); |
|
|
|
_issueJobManager.CheckDetails(entity, result); |
|
|
|
//TODO 添加其它校验
|
|
|
|
if (result.Errors.Any()) |
|
|
|
{ |
|
|
|
throw new AbpValidationException(result.Errors); |
|
|
|
} |
|
|
|
|
|
|
|
return dto; |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
///// 临时解决方案 解决创建补料的订阅事件无法返回错误信息的问题
|
|
|
|
///// </summary>
|
|
|
|
///// <param name="materialRequestHandledETO"></param>
|
|
|
|
///// <returns></returns>
|
|
|
|
//[Authorize(IssueJobPermissions.Create)]
|
|
|
|
//[HttpPost("create-by-eto")]
|
|
|
|
//public virtual async Task<MaterialRequestHandledETO> CreateByEtoAsync(MaterialRequestHandledETO materialRequestHandledETO)
|
|
|
|
//{
|
|
|
|
// await _issueJobManager.AddByEtoAsync(materialRequestHandledETO);
|
|
|
|
|
|
|
|
// return new MaterialRequestHandledETO();
|
|
|
|
//}
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
///// 临时解决方案 解决创建补料的订阅事件无法返回错误信息的问题
|
|
|
|
///// </summary>
|
|
|
|
///// <param name="materialRequestHandledETO"></param>
|
|
|
|
///// <returns></returns>
|
|
|
|
//[Authorize(IssueJobPermissions.Create)]
|
|
|
|
//[HttpPost("create-by-eto2")]
|
|
|
|
//public virtual async Task<IssueJobDTO> CreateByEtoAsync2(MaterialRequestHandledETO materialRequestHandledETO)
|
|
|
|
//{
|
|
|
|
// await _issueJobManager.TestError();
|
|
|
|
|
|
|
|
// return new IssueJobDTO();
|
|
|
|
//} list-by
|
|
|
|
|
|
|
|
} |
|
|
|