Browse Source

临时数据

集成Redis
唐明亮 2 years ago
parent
commit
64cffe42b0
  1. 44
      README.md
  2. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs
  3. 28
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
  4. 20
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs
  5. 49
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs
  6. 14
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json
  7. 4
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluReader.cs
  8. 15
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/appsettings.json
  9. 27
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs
  10. 4
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs
  11. 29
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs
  12. 50
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs
  13. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs
  14. 9
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs
  15. 11
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductReceiptNoteConverter.cs
  16. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductRecycleNoteConverter.cs
  17. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs
  18. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseOrderConverter.cs
  19. 10
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseReturnConverter.cs
  20. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.cs
  21. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs
  22. 10
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs
  23. 32
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs
  24. 24
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TransferNoteConverter.cs
  25. 27
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
  26. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs
  27. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs
  28. 112
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WIPAdjusNoteConverter.cs
  29. 11
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs
  30. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs
  31. 18
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json
  32. 1
      be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Mes/Mes/MesProductL7PartsNoteAutoMapperProfile.cs
  33. 2
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
  34. 1
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs
  35. 34
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
  36. 14
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json
  37. 12
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/CountAdjustNote/CountAdjustNoteDetailExchangeDto.cs
  38. 50
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteDetailExchangeDto.cs
  39. 2
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteExchangeDto.cs
  40. 50
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml
  41. 1
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application/OutgoingFromWms/OutgoingFromWmsAutoMapperProfile.cs
  42. 7
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs
  43. 1
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAutoMapperProfile.cs
  44. 48
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/TokenService.cs
  45. 58
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/appsettings.json
  46. 13
      be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/BasedataHttpApiHostModule.cs
  47. 58
      be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/appsettings.json
  48. 4
      be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Win_in.Sfs.Wms.Dashboard.Host.csproj
  49. 58
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/appsettings.json
  50. 37
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql
  51. 11
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/BaseDatas/DictController.cs
  52. 22
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs
  53. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAutoMapperProfile.cs
  54. 1
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs
  55. 3
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Containers/ContainerAutoMapperProfile.cs
  56. 19
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs
  57. 15
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/TransactionManager.cs
  58. 1
      be/Modules/Label/src/Win_in.Sfs.Label.Application/CountLabels/CountLabelAutoMapperProfile.cs
  59. 1
      be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletCode/PalletCodeAutoMapperProfile.cs
  60. 1
      be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletLabels/PalletLabelAutoMapperProfile.cs
  61. 1
      be/Modules/Label/src/Win_in.Sfs.Label.Application/SaleLabels/SaleLabelAutoMapperProfile.cs
  62. 1
      be/Modules/Label/src/Win_in.Sfs.Label.Application/SerialCode/SerialCodeAutoMapperProfile.cs
  63. 1
      be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs
  64. 1
      be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs
  65. 1
      be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs
  66. 1
      be/Modules/Message/src/Win_in.Sfs.Message.Application/PrivateMessages/PrivateMessageAutoMapperProfile.cs
  67. 1
      be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs
  68. 5
      be/Modules/Shared/src/Win_in.Sfs.Shared.Application/CachingExtensions.cs
  69. 8
      be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs
  70. 9
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs
  71. 3
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Entities/SfsMasterAggregateRootBase.cs
  72. 44
      be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs
  73. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/IIssueJobAppService.cs
  74. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/DTOs/UnplannedIssueJobDetailDTO.cs
  75. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/Inputs/UnplannedIssueJobDetailInput.cs
  76. 32
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDetailDTO.cs
  77. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/Inputs/UnplannedReceiptJobDetailInput.cs
  78. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/DTOs/UnplannedIssueNoteDetailDTO.cs
  79. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/Inputs/UnplannedIssueNoteDetailInput.cs
  80. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/DTOs/UnplannedReceiptNoteDetailDTO.cs
  81. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/Inputs/UnplannedReceiptNoteDetailInput.cs
  82. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs
  83. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs
  84. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/DTOs/UnplannedIssueRequestDetailDTO.cs
  85. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/Inputs/UnplannedIssueRequestDetailInput.cs
  86. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/DTOs/UnplannedReceiptRequestDetailDTO.cs
  87. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/Inputs/UnplannedReceiptRequestDetailInput.cs
  88. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobAppServiceBase.cs
  89. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/StoreApplicationAutoMapperProfile.cs
  90. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CheckJobs/CheckJobAutoMapperProfile.cs
  91. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAutoMapperProfile.cs
  92. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs
  93. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAutoMapperProfile.cs
  94. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs
  95. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAutoMapperProfile.cs
  96. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/JisDeliverJobs/JisDeliverJobAutoMapperProfile.cs
  97. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductReceiveJobs/ProductReceiveJobAutoMapperProfile.cs
  98. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs
  99. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAutoMapperProfile.cs
  100. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReturnJobs/PurchaseReturnJobAutoMapperProfile.cs

44
README.md

@ -1,42 +1,23 @@
# 开发和部署方式 # 开发和部署方式
## windows x64 下本地开发 ## 开发环境配置
当前项目基于 .net 6 sdk,安装 visual studio 2022 时通常会自带 ### 软件安装
### supervisor 方式开发 1. visual studio 2022(.net 6 sdk)
1. Docker Desktop(wsl2)
1. 根据项目需求,安装 SQL Server 或 MySQL ### 配置文件
2. 使用 build/src/win-x64/publish/ 目录下的 dev.start.cmd 和 dev.stop.cmd 管理非数据库依赖
配置文件 配置文件存储在build\src\docker\publish\conf 目录下,settings 目录存放程序配置文件,其他目录存放依赖配置文件
1. supervisor: `build\src\win-x64\publish\supervisord\supervisor.dev.conf` ### 依赖管理
1. nginx: `build\src\win-x64\publish\nginx\conf\nginx.conf`
1. gateway: `build\src\win-x64\publish\gateway\appsettings.json`
1. config: `build\src\win-x64\publish\gateway\wwwroot\settings\appsettings.json`
1. config: `build\src\win-x64\publish\gateway\wwwroot\settings\appsettings.Development.json`
```mermaid 使用 build/src/docker/publish/ 目录下的 dev.start.cmd 和 dev.stop.cmd 管理依赖的停止启动,可以在Docker Desktop中查看和管理启动的服务
flowchart LR
nginx --localhost:21093--> gateway--localhost:59092--> api:59092
api:59092 --localhost:6379--> redis:6379
api:59092 --localhost:13319--> database:13319
gateway --localhost:8086--> influxdb:8086
```
### Docker Desktop 方式开发
1. 无需按照数据库
2. 使用 build/src/docker/publish/ 目录下的 dev.start.cmd 和 dev.stop.cmd 管理依赖
## 部署 ## 部署
### windows x64 supervisor 方式部署 Docker 和 Windows 部署两种方式只需要按需修改配置文件中的主机名和端口,windows单机部署时使用localhost作为主机名,docker compose单机部署时使用service name 作为主机名
1. 执行: `build\src\win-x64\build.cmd`
2. 上传: `build\dist\win-x64\publish` 目录到服务器
3. 修改配置,执行 publish 目录下的 start.cmd
### docker compose 方式部署 ### docker compose 方式部署
@ -44,7 +25,8 @@ gateway --localhost:8086--> influxdb:8086
2. 上传: `build\dist\win-x64\publish` 目录到服务器 2. 上传: `build\dist\win-x64\publish` 目录到服务器
3. 修改配置,执行 publish 目录下的 start.sh 或 start.cmd 3. 修改配置,执行 publish 目录下的 start.sh 或 start.cmd
构建时的处理: ### windows x64 方式部署
1. 复制并重命名 build\src\win-x64\publish\nginx\conf 到 build\dist\docker\publish\conf\nginx,保持nginx的配置文件统一在 build\src\win-x64\publish\nginx\conf 目录维护 1. 执行: `build\src\win-x64\build.cmd`
1. 复制 build\src\win-x64\publish\gateway 到 build\dist\docker\publish\gateway,保持网关的配置和应用的配置统一在 build\src\win-x64\publish\gateway 目录维护 2. 上传: `build\dist\win-x64\publish` 目录到服务器
3. 修改配置,执行 publish 目录下的 start.cmd

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs

@ -166,7 +166,7 @@ public class EosAgentModule : AbpModule
{ {
context.AddBackgroundWorkerAsync<EosIncomingBackgroundWorker>(); context.AddBackgroundWorkerAsync<EosIncomingBackgroundWorker>();
// context.AddBackgroundWorkerAsync<EosOutgoingBackgroundWorker>(); context.AddBackgroundWorkerAsync<EosOutgoingBackgroundWorker>();
} }
} }

28
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs

@ -43,21 +43,21 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
//转换Plan //转换Plan
await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false); await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false);
// Logger.LogInformation($"Read Ship"); Logger.LogInformation($"Read Ship");
// var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>(); var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>();
// var shipConverter = workerContext.ServiceProvider.GetRequiredService<ShipConverter>(); var shipConverter = workerContext.ServiceProvider.GetRequiredService<ShipConverter>();
// //读取并保持Ship //读取并保持Ship
// var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false); var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false);
// //转换Ship //转换Ship
// await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false);
// Logger.LogInformation($"Read Product"); Logger.LogInformation($"Read Product");
// var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>(); var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>();
// var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>(); var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>();
// //读取并保持Product //读取并保持Product
// var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false);
//// 转换Product // 转换Product
// await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Completed: Handling {Incoming}"); Logger.LogInformation($"Completed: Handling {Incoming}");
} }

20
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs

@ -55,13 +55,13 @@ public class ShipConverter : IIncomingConverter
var supplierAsnList = await BuildIncomingToWmsOfSupplierAsnAsync(incomingFromExternalList).ConfigureAwait(false); var supplierAsnList = await BuildIncomingToWmsOfSupplierAsnAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(supplierAsnList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(supplierAsnList).ConfigureAwait(false);
var purchaseLabelList = BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList); var purchaseLabelList = await BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(purchaseLabelList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(purchaseLabelList).ConfigureAwait(false);
//归档 //归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private List<IncomingToWms> BuildIncomingToWmsOfPurchaseLabelAsync(List<IncomingFromExternal> incomingFromExternalList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseLabelAsync(List<IncomingFromExternal> incomingFromExternalList)
{ {
var incomingToWmsList = new List<IncomingToWms>(); var incomingToWmsList = new List<IncomingToWms>();
@ -76,7 +76,7 @@ public class ShipConverter : IIncomingConverter
}; };
incomingToWms.SetEffectiveDate(incomingFromExternal.EffectiveDate); incomingToWms.SetEffectiveDate(incomingFromExternal.EffectiveDate);
var exchangeAsn = JsonSerializer.Deserialize<SupplierAsnExchangeDto>(incomingFromExternal.DestinationDataContent); var exchangeAsn = JsonSerializer.Deserialize<SupplierAsnExchangeDto>(incomingFromExternal.DestinationDataContent);
var purchaseLabel = BuildPurchaseLabelCreateDto(exchangeAsn); var purchaseLabel = await BuildPurchaseLabelCreateDto(exchangeAsn).ConfigureAwait(false);
incomingToWms.DataContent = JsonSerializer.Serialize(purchaseLabel); incomingToWms.DataContent = JsonSerializer.Serialize(purchaseLabel);
incomingToWmsList.Add(incomingToWms); incomingToWmsList.Add(incomingToWms);
@ -85,11 +85,23 @@ public class ShipConverter : IIncomingConverter
return incomingToWmsList; return incomingToWmsList;
} }
private InventoryLabelEditInput BuildPurchaseLabelCreateDto(SupplierAsnExchangeDto exchangeAsn) private async Task<InventoryLabelEditInput> BuildPurchaseLabelCreateDto(SupplierAsnExchangeDto exchangeAsn)
{ {
var purchaseLabel = _objectMapper.Map<SupplierAsnDetailExchangeDto, InventoryLabelEditInput>(exchangeAsn.Detail); var purchaseLabel = _objectMapper.Map<SupplierAsnDetailExchangeDto, InventoryLabelEditInput>(exchangeAsn.Detail);
purchaseLabel.AsnNumber = exchangeAsn.Number; purchaseLabel.AsnNumber = exchangeAsn.Number;
purchaseLabel.RpNumber = ""; purchaseLabel.RpNumber = "";
var item = await _itemBasicAppService.GetByCodeAsync(purchaseLabel.ItemCode).ConfigureAwait(false);
if (item != null)
{
purchaseLabel.ItemName = item.Name;
purchaseLabel.ItemDesc1 = item.Desc1;
}
else
{
purchaseLabel.ItemName = "";
purchaseLabel.ItemDesc1 = "";
}
return purchaseLabel; return purchaseLabel;
} }

49
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs

@ -6,7 +6,7 @@ using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReceipt; using Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
@ -18,6 +18,7 @@ public class ArriveConverter : IOutgoingConverter
private readonly ISupplierAsnAppService _supplierAsnAppService; private readonly ISupplierAsnAppService _supplierAsnAppService;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
public ArriveConverter( public ArriveConverter(
IOutgoingFromWmsManager outgoingFromWmsManager IOutgoingFromWmsManager outgoingFromWmsManager
, IOutgoingToExternalManager outgoingToExternalManager , IOutgoingToExternalManager outgoingToExternalManager
@ -35,11 +36,11 @@ public class ArriveConverter : IOutgoingConverter
{ {
var outgoingToExternalList = new List<OutgoingToExternal>(); var outgoingToExternalList = new List<OutgoingToExternal>();
var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReceipt, EnumSystemType.EOS).ConfigureAwait(false); var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.Putaway, EnumSystemType.EOS).ConfigureAwait(false);
foreach (var outgoingFromWms in outgoingFromWmsList) foreach (var outgoingFromWms in outgoingFromWmsList)
{ {
var wmsReceipt = JsonSerializer.Deserialize<PurchaseReceiptNoteDTO>(outgoingFromWms.DataContent); var wmsReceipt = JsonSerializer.Deserialize<PutawayNoteDTO>(outgoingFromWms.DataContent);
foreach (var detail in wmsReceipt.Details) foreach (var detail in wmsReceipt.Details)
{ {
var outgoingToExternal = new OutgoingToExternal() var outgoingToExternal = new OutgoingToExternal()
@ -49,14 +50,14 @@ public class ArriveConverter : IOutgoingConverter
SourceSystem = EnumSystemType.WMS.ToString(), SourceSystem = EnumSystemType.WMS.ToString(),
SourceDataId = detail.Id.ToString(), SourceDataId = detail.Id.ToString(),
SourceDataGroupCode = wmsReceipt.Number, SourceDataGroupCode = wmsReceipt.Number,
SourceDataDetailCode = detail.PackingCode, SourceDataDetailCode = detail.ToPackingCode,
Writer = nameof(EosOutgoingBackgroundWorker), Writer = nameof(EosOutgoingBackgroundWorker),
DestinationSystem = EnumSystemType.SCP.ToString(), DestinationSystem = EnumSystemType.EOS.ToString(),
DestinationDataId = "", DestinationDataId = "",
}; };
outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
var exchangeReceipt = await BuildPurchaseReceiptExchangeDtoAsync(wmsReceipt, detail).ConfigureAwait(false); var exchangeReceipt = await BuildPutawayExchangeDtoAsync(wmsReceipt, detail).ConfigureAwait(false);
outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt); outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt);
var arrive = BuildArrive(exchangeReceipt); var arrive = BuildArrive(exchangeReceipt);
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive);
@ -71,25 +72,30 @@ public class ArriveConverter : IOutgoingConverter
return outgoingToExternalList; return outgoingToExternalList;
} }
private static ArriveNote BuildArrive(PurchaseReceiptNoteExchangeDto exchangeReceipt) private ArriveNote BuildArrive(PutawayNoteExchangeDto exchangeReceipt)
{ {
var detail = exchangeReceipt.Detail; var detail = exchangeReceipt.Detail;
var nulltime = Convert.ToDateTime("0001/01/01 00:00:00");
if (detail.ShipDate == nulltime)
{
detail.ShipDate = null;
}
var arrive = new ArriveNote() var arrive = new ArriveNote()
{ {
PlanBillNo = exchangeReceipt.PoNumber, PlanBillNo = detail.PoNumber,
ShipBillNo = exchangeReceipt.AsnNumber, ShipBillNo = detail.AsnNumber,
DocNo = exchangeReceipt.Number, DocNo = exchangeReceipt.Number,
DetailMatNo = detail.PackingCode, DetailMatNo = detail.ToPackingCode,
ERP = detail.ItemCode, ERP = detail.ItemCode,
Qty = detail.Qty, Qty = detail.ShippedQty,
HgQty = detail.Qty, HgQty = detail.Qty,
ProductDate = detail.ProduceDate, ProductDate = detail.ProduceDate,
ProductBatch = detail.Lot, ProductBatch = detail.ToLot,
Loc = detail.LocationErpCode, Loc = detail.ToLocationErpCode,
ShipDate = exchangeReceipt.ShipDate, ShipDate = detail.ShipDate,
ShipBillState = 0, ShipBillState = 0,
SupplierCode = exchangeReceipt.SupplierCode, SupplierCode = detail.SupplierCode,
PlanUserCode = exchangeReceipt.ContactName, PlanUserCode = detail.PlanUserCode,//筹措员
EosState = 0, EosState = 0,
// EosDate = DateTime.MinValue, // EosDate = DateTime.MinValue,
WmsDate = DateTime.Now, WmsDate = DateTime.Now,
@ -98,14 +104,11 @@ public class ArriveConverter : IOutgoingConverter
return arrive; return arrive;
} }
private async Task<PurchaseReceiptNoteExchangeDto> BuildPurchaseReceiptExchangeDtoAsync(PurchaseReceiptNoteDTO wmsReceipt, PurchaseReceiptNoteDetailDTO wmsReceiptDetail) private Task<PutawayNoteExchangeDto> BuildPutawayExchangeDtoAsync(PutawayNoteDTO wmsReceipt, PutawayNoteDetailDTO wmsReceiptDetail)
{ {
var exchangeReceipt = _objectMapper.Map<PurchaseReceiptNoteDTO, PurchaseReceiptNoteExchangeDto>(wmsReceipt); var exchangeReceipt = _objectMapper.Map<PutawayNoteDTO, PutawayNoteExchangeDto>(wmsReceipt);
var exchangeReceiptDetail = _objectMapper.Map<PurchaseReceiptNoteDetailDTO, PurchaseReceiptNoteDetailExchangeDto>(wmsReceiptDetail); var exchangeReceiptDetail = _objectMapper.Map<PutawayNoteDetailDTO, PutawayNoteDetailExchangeDto>(wmsReceiptDetail);
var asn = await _supplierAsnAppService.GetByNumberAsync(exchangeReceipt.AsnNumber).ConfigureAwait(false);
exchangeReceipt.ShipDate = asn?.ShipDate;
exchangeReceipt.ContactName = asn == null ? "" : asn.ContactName;
exchangeReceipt.Detail = exchangeReceiptDetail; exchangeReceipt.Detail = exchangeReceiptDetail;
return exchangeReceipt; return Task.FromResult(exchangeReceipt);
} }
} }

14
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json

@ -1,12 +1,12 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", "Default": "Server=10.164.113.32,1818\\SHDB;Database=Wms_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True",
"DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", "DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True",
"EOS": "Server=61.139.155.47;Database=EOSCC;Uid=wms;Pwd=1;TrustServerCertificate=True" "EOS": "Server=61.139.155.47;Database=EOSSH;Uid=wms;Pwd=1;TrustServerCertificate=True"
}, },
"AuthServer": { "AuthServer": {
"Authority": "http://dev.ccwin-in.com:21293/", "Authority": "http://10.164.113.31:60083/",
"RequireHttpsMetadata": "false", "RequireHttpsMetadata": "false",
"SwaggerClientId": "admin", "SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*", "SwaggerClientSecret": "1q2w3E*",
@ -25,13 +25,13 @@
"RemoteServices": { "RemoteServices": {
"BaseData": { "BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:21294/" "BaseUrl": "http://10.164.113.31:60084/"
}, },
"Store": { "Store": {
"BaseUrl": "http://dev.ccwin-in.com:21295/" "BaseUrl": "http://10.164.113.31:60085/"
}, },
"Label": { "Label": {
"BaseUrl": "http://dev.ccwin-in.com:21292/" "BaseUrl": "http://10.164.113.31:60082/"
} }
}, },
"EosOptions": { "EosOptions": {

4
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluReader.cs

@ -58,7 +58,7 @@ public class BackFluReader : IReader
try try
{ {
var bm = BuildScrapNoteOrderExchangeMes(backflu); var bm = BuildScrapNoteOrderExchangeMes(backflu);
incomingData.DestinationDataContent = JsonSerializer.Serialize(backflu); incomingData.DestinationDataContent = JsonSerializer.Serialize(bm);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -94,7 +94,7 @@ public class BackFluReader : IReader
var back = new BackFlushNoteExchangeDto() var back = new BackFlushNoteExchangeDto()
{ {
ActiveDate = Convert.ToDateTime(backflu.scmout_dt_w.Substring(0, 4) + "-" + backflu.scmout_dt_w.Substring(4, 2) + "-" + backflu.scmout_dt_w.Substring(6, 2)), ActiveDate = DateTime.ParseExact(backflu.scmout_dt_w, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture),
ItemCode = backflu.scmout_part, ItemCode = backflu.scmout_part,
Number = backflu.scmout_nbr Number = backflu.scmout_nbr
}; };

15
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/appsettings.json

@ -1,12 +1,12 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,21195;Database= WMS;uid=sa;pwd=aA123456!;TrustServerCertificate=True;", "Default": "Server=10.164.113.32,1818\\SHDB;Database=Wms_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True",
"DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True;", "DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True",
"MES": "Server=10.164.1.12;Port=3306;Database=erp;Uid=wms;Pwd=123456;" "MES": "Server=10.164.113.32,1818\\SHDB;Database=MES_SH;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True"
}, },
"AuthServer": { "AuthServer": {
"Authority": "http://dev.ccwin-in.com:21293/", "Authority": "http://dev.ccwin-in.com:60083/",
"RequireHttpsMetadata": "false", "RequireHttpsMetadata": "false",
"SwaggerClientId": "admin", "SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*", "SwaggerClientSecret": "1q2w3E*",
@ -24,14 +24,15 @@
"RemoteServices": { "RemoteServices": {
"BaseData": { "BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:21294/" "BaseUrl": "http://dev.ccwin-in.com:60084/"
}, },
"Store": { "Store": {
"BaseUrl": "http://dev.ccwin-in.com:21295/" "BaseUrl": "http://dev.ccwin-in.com:60085/"
}, },
"Label": { "Label": {
"BaseUrl": "http://dev.ccwin-in.com:21292/" "BaseUrl": "http://dev.ccwin-in.com:60082/"
} }
}, },
"MesOptions": { "MesOptions": {
"IncomingOptions": { "IncomingOptions": {

27
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs

@ -14,13 +14,16 @@ using Win_in.Sfs.Wms.DataExchange.WMS.Deparment;
using Win_in.Sfs.Wms.DataExchange.WMS.Dict; using Win_in.Sfs.Wms.DataExchange.WMS.Dict;
using Win_in.Sfs.Wms.DataExchange.WMS.InterfaceCalendar; using Win_in.Sfs.Wms.DataExchange.WMS.InterfaceCalendar;
using Win_in.Sfs.Wms.DataExchange.WMS.ItemBasic; using Win_in.Sfs.Wms.DataExchange.WMS.ItemBasic;
using Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote;
using Win_in.Sfs.Wms.DataExchange.WMS.PCK; using Win_in.Sfs.Wms.DataExchange.WMS.PCK;
using Win_in.Sfs.Wms.DataExchange.WMS.ProductionReturnNote; using Win_in.Sfs.Wms.DataExchange.WMS.ProductionReturnNote;
using Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote; using Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote;
using Win_in.Sfs.Wms.DataExchange.WMS.ProductRecycleNote;
using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseOrder; using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseOrder;
using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReturn; using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReturn;
using Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote; using Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote;
using Win_in.Sfs.Wms.DataExchange.WMS.RecycledMaterialReceiptNote; using Win_in.Sfs.Wms.DataExchange.WMS.RecycledMaterialReceiptNote;
using Win_in.Sfs.Wms.DataExchange.WMS.ScrapNote;
using Win_in.Sfs.Wms.DataExchange.WMS.Supplier; using Win_in.Sfs.Wms.DataExchange.WMS.Supplier;
using Win_in.Sfs.Wms.DataExchange.WMS.TransferNote; using Win_in.Sfs.Wms.DataExchange.WMS.TransferNote;
using Win_in.Sfs.Wms.DataExchange.WMS.UnplannedIssueNote; using Win_in.Sfs.Wms.DataExchange.WMS.UnplannedIssueNote;
@ -34,6 +37,12 @@ public class FawtygAutoMapperProfile : Profile
{ {
public FawtygAutoMapperProfile() public FawtygAutoMapperProfile()
{ {
CreateMap<IncomingToWms, ArchivedIncomingToWms>();
CreateMap<IncomingFromExternal, ArchivedIncomingFromExternal>();
CreateMap<OutgoingFromWms, ArchivedOutgoingFromWms>();
CreateMap<OutgoingToExternal, ArchivedOutgoingToExternal>();
CreateMap<InterfaceCalendarExchangeDto, InterfaceCalendarEditInput>(); CreateMap<InterfaceCalendarExchangeDto, InterfaceCalendarEditInput>();
CreateMap<DictExchangeDto, DictEditInput>() CreateMap<DictExchangeDto, DictEditInput>()
.Ignore(x => x.Items); .Ignore(x => x.Items);
@ -45,6 +54,9 @@ public class FawtygAutoMapperProfile : Profile
CreateMap<BackFlushNoteDTO, BackFlushNoteExchangeDto>(); CreateMap<BackFlushNoteDTO, BackFlushNoteExchangeDto>();
CreateMap<BackFlushNoteDetailDTO, BackFlushNoteDetailExchangeDto>(); CreateMap<BackFlushNoteDetailDTO, BackFlushNoteDetailExchangeDto>();
CreateMap<BackFlushNoteExchangeDto, BackFlushNoteEditInput>();
CreateMap<BackFlushNoteDetailExchangeDto, BackFlushNoteDetailInput>();
CreateMap<RecycledMaterialReceiptNoteDTO, RecycledMaterialReceiptNoteExchangeDto>(); CreateMap<RecycledMaterialReceiptNoteDTO, RecycledMaterialReceiptNoteExchangeDto>();
CreateMap<RecycledMaterialReceiptNoteDetailDTO, RecycledMaterialReceiptNoteDetailExchangeDto>(); CreateMap<RecycledMaterialReceiptNoteDetailDTO, RecycledMaterialReceiptNoteDetailExchangeDto>();
@ -85,16 +97,25 @@ public class FawtygAutoMapperProfile : Profile
.Ignore(x => x.Detail); .Ignore(x => x.Detail);
CreateMap<PurchaseReturnNoteDetailDTO, PurchaseReturnNoteDetailExchangeDto>(); CreateMap<PurchaseReturnNoteDetailDTO, PurchaseReturnNoteDetailExchangeDto>();
CreateMap<OutgoingToExternal, ArchivedOutgoingToExternal>();
CreateMap<OutgoingFromWms, ArchivedOutgoingFromWms>();
CreateMap<CountAdjustNoteDTO, CountAdjustNoteExchangeDto>(); CreateMap<CountAdjustNoteDTO, CountAdjustNoteExchangeDto>();
CreateMap<CountAdjustNoteDetailDTO, CountAdjustNoteDetailExchangeDto>(); CreateMap<CountAdjustNoteDetailDTO, CountAdjustNoteDetailExchangeDto>();
CreateMap<ItemTransformNoteDTO, ItemTransformNoteExchangeDto>();
CreateMap<ItemTransformNoteDetailDTO, ItemTransformNoteDetailExchangeDto>();
CreateMap<ScrapNoteDTO, ScrapNoteExchangeDto>();
CreateMap<ScrapNoteDetailDTO, ScrapNoteDetailExchangeDto>();
CreateMap<BomExchangeDto, BomImportInput>(); CreateMap<BomExchangeDto, BomImportInput>();
CreateMap<BomDTO, BomExchangeDto>(); CreateMap<BomDTO, BomExchangeDto>();
CreateMap<SupplierExchangeDto, SupplierEditInput>(); CreateMap<SupplierExchangeDto, SupplierEditInput>();
CreateMap<CustomerExchangeDto, CustomerEditInput>(); CreateMap<CustomerExchangeDto, CustomerEditInput>();
CreateMap<ProductRecycleNoteDTO, ProductRecycleNoteEditInput>(); CreateMap<ProductRecycleNoteDTO, ProductRecycleNoteEditInput>();
CreateMap<ProductRecycleNoteDetailDTO, ProductRecycleNoteDetailInput>(); CreateMap<ProductRecycleNoteDetailDTO, ProductRecycleNoteDetailInput>();
CreateMap<ProductRecycleNoteDTO, ProductRecycleNoteExchangeDto>()
.Ignore(x => x.Details)
.Ignore(x => x.MaterialDetails);
CreateMap<ProductRecycleNoteDetailDTO, ProductRecycleNoteDetailExchangeDto>();
CreateMap<ProductRecycleMaterialDetailDTO, ProductRecycleMaterialDetailExchangeDto>();
CreateMap<BackFlushNoteExchangeDto, BackFlushNoteEditInput>();
CreateMap<BackFlushNoteDetailExchangeDto, BackFlushNoteDetailInput>();
} }
} }

4
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs

@ -93,8 +93,8 @@ public class BackFluReader : IReader
var back = new BackFlushNoteExchangeDto() var back = new BackFlushNoteExchangeDto()
{ {
ActiveDate = DateTime.ParseExact(backflu.scmout_dt_w, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture),
ActiveDate = Convert.ToDateTime(backflu.scmout_dt_w.Substring(0, 4) + "-" + backflu.scmout_dt_w.Substring(4, 2) + "-" + backflu.scmout_dt_w.Substring(6, 2)), // ActiveDate = Convert.ToDateTime(backflu.scmout_dt_w.Substring(0, 4) + "-" + backflu.scmout_dt_w.Substring(4, 2) + "-" + backflu.scmout_dt_w.Substring(6, 2)),
ItemCode = backflu.scmout_part, ItemCode = backflu.scmout_part,
Number = backflu.scmout_nbr Number = backflu.scmout_nbr
}; };

29
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs

@ -59,13 +59,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
common.updatedt = DateTime.Now; common.updatedt = DateTime.Now;
common.isupdate = false; common.isupdate = false;
//Logger.LogInformation($"Read ItemBasic");//零件 Logger.LogInformation($"Read ItemBasic");//零件
//var itemBasicReader = workerContext.ServiceProvider.GetRequiredService<ItemBasicReader>(); var itemBasicReader = workerContext.ServiceProvider.GetRequiredService<ItemBasicReader>();
//var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService<ItemBasicConverter>(); var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService<ItemBasicConverter>();
////读取并保存itemBasic //读取并保存itemBasic
//var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false); var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false);
////转换itemBasic //转换itemBasic
//await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read User");//用户和部门 Logger.LogInformation($"Read User");//用户和部门
var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>(); var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>();
@ -96,13 +96,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
//转换Dict //转换Dict
await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Bom"); Logger.LogInformation($"Read Bom");
//var BomReader = workerContext.ServiceProvider.GetRequiredService<BomReader>(); var BomReader = workerContext.ServiceProvider.GetRequiredService<BomReader>();
//var BomConverter = workerContext.ServiceProvider.GetRequiredService<BomConverter>(); var BomConverter = workerContext.ServiceProvider.GetRequiredService<BomConverter>();
////读取并保存Bom //读取并保存Bom
//var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false); var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false);
////转换Bom //转换Bom
//await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false); await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Supplier");//供应商 Logger.LogInformation($"Read Supplier");//供应商
var SupplierReader = workerContext.ServiceProvider.GetRequiredService<SupplierReader>(); var SupplierReader = workerContext.ServiceProvider.GetRequiredService<SupplierReader>();
@ -132,6 +132,7 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
common.isupdate = true; common.isupdate = true;
} }
} }
//已经挪至MES接口,tyrp暂不启动这个接口20230424(上海东阳改)
//Logger.LogInformation($"Read BackFlush");//耗用单 //Logger.LogInformation($"Read BackFlush");//耗用单
//var BackFlushReader = workerContext.ServiceProvider.GetRequiredService<BackFluReader>(); //var BackFlushReader = workerContext.ServiceProvider.GetRequiredService<BackFluReader>();
//var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService<BackFluConverter>(); //var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService<BackFluConverter>();

50
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs

@ -44,11 +44,15 @@ public class CountAdjustNoteConverter : IOutgoingConverter
foreach (var outgoingFromWms in outgoingFromWmsList) foreach (var outgoingFromWms in outgoingFromWmsList)
{ {
var wmsCountAdjust = JsonSerializer.Deserialize<CountAdjustNoteDTO>(outgoingFromWms.DataContent); var wmsCountAdjust = JsonSerializer.Deserialize<CountAdjustNoteDTO>(outgoingFromWms.DataContent);
var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false);
var departmentCode = department == null ? "" : department.Code; var departmentCode = department == null ? "" : department.Code;
var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.LocationErpCode }).Select(p => new CountAdjustNoteDetailExchangeDto { CountQty = p.Sum(itm => itm.CountQty), InventoryQty = p.Sum(itm => itm.InventoryQty), ItemCode = p.Key.ItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) });
var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.LocationErpCode }).Select(p => new CountAdjustNoteDetailExchangeDto { CountQty = p.Sum(itm => itm.CountQty), ItemCode = p.Key.ItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); var detal = details.ToList();
foreach (var detail in details.Where(r => r.CountQty == 0)) foreach (var detail in detal)
{
//判断盘点数与库存数是否相等
if (detail.CountQty != detail.InventoryQty)
{ {
var outgoingToExternal = new OutgoingToExternal() var outgoingToExternal = new OutgoingToExternal()
{ {
@ -57,13 +61,12 @@ public class CountAdjustNoteConverter : IOutgoingConverter
SourceSystem = EnumSystemType.WMS.ToString(), SourceSystem = EnumSystemType.WMS.ToString(),
SourceDataId = wmsCountAdjust.Number, SourceDataId = wmsCountAdjust.Number,
SourceDataGroupCode = wmsCountAdjust.Number, SourceDataGroupCode = wmsCountAdjust.Number,
SourceDataDetailCode = detail.ItemCode, SourceDataDetailCode = details.FirstOrDefault().ItemCode,
Writer = nameof(TyrpOutgoingBackgroundWorker), Writer = nameof(TyrpOutgoingBackgroundWorker),
DestinationSystem = EnumSystemType.ERP.ToString(), DestinationSystem = EnumSystemType.ERP.ToString(),
DestinationDataId = "", DestinationDataId = "",
}; };
outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail).ConfigureAwait(false); var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail).ConfigureAwait(false);
outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue);
var arrive = BuildIssue(exchangeIssue, departmentCode); var arrive = BuildIssue(exchangeIssue, departmentCode);
@ -73,51 +76,40 @@ public class CountAdjustNoteConverter : IOutgoingConverter
} }
} }
}
await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false); await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false);
//将outgoingFromWms数据归档
await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false);
return outgoingToExternalList; return outgoingToExternalList;
//插入到中间表OutgoingToExternal
} }
private static CountAdjust BuildIssue(CountAdjustNoteExchangeDto exchangeCountAdjust, string departmentCode) private CountAdjust BuildIssue(CountAdjustNoteExchangeDto exchangeCountAdjust, string departmentCode)
{ {
var detail = exchangeCountAdjust.Detail; var detail = exchangeCountAdjust.Detail;
string time = DateTime.Now.ToLongTimeString();
string time1 = DateTime.Now.ToShortDateString().Replace("/", "").Trim();
string date = time1 + "" + time;
string asdtype = "";
if (Enum.Parse<EnumTransSubType>(exchangeCountAdjust.Type) == EnumTransSubType.CountAdjust_WIP)
{
asdtype = "4041";
}
else if (Enum.Parse<EnumTransSubType>(exchangeCountAdjust.Type) == EnumTransSubType.CountAdjust_Warehouse)
{
asdtype = "4003";
}
var counta = new CountAdjust() var counta = new CountAdjust()
{ {
mesout_asd_refc = departmentCode, mesout_asd_refc = departmentCode,
mesout_asd_dt_w = date, mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
mesout_asd_type = asdtype, mesout_asd_type = "4003",
mesout_asd_part = detail.ItemCode, mesout_asd_part = detail.ItemCode,
mesout_asd_date = exchangeCountAdjust.ActiveDate.ToShortDateString().Replace("/", "").Trim(), mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"),
mesout_asd_loc = detail.LocationErpCode, mesout_asd_loc = string.Empty,
mesout_asd_code = detail.ReasonCode, mesout_asd_code = detail.ReasonCode,
mesout_asd_qty = detail.CountQty, mesout_asd_qty = detail.CountQty + detail.InventoryQty,
mesout_asd_user = exchangeCountAdjust.Worker, mesout_asd_user = exchangeCountAdjust.Worker,
mesout_asd_k = string.Empty, mesout_asd_k = string.Empty,
mesout_asd_stat = "Y" mesout_asd_stat = "Y"
}; };
return counta; return counta;
} }
private async Task<CountAdjustNoteExchangeDto> BuildPurchaseReceiptExchangeDtoAsync( private async Task<CountAdjustNoteExchangeDto> BuildPurchaseReceiptExchangeDtoAsync(
CountAdjustNoteDTO wmsCountAdjust, CountAdjustNoteDetailExchangeDto wmsCountAdjustDetail) CountAdjustNoteDTO wmsCountAdjust, CountAdjustNoteDetailExchangeDto wmsCountAdjustDetail)
{ {
await Task.CompletedTask.ConfigureAwait(false);
var exchangeCountAdjust = _objectMapper.Map<CountAdjustNoteDTO, CountAdjustNoteExchangeDto>(wmsCountAdjust); var exchangeCountAdjust = _objectMapper.Map<CountAdjustNoteDTO, CountAdjustNoteExchangeDto>(wmsCountAdjust);
//var exchangeCountAdjustDetail =
// _objectMapper.Map<CountAdjustNoteDetailDTO, CountAdjustNoteDetailExchangeDto>(wmsCountAdjustDetail);
//var userdep = await _supplierAsnAppService.GetByNumberAsync(exchangeCountAdjust.Worker);
//exchangeCountAdjust.DepartmentCode = userdep.DepartmentCode;
exchangeCountAdjust.Detail = wmsCountAdjustDetail; exchangeCountAdjust.Detail = wmsCountAdjustDetail;
return exchangeCountAdjust; return exchangeCountAdjust;
} }

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs

@ -78,7 +78,7 @@ public class IssueNoteConverter : IOutgoingConverter
outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
var exchangeReceiptDetail = _objectMapper.Map<IssueNoteDetailDTO, IssueNoteDetailExchangeDto>(detail); var exchangeReceiptDetail = _objectMapper.Map<IssueNoteDetailDTO, IssueNoteDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, putawayNote.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail);
outgoingToExternalList.Add(outgoingDetailToExternal); outgoingToExternalList.Add(outgoingDetailToExternal);
} }
@ -115,12 +115,12 @@ public class IssueNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private Scmsend BuildDataInterfaceDetail(IssueNoteExchangeDto exchangeOrder, IssueNoteDetailExchangeDto exchangeDetailOrder) private Scmsend BuildDataInterfaceDetail(IssueNoteExchangeDto exchangeOrder, IssueNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{ {
var ret = new Scmsend() var ret = new Scmsend()
{ {
scmsend_type = billtype, scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number, scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "1", scmsend_stat1 = "1",
scmsend_part = exchangeDetailOrder.ItemCode, scmsend_part = exchangeDetailOrder.ItemCode,
@ -130,7 +130,7 @@ public class IssueNoteConverter : IOutgoingConverter
scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty, scmsend_qty = exchangeDetailOrder.Qty,
scmsend_wipd_loc = exchangeDetailOrder.ToLocationErpCode, scmsend_wipd_loc = exchangeDetailOrder.ToLocationErpCode,
scmsend_userid = exchangeOrder.Worker scmsend_userid = string.IsNullOrEmpty(exchangeOrder.Worker) ? "" : exchangeOrder.Worker.Length>6?(exchangeOrder.Worker).Substring(0, 6): exchangeOrder.Worker
}; };
return ret; return ret;
} }

9
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs

@ -46,7 +46,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing;
var wmsCountAdjust = JsonSerializer.Deserialize<ItemTransformNoteDTO>(outgoingFromWms.DataContent); var wmsCountAdjust = JsonSerializer.Deserialize<ItemTransformNoteDTO>(outgoingFromWms.DataContent);
if (Enum.Parse<EnumTransSubType>(wmsCountAdjust.Type) == EnumTransSubType.Item_Transform) if (Enum.Parse<EnumTransSubType>(wmsCountAdjust.Type) == EnumTransSubType.Item_Transform)
{ {
var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); var department =await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false);
var departmentCode = department == null ? "" : department.Code; var departmentCode = department == null ? "" : department.Code;
var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.ToItemCode, r.LocationErpCode, r.ToLocationCode }).Select(p => new ItemTransformNoteDetailExchangeDto { ToQty = p.Sum(itm => itm.ToQty), FromQty = p.Sum(itm => itm.FromQty), ItemCode = p.Key.ItemCode, ToItemCode = p.Key.ToItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.ToItemCode, r.LocationErpCode, r.ToLocationCode }).Select(p => new ItemTransformNoteDetailExchangeDto { ToQty = p.Sum(itm => itm.ToQty), FromQty = p.Sum(itm => itm.FromQty), ItemCode = p.Key.ItemCode, ToItemCode = p.Key.ToItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) });
foreach (var detail in details) foreach (var detail in details)
@ -100,16 +100,11 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing;
private CountAdjust BuildIssue(ItemTransformNoteExchangeDto exchangeCountAdjust, string departmentCode) private CountAdjust BuildIssue(ItemTransformNoteExchangeDto exchangeCountAdjust, string departmentCode)
{ {
var detail = exchangeCountAdjust.Detail; var detail = exchangeCountAdjust.Detail;
string asdtype = "";
if (Enum.Parse<EnumTransSubType>(exchangeCountAdjust.Type) == EnumTransSubType.Item_Transform)
{
asdtype = "4003";
}
var counta = new CountAdjust() var counta = new CountAdjust()
{ {
mesout_asd_refc = departmentCode, mesout_asd_refc = departmentCode,
mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
mesout_asd_type = asdtype, mesout_asd_type = "4003",
mesout_asd_part = detail.ItemCode, mesout_asd_part = detail.ItemCode,
mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"), mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"),
mesout_asd_loc = detail.LocationErpCode, mesout_asd_loc = detail.LocationErpCode,

11
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductReceiptNoteConverter.cs

@ -27,6 +27,8 @@ public class ProductReceiptNoteConverter : IOutgoingConverter
_objectMapper = objectMapper; _objectMapper = objectMapper;
} }
public virtual async Task<List<OutgoingToExternal>> ConvertAsync() public virtual async Task<List<OutgoingToExternal>> ConvertAsync()
{ {
var outgoingToExternalList = new List<OutgoingToExternal>(); var outgoingToExternalList = new List<OutgoingToExternal>();
@ -67,21 +69,21 @@ public class ProductReceiptNoteConverter : IOutgoingConverter
return outgoingToExternalList; return outgoingToExternalList;
} }
private static ProductReceiptNote BuildProductReceiptNote(ProductReceiptNoteExchangeDto exchangeProductReceiptNote) private ProductReceiptNote BuildProductReceiptNote(ProductReceiptNoteExchangeDto exchangeProductReceiptNote)
{ {
var detail = exchangeProductReceiptNote.Detail; var detail = exchangeProductReceiptNote.Detail;
var ret = new ProductReceiptNote() var ret = new ProductReceiptNote()
{ {
mesout_ref_nbr = exchangeProductReceiptNote.Number, mesout_ref_nbr = exchangeProductReceiptNote.Number,
mesout_id = detail.RawLocationCode, mesout_id = string.IsNullOrEmpty(detail.RawLocationCode)?"": detail.RawLocationCode,
mesout_part = detail.ItemCode, mesout_patr = detail.ItemCode,
mesout_date = exchangeProductReceiptNote.ActiveDate.ToString("yyyyMMdd"), mesout_date = exchangeProductReceiptNote.ActiveDate.ToString("yyyyMMdd"),
mesout_bad = detail.ReturnQty, mesout_bad = detail.ReturnQty,
mesout_move = detail.ReturnQty != 0 ? 0 : detail.Qty, mesout_move = detail.ReturnQty != 0 ? 0 : detail.Qty,
mesout_unable = 0, mesout_unable = 0,
mesout_loc = detail.LocationErpCode, mesout_loc = detail.LocationErpCode,
mesout_dt = exchangeProductReceiptNote.ActiveDate.ToString("yyyyMMdd"), mesout_dt = exchangeProductReceiptNote.ActiveDate.ToString("yyyyMMdd"),
memo = detail.Remark, memo = string.IsNullOrEmpty(detail.Remark)?"": detail.Remark,
refno = "", refno = "",
}; };
@ -90,7 +92,6 @@ public class ProductReceiptNoteConverter : IOutgoingConverter
private async Task<ProductReceiptNoteExchangeDto> BuildProductReceiptNoteExchangeDtoAsync(ProductReceiptNoteDTO wmsReceipt, ProductReceiptNoteDetailDTO wmsReceiptDetail) private async Task<ProductReceiptNoteExchangeDto> BuildProductReceiptNoteExchangeDtoAsync(ProductReceiptNoteDTO wmsReceipt, ProductReceiptNoteDetailDTO wmsReceiptDetail)
{ {
await Task.CompletedTask.ConfigureAwait(false);
var exchangeReceipt = _objectMapper.Map<ProductReceiptNoteDTO, ProductReceiptNoteExchangeDto>(wmsReceipt); var exchangeReceipt = _objectMapper.Map<ProductReceiptNoteDTO, ProductReceiptNoteExchangeDto>(wmsReceipt);
var exchangeReceiptDetail = _objectMapper.Map<ProductReceiptNoteDetailDTO, ProductReceiptNoteDetailExchangeDto>(wmsReceiptDetail); var exchangeReceiptDetail = _objectMapper.Map<ProductReceiptNoteDetailDTO, ProductReceiptNoteDetailExchangeDto>(wmsReceiptDetail);
exchangeReceipt.Detail = exchangeReceiptDetail; exchangeReceipt.Detail = exchangeReceiptDetail;

6
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductRecycleNoteConverter.cs

@ -87,7 +87,7 @@ public class ProductRecycleNoteConverter : IOutgoingConverter
DataAction = outgoingFromWms.DataAction, DataAction = outgoingFromWms.DataAction,
SourceSystem = EnumSystemType.WMS.ToString(), SourceSystem = EnumSystemType.WMS.ToString(),
SourceDataId = materialDetail.Id.ToString(), SourceDataId = materialDetail.Id.ToString(),
SourceDataGroupCode = detail.ItemCode, SourceDataGroupCode = wmsReceipt.Number,
SourceDataDetailCode = materialDetail.ItemCode, SourceDataDetailCode = materialDetail.ItemCode,
Writer = nameof(TyrpOutgoingBackgroundWorker), Writer = nameof(TyrpOutgoingBackgroundWorker),
DestinationSystem = EnumSystemType.ERP.ToString(), DestinationSystem = EnumSystemType.ERP.ToString(),
@ -134,7 +134,7 @@ public class ProductRecycleNoteConverter : IOutgoingConverter
wmsoutm_stock_stat = "", wmsoutm_stock_stat = "",
wmsoutm_open_part = exchangeOrder.ItemCode, wmsoutm_open_part = exchangeOrder.ItemCode,
wmsoutm_open_loc = exchangeOrder.LocationErpCode, wmsoutm_open_loc = exchangeOrder.LocationErpCode,
wmsoutm_open_hours = 0, wmsoutm_open_hours = 1,//无法取到转移工时 目前默认为1
wmsoutm_tyrp_k = "", wmsoutm_tyrp_k = "",
wmsoutm_id = 0,//明细中最大scmsend_id wmsoutm_id = 0,//明细中最大scmsend_id
wmsoutm_open_qt = exchangeOrderDetail.Qty, wmsoutm_open_qt = exchangeOrderDetail.Qty,
@ -147,7 +147,7 @@ public class ProductRecycleNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private static Wmsoutd BuildDataInterfaceDetail(ProductRecycleNoteExchangeDto exchangeOrder, ProductRecycleMaterialDetailExchangeDto exchangeDetailOrder) private Wmsoutd BuildDataInterfaceDetail(ProductRecycleNoteExchangeDto exchangeOrder, ProductRecycleMaterialDetailExchangeDto exchangeDetailOrder)
{ {
var ret = new Wmsoutd() var ret = new Wmsoutd()
{ {

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs

@ -77,7 +77,7 @@ public class ProductionReturnNoteConverter : IOutgoingConverter
outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
var exchangeReceiptDetail = _objectMapper.Map<ProductionReturnNoteDetailDTO, ProductionReturnNoteDetailExchangeDto>(detail); var exchangeReceiptDetail = _objectMapper.Map<ProductionReturnNoteDetailDTO, ProductionReturnNoteDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, putawayNote.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail);
outgoingToExternalList.Add(outgoingDetailToExternal); outgoingToExternalList.Add(outgoingDetailToExternal);
} }
@ -114,12 +114,12 @@ public class ProductionReturnNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private Scmsend BuildDataInterfaceDetail(ProductionReturnNoteExchangeDto exchangeOrder, ProductionReturnNoteDetailExchangeDto exchangeDetailOrder) private Scmsend BuildDataInterfaceDetail(ProductionReturnNoteExchangeDto exchangeOrder, ProductionReturnNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{ {
var ret = new Scmsend() var ret = new Scmsend()
{ {
scmsend_type = billtype, scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number, scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "2", scmsend_stat1 = "2",
scmsend_part = exchangeDetailOrder.ItemCode, scmsend_part = exchangeDetailOrder.ItemCode,
@ -129,7 +129,7 @@ public class ProductionReturnNoteConverter : IOutgoingConverter
scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty, scmsend_qty = exchangeDetailOrder.Qty,
scmsend_wipd_loc = exchangeDetailOrder.FromLocationErpCode, scmsend_wipd_loc = exchangeDetailOrder.FromLocationErpCode,
scmsend_userid = exchangeOrder.Worker scmsend_userid = string.IsNullOrEmpty(exchangeOrder.Worker) ? "" : exchangeOrder.Worker
}; };
return ret; return ret;
} }

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseOrderConverter.cs

@ -85,7 +85,7 @@ public class PurchaseOrderConverter : IOutgoingConverter
outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
var exchangeReceiptDetail = _objectMapper.Map<PurchaseOrderDetailDTO, PurchaseOrderDetailExchangeDto>(detail); var exchangeReceiptDetail = _objectMapper.Map<PurchaseOrderDetailDTO, PurchaseOrderDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var purchaseOrderDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); var purchaseOrderDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, purchaseOrder.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(purchaseOrderDetail); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(purchaseOrderDetail);
outgoingToExternalList.Add(outgoingDetailToExternal); outgoingToExternalList.Add(outgoingDetailToExternal);
} }
@ -122,12 +122,12 @@ public class PurchaseOrderConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private Scmsend BuildDataInterfaceDetail(PurchaseOrderExchangeDto exchangeOrder, PurchaseOrderDetailExchangeDto exchangeDetailOrder) private Scmsend BuildDataInterfaceDetail(PurchaseOrderExchangeDto exchangeOrder, PurchaseOrderDetailExchangeDto exchangeDetailOrder, string dt_w)
{ {
var ret = new Scmsend() var ret = new Scmsend()
{ {
scmsend_type = billtype, scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number, scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "3", scmsend_stat1 = "3",
scmsend_part = exchangeDetailOrder.ItemCode, scmsend_part = exchangeDetailOrder.ItemCode,
@ -137,7 +137,7 @@ public class PurchaseOrderConverter : IOutgoingConverter
scmsend_date = exchangeOrder.OrderDate.ToString("yyyyMMdd"), scmsend_date = exchangeOrder.OrderDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty, scmsend_qty = exchangeDetailOrder.Qty,
scmsend_wipd_loc = "", scmsend_wipd_loc = "",
scmsend_userid = exchangeOrder.ContactName scmsend_userid = string.IsNullOrEmpty(exchangeOrder.ContactName) ? "" : exchangeOrder.ContactName
}; };
return ret; return ret;
} }

10
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseReturnConverter.cs

@ -82,7 +82,7 @@ public class PurchaseReturnConverter : IOutgoingConverter
outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
var exchangeReceiptDetail = _objectMapper.Map<PurchaseReturnNoteDetailDTO, PurchaseReturnNoteDetailExchangeDto>(detail); var exchangeReceiptDetail = _objectMapper.Map<PurchaseReturnNoteDetailDTO, PurchaseReturnNoteDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var purchaseReturnDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); var purchaseReturnDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, purchaseReturn.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(purchaseReturnDetail); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(purchaseReturnDetail);
outgoingToExternalList.Add(outgoingDetailToExternal); outgoingToExternalList.Add(outgoingDetailToExternal);
} }
@ -119,14 +119,14 @@ public class PurchaseReturnConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private Scmsend BuildDataInterfaceDetail(PurchaseReturnNoteExchangeDto exchangeOrder, PurchaseReturnNoteDetailExchangeDto exchangeDetailOrder) private Scmsend BuildDataInterfaceDetail(PurchaseReturnNoteExchangeDto exchangeOrder, PurchaseReturnNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{ {
var ret = new Scmsend() var ret = new Scmsend()
{ {
scmsend_type = billtype, scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number, scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "0", scmsend_stat1 = "4",
scmsend_part = exchangeDetailOrder.ItemCode, scmsend_part = exchangeDetailOrder.ItemCode,
scmsend_delv_date = "", scmsend_delv_date = "",
scmsend_orderno = exchangeOrder.SupplierCode, scmsend_orderno = exchangeOrder.SupplierCode,
@ -134,7 +134,7 @@ public class PurchaseReturnConverter : IOutgoingConverter
scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty, scmsend_qty = exchangeDetailOrder.Qty,
scmsend_wipd_loc = "", scmsend_wipd_loc = "",
scmsend_userid = exchangeOrder.ContactName scmsend_userid = string.IsNullOrEmpty(exchangeOrder.ContactName) ? "" : exchangeOrder.ContactName
}; };
return ret; return ret;
} }

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.cs

@ -77,7 +77,7 @@ public class PutawayNoteConverter : IOutgoingConverter
outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
var exchangeReceiptDetail = _objectMapper.Map<PutawayNoteDetailDTO, PutawayNoteDetailExchangeDto>(detail); var exchangeReceiptDetail = _objectMapper.Map<PutawayNoteDetailDTO, PutawayNoteDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, putawayNote.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail);
outgoingToExternalList.Add(outgoingDetailToExternal); outgoingToExternalList.Add(outgoingDetailToExternal);
} }
@ -114,12 +114,12 @@ public class PutawayNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private Scmsend BuildDataInterfaceDetail(PutawayNoteExchangeDto exchangeOrder, PutawayNoteDetailExchangeDto exchangeDetailOrder) private Scmsend BuildDataInterfaceDetail(PutawayNoteExchangeDto exchangeOrder, PutawayNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{ {
var ret = new Scmsend() var ret = new Scmsend()
{ {
scmsend_type = billtype, scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number, scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "0", scmsend_stat1 = "0",
scmsend_part = exchangeDetailOrder.ItemCode, scmsend_part = exchangeDetailOrder.ItemCode,
@ -129,7 +129,7 @@ public class PutawayNoteConverter : IOutgoingConverter
scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty, scmsend_qty = exchangeDetailOrder.Qty,
scmsend_wipd_loc = "", scmsend_wipd_loc = "",
scmsend_userid = exchangeOrder.Worker scmsend_userid = string.IsNullOrEmpty(exchangeOrder.Worker) ? "" : exchangeOrder.Worker
}; };
return ret; return ret;
} }

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs

@ -138,7 +138,7 @@ public class RecycledMaterialReceiptNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private static Wmsoutd BuildDataInterfaceDetail(RecycledMaterialReceiptNoteExchangeDto exchangeOrder, RecycledMaterialReceiptNoteDetailExchangeDto exchangeDetailOrder) private Wmsoutd BuildDataInterfaceDetail(RecycledMaterialReceiptNoteExchangeDto exchangeOrder, RecycledMaterialReceiptNoteDetailExchangeDto exchangeDetailOrder)
{ {
var ret = new Wmsoutd() var ret = new Wmsoutd()
{ {

10
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs

@ -47,9 +47,19 @@ public class ScontrolWriter : IWriter
dataInterfaceDetailList.Add(receiptDetail); dataInterfaceDetailList.Add(receiptDetail);
} }
} }
try
{
//dataInterface分主子表分别写入ERP //dataInterface分主子表分别写入ERP
await _dataInterfaceManager.PostListAsync(dataInterfaceList, dataInterfaceDetailList).ConfigureAwait(false); await _dataInterfaceManager.PostListAsync(dataInterfaceList, dataInterfaceDetailList).ConfigureAwait(false);
} }
catch (System.Exception ex)
{
foreach (var item in entitys)
{
item.SetError(EnumExchangeDataErrorCode.Exception, ex.Message, ex.ToString());
}
}
}
//将数据归档 //将数据归档
await _outgoingToExternalManager.ArchiveManyAsync(outgoingDataList).ConfigureAwait(false); await _outgoingToExternalManager.ArchiveManyAsync(outgoingDataList).ConfigureAwait(false);
} }

32
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs

@ -38,8 +38,7 @@ IOutgoingFromWmsManager outgoingFromWmsManager
public virtual async Task<List<OutgoingToExternal>> ConvertAsync() public virtual async Task<List<OutgoingToExternal>> ConvertAsync()
{ {
var outgoingToExternalList = new List<OutgoingToExternal>(); var outgoingToExternalList = new List<OutgoingToExternal>();
var outgoingFromWmsList = var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.Scrap, EnumSystemType.ERP).ConfigureAwait(false);
await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.UnplannedIssue, EnumSystemType.ERP).ConfigureAwait(false);
foreach (var outgoingFromWms in outgoingFromWmsList) foreach (var outgoingFromWms in outgoingFromWmsList)
{ {
var wmsCountAdjust = JsonSerializer.Deserialize<ScrapNoteDTO>(outgoingFromWms.DataContent); var wmsCountAdjust = JsonSerializer.Deserialize<ScrapNoteDTO>(outgoingFromWms.DataContent);
@ -69,36 +68,40 @@ IOutgoingFromWmsManager outgoingFromWmsManager
outgoingToExternalList.Add(outgoingToExternal); outgoingToExternalList.Add(outgoingToExternal);
} }
} }
await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false); await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false);
//将outgoingFromWms数据归档
await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false);
return outgoingToExternalList; return outgoingToExternalList;
} }
private static CountAdjust BuildIssue(ScrapNoteExchangeDto exchangeScrap, string departmentCode) private CountAdjust BuildIssue(ScrapNoteExchangeDto exchangeScrap, string departmentCode)
{ {
var detail = exchangeScrap.Detail; var detail = exchangeScrap.Detail;
string time = DateTime.Now.ToLongTimeString();
string time1 = DateTime.Now.ToShortDateString().Replace("/", "").Trim();
//string date = time1 + " " + time;
string date = string.Format("{0} {1}", time, time1);
string asdtype = ""; string asdtype = "";
if (exchangeScrap.Type== EnumTransSubType.CountAdjust_WIP.ToString())
if (Enum.Parse<EnumTransSubType>(exchangeScrap.Type) == EnumTransSubType.CountAdjust_WIP)
{ {
asdtype = "4042"; asdtype = "4042";
} }
else if (Enum.Parse<EnumTransSubType>(exchangeScrap.Type) == EnumTransSubType.CountAdjust_Warehouse) else if (exchangeScrap.Type == EnumTransSubType.CountAdjust_Warehouse.ToString())
{
asdtype = "4004";
}
else if (exchangeScrap.Type == EnumTransSubType.Scrap_Manual.ToString())
{ {
asdtype = "4004"; asdtype = "4004";
} }
else if (exchangeScrap.Type == EnumTransSubType.Scrap_WIP.ToString())
{
asdtype = "4042";
}
var counta = new CountAdjust() var counta = new CountAdjust()
{ {
mesout_asd_refc = departmentCode, mesout_asd_refc = departmentCode,
mesout_asd_dt_w = date, mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
mesout_asd_type = asdtype, mesout_asd_type = asdtype,
mesout_asd_part = detail.ItemCode, mesout_asd_part = detail.ItemCode,
mesout_asd_date = exchangeScrap.ActiveDate.ToShortDateString().Replace("/", "").Trim(), mesout_asd_date = exchangeScrap.ActiveDate.ToString("yyyyMMdd"),
mesout_asd_loc = "",//字段不明确 mesout_asd_loc = detail.FromLocationErpCode,
mesout_asd_code = detail.ReasonCode, mesout_asd_code = detail.ReasonCode,
mesout_asd_qty = detail.Qty, mesout_asd_qty = detail.Qty,
mesout_asd_user = exchangeScrap.Worker, mesout_asd_user = exchangeScrap.Worker,
@ -109,7 +112,6 @@ IOutgoingFromWmsManager outgoingFromWmsManager
} }
private async Task<ScrapNoteExchangeDto> BuildPurchaseReceiptExchangeDtoAsync(ScrapNoteDTO wmsScrap, ScrapNoteDetailDTO wmsScrapDetail) private async Task<ScrapNoteExchangeDto> BuildPurchaseReceiptExchangeDtoAsync(ScrapNoteDTO wmsScrap, ScrapNoteDetailDTO wmsScrapDetail)
{ {
await Task.CompletedTask.ConfigureAwait(false);
var exchangeScrap = _objectMapper.Map<ScrapNoteDTO, ScrapNoteExchangeDto>(wmsScrap); var exchangeScrap = _objectMapper.Map<ScrapNoteDTO, ScrapNoteExchangeDto>(wmsScrap);
var exchangeScrapDetail = _objectMapper.Map<ScrapNoteDetailDTO, ScrapNoteDetailExchangeDto>(wmsScrapDetail); var exchangeScrapDetail = _objectMapper.Map<ScrapNoteDetailDTO, ScrapNoteDetailExchangeDto>(wmsScrapDetail);
//var userdep = await _supplierAsnAppService.GetByNumberAsync(exchangeCountAdjust.Worker); //var userdep = await _supplierAsnAppService.GetByNumberAsync(exchangeCountAdjust.Worker);

24
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TransferNoteConverter.cs

@ -36,6 +36,7 @@ public class TransferNoteConverter : IOutgoingConverter
_objectMapper = objectMapper; _objectMapper = objectMapper;
} }
public virtual async Task<List<OutgoingToExternal>> ConvertAsync() public virtual async Task<List<OutgoingToExternal>> ConvertAsync()
{ {
var outgoingToExternalList = new List<OutgoingToExternal>(); var outgoingToExternalList = new List<OutgoingToExternal>();
@ -68,16 +69,17 @@ public class TransferNoteConverter : IOutgoingConverter
}; };
outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt); outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt);
string dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss");
if (exchangeReceipt.Type != EnumTransSubType.Transfer_Customer.ToString()) if (exchangeReceipt.Type != EnumTransSubType.Transfer_Customer.ToString())
{ {
outgoingToExternal.DataType = EnumOutgoingDataType.TransferForErp.ToString(); outgoingToExternal.DataType = EnumOutgoingDataType.TransferForErp.ToString();
var putawayNoteScontrol = BuildScontrolDataInterface(exchangeReceipt); var putawayNoteScontrol = BuildScontrolDataInterface(exchangeReceipt, dt_w);
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteScontrol); outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteScontrol);
} }
else else
{ {
outgoingToExternal.DataType = EnumOutgoingDataType.TransferForCustom.ToString(); outgoingToExternal.DataType = EnumOutgoingDataType.TransferForCustom.ToString();
var putawayNoteWmsoutm = BuildWmsoutmDataInterface(exchangeReceipt, departmentCode); var putawayNoteWmsoutm = BuildWmsoutmDataInterface(exchangeReceipt, departmentCode, dt_w);
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteWmsoutm); outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteWmsoutm);
} }
@ -106,7 +108,7 @@ public class TransferNoteConverter : IOutgoingConverter
if (exchangeReceipt.Type != EnumTransSubType.Transfer_Customer.ToString()) if (exchangeReceipt.Type != EnumTransSubType.Transfer_Customer.ToString())
{ {
var putawayNoteDetailScmsend = BuildScmsendDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); var putawayNoteDetailScmsend = BuildScmsendDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetailScmsend); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetailScmsend);
} }
else else
@ -133,12 +135,12 @@ public class TransferNoteConverter : IOutgoingConverter
/// </summary> /// </summary>
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <returns></returns> /// <returns></returns>
private Scontrol BuildScontrolDataInterface(TransferNoteExchangeDto exchangeOrder) private Scontrol BuildScontrolDataInterface(TransferNoteExchangeDto exchangeOrder, string dt_w)
{ {
var ret = new Scontrol() var ret = new Scontrol()
{ {
scontrol_nbr = exchangeOrder.Number, scontrol_nbr = exchangeOrder.Number,
scontrol_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), scontrol_dt_w = dt_w,
scontrol_stat = "Y", scontrol_stat = "Y",
scontrol_dt_k = "", scontrol_dt_k = "",
scontrol_type = billtype_s, scontrol_type = billtype_s,
@ -152,12 +154,12 @@ public class TransferNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private Scmsend BuildScmsendDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder) private Scmsend BuildScmsendDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{ {
var ret = new Scmsend() var ret = new Scmsend()
{ {
scmsend_type = billtype_s, scmsend_type = billtype_s,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number, scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "0", scmsend_stat1 = "0",
scmsend_part = exchangeDetailOrder.ItemCode, scmsend_part = exchangeDetailOrder.ItemCode,
@ -177,13 +179,13 @@ public class TransferNoteConverter : IOutgoingConverter
/// </summary> /// </summary>
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <returns></returns> /// <returns></returns>
private Wmsoutm BuildWmsoutmDataInterface(TransferNoteExchangeDto exchangeOrder, string departmentCode) private Wmsoutm BuildWmsoutmDataInterface(TransferNoteExchangeDto exchangeOrder, string departmentCode, string dt_w)
{ {
var ret = new Wmsoutm() var ret = new Wmsoutm()
{ {
wmsoutm_nbr = exchangeOrder.Number, wmsoutm_nbr = exchangeOrder.Number,
wmsoutm_type = billtype_w, wmsoutm_type = billtype_w,
wmsoutm_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), wmsoutm_dt_w = dt_w,
wmsoutm_stat = "Y", wmsoutm_stat = "Y",
wmsoutm_tyrp_dt = "", wmsoutm_tyrp_dt = "",
wmsoutm_user = exchangeOrder.Worker, wmsoutm_user = exchangeOrder.Worker,
@ -192,7 +194,7 @@ public class TransferNoteConverter : IOutgoingConverter
wmsoutm_cust = "", wmsoutm_cust = "",
wmsoutm_shm_nbr = "", wmsoutm_shm_nbr = "",
wmsoutm_cust_loc = "", wmsoutm_cust_loc = "",
wmsoutm_stock_stat = "", wmsoutm_stock_stat = "1",
wmsoutm_open_part = "", wmsoutm_open_part = "",
wmsoutm_open_loc = "", wmsoutm_open_loc = "",
wmsoutm_open_hours = 0, wmsoutm_open_hours = 0,
@ -208,7 +210,7 @@ public class TransferNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private static Wmsoutd BuildWmsoutdDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder) private Wmsoutd BuildWmsoutdDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder)
{ {
var ret = new Wmsoutd() var ret = new Wmsoutd()
{ {

27
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs

@ -32,6 +32,7 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{ {
Logger.LogInformation($"Starting: Handling {Outgoing}"); Logger.LogInformation($"Starting: Handling {Outgoing}");
if (!_options.Value.IncomingOptions.Active) if (!_options.Value.IncomingOptions.Active)
{ {
Logger.LogInformation($"{Outgoing} is not active!"); Logger.LogInformation($"{Outgoing} is not active!");
@ -84,10 +85,11 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
var deliverNoteList = await deliverNoteConvert.ConvertAsync().ConfigureAwait(false); var deliverNoteList = await deliverNoteConvert.ConvertAsync().ConfigureAwait(false);
await wmsoutmWriter.WriteAsync(deliverNoteList).ConfigureAwait(false); await wmsoutmWriter.WriteAsync(deliverNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write CustomerReturnNote");//退货单 //暂无此接口
var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService<CustomerReturnNoteConverter>(); //Logger.LogInformation($"Write CustomerReturnNote");//退货单
var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false); //var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService<CustomerReturnNoteConverter>();
await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false); //var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false);
//await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write UnplannedIssueNote");//非生产领料单 Logger.LogInformation($"Write UnplannedIssueNote");//非生产领料单
var unplannedIssueNoteConvert = workerContext.ServiceProvider.GetRequiredService<UnplannedIssueNoteConverter>(); var unplannedIssueNoteConvert = workerContext.ServiceProvider.GetRequiredService<UnplannedIssueNoteConverter>();
@ -109,21 +111,28 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
var productRecycleNoteList = await productRecycleNoteConvert.ConvertAsync().ConfigureAwait(false); var productRecycleNoteList = await productRecycleNoteConvert.ConvertAsync().ConfigureAwait(false);
await wmsoutmWriter.WriteAsync(productRecycleNoteList).ConfigureAwait(false); await wmsoutmWriter.WriteAsync(productRecycleNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write CountAdjusNote");//调整单、线边仓调整单 Logger.LogInformation($"Write CountAdjusNote");//盘点调整单
var countadjustNoteConvert = workerContext.ServiceProvider.GetRequiredService<CountAdjustNoteConverter>(); var countadjustNoteConvert = workerContext.ServiceProvider.GetRequiredService<CountAdjustNoteConverter>();
var countadjustNoteList = await countadjustNoteConvert.ConvertAsync().ConfigureAwait(false); var countadjustNoteList = await countadjustNoteConvert.ConvertAsync().ConfigureAwait(false);
var countadjustWriter = workerContext.ServiceProvider.GetRequiredService<CountAdjustNoteWriter>(); var countadjustWriter = workerContext.ServiceProvider.GetRequiredService<CountAdjustNoteWriter>();
await countadjustWriter.WriteAsync(countadjustNoteList).ConfigureAwait(false); await countadjustWriter.WriteAsync(countadjustNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write ScrapNote");//报废单、线边仓报废 Logger.LogInformation($"Write WIPAdjusNote");//线边仓调整
var scrapNoteConvert = workerContext.ServiceProvider.GetRequiredService<ScrapNoteConverter>(); var wipAdjustNoteConvert = workerContext.ServiceProvider.GetRequiredService<WIPAdjusNoteConverter>();
var scrapNoteList = await scrapNoteConvert.ConvertAsync().ConfigureAwait(false); var wipAdjustNoteList = await wipAdjustNoteConvert.ConvertAsync().ConfigureAwait(false);
await countadjustWriter.WriteAsync(scrapNoteList).ConfigureAwait(false); await countadjustWriter.WriteAsync(wipAdjustNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write ItemTransformNote");//回收料调整单 Logger.LogInformation($"Write ItemTransformNote");//回收料调整单
var ItemTransformNoteConvert = workerContext.ServiceProvider.GetRequiredService<ItemTransformNoteConverter>(); var ItemTransformNoteConvert = workerContext.ServiceProvider.GetRequiredService<ItemTransformNoteConverter>();
var ItemTransformNoteList = await ItemTransformNoteConvert.ConvertAsync().ConfigureAwait(false); var ItemTransformNoteList = await ItemTransformNoteConvert.ConvertAsync().ConfigureAwait(false);
await countadjustWriter.WriteAsync(ItemTransformNoteList).ConfigureAwait(false); await countadjustWriter.WriteAsync(ItemTransformNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write ScrapNote");//报废单、线边仓报废单
var scrapNoteConvert = workerContext.ServiceProvider.GetRequiredService<ScrapNoteConverter>();
var scrapNoteList = await scrapNoteConvert.ConvertAsync().ConfigureAwait(false);
await countadjustWriter.WriteAsync(scrapNoteList).ConfigureAwait(false);
Logger.LogInformation($"Completed: Handling {Outgoing}"); Logger.LogInformation($"Completed: Handling {Outgoing}");
} }

6
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs

@ -49,7 +49,7 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter
var exchangeReceipt = _objectMapper.Map<UnplannedIssueNoteDTO, UnplannedIssueNoteExchangeDto>(wmsReceipt); var exchangeReceipt = _objectMapper.Map<UnplannedIssueNoteDTO, UnplannedIssueNoteExchangeDto>(wmsReceipt);
var department = await _departmentAppService.GetByUsernameAsync(exchangeReceipt.Worker).ConfigureAwait(false); var department = await _departmentAppService.GetByUsernameAsync(exchangeReceipt.Worker).ConfigureAwait(false);
var departmentCode = department == null ? "" : department.Code; var departmentCode = department == null ? "" : department.Code;
var purchaseOrder = BuildDataInterface(exchangeReceipt, departmentCode); var purchaseOrder = BuildDataInterface(exchangeReceipt);
var outgoingToExternal = new OutgoingToExternal() var outgoingToExternal = new OutgoingToExternal()
{ {
DataType = EnumOutgoingDataType.UnplannedIssue.ToString(), DataType = EnumOutgoingDataType.UnplannedIssue.ToString(),
@ -106,7 +106,7 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter
/// </summary> /// </summary>
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <returns></returns> /// <returns></returns>
private Wmsoutm BuildDataInterface(UnplannedIssueNoteExchangeDto exchangeOrder, string departmentCode) private Wmsoutm BuildDataInterface(UnplannedIssueNoteExchangeDto exchangeOrder)
{ {
var ret = new Wmsoutm() var ret = new Wmsoutm()
@ -138,7 +138,7 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private static Wmsoutd BuildDataInterfaceDetail(UnplannedIssueNoteExchangeDto exchangeOrder, UnplannedIssueNoteDetailExchangeDto exchangeDetailOrder) private Wmsoutd BuildDataInterfaceDetail(UnplannedIssueNoteExchangeDto exchangeOrder, UnplannedIssueNoteDetailExchangeDto exchangeDetailOrder)
{ {
var ret = new Wmsoutd() var ret = new Wmsoutd()
{ {

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs

@ -138,7 +138,7 @@ public class UnplannedReceiptNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param> /// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param> /// <param name="exchangeDetailOrder"></param>
/// <returns></returns> /// <returns></returns>
private static Wmsoutd BuildDataInterfaceDetail(UnplannedReceiptNoteExchangeDto exchangeOrder, UnplannedReceiptNoteDetailExchangeDto exchangeDetailOrder) private Wmsoutd BuildDataInterfaceDetail(UnplannedReceiptNoteExchangeDto exchangeOrder, UnplannedReceiptNoteDetailExchangeDto exchangeDetailOrder)
{ {
var ret = new Wmsoutd() var ret = new Wmsoutd()
{ {

112
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WIPAdjusNoteConverter.cs

@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Auth.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.WMS.CountAdjustNote;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing;
public class WIPAdjusNoteConverter : IOutgoingConverter
{
private readonly IOutgoingFromWmsManager _outgoingFromWmsManager;
private readonly IOutgoingToExternalManager _outgoingToExternalManager;
private readonly ISupplierAsnAppService _supplierAsnAppService;
private readonly IDepartmentAppService _departmentAppService;
private readonly IObjectMapper _objectMapper;
public WIPAdjusNoteConverter(
IOutgoingFromWmsManager outgoingFromWmsManager
, IOutgoingToExternalManager outgoingToExternalManager
, ISupplierAsnAppService supplierAsnAppService
, IDepartmentAppService departmentAppService
, IObjectMapper objectMapper
)
{
_outgoingFromWmsManager = outgoingFromWmsManager;
_outgoingToExternalManager = outgoingToExternalManager;
_supplierAsnAppService = supplierAsnAppService;
_departmentAppService = departmentAppService;
_objectMapper = objectMapper;
}
public virtual async Task<List<OutgoingToExternal>> ConvertAsync()
{
var outgoingToExternalList = new List<OutgoingToExternal>();
var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.WIPAdjust, EnumSystemType.ERP).ConfigureAwait(false);
foreach (var outgoingFromWms in outgoingFromWmsList)
{
var wmsCountAdjust = JsonSerializer.Deserialize<CountAdjustNoteDTO>(outgoingFromWms.DataContent);
var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false);
var departmentCode = department == null ? "" : department.Code;
var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.LocationErpCode }).Select(p => new CountAdjustNoteDetailExchangeDto { CountQty = p.Sum(itm => itm.CountQty), InventoryQty = p.Sum(itm => itm.InventoryQty), ItemCode = p.Key.ItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) });
var detal = details.ToList();
foreach (var detail in detal)
{
//判断盘点数与库存数是否相等
if (detail.CountQty != detail.InventoryQty)
{
var outgoingToExternal = new OutgoingToExternal()
{
DataType = outgoingFromWms.DataType,
DataAction = outgoingFromWms.DataAction,
SourceSystem = EnumSystemType.WMS.ToString(),
SourceDataId = wmsCountAdjust.Number,
SourceDataGroupCode = wmsCountAdjust.Number,
SourceDataDetailCode = details.FirstOrDefault().ItemCode,
Writer = nameof(TyrpOutgoingBackgroundWorker),
DestinationSystem = EnumSystemType.ERP.ToString(),
DestinationDataId = "",
};
outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail).ConfigureAwait(false);
outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue);
var arrive = BuildIssue(exchangeIssue, departmentCode);
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive);
outgoingToExternalList.Add(outgoingToExternal);
}
}
}
await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false);
//将outgoingFromWms数据归档
await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false);
return outgoingToExternalList;
//插入到中间表OutgoingToExternal
}
private CountAdjust BuildIssue(CountAdjustNoteExchangeDto exchangeCountAdjust, string departmentCode)
{
var detail = exchangeCountAdjust.Detail;
var counta = new CountAdjust()
{
mesout_asd_refc = departmentCode,
mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
mesout_asd_type = "4041",
mesout_asd_part = detail.ItemCode,
mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"),
mesout_asd_loc = string.Empty,
mesout_asd_code = detail.ReasonCode,
mesout_asd_qty = detail.CountQty + detail.InventoryQty,
mesout_asd_user = exchangeCountAdjust.Worker,
mesout_asd_k = string.Empty,
mesout_asd_stat = "Y"
};
return counta;
}
private async Task<CountAdjustNoteExchangeDto> BuildPurchaseReceiptExchangeDtoAsync(
CountAdjustNoteDTO wmsCountAdjust, CountAdjustNoteDetailExchangeDto wmsCountAdjustDetail)
{
var exchangeCountAdjust = _objectMapper.Map<CountAdjustNoteDTO, CountAdjustNoteExchangeDto>(wmsCountAdjust);
exchangeCountAdjust.Detail = wmsCountAdjustDetail;
return exchangeCountAdjust;
}
}

11
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs

@ -47,9 +47,20 @@ public class WmsoutmWriter : IWriter
dataInterfaceDetailList.Add(receiptDetail); dataInterfaceDetailList.Add(receiptDetail);
} }
} }
try
{
//dataInterface分主子表分别写入ERP //dataInterface分主子表分别写入ERP
await _wmsoutdManager.PostListAsync(dataInterfaceList, dataInterfaceDetailList).ConfigureAwait(false); await _wmsoutdManager.PostListAsync(dataInterfaceList, dataInterfaceDetailList).ConfigureAwait(false);
} }
catch (System.Exception ex)
{
foreach (var item in entitys)
{
item.SetError(EnumExchangeDataErrorCode.Exception, ex.Message, ex.ToString());
}
}
}
//将数据归档 //将数据归档
await _outgoingToExternalManager.ArchiveManyAsync(outgoingDataList).ConfigureAwait(false); await _outgoingToExternalManager.ArchiveManyAsync(outgoingDataList).ConfigureAwait(false);
} }

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs

@ -173,7 +173,7 @@ public class TyrpAgentModule : AbpModule
{ {
context.AddBackgroundWorkerAsync<TyrpIncomingBackgroundWorker>(); context.AddBackgroundWorkerAsync<TyrpIncomingBackgroundWorker>();
// context.AddBackgroundWorkerAsync<TyrpOutgoingBackgroundWorker>(); context.AddBackgroundWorkerAsync<TyrpOutgoingBackgroundWorker>();
} }
} }

18
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json

@ -1,13 +1,13 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,21195;Database=Wms;uid=sa;pwd=aA123456!;TrustServerCertificate=True", "Default": "Server=10.164.113.32,1818\\SHDB;Database=Wms_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True",
"DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", "DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True",
"TYRP": "Server=dev.ccwin-in.com,21195;Database=TYRP;Uid=sa;Pwd=aA123456!;TrustServerCertificate=True", "TYRP": "Server=10.164.113.32,1818\\SHDB;Database=TYRP;Uid=ShWmsUser;Pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True",
"SYBASE_TYRP": "Data Source=10.164.1.11; Port=5000; Database=mesdb; Uid=mesuser; Pwd=mesuser1234;Charset=cp850;" //iso_1 "SYBASE_TYRP": "Data Source=10.164.115.137; Port=5000; Database=mesdb; Uid=mesuser; Pwd=mesuser1234;Charset=cp850;" //iso_1
}, },
"AuthServer": { "AuthServer": {
"Authority": "http://dev.ccwin-in.com:21293/", "Authority": "http://dev.ccwin-in.com:60083/",
"RequireHttpsMetadata": "false", "RequireHttpsMetadata": "false",
"SwaggerClientId": "admin", "SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*", "SwaggerClientSecret": "1q2w3E*",
@ -26,16 +26,16 @@
"RemoteServices": { "RemoteServices": {
"BaseData": { "BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:21294/" "BaseUrl": "http://dev.ccwin-in.com:60084/"
}, },
"Store": { "Store": {
"BaseUrl": "http://dev.ccwin-in.com:21295/" "BaseUrl": "http://dev.ccwin-in.com:60085/"
}, },
"Label": { "Label": {
"BaseUrl": "http://dev.ccwin-in.com:21292/" "BaseUrl": "http://dev.ccwin-in.com:60082/"
}, },
"Auth": { "Auth": {
"BaseUrl": "http://dev.ccwin-in.com:21293/" "BaseUrl": "http://dev.ccwin-in.com:60083/"
} }
}, },
"TyrpOptions": { "TyrpOptions": {

1
be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Mes/Mes/MesProductL7PartsNoteAutoMapperProfile.cs

@ -11,7 +11,6 @@ public class MesProductL7PartsNoteAutoMapperProfile : Profile
public MesProductL7PartsNoteAutoMapperProfile() public MesProductL7PartsNoteAutoMapperProfile()
{ {
CreateMap<MesProductL7PartsNote, MesProductL7PartsNoteDTO>() CreateMap<MesProductL7PartsNote, MesProductL7PartsNoteDTO>()
.IgnoreAuditedObjectProperties()
.ForMember(x => x.CreationTime, y => y.MapFrom(d => d.CreationTime)) .ForMember(x => x.CreationTime, y => y.MapFrom(d => d.CreationTime))
.ReverseMap(); .ReverseMap();

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

@ -150,6 +150,6 @@ public class AgentModule : AbpModule
ApplicationInitializationContext context) ApplicationInitializationContext context)
{ {
context.AddBackgroundWorkerAsync<IncomingToWmsWorker>(); context.AddBackgroundWorkerAsync<IncomingToWmsWorker>();
//context.AddBackgroundWorkerAsync<OutgoingFromWmsWorker>(); context.AddBackgroundWorkerAsync<OutgoingFromWmsWorker>();
} }
} }

1
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs

@ -157,6 +157,7 @@ public static class IncomingToWmsExtensions
var backFlush = JsonSerializer.Deserialize<BackFlushNoteEditInput>(incomingConverted.DataContent); var backFlush = JsonSerializer.Deserialize<BackFlushNoteEditInput>(incomingConverted.DataContent);
var balanceAppService = workerContext.ServiceProvider.GetRequiredService<IBalanceAppService>(); var balanceAppService = workerContext.ServiceProvider.GetRequiredService<IBalanceAppService>();
var balanceDtos = await balanceAppService.GetRecommendBalancesAsync(new RecommendBalanceRequestInput() var balanceDtos = await balanceAppService.GetRecommendBalancesAsync(new RecommendBalanceRequestInput()
{ {
Qty = backFlush.Qty, Qty = backFlush.Qty,

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

@ -79,64 +79,64 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
switch (dataType) switch (dataType)
{ {
case EnumIncomingDataType.Department: case EnumIncomingDataType.Department:
//await incomingToWms.HandleDepartmentsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleDepartmentsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.User: case EnumIncomingDataType.User:
//await incomingToWms.HandleUsersAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleUsersAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.Item: case EnumIncomingDataType.Item:
//await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.Location: case EnumIncomingDataType.Location:
await incomingToWms.HandleErpLocationsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleErpLocationsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.Bom: case EnumIncomingDataType.Bom:
//await incomingToWms.HandleBomsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleBomsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.Dict: case EnumIncomingDataType.Dict:
await incomingToWms.HandleDictsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleDictsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.Supplier: case EnumIncomingDataType.Supplier:
//await incomingToWms.HandleSuppliersAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleSuppliersAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.SupplierItem: case EnumIncomingDataType.SupplierItem:
//await incomingToWms.HandleSupplierItemsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleSupplierItemsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.ItemPack: case EnumIncomingDataType.ItemPack:
//await incomingToWms.HandleItemPacksAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleItemPacksAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.Customer: case EnumIncomingDataType.Customer:
//await incomingToWms.HandleCustomersAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleCustomersAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.CustomerItem: case EnumIncomingDataType.CustomerItem:
//await incomingToWms.HandleCustomerItemsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleCustomerItemsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.InterfaceCalendar: case EnumIncomingDataType.InterfaceCalendar:
//await incomingToWms.HandleInterfaceCalendarsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleInterfaceCalendarsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.PurchaseOrder: case EnumIncomingDataType.PurchaseOrder:
//await incomingToWms.HandlePurchaseOrdersAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandlePurchaseOrdersAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.SaleOrder: case EnumIncomingDataType.SaleOrder:
//await incomingToWms.HandleSaleOrdersAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleSaleOrdersAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.SupplierAsn: case EnumIncomingDataType.SupplierAsn:
//await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.ProductReceipt: case EnumIncomingDataType.ProductReceipt:
//await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.MaterialRequest: case EnumIncomingDataType.MaterialRequest:
await incomingToWms.HandleMaterialRequestsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleMaterialRequestsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.Scrap: case EnumIncomingDataType.Scrap:
//await incomingToWms.HandleScrapsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleScrapsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.IssueConfirm: case EnumIncomingDataType.IssueConfirm:
//await incomingToWms.HandleIssueNoteConfirmAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleIssueNoteConfirmAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.PurchaseLabel: case EnumIncomingDataType.PurchaseLabel:
//await incomingToWms.HandleInventoryLabelsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleInventoryLabelsAsync(workerContext).ConfigureAwait(false);
break; break;
case EnumIncomingDataType.BackFlush: case EnumIncomingDataType.BackFlush:
await incomingToWms.HandleBackFlushsAsync(workerContext).ConfigureAwait(false); await incomingToWms.HandleBackFlushsAsync(workerContext).ConfigureAwait(false);

14
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json

@ -1,13 +1,13 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", "Default": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True",
"DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True" "DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True"
}, },
"AuthServer": { "AuthServer": {
"Authority": "http://dev.ccwin-in.com:21293/", "Authority": "http://dev.ccwin-in.com:60083/",
"RequireHttpsMetadata": "false", "RequireHttpsMetadata": "false",
"SwaggerClientId": "admin", "SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*", "SwaggerClientSecret": "1q2w3E*",
@ -26,16 +26,16 @@
"RemoteServices": { "RemoteServices": {
"BaseData": { "BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:21294/" "BaseUrl": "http://dev.ccwin-in.com:60084/"
}, },
"Store": { "Store": {
"BaseUrl": "http://dev.ccwin-in.com:21295/" "BaseUrl": "http://dev.ccwin-in.com:60085/"
}, },
"Label": { "Label": {
"BaseUrl": "http://dev.ccwin-in.com:21292/" "BaseUrl": "http://dev.ccwin-in.com:60082/"
}, },
"Auth": { "Auth": {
"BaseUrl": "http://dev.ccwin-in.com:21293/" "BaseUrl": "http://dev.ccwin-in.com:60083/"
} }
}, },
"DataExchangeOptions": { "DataExchangeOptions": {

12
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/CountAdjustNote/CountAdjustNoteDetailExchangeDto.cs

@ -4,7 +4,6 @@ namespace Win_in.Sfs.Wms.DataExchange.WMS.CountAdjustNote;
public class CountAdjustNoteDetailExchangeDto public class CountAdjustNoteDetailExchangeDto
{ {
/// <summary> /// <summary>
/// 物品代码 /// 物品代码
/// </summary> /// </summary>
@ -21,9 +20,18 @@ public class CountAdjustNoteDetailExchangeDto
[Display(Name = "原因代码")] [Display(Name = "原因代码")]
public string ReasonCode { get; set; } public string ReasonCode { get; set; }
/// <summary> /// <summary>
/// 库存数量
/// </summary>
[Display(Name = "库存数量")]
public decimal InventoryQty { get; set; }
/// <summary>
/// 调整数量
/// </summary>
[Display(Name = "调整数量")]
public decimal AdjustQty { get; set; }
/// <summary>
/// 盘点数量 /// 盘点数量
/// </summary> /// </summary>
[Display(Name = "盘点数量")] [Display(Name = "盘点数量")]
public decimal CountQty { get; set; } public decimal CountQty { get; set; }
} }

50
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteDetailExchangeDto.cs

@ -1,3 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote; namespace Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote;
@ -26,9 +27,58 @@ public class PutawayNoteDetailExchangeDto
[Display(Name = "目标ERP库位")] [Display(Name = "目标ERP库位")]
public string ToLocationErpCode { get; set; } public string ToLocationErpCode { get; set; }
/// <summary>
/// 箱标签
/// </summary>
[Display(Name = "箱标签")]
public string ToPackingCode { get; set; }
/// <summary> /// <summary>
/// 数量 /// 数量
/// </summary> /// </summary>
[Display(Name = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
/// <summary>
/// 数量
/// </summary>
[Display(Name = "订单数量")]
public decimal ShippedQty { get; set; }
/// <summary>
/// 供应商代码
/// </summary>
[Display(Name = "供应商代码")]
public string SupplierCode { get; set; }
/// <summary>
/// 批次
/// </summary>
[Display(Name = "批次")]
public string ToLot { get; set; }
/// <summary>
/// 生产时间
/// </summary>
[Display(Name = "生产时间")]
public DateTime ProduceDate { get; set; } = DateTime.Now;
/// <summary>
/// 发货单号
/// </summary>
[Display(Name = "发货单号")]
public string AsnNumber { get; set; }
/// <summary>
/// 发货时间
/// </summary>
public DateTime? ShipDate { get; set; }
/// <summary>
/// 筹措员
/// </summary>
public string PlanUserCode { get; set; }
[Display(Name = "备注")]
public string Remark { get; set; }
} }

2
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteExchangeDto.cs

@ -27,4 +27,6 @@ public class PutawayNoteExchangeDto
[Display(Name = "操作员")] [Display(Name = "操作员")]
public string Worker { get; set; } public string Worker { get; set; }
public PutawayNoteDetailExchangeDto Detail { get; set; } = new();
} }

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

@ -411,6 +411,16 @@
原因代码 原因代码
</summary> </summary>
</member> </member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.CountAdjustNote.CountAdjustNoteDetailExchangeDto.InventoryQty">
<summary>
库存数量
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.CountAdjustNote.CountAdjustNoteDetailExchangeDto.AdjustQty">
<summary>
调整数量
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.CountAdjustNote.CountAdjustNoteDetailExchangeDto.CountQty"> <member name="P:Win_in.Sfs.Wms.DataExchange.WMS.CountAdjustNote.CountAdjustNoteDetailExchangeDto.CountQty">
<summary> <summary>
盘点数量 盘点数量
@ -1116,11 +1126,51 @@
目标ERP库位 目标ERP库位
</summary> </summary>
</member> </member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.ToPackingCode">
<summary>
箱标签
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.Qty"> <member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.Qty">
<summary> <summary>
数量 数量
</summary> </summary>
</member> </member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.ShippedQty">
<summary>
数量
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.SupplierCode">
<summary>
供应商代码
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.ToLot">
<summary>
批次
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.ProduceDate">
<summary>
生产时间
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.AsnNumber">
<summary>
发货单号
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.ShipDate">
<summary>
发货时间
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteDetailExchangeDto.PlanUserCode">
<summary>
筹措员
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteExchangeDto.Number"> <member name="P:Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote.PutawayNoteExchangeDto.Number">
<summary> <summary>
上架单号 上架单号

1
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application/OutgoingFromWms/OutgoingFromWmsAutoMapperProfile.cs

@ -10,7 +10,6 @@ public class OutgoingFromWmsAutoMapperProfile : Profile
public OutgoingFromWmsAutoMapperProfile() public OutgoingFromWmsAutoMapperProfile()
{ {
CreateMap<OutgoingFromWms, OutgoingFromWmsDTO>() CreateMap<OutgoingFromWms, OutgoingFromWmsDTO>()
.IgnoreAuditedObjectProperties()
.ForMember(x => x.CreationTime, y => y.MapFrom(d => d.CreationTime)) .ForMember(x => x.CreationTime, y => y.MapFrom(d => d.CreationTime))
.ReverseMap(); .ReverseMap();

7
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs

@ -24,13 +24,14 @@ public enum EnumOutgoingDataType
ProductionReturn = 16, ProductionReturn = 16,
ProductReceipt = 17, ProductReceipt = 17,
Deliver = 18, Deliver = 18,
CountAdjust = 19, CountAdjust = 19,//盘点整单
CustomerReturn = 20, CustomerReturn = 20,
UnplannedIssue = 21, UnplannedIssue = 21,
RecycledMaterialReceipt = 22, RecycledMaterialReceipt = 22,
ScrapNote = 23, Scrap = 23,
ProductRecycle = 24, ProductRecycle = 24,
Item_Transform = 25 Item_Transform = 25,//线边仓调整单
WIPAdjust = 26//回收料调整单
} }
public enum EnumExchangeTableType public enum EnumExchangeTableType
{ {

1
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAutoMapperProfile.cs

@ -10,7 +10,6 @@ public partial class AuthApplicationAutoMapperProfile : Profile
private void DepartmentAutoMapperProfile() private void DepartmentAutoMapperProfile()
{ {
CreateMap<Department, DepartmentDTO>() CreateMap<Department, DepartmentDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<DepartmentCreateInput, Department>() CreateMap<DepartmentCreateInput, Department>()
.IgnoreAuditedObjectProperties() .IgnoreAuditedObjectProperties()

48
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/TokenService.cs

@ -1,9 +1,10 @@
using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Net.Http; using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks; using System.Threading.Tasks;
using IdentityModel.Client; using IdentityModel.Client;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -11,35 +12,31 @@ using Volo.Abp.Application.Services;
namespace Win_in.Sfs.Auth.Tokens; namespace Win_in.Sfs.Auth.Tokens;
[Route($"api/token")] [Route($"api")]
[Authorize]
public class TokenService : ApplicationService public class TokenService : ApplicationService
{ {
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IHttpClientFactory _httpClientFactory; private readonly IHttpClientFactory _httpClientFactory;
private readonly ILogger<TokenService> _logger; private readonly ILogger<TokenService> _logger;
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
public TokenService(IHttpContextAccessor httpContextAccessor, IHttpClientFactory httpClientFactory, IConfiguration configuration, ILogger<TokenService> logger)
public TokenService(IHttpClientFactory httpClientFactory, IConfiguration configuration, ILogger<TokenService> logger)
{ {
this._httpContextAccessor = httpContextAccessor;
this._httpClientFactory = httpClientFactory; this._httpClientFactory = httpClientFactory;
this._configuration = configuration; this._configuration = configuration;
this._logger = logger; this._logger = logger;
} }
[HttpPost] [HttpPost("token")]
[AllowAnonymous] [AllowAnonymous]
public async Task<IActionResult> CreateAsync(LoginModel model) public async Task<IActionResult> CreateAsync(LoginModel model)
{ {
var address = _configuration["AuthServer:Authority"]; var address = _configuration["AuthServer:Authority"];
var request = new DiscoveryDocumentRequest
{
Address = address,
Policy = new DiscoveryPolicy { RequireHttps = false }
};
var discovery = await _httpClientFactory.CreateClient().GetDiscoveryDocumentAsync(request).ConfigureAwait(false);
var clientId = _configuration["AuthServer:ClientId"]; var clientId = _configuration["AuthServer:ClientId"];
var clientSecret = _configuration["AuthServer:ClientSecret"]; var clientSecret = _configuration["AuthServer:ClientSecret"];
this._logger.LogInformation($"address:{address},TokenEndpoint:{discovery.TokenEndpoint},clientId:{clientId},clientSecret:{clientSecret}");
var result = await _httpClientFactory.CreateClient().RequestPasswordTokenAsync(new PasswordTokenRequest var result = await _httpClientFactory.CreateClient().RequestPasswordTokenAsync(new PasswordTokenRequest
{ {
Address = $"{address.TrimEnd('/')}/connect/token", Address = $"{address.TrimEnd('/')}/connect/token",
@ -49,11 +46,6 @@ public class TokenService : ApplicationService
UserName = model.UserName, UserName = model.UserName,
Password = model.Password Password = model.Password
}).ConfigureAwait(false); }).ConfigureAwait(false);
Console.WriteLine($"Result:${(result.IsError ? result.ErrorDescription : result.AccessToken)}");
//if (result.RefreshToken == null)
//{
// throw new UserFriendlyException("用户名或密码错误");
//}
return new JsonResult(new return new JsonResult(new
{ {
@ -72,18 +64,26 @@ public class TokenService : ApplicationService
}); });
} }
[HttpGet("[action]")] [HttpGet("token/application-configuration")]
[AllowAnonymous] public async Task<IActionResult> ApplicationConfiguration()
public string Test()
{ {
return "Test"; var address = _configuration["AuthServer:Authority"];
var url = $"{address.TrimEnd('/')}/api/abp/application-configuration";
var httpClient = _httpClientFactory.CreateClient();
var token = this._httpContextAccessor.HttpContext.Request.Headers.Authorization.ToString();
httpClient.DefaultRequestHeaders.Authorization = AuthenticationHeaderValue.Parse(token);
var response = await httpClient.GetAsync(url).ConfigureAwait(false);
var result = new ContentResult();
result.ContentType = "application/json";
result.Content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
return result;
} }
[HttpGet("/token/test")] [HttpGet("token/test")]
[AllowAnonymous] [AllowAnonymous]
public string Test1() public string Test()
{ {
return "Test"; return "test";
} }
} }

58
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/appsettings.json

@ -1,34 +1,34 @@
{ {
"ConfigServer": "http://localhost:21093", "ConfigServer": "http://localhost:21093",
"ConfigServer.Docker": "http://gateway:21093", "ConfigServer.Docker": "http://gateway:21093",
"ConnectionStrings": { //"ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,21195;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", // "Default": "Server=dev.ccwin-in.com,21195;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;",
"Auth": "Server=dev.ccwin-in.com,21195;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;" // "Auth": "Server=dev.ccwin-in.com,21195;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;"
}, //},
"SwaggerAuthServer": { //"SwaggerAuthServer": {
"Authority": "http://localhost:59093", // "Authority": "http://localhost:59093",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
}, //},
"IdentityServer": { //"IdentityServer": {
"Clients": { // "Clients": {
"Auth_Web": { // "Auth_Web": {
"ClientId": "Auth_Web", // "ClientId": "Auth_Web",
"RootUrl": "http://localhost:59093/", // "RootUrl": "http://localhost:59093/",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
}, // },
"Auth_App": { // "Auth_App": {
"ClientId": "Auth_App", // "ClientId": "Auth_App",
"ClientSecret": "1q2w3e*", // "ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093", // "RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
}, // },
"Auth_Swagger": { // "Auth_Swagger": {
"ClientId": "Auth_Swagger", // "ClientId": "Auth_Swagger",
"ClientSecret": "1q2w3e*", // "ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093", // "RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
} // }
} // }
} //}
} }

13
be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/BasedataHttpApiHostModule.cs

@ -67,14 +67,19 @@ public class BasedataHttpApiHostModule : ModuleBase<BasedataHttpApiHostModule>
{ {
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
//base.ConfigureServices(context);
//ConfigureAuditing();
////
//ConfigureBlobStoring();
//Configure<AbpClockOptions>(options =>
//{
// options.Kind = DateTimeKind.Local;
//});
base.ConfigureServices(context); base.ConfigureServices(context);
ConfigureAuditing(); ConfigureAuditing();
// //
ConfigureBlobStoring(); ConfigureBlobStoring();
Configure<AbpClockOptions>(options =>
{
options.Kind = DateTimeKind.Local;
});
} }
public override void PostConfigureServices(ServiceConfigurationContext context) public override void PostConfigureServices(ServiceConfigurationContext context)

58
be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/appsettings.json

@ -1,34 +1,34 @@
{ {
"ConfigServer": "http://localhost:21093", "ConfigServer": "http://localhost:21093",
"ConfigServer.Docker": "http://gateway:21093", "ConfigServer.Docker": "http://gateway:21093",
"ConnectionStrings": { //"ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", // "Default": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;",
"Auth": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;" // "Auth": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;"
}, //},
"SwaggerAuthServer": { //"SwaggerAuthServer": {
"Authority": "http://localhost:59093", // "Authority": "http://localhost:59093",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
}, //},
"IdentityServer": { //"IdentityServer": {
"Clients": { // "Clients": {
"Auth_Web": { // "Auth_Web": {
"ClientId": "Auth_Web", // "ClientId": "Auth_Web",
"RootUrl": "http://localhost:59093/", // "RootUrl": "http://localhost:59093/",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
}, // },
"Auth_App": { // "Auth_App": {
"ClientId": "Auth_App", // "ClientId": "Auth_App",
"ClientSecret": "1q2w3e*", // "ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093", // "RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
}, // },
"Auth_Swagger": { // "Auth_Swagger": {
"ClientId": "Auth_Swagger", // "ClientId": "Auth_Swagger",
"ClientSecret": "1q2w3e*", // "ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093", // "RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
} // }
} // }
} //}
} }

4
be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Win_in.Sfs.Wms.Dashboard.Host.csproj

@ -48,8 +48,8 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> <!--<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if $(ConfigurationName) == Release (powershell Compress-Archive -Path '$(TargetDir)Win_in*.dll','$(TargetDir)Win_in*.pdb' -DestinationPath '$(SolutionDir)Output\DashboardHost.zip' -Force)" /> <Exec Command="if $(ConfigurationName) == Release (powershell Compress-Archive -Path '$(TargetDir)Win_in*.dll','$(TargetDir)Win_in*.pdb' -DestinationPath '$(SolutionDir)Output\DashboardHost.zip' -Force)" />
</Target> </Target>-->
</Project> </Project>

58
be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/appsettings.json

@ -1,34 +1,34 @@
{ {
"ConfigServer": "http://localhost:21093", "ConfigServer": "http://localhost:21093",
"ConfigServer.Docker": "http://gateway:21093", "ConfigServer.Docker": "http://gateway:21093",
"ConnectionStrings": { //"ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", // "Default": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;",
"Auth": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;" // "Auth": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;"
}, //},
"SwaggerAuthServer": { //"SwaggerAuthServer": {
"Authority": "http://localhost:59093", // "Authority": "http://localhost:59093",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
}, //},
"IdentityServer": { //"IdentityServer": {
"Clients": { // "Clients": {
"Auth_Web": { // "Auth_Web": {
"ClientId": "Auth_Web", // "ClientId": "Auth_Web",
"RootUrl": "http://localhost:59093/", // "RootUrl": "http://localhost:59093/",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
}, // },
"Auth_App": { // "Auth_App": {
"ClientId": "Auth_App", // "ClientId": "Auth_App",
"ClientSecret": "1q2w3e*", // "ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093", // "RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
}, // },
"Auth_Swagger": { // "Auth_Swagger": {
"ClientId": "Auth_Swagger", // "ClientId": "Auth_Swagger",
"ClientSecret": "1q2w3e*", // "ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093", // "RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false" // "RequireHttpsMetadata": "false"
} // }
} // }
} //}
} }

37
be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql

@ -2529,6 +2529,9 @@ CREATE TABLE [Job_PutawayJobDetail] (
CREATE TABLE [Job_UnplannedIssueJobDetail] ( CREATE TABLE [Job_UnplannedIssueJobDetail] (
[Id] uniqueidentifier NOT NULL, [Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL, [ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL, [CreatorId] uniqueidentifier NULL,
@ -2579,6 +2582,9 @@ CREATE TABLE [Job_UnplannedIssueJobDetail] (
CREATE TABLE [Job_UnplannedReceiptJobDetail] ( CREATE TABLE [Job_UnplannedReceiptJobDetail] (
[Id] uniqueidentifier NOT NULL, [Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL, [ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL, [CreatorId] uniqueidentifier NULL,
@ -2957,6 +2963,7 @@ CREATE TABLE [Store_DeliverNoteDetail] (
[ItemDesc1] nvarchar(64) NULL, [ItemDesc1] nvarchar(64) NULL,
[ItemDesc2] nvarchar(64) NULL, [ItemDesc2] nvarchar(64) NULL,
[ItemCode] nvarchar(64) NOT NULL, [ItemCode] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL, [Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[FromPackingCode] nvarchar(64) NOT NULL, [FromPackingCode] nvarchar(64) NOT NULL,
@ -2993,7 +3000,6 @@ CREATE TABLE [Store_DeliverNoteDetail] (
[RecommendFromLocationGroup] nvarchar(64) NULL, [RecommendFromLocationGroup] nvarchar(64) NULL,
[RecommendFromLocationErpCode] nvarchar(64) NULL, [RecommendFromLocationErpCode] nvarchar(64) NULL,
[RecommendFromWarehouseCode] nvarchar(64) NULL, [RecommendFromWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL, [HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL,
@ -3411,6 +3417,7 @@ CREATE TABLE [Store_IssueNoteDetail] (
[ItemDesc1] nvarchar(64) NULL, [ItemDesc1] nvarchar(64) NULL,
[ItemDesc2] nvarchar(64) NULL, [ItemDesc2] nvarchar(64) NULL,
[ItemCode] nvarchar(64) NOT NULL, [ItemCode] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL, [Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[FromPackingCode] nvarchar(450) NULL, [FromPackingCode] nvarchar(450) NULL,
@ -3447,7 +3454,6 @@ CREATE TABLE [Store_IssueNoteDetail] (
[RecommendFromLocationGroup] nvarchar(64) NULL, [RecommendFromLocationGroup] nvarchar(64) NULL,
[RecommendFromLocationErpCode] nvarchar(64) NULL, [RecommendFromLocationErpCode] nvarchar(64) NULL,
[RecommendFromWarehouseCode] nvarchar(64) NULL, [RecommendFromWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL, [HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL,
@ -3855,6 +3861,7 @@ CREATE TABLE [Store_ProductionReturnNoteDetail] (
[ItemDesc1] nvarchar(64) NULL, [ItemDesc1] nvarchar(64) NULL,
[ItemDesc2] nvarchar(64) NULL, [ItemDesc2] nvarchar(64) NULL,
[ItemCode] nvarchar(64) NOT NULL, [ItemCode] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL, [Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[FromPackingCode] nvarchar(450) NULL, [FromPackingCode] nvarchar(450) NULL,
@ -3891,7 +3898,6 @@ CREATE TABLE [Store_ProductionReturnNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL, [HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL,
@ -4021,6 +4027,7 @@ CREATE TABLE [Store_ProductReceiptNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL, [LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL, [Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL, [RecommendContainerCode] nvarchar(64) NULL,
@ -4035,7 +4042,6 @@ CREATE TABLE [Store_ProductReceiptNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL, [HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL,
@ -4279,6 +4285,7 @@ CREATE TABLE [Store_PurchaseReceiptNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL, [LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL, [Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL, [RecommendContainerCode] nvarchar(64) NULL,
@ -4293,7 +4300,6 @@ CREATE TABLE [Store_PurchaseReceiptNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL, [HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL,
@ -4378,6 +4384,7 @@ CREATE TABLE [Store_PurchaseReturnNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL, [LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL, [Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL, [RecommendContainerCode] nvarchar(64) NULL,
@ -4392,7 +4399,6 @@ CREATE TABLE [Store_PurchaseReturnNoteDetail] (
[RecommendFromLocationGroup] nvarchar(64) NULL, [RecommendFromLocationGroup] nvarchar(64) NULL,
[RecommendFromLocationErpCode] nvarchar(64) NULL, [RecommendFromLocationErpCode] nvarchar(64) NULL,
[RecommendFromWarehouseCode] nvarchar(64) NULL, [RecommendFromWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL, [HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL,
@ -4466,6 +4472,7 @@ CREATE TABLE [Store_PutawayNoteDetail] (
[ItemDesc1] nvarchar(64) NULL, [ItemDesc1] nvarchar(64) NULL,
[ItemDesc2] nvarchar(64) NULL, [ItemDesc2] nvarchar(64) NULL,
[ItemCode] nvarchar(64) NOT NULL, [ItemCode] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL, [Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[FromPackingCode] nvarchar(450) NULL, [FromPackingCode] nvarchar(450) NULL,
@ -4502,7 +4509,6 @@ CREATE TABLE [Store_PutawayNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL, [HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL,
@ -4875,6 +4881,9 @@ CREATE TABLE [Store_TransferRequestDetail] (
CREATE TABLE [Store_UnplannedIssueNoteDetail] ( CREATE TABLE [Store_UnplannedIssueNoteDetail] (
[Id] uniqueidentifier NOT NULL, [Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL, [ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL, [CreatorId] uniqueidentifier NULL,
@ -4901,6 +4910,7 @@ CREATE TABLE [Store_UnplannedIssueNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL, [LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL, [Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL, [RecommendContainerCode] nvarchar(64) NULL,
@ -4915,7 +4925,6 @@ CREATE TABLE [Store_UnplannedIssueNoteDetail] (
[RecommendFromLocationGroup] nvarchar(64) NULL, [RecommendFromLocationGroup] nvarchar(64) NULL,
[RecommendFromLocationErpCode] nvarchar(64) NULL, [RecommendFromLocationErpCode] nvarchar(64) NULL,
[RecommendFromWarehouseCode] nvarchar(64) NULL, [RecommendFromWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL, [HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL,
@ -4937,6 +4946,9 @@ CREATE TABLE [Store_UnplannedIssueNoteDetail] (
CREATE TABLE [Store_UnplannedIssueRequestDetail] ( CREATE TABLE [Store_UnplannedIssueRequestDetail] (
[Id] uniqueidentifier NOT NULL, [Id] uniqueidentifier NOT NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL, [CreatorId] uniqueidentifier NULL,
@ -4974,6 +4986,9 @@ CREATE TABLE [Store_UnplannedIssueRequestDetail] (
CREATE TABLE [Store_UnplannedReceiptNoteDetail] ( CREATE TABLE [Store_UnplannedReceiptNoteDetail] (
[Id] uniqueidentifier NOT NULL, [Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL, [ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL, [CreatorId] uniqueidentifier NULL,
@ -5000,6 +5015,7 @@ CREATE TABLE [Store_UnplannedReceiptNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL, [LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL, [Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL, [RecommendContainerCode] nvarchar(64) NULL,
@ -5014,7 +5030,6 @@ CREATE TABLE [Store_UnplannedReceiptNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL, [HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL,
@ -5036,6 +5051,10 @@ CREATE TABLE [Store_UnplannedReceiptNoteDetail] (
CREATE TABLE [Store_UnplannedReceiptRequestDetail] ( CREATE TABLE [Store_UnplannedReceiptRequestDetail] (
[Id] uniqueidentifier NOT NULL, [Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL, [CreatorId] uniqueidentifier NULL,

11
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/BaseDatas/DictController.cs

@ -1,6 +1,9 @@
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Json;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.BaseDatas; namespace Win_in.Sfs.Wms.Pda.Controllers.BaseDatas;
@ -18,9 +21,11 @@ public class DictController : AbpController
/// ///
/// </summary> /// </summary>
/// <param name="dictApp"></param> /// <param name="dictApp"></param>
public DictController(IDictAppService dictApp) public DictController(IDictAppService dictApp,IOptions<AbpJsonOptions> options)
{ {
_dictApp = dictApp; _dictApp = dictApp;
var str = options.Value.DefaultDateTimeFormat;
Console.WriteLine(str);
} }
/// <summary> /// <summary>
@ -31,6 +36,8 @@ public class DictController : AbpController
[HttpGet("by-code")] [HttpGet("by-code")]
public virtual async Task<DictDTO> GetByCodeAsync(string code) public virtual async Task<DictDTO> GetByCodeAsync(string code)
{ {
return await _dictApp.GetByCodeAsync(code).ConfigureAwait(false); var dtos = await _dictApp.GetByCodeAsync(code).ConfigureAwait(false);
return dtos;
} }
} }

22
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text.Json; using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@ -70,13 +72,13 @@ public class JobController : AbpController
/// 获取全部任务数量统计 /// 获取全部任务数量统计
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet("")] [HttpGet("get-job-count/{isToday}")]
public virtual async Task<ListResultDto<JobCountDto>> CountAsync() public virtual async Task<ListResultDto<JobCountDto>> CountAsync(Guid userId ,bool isToday)
{ {
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetUserWorkGroupAsync(userId).ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes.Select(p=>p.WorkGroupCode));
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; var status = new List<EnumJobStatus>() { EnumJobStatus.Open,EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var list = new List<JobCountDto>(); var list = new List<JobCountDto>();
@ -146,7 +148,7 @@ public class JobController : AbpController
}).ConfigureAwait(false); }).ConfigureAwait(false);
list.Add(new JobCountDto { JobType = EnumJobType.ProductReceiveJob, Count = productReceiveJobs }); list.Add(new JobCountDto { JobType = EnumJobType.ProductReceiveJob, Count = productReceiveJobs });
var purchaseReceiptJobs = await _purchaseReceiptJobAppService.GetCountByFilterAsync(new SfsJobRequestInputBase var purchaseReceiptJobRequest = new SfsJobRequestInputBase
{ {
Condition = new Condition Condition = new Condition
{ {
@ -156,7 +158,13 @@ public class JobController : AbpController
new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In") new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In")
} }
} }
}).ConfigureAwait(false); };
if (isToday)//只看当日
{
purchaseReceiptJobRequest.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.ToString("yyyy-MM-dd"), ">=", "And"));
purchaseReceiptJobRequest.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.AddDays(1).ToString("yyyy-MM-dd"), "<=", "And"));
}
var purchaseReceiptJobs = await _purchaseReceiptJobAppService.GetCountByFilterAsync(purchaseReceiptJobRequest).ConfigureAwait(false);
list.Add(new JobCountDto { JobType = EnumJobType.PurchaseReceiptJob, Count = purchaseReceiptJobs }); list.Add(new JobCountDto { JobType = EnumJobType.PurchaseReceiptJob, Count = purchaseReceiptJobs });
var purchaseReturnJobs = await _purchaseReturnJobAppService.GetCountByFilterAsync(new SfsJobRequestInputBase var purchaseReturnJobs = await _purchaseReturnJobAppService.GetCountByFilterAsync(new SfsJobRequestInputBase

2
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAutoMapperProfile.cs

@ -13,7 +13,7 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
; ;
CreateMap<DictItem, DictItemDTO>() CreateMap<DictItem, DictItemDTO>()
.IgnoreAuditedObjectProperties(); ;
CreateMap<DictImportInput, Dict>() CreateMap<DictImportInput, Dict>()
.IgnoreAuditedObjectProperties() .IgnoreAuditedObjectProperties()

1
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs

@ -275,6 +275,7 @@ public class BalanceAppService
dto.ItemName = item.Name; dto.ItemName = item.Name;
dto.ItemDesc1 = item.Desc1; dto.ItemDesc1 = item.Desc1;
dto.ItemDesc2 = item.Desc2; dto.ItemDesc2 = item.Desc2;
dto.Uom = item.BasicUom;
} }
return dtos; return dtos;
} }

3
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Containers/ContainerAutoMapperProfile.cs

@ -12,7 +12,8 @@ public partial class InventoryApplicationAutoMapperProfile : Profile
CreateMap<Container, ContainerDTO>() CreateMap<Container, ContainerDTO>()
.ReverseMap(); .ReverseMap();
CreateMap<ContainerDetail, ContainerDetailDTO>().IgnoreAuditedObjectProperties(); CreateMap<ContainerDetail, ContainerDetailDTO>()
;
CreateMap<ContainerDetailInput, ContainerDetail>() CreateMap<ContainerDetailInput, ContainerDetail>()
.IgnoreAuditedObjectProperties() .IgnoreAuditedObjectProperties()

19
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs

@ -105,6 +105,15 @@ public class BalanceManager : DomainService, IBalanceManager
} }
else else
{ {
if (existBalance.IsActive == false)
{
throw new UserFriendlyException($"库位在{existBalance.LocationCode}," +
$"物品编号为{existBalance.ItemCode}," +
$"箱码为{existBalance.PackingCode}," +
$"批次为{existBalance.Lot}," +
$"状态为{existBalance.Status.GetDisplayName()}" +
$"的库存是不可用状态");
}
//如果单件管理的库存已存在,报错 //如果单件管理的库存已存在,报错
transaction.CheckSingleUnitHasExist(); transaction.CheckSingleUnitHasExist();
existBalance.IncreaseQty(transaction.Qty); existBalance.IncreaseQty(transaction.Qty);
@ -202,6 +211,16 @@ public class BalanceManager : DomainService, IBalanceManager
} }
else else
{ {
if (existBalance.IsActive == false)
{
throw new UserFriendlyException($"库位在{existBalance.LocationCode}," +
$"物品编号为{existBalance.ItemCode}," +
$"箱码为{existBalance.PackingCode}," +
$"批次为{existBalance.Lot}," +
$"状态为{existBalance.Status}" +
$"的库存是不可用状态");
}
existBalance.IncreaseQty(transaction.Qty); existBalance.IncreaseQty(transaction.Qty);
switch (existBalance.Qty) switch (existBalance.Qty)
{ {

15
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/TransactionManager.cs

@ -18,7 +18,8 @@ public class TransactionManager : DomainService, ITransactionManager
private readonly IBalanceManager _balanceManager; private readonly IBalanceManager _balanceManager;
private readonly IItemBasicAclService _itemBasicAclService; private readonly IItemBasicAclService _itemBasicAclService;
private readonly ILocationAclService _locationAclService; private readonly ILocationAclService _locationAclService;
private readonly ITransactionTypeAclService _transactionTypeAclService; //private readonly ITransactionTypeAclService _transactionTypeAclService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
private readonly ITransactionRepository _transactionRepository; private readonly ITransactionRepository _transactionRepository;
private readonly IBalanceRepository _balanceRepository; private readonly IBalanceRepository _balanceRepository;
private readonly ISnowflakeIdGenerator _numberGenerator; private readonly ISnowflakeIdGenerator _numberGenerator;
@ -28,20 +29,22 @@ public class TransactionManager : DomainService, ITransactionManager
IBalanceManager balanceManager IBalanceManager balanceManager
, IItemBasicAclService itemBasicAclService , IItemBasicAclService itemBasicAclService
, ILocationAclService locationAclService , ILocationAclService locationAclService
, ITransactionTypeAclService transactionTypeAclService //, ITransactionTypeAclService transactionTypeAclService
, ITransactionRepository transactionRepository , ITransactionRepository transactionRepository
, IBalanceRepository balanceRepository , IBalanceRepository balanceRepository
, ISnowflakeIdGenerator numberGenerator , ISnowflakeIdGenerator numberGenerator
, ILocationCapacityManager locationCapacityManager) , ILocationCapacityManager locationCapacityManager
, ITransactionTypeAppService transactionTypeAppService)
{ {
_balanceManager = balanceManager; _balanceManager = balanceManager;
_itemBasicAclService = itemBasicAclService; _itemBasicAclService = itemBasicAclService;
_locationAclService = locationAclService; _locationAclService = locationAclService;
_transactionTypeAclService = transactionTypeAclService; //_transactionTypeAclService = transactionTypeAclService;
_transactionRepository = transactionRepository; _transactionRepository = transactionRepository;
_balanceRepository = balanceRepository; _balanceRepository = balanceRepository;
_numberGenerator = numberGenerator; _numberGenerator = numberGenerator;
_locationCapacityManager = locationCapacityManager; _locationCapacityManager = locationCapacityManager;
_transactionTypeAppService = transactionTypeAppService;
} }
public virtual async Task<string> AddAsync(Transaction transaction) public virtual async Task<string> AddAsync(Transaction transaction)
@ -96,7 +99,7 @@ public class TransactionManager : DomainService, ITransactionManager
var item = await _itemBasicAclService.GetByCodeAsync(transaction.ItemCode).ConfigureAwait(false); var item = await _itemBasicAclService.GetByCodeAsync(transaction.ItemCode).ConfigureAwait(false);
var location = await _locationAclService.GetByCodeAsync(transaction.LocationCode).ConfigureAwait(false); var location = await _locationAclService.GetByCodeAsync(transaction.LocationCode).ConfigureAwait(false);
var transactionType = await _transactionTypeAclService.GetByTransTypeAsync(transaction.TransType, transaction.TransSubType).ConfigureAwait(false); var transactionType = await _transactionTypeAppService.GetByTransTypeAsync(transaction.TransType, transaction.TransSubType).ConfigureAwait(false);
transaction.CheckTransactionType(transactionType, item, location); transaction.CheckTransactionType(transactionType, item, location);
//执行库存余额的变动 //执行库存余额的变动
@ -158,7 +161,7 @@ public class TransactionManager : DomainService, ITransactionManager
//库位注意大小写 //库位注意大小写
var location = locations.FirstOrDefault(p => p.Code.ToUpper() == transaction.LocationCode.ToUpper()); var location = locations.FirstOrDefault(p => p.Code.ToUpper() == transaction.LocationCode.ToUpper());
var transactionType = await _transactionTypeAclService.GetByTransTypeAsync(transaction.TransType, transaction.TransSubType).ConfigureAwait(false); var transactionType = await _transactionTypeAppService.GetByTransTypeAsync(transaction.TransType, transaction.TransSubType).ConfigureAwait(false);
transaction.CheckTransactionType(transactionType, item, location); transaction.CheckTransactionType(transactionType, item, location);
await UpdateBalanceAsync(transaction, item, location).ConfigureAwait(false); await UpdateBalanceAsync(transaction, item, location).ConfigureAwait(false);

1
be/Modules/Label/src/Win_in.Sfs.Label.Application/CountLabels/CountLabelAutoMapperProfile.cs

@ -10,7 +10,6 @@ public class CountLabelAutoMapperProfile : Profile
public CountLabelAutoMapperProfile() public CountLabelAutoMapperProfile()
{ {
CreateMap<CountLabel, CountLabelDto>() CreateMap<CountLabel, CountLabelDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<CountLabel, CountLabelEditInput>(); CreateMap<CountLabel, CountLabelEditInput>();

1
be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletCode/PalletCodeAutoMapperProfile.cs

@ -10,7 +10,6 @@ public class PalletCodeAutoMapperProfile : Profile
public PalletCodeAutoMapperProfile() public PalletCodeAutoMapperProfile()
{ {
CreateMap<PalletCode, PalletCodeDto>() CreateMap<PalletCode, PalletCodeDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<PalletCode, PalletCodeEditInput>(); CreateMap<PalletCode, PalletCodeEditInput>();

1
be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletLabels/PalletLabelAutoMapperProfile.cs

@ -10,7 +10,6 @@ public class PalletLabelAutoMapperProfile : Profile
public PalletLabelAutoMapperProfile() public PalletLabelAutoMapperProfile()
{ {
CreateMap<PalletLabel, PalletLabelDto>() CreateMap<PalletLabel, PalletLabelDto>()
.IgnoreAuditedObjectProperties()
.ForMember(x => x.ItemName, y => y.MapFrom(d => d.Name)) .ForMember(x => x.ItemName, y => y.MapFrom(d => d.Name))
.ForMember(x => x.ItemDesc1, y => y.MapFrom(d => d.Desc1)) .ForMember(x => x.ItemDesc1, y => y.MapFrom(d => d.Desc1))
.ForMember(x => x.ItemDesc2, y => y.MapFrom(d => d.Desc2)) .ForMember(x => x.ItemDesc2, y => y.MapFrom(d => d.Desc2))

1
be/Modules/Label/src/Win_in.Sfs.Label.Application/SaleLabels/SaleLabelAutoMapperProfile.cs

@ -10,7 +10,6 @@ public class SaleLabelAutoMapperProfile : Profile
public SaleLabelAutoMapperProfile() public SaleLabelAutoMapperProfile()
{ {
CreateMap<SaleLabel, SaleLabelDto>() CreateMap<SaleLabel, SaleLabelDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
} }
} }

1
be/Modules/Label/src/Win_in.Sfs.Label.Application/SerialCode/SerialCodeAutoMapperProfile.cs

@ -10,7 +10,6 @@ public class SerialCodeAutoMapperProfile : Profile
public SerialCodeAutoMapperProfile() public SerialCodeAutoMapperProfile()
{ {
CreateMap<SerialCode, SerialCodeDto>() CreateMap<SerialCode, SerialCodeDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<SerialCode, SerialCodeEditInput>(); CreateMap<SerialCode, SerialCodeEditInput>();

1
be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs

@ -10,7 +10,6 @@ public partial class MessageApplicationAutoMapperProfile : Profile
public void MessageTypeSubscribesAutoMapperProfile() public void MessageTypeSubscribesAutoMapperProfile()
{ {
CreateMap<MessageTypeSubscribe, MessageTypeSubscribeDto>() CreateMap<MessageTypeSubscribe, MessageTypeSubscribeDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<MessageTypeSubscribeEditInput, MessageTypeSubscribe>() CreateMap<MessageTypeSubscribeEditInput, MessageTypeSubscribe>()

1
be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs

@ -10,7 +10,6 @@ public partial class MessageApplicationAutoMapperProfile : Profile
public void MessageTypeAutoMapperProfile() public void MessageTypeAutoMapperProfile()
{ {
CreateMap<MessageType, MessageTypeDto>() CreateMap<MessageType, MessageTypeDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
} }
} }

1
be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs

@ -11,7 +11,6 @@ public partial class MessageApplicationAutoMapperProfile : Profile
public void NotifyMessageAutoMapperProfileConfig() public void NotifyMessageAutoMapperProfileConfig()
{ {
CreateMap<NotifyMessage, NotifyMessageDto>() CreateMap<NotifyMessage, NotifyMessageDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<NotifyMessageETO, NotifyMessageDto>() CreateMap<NotifyMessageETO, NotifyMessageDto>()

1
be/Modules/Message/src/Win_in.Sfs.Message.Application/PrivateMessages/PrivateMessageAutoMapperProfile.cs

@ -10,7 +10,6 @@ public class PrivateMessageAutoMapperProfile : Profile
public PrivateMessageAutoMapperProfile() public PrivateMessageAutoMapperProfile()
{ {
CreateMap<PrivateMessage, PrivateMessageDto>() CreateMap<PrivateMessage, PrivateMessageDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
} }
} }

1
be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs

@ -11,7 +11,6 @@ public partial class MessageApplicationAutoMapperProfile : Profile
public void UserNotifyAutoMapperProfile() public void UserNotifyAutoMapperProfile()
{ {
CreateMap<UserNotifyMessage, UserNotifyMessageDto>() CreateMap<UserNotifyMessage, UserNotifyMessageDto>()
.IgnoreAuditedObjectProperties()
.BeforeMap((x, y) => y.UserId = x.CreatorId==null?Guid.Empty: x.CreatorId.Value) .BeforeMap((x, y) => y.UserId = x.CreatorId==null?Guid.Empty: x.CreatorId.Value)
.ReverseMap(); .ReverseMap();

5
be/Modules/Shared/src/Win_in.Sfs.Shared.Application/CachingExtensions.cs

@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Caching.Distributed;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.Json;
namespace Win_in.Sfs.Shared.Application; namespace Win_in.Sfs.Shared.Application;
@ -27,6 +28,10 @@ public static class CachingExtensions
{ {
TCacheItem cacheItem; TCacheItem cacheItem;
//return await factory.Invoke().ConfigureAwait(false);
//todo 有问题 时间转换 坑坑坑
var result = await cache.GetAsync(key).ConfigureAwait(false); var result = await cache.GetAsync(key).ConfigureAwait(false);
if (result == null) if (result == null)
{ {

8
be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs

@ -159,8 +159,12 @@ public abstract class SfsCrudWithDetailsAppServiceBase<TEntity, TEntityDto, TReq
var entities = await _repository.GetPagedListAsync(expression, input.SkipCount, input.MaxResultCount, var entities = await _repository.GetPagedListAsync(expression, input.SkipCount, input.MaxResultCount,
input.Sorting, true).ConfigureAwait(false); input.Sorting, true).ConfigureAwait(false);
var list = ObjectMapper.Map<List<TEntity>, List<TEntityDto>>(entities); var list = ObjectMapper.Map<List<TEntity>, List<TEntityDto>>(entities);
var hasDetails = typeof(TEntity) is SfsMasterAggregateRootBase<TDetail> detailEntity;
return ExportImportService.Export(list, detailsProptyName: hasDetails ? nameof(detailEntity.Details) : null); //var hasDetails = typeof(TEntity) is SfsMasterAggregateRootBase<TDetail> detailEntity;
var tt = typeof(TEntity).GetBaseClasses(typeof(SfsMasterAggregateRootBase<TDetail>));
var hasDetails = tt.Length > 0 ? true : false;
return ExportImportService.Export(list,detailsProptyName: hasDetails ? nameof(TDetail) : null);
} }
/// <summary> /// <summary>

9
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs

@ -1,3 +1,6 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Shared.Domain.Shared;
public enum EnumJobStatus public enum EnumJobStatus
@ -5,30 +8,36 @@ public enum EnumJobStatus
/// <summary> /// <summary>
/// 空枚举 /// 空枚举
/// </summary> /// </summary>
[Display(Name = "空枚举")]
None = 0, None = 0,
/// <summary> /// <summary>
/// 待处理 /// 待处理
/// </summary> /// </summary>
[Display(Name = "待处理")]
Open = 1, Open = 1,
/// <summary> /// <summary>
/// 执行中 /// 执行中
/// </summary> /// </summary>
[Display(Name = "执行中")]
Doing = 2, Doing = 2,
/// <summary> /// <summary>
/// 完成 /// 完成
/// </summary> /// </summary>
[Display(Name = "完成")]
Done = 3, Done = 3,
/// <summary> /// <summary>
/// 关闭 /// 关闭
/// </summary> /// </summary>
[Display(Name = "关闭")]
Closed = 8, Closed = 8,
/// <summary> /// <summary>
/// 作废 /// 作废
/// </summary> /// </summary>
[Display(Name = "作废")]
Cancelled = 9 Cancelled = 9
} }

3
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Entities/SfsMasterAggregateRootBase.cs

@ -67,7 +67,7 @@ public abstract class SfsMasterAggregateRootBase<TDetail> : SfsAggregateRootBase
Details.AddRange(details); Details.AddRange(details);
} }
public void ReplaceDetail(Guid id, TDetail newDetail) public void ReplaceDetail(Guid id,TDetail newDetail)
{ {
var detail = GetDetail(id); var detail = GetDetail(id);
@ -106,7 +106,6 @@ public abstract class SfsMasterAggregateRootBase<TDetail> : SfsAggregateRootBase
property.SetValue(detail, newValue); property.SetValue(detail, newValue);
} }
} }
/* /*
////todo check ////todo check
//var detail = GetDetail(id); //var detail = GetDetail(id);

44
be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs

@ -1,10 +1,15 @@
using System; using System;
using System.Configuration;
using System.Data; using System.Data;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Runtime.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using DocumentFormat.OpenXml.InkML;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
@ -20,6 +25,7 @@ using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using NUglify.Helpers; using NUglify.Helpers;
using Serilog.Formatting.Json;
using StackExchange.Redis; using StackExchange.Redis;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
using Volo.Abp; using Volo.Abp;
@ -35,8 +41,11 @@ using Volo.Abp.Content;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Guids; using Volo.Abp.Guids;
using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson.JsonConverters;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Timing;
using Win_in.Sfs.Shared.Application; using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport; using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
@ -70,6 +79,7 @@ public abstract class ModuleBase<T> : AbpModule where T : AbpModule
ConfigureAutoApiControllers(); ConfigureAutoApiControllers();
ConfigureSwaggerServices(); ConfigureSwaggerServices();
ConfigureAddCors(); ConfigureAddCors();
Configure();
SetFormLimit(); SetFormLimit();
ConfigureExceptionHanding(); ConfigureExceptionHanding();
} }
@ -238,6 +248,9 @@ public abstract class ModuleBase<T> : AbpModule where T : AbpModule
protected virtual void Configure() protected virtual void Configure()
{ {
//todo 解决时间
// ServiceConfigurationContext.Services.AddTransient<IJsonSerializer,ConvertAbpJson>();
} }
protected virtual void ConfigureAddCors() protected virtual void ConfigureAddCors()
@ -440,4 +453,35 @@ public abstract class ModuleBase<T> : AbpModule where T : AbpModule
options.SendExceptionsDetailsToClients = true; options.SendExceptionsDetailsToClients = true;
}); });
} }
/// <summary>
/// 为了处理abp的时间存入redis 在win环境读取出来报错
/// </summary>
public class ConvertAbpJson : IJsonSerializer
{
public T Deserialize<T>(string jsonString, bool camelCase = true)
{
return System.Text.Json.JsonSerializer.Deserialize<T>(jsonString, GetOptions(camelCase));
}
public object Deserialize(Type type, string jsonString, bool camelCase = true)
{
return System.Text.Json.JsonSerializer.Deserialize(jsonString, type, GetOptions(camelCase));
}
public string Serialize(object obj, bool camelCase = true, bool indented = false)
{
return System.Text.Json.JsonSerializer.Serialize(obj, GetOptions(camelCase, indented));
}
private System.Text.Json.JsonSerializerOptions GetOptions(bool camelCase = true, bool indented = false)
{
return new System.Text.Json.JsonSerializerOptions
{
PropertyNameCaseInsensitive = camelCase,
WriteIndented = indented,
ReferenceHandler = ReferenceHandler.IgnoreCycles
};
}
}
} }

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/IIssueJobAppService.cs

@ -14,4 +14,6 @@ public interface IIssueJobAppService
Task<PagedResultDto<IssueJobDTO>> GetListByTypeAsync(SfsJobRequestInputBase requestInput, string requestType, Task<PagedResultDto<IssueJobDTO>> GetListByTypeAsync(SfsJobRequestInputBase requestInput, string requestType,
bool includeDetails = false, CancellationToken cancellationToken = default); bool includeDetails = false, CancellationToken cancellationToken = default);
Task<List<IssueJobDTO>> GetByRequestNumberAsync(string requestNumber);
} }

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/DTOs/UnplannedIssueJobDetailDTO.cs

@ -10,4 +10,22 @@ public class UnplannedIssueJobDetailDTO : SfsJobRecommendFromDetailDTOBase
[Display(Name = "原因代码")] [Display(Name = "原因代码")]
public string ReasonCode { get; set; } public string ReasonCode { get; set; }
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
} }

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/Inputs/UnplannedIssueJobDetailInput.cs

@ -11,6 +11,24 @@ public class UnplannedIssueJobDetailInput : SfsJobRecommendFromDetailInputBase,
[Display(Name = "原因代码")] [Display(Name = "原因代码")]
public string ReasonCode { get; set; } public string ReasonCode { get; set; }
//// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
/// <summary> /// <summary>
/// 扩展属性 /// 扩展属性
/// </summary> /// </summary>

32
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDetailDTO.cs

@ -1,6 +1,38 @@
using DocumentFormat.OpenXml.Wordprocessing;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Data;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class UnplannedReceiptJobDetailDTO : SfsJobRecommendToDetailDTOBase public class UnplannedReceiptJobDetailDTO : SfsJobRecommendToDetailDTOBase
{ {
/// <summary>
/// 原因代码
/// </summary>
[Display(Name = "原因代码")]
public string ReasonCode { get; set; }
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
/// <summary>
/// 扩展属性
/// </summary>
[Display(Name = "扩展属性")]
public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary();
} }

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/Inputs/UnplannedReceiptJobDetailInput.cs

@ -11,6 +11,24 @@ public class UnplannedReceiptJobDetailInput : SfsJobRecommendToDetailInputBase,
[Display(Name = "原因代码")] [Display(Name = "原因代码")]
public string ReasonCode { get; set; } public string ReasonCode { get; set; }
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
/// <summary> /// <summary>
/// 扩展属性 /// 扩展属性
/// </summary> /// </summary>

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/DTOs/UnplannedIssueNoteDetailDTO.cs

@ -17,4 +17,22 @@ public class UnplannedIssueNoteDetailDTO : SfsStoreRecommendFromDetailWithLotPac
[Display(Name = "原因代码")] [Display(Name = "原因代码")]
public string ReasonCode { get; set; } public string ReasonCode { get; set; }
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
} }

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/Inputs/UnplannedIssueNoteDetailInput.cs

@ -13,6 +13,24 @@ public class UnplannedIssueNoteDetailInput : SfsStoreRecommendFromDetailWithLotP
[Display(Name = "原因代码")] [Display(Name = "原因代码")]
public string ReasonCode { get; set; } public string ReasonCode { get; set; }
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
/// <summary> /// <summary>
/// 扩展属性 /// 扩展属性
/// </summary> /// </summary>

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/DTOs/UnplannedReceiptNoteDetailDTO.cs

@ -16,4 +16,22 @@ public class UnplannedReceiptNoteDetailDTO : SfsStoreRecommendToDetailWithLotPac
/// </summary> /// </summary>
[Display(Name = "原因代码")] [Display(Name = "原因代码")]
public string ReasonCode { get; set; } public string ReasonCode { get; set; }
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
} }

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/Inputs/UnplannedReceiptNoteDetailInput.cs

@ -11,6 +11,24 @@ public class UnplannedReceiptNoteDetailInput : SfsStoreRecommendToDetailWithLotP
[Display(Name = "原因代码")] [Display(Name = "原因代码")]
public string ReasonCode { get; set; } public string ReasonCode { get; set; }
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
/// <summary> /// <summary>
/// 扩展属性 /// 扩展属性
/// </summary> /// </summary>

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs

@ -29,7 +29,7 @@ public interface IPurchaseOrderAppService
/// <param name="number"></param> /// <param name="number"></param>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
Task UpdateDetailsAsync(string number, List<PurchaseOrderDetailUpdateInput> input); Task UpdateDetailsAsync(string number,List<PurchaseOrderDetailUpdateInput> input);
/// <summary> /// <summary>
/// 【批量创建】到货通知 (收货单) /// 【批量创建】到货通知 (收货单)

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs

@ -14,6 +14,8 @@ public class TransferRequestImportInput : SfsStoreImportInputBase
[Required(ErrorMessage = "{0}是必填项")] [Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "调拨类型")] [ImporterHeader(Name = "调拨类型")]
[ExporterHeader(DisplayName = "调拨类型")] [ExporterHeader(DisplayName = "调拨类型")]
[ValueMapping("区域间调拨(储位调拨)", EnumTransSubType.Transfer_Area)]
[ValueMapping("线边调拨(线边仓调拨)", EnumTransSubType.Transfer_WIP)]
[ValueMapping("客户库位调拨(客户储位调拨)", EnumTransSubType.Transfer_Customer)] [ValueMapping("客户库位调拨(客户储位调拨)", EnumTransSubType.Transfer_Customer)]
public string Type { get; set; } public string Type { get; set; }

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/DTOs/UnplannedIssueRequestDetailDTO.cs

@ -12,4 +12,22 @@ public class UnplannedIssueRequestDetailDTO
/// </summary> /// </summary>
[Display(Name = "扩展属性")] [Display(Name = "扩展属性")]
public ExtraPropertyDictionary ExtraProperties { set; get; } = new ExtraPropertyDictionary(); public ExtraPropertyDictionary ExtraProperties { set; get; } = new ExtraPropertyDictionary();
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
} }

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/Inputs/UnplannedIssueRequestDetailInput.cs

@ -10,4 +10,22 @@ public class UnplannedIssueRequestDetailInput : SfsStoreDetailWithLotPackingQtyL
/// </summary> /// </summary>
[Display(Name = "扩展属性")] [Display(Name = "扩展属性")]
public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary();
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
} }

24
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/DTOs/UnplannedReceiptRequestDetailDTO.cs

@ -7,6 +7,30 @@ public class UnplannedReceiptRequestDetailDTO
: SfsStoreDetailWithLotPackingQtyLocationStatusDTOBase : SfsStoreDetailWithLotPackingQtyLocationStatusDTOBase
, IHasExtraProperties , IHasExtraProperties
{ {
/// <summary>
/// 原因代码
/// </summary>
[Display(Name = "原因代码")]
public string ReasonCode { get; set; }
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
/// <summary> /// <summary>
/// 扩展属性 /// 扩展属性
/// </summary> /// </summary>

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/Inputs/UnplannedReceiptRequestDetailInput.cs

@ -5,6 +5,24 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class UnplannedReceiptRequestDetailInput : SfsStoreDetailWithLotPackingQtyLocationInputBase, IHasExtraProperties public class UnplannedReceiptRequestDetailInput : SfsStoreDetailWithLotPackingQtyLocationInputBase, IHasExtraProperties
{ {
/// <summary>
/// 专案
/// </summary>
[Display(Name = "专案")]
public string CaseCode { get; set; }
/// <summary>
/// 项目分类
/// </summary>
[Display(Name = "项目分类")]
public string ProjCapacityCode { get; set; }
/// <summary>
/// 次交易码
/// </summary>
[Display(Name = "次交易码")]
public string OnceBusiCode { get; set; }
/// <summary> /// <summary>
/// 扩展属性 /// 扩展属性
/// </summary> /// </summary>

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobAppServiceBase.cs

@ -11,6 +11,7 @@ using Volo.Abp.Validation;
using Win_in.Sfs.Shared.Application; using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
@ -153,6 +154,12 @@ public abstract class SfsJobAppServiceBase<TEntity, TDetail, TEntityDto, TReques
public virtual async Task<TEntityDto> CompleteAsync(Guid id, TEntityDto dto) public virtual async Task<TEntityDto> CompleteAsync(Guid id, TEntityDto dto)
{ {
var handleEntity = ObjectMapper.Map<TEntityDto, TEntity>(dto); var handleEntity = ObjectMapper.Map<TEntityDto, TEntity>(dto);
var job= await _repository.GetAsync(id).ConfigureAwait(false);
if (job.JobStatus is EnumJobStatus.Closed or EnumJobStatus.Cancelled or EnumJobStatus.None or EnumJobStatus.Done)//需要考虑下 多次提交的问题 所以不判断 进行中
{
throw new UserFriendlyException($"任务状态错误:编号为【{job.Number}】的任务已经【{job.JobStatus.GetDisplayName()}】");
}
var handleResult = await _jobManager.CompleteAsync(handleEntity, CurrentUser).ConfigureAwait(false); var handleResult = await _jobManager.CompleteAsync(handleEntity, CurrentUser).ConfigureAwait(false);
var handleDto = ObjectMapper.Map<TEntity, TEntityDto>(handleResult); var handleDto = ObjectMapper.Map<TEntity, TEntityDto>(handleResult);
return handleDto; return handleDto;

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/StoreApplicationAutoMapperProfile.cs

@ -10,7 +10,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
private void ExchangeDataAutoMapperProfile() private void ExchangeDataAutoMapperProfile()
{ {
CreateMap<ExchangeData, ExchangeDataDTO>() CreateMap<ExchangeData, ExchangeDataDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
// CreateMap<ExchangeDataCreateInput, ExchangeData>() // CreateMap<ExchangeDataCreateInput, ExchangeData>()
// .IgnoreAuditedObjectProperties() // .IgnoreAuditedObjectProperties()

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CheckJobs/CheckJobAutoMapperProfile.cs

@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.ReverseMap(); .ReverseMap();
CreateMap<CheckJobDetail, CheckJobDetailDTO>() CreateMap<CheckJobDetail, CheckJobDetailDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<CheckJobDetailInput, CheckJobDetail>() CreateMap<CheckJobDetailInput, CheckJobDetail>()

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAutoMapperProfile.cs

@ -73,11 +73,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.Details); .Ignore(x => x.Details);
CreateMap<CountJobDetail, CountJobDetailDTO>() CreateMap<CountJobDetail, CountJobDetailDTO>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<CountJobDetailDTO, CountJobDetail>() CreateMap<CountJobDetailDTO, CountJobDetail>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<CountJobDetailInput, CountJobDetail>() CreateMap<CountJobDetailInput, CountJobDetail>()

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs

@ -13,10 +13,10 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.ReverseMap(); .ReverseMap();
CreateMap<DeliverJobDetail, DeliverJobDetailDTO>() CreateMap<DeliverJobDetail, DeliverJobDetailDTO>()
.IgnoreAuditedObjectProperties(); ;
CreateMap<DeliverJobDetailDTO, DeliverJobDetail>() CreateMap<DeliverJobDetailDTO, DeliverJobDetail>()
.IgnoreAuditedObjectProperties(); ;
CreateMap<DeliverJobEditInput, DeliverJob>(); CreateMap<DeliverJobEditInput, DeliverJob>();

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAutoMapperProfile.cs

@ -16,11 +16,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile
; ;
CreateMap<InspectJobDetail, InspectJobDetailDTO>() CreateMap<InspectJobDetail, InspectJobDetailDTO>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<InspectJobDetailDTO, InspectJobDetail>() CreateMap<InspectJobDetailDTO, InspectJobDetail>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<InspectJobDetailInput, InspectJobDetail>() CreateMap<InspectJobDetailInput, InspectJobDetail>()
@ -31,11 +29,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.Id); .Ignore(x => x.Id);
CreateMap<InspectJobSummaryDetail, InspectJobSummaryDetailDTO>() CreateMap<InspectJobSummaryDetail, InspectJobSummaryDetailDTO>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<InspectJobSummaryDetailDTO, InspectJobSummaryDetail>() CreateMap<InspectJobSummaryDetailDTO, InspectJobSummaryDetail>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<InspectJobSummaryDetailInput, InspectJobSummaryDetail>() CreateMap<InspectJobSummaryDetailInput, InspectJobSummaryDetail>()
@ -47,7 +43,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
; ;
CreateMap<InspectRequestDTO, InspectJob>() CreateMap<InspectRequestDTO, InspectJob>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.WarehouseCode) .Ignore(x => x.WarehouseCode)
.Ignore(x => x.Details) .Ignore(x => x.Details)
.Ignore(x => x.SummaryDetails) .Ignore(x => x.SummaryDetails)

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs

@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -151,6 +152,13 @@ public class IssueJobAppService
} }
[HttpPost("by-request-number/{requestNumber}")]
public virtual async Task<List<IssueJobDTO>> GetByRequestNumberAsync(string requestNumber)
{
var entitys = await _repository.GetListAsync(p => p.MaterialRequestNumber == requestNumber).ConfigureAwait(false);
return ObjectMapper.Map<List<IssueJob>, List<IssueJobDTO>>(entitys);
}
/* /*
/// <summary> /// <summary>
/// ///

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAutoMapperProfile.cs

@ -14,11 +14,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile
CreateMap<IssueJobDTO, IssueJob>(); CreateMap<IssueJobDTO, IssueJob>();
CreateMap<IssueJobDetail, IssueJobDetailDTO>() CreateMap<IssueJobDetail, IssueJobDetailDTO>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<IssueJobDetailDTO, IssueJobDetail>() CreateMap<IssueJobDetailDTO, IssueJobDetail>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<IssueJobDetailInput, IssueJobDetail>() CreateMap<IssueJobDetailInput, IssueJobDetail>()

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/JisDeliverJobs/JisDeliverJobAutoMapperProfile.cs

@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.ReverseMap(); .ReverseMap();
CreateMap<JisDeliverJobDetail, JisDeliverJobDetailDTO>() CreateMap<JisDeliverJobDetail, JisDeliverJobDetailDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<JisDeliverJobDetailInput, JisDeliverJobDetail>() CreateMap<JisDeliverJobDetailInput, JisDeliverJobDetail>()

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductReceiveJobs/ProductReceiveJobAutoMapperProfile.cs

@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.ReverseMap(); .ReverseMap();
CreateMap<ProductReceiveJobDetail, ProductReceiveJobDetailDTO>() CreateMap<ProductReceiveJobDetail, ProductReceiveJobDetailDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<ProductReceiveJobDetailInput, ProductReceiveJobDetail>() CreateMap<ProductReceiveJobDetailInput, ProductReceiveJobDetail>()

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs

@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.ReverseMap(); .ReverseMap();
CreateMap<ProductionReturnJobDetail, ProductionReturnJobDetailDTO>() CreateMap<ProductionReturnJobDetail, ProductionReturnJobDetailDTO>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<ProductionReturnJobEditInput, ProductionReturnJob>(); CreateMap<ProductionReturnJobEditInput, ProductionReturnJob>();
@ -26,7 +25,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.Id); .Ignore(x => x.Id);
CreateMap<ProductionReturnJobDetailDTO, ProductionReturnJobDetail>() CreateMap<ProductionReturnJobDetailDTO, ProductionReturnJobDetail>()
.IgnoreAuditedObjectProperties()
; ;
} }

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAutoMapperProfile.cs

@ -16,11 +16,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile
; ;
CreateMap<PurchaseReceiptJobDetail, PurchaseReceiptJobDetailDTO>() CreateMap<PurchaseReceiptJobDetail, PurchaseReceiptJobDetailDTO>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<PurchaseReceiptJobDetailDTO, PurchaseReceiptJobDetail>() CreateMap<PurchaseReceiptJobDetailDTO, PurchaseReceiptJobDetail>()
.IgnoreAuditedObjectProperties()
; ;
CreateMap<PurchaseReceiptJobDetailInput, PurchaseReceiptJobDetail>() CreateMap<PurchaseReceiptJobDetailInput, PurchaseReceiptJobDetail>()

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReturnJobs/PurchaseReturnJobAutoMapperProfile.cs

@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.ReverseMap(); .ReverseMap();
CreateMap<PurchaseReturnJobDetail, PurchaseReturnJobDetailDTO>() CreateMap<PurchaseReturnJobDetail, PurchaseReturnJobDetailDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<PurchaseReturnJobDetailInput, PurchaseReturnJobDetail>() CreateMap<PurchaseReturnJobDetailInput, PurchaseReturnJobDetail>()

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save