|
|
@ -6,11 +6,8 @@ using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.ObjectMapping; |
|
|
|
using Win_in.Sfs.Basedata.Domain.Shared; |
|
|
|
using Win_in.Sfs.FileStorage.Application.Contracts; |
|
|
|
using Win_in.Sfs.Shared.Domain.Shared; |
|
|
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Inspect; |
|
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|
|
|
using Win_in.Sfs.Wms.Store.Domain; |
|
|
|
using Win_in.Sfs.Wms.Store.Domain.Shared; |
|
|
@ -66,7 +63,8 @@ public class InspectJobAppService |
|
|
|
|
|
|
|
var summaryDetail = ObjectMapper.Map<InspectJobCompleteSummaryDetailInput, InspectJobSummaryDetail>(input); |
|
|
|
|
|
|
|
var entity = await _inspectJobManager.CompleteSummaryDetailStatusAsync(id, summaryDetailId, summaryDetail, CurrentUser).ConfigureAwait(false); |
|
|
|
var entity = await _inspectJobManager |
|
|
|
.CompleteSummaryDetailStatusAsync(id, summaryDetailId, summaryDetail, CurrentUser).ConfigureAwait(false); |
|
|
|
|
|
|
|
return ObjectMapper.Map<InspectJobSummaryDetail, InspectJobSummaryDetailDTO>(entity); |
|
|
|
} |
|
|
@ -102,7 +100,8 @@ public class InspectJobAppService |
|
|
|
/// <param name="detailDto"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("set-detail-nook-status/{id}")] |
|
|
|
public virtual async Task<InspectJobSummaryDetailDTO> SetDetailNoOkStatusAsync(Guid id, InspectJobDetailDTO detailDto) |
|
|
|
public virtual async Task<InspectJobSummaryDetailDTO> SetDetailNoOkStatusAsync(Guid id, |
|
|
|
InspectJobDetailDTO detailDto) |
|
|
|
{ |
|
|
|
var entity = ObjectMapper.Map<InspectJobDetailDTO, InspectJobDetail>(detailDto); |
|
|
|
|
|
|
@ -142,18 +141,28 @@ public class InspectJobAppService |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 批量设置质检状态
|
|
|
|
/// 批量设置质检状态
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <param name="detailIdList"></param>
|
|
|
|
/// <param name="detailDto"></param>
|
|
|
|
/// <param name="detailManyDto"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("Set-Many-Detail-Status")] |
|
|
|
public virtual async Task<InspectJobDTO> SetManyDetailStatusAsync(Guid id, List<Guid> detailIdList, InspectJobDetailDTO detailDto) |
|
|
|
public virtual async Task<InspectJobDTO> SetManyDetailStatusAsync(Guid id, InspectJobDetailManyDTO detailManyDto) |
|
|
|
{ |
|
|
|
var guidstr = detailManyDto.GuidList; |
|
|
|
var guidstrList = guidstr.Split(','); |
|
|
|
var guidList = new List<Guid>(); |
|
|
|
foreach (var guidStr in guidstrList) |
|
|
|
{ |
|
|
|
guidList.Add(Guid.Parse(guidStr)); |
|
|
|
} |
|
|
|
|
|
|
|
var detailDto = (InspectJobDetailDTO)detailManyDto; |
|
|
|
|
|
|
|
var entityDetail = ObjectMapper.Map<InspectJobDetailDTO, InspectJobDetail>(detailDto); |
|
|
|
|
|
|
|
var entity=await _inspectJobManager.SetManyDetailStatusAsync(id,detailIdList, entityDetail).ConfigureAwait(false); |
|
|
|
var entity = await _inspectJobManager.SetManyDetailStatusAsync(id, guidList, entityDetail) |
|
|
|
.ConfigureAwait(false); |
|
|
|
|
|
|
|
return ObjectMapper.Map<InspectJob, InspectJobDTO>(entity); |
|
|
|
} |
|
|
@ -175,7 +184,9 @@ public class InspectJobAppService |
|
|
|
[HttpPost("get-job/by-detail-packing")] |
|
|
|
public virtual async Task<InspectJobDTO> GetInspectNoteDetailByPackingCodeAsync(string packingCode) |
|
|
|
{ |
|
|
|
var entity = (await _repository.GetListAsync(p => p.Details.Any(y => y.PackingCode == packingCode), true).ConfigureAwait(false)).FirstOrDefault(); |
|
|
|
var entity = |
|
|
|
(await _repository.GetListAsync(p => p.Details.Any(y => y.PackingCode == packingCode), true) |
|
|
|
.ConfigureAwait(false)).FirstOrDefault(); |
|
|
|
|
|
|
|
var dto = ObjectMapper.Map<InspectJob, InspectJobDTO>(entity); |
|
|
|
|
|
|
@ -183,18 +194,21 @@ public class InspectJobAppService |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 保存拆箱时涉及的明细修改
|
|
|
|
/// 保存拆箱时涉及的明细修改
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("save-detail-split-packing")] |
|
|
|
public virtual async Task<InspectJobDTO> SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input) |
|
|
|
{ |
|
|
|
InspectJob job = await _repository.FindAsync(p => p.Number == input.Number).ConfigureAwait(false); |
|
|
|
InspectJobDetail detail = job.Details.FirstOrDefault(p => p.PackingCode == input.FromPackingCode); /* && p.ReceiveQty == input.FromQty*/ |
|
|
|
var job = await _repository.FindAsync(p => p.Number == input.Number).ConfigureAwait(false); |
|
|
|
var detail = |
|
|
|
job.Details.FirstOrDefault(p => |
|
|
|
p.PackingCode == input.FromPackingCode); /* && p.ReceiveQty == input.FromQty*/ |
|
|
|
if (detail == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"根据PackingCode={input.FromPackingCode}取InspectDetail表为空!"); |
|
|
|
} |
|
|
|
|
|
|
|
//插入目标箱
|
|
|
|
var newDetail = CommonHelper.CloneObj(detail); |
|
|
|
newDetail.SetId(GuidGenerator.Create()); |
|
|
|