From 8e35ca6aa8e1db3ff8e5ad89595a3be40e6b0998 Mon Sep 17 00:00:00 2001
From: lvzb <35200379@qq.com>
Date: Tue, 9 Jul 2024 15:01:42 +0800
Subject: [PATCH 01/17] =?UTF-8?q?MES=E6=8E=A5=E5=8F=A3=E5=92=8C=E6=8A=A5?=
=?UTF-8?q?=E5=BA=9F=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Frozen/Frozen.cs | 2 +-
.../Incoming/EosIncomingBackgroundWorker.cs | 20 ++-
.../Incoming/FrozenReader.cs | 4 +-
.../Incoming/MesIncomingBackgroundWorker.cs | 149 +++++++++---------
.../AgentModule.cs | 2 +-
.../IncomingToWmsWorker.cs | 30 +++-
.../OutgoingFromWmsWorker.cs | 19 +++
.../appsettings.json | 16 +-
.../appsettings.json | 2 +-
.../IInterfaceConfigManager.cs | 7 +
.../IInterfaceConfigRepository.cs | 8 +
.../InterfaceConfig/InterfaceConfig.cs | 23 +++
.../InterfaceConfig/InterfaceConfigManager.cs | 25 +++
.../DataExchangeDbContext.cs | 2 +
...xchangeDbContextModelCreatingExtensions.cs | 2 +-
...eConfigDbContextModelCreatingExtensions.cs | 25 +++
.../InterfaceConfigEfCoreRepository.cs | 25 +++
.../TransferLogs/ITransferLogAppService.cs | 2 +-
.../TransferLogs/TransferLogAppService.cs | 21 +++
.../TransferLogs/ITransferLogManager.cs | 2 +-
.../TransferLogs/TransferLogManager.cs | 54 +++++++
.../Enums/Inventory/EnumTransSubType.cs | 7 +
.../DataExchanges/ScrapNoteEventHandler.cs | 18 +--
.../Transactions/ScrapNoteEventHandler.cs | 36 +++--
.../settings/appsettings.Development.json | 4 +-
25 files changed, 383 insertions(+), 122 deletions(-)
create mode 100644 be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/IInterfaceConfigManager.cs
create mode 100644 be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/IInterfaceConfigRepository.cs
create mode 100644 be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/InterfaceConfig.cs
create mode 100644 be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/InterfaceConfigManager.cs
create mode 100644 be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/InterfaceConfig/InterfaceConfigDbContextModelCreatingExtensions.cs
create mode 100644 be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/InterfaceConfig/InterfaceConfigEfCoreRepository.cs
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Frozen/Frozen.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Frozen/Frozen.cs
index 9ae130400..3a9c348db 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Frozen/Frozen.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Frozen/Frozen.cs
@@ -8,7 +8,7 @@ public class Frozen : Entity
/// 序号
///
[Key]
- public string mesout_frozen_id { get; set; }
+ public long mesout_frozen_id { get; set; }
///
/// 类型
///
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
index b3a743d81..ae5bc9f51 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
@@ -5,6 +5,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading;
using Volo.Abp.Uow;
+using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.Incoming;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
@@ -29,10 +30,23 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
Logger.LogInformation($"开始: 执行 {Incoming}");
- if (!_options.Value.IncomingOptions.Active)
+ var configManager = workerContext.ServiceProvider.GetRequiredService();
+ var confitem = await configManager.GetInterfaceConfig("").ConfigureAwait(false);
+ if (confitem == null)
{
- Logger.LogInformation($"{Incoming} 已关闭没有执行!");
- return;
+ if (!_options.Value.IncomingOptions.Active)
+ {
+ Logger.LogInformation($"{Incoming} 已关闭没有执行!");
+ return;
+ }
+ }
+ else
+ {
+ if (!confitem.Active)
+ {
+ Logger.LogInformation($"{Incoming} 已关闭没有执行!");
+ return;
+ }
}
Logger.LogInformation($"读取 采购订单");
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/FrozenReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/FrozenReader.cs
index 75b4f9ba5..1006d1701 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/FrozenReader.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/FrozenReader.cs
@@ -86,7 +86,7 @@ public class FrozenReader : IReader
DataAction = EnumExchangeDataAction.Add,
SourceSystem = EnumSystemType.MES.ToString(),
SourceDataId = Frozen.mesout_frozen_id.ToString(),
- SourceDataGroupCode = Frozen.mesout_frozen_id,
+ SourceDataGroupCode = Frozen.mesout_frozen_id.ToString(),
SourceDataDetailCode = Frozen.mesout_frozen_part,
SourceDataContent = JsonSerializer.Serialize(Frozen),
WriteTime = DateTime.Now,
@@ -101,7 +101,7 @@ public class FrozenReader : IReader
{
var mesNote = new MesNoteExchangeDto()
{
- MesRequestNumber=Frozen.mesout_frozen_id,
+ MesRequestNumber=Frozen.mesout_frozen_id.ToString(),
Worker = Frozen.mesout_frozen_user,
Remark = Frozen.mesout_frozen_reason,
Type = Frozen.mesout_frozen_type == "0" ? EnumTransType.MesFreezed.ToString() : EnumTransType.MesUnFreezed.ToString(),
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
index 3824bb5e3..53d3fec9f 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
@@ -45,24 +45,36 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
return;
}
- #region 缴库 MesOut
- Logger.LogInformation($"读取缴库(MesOut)");//缴库
- var mesOutReader = workerContext.ServiceProvider.GetRequiredService();
- var mesOutConverter = workerContext.ServiceProvider.GetRequiredService();
- var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取mes缴库
- var mesOutsFromExternalList = await mesOutReader.ReadAsync().ConfigureAwait(false);
- var mesOutsFromExternalList_ProductReceipt = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.ProductReceipt.ToString()).ToList();
- var mesOutsFromExternalList_TransferNote = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.TransferNote.ToString()).ToList();
- //转换缴库数据(如果有质量补得数据直接生产移库数据移到客户库位)
- await mesOutConverter.ConvertAsync(mesOutsFromExternalList_ProductReceipt).ConfigureAwait(false);
- if (mesOutsFromExternalList_TransferNote.Count > 0)//如果有质量补则生产储位调拨任务
- {
- await TransferNoteConverter.ConvertAsync(mesOutsFromExternalList_TransferNote).ConfigureAwait(false);
- }
- Logger.LogInformation($"处理完工收货(缴库)【{mesOutsFromExternalList_ProductReceipt.Count}】条数据");
- Logger.LogInformation($"处理储位调拨【{mesOutsFromExternalList_TransferNote.Count}】条数据");
- #endregion
+ //#region 缴库 MesOut
+ //Logger.LogInformation($"读取缴库(MesOut)");//缴库
+ //var mesOutReader = workerContext.ServiceProvider.GetRequiredService();
+ //var mesOutConverter = workerContext.ServiceProvider.GetRequiredService();
+ //var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取mes缴库
+ //var mesOutsFromExternalList = await mesOutReader.ReadAsync().ConfigureAwait(false);
+ //var mesOutsFromExternalList_ProductReceipt = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.ProductReceipt.ToString()).ToList();
+ //var mesOutsFromExternalList_TransferNote = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.TransferNote.ToString()).ToList();
+ ////转换缴库数据(如果有质量补得数据直接生产移库数据移到客户库位)
+ //await mesOutConverter.ConvertAsync(mesOutsFromExternalList_ProductReceipt).ConfigureAwait(false);
+ //if (mesOutsFromExternalList_TransferNote.Count > 0)//如果有质量补则生产储位调拨任务
+ //{
+ // await TransferNoteConverter.ConvertAsync(mesOutsFromExternalList_TransferNote).ConfigureAwait(false);
+ //}
+ //Logger.LogInformation($"处理完工收货(缴库)【{mesOutsFromExternalList_ProductReceipt.Count}】条数据");
+ //Logger.LogInformation($"处理储位调拨【{mesOutsFromExternalList_TransferNote.Count}】条数据");
+ //#endregion
+
+ //#region 冻结解冻 Frozen
+ //Logger.LogInformation($"读取冻结解冻 (Frozen)");//冻结解冻
+ //var FrozenReader = workerContext.ServiceProvider.GetRequiredService();
+ //var FrozenConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保存Frozen
+ //var mesNoteFromExternalList = await FrozenReader.ReadAsync().ConfigureAwait(false);
+ ////转换Frozen
+ //await FrozenConverter.ConvertAsync(mesNoteFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"处理冻结解冻【{mesNoteFromExternalList.Count}】条数据");
+ //#endregion
+
#region 报废 Scrap
Logger.LogInformation($"读取报废(Scrap)");//报废
@@ -75,61 +87,52 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
Logger.LogInformation($"处理报废【{scrapsFromExternalList.Count}】条数据");
#endregion
- #region 耗用单 BackFlush
- Logger.LogInformation($"读取耗用单 (BackFlush)");//耗用单
- var BackFlushReader = workerContext.ServiceProvider.GetRequiredService();
- var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取并保存BackFlush
- var backFlushsFromExternalList = await BackFlushReader.ReadAsync().ConfigureAwait(false);
- //转换BackFlush
- await BackFlushConverter.ConvertAsync(backFlushsFromExternalList).ConfigureAwait(false);
- Logger.LogInformation($"处理耗用单【{backFlushsFromExternalList.Count}】条数据");
- #endregion
-
- #region 储位调拨 TransferNote
- Logger.LogInformation($"读取储位调拨 (TransferNote)");//储位调拨
- var TransferNoteReader = workerContext.ServiceProvider.GetRequiredService();
- // var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取并保存TransferNote
- var transferNoteFromExternalList = await TransferNoteReader.ReadAsync().ConfigureAwait(false);
- //转换TransferNote
- await TransferNoteConverter.ConvertAsync(transferNoteFromExternalList).ConfigureAwait(false);
- Logger.LogInformation($"处理储位调拨【{transferNoteFromExternalList.Count}】条数据");
- #endregion
-
- #region 冻结解冻 Frozen
- Logger.LogInformation($"读取冻结解冻 (Frozen)");//冻结解冻
- var FrozenReader = workerContext.ServiceProvider.GetRequiredService();
- var FrozenConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取并保存Frozen
- var mesNoteFromExternalList = await FrozenReader.ReadAsync().ConfigureAwait(false);
- //转换Frozen
- await FrozenConverter.ConvertAsync(mesNoteFromExternalList).ConfigureAwait(false);
- Logger.LogInformation($"处理冻结解冻【{mesNoteFromExternalList.Count}】条数据");
- #endregion
-
- #region 成品发运 Delivery
- Logger.LogInformation($"读取成品发运 (Delivery)");//成品发运
- var DeliveryReader = workerContext.ServiceProvider.GetRequiredService();
- var DeliveryConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取并保存Delivery
- var deliveryNoteFromExternalList = await DeliveryReader.ReadAsync().ConfigureAwait(false);
- //转换Delivery
- await DeliveryConverter.ConvertAsync(deliveryNoteFromExternalList).ConfigureAwait(false);
- Logger.LogInformation($"处理成品发运【{deliveryNoteFromExternalList.Count}】条数据");
- #endregion
-
- #region 自动叫料 CallMtl
-
- Logger.LogInformation($"读取自动叫料 (CallMtl)");//自动叫料
- var CallMtlReader = workerContext.ServiceProvider.GetRequiredService();
- var CallMtlConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取并保存Delivery
- var callMtlFromExternalList = await CallMtlReader.ReadAsync().ConfigureAwait(false);
- //转换Delivery
- await CallMtlConverter.ConvertAsync(callMtlFromExternalList).ConfigureAwait(false);
- Logger.LogInformation($"处理自动叫料【{callMtlFromExternalList.Count}】条数据");
- #endregion
+ //#region 耗用单 BackFlush
+ //Logger.LogInformation($"读取耗用单 (BackFlush)");//耗用单
+ //var BackFlushReader = workerContext.ServiceProvider.GetRequiredService();
+ //var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保存BackFlush
+ //var backFlushsFromExternalList = await BackFlushReader.ReadAsync().ConfigureAwait(false);
+ ////转换BackFlush
+ //await BackFlushConverter.ConvertAsync(backFlushsFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"处理耗用单【{backFlushsFromExternalList.Count}】条数据");
+ //#endregion
+
+ //#region 储位调拨 TransferNote
+ //Logger.LogInformation($"读取储位调拨 (TransferNote)");//储位调拨
+ //var TransferNoteReader = workerContext.ServiceProvider.GetRequiredService();
+ //// var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保存TransferNote
+ //var transferNoteFromExternalList = await TransferNoteReader.ReadAsync().ConfigureAwait(false);
+ ////转换TransferNote
+ //await TransferNoteConverter.ConvertAsync(transferNoteFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"处理储位调拨【{transferNoteFromExternalList.Count}】条数据");
+ //#endregion
+
+
+
+ //#region 成品发运 Delivery
+ //Logger.LogInformation($"读取成品发运 (Delivery)");//成品发运
+ //var DeliveryReader = workerContext.ServiceProvider.GetRequiredService();
+ //var DeliveryConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保存Delivery
+ //var deliveryNoteFromExternalList = await DeliveryReader.ReadAsync().ConfigureAwait(false);
+ ////转换Delivery
+ //await DeliveryConverter.ConvertAsync(deliveryNoteFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"处理成品发运【{deliveryNoteFromExternalList.Count}】条数据");
+ //#endregion
+
+ //#region 自动叫料 CallMtl
+
+ //Logger.LogInformation($"读取自动叫料 (CallMtl)");//自动叫料
+ //var CallMtlReader = workerContext.ServiceProvider.GetRequiredService();
+ //var CallMtlConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保存Delivery
+ //var callMtlFromExternalList = await CallMtlReader.ReadAsync().ConfigureAwait(false);
+ ////转换Delivery
+ //await CallMtlConverter.ConvertAsync(callMtlFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"处理自动叫料【{callMtlFromExternalList.Count}】条数据");
+ //#endregion
Logger.LogInformation($"提交: 执行 {Incoming}");
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
index 28aa02cc5..59cf323ef 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
@@ -150,6 +150,6 @@ public class AgentModule : AbpModule
ApplicationInitializationContext context)
{
context.AddBackgroundWorkerAsync();
- context.AddBackgroundWorkerAsync();
+ // context.AddBackgroundWorkerAsync();
}
}
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 8d93ccf90..8b5413752 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
@@ -49,16 +49,30 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
[UnitOfWork]
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
- Logger.LogInformation("Starting: Handling Incoming Exchange data...");
- if (!_options.Value.IncomingOptions.Active)
- {
- Logger.LogInformation("Incoming Exchange is not active!");
- return;
- }
+ Logger.LogInformation("开始接收数据...");
+ // var configManager = workerContext.ServiceProvider.GetRequiredService();
+ //var confitem = await configManager.GetInterfaceConfig("").ConfigureAwait(false);
+ // if (confitem == null)
+ // {
+ // if (!_options.Value.IncomingOptions.Active)
+ // {
+ // Logger.LogInformation("Wms接收接口已关闭!");
+ // return;
+ // }
+ // }
+ // else
+ // {
+ // if (!confitem.Active)
+ // {
+ // Logger.LogInformation("Wms接收接口已关闭!");
+ // return;
+ // }
+ // }
+
await HandleIncomingDataAsync(workerContext).ConfigureAwait(false);
- Logger.LogInformation("Completed: Handling Incoming Exchange data...");
+ Logger.LogInformation("提交接收数据...");
}
private async Task HandleIncomingDataAsync(PeriodicBackgroundWorkerContext workerContext)
@@ -93,7 +107,7 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
incomingToWms.SetError(EnumExchangeDataErrorCode.Exception, e.Message);
}
//归档并删除
- await incomingToWmsManager.ArchiveAsync(incomingToWms).ConfigureAwait(false);
+ // await incomingToWmsManager.ArchiveAsync(incomingToWms).ConfigureAwait(false);
}
}
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs
index bafe08f81..bc8b8b739 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs
@@ -29,6 +29,25 @@ public class OutgoingFromWmsWorker : AsyncPeriodicBackgroundWorkerBase
[UnitOfWork]
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
+ var configManager = workerContext.ServiceProvider.GetRequiredService();
+ var confitem = await configManager.GetInterfaceConfig("").ConfigureAwait(false);
+ if (confitem == null)
+ {
+ if (!_options.Active)
+ {
+ Logger.LogInformation("Wms传出接口已关闭!");
+ return;
+ }
+ }
+ else
+ {
+ if (!confitem.Active)
+ {
+ Logger.LogInformation("Wms传出接口已关闭!");
+ return;
+ }
+ }
+
//Resolve dependencies
var exchangeDataAppService = workerContext.ServiceProvider.GetRequiredService();
var objectMapper = workerContext.ServiceProvider.GetRequiredService();
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json
index 649886482..2e0324e5f 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json
@@ -1,13 +1,13 @@
{
"ConnectionStrings": {
- "Default": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;TrustServerCertificate=True",
- "DataExchange": "Server=10.164.233.6;Database=WMS_DongYang_DataExchange_CC;uid=ccwin-in;pwd=Microsoft@2022;TrustServerCertificate=True"
+ "Default": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;TrustServerCertificate=True",
+ "DataExchange": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_DataExchange_CC;uid=ccwin-in;pwd=Microsoft@2022;TrustServerCertificate=True"
},
"AuthServer": {
- "Authority": "http://10.164.233.5:60083/",
+ "Authority": "http://dev.ccwin-in.com:60083/",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*",
@@ -26,16 +26,16 @@
"RemoteServices": {
"BaseData": {
- "BaseUrl": "http://10.164.233.5:60084/"
+ "BaseUrl": "http://localhost:59094/"
},
"Store": {
- "BaseUrl": "http://10.164.233.5:60085/"
+ "BaseUrl": "http://localhost:59095/"
},
"Label": {
- "BaseUrl": "http://10.164.233.5:60082/"
+ "BaseUrl": "http://dev.ccwin-in.com:60082/"
},
"Auth": {
- "BaseUrl": "http://10.164.233.5:60083/"
+ "BaseUrl": "http://dev.ccwin-in.com:60083/"
}
},
"DataExchangeOptions": {
@@ -44,7 +44,7 @@
"PeriodSeconds": 10,
"RetryTimes": 1,
"BatchSize": 100,
- "apiUrl": "http://10.164.233.5:60085/"
+ "apiUrl": "http://dev.ccwin-in.com:60085/"
},
"OutgoingOptions": {
"Active": false,
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.DbMigrator/appsettings.json b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.DbMigrator/appsettings.json
index dec61c81a..1dfd30089 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.DbMigrator/appsettings.json
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.DbMigrator/appsettings.json
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
- "Default": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;",
+ "Default": "Server=dev.ccwin-in.com,13319;Database=DataExchange_Main;uid=sa;pwd=aA123456!;",
"DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;"
},
"IdentityServer": {
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/IInterfaceConfigManager.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/IInterfaceConfigManager.cs
new file mode 100644
index 000000000..d72aabe2d
--- /dev/null
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/IInterfaceConfigManager.cs
@@ -0,0 +1,7 @@
+using System.Threading.Tasks;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain;
+public interface IInterfaceConfigManager
+{
+ Task GetInterfaceConfig(string code);
+}
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/IInterfaceConfigRepository.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/IInterfaceConfigRepository.cs
new file mode 100644
index 000000000..4bfcc80cb
--- /dev/null
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/IInterfaceConfigRepository.cs
@@ -0,0 +1,8 @@
+using System.Threading.Tasks;
+using Win_in.Sfs.Wms.DataExchange.Domain;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain;
+public interface IInterfaceConfigRepository
+{
+ Task GetInterfaceConfig(string code);
+}
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/InterfaceConfig.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/InterfaceConfig.cs
new file mode 100644
index 000000000..9051cbac2
--- /dev/null
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/InterfaceConfig.cs
@@ -0,0 +1,23 @@
+using Win_in.Sfs.Shared.Domain;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain;
+public class InterfaceConfig : SfsAggregateRootBase
+{
+ ///
+ /// 接口名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 编码
+ ///
+ public string Code { get; set; }
+ ///
+ /// 是否启用
+ ///
+ public bool Active { get; set; }
+ ///
+ /// 等级
+ ///
+ public int Level { get; set; }
+}
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/InterfaceConfigManager.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/InterfaceConfigManager.cs
new file mode 100644
index 000000000..6c6a2430c
--- /dev/null
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/InterfaceConfig/InterfaceConfigManager.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp.Domain.Services;
+using Volo.Abp.Uow;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain;
+public class InterfaceConfigManager : DomainService, IInterfaceConfigManager
+{
+ private readonly IInterfaceConfigRepository _repository;
+
+ public InterfaceConfigManager(
+ IInterfaceConfigRepository repository
+ )
+ {
+ _repository = repository;
+ }
+
+ public virtual async Task GetInterfaceConfig(string code)
+ {
+ return await _repository.GetInterfaceConfig(code).ConfigureAwait(false);
+ }
+}
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeDbContext.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeDbContext.cs
index fcb0a34f3..af5ae5831 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeDbContext.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeDbContext.cs
@@ -40,6 +40,8 @@ public class DataExchangeDbContext :
public DbSet OutgoingFromWms { get; set; }
public DbSet ArchivedOutgoingFromWms { get; set; }
+ public DbSet InterfaceConfig { get; set; }
+
#region Entities from the modules
/* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeDbContextModelCreatingExtensions.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeDbContextModelCreatingExtensions.cs
index 8fb3bb101..6703ed38b 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeDbContextModelCreatingExtensions.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeDbContextModelCreatingExtensions.cs
@@ -27,7 +27,7 @@ public static class DataExchangeDbContextModelCreatingExtensions
builder.ConfigureArchivedIncomingFromExternal(options);
builder.ConfigureOutgoingFromWms(options);
builder.ConfigureArchivedOutgoingFromWms(options);
-
+ builder.ConfigureInterfaceConfig(options);
builder.ConfigureMessageReceive(options);
/* Configure all entities here. Example:
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/InterfaceConfig/InterfaceConfigDbContextModelCreatingExtensions.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/InterfaceConfig/InterfaceConfigDbContextModelCreatingExtensions.cs
new file mode 100644
index 000000000..cf48a26a6
--- /dev/null
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/InterfaceConfig/InterfaceConfigDbContextModelCreatingExtensions.cs
@@ -0,0 +1,25 @@
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore.Modeling;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Shared.EntityFrameworkCore;
+using Win_in.Sfs.Wms.DataExchange.Domain;
+
+namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore;
+public static class InterfaceConfigDbContextModelCreatingExtensions
+{
+ public static void ConfigureInterfaceConfig(this ModelBuilder builder, DataExchangeModelBuilderConfigurationOptions options)
+ {
+ builder.Entity(b =>
+ {
+ //Configure table & schema name
+ b.ToTable(options.TablePrefix + nameof(InterfaceConfig), options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ //Configure Sfs base properties
+ b.ConfigureSfsBase();
+
+ b.Property(q => q.Name).HasMaxLength(SfsPropertyConst.CodeLength);
+ b.HasIndex(q => new { q.Code }).IsUnique();
+ });
+ }
+}
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/InterfaceConfig/InterfaceConfigEfCoreRepository.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/InterfaceConfig/InterfaceConfigEfCoreRepository.cs
new file mode 100644
index 000000000..608f22595
--- /dev/null
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/InterfaceConfig/InterfaceConfigEfCoreRepository.cs
@@ -0,0 +1,25 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore;
+using Win_in.Sfs.Shared.EntityFrameworkCore;
+using Win_in.Sfs.Wms.DataExchange.Domain;
+using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
+
+namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore;
+
+public class InterfaceConfigEfCoreRepository : SfsEfCoreRepositoryBase, IInterfaceConfigRepository
+{
+ public InterfaceConfigEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider)
+ {
+ }
+
+ public virtual async Task GetInterfaceConfig(string code)
+ {
+ var dbSet = await GetDbSetAsync().ConfigureAwait(false);
+ var entitie = await dbSet.FirstOrDefaultAsync(p => p.Code == code).ConfigureAwait(false);
+ return entitie;
+ }
+
+}
diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/TransferLogs/ITransferLogAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/TransferLogs/ITransferLogAppService.cs
index 0c05af72e..4c0fd5395 100644
--- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/TransferLogs/ITransferLogAppService.cs
+++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/TransferLogs/ITransferLogAppService.cs
@@ -15,5 +15,5 @@ public interface ITransferLogAppService
Task> GetListByContainerAsync(string containerCode);
Task> GetListByItemAsync(string itemCode);
Task> GetListByLocationAsync(string locationCode);
-
+ Task> AddManyWithTransferAsync(List inputs, List transactionInputs);
}
diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs
index 68b010434..1c7474a1f 100644
--- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs
+++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs
@@ -75,6 +75,27 @@ public class TransferLogAppService
return dto;
}
+ [HttpPost("add-many-with-transfer")]
+ public virtual async Task> AddManyWithTransferAsync(List inputs,List transactionInputs)
+ {
+ var transferLogs = ObjectMapper.Map, List>(inputs);
+ var transactions = ObjectMapper.Map, List>(transactionInputs);
+ foreach (var entity in transferLogs)
+ {
+ if (string.IsNullOrEmpty(entity.Worker))
+ {
+ entity.Worker = CurrentUser.GetUserName();
+ }
+
+ entity.TransferTime = Clock.Now;
+ entity.ActiveDate = await _interfaceCalendarAclService.GetActiveDateAsync(Clock.Now).ConfigureAwait(false);
+ }
+
+ await _transferLogManager.AddManyWithTransferAsync(transferLogs, transactions).ConfigureAwait(false);
+
+ var dto = ObjectMapper.Map, List>(transferLogs);
+ return dto;
+ }
[HttpGet("list/by-number/{number}")]
public virtual async Task> GetListByNumberAsync(string number)
{
diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/TransferLogs/ITransferLogManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/TransferLogs/ITransferLogManager.cs
index 34fb3cabb..1a8719a6f 100644
--- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/TransferLogs/ITransferLogManager.cs
+++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/TransferLogs/ITransferLogManager.cs
@@ -51,5 +51,5 @@ public interface ITransferLogManager : IDomainService
Task ChangeLocationAsync(Balance inventory,
string newWarehouseCode, string newLocationCode, string newContainerCode, string worker,
string jobNumber, string docNumber);
-
+ Task AddManyWithTransferAsync(List transferLogs, List inputTransactions);
}
diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/TransferLogs/TransferLogManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/TransferLogs/TransferLogManager.cs
index 616b564fa..cbed261c3 100644
--- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/TransferLogs/TransferLogManager.cs
+++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/TransferLogs/TransferLogManager.cs
@@ -147,6 +147,60 @@ public class TransferLogManager : DomainService, ITransferLogManager
}
+ public virtual async Task AddManyWithTransferAsync(List transferLogs, List excludeTransactions)
+ {
+ //TODO 功能大调整
+
+ //1. 生成并添加Transactions
+
+ var transactions = new List();
+
+ foreach (var transferLog in transferLogs)
+ {
+ var number = await _numberGenerator.CreateAsync().ConfigureAwait(false);
+ var activeDate = await _interfaceCalendarAclService.GetActiveDateAsync(Clock.Now).ConfigureAwait(false);
+
+ await TrySetItemAndLocationAsync(transferLog).ConfigureAwait(false);
+
+ var inOutTransactions = await transferLog.BuildAndAddTransactionsAsync(number, activeDate,
+ _transactionManager.AddAsync).ConfigureAwait(false);
+
+ Logger.LogDebug($"{transferLog.DocNumber}|TransferLog:{transferLog}");
+ transactions.AddRange(inOutTransactions);
+ }
+
+ //2. 添加TransferLogs
+ await _transferLogRepository.InsertManyAsync(transferLogs).ConfigureAwait(false);
+
+ //3. Transactions按箱码,ERP料号,批次,库位,状态汇总数量,将需要对冲的明细对冲掉
+ var allTransactions = new List();
+ allTransactions.AddRange(transactions);
+ allTransactions.AddRange(excludeTransactions);
+ var compactTransactions = new List();
+ foreach (var transaction in allTransactions)
+ {
+ var compactTransaction = compactTransactions.FirstOrDefault(p => p.ItemCode == transaction.ItemCode
+ && p.PackingCode == transaction.PackingCode
+ && p.Lot == transaction.Lot
+ && p.LocationCode == transaction.LocationCode
+ && p.Status == transaction.Status);
+ if (compactTransaction == null)//如果集合中没有就创建
+ {
+ compactTransaction = new Transaction(transaction);
+ compactTransactions.Add(compactTransaction);
+ }
+ else//有则加减qty
+ {
+ compactTransaction.Qty += transaction.Qty;
+ }
+
+ }
+
+ //4. 根据汇总后的Transaction列表更新库存余额和库位可用容量
+ await _transactionManager.UpdateBalanceAsync(compactTransactions.Where(r=>r.Qty!=0).ToList()).ConfigureAwait(false);
+
+ }
+
public virtual async Task ChangeBatchAsync(Balance inventory, string newLot,
string newSupplierBatch, DateTime newArriveDate, DateTime newProduceDate, DateTime newExpireDate, string worker, string jobNumber, string docNumber)
{
diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs
index 5a45e7d5d..e1869bb2e 100644
--- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs
+++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs
@@ -114,6 +114,13 @@ public enum EnumTransSubType
[Display(Name = "完工报废")]
Scrap_Product = 3604,
+ ///
+ /// 报废转移
+ ///
+ [Display(Name = "报废转移")]
+ Scrap_Transfer = 3605,
+
+
///
/// 线边调整
///
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ScrapNoteEventHandler.cs
index 5dcc31266..22ba26566 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ScrapNoteEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ScrapNoteEventHandler.cs
@@ -39,17 +39,17 @@ public class ScrapNoteEventHandler
await detail.TrySetLocationAsync(LocationAclService).ConfigureAwait(false);
}
- //如果WMS管理报废库,生成库存转移
- if (await SettingManager.IsTrueAsync(StoreSettings.Common.EnableScrapLocation).ConfigureAwait(false))
- {
- var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Transfer, dtos).ConfigureAwait(false);
- await AddManyAsync(exchangeData).ConfigureAwait(false);
- }
- else
- {
+ ////如果WMS管理报废库,生成库存转移
+ //if (await SettingManager.IsTrueAsync(StoreSettings.Common.EnableScrapLocation).ConfigureAwait(false))
+ //{
+ // var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Transfer, dtos).ConfigureAwait(false);
+ // await AddManyAsync(exchangeData).ConfigureAwait(false);
+ //}
+ //else
+ //{
var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Scrap, dtos).ConfigureAwait(false);
await AddManyAsync(exchangeData).ConfigureAwait(false);
- }
+ // }
}
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
index 981f42265..caf44ed49 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
@@ -4,9 +4,11 @@ using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
+using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
+using Win_in.Sfs.Wms.Inventory.Domain;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Event.Transaction;
@@ -38,42 +40,53 @@ public class ScrapNoteEventHandler
private async Task AddTransactionsAsync(List scrapNotes)
{
-
- //如果WMS管理报废库,生成库存转移
+ var holdLocation = await LocationAclService.GetFirstByTypeAsync(EnumLocationType.HOLD).ConfigureAwait(false); //隔离库位
+ var transferLogs = new List();
+ var transactions = new List();
+ //如果WMS管理报废库,生成报废库存转移(从HOLD库先转移到线边)
if (await SettingManager.IsTrueAsync(StoreSettings.Common.EnableScrapLocation).ConfigureAwait(false))
{
- var transferLogs = new List();
foreach (var scrapNote in scrapNotes)
{
- transferLogs.AddRange(BuildTransferLogs(scrapNote));
+
+ if (await SettingManager.IsTrueAsync(StoreSettings.Common.EnableScrapLocation).ConfigureAwait(false))
+ {
+ transferLogs.AddRange(BuildTransferLogs(scrapNote, holdLocation));
+ }
+ transactions.AddRange(BuildTransactions(scrapNote));
}
- await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
+
+ await TransferLogAppService.AddManyWithTransferAsync(transferLogs, transactions).ConfigureAwait(false);
+ await TransactionAppService.AddManyEmptyAsync(transactions).ConfigureAwait(false);
}
else
{
- var transactions = new List();
foreach (var scrapNote in scrapNotes)
- {
+ {
transactions.AddRange(BuildTransactions(scrapNote));
}
-
await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false);
}
}
- private List BuildTransferLogs(ScrapNote scrapNote)
+ private List BuildTransferLogs(ScrapNote scrapNote, LocationDTO holdLocation)
{
var transferLogs = new List();
+
foreach (var detail in scrapNote.Details.Where(detail => detail.Qty != 0))
{
var transferLog = ObjectMapper.Map(detail);
transferLog.TransType = TransType;
- transferLog.TransSubType = Enum.Parse(scrapNote.Type);
+ transferLog.TransSubType = EnumTransSubType.Scrap_Transfer;
transferLog.Worker = scrapNote.Worker;
transferLog.DocNumber = scrapNote.Number;
transferLog.JobNumber = scrapNote.JobNumber;
-
+ transferLog.FromLocationCode = holdLocation?.Code;
+ transferLog.FromLocationArea = holdLocation?.AreaCode;
+ transferLog.FromLocationGroup = holdLocation?.LocationGroupCode;
+ transferLog.FromLocationErpCode = holdLocation?.ErpLocationCode;
+ transferLog.FromStatus = EnumInventoryStatus.HOLD;
transferLogs.Add(transferLog);
}
@@ -89,6 +102,7 @@ public class ScrapNoteEventHandler
var transaction = ObjectMapper.Map(detail);
transaction.TransType = TransType;
+ transaction.TransSubType = Enum.Parse(deliverNote.Type);
transaction.TransInOut = EnumTransInOut.Out;
transaction.Worker = deliverNote.Worker;
transaction.DocNumber = deliverNote.Number;
diff --git a/build/src/docker/publish/conf/settings/appsettings.Development.json b/build/src/docker/publish/conf/settings/appsettings.Development.json
index c74d5217b..ec97ab563 100644
--- a/build/src/docker/publish/conf/settings/appsettings.Development.json
+++ b/build/src/docker/publish/conf/settings/appsettings.Development.json
@@ -133,8 +133,8 @@
//"BaseUrl": "http://localhost:59093/"
},
"BaseData": {
- "BaseUrl": "http://dev.ccwin-in.com:60084/"
- //"BaseUrl": "http://localhost:59094/"
+ //"BaseUrl": "http://dev.ccwin-in.com:60084/"
+ "BaseUrl": "http://localhost:59094/"
},
"Default": {
"BaseUrl": "http://dev.ccwin-in.com:60083/"
From 6477a0c42b9a65ac865ca8426bbe61686a1226fd Mon Sep 17 00:00:00 2001
From: lvzb <35200379@qq.com>
Date: Tue, 9 Jul 2024 15:05:19 +0800
Subject: [PATCH 02/17] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Transactions/ScrapNoteEventHandler.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
index caf44ed49..d28b17034 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
@@ -55,7 +55,7 @@ public class ScrapNoteEventHandler
}
transactions.AddRange(BuildTransactions(scrapNote));
}
-
+ //报废是库存世界变动是隔离库数量-1,但是增加了一个移库日志从Hold到线边,库存事务是三个,Hold库-1(移库),线边+1(移库),线边-1(报废)
await TransferLogAppService.AddManyWithTransferAsync(transferLogs, transactions).ConfigureAwait(false);
await TransactionAppService.AddManyEmptyAsync(transactions).ConfigureAwait(false);
}
From fe3803b4f8d29c953dde610b695d3f18e5e5963b Mon Sep 17 00:00:00 2001
From: "boxu.zheng"
Date: Wed, 10 Jul 2024 08:14:56 +0800
Subject: [PATCH 03/17] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=20=E9=83=A8=E9=97=A8=E8=8E=B7=E5=8F=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Departments/IDepartmentAppService.cs | 1 +
.../Departments/DepartmentAppService.cs | 21 +++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/Departments/IDepartmentAppService.cs b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/Departments/IDepartmentAppService.cs
index d97d5d484..0af5cf24d 100644
--- a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/Departments/IDepartmentAppService.cs
+++ b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/Departments/IDepartmentAppService.cs
@@ -9,4 +9,5 @@ public interface IDepartmentAppService
{
Task GetByUsernameAsync(string username);
Task UpdateAsync(DepartmentCreateInput input);
+ Task GetByUserIdAsync(string userId);
}
diff --git a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAppService.cs b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAppService.cs
index b75291fc7..f546528a1 100644
--- a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAppService.cs
+++ b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAppService.cs
@@ -49,6 +49,27 @@ public class DepartmentAppService
var deptDto = await GetByCodeAsync(departmentCode).ConfigureAwait(false);
return deptDto;
}
+
+ [AllowAnonymous]
+ [HttpGet("by-userid")]
+ public virtual async Task GetByUserIdAsync(string userId)
+ {
+ var user = await _identityUserManager.FindByIdAsync(userId).ConfigureAwait(false);
+ if (user == null)
+ {
+ return null;
+ }
+
+ var departmentCode = user.GetDepartmentCode();
+ if (string.IsNullOrEmpty(departmentCode))
+ {
+ return null;
+ }
+
+ var deptDto = await GetByCodeAsync(departmentCode).ConfigureAwait(false);
+ return deptDto;
+ }
+
[AllowAnonymous]
[HttpPost("update")]
public virtual async Task UpdateAsync(DepartmentCreateInput input)
From 6f7f9e6443d9e6193d39770459d75326db8cd78c Mon Sep 17 00:00:00 2001
From: lvzb <35200379@qq.com>
Date: Wed, 10 Jul 2024 09:16:02 +0800
Subject: [PATCH 04/17] =?UTF-8?q?mes=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Chassis/IMesChassisManager.cs | 10 ++
.../Chassis/IMesChassisRepository.cs | 8 ++
.../Chassis/MesChassis.cs | 49 ++++++++
.../Chassis/MesChassisManager.cs | 47 +++++++
...ChassisDbContextModelCreatingExtensions.cs | 27 ++++
.../Chassis/MesChassisEfCoreRepository.cs | 13 ++
...xchangeDbContextModelCreatingExtensions.cs | 1 +
...ExchangeEntityFrameworkCoreFawtygModule.cs | 2 +
.../MesDbContext.cs | 3 +
.../FawtygAutoMapperProfile.cs | 5 +
.../Incoming/MesChassisConverter.cs | 92 ++++++++++++++
.../Incoming/MesChassisReader.cs | 116 ++++++++++++++++++
.../Incoming/MesIncomingBackgroundWorker.cs | 34 +++--
.../IncomingToWmsExtensions.cs | 36 ++----
.../IncomingToWmsWorker.cs | 5 +-
.../appsettings.json | 4 +-
.../WMS/Chassis/ChassisExchangeDto.cs | 50 ++++++++
...Wms.DataExchange.Application.Contracts.xml | 35 ++++++
.../appsettings.json | 4 +-
.../Enums/EnumIncomingDataType.cs | 4 +
20 files changed, 500 insertions(+), 45 deletions(-)
create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/IMesChassisManager.cs
create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/IMesChassisRepository.cs
create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/MesChassis.cs
create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/MesChassisManager.cs
create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Chassis/MesChassisDbContextModelCreatingExtensions.cs
create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Chassis/MesChassisEfCoreRepository.cs
create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesChassisConverter.cs
create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesChassisReader.cs
create mode 100644 be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/Chassis/ChassisExchangeDto.cs
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/IMesChassisManager.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/IMesChassisManager.cs
new file mode 100644
index 000000000..54012cbfc
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/IMesChassisManager.cs
@@ -0,0 +1,10 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Chassis;
+public interface IMesChassisManager
+{
+ Task> GetToBeProcessedListAsync();
+ Task UpdateProcessedListAsync(List entities);
+ Task UpdateProcesseErrordListAsync(List entities);
+}
\ No newline at end of file
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/IMesChassisRepository.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/IMesChassisRepository.cs
new file mode 100644
index 000000000..780161358
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/IMesChassisRepository.cs
@@ -0,0 +1,8 @@
+using Volo.Abp.Domain.Repositories;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Chassis;
+
+public interface IMesChassisRepository : IRepository
+{
+
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/MesChassis.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/MesChassis.cs
new file mode 100644
index 000000000..d8b92ffba
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/MesChassis.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp.Domain.Entities;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Chassis;
+public class MesChassis : Entity
+{ ///
+ /// 序号
+ ///
+ [Key]
+ public int mesout_fis_id { get; set; }
+ ///
+ /// erp号
+ ///
+ public string mesout_fis_erpno { get; set; }
+ ///
+ /// 底盘号
+ ///
+ public string mesout_fis_vin { get; set; }
+ ///
+ /// 产品类型
+ ///
+ public string mesout_fis_productType { get; set; }
+ ///
+ /// 颜色
+ ///
+ public string mesout_fis_productColor { get; set; }
+ ///
+ /// 添加时间
+ ///
+ public DateTime? addtime { get; set; }
+ ///
+ /// 修改时间
+ ///
+ public DateTime? updatetime { get; set; }
+ ///
+ /// 是否读取(0,1)
+ ///
+ public int mesout_fis_status { get; set; }
+
+ public override object[] GetKeys()
+ {
+ return new object[] { mesout_fis_id };
+ }
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/MesChassisManager.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/MesChassisManager.cs
new file mode 100644
index 000000000..264641e51
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Chassis/MesChassisManager.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp.Domain.Services;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Chassis;
+
+public class MesChassisManager : DomainService, IMesChassisManager
+{
+ private readonly IMesChassisRepository _repository;
+
+ public MesChassisManager(IMesChassisRepository repository)
+ {
+ _repository = repository;
+ }
+ public virtual async Task> GetToBeProcessedListAsync()
+ {
+ var plans = await _repository.GetListAsync(p => p.mesout_fis_status == 0).ConfigureAwait(false);
+ return plans;
+
+ }
+ public virtual async Task UpdateProcesseErrordListAsync(List entities)
+ {
+ var ids = entities.Select(p => p.mesout_fis_id);
+ var plans = await _repository.GetListAsync(p => ids.Contains(p.mesout_fis_id)).ConfigureAwait(false);
+ plans.ForEach(p =>
+ {
+ p.mesout_fis_status = 2;
+ // p.WmsDate = Clock.Now;
+ });
+ await _repository.UpdateManyAsync(plans).ConfigureAwait(false);
+ }
+ public virtual async Task UpdateProcessedListAsync(List entities)
+ {
+ var ids = entities.Select(p => p.mesout_fis_id);
+ var plans = await _repository.GetListAsync(p => ids.Contains(p.mesout_fis_id)).ConfigureAwait(false);
+ plans.ForEach(p =>
+ {
+ p.mesout_fis_status = 1;
+
+ // p.WmsDate = Clock.Now;
+ });
+ await _repository.UpdateManyAsync(plans).ConfigureAwait(false);
+ }
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Chassis/MesChassisDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Chassis/MesChassisDbContextModelCreatingExtensions.cs
new file mode 100644
index 000000000..c56eb44dd
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Chassis/MesChassisDbContextModelCreatingExtensions.cs
@@ -0,0 +1,27 @@
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore.Modeling;
+using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Chassis;
+
+namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes;
+public static class MesChassisDbContextModelCreatingExtensions
+{
+ public static void ConfigureMesChassis(this ModelBuilder builder, MesModelBuilderConfigurationOptions options)
+ {
+ builder.Entity(b =>
+ {
+ //Configure table & schema Name
+ b.ToTable(options.TablePrefix + "mesout_fis", options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+
+ //Properties
+ b.Property(q => q.mesout_fis_id).HasMaxLength(20);
+ b.Property(q => q.mesout_fis_erpno).HasMaxLength(50);
+ b.Property(q => q.mesout_fis_vin).HasMaxLength(50);
+ b.Property(q => q.mesout_fis_productType).HasMaxLength(50);
+ b.Property(q => q.mesout_fis_productColor).HasMaxLength(50);
+ b.Property(q => q.mesout_fis_status);
+ });
+
+ }
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Chassis/MesChassisEfCoreRepository.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Chassis/MesChassisEfCoreRepository.cs
new file mode 100644
index 000000000..2ae58aa45
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Chassis/MesChassisEfCoreRepository.cs
@@ -0,0 +1,13 @@
+using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore;
+using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Chassis;
+
+
+namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes;
+public class MesChassisEfCoreRepository : EfCoreRepository, IMesChassisRepository
+{
+ public MesChassisEfCoreRepository(IDbContextProvider dbContextProvider)
+ : base(dbContextProvider)
+ {
+ }
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeDbContextModelCreatingExtensions.cs
index 85ed867b5..0eb283227 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeDbContextModelCreatingExtensions.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeDbContextModelCreatingExtensions.cs
@@ -31,5 +31,6 @@ public static class DataExchangeDbContextModelCreatingExtensions
builder.ConfigureFrozen(options);
builder.ConfigureDelivery(options);
builder.ConfigureCallMtl(options);
+ builder.ConfigureMesChassis(options);
}
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeEntityFrameworkCoreFawtygModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeEntityFrameworkCoreFawtygModule.cs
index 192205bbc..bd4384bdc 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeEntityFrameworkCoreFawtygModule.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeEntityFrameworkCoreFawtygModule.cs
@@ -4,6 +4,7 @@ using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.MySQL;
using Volo.Abp.Modularity;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.CallMtl;
+using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Chassis;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Delivery;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Frozen;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
@@ -40,5 +41,6 @@ public class DataExchangeEntityFrameworkCoreFawtygModule : AbpModule
context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
+ context.Services.AddTransient();
}
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesDbContext.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesDbContext.cs
index c4efc833b..4b17a29ac 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesDbContext.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesDbContext.cs
@@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.CallMtl;
+using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Chassis;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Delivery;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Frozen;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
@@ -33,6 +34,8 @@ public class MesDbContext :
public virtual DbSet Delivery { get; }
public virtual DbSet CallMtl { get; }
+
+ public virtual DbSet MesChassis { get; }
public MesDbContext(DbContextOptions options)
: base(options)
{
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/FawtygAutoMapperProfile.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/FawtygAutoMapperProfile.cs
index e5fd5ef17..b44bae718 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/FawtygAutoMapperProfile.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/FawtygAutoMapperProfile.cs
@@ -3,6 +3,7 @@ using Volo.Abp.AutoMapper;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.WMS.BackFlushNote;
+using Win_in.Sfs.Wms.DataExchange.WMS.Chassis;
using Win_in.Sfs.Wms.DataExchange.WMS.DeliverNote;
using Win_in.Sfs.Wms.DataExchange.WMS.DeliverRequest;
using Win_in.Sfs.Wms.DataExchange.WMS.InjectionIssueRequest;
@@ -293,5 +294,9 @@ public class FawtygAutoMapperProfile : Profile
.Ignore(x => x.ReceivedQty)
.Ignore(x => x.Status)
.Ignore(x => x.PositionCode);
+ CreateMap()
+ .Ignore(x => x.ItemName)
+ .Ignore(x => x.ItemDesc1)
+ .Ignore(x => x.ItemDesc2);
}
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesChassisConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesChassisConverter.cs
new file mode 100644
index 000000000..419be875d
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesChassisConverter.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using Win_in.Sfs.Basedata.Application.Contracts;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Wms.DataExchange.Domain;
+using Win_in.Sfs.Wms.DataExchange.WMS.Chassis;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+using Volo.Abp.ObjectMapping;
+
+namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
+public class MesChassisConverter : IIncomingConverter
+{
+ private readonly IIncomingFromExternalManager _incomingFromExternalManager;
+ private readonly IIncomingToWmsManager _incomingToWmsManager;
+ private readonly IObjectMapper _objectMapper;
+ private readonly IItemBasicAppService _itemBasicAppService;
+ private readonly ILocationAppService _locationAppService;
+ private readonly ILogger _logger;
+
+ public MesChassisConverter(
+ IIncomingToWmsManager incomingToWmsManager
+ , IObjectMapper objectMapper
+ , IItemBasicAppService itemBasicAppService
+ , ILogger logger,
+ ILocationAppService locationAppService,
+ IIncomingFromExternalManager incomingFromExternalManager)
+ {
+ _incomingToWmsManager = incomingToWmsManager;
+ _objectMapper = objectMapper;
+ _itemBasicAppService = itemBasicAppService;
+ _logger = logger;
+ _locationAppService = locationAppService;
+ _incomingFromExternalManager = incomingFromExternalManager;
+ }
+
+ public virtual async Task ConvertAsync(List incomingFromExternalList)
+ {
+ if (!incomingFromExternalList.Any())
+ {
+ _logger.LogInformation("无底盘数据【转换】");
+ return;
+ }
+
+ //按Number合并Chassis单据
+ var transferNoteList = await BuildIncomingToWmsOfChassisAsync(incomingFromExternalList).ConfigureAwait(false);
+ await _incomingToWmsManager.CreateManyAsync(transferNoteList).ConfigureAwait(false);
+ //归档
+ await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
+ }
+
+ private async Task> BuildIncomingToWmsOfChassisAsync(List incomingDataList)
+ {
+ var incomingToWmsList = new List();
+ foreach (var incomingData in incomingDataList)
+ {
+ var incomingToWms = new IncomingToWms()
+ {
+ DataType = incomingData.DataType,
+ DataAction = incomingData.DataAction,
+ SourceSystem = incomingData.SourceSystem,
+ DataIdentityCode = incomingData.SourceDataGroupCode,
+ };
+ incomingToWms.SetEffectiveDate(incomingData.EffectiveDate);
+ var exchangeChassis = JsonSerializer.Deserialize(incomingData.DestinationDataContent);
+ var wmsChassis = _objectMapper.Map(exchangeChassis);
+ try
+ {
+ var item = await _itemBasicAppService.GetByCodeAsync(exchangeChassis.ItemCode).ConfigureAwait(false);
+ if (item != null)
+ {
+ wmsChassis.ItemName = item.Name;
+ wmsChassis.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : "";
+ wmsChassis.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : "";
+ }
+ }
+ catch (Exception)
+ {
+ wmsChassis.ItemName = "";
+ wmsChassis.ItemDesc1 = "";
+ wmsChassis.ItemDesc2 = "";
+ }
+ incomingToWms.DataContent = JsonSerializer.Serialize(wmsChassis);
+ incomingToWmsList.Add(incomingToWms);
+ }
+ return incomingToWmsList;
+ }
+
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesChassisReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesChassisReader.cs
new file mode 100644
index 000000000..8b0606f67
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesChassisReader.cs
@@ -0,0 +1,116 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
+using Win_in.Sfs.Wms.DataExchange.Domain;
+using System.Text.Json;
+using Win_in.Sfs.Wms.DataExchange.WMS.MesNote;
+using Win_in.Sfs.Basedata.Application.Contracts;
+using Win_in.Sfs.Shared.Domain.Shared;
+using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Chassis;
+using Win_in.Sfs.Wms.DataExchange.WMS.Chassis;
+
+namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
+public class MesChassisReader : IReader
+{
+ private readonly IMesChassisManager _mesChassisManager;
+ private readonly IIncomingFromExternalManager _incomingFromExternalManager;
+ private readonly ILogger _logger;
+ private readonly ILocationAppService _locationAppService;
+
+ public MesChassisReader(
+ IMesChassisManager mesChassisManager
+ , IIncomingFromExternalManager incomingFromExternalManager
+ , ILogger logger
+ , ILocationAppService locationAppService
+ )
+ {
+ _mesChassisManager = mesChassisManager;
+ _incomingFromExternalManager = incomingFromExternalManager;
+ _logger = logger;
+ _locationAppService = locationAppService;
+ }
+
+ public virtual async Task> ReadAsync()
+
+ {
+ //从MES读取待处理MesChassis
+ var toBeProcessedPillTasks = await _mesChassisManager.GetToBeProcessedListAsync().ConfigureAwait(false);
+ if (!toBeProcessedPillTasks.Any())
+ {
+ _logger.LogInformation("无底盘数据【读取】");
+ return new List();
+ }
+ //MesChassis逐一转换为MaterialRequest
+ var incomingDataList = BuildIncomingFromExternalFromPillTaskAsync(toBeProcessedPillTasks);
+ await _incomingFromExternalManager.CreateManyAsync(incomingDataList).ConfigureAwait(false);
+ //更新MES数据状态
+ await _mesChassisManager.UpdateProcessedListAsync(toBeProcessedPillTasks).ConfigureAwait(false);
+
+ return incomingDataList;
+ }
+
+ private static List BuildIncomingFromExternalFromPillTaskAsync(List toBeProcessedMesChassiss)
+ {
+ var incomingDataList = new List();
+ foreach (var MesChassis in toBeProcessedMesChassiss)
+ {
+ var incomingData = BuildIncomingFromExternal(MesChassis);
+
+ incomingData.SetEffectiveDate(DateTime.Now);
+ incomingData.SetSuccess();
+ try
+ {
+ var MaterialRequest = BuildChassisCreateInput(MesChassis);
+ incomingData.DestinationDataContent = JsonSerializer.Serialize(MaterialRequest);
+ }
+ catch (Exception ex)
+ {
+ incomingData.SetError(EnumExchangeDataErrorCode.Exception, ex.Message, ex.ToString());
+ }
+
+ incomingDataList.Add(incomingData);
+
+ }
+
+ return incomingDataList;
+ }
+
+ private static IncomingFromExternal BuildIncomingFromExternal(MesChassis MesChassis)
+ {
+ var incomingData = new IncomingFromExternal()
+ {
+ DataType = EnumIncomingDataType.MesChassis.ToString(),
+ DataAction = EnumExchangeDataAction.Add,
+ SourceSystem = EnumSystemType.MES.ToString(),
+ SourceDataId = MesChassis.mesout_fis_id.ToString(),
+ SourceDataGroupCode = MesChassis.mesout_fis_vin.ToString(),
+ SourceDataDetailCode = MesChassis.mesout_fis_erpno,
+ SourceDataContent = JsonSerializer.Serialize(MesChassis),
+ WriteTime = DateTime.Now,
+ Writer = nameof(MesIncomingBackgroundWorker),
+
+ DestinationSystem = EnumSystemType.WMS.ToString(),
+ };
+ return incomingData;
+ }
+
+ private static ChassisExchangeDto BuildChassisCreateInput(MesChassis MesChassis)
+ {
+ var chassis = new ChassisExchangeDto()
+ {
+ Number = MesChassis.mesout_fis_id.ToString(),
+ ChassisNumber= MesChassis.mesout_fis_vin,
+ Description= MesChassis.mesout_fis_productType,
+ ProduceDateTime= DateTime.Now,
+ ReceiveInterfaceDateTime= DateTime.Now,
+ SortNumber = MesChassis.mesout_fis_id,
+ ItemCode = MesChassis.mesout_fis_erpno,
+ Configuration= MesChassis.mesout_fis_productColor,
+ };
+ return chassis;
+ }
+
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
index 53d3fec9f..e0482a972 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
@@ -76,16 +76,16 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
//#endregion
- #region 报废 Scrap
- Logger.LogInformation($"读取报废(Scrap)");//报废
- var scrapReader = workerContext.ServiceProvider.GetRequiredService();
- var scrapConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取并保存Scrap
- var scrapsFromExternalList = await scrapReader.ReadAsync().ConfigureAwait(false);
- //转换Scrap
- await scrapConverter.ConvertAsync(scrapsFromExternalList).ConfigureAwait(false);
- Logger.LogInformation($"处理报废【{scrapsFromExternalList.Count}】条数据");
- #endregion
+ //#region 报废 Scrap
+ //Logger.LogInformation($"读取报废(Scrap)");//报废
+ //var scrapReader = workerContext.ServiceProvider.GetRequiredService();
+ //var scrapConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保存Scrap
+ //var scrapsFromExternalList = await scrapReader.ReadAsync().ConfigureAwait(false);
+ ////转换Scrap
+ //await scrapConverter.ConvertAsync(scrapsFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"处理报废【{scrapsFromExternalList.Count}】条数据");
+ //#endregion
//#region 耗用单 BackFlush
//Logger.LogInformation($"读取耗用单 (BackFlush)");//耗用单
@@ -109,7 +109,7 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
//Logger.LogInformation($"处理储位调拨【{transferNoteFromExternalList.Count}】条数据");
//#endregion
-
+
//#region 成品发运 Delivery
//Logger.LogInformation($"读取成品发运 (Delivery)");//成品发运
@@ -134,6 +134,18 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
//Logger.LogInformation($"处理自动叫料【{callMtlFromExternalList.Count}】条数据");
//#endregion
+
+ #region 底盘 Chassis
+ Logger.LogInformation($"读取底盘(Chassis)");//底盘
+ var mesChassisReader = workerContext.ServiceProvider.GetRequiredService();
+ var mesChassisConverter = workerContext.ServiceProvider.GetRequiredService();
+ //读取并保存Chassis
+ var mesChassisFromExternalList = await mesChassisReader.ReadAsync().ConfigureAwait(false);
+ //转换Chassis
+ await mesChassisConverter.ConvertAsync(mesChassisFromExternalList).ConfigureAwait(false);
+ Logger.LogInformation($"处理底盘【{mesChassisFromExternalList.Count}】条数据");
+ #endregion
+
Logger.LogInformation($"提交: 执行 {Incoming}");
#region 未启用接口启用时需要看逻辑修改
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs
index 5f5c36cc9..ad7887a2d 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs
@@ -49,39 +49,17 @@ public static class IncomingToWmsExtensions
await DepartmentBasicAppService.UpdateAsync(Department).ConfigureAwait(false);
}
-
+ public static async Task HandleChassisAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext)
+ {
+ var chassis = JsonSerializer.Deserialize(incomingConverted.DataContent);
+ var chassisAppService = workerContext.ServiceProvider.GetRequiredService();
+ await chassisAppService.CreateAsync(chassis).ConfigureAwait(false);
+ }
public static async Task HandleItemsAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext)
{
var item = JsonSerializer.Deserialize(incomingConverted.DataContent);
var itemBasicAppService = workerContext.ServiceProvider.GetRequiredService();
- await itemBasicAppService.UpsertAsyncByInterface(item).ConfigureAwait(false);
-
- //try
- //{
- // Thread thread = new Thread(thead);
-
- // thread.Start();
- // var BalanceAppService = workerContext.ServiceProvider.GetRequiredService();
- // BalanceUpdateItemBasicInfoDto balan = new BalanceUpdateItemBasicInfoDto();
- // List bala = new List();
- // BalanceUpdateItemBasicInfo ba = new BalanceUpdateItemBasicInfo();
- // ba.ItemCode = item.Code;
- // ba.ItemDesc1 = item.Desc1;
- // ba.ItemDesc2 = item.Desc2;
- // ba.ItemName = item.Name;
- // bala.Add(ba);
- // balan.BalanceUpdateItemBasicInfos = bala;
- // await BalanceAppService.UpdateItemBasicInfoAsync(balan).ConfigureAwait(false);
- //}
- //catch (Exception ex)
- //{
-
- //}
-
- }
- public static void thead()
- {
-
+ await itemBasicAppService.UpsertAsyncByInterface(item).ConfigureAwait(false);
}
public static async Task HandleErpLocationItemsAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext)
{
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 8b5413752..9993e4930 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
@@ -107,7 +107,7 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
incomingToWms.SetError(EnumExchangeDataErrorCode.Exception, e.Message);
}
//归档并删除
- // await incomingToWmsManager.ArchiveAsync(incomingToWms).ConfigureAwait(false);
+ await incomingToWmsManager.ArchiveAsync(incomingToWms).ConfigureAwait(false);
}
}
@@ -213,6 +213,9 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
case EnumIncomingDataType.CallMtl:
await incomingToWms.HandleInjectionIssueRequestAsync(workerContext).ConfigureAwait(false);
break;
+ case EnumIncomingDataType.MesChassis:
+ await incomingToWms.HandleChassisAsync(workerContext).ConfigureAwait(false);
+ break;
case EnumIncomingDataType.None:
default:
throw new ArgumentOutOfRangeException();
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json
index 2e0324e5f..0f8bdf492 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json
@@ -26,10 +26,10 @@
"RemoteServices": {
"BaseData": {
- "BaseUrl": "http://localhost:59094/"
+ "BaseUrl": "http://dev.ccwin-in.com:60084/"
},
"Store": {
- "BaseUrl": "http://localhost:59095/"
+ "BaseUrl": "http://dev.ccwin-in.com:60085/"
},
"Label": {
"BaseUrl": "http://dev.ccwin-in.com:60082/"
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/Chassis/ChassisExchangeDto.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/Chassis/ChassisExchangeDto.cs
new file mode 100644
index 000000000..238c10919
--- /dev/null
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/Chassis/ChassisExchangeDto.cs
@@ -0,0 +1,50 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace Win_in.Sfs.Wms.DataExchange.WMS.Chassis;
+public class ChassisExchangeDto
+{
+ ///
+ /// Wms编号
+ ///
+ [Display(Name = "Wms编号")]
+ public string Number { get; set; }
+
+ ///
+ /// 底盘号
+ ///
+ [Display(Name = "底盘号")]
+ public string ChassisNumber { get; set; }
+
+ ///
+ /// 描述
+ ///
+ [Display(Name = "描述")]
+ public string Description { get; set; }
+
+ ///
+ /// 底盘生产时间
+ ///
+ [Display(Name = "底盘生产时间")]
+ public DateTime ProduceDateTime { get; set; }
+
+ ///
+ /// 接收接口时间
+ ///
+ [Display(Name = "接收接口时间")]
+ public DateTime ReceiveInterfaceDateTime { get; set; }
+
+ ///
+ /// 执行位置排序列
+ ///
+ [Display(Name = "执行位置排序列")]
+ public long SortNumber { get; set; }
+
+ public string ItemCode { get; set; }
+
+ ///
+ /// 配置号
+ ///
+ [Display(Name = "配置号")]
+ public string Configuration { 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 bd66333af..166d79959 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
@@ -396,6 +396,41 @@
结束时间
+
+
+ Wms编号
+
+
+
+
+ 底盘号
+
+
+
+
+ 描述
+
+
+
+
+ 底盘生产时间
+
+
+
+
+ 接收接口时间
+
+
+
+
+ 执行位置排序列
+
+
+
+
+ 配置号
+
+
ERP料号
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.DbMigrator/appsettings.json b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.DbMigrator/appsettings.json
index 1dfd30089..43d616059 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.DbMigrator/appsettings.json
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.DbMigrator/appsettings.json
@@ -1,7 +1,7 @@
{
"ConnectionStrings": {
- "Default": "Server=dev.ccwin-in.com,13319;Database=DataExchange_Main;uid=sa;pwd=aA123456!;",
- "DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;"
+ "Default": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;",
+ "DataExchange": "Server=dev.ccwin-in.com,21195;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;"
},
"IdentityServer": {
"Clients": {
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumIncomingDataType.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumIncomingDataType.cs
index dfce502f1..0e45e8cc2 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumIncomingDataType.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumIncomingDataType.cs
@@ -130,4 +130,8 @@ public enum EnumIncomingDataType
/// 自动叫料
///
CallMtl=31,
+ ///
+ /// 底盘
+ ///
+ MesChassis=32,
}
From 9d885414b763ba3e783a9af0b34fd73ee6584ff9 Mon Sep 17 00:00:00 2001
From: lvzb <35200379@qq.com>
Date: Wed, 10 Jul 2024 13:36:43 +0800
Subject: [PATCH 05/17] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../EosAgentModule.cs | 4 ++--
.../Incoming/EosIncomingBackgroundWorker.cs | 2 +-
.../FawtygAutoMapperProfile.cs | 3 +++
.../DataExchangeEntityFrameworkCoreModule.cs | 1 +
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs
index 8d4989e44..43fc043db 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs
@@ -165,8 +165,8 @@ public class EosAgentModule : AbpModule
ApplicationInitializationContext context)
{
- //context.AddBackgroundWorkerAsync();
- context.AddBackgroundWorkerAsync();
+ context.AddBackgroundWorkerAsync();
+ context.AddBackgroundWorkerAsync();
}
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
index ae5bc9f51..7b109e3fc 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
@@ -31,7 +31,7 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
{
Logger.LogInformation($"开始: 执行 {Incoming}");
var configManager = workerContext.ServiceProvider.GetRequiredService();
- var confitem = await configManager.GetInterfaceConfig("").ConfigureAwait(false);
+ var confitem = await configManager.GetInterfaceConfig("EOS-IN").ConfigureAwait(false);
if (confitem == null)
{
if (!_options.Value.IncomingOptions.Active)
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs
index b83e2409d..300c8bd05 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs
@@ -113,8 +113,11 @@ public class FawtygAutoMapperProfile : Profile
CreateMap();
CreateMap();
CreateMap();
+ CreateMap();
CreateMap();
+ CreateMap ();
CreateMap();
+ CreateMap();
CreateMap();
CreateMap();
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeEntityFrameworkCoreModule.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeEntityFrameworkCoreModule.cs
index 92a4b08b1..25b9272df 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeEntityFrameworkCoreModule.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore/EntityFrameworkCore/DataExchangeEntityFrameworkCoreModule.cs
@@ -51,6 +51,7 @@ public class DataExchangeEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
+ context.Services.AddTransient();
Configure(options =>
{
From 200574e518d87fa14e24a5cf9e17672a95802db0 Mon Sep 17 00:00:00 2001
From: liuyunfeng
Date: Wed, 10 Jul 2024 16:51:41 +0800
Subject: [PATCH 06/17] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=89=B9=E9=87=8F?=
=?UTF-8?q?=E6=8F=92=E5=85=A5=E6=8B=86=E7=AE=B1=E8=A1=A8=E8=B6=85=E6=97=B6?=
=?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SplitPackings/SplitPackingRecManager.cs | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs
index a4564026f..bd72af6e8 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs
@@ -25,7 +25,6 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
public async Task BatchInsertAsync(List input)
{
- var query = await _repository.GetQueryableAsync().ConfigureAwait(false);
foreach (SplitPackingRec item in input)
{
#region 校验
@@ -44,6 +43,11 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
}
}
#endregion
+ }
+
+ var query = await _repository.GetQueryableAsync().ConfigureAwait(false);
+ foreach (SplitPackingRec item in input)
+ {
if (item.OprType == OprTypeEnum.SplitBox || item.OprType == OprTypeEnum.MergeBox)
{
@@ -75,11 +79,11 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
newObj.FromUom = newObj.ToUom;
newObj.FromQty = newObj.ToQty;
newObj.FromLot = newObj.ToLot;
- var res = await _repository.InsertAsync(newObj, true).ConfigureAwait(false);
+ var res = await _repository.InsertAsync(newObj, false).ConfigureAwait(false);
}
SplitPackingRec newEntity = CommonHelper.CloneObj(item);
newEntity.SetId(GuidGenerator.Create());
- var ret = await _repository.InsertAsync(newEntity, true).ConfigureAwait(false);
+ var ret = await _repository.InsertAsync(newEntity, false).ConfigureAwait(false);
}
else
{
@@ -93,7 +97,7 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
}
SplitPackingRec newEntity = CommonHelper.CloneObj(item);
newEntity.SetId(GuidGenerator.Create());
- var ret = await _repository.InsertAsync(newEntity, true).ConfigureAwait(false);
+ var ret = await _repository.InsertAsync(newEntity, false).ConfigureAwait(false);
}
} //foreach
return true;
From d39b50bb7f5ebc7b669038dc08416b2e6ed238b7 Mon Sep 17 00:00:00 2001
From: lvzb <35200379@qq.com>
Date: Thu, 11 Jul 2024 08:43:50 +0800
Subject: [PATCH 07/17] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E6=8E=A7=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Outgoing/EosOutgoingBackgroundWorker.cs | 21 +-
...tionMoldingTaskIncomingBackgroundWorker.cs | 31 +--
.../Incoming/MesIncomingBackgroundWorker.cs | 197 ++++++++++--------
.../Outgoing/MesOutgoingBackgroundWorker.cs | 21 +-
.../Incoming/TyrpIncomingBackgroundWorker.cs | 21 +-
.../Outgoing/TyrpOutgoingBackgroundWorker.cs | 21 +-
.../IncomingToWmsWorker.cs | 37 ++--
.../OutgoingFromWmsWorker.cs | 4 +-
.../Kittings/KittingAppService.cs | 4 +-
.../settings/appsettings.Development.json | 7 +-
10 files changed, 224 insertions(+), 140 deletions(-)
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/EosOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/EosOutgoingBackgroundWorker.cs
index 677a44fa8..b9de3d016 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/EosOutgoingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/EosOutgoingBackgroundWorker.cs
@@ -5,6 +5,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading;
using Volo.Abp.Uow;
+using Win_in.Sfs.Wms.DataExchange.Domain;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
@@ -29,10 +30,24 @@ public class EosOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
Logger.LogInformation($"开始: 执行 {Outgoing}");
- if (!_options.Value.IncomingOptions.Active)
+
+ var configManager = workerContext.ServiceProvider.GetRequiredService();
+ var confitem = await configManager.GetInterfaceConfig("EOS-OUT").ConfigureAwait(false);
+ if (confitem == null)
+ {
+ if (!_options.Value.OutgoingOptions.Active)
+ {
+ Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
+ return;
+ }
+ }
+ else
{
- Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
- return;
+ if (!confitem.Active)
+ {
+ Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
+ return;
+ }
}
Logger.LogInformation($"传出 采购上架单");
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs
index 6f9e10808..bc6238dd0 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs
@@ -6,6 +6,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading;
using Volo.Abp.Uow;
+using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming;
using Win_in.Sfs.Wms.Store.Application.Contracts;
@@ -13,7 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class InjectionMoldingTaskIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
{
- private readonly string Incoming = "InjectionMoldingTask Incoming";
+ private readonly string Incoming = "视觉接收";
private readonly IOptions _options;
@@ -32,30 +33,36 @@ public class InjectionMoldingTaskIncomingBackgroundWorker : AsyncPeriodicBackgro
_options.Value.AutoRemote.Interval = 2;
#endif
-
-
Timer.Period = options.Value.AutoRemote.TimeCycle * 60 * 1000; //default 10 minutes
}
[UnitOfWork]
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
- Logger.LogInformation($"Starting: Handling {Incoming}");
- if (!_options.Value.IncomingOptions.Active)
+ Logger.LogInformation($"开始: 执行 {Incoming}");
+ var configManager = workerContext.ServiceProvider.GetRequiredService();
+ var confitem = await configManager.GetInterfaceConfig("SJ-IN").ConfigureAwait(false);
+ if (confitem == null)
{
- Logger.LogInformation($"{Incoming} is not active!");
- return;
+ if (!_options.Value.IncomingOptions.Active)
+ {
+ Logger.LogInformation($"{Incoming} 已关闭没有执行!");
+ return;
+ }
}
- int min = DateTime.Now.Hour*60+ DateTime.Now.Minute;//第二天00:05:00与当天23:55:00不执行避免tyrpnumber重复
- if ( (24*60-5)<= min || min <= 5)
+ else
{
- Logger.LogInformation($"{Incoming} 时间小于第二天00:05:00大于当天23:55:00");
- return;
+ if (!confitem.Active)
+ {
+ Logger.LogInformation($"{Incoming} 已关闭没有执行!");
+ return;
+ }
}
+
Logger.LogInformation($"注塑任务");//缴库
var reader = workerContext.ServiceProvider.GetService();
await reader.ReadAsync().ConfigureAwait(false);
- Logger.LogInformation($"Completed: Handling {Incoming}");
+ Logger.LogInformation($"提交: 执行 {Incoming}");
}
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
index e0482a972..e2b0a43e9 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
@@ -7,6 +7,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading;
using Volo.Abp.Uow;
+using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
@@ -32,12 +33,27 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
Logger.LogInformation($"开始: 执行 {Incoming}");
- if (!_options.Value.IncomingOptions.Active)
+
+ var configManager = workerContext.ServiceProvider.GetRequiredService();
+ var confitem = await configManager.GetInterfaceConfig("MES-IN").ConfigureAwait(false);
+ if (confitem == null)
{
- Logger.LogInformation($"{Incoming} 已关闭没有执行!");
- return;
+ if (!_options.Value.IncomingOptions.Active)
+ {
+ Logger.LogInformation($"{Incoming} 已关闭没有执行!");
+ return;
+ }
+ }
+ else
+ {
+ if (!confitem.Active)
+ {
+ Logger.LogInformation($"{Incoming} 已关闭没有执行!");
+ return;
+ }
}
+
int min = DateTime.Now.Hour*60+ DateTime.Now.Minute;//第二天00:05:00与当天23:55:00不执行避免tyrpnumber重复
if ( (24*60-5)<= min || min <= 5)
{
@@ -45,94 +61,93 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
return;
}
- //#region 缴库 MesOut
- //Logger.LogInformation($"读取缴库(MesOut)");//缴库
- //var mesOutReader = workerContext.ServiceProvider.GetRequiredService();
- //var mesOutConverter = workerContext.ServiceProvider.GetRequiredService();
- //var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService();
- ////读取mes缴库
- //var mesOutsFromExternalList = await mesOutReader.ReadAsync().ConfigureAwait(false);
- //var mesOutsFromExternalList_ProductReceipt = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.ProductReceipt.ToString()).ToList();
- //var mesOutsFromExternalList_TransferNote = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.TransferNote.ToString()).ToList();
- ////转换缴库数据(如果有质量补得数据直接生产移库数据移到客户库位)
- //await mesOutConverter.ConvertAsync(mesOutsFromExternalList_ProductReceipt).ConfigureAwait(false);
- //if (mesOutsFromExternalList_TransferNote.Count > 0)//如果有质量补则生产储位调拨任务
- //{
- // await TransferNoteConverter.ConvertAsync(mesOutsFromExternalList_TransferNote).ConfigureAwait(false);
- //}
- //Logger.LogInformation($"处理完工收货(缴库)【{mesOutsFromExternalList_ProductReceipt.Count}】条数据");
- //Logger.LogInformation($"处理储位调拨【{mesOutsFromExternalList_TransferNote.Count}】条数据");
- //#endregion
-
- //#region 冻结解冻 Frozen
- //Logger.LogInformation($"读取冻结解冻 (Frozen)");//冻结解冻
- //var FrozenReader = workerContext.ServiceProvider.GetRequiredService();
- //var FrozenConverter = workerContext.ServiceProvider.GetRequiredService();
- ////读取并保存Frozen
- //var mesNoteFromExternalList = await FrozenReader.ReadAsync().ConfigureAwait(false);
- ////转换Frozen
- //await FrozenConverter.ConvertAsync(mesNoteFromExternalList).ConfigureAwait(false);
- //Logger.LogInformation($"处理冻结解冻【{mesNoteFromExternalList.Count}】条数据");
- //#endregion
-
-
- //#region 报废 Scrap
- //Logger.LogInformation($"读取报废(Scrap)");//报废
- //var scrapReader = workerContext.ServiceProvider.GetRequiredService();
- //var scrapConverter = workerContext.ServiceProvider.GetRequiredService();
- ////读取并保存Scrap
- //var scrapsFromExternalList = await scrapReader.ReadAsync().ConfigureAwait(false);
- ////转换Scrap
- //await scrapConverter.ConvertAsync(scrapsFromExternalList).ConfigureAwait(false);
- //Logger.LogInformation($"处理报废【{scrapsFromExternalList.Count}】条数据");
- //#endregion
-
- //#region 耗用单 BackFlush
- //Logger.LogInformation($"读取耗用单 (BackFlush)");//耗用单
- //var BackFlushReader = workerContext.ServiceProvider.GetRequiredService();
- //var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService();
- ////读取并保存BackFlush
- //var backFlushsFromExternalList = await BackFlushReader.ReadAsync().ConfigureAwait(false);
- ////转换BackFlush
- //await BackFlushConverter.ConvertAsync(backFlushsFromExternalList).ConfigureAwait(false);
- //Logger.LogInformation($"处理耗用单【{backFlushsFromExternalList.Count}】条数据");
- //#endregion
-
- //#region 储位调拨 TransferNote
- //Logger.LogInformation($"读取储位调拨 (TransferNote)");//储位调拨
- //var TransferNoteReader = workerContext.ServiceProvider.GetRequiredService();
- //// var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService();
- ////读取并保存TransferNote
- //var transferNoteFromExternalList = await TransferNoteReader.ReadAsync().ConfigureAwait(false);
- ////转换TransferNote
- //await TransferNoteConverter.ConvertAsync(transferNoteFromExternalList).ConfigureAwait(false);
- //Logger.LogInformation($"处理储位调拨【{transferNoteFromExternalList.Count}】条数据");
- //#endregion
-
-
-
- //#region 成品发运 Delivery
- //Logger.LogInformation($"读取成品发运 (Delivery)");//成品发运
- //var DeliveryReader = workerContext.ServiceProvider.GetRequiredService();
- //var DeliveryConverter = workerContext.ServiceProvider.GetRequiredService();
- ////读取并保存Delivery
- //var deliveryNoteFromExternalList = await DeliveryReader.ReadAsync().ConfigureAwait(false);
- ////转换Delivery
- //await DeliveryConverter.ConvertAsync(deliveryNoteFromExternalList).ConfigureAwait(false);
- //Logger.LogInformation($"处理成品发运【{deliveryNoteFromExternalList.Count}】条数据");
- //#endregion
-
- //#region 自动叫料 CallMtl
-
- //Logger.LogInformation($"读取自动叫料 (CallMtl)");//自动叫料
- //var CallMtlReader = workerContext.ServiceProvider.GetRequiredService();
- //var CallMtlConverter = workerContext.ServiceProvider.GetRequiredService();
- ////读取并保存Delivery
- //var callMtlFromExternalList = await CallMtlReader.ReadAsync().ConfigureAwait(false);
- ////转换Delivery
- //await CallMtlConverter.ConvertAsync(callMtlFromExternalList).ConfigureAwait(false);
- //Logger.LogInformation($"处理自动叫料【{callMtlFromExternalList.Count}】条数据");
- //#endregion
+ #region 缴库 MesOut
+ Logger.LogInformation($"读取缴库(MesOut)");//缴库
+ var mesOutReader = workerContext.ServiceProvider.GetRequiredService();
+ var mesOutConverter = workerContext.ServiceProvider.GetRequiredService();
+ var TransferNoteConverter = workerContext.ServiceProvider.GetRequiredService();
+ //读取mes缴库
+ var mesOutsFromExternalList = await mesOutReader.ReadAsync().ConfigureAwait(false);
+ var mesOutsFromExternalList_ProductReceipt = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.ProductReceipt.ToString()).ToList();
+ var mesOutsFromExternalList_TransferNote = mesOutsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.TransferNote.ToString()).ToList();
+ //转换缴库数据(如果有质量补得数据直接生产移库数据移到客户库位)
+ await mesOutConverter.ConvertAsync(mesOutsFromExternalList_ProductReceipt).ConfigureAwait(false);
+ if (mesOutsFromExternalList_TransferNote.Count > 0)//如果有质量补则生产储位调拨任务
+ {
+ await TransferNoteConverter.ConvertAsync(mesOutsFromExternalList_TransferNote).ConfigureAwait(false);
+ }
+ Logger.LogInformation($"处理完工收货(缴库)【{mesOutsFromExternalList_ProductReceipt.Count}】条数据");
+ Logger.LogInformation($"处理储位调拨【{mesOutsFromExternalList_TransferNote.Count}】条数据");
+ #endregion
+
+ #region 冻结解冻 Frozen
+ Logger.LogInformation($"读取冻结解冻 (Frozen)");//冻结解冻
+ var FrozenReader = workerContext.ServiceProvider.GetRequiredService();
+ var FrozenConverter = workerContext.ServiceProvider.GetRequiredService();
+ //读取并保存Frozen
+ var mesNoteFromExternalList = await FrozenReader.ReadAsync().ConfigureAwait(false);
+ //转换Frozen
+ await FrozenConverter.ConvertAsync(mesNoteFromExternalList).ConfigureAwait(false);
+ Logger.LogInformation($"处理冻结解冻【{mesNoteFromExternalList.Count}】条数据");
+ #endregion
+
+
+ #region 报废 Scrap
+ Logger.LogInformation($"读取报废(Scrap)");//报废
+ var scrapReader = workerContext.ServiceProvider.GetRequiredService();
+ var scrapConverter = workerContext.ServiceProvider.GetRequiredService();
+ //读取并保存Scrap
+ var scrapsFromExternalList = await scrapReader.ReadAsync().ConfigureAwait(false);
+ //转换Scrap
+ await scrapConverter.ConvertAsync(scrapsFromExternalList).ConfigureAwait(false);
+ Logger.LogInformation($"处理报废【{scrapsFromExternalList.Count}】条数据");
+ #endregion
+
+ #region 耗用单 BackFlush
+ Logger.LogInformation($"读取耗用单 (BackFlush)");//耗用单
+ var BackFlushReader = workerContext.ServiceProvider.GetRequiredService();
+ var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService();
+ //读取并保存BackFlush
+ var backFlushsFromExternalList = await BackFlushReader.ReadAsync().ConfigureAwait(false);
+ //转换BackFlush
+ await BackFlushConverter.ConvertAsync(backFlushsFromExternalList).ConfigureAwait(false);
+ Logger.LogInformation($"处理耗用单【{backFlushsFromExternalList.Count}】条数据");
+ #endregion
+
+ #region 储位调拨 TransferNote
+ Logger.LogInformation($"读取储位调拨 (TransferNote)");//储位调拨
+ var TransferNoteReader = workerContext.ServiceProvider.GetRequiredService();
+ //读取并保存TransferNote
+ var transferNoteFromExternalList = await TransferNoteReader.ReadAsync().ConfigureAwait(false);
+ //转换TransferNote
+ await TransferNoteConverter.ConvertAsync(transferNoteFromExternalList).ConfigureAwait(false);
+ Logger.LogInformation($"处理储位调拨【{transferNoteFromExternalList.Count}】条数据");
+ #endregion
+
+
+
+ #region 成品发运 Delivery
+ Logger.LogInformation($"读取成品发运 (Delivery)");//成品发运
+ var DeliveryReader = workerContext.ServiceProvider.GetRequiredService();
+ var DeliveryConverter = workerContext.ServiceProvider.GetRequiredService();
+ //读取并保存Delivery
+ var deliveryNoteFromExternalList = await DeliveryReader.ReadAsync().ConfigureAwait(false);
+ //转换Delivery
+ await DeliveryConverter.ConvertAsync(deliveryNoteFromExternalList).ConfigureAwait(false);
+ Logger.LogInformation($"处理成品发运【{deliveryNoteFromExternalList.Count}】条数据");
+ #endregion
+
+ #region 自动叫料 CallMtl
+
+ Logger.LogInformation($"读取自动叫料 (CallMtl)");//自动叫料
+ var CallMtlReader = workerContext.ServiceProvider.GetRequiredService();
+ var CallMtlConverter = workerContext.ServiceProvider.GetRequiredService();
+ //读取并保存Delivery
+ var callMtlFromExternalList = await CallMtlReader.ReadAsync().ConfigureAwait(false);
+ //转换Delivery
+ await CallMtlConverter.ConvertAsync(callMtlFromExternalList).ConfigureAwait(false);
+ Logger.LogInformation($"处理自动叫料【{callMtlFromExternalList.Count}】条数据");
+ #endregion
#region 底盘 Chassis
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Outgoing/MesOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Outgoing/MesOutgoingBackgroundWorker.cs
index 44efc9126..115e3c408 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Outgoing/MesOutgoingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Outgoing/MesOutgoingBackgroundWorker.cs
@@ -5,6 +5,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading;
using Volo.Abp.Uow;
+using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Outgoing;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
@@ -30,10 +31,24 @@ public class MesOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
Logger.LogInformation($"Starting: Handling {Outgoing}");
- if (!_options.Value.IncomingOptions.Active)
+
+ var configManager = workerContext.ServiceProvider.GetRequiredService();
+ var confitem = await configManager.GetInterfaceConfig("MES-OUT").ConfigureAwait(false);
+ if (confitem == null)
+ {
+ if (!_options.Value.OutgoingOptions.Active)
+ {
+ Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
+ return;
+ }
+ }
+ else
{
- Logger.LogInformation($"{Outgoing} is not active!");
- return;
+ if (!confitem.Active)
+ {
+ Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
+ return;
+ }
}
Logger.LogInformation($"Write Issue");
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs
index e1cb31cb6..d2660f40e 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs
@@ -7,6 +7,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading;
using Volo.Abp.Uow;
+using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming;
@@ -34,10 +35,24 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
Logger.LogInformation($"开始: 执行 {Incoming}");
- if (!_options.Value.IncomingOptions.Active)
+
+ var configManager = workerContext.ServiceProvider.GetRequiredService();
+ var confitem = await configManager.GetInterfaceConfig("TYRP-IN").ConfigureAwait(false);
+ if (confitem == null)
{
- Logger.LogInformation($"{Incoming} 已关闭没有执行!");
- return;
+ if (!_options.Value.IncomingOptions.Active)
+ {
+ Logger.LogInformation($"{Incoming} 已关闭没有执行!");
+ return;
+ }
+ }
+ else
+ {
+ if (!confitem.Active)
+ {
+ Logger.LogInformation($"{Incoming} 已关闭没有执行!");
+ return;
+ }
}
//var repository = workerContext.ServiceProvider.GetRequiredService();
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
index bba3b1d39..e44fd2cd1 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
@@ -7,6 +7,7 @@ using Microsoft.Extensions.Options;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Threading;
using Volo.Abp.Uow;
+using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing;
@@ -33,11 +34,23 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
Logger.LogInformation($"开始: 执行 {Outgoing}");
-
- if (!_options.Value.OutgoingOptions.Active)
+ var configManager = workerContext.ServiceProvider.GetRequiredService();
+ var confitem = await configManager.GetInterfaceConfig("TYRP-OUT").ConfigureAwait(false);
+ if (confitem == null)
{
- Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
- return;
+ if (!_options.Value.OutgoingOptions.Active)
+ {
+ Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
+ return;
+ }
+ }
+ else
+ {
+ if (!confitem.Active)
+ {
+ Logger.LogInformation($"{Outgoing} 已关闭没有执行!");
+ return;
+ }
}
var scontrolWriter = workerContext.ServiceProvider.GetRequiredService();//scontrol中间表服务
var wmsoutmWriter = workerContext.ServiceProvider.GetRequiredService();//wmsoutm中间表的服务
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 9993e4930..9248aa46a 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
@@ -50,25 +50,24 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
Logger.LogInformation("开始接收数据...");
- // var configManager = workerContext.ServiceProvider.GetRequiredService();
- //var confitem = await configManager.GetInterfaceConfig("").ConfigureAwait(false);
- // if (confitem == null)
- // {
- // if (!_options.Value.IncomingOptions.Active)
- // {
- // Logger.LogInformation("Wms接收接口已关闭!");
- // return;
- // }
- // }
- // else
- // {
- // if (!confitem.Active)
- // {
- // Logger.LogInformation("Wms接收接口已关闭!");
- // return;
- // }
- // }
-
+ var configManager = workerContext.ServiceProvider.GetRequiredService();
+ var confitem = await configManager.GetInterfaceConfig("WMS-IN").ConfigureAwait(false);
+ if (confitem == null)
+ {
+ if (!_options.Value.IncomingOptions.Active)
+ {
+ Logger.LogInformation("Wms接收接口已关闭!");
+ return;
+ }
+ }
+ else
+ {
+ if (!confitem.Active)
+ {
+ Logger.LogInformation("Wms接收接口已关闭!");
+ return;
+ }
+ }
await HandleIncomingDataAsync(workerContext).ConfigureAwait(false);
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs
index bc8b8b739..b59cbd929 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/OutgoingFromWmsWorker.cs
@@ -29,8 +29,9 @@ public class OutgoingFromWmsWorker : AsyncPeriodicBackgroundWorkerBase
[UnitOfWork]
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
+ Logger.LogInformation("开始传出数据...");
var configManager = workerContext.ServiceProvider.GetRequiredService();
- var confitem = await configManager.GetInterfaceConfig("").ConfigureAwait(false);
+ var confitem = await configManager.GetInterfaceConfig("WMS-OUT").ConfigureAwait(false);
if (confitem == null)
{
if (!_options.Active)
@@ -79,5 +80,6 @@ public class OutgoingFromWmsWorker : AsyncPeriodicBackgroundWorkerBase
{
Logger.LogInformation(ex.Message+ex?.InnerException.Message);
}
+ Logger.LogInformation("提交传出数据...");
}
}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs
index 77dbbbde3..7e92e6198 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs
@@ -344,8 +344,8 @@ public class KittingAppService : SfsBaseDataWithCodeAppServiceBase
Date: Thu, 11 Jul 2024 13:22:43 +0800
Subject: [PATCH 08/17] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ItemContainers/ItemContainerAppService.cs | 17 +++++++++++++++--
.../PositionCodes/PositionCodeAppService.cs | 5 +++--
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemContainers/ItemContainerAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemContainers/ItemContainerAppService.cs
index 10ba51340..37792339b 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemContainers/ItemContainerAppService.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemContainers/ItemContainerAppService.cs
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories;
@@ -39,7 +40,19 @@ public class ItemContainerAppService
_repository = repository;
_manager = manager;
}
-
+ protected override async Task> ImportProcessingEntityAsync( Dictionary dictionary)
+ {
+ var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key);
+ foreach (var itemContainer in addList)
+ {
+ if (string.IsNullOrEmpty(itemContainer.BasicUom))
+ {
+ var itemBasic = await ItemBasicAppService.GetByCodeAsync(itemContainer.ItemCode).ConfigureAwait(false);
+ itemContainer.BasicUom = itemBasic.BasicUom;
+ }
+ }
+ return dictionary;
+ }
///
/// 用来重写 新增实体
///
@@ -86,7 +99,7 @@ public class ItemContainerAppService
{
//20240520苑静雯删除
await base.CheckItemBasicItemCodeAsync(importInput.ItemCode, validationRresult).ConfigureAwait(false);
- // await base.CheckItemBasicPackUomAsync(importInput.ItemCode, importInput.BasicUom, validationRresult).ConfigureAwait(false);
+ //await base.CheckItemBasicPackUomAsync(importInput.ItemCode, importInput.BasicUom, validationRresult).ConfigureAwait(false);
//await base.CheckItemContainerAsync(importInput.ContainerCode, validationRresult).ConfigureAwait(false);
}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCodes/PositionCodeAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCodes/PositionCodeAppService.cs
index 4365fbf6c..95d6ed088 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCodes/PositionCodeAppService.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCodes/PositionCodeAppService.cs
@@ -95,10 +95,10 @@ public class PositionCodeAppService
{
throw new UserFriendlyException($"{id} 未找到位置码信息");
}
- var itemEntity = await _repository.FirstOrDefaultAsync(p => p.PartCode == input.PartCode && p.Code!=input.Code).ConfigureAwait(false);
+ var itemEntity = await _repository.FirstOrDefaultAsync(p => p.PartCode == input.PartCode && p.Code==input.Code).ConfigureAwait(false);
if (itemEntity != null)
{
- throw new UserFriendlyException($"{input.PartCode} 物品已存在");
+ throw new UserFriendlyException($"位置码{input.Code}已存在物品{input.PartCode}的信息 ");
}
@@ -142,6 +142,7 @@ public class PositionCodeAppService
var itemBasic = await ItemBasicAppService.GetByCodeAsync(positionCode.PartCode).ConfigureAwait(false);
positionCode.PartName = itemBasic.Name;
positionCode.PartDesc = itemBasic.Desc1;
+ if (string.IsNullOrEmpty(positionCode.BasicUom)) positionCode.BasicUom = itemBasic.BasicUom;
switch (positionCode.Type)
{
case EnumPositionCodeType.InjectionIssue:
From b71d31b0be551524cb1cf1c9f1763b8fc041085e Mon Sep 17 00:00:00 2001
From: lvzb <35200379@qq.com>
Date: Thu, 11 Jul 2024 14:55:07 +0800
Subject: [PATCH 09/17] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8F=AB=E6=96=99?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../CallMtl/CallMtl.cs | 4 ++--
.../CallMtl/CallMtlManager.cs | 8 ++++----
.../CallMtl/CallMtlDbContextModelCreatingExtensions.cs | 3 ++-
.../Incoming/CallMtlReader.cs | 4 ++--
.../Incoming/MesOutConverter.cs | 2 +-
.../Enums/Store/EnumIssueRequestType.cs | 4 ++--
6 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/CallMtl/CallMtl.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/CallMtl/CallMtl.cs
index 7b9b122ee..46e7f3af1 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/CallMtl/CallMtl.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/CallMtl/CallMtl.cs
@@ -8,7 +8,7 @@ public class CallMtl : Entity
/// 序号
///
[Key]
- public string mesout_callmtl_id { get; set; }
+ public long ID { get; set; }
///
/// 物料
///
@@ -33,7 +33,7 @@ public class CallMtl : Entity
public override object[] GetKeys()
{
- return new object[] { mesout_callmtl_id };
+ return new object[] { ID };
}
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/CallMtl/CallMtlManager.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/CallMtl/CallMtlManager.cs
index d48c9e68e..4664c7398 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/CallMtl/CallMtlManager.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/CallMtl/CallMtlManager.cs
@@ -20,8 +20,8 @@ public class CallMtlManager : DomainService, ICallMtlManager
}
public virtual async Task UpdateProcesseErrordListAsync(List entities)
{
- var ids = entities.Select(p => p.mesout_callmtl_id);
- var plans = await _repository.GetListAsync(p => ids.Contains(p.mesout_callmtl_id)).ConfigureAwait(false);
+ var ids = entities.Select(p => p.ID);
+ var plans = await _repository.GetListAsync(p => ids.Contains(p.ID)).ConfigureAwait(false);
plans.ForEach(p =>
{
p.Yl1 = 2;
@@ -31,8 +31,8 @@ public class CallMtlManager : DomainService, ICallMtlManager
}
public virtual async Task UpdateProcessedListAsync(List entities)
{
- var ids = entities.Select(p => p.mesout_callmtl_id);
- var plans = await _repository.GetListAsync(p => ids.Contains(p.mesout_callmtl_id)).ConfigureAwait(false);
+ var ids = entities.Select(p => p.ID);
+ var plans = await _repository.GetListAsync(p => ids.Contains(p.ID)).ConfigureAwait(false);
plans.ForEach(p =>
{
p.Yl1 = 1;
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/CallMtl/CallMtlDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/CallMtl/CallMtlDbContextModelCreatingExtensions.cs
index 9a28e7a47..4764666e3 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/CallMtl/CallMtlDbContextModelCreatingExtensions.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/CallMtl/CallMtlDbContextModelCreatingExtensions.cs
@@ -15,7 +15,8 @@ public static class CallMtlDbContextModelCreatingExtensions
b.ConfigureByConvention();
//Properties
- b.Property(q => q.mesout_callmtl_id).HasMaxLength(20);
+ // b.Property(q => q.ID).HasMaxLength(20);
+ b.Property(q => q.ID);
b.Property(q => q.mesout_callmtl_erpno).HasMaxLength(20);
b.Property(q => q.mesout_callmtl_loc).HasMaxLength(10);
b.Property(q => q.mesout_callmtl_num).HasPrecision(10, 2);
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/CallMtlReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/CallMtlReader.cs
index 7bc6dd95a..1d70736d3 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/CallMtlReader.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/CallMtlReader.cs
@@ -86,8 +86,8 @@ public class CallMtlReader : IReader
DataType = EnumIncomingDataType.CallMtl.ToString(),
DataAction = EnumExchangeDataAction.Add,
SourceSystem = EnumSystemType.MES.ToString(),
- SourceDataId = CallMtl.mesout_callmtl_id.ToString(),
- SourceDataGroupCode = CallMtl.mesout_callmtl_id,
+ SourceDataId = CallMtl.ID.ToString(),
+ SourceDataGroupCode = CallMtl.ID.ToString(),
SourceDataDetailCode = CallMtl.mesout_callmtl_erpno,
SourceDataContent = JsonSerializer.Serialize(CallMtl),
WriteTime = DateTime.Now,
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
index 8f02b2b60..8ea019ee8 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
@@ -105,7 +105,7 @@ public class MesOutConverter : IIncomingConverter
//}
//else
//{
- wmsProductReceiptNoteDetail.Lot = ""; //排序批次
+ wmsProductReceiptNoteDetail.Lot = ""; //排序批次
wmsProductReceiptNoteDetail.PackingCode = "";//箱标签
wmsProductReceiptNoteDetail.Status = EnumInventoryStatus.OK;
wmsProductReceiptNoteDetail.WarehouseCode = "T9";
diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueRequestType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueRequestType.cs
index 6518de328..f16e5e746 100644
--- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueRequestType.cs
+++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumIssueRequestType.cs
@@ -41,8 +41,8 @@ public enum EnumIssueRequestType
ExcelImport=5,
///
- /// 注塑计划
+ /// 涂装上线计划
///
- [Display(Name = "EXCEL导入")]
+ [Display(Name = "涂装上线计划")]
InjectionPlan = 6,
}
From f92160f6ef3b6c510b2fa9473810ec8a358de71c Mon Sep 17 00:00:00 2001
From: lvzb <35200379@qq.com>
Date: Thu, 11 Jul 2024 15:37:30 +0800
Subject: [PATCH 10/17] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Transactions/ScrapNoteEventHandler.cs | 36 ++++++++++---------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
index d28b17034..0f474b9c2 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using DocumentFormat.OpenXml.Vml.Spreadsheet;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
@@ -40,31 +41,32 @@ public class ScrapNoteEventHandler
private async Task AddTransactionsAsync(List scrapNotes)
{
+ var isScrapLocation = await SettingManager.IsTrueAsync(StoreSettings.Common.EnableScrapLocation).ConfigureAwait(false); //如果WMS管理报废库,生成报废库存转移(从HOLD库先转移到线边)
var holdLocation = await LocationAclService.GetFirstByTypeAsync(EnumLocationType.HOLD).ConfigureAwait(false); //隔离库位
var transferLogs = new List();
- var transactions = new List();
- //如果WMS管理报废库,生成报废库存转移(从HOLD库先转移到线边)
- if (await SettingManager.IsTrueAsync(StoreSettings.Common.EnableScrapLocation).ConfigureAwait(false))
+ var transactions = new List();//更新库存的事务
+ var emptyTransactions = new List();//不更新库存的事务
+ foreach (var scrapNote in scrapNotes)
{
- foreach (var scrapNote in scrapNotes)
+ if (isScrapLocation && scrapNote.Worker == "MES")//管理隔离库并且是mes接口来的从隔离库直接报废(但是要先移到线边)
+ {
+ transferLogs.AddRange(BuildTransferLogs(scrapNote, holdLocation));
+ emptyTransactions.AddRange(BuildTransactions(scrapNote));
+ }
+ else
{
-
- if (await SettingManager.IsTrueAsync(StoreSettings.Common.EnableScrapLocation).ConfigureAwait(false))
- {
- transferLogs.AddRange(BuildTransferLogs(scrapNote, holdLocation));
- }
transactions.AddRange(BuildTransactions(scrapNote));
}
+
+ }
+ if (transferLogs.Count > 0)
+ {
//报废是库存世界变动是隔离库数量-1,但是增加了一个移库日志从Hold到线边,库存事务是三个,Hold库-1(移库),线边+1(移库),线边-1(报废)
- await TransferLogAppService.AddManyWithTransferAsync(transferLogs, transactions).ConfigureAwait(false);
- await TransactionAppService.AddManyEmptyAsync(transactions).ConfigureAwait(false);
+ await TransferLogAppService.AddManyWithTransferAsync(transferLogs, emptyTransactions).ConfigureAwait(false);
+ await TransactionAppService.AddManyEmptyAsync(emptyTransactions).ConfigureAwait(false);
}
- else
+ if (transactions.Count > 0)
{
- foreach (var scrapNote in scrapNotes)
- {
- transactions.AddRange(BuildTransactions(scrapNote));
- }
await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false);
}
}
@@ -72,7 +74,7 @@ public class ScrapNoteEventHandler
private List BuildTransferLogs(ScrapNote scrapNote, LocationDTO holdLocation)
{
var transferLogs = new List();
-
+
foreach (var detail in scrapNote.Details.Where(detail => detail.Qty != 0))
{
var transferLog = ObjectMapper.Map(detail);
From b53e5f7552c99becaba5daa09318d9d37bd0dfa9 Mon Sep 17 00:00:00 2001
From: liuyunfeng
Date: Thu, 11 Jul 2024 15:55:59 +0800
Subject: [PATCH 11/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=A7=E8=A1=8C?=
=?UTF-8?q?=E8=B6=85=E6=97=B6bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Commons/CommonHelper.cs | 38 ++++++
.../SplitPackings/SplitPackingRecManager.cs | 123 ++++++++++++------
2 files changed, 120 insertions(+), 41 deletions(-)
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Commons/CommonHelper.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Commons/CommonHelper.cs
index ade4d7ddb..5b709e4d7 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Commons/CommonHelper.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Commons/CommonHelper.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
@@ -36,5 +37,42 @@ public sealed class CommonHelper
return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
}
+}
+///
+/// Expression动态拼接+泛型缓存
+///
+///
+///
+public class ExpressionGenericMapper//Mapper`2
+{
+ private static Func _FUNC = null;
+ static ExpressionGenericMapper()
+ {
+ ParameterExpression parameterExpression = Expression.Parameter(typeof(TIn), "p");
+ List memberBindingList = new List();
+ foreach (var item in typeof(TOut).GetProperties())
+ {
+ MemberExpression property = Expression.Property(parameterExpression, typeof(TIn).GetProperty(item.Name));
+ MemberBinding memberBinding = Expression.Bind(item, property);
+ memberBindingList.Add(memberBinding);
+ }
+ foreach (var item in typeof(TOut).GetFields())
+ {
+ MemberExpression property = Expression.Field(parameterExpression, typeof(TIn).GetField(item.Name));
+ MemberBinding memberBinding = Expression.Bind(item, property);
+ memberBindingList.Add(memberBinding);
+ }
+ MemberInitExpression memberInitExpression = Expression.MemberInit(Expression.New(typeof(TOut)), memberBindingList.ToArray());
+ Expression> lambda = Expression.Lambda>(memberInitExpression, new ParameterExpression[]
+ {
+ parameterExpression
+ });
+ _FUNC = lambda.Compile();//拼装是一次性的
+ }
+ public static TOut Trans(TIn t)
+ {
+ return _FUNC(t);
+ }
}
+
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs
index bd72af6e8..e47c930ec 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs
@@ -25,9 +25,9 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
public async Task BatchInsertAsync(List input)
{
+ #region 校验
foreach (SplitPackingRec item in input)
{
- #region 校验
if (item.OprType == OprTypeEnum.SplitBox || item.OprType == OprTypeEnum.MergeBox) //拆箱或合箱
{
if (item.FromPackingCode == item.ToPackingCode)
@@ -42,18 +42,26 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
throw new UserFriendlyException("操作类型不是拆箱或合箱状态,源箱码和目标箱码必须相同!");
}
}
- #endregion
}
-
+ #endregion
+ //缓存数据
var query = await _repository.GetQueryableAsync().ConfigureAwait(false);
+ var fromPackCodeLst = input.Select(itm => itm.FromPackingCode).ToList();
+ var toPackCodeLst = input.Select(itm => itm.ToPackingCode).ToList();
+ var historyLst = await query.Where(itm => fromPackCodeLst.Contains(itm.ToPackingCode) && (itm.OprType == OprTypeEnum.SplitBox || itm.OprType == OprTypeEnum.MergeBox)).ToListAsync().ConfigureAwait(false); //取顶级箱码时用到
+ var hisLst2 = await query.Where(itm => fromPackCodeLst.Contains(itm.FromPackingCode)).ToListAsync().ConfigureAwait(false);
+ Dictionary hisLst3 = await query.Where(itm => toPackCodeLst.Contains(itm.FromPackingCode) && itm.OprType == OprTypeEnum.Other).ToDictionaryAsync(itm => itm.FromPackingCode, it2 => it2).ConfigureAwait(false);
+
+ //遍历、批量插入
+ List operLst = new List();
foreach (SplitPackingRec item in input)
{
if (item.OprType == OprTypeEnum.SplitBox || item.OprType == OprTypeEnum.MergeBox)
{
//设置顶级箱码
- item.FromTopPackingCode = CalcuTopPackingCode(query, item.FromPackingCode);
- item.ToTopPackingCode = CalcuTopPackingCode(query, item.FromPackingCode); //ToPackingCode
+ item.FromTopPackingCode = CalcuTopPackingCode(input, historyLst, item);
+ item.ToTopPackingCode = CalcuTopPackingCode(input, historyLst, item);
if (item.FromTopPackingCode.IsNullOrEmpty())
{
item.FromTopPackingCode = item.FromPackingCode;
@@ -63,14 +71,12 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
item.ToTopPackingCode = item.FromTopPackingCode;
}
//设置六个单据号
- SetBillNumber(query, item);
+ SetBillNumber(hisLst2, item);
//拆箱时,如果目标箱不存在,插入目标箱(两个箱码相同)
- string toPackCode = item.ToPackingCode;
- var toHis = await query.Where(itm => itm.FromPackingCode == toPackCode && itm.ToPackingCode == toPackCode).OrderBy(itm => itm.CreationTime).FirstOrDefaultAsync().ConfigureAwait(false);
- if (toHis == null)
+ if (hisLst3.ContainsKey(item.ToPackingCode) == false)
{
-
- SplitPackingRec newObj = CommonHelper.CloneObj(item);
+ //SplitPackingRec newObj = CommonHelper.CloneObj(item);
+ SplitPackingRec newObj = ExpressionGenericMapper.Trans(item);
newObj.SetId(GuidGenerator.Create());
newObj.OprType = OprTypeEnum.Other;
newObj.FromPackingCode = newObj.ToPackingCode; //克隆赋值
@@ -79,11 +85,20 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
newObj.FromUom = newObj.ToUom;
newObj.FromQty = newObj.ToQty;
newObj.FromLot = newObj.ToLot;
- var res = await _repository.InsertAsync(newObj, false).ConfigureAwait(false);
+ //var res = await _repository.InsertAsync(newObj, false).ConfigureAwait(false);
+ operLst.Add(newObj);
}
- SplitPackingRec newEntity = CommonHelper.CloneObj(item);
+ //var toHis = await query.Where(itm => itm.FromPackingCode == toPackCode && itm.ToPackingCode == toPackCode).OrderBy(itm => itm.CreationTime).FirstOrDefaultAsync().ConfigureAwait(false);
+ //if (toHis == null)
+ //{
+ //}
+ //SplitPackingRec newEntity = CommonHelper.CloneObj(item);
+ SplitPackingRec newEntity = ExpressionGenericMapper.Trans(item);
+
newEntity.SetId(GuidGenerator.Create());
- var ret = await _repository.InsertAsync(newEntity, false).ConfigureAwait(false);
+ // var ret = await _repository.InsertAsync(newEntity, false).ConfigureAwait(false);
+ operLst.Add(newEntity);
+
}
else
{
@@ -95,11 +110,14 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
{
item.ToTopPackingCode = item.FromPackingCode;// ToPackingCode;
}
- SplitPackingRec newEntity = CommonHelper.CloneObj(item);
+ //SplitPackingRec newEntity = CommonHelper.CloneObj(item);
+ SplitPackingRec newEntity = ExpressionGenericMapper.Trans(item);
newEntity.SetId(GuidGenerator.Create());
- var ret = await _repository.InsertAsync(newEntity, false).ConfigureAwait(false);
+ //var ret = await _repository.InsertAsync(newEntity, false).ConfigureAwait(false);
+ operLst.Add(newEntity);
}
} //foreach
+ await _repository.InsertManyAsync(operLst).ConfigureAwait(false);
return true;
}
@@ -203,48 +221,71 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
}
///
- /// 取顶级箱码
+ /// 取顶级箱码:
///
- /// 箱码历史
- /// 箱码,from to时都传入from
+ /// 本次操作要插入的拆箱记录列表,位于内存中
+ /// 数据库中的历史数据:拆箱或合箱、to箱码=内存中的from箱码
+ /// 内存中当前记录
///
- private static string CalcuTopPackingCode(IQueryable historyQuery, string packingCode)
+ private static string CalcuTopPackingCode(List memoryInput, List historyLst, SplitPackingRec curRecord)
{
- var qry = historyQuery.Where(itm => itm.OprType == OprTypeEnum.SplitBox || itm.OprType == OprTypeEnum.MergeBox);
- string ret = null;
- SplitPackingRec? firstObj = null;
- string toCode = packingCode;
+ //根据当前记录在内存列表中递归取得最上级拆箱记录:1-2 2-3 3-4 根据3-4能取到1-2
+ SplitPackingRec priorMemoryRecord = curRecord;
while (1 == 1)
{
- firstObj = qry.FirstOrDefault(itm => itm.ToPackingCode == toCode);
- if (firstObj == null)
+ var obj = memoryInput.FirstOrDefault(itm => itm.ToPackingCode == priorMemoryRecord.FromPackingCode);
+ if (obj != null)
{
- ret = toCode;
- break;
+ priorMemoryRecord = obj;
}
else
{
- toCode = firstObj.FromPackingCode;
+ break;
}
}
- return ret;
- //var historyRec = historyQuery.Where(itm => itm.FromPackingCode == packingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault();
- //if (historyRec != null)
- //{
- // return historyRec.FromTopPackingCode;
- //}
- //else
+ /*
+ 算法:根据当前记录的from箱码在数据库中取上级拆箱记录,并返回顶级箱码
+ 前提:只查找拆箱、合箱记录
+ 1-1
+ 2-2
+ 1-2 查询to箱码=1的(没有,顶级箱码=from箱码)
+ 3-3
+ 2-3 查询 to箱码=2的(找到1-2记录,取顶级箱码字段)
+ 4-4
+ 3-4 查询to箱码=3的(找到2-3记录,取顶级箱码字段)
+ 5-5
+ 3-5 查询to箱码=3的(找到2-3记录,取顶级箱码字段)
+ */
+ var hisObj = historyLst.FirstOrDefault(itm => itm.ToPackingCode == priorMemoryRecord.FromPackingCode);
+ if (hisObj != null)
+ {
+ return hisObj.FromTopPackingCode;
+ }
+ else
+ {
+ return priorMemoryRecord.FromPackingCode;
+ }
+ //var qry = historyLst.Where(itm => itm.OprType == OprTypeEnum.SplitBox || itm.OprType == OprTypeEnum.MergeBox);
+ //string ret = null;
+ //SplitPackingRec? firstObj = null;
+ //string toCode = priorRecord.FromPackingCode;
+ //while (1 == 1)
//{
- // historyRec = historyQuery.Where(itm => itm.ToPackingCode == packingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault();
- // if (historyRec != null)
+ // firstObj = qry.FirstOrDefault(itm => itm.ToPackingCode == toCode);
+ // if (firstObj == null)
+ // {
+ // ret = toCode;
+ // break;
+ // }
+ // else
// {
- // return historyRec.ToTopPackingCode;
+ // toCode = firstObj.FromPackingCode;
// }
//}
- //return null;
+ //return ret;
}
- private static void SetBillNumber(IQueryable historyQuery, SplitPackingRec obj)
+ private static void SetBillNumber(List historyQuery, SplitPackingRec obj)
{
var historyRec = historyQuery.Where(itm => itm.FromPackingCode == obj.FromPackingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault();
if (historyRec != null)
From f3c1252fc2ad6d574d7e25be973ad824166b50df Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Fri, 12 Jul 2024 17:31:24 +0800
Subject: [PATCH 12/17] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?=
=?UTF-8?q?=E4=B8=AD=E5=87=BA=E7=8E=B0=E7=9A=84bug20240712?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Jobs/IssueJobs/SparePartIssueJobsController.cs | 8 ++++----
.../ProductionLineItems/ProductionLineItemAppService.cs | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/SparePartIssueJobsController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/SparePartIssueJobsController.cs
index 66cbe7fae..23e5fe456 100644
--- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/SparePartIssueJobsController.cs
+++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/SparePartIssueJobsController.cs
@@ -52,10 +52,10 @@ public class SparePartIssueJobsController : AbpController
{
status.Add((int)EnumJobStatus.Open);
}
- else if (jobStatus == "Wait")
- {
- status.Add((int)EnumJobStatus.Wait);
- }
+ //else if (jobStatus == "Wait")
+ //{
+ // status.Add((int)EnumJobStatus.Wait);
+ //}
else
{
status.Add((int)EnumJobStatus.Done);
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs
index ea7be1738..500bc1ec7 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs
@@ -126,9 +126,9 @@ public class ProductionLineItemAppService :
public virtual async Task GetByProductLineCodeAndItemCodeAsync(string productLineCode,
string itemCode)
{
- var entityList = await _repository
- .FindAsync(p => p.ProdLineCode == productLineCode && p.ItemCode == itemCode).ConfigureAwait(false);
- return ObjectMapper.Map(entityList);
+ var entity = await _repository
+ .FirstOrDefaultAsync(p => p.ProdLineCode == productLineCode && p.ItemCode == itemCode).ConfigureAwait(false);
+ return ObjectMapper.Map(entity);
}
[HttpPost("get-by-productlinecode-and-itemcode-and-erplocationcode-async")]
public virtual async Task> GetByProductLineCodeAndItemCodeAndErpLocationCodeAsync(List locationType, string erpLocationCodes,string itemCode)
From ecc52926532bdaa774bee88cfc9bf662acda4923 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com>
Date: Fri, 12 Jul 2024 21:50:05 +0800
Subject: [PATCH 13/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.vs/WZC2/v17/.wsuo | Bin 238080 -> 229888 bytes
.../Client/WebApi.cs | 54 +++++++++++++++---
.../Incoming/InjectionMoldingRequestReader.cs | 12 +++-
...tionMoldingTaskIncomingBackgroundWorker.cs | 36 ++++++------
.../appsettings.json | 2 +-
.../tests/Class1.cs | 20 +++++++
.../test/TestAppService.cs | 18 ++++--
7 files changed, 109 insertions(+), 33 deletions(-)
diff --git a/.vs/WZC2/v17/.wsuo b/.vs/WZC2/v17/.wsuo
index 78d4fb1e68f43b4628ac4cd45651943fc90d5a62..5a177d4c348e16688dba793929c7961619cbd9bf 100644
GIT binary patch
delta 2535
zcmbu=OHfl+7zglsZb*o569NPRAxMHiqb7I>At6yT8dT8o(g3~?lL$VF6)~|IABnY7
zyXrtr+pM~2XIR*cn06eeU34moE;`nQi%!Q)J9g@_<3OucrT;GyM6J_ldzc^hyzV()
z?&G_OX>H;i?f4p&GtpvDRtkc!lpj+YrbZtz?WlM6x~;c9eFywuU>8OVi^i%&HRz->rnT>df32w@(h?M
z@q>9^@jI(bNh!iSJSxRi4>5f6B7Z2gYZ%2yH;$s=69qMFBadq0tTjDbk}oFz!+vV)
z_jP7Jy`Ntf8+b(DEzwO}_G}j`zpsC!+Jp|Zz#kf7Y%`CR#p$Ujt6*HGZRFRBI@06X
z%dCXr%9ams!iVrAZE<|YlGUx!;s=YO=aK3FZ!_BXOm(+p#?*44(=&s4}
zUevpVG2y77q)8~!?TQOuobcV{z8+b(f9S+u>&`*HKiio=Cv8Hn#2n(u%+v*Bo$dIw
zPp`!e$FirVy91Zm%e}h5Z)_@PWoc{E58_mCoE2uSLS{Ak$#ZiJPp?Q0yGxbluFC^V
zqpSL=>+*?LjMEY#e!2pbKy4L{xuAw6kO%o7fd;ft06HjyA}9tult3vMpbW~v2o+$0
zN>~b2U}i#Gu%J>6%b*5op$=XHD=dc!o-~u-^g9p5@8rDDy
ztc7*pV{s$}R5pMgT45t>g3Ztd?XU&5!t2lhozMl{&;#3GI|QH?`k)_nz)si&yI~Iu
zz+M=HeR2E?LI}dJABJEU4!}V;1c%`b7=a`3CLD!PI0j>I93l{f6Yv(Cgi{cM({KjP
z!a1P56$vJ!=JLhIsTz%V8!uL}D8g3rXweON&sj5%7RMzwo}tV;fn(AeVSXO?-mBon&@_OakHM^>#w6#k^>|Bn|^FQ(5DOwBf=Q}xUV+3SB@V-
zzT1QKWS~`j*p6;TjqGR`ZgPY@cDK{vu{)hZ9(%LL6}E>$Znqo?h8-byFq2s+4QI+B
zAM%W_!M;7^=xDY#$YGZ=7m=OKL{8IA;WGMRu(iZgygmJk5YrM<*QwUFWqdKmHnFv(j1=@jZ=}M3KIn^nNJD?5V*mzX5Hc_rnHYjB48<^9g{zT`
zYmj3yxlOrruElVSKpw8cNL-H_FbX%~CXB|-7=v3d7WpW^I22+$CSW2a;Z{t>6ck}9
zreV7Jn#FWxU?yh42^VH#4(4JWN-!S_un?tiqYNs~rrj~Wljp#WB46b}<=UTHoqjM>
zPSm+T`mJ;A&u>)AH7cK>^ewH%D(0^TtE{m^%DaMkUg+7R0RM3|<;loF;p&(5TgI<`
zFJx%gp7P>GkM0yj(xtltdk_r0N1o7!+Dwu3)dJ_f({gwFII%*yY;Ix5qqY&&%UhlB
zIwKmyAI_id6w{Sjs#t8
z1Y1>=(mVwjy1x+BXQ-!>&VoE^Cr+LTG!^97L>v)+?f!b%xExulB?hSbb?@;@+gLnN
z8G1KHs+`Z2O8@s`@_@Xo||!)n<4}>tK48Mb7PbSIhInv@_VuqwV@`x}#W
z=<8m}hm^wu34gwq(>JgJD{&w0#{+l}tFRht@DM8SFxKJ`RN_&r!+LDMV|W}-;7L5C
zwveakY(y2jcm~hnIr#8AUcigkgqN@xTktZfQG>0hMIBzjtJsEmY{zSO9SwK`JFru2
zVY}$;#+!Hxd+;{i!MkY0d)SNj@c}->K753au^$KU2@c^P+Tk;N0hQY?Ievw&@eRJk
zVSgci$KVLQM-xnfwB#pLCDaMM1H&%x7lS6IE)vByMZkfwRk
ze(qMyR5jR&TGZhcyozn8$99}5&ws!22cgUAI|AjF>Cr}BBY#46P0R4@uxLF3o!j`3L*njOM$
zdWF+?ae;Z5apZ0>*?2lcvo2p?&h+J#a8|67HK%78QS@cSkCTnz^UQg4Cdsnhy0L05
sH(A0&gRyI*`ATE)B6F6{?lzAVvgwf1s46v=%DT)nc{n?-nO)O=0U#5lga7~l
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
index a4498b3d5..071d4433e 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
@@ -1,5 +1,3 @@
-
-
//----------------------
//
// Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
@@ -72,7 +70,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
///
/// Success
/// A server side error occurred.
- public virtual System.Threading.Tasks.Task GetMacStaticAsync()
+ public virtual System.Threading.Tasks.Task GetMacStaticAsync()
{
return GetMacStaticAsync(System.Threading.CancellationToken.None);
}
@@ -83,7 +81,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
///
/// Success
/// A server side error occurred.
- public virtual async System.Threading.Tasks.Task GetMacStaticAsync(System.Threading.CancellationToken cancellationToken)
+ public virtual async System.Threading.Tasks.Task GetMacStaticAsync(System.Threading.CancellationToken cancellationToken)
{
var client_ = _httpClient;
var disposeClient_ = false;
@@ -125,7 +123,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
- var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ var objectResponse_ = await ReadObjectResponseAsync