|
|
@ -1,10 +1,12 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Volo.Abp.Application.Dtos; |
|
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
|
using Win_in.Sfs.Shared.Domain; |
|
|
|
using Win_in.Sfs.Store.Application.Contracts; |
|
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|
|
@ -25,9 +27,11 @@ public class ChassisOperationSequenceAppService |
|
|
|
private new readonly IChassisOperationSequenceRepository _repository; |
|
|
|
private readonly IChassisOperationSequenceManager _manager; |
|
|
|
private readonly IChassisAppService _chassisAppService; |
|
|
|
private readonly IKittingAppService _kittingAppService; |
|
|
|
private readonly IBomAppService _bomAppService; |
|
|
|
|
|
|
|
public ChassisOperationSequenceAppService( |
|
|
|
IChassisOperationSequenceRepository repository, IChassisOperationSequenceManager manager, IChassisAppService chassisAppService) : base(repository) |
|
|
|
IChassisOperationSequenceRepository repository, IChassisOperationSequenceManager manager, IChassisAppService chassisAppService, IKittingAppService kittingAppService, IBomAppService bomAppService) : base(repository) |
|
|
|
{ |
|
|
|
base.CreatePolicyName = ChassisOperationSequencePermissions.Create; |
|
|
|
base.UpdatePolicyName = ChassisOperationSequencePermissions.Update; |
|
|
@ -36,6 +40,8 @@ public class ChassisOperationSequenceAppService |
|
|
|
_repository = repository; |
|
|
|
_manager = manager; |
|
|
|
_chassisAppService = chassisAppService; |
|
|
|
_kittingAppService = kittingAppService; |
|
|
|
_bomAppService = bomAppService; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -99,9 +105,51 @@ public class ChassisOperationSequenceAppService |
|
|
|
return await _chassisAppService.GetPagedListByFilterAsync(requestInput,false, cancellationToken).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<> GetBomWithKittingBom() |
|
|
|
[HttpPost("get-list-with-kitting-bom-chassis-bom")] |
|
|
|
public async Task<List<ChassisOperationSequenceSearchDTO>> GetBomWithKittingBomAsync(Dictionary<string,string> dictChassisItemCode,string kittingCode) |
|
|
|
{ |
|
|
|
//dictChassisItemCode key是底盘号 value是总成
|
|
|
|
|
|
|
|
//获取KittingCode用的ItemCode
|
|
|
|
var kittingDto =await _kittingAppService.GetByCodeAsync(kittingCode).ConfigureAwait(false); |
|
|
|
var kittingItemCodeList = new List<string>(); |
|
|
|
foreach (var detail in kittingDto.Details) |
|
|
|
{ |
|
|
|
kittingItemCodeList.Add(detail.ItemCode); |
|
|
|
} |
|
|
|
|
|
|
|
//用来存储所有底盘的BOM 只查询一次
|
|
|
|
var chassisBomItemCodeList= new Dictionary<string, List<string>>(); |
|
|
|
foreach (var dict in dictChassisItemCode) |
|
|
|
{ |
|
|
|
var bomDtos = await _bomAppService.GetBomTreeByCodeAsync(dict.Value).ConfigureAwait(false); |
|
|
|
var chassisItemCodeBomList = new List<string>(); |
|
|
|
foreach (var dto in bomDtos) |
|
|
|
{ |
|
|
|
chassisItemCodeBomList.Add(dto.Component); |
|
|
|
} |
|
|
|
|
|
|
|
chassisBomItemCodeList.Add(dict.Key, chassisItemCodeBomList); |
|
|
|
} |
|
|
|
|
|
|
|
//要求显示根据总成做主条件
|
|
|
|
var listChassisOperationSequenceSearchList=new List<ChassisOperationSequenceSearchDTO>(); |
|
|
|
foreach (var itemCode in kittingItemCodeList) |
|
|
|
{ |
|
|
|
var listChassisOperationSequenceSearchDto =new ChassisOperationSequenceSearchDTO(); |
|
|
|
|
|
|
|
listChassisOperationSequenceSearchDto.ItemCode = itemCode; |
|
|
|
|
|
|
|
foreach (var dict in chassisBomItemCodeList) |
|
|
|
{ |
|
|
|
if (dict.Value.Contains(itemCode)) |
|
|
|
{ |
|
|
|
listChassisOperationSequenceSearchDto.ChassisNumberList.Add(dict.Key); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return listChassisOperationSequenceSearchList; |
|
|
|
} |
|
|
|
|
|
|
|
#region 无用
|
|
|
|