Browse Source

Merge branch 'dev_DY_CC' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_DY_CC

dev_DY_CC
郑勃旭 1 year ago
parent
commit
6e3f13b509
  1. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/MesOut/MesOut.cs
  2. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesOut/MesOutDbContextModelCreatingExtensions.cs
  3. 2
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
  4. 11
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ProductReceiptNote/ProductReceiptNoteDetailExchangeDto.cs
  5. 10
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml
  6. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/IItemBasicAppService.cs
  7. 24
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/ErpCodeRequest.cs
  8. 16
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAppService.cs
  9. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/DTOs/ProductReceiptNoteDetailDTO.cs
  10. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/Inputs/ProductReceiptNoteDetailInput.cs
  11. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAppService.cs
  12. 16
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAutoMapperProfile.cs
  13. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs
  14. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteDetail.cs
  15. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ProductReceiptNotes/ProductReceiptNoteDbContextModelCreatingExtensions.cs
  16. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductReceiveJobAutoMapperProfile.cs
  17. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ProductReceiptRequestMapperProfile.cs
  18. 107
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CoatingIssueNoteEventHandler.cs
  19. 106
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs
  20. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/MesOut/MesOut.cs

@ -11,6 +11,10 @@ public class MesOut : Entity
[Key] [Key]
public string Mesout_ref_nbr { get; set; } public string Mesout_ref_nbr { get; set; }
/// <summary> /// <summary>
/// 条码号(20240430添加)
/// </summary>
public string Mesout_barcode { get; set; }
/// <summary>
/// 调出储位 /// 调出储位
/// </summary> /// </summary>
public string Mesout_id { get; set; } public string Mesout_id { get; set; }
@ -19,6 +23,10 @@ public class MesOut : Entity
/// </summary> /// </summary>
public string Mesout_part { get; set; } public string Mesout_part { get; set; }
/// <summary> /// <summary>
/// 质量补标识(20240430添加)
/// </summary>
public string Mesout_quality { get; set; }
/// <summary>
/// 日期 /// 日期
/// </summary> /// </summary>
public string Mesout_date { get; set; } public string Mesout_date { get; set; }

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesOut/MesOutDbContextModelCreatingExtensions.cs

@ -17,8 +17,10 @@ public static class MesOutDbContextModelCreatingExtensions
//Properties //Properties
b.Property(q => q.Mesout_ref_nbr).HasMaxLength(36); b.Property(q => q.Mesout_ref_nbr).HasMaxLength(36);
b.Property(q => q.Mesout_barcode).HasMaxLength(20);
b.Property(q => q.Mesout_id).HasMaxLength(1); b.Property(q => q.Mesout_id).HasMaxLength(1);
b.Property(q => q.Mesout_part).HasMaxLength(20); b.Property(q => q.Mesout_part).HasMaxLength(20);
b.Property(q => q.Mesout_quality).HasMaxLength(20);
b.Property(q => q.Mesout_date).HasMaxLength(8); b.Property(q => q.Mesout_date).HasMaxLength(8);
b.Property(q => q.Mesout_move).HasPrecision(18, 2); b.Property(q => q.Mesout_move).HasPrecision(18, 2);
b.Property(q => q.Mesout_unable).HasPrecision(18, 2); b.Property(q => q.Mesout_unable).HasPrecision(18, 2);

2
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs

@ -169,7 +169,7 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.ProductReceipt: case EnumIncomingDataType.ProductReceipt:
await SendProductReceipt(workerContext, incomingToWms).ConfigureAwait(false); await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.MaterialRequest: case EnumIncomingDataType.MaterialRequest:
await incomingToWms.HandleMaterialRequestsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleMaterialRequestsAsync(workerContext).ConfigureAwait(false);

11
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ProductReceiptNote/ProductReceiptNoteDetailExchangeDto.cs

@ -61,4 +61,15 @@ public class ProductReceiptNoteDetailExchangeDto
/// 仓库 /// 仓库
/// </summary> /// </summary>
public string WarehouseCode { get; set; } public string WarehouseCode { get; set; }
/// <summary>
/// Mes条码号
/// </summary>
[Display(Name = "Mes条码号")]
public string MesBarCode { get; set; }
/// <summary>
/// Mes质量补标识
/// </summary>
[Display(Name = "Mes质量补标识")]
public string MesQuality { get; set; }
} }

10
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml

@ -861,6 +861,16 @@
仓库 仓库
</summary> </summary>
</member> </member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteDetailExchangeDto.MesBarCode">
<summary>
Mes条码号
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteDetailExchangeDto.MesQuality">
<summary>
Mes质量补标识
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteExchangeDto.CompleteTime"> <member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteExchangeDto.CompleteTime">
<summary> <summary>
完工时间 完工时间

2
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/IItemBasicAppService.cs

@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.tests;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
@ -26,4 +27,5 @@ public interface IItemBasicAppService
Task UpsertAsyncByInterface(ItemBasicEditInput input); Task UpsertAsyncByInterface(ItemBasicEditInput input);
Task UpsertStdPackQtyAsync(string itemCode, decimal stdpackqty); Task UpsertStdPackQtyAsync(string itemCode, decimal stdpackqty);
Task<ErpCodeRequest> GetErpCodeByMesBarCode(string BarCode);
} }

24
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/ErpCodeRequest.cs

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win_in.Sfs.Basedata.tests;
[Serializable]
public class ErpCodeRequest
{
public string ErpCode { set; get; }
public string ProductType { set; get; }
public string ProductColor { set; get; }
public string ProductState { set; get; }
public string ProductProperty { set; get; }
public string From { set; get; }
}

16
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAppService.cs

@ -14,6 +14,7 @@ using Volo.Abp.Validation;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Basedata.Domain.Shared; using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Basedata.tests;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
@ -231,4 +232,19 @@ public class ItemBasicAppService
} }
#endregion #endregion
[HttpPost("get-erp-code-by-mes-barcode")]
public virtual async Task<ErpCodeRequest> GetErpCodeByMesBarCode(string BarCode)
{
var itemBasic = await _repository.GetAsync(p => p.Code == BarCode).ConfigureAwait(false);
ErpCodeRequest rest = new ErpCodeRequest();
rest.ErpCode = itemBasic.Code;
rest.ProductType = itemBasic.Type;
rest.ProductColor = itemBasic.Color;
rest.ProductState = itemBasic.Status.ToString();
rest.ProductProperty = "油漆件";
rest.From = "WIPT";
return rest;
}
} }

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/DTOs/ProductReceiptNoteDetailDTO.cs

@ -39,5 +39,14 @@ public class ProductReceiptNoteDetailDTO : SfsStoreRecommendToDetailWithLotPacki
/// </summary> /// </summary>
[Display(Name = "返线数量")] [Display(Name = "返线数量")]
public decimal ReturnQty { get; set; } public decimal ReturnQty { get; set; }
/// <summary>
/// Mes条码号
/// </summary>
[Display(Name = "Mes条码号")]
public string MesBarCode { get; set; }
/// <summary>
/// Mes质量补标识
/// </summary>
[Display(Name = "Mes质量补标识")]
public string MesQuality { get; set; }
} }

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/Inputs/ProductReceiptNoteDetailInput.cs

@ -45,4 +45,14 @@ public class ProductReceiptNoteDetailInput : SfsStoreRecommendToDetailWithLotPac
/// </summary> /// </summary>
[Display(Name = "返线数量")] [Display(Name = "返线数量")]
public decimal ReturnQty { get; set; } public decimal ReturnQty { get; set; }
/// <summary>
/// Mes条码号
/// </summary>
[Display(Name = "Mes条码号")]
public string MesBarCode { get; set; }
/// <summary>
/// Mes质量补标识
/// </summary>
[Display(Name = "Mes质量补标识")]
public string MesQuality { get; set; }
} }

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAppService.cs

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Win_in.Sfs.Wms.Store.GaoTongs;
internal class GaoTongAppService
{
}

16
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAutoMapperProfile.cs

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
namespace Win_in.Sfs.Wms.Store.Application;
public partial class StoreApplicationAutoMapperProfile : Profile
{
private void GaoTongAutoMapperProfile()
{
}
}

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs

@ -32,5 +32,14 @@ public enum EnumExchangeDataType
//回收料调整 //回收料调整
Item_Transform = 28, Item_Transform = 28,
//半成品上架 //半成品上架
SemiPutaway = 29 SemiPutaway = 29,
/// <summary>
/// 注塑发料
/// </summary>
InjectionIssue=30,
/// <summary>
/// 涂装发料
/// </summary>
CoatingIssue=31,
} }

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteDetail.cs

@ -26,4 +26,13 @@ public class ProductReceiptNoteDetail : SfsStoreRecommendToDetailWithLotPackingQ
/// 返线数量 /// 返线数量
/// </summary> /// </summary>
public decimal ReturnQty { get; set; } public decimal ReturnQty { get; set; }
/// <summary>
/// Mes条码号
/// </summary>
public string MesBarCode { get; set; }
/// <summary>
/// Mes质量补标识
/// </summary>
public string MesQuality { get; set; }
} }

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ProductReceiptNotes/ProductReceiptNoteDbContextModelCreatingExtensions.cs

@ -54,7 +54,8 @@ public static class ProductReceiptNoteDbContextModelCreatingExtensions
b.Property(q => q.LocationCode).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.LocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ReturnQty).HasDefaultValue(0); b.Property(q => q.ReturnQty).HasDefaultValue(0);
b.Property(q => q.Remark).HasMaxLength(SfsPropertyConst.RemarkLength); b.Property(q => q.Remark).HasMaxLength(SfsPropertyConst.RemarkLength);
b.Property(q => q.MesBarCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.MesQuality).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations //Relations
//Indexes //Indexes

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductReceiveJobAutoMapperProfile.cs

@ -45,6 +45,8 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.Shift) .Ignore(x => x.Shift)
.Ignore(x => x.Remark) .Ignore(x => x.Remark)
.Ignore(x => x.ArriveDate) .Ignore(x => x.ArriveDate)
.Ignore(x => x.MesBarCode)
.Ignore(x => x.MesQuality)
; ;
CreateMap<ProductReceiveJobDetail, ExpectInEditInput>() CreateMap<ProductReceiveJobDetail, ExpectInEditInput>()

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ProductReceiptRequestMapperProfile.cs

@ -28,6 +28,8 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.RawLocationCode).Ignore(x => x.Shift).Ignore(x => x.ProdLine) .Ignore(x => x.RawLocationCode).Ignore(x => x.Shift).Ignore(x => x.ProdLine)
.Ignore(x => x.Status) .Ignore(x => x.Status)
.Ignore(x => x.ContainerCode) .Ignore(x => x.ContainerCode)
.Ignore(x => x.MesBarCode)
.Ignore(x => x.MesQuality)
.IgnoreIHasRecommendAndHandledTo(); .IgnoreIHasRecommendAndHandledTo();
} }
} }

107
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CoatingIssueNoteEventHandler.cs

@ -0,0 +1,107 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Notes.IssueNotes;
namespace Win_in.Sfs.Wms.Store.Event.DataExchanges;
/// <summary>
/// 涂装发料记录传给TYRP(线边领料单)
/// </summary>
public class CoatingIssueNoteEventHandler
: StoreDataExchangeEventHandlerBase<CoatingIssueNote>
, ILocalEventHandler<SfsCreatedEntityEventData<CoatingIssueNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<CoatingIssueNote>>>
{
private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.CoatingIssue;
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<CoatingIssueNote> eventData)
{
var entity = eventData.Entity;
await AddExchangeDataAsync(entity).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<CoatingIssueNote>> eventData)
{
var entities = eventData.Entity;
await AddExchangeDataAsync(entities).ConfigureAwait(false);
}
protected override async Task AddExchangeDataAsync(List<CoatingIssueNote> entities)
{
var dtos = ObjectMapper.Map<List<CoatingIssueNote>, List<CoatingIssueNoteDTO>>(entities);
foreach (var detail in dtos.SelectMany(dto => dto.Details))
{
if (string.IsNullOrEmpty(detail.HandledFromLocationErpCode))
{
var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false);
if (location != null)
{
detail.HandledFromLocationErpCode = location.ErpLocationCode;
detail.HandledFromLocationGroup = location.LocationGroupCode;
detail.HandledFromLocationArea = location.AreaCode;
if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode))
{
detail.HandledFromWarehouseCode = location.WarehouseCode;
}
}
}
if (string.IsNullOrEmpty(detail.HandledToLocationErpCode))
{
var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false);
if (location != null)
{
detail.HandledToLocationErpCode = location.ErpLocationCode;
detail.HandledToLocationGroup = location.LocationGroupCode;
detail.HandledToLocationArea = location.AreaCode;
if (string.IsNullOrEmpty(detail.HandledToWarehouseCode))
{
detail.HandledToWarehouseCode = location.WarehouseCode;
}
}
}
}
var toErpDto = new List<CoatingIssueNoteDTO>();
foreach (var item in dtos)
{
if (item.Details != null && item.Details.Count != 0)
{
toErpDto.Add(item);
}
}
//2023-12-6要求同储位不传入接口 按历史规则
var result = new List<CoatingIssueNoteDTO>();
foreach (var injectionIssueNoteDto in toErpDto)
{
injectionIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.HandledToLocationErpCode);
if (injectionIssueNoteDto.Details.Count > 0)
{
result.Add(injectionIssueNoteDto);
}
}
if (result.Count > 0)
{
var exchangeDataerp =
await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, result)
.ConfigureAwait(false);
await AddManyAsync(exchangeDataerp).ConfigureAwait(false);
}
}
}

106
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs

@ -0,0 +1,106 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Event.DataExchanges;
/// <summary>
/// 注塑发料记录传给TYRP(线边领料单)
/// </summary>
public class InjectionIssueNoteEventHandler
: StoreDataExchangeEventHandlerBase<InjectionIssueNote>
, ILocalEventHandler<SfsCreatedEntityEventData<InjectionIssueNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<InjectionIssueNote>>>
{
private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.InjectionIssue;
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<InjectionIssueNote> eventData)
{
var entity = eventData.Entity;
await AddExchangeDataAsync(entity).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<InjectionIssueNote>> eventData)
{
var entities = eventData.Entity;
await AddExchangeDataAsync(entities).ConfigureAwait(false);
}
protected override async Task AddExchangeDataAsync(List<InjectionIssueNote> entities)
{
var dtos = ObjectMapper.Map<List<InjectionIssueNote>, List<InjectionIssueNoteDTO>>(entities);
foreach (var detail in dtos.SelectMany(dto => dto.Details))
{
if(string.IsNullOrEmpty(detail.HandledFromLocationErpCode))
{
var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false);
if (location != null)
{
detail.HandledFromLocationErpCode = location.ErpLocationCode;
detail.HandledFromLocationGroup = location.LocationGroupCode;
detail.HandledFromLocationArea = location.AreaCode;
if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode))
{
detail.HandledFromWarehouseCode = location.WarehouseCode;
}
}
}
if(string.IsNullOrEmpty(detail.HandledToLocationErpCode))
{
var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false);
if (location != null)
{
detail.HandledToLocationErpCode = location.ErpLocationCode;
detail.HandledToLocationGroup = location.LocationGroupCode;
detail.HandledToLocationArea = location.AreaCode;
if (string.IsNullOrEmpty(detail.HandledToWarehouseCode))
{
detail.HandledToWarehouseCode = location.WarehouseCode;
}
}
}
}
var toErpDto = new List<InjectionIssueNoteDTO>();
foreach (var item in dtos)
{
if (item.Details != null && item.Details.Count != 0)
{
toErpDto.Add(item);
}
}
//2023-12-6要求同储位不传入接口 按历史规则
var result = new List<InjectionIssueNoteDTO>();
foreach (var injectionIssueNoteDto in toErpDto)
{
injectionIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.HandledToLocationErpCode);
if (injectionIssueNoteDto.Details.Count > 0)
{
result.Add(injectionIssueNoteDto);
}
}
if (result.Count > 0)
{
var exchangeDataerp =
await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, result)
.ConfigureAwait(false);
await AddManyAsync(exchangeDataerp).ConfigureAwait(false);
}
}
}

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs

@ -32,10 +32,9 @@ namespace Win_in.Sfs.Wms.Store.Event.DataExchanges
await AddExchangeDataAsync(entity).ConfigureAwait(false); await AddExchangeDataAsync(entity).ConfigureAwait(false);
} }
protected override async Task AddExchangeDataAsync(List<ThirdLocationNote> entities) protected override async Task AddExchangeDataAsync(List<ThirdLocationNote> entities)
{ {
var dtos = ObjectMapper.Map<List<ThirdLocationNote>, List<TransferNoteDTO>>(entities); var dtos = ObjectMapper.Map<List<ThirdLocationNote>, List<ThirdLocationNoteDTO>>(entities);
var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Transfer, dtos).ConfigureAwait(false); var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Transfer, dtos).ConfigureAwait(false);
await AddManyAsync(exchangeData).ConfigureAwait(false); await AddManyAsync(exchangeData).ConfigureAwait(false);

Loading…
Cancel
Save