From 8b7fd1d66be46b6b2bd1318ed5843ec5c83959fa Mon Sep 17 00:00:00 2001
From: lvzb <35200379@qq.com>
Date: Mon, 6 May 2024 10:55:13 +0800
Subject: [PATCH 1/4] =?UTF-8?q?mes=E7=BC=B4=E5=BA=93=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MesOut/MesOut.cs | 8 +++++++
.../MesOutDbContextModelCreatingExtensions.cs | 2 ++
.../IncomingToWmsWorker.cs | 2 +-
.../ProductReceiptNoteDetailExchangeDto.cs | 11 +++++++++
...Wms.DataExchange.Application.Contracts.xml | 10 ++++++++
.../ItemBasics/IItemBasicAppService.cs | 2 ++
.../tests/ErpCodeRequest.cs | 24 +++++++++++++++++++
.../Items/ItemBasicAppService.cs | 16 +++++++++++++
.../DTOs/ProductReceiptNoteDetailDTO.cs | 11 ++++++++-
.../Inputs/ProductReceiptNoteDetailInput.cs | 10 ++++++++
.../ProductReceiptNoteDetail.cs | 9 +++++++
...iptNoteDbContextModelCreatingExtensions.cs | 3 ++-
.../ProductReceiveJobAutoMapperProfile.cs | 2 ++
.../ProductReceiptRequestMapperProfile.cs | 2 ++
14 files changed, 109 insertions(+), 3 deletions(-)
create mode 100644 be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/ErpCodeRequest.cs
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/MesOut/MesOut.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/MesOut/MesOut.cs
index 34a5aee52..de58a3987 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/MesOut/MesOut.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/MesOut/MesOut.cs
@@ -11,6 +11,10 @@ public class MesOut : Entity
[Key]
public string Mesout_ref_nbr { get; set; }
///
+ /// 条码号(20240430添加)
+ ///
+ public string Mesout_barcode { get; set; }
+ ///
/// 调出储位
///
public string Mesout_id { get; set; }
@@ -19,6 +23,10 @@ public class MesOut : Entity
///
public string Mesout_part { get; set; }
///
+ /// 质量补标识(20240430添加)
+ ///
+ public string Mesout_quality { get; set; }
+ ///
/// 日期
///
public string Mesout_date { get; set; }
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesOut/MesOutDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesOut/MesOutDbContextModelCreatingExtensions.cs
index 61d77b269..0b8bdd2ff 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesOut/MesOutDbContextModelCreatingExtensions.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesOut/MesOutDbContextModelCreatingExtensions.cs
@@ -17,8 +17,10 @@ public static class MesOutDbContextModelCreatingExtensions
//Properties
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_part).HasMaxLength(20);
+ b.Property(q => q.Mesout_quality).HasMaxLength(20);
b.Property(q => q.Mesout_date).HasMaxLength(8);
b.Property(q => q.Mesout_move).HasPrecision(18, 2);
b.Property(q => q.Mesout_unable).HasPrecision(18, 2);
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
index 4120b94f6..6a6071789 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
+++ b/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);
break;
case EnumIncomingDataType.ProductReceipt:
- await SendProductReceipt(workerContext, incomingToWms).ConfigureAwait(false);
+ await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.MaterialRequest:
await incomingToWms.HandleMaterialRequestsAsync(workerContext).ConfigureAwait(false);
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ProductReceiptNote/ProductReceiptNoteDetailExchangeDto.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ProductReceiptNote/ProductReceiptNoteDetailExchangeDto.cs
index 1ee7279d5..fe2722182 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ProductReceiptNote/ProductReceiptNoteDetailExchangeDto.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ProductReceiptNote/ProductReceiptNoteDetailExchangeDto.cs
@@ -61,4 +61,15 @@ public class ProductReceiptNoteDetailExchangeDto
/// 仓库
///
public string WarehouseCode { get; set; }
+
+ ///
+ /// Mes条码号
+ ///
+ [Display(Name = "Mes条码号")]
+ public string MesBarCode { get; set; }
+ ///
+ /// Mes质量补标识
+ ///
+ [Display(Name = "Mes质量补标识")]
+ public string MesQuality { get; set; }
}
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml
index a9660cc25..e614f4317 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml
@@ -861,6 +861,16 @@
仓库
+
+
+ Mes条码号
+
+
+
+
+ Mes质量补标识
+
+
完工时间
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/IItemBasicAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/IItemBasicAppService.cs
index da616e239..59739fcba 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/IItemBasicAppService.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/IItemBasicAppService.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
+using Win_in.Sfs.Basedata.tests;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
@@ -26,4 +27,5 @@ public interface IItemBasicAppService
Task UpsertAsyncByInterface(ItemBasicEditInput input);
Task UpsertStdPackQtyAsync(string itemCode, decimal stdpackqty);
+ Task GetErpCodeByMesBarCode(string BarCode);
}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/ErpCodeRequest.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/ErpCodeRequest.cs
new file mode 100644
index 000000000..ebd3c4da9
--- /dev/null
+++ b/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; }
+}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAppService.cs
index fc7d9b96d..b5a28e7d7 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAppService.cs
+++ b/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.Domain;
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.Shared;
@@ -231,4 +232,19 @@ public class ItemBasicAppService
}
#endregion
+ [HttpPost("get-erp-code-by-mes-barcode")]
+ public virtual async Task 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;
+ }
+
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/DTOs/ProductReceiptNoteDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/DTOs/ProductReceiptNoteDetailDTO.cs
index 9003ca7c8..361859c3f 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/DTOs/ProductReceiptNoteDetailDTO.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/DTOs/ProductReceiptNoteDetailDTO.cs
@@ -39,5 +39,14 @@ public class ProductReceiptNoteDetailDTO : SfsStoreRecommendToDetailWithLotPacki
///
[Display(Name = "返线数量")]
public decimal ReturnQty { get; set; }
-
+ ///
+ /// Mes条码号
+ ///
+ [Display(Name = "Mes条码号")]
+ public string MesBarCode { get; set; }
+ ///
+ /// Mes质量补标识
+ ///
+ [Display(Name = "Mes质量补标识")]
+ public string MesQuality { get; set; }
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/Inputs/ProductReceiptNoteDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/Inputs/ProductReceiptNoteDetailInput.cs
index 3077c723f..292379dfc 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/Inputs/ProductReceiptNoteDetailInput.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductReceiptNotes/Inputs/ProductReceiptNoteDetailInput.cs
@@ -45,4 +45,14 @@ public class ProductReceiptNoteDetailInput : SfsStoreRecommendToDetailWithLotPac
///
[Display(Name = "返线数量")]
public decimal ReturnQty { get; set; }
+ ///
+ /// Mes条码号
+ ///
+ [Display(Name = "Mes条码号")]
+ public string MesBarCode { get; set; }
+ ///
+ /// Mes质量补标识
+ ///
+ [Display(Name = "Mes质量补标识")]
+ public string MesQuality { get; set; }
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteDetail.cs
index a6cf2c8a2..36379e3cf 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteDetail.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteDetail.cs
@@ -26,4 +26,13 @@ public class ProductReceiptNoteDetail : SfsStoreRecommendToDetailWithLotPackingQ
/// 返线数量
///
public decimal ReturnQty { get; set; }
+
+ ///
+ /// Mes条码号
+ ///
+ public string MesBarCode { get; set; }
+ ///
+ /// Mes质量补标识
+ ///
+ public string MesQuality { get; set; }
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ProductReceiptNotes/ProductReceiptNoteDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ProductReceiptNotes/ProductReceiptNoteDbContextModelCreatingExtensions.cs
index 48cb6c311..d127a8e5f 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ProductReceiptNotes/ProductReceiptNoteDbContextModelCreatingExtensions.cs
+++ b/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.ReturnQty).HasDefaultValue(0);
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
//Indexes
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductReceiveJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductReceiveJobAutoMapperProfile.cs
index 1057b5a5c..306212009 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductReceiveJobAutoMapperProfile.cs
+++ b/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.Remark)
.Ignore(x => x.ArriveDate)
+ .Ignore(x => x.MesBarCode)
+ .Ignore(x => x.MesQuality)
;
CreateMap()
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ProductReceiptRequestMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ProductReceiptRequestMapperProfile.cs
index 865415fd1..f966e48c8 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ProductReceiptRequestMapperProfile.cs
+++ b/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.Status)
.Ignore(x => x.ContainerCode)
+ .Ignore(x => x.MesBarCode)
+ .Ignore(x => x.MesQuality)
.IgnoreIHasRecommendAndHandledTo();
}
}
From eb46dc0e3c6ccb3456612b9c1a547cab15322862 Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Mon, 6 May 2024 11:51:17 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B3=A8=E5=A1=91?=
=?UTF-8?q?=E5=8F=91=E6=96=99=E8=AE=B0=E5=BD=95TYRP=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ExchangeDatas/EnumExchangeDataType.cs | 7 +-
.../InjectionIssueNoteEventHandler.cs | 106 ++++++++++++++++++
2 files changed, 112 insertions(+), 1 deletion(-)
create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs
index b22c253d6..d8caaf8c1 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs
@@ -32,5 +32,10 @@ public enum EnumExchangeDataType
//回收料调整
Item_Transform = 28,
//半成品上架
- SemiPutaway = 29
+ SemiPutaway = 29,
+ ///
+ /// 注塑发料
+ ///
+ InjectionIssue=30,
+
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs
new file mode 100644
index 000000000..ec0b619ef
--- /dev/null
+++ b/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;
+
+///
+/// 注塑发料记录传给TYRP
+///
+public class InjectionIssueNoteEventHandler
+ : StoreDataExchangeEventHandlerBase
+ , ILocalEventHandler>
+ , ILocalEventHandler>>
+{
+
+ private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.InjectionIssue;
+
+ [UnitOfWork]
+ public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData)
+ {
+ var entity = eventData.Entity;
+ await AddExchangeDataAsync(entity).ConfigureAwait(false);
+ }
+
+ [UnitOfWork]
+ public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData)
+ {
+ var entities = eventData.Entity;
+ await AddExchangeDataAsync(entities).ConfigureAwait(false);
+ }
+
+ protected override async Task AddExchangeDataAsync(List entities)
+ {
+ var dtos = ObjectMapper.Map, List>(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();
+ foreach (var item in dtos)
+ {
+ if (item.Details != null && item.Details.Count != 0)
+ {
+ toErpDto.Add(item);
+ }
+ }
+
+ //2023-12-6要求同储位不传入接口 按历史规则
+ var result = new List();
+ 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);
+ }
+ }
+
+}
From 854bc18d442630c541ddd80016c82dcb9bfe90f1 Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Mon, 6 May 2024 13:44:19 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B6=82=E8=A3=85?=
=?UTF-8?q?=E5=8F=91=E6=96=99TYRP=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ExchangeDatas/EnumExchangeDataType.cs | 4 +
.../CoatingIssueNoteEventHandler.cs | 107 ++++++++++++++++++
.../InjectionIssueNoteEventHandler.cs | 2 +-
.../ThirdLocationNoteEventHandler.cs | 3 +-
4 files changed, 113 insertions(+), 3 deletions(-)
create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CoatingIssueNoteEventHandler.cs
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs
index d8caaf8c1..e1aee60b2 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs
@@ -37,5 +37,9 @@ public enum EnumExchangeDataType
/// 注塑发料
///
InjectionIssue=30,
+ ///
+ /// 涂装发料
+ ///
+ CoatingIssue=31,
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CoatingIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/CoatingIssueNoteEventHandler.cs
new file mode 100644
index 000000000..de0a95320
--- /dev/null
+++ b/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;
+
+///
+/// 涂装发料记录传给TYRP(线边领料单)
+///
+public class CoatingIssueNoteEventHandler
+ : StoreDataExchangeEventHandlerBase
+ , ILocalEventHandler>
+ , ILocalEventHandler>>
+{
+
+ private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.CoatingIssue;
+
+ [UnitOfWork]
+ public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData)
+ {
+ var entity = eventData.Entity;
+ await AddExchangeDataAsync(entity).ConfigureAwait(false);
+ }
+
+ [UnitOfWork]
+ public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData)
+ {
+ var entities = eventData.Entity;
+ await AddExchangeDataAsync(entities).ConfigureAwait(false);
+ }
+
+ protected override async Task AddExchangeDataAsync(List entities)
+ {
+ var dtos = ObjectMapper.Map, List>(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();
+ foreach (var item in dtos)
+ {
+ if (item.Details != null && item.Details.Count != 0)
+ {
+ toErpDto.Add(item);
+ }
+ }
+
+ //2023-12-6要求同储位不传入接口 按历史规则
+ var result = new List();
+ 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);
+ }
+ }
+
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs
index ec0b619ef..f5e09482f 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/InjectionIssueNoteEventHandler.cs
@@ -11,7 +11,7 @@ using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Event.DataExchanges;
///
-/// 注塑发料记录传给TYRP
+/// 注塑发料记录传给TYRP(线边领料单)
///
public class InjectionIssueNoteEventHandler
: StoreDataExchangeEventHandlerBase
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs
index abd58f12a..7adb5dde4 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs
+++ b/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);
}
-
protected override async Task AddExchangeDataAsync(List entities)
{
- var dtos = ObjectMapper.Map, List>(entities);
+ var dtos = ObjectMapper.Map, List>(entities);
var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Transfer, dtos).ConfigureAwait(false);
await AddManyAsync(exchangeData).ConfigureAwait(false);
From 1cd1600c0a8ca95d3aacd2a47701b4bec0e6ff41 Mon Sep 17 00:00:00 2001
From: liuyunfeng
Date: Mon, 6 May 2024 14:54:45 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E7=AB=8B=E5=BA=93=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../GaoTongs/GaoTongAppService.cs | 10 ++++++++++
.../GaoTongs/GaoTongAutoMapperProfile.cs | 16 ++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAppService.cs
create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAutoMapperProfile.cs
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAppService.cs
new file mode 100644
index 000000000..f7f61320f
--- /dev/null
+++ b/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
+{
+}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/GaoTongs/GaoTongAutoMapperProfile.cs
new file mode 100644
index 000000000..5de41e865
--- /dev/null
+++ b/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()
+ {
+ }
+}
+