Browse Source

成品发运修改

dev_DY_CC
lvzb 1 year ago
parent
commit
3f9c543d73
  1. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Boms/IBomAppService.cs
  2. 13
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs
  3. 17
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs
  4. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/IBomManager.cs
  5. 15
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs

2
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Boms/IBomAppService.cs

@ -41,5 +41,5 @@ public interface IBomAppService
/// <param name="productNum">总成数量</param> /// <param name="productNum">总成数量</param>
/// <returns></returns> /// <returns></returns>
Task<List<BomDTO>> GetMaterialTotalQtyAsync(string productCode, int productNum); Task<List<BomDTO>> GetMaterialTotalQtyAsync(string productCode, int productNum);
Task<List<BomDTO>> GetBomTreeByCodeAsync(string productCode);
} }

13
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs

@ -90,7 +90,20 @@ public class BomAppService :
{ {
return await _bomManager.GetListOfComponentAsync(component).ConfigureAwait(false); return await _bomManager.GetListOfComponentAsync(component).ConfigureAwait(false);
} }
/// <summary>
/// 获取bomtree
/// </summary>
/// <param name="component"></param>
/// <returns></returns>
[HttpGet("get-bom-tree-by-code")]
public virtual async Task<List<BomDTO>> GetBomTreeByCodeAsync(string productCode)
{
var entities = await _bomManager.GetAllItemByCode(productCode).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<Bom>, List<BomDTO>>(entities);
return dtos;
}
/// <summary> /// <summary>
/// 获取所有子物料关系 /// 获取所有子物料关系
/// </summary> /// </summary>

17
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs

@ -213,4 +213,21 @@ public class BomManager : DomainService, IBomManager
} }
return lst; return lst;
} }
/// <summary>
/// 获取所有bomtree
/// </summary>
/// <param name="productCode"></param>
/// <returns></returns>
public virtual async Task<List<Bom>> GetAllItemByCode(string productCode)
{
List<Bom> boms = new List<Bom>();
var lst = await _repository.GetListAsync(p => p.Product == productCode).ConfigureAwait(false);
foreach (var bom in lst)
{
boms.Add(bom);
var results= await GetAllItemByCode(bom.Component).ConfigureAwait(false);
boms.AddRange(results);
}
return boms;
}
} }

2
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/IBomManager.cs

@ -40,5 +40,5 @@ public interface IBomManager : IDomainService, IBulkImportService<Bom>
/// <param name="productNum">总成数量</param> /// <param name="productNum">总成数量</param>
/// <returns></returns> /// <returns></returns>
Task<List<Bom>> GetMaterialTotalQtyAsync(string productCode, int productNum); Task<List<Bom>> GetMaterialTotalQtyAsync(string productCode, int productNum);
Task<List<Bom>> GetAllItemByCode(string productCode);
} }

15
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs

@ -69,7 +69,7 @@ public class DeliverRequestAppService :
public override async Task<DeliverRequestDTO> CreateAsync(DeliverRequestEditInput input) public override async Task<DeliverRequestDTO> CreateAsync(DeliverRequestEditInput input)
{ {
var entity = ObjectMapper.Map<DeliverRequestEditInput, DeliverRequest>(input); var entity = ObjectMapper.Map<DeliverRequestEditInput, DeliverRequest>(input);
await SetRequestAutoPropertiesAsync(entity).ConfigureAwait(false);
await _deliverRequestManager.CreateAsync(entity).ConfigureAwait(false); await _deliverRequestManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<DeliverRequest, DeliverRequestDTO>(entity); var dto = ObjectMapper.Map<DeliverRequest, DeliverRequestDTO>(entity);
@ -248,7 +248,16 @@ public class DeliverRequestAppService :
private async Task SetRequestAutoPropertiesAsync(DeliverRequest entity) private async Task SetRequestAutoPropertiesAsync(DeliverRequest entity)
{ {
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Deliver, EnumTransSubType.Deliver_Standard).ConfigureAwait(false); var transType = EnumTransSubType.Deliver_Standard;
if (entity.DeliverRequestType == EnumDeliverRequestType.FIS)
{
transType = EnumTransSubType.Deliver_FIS;
}
else if (entity.DeliverRequestType == EnumDeliverRequestType.RAW)
{
transType = EnumTransSubType.Deliver_RAW;
}
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Deliver, transType).ConfigureAwait(false);
Check.NotNull(tranType, "事务类型", "事务类型不存在"); Check.NotNull(tranType, "事务类型", "事务类型不存在");
@ -257,7 +266,7 @@ public class DeliverRequestAppService :
entity.AutoAgree = tranType.AutoAgreeRequest; entity.AutoAgree = tranType.AutoAgreeRequest;
entity.AutoHandle = tranType.AutoHandleRequest; entity.AutoHandle = tranType.AutoHandleRequest;
entity.DirectCreateNote = tranType.DirectCreateNote; entity.DirectCreateNote = tranType.DirectCreateNote;
entity.DeliverRequestType = EnumDeliverRequestType.Normal; entity.DeliverRequestType = entity.DeliverRequestType;
} }
private static void CheckTransactionType(TransactionTypeDTO transactionType, ItemBasicDTO item) private static void CheckTransactionType(TransactionTypeDTO transactionType, ItemBasicDTO item)

Loading…
Cancel
Save