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. 7
      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. 1
      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/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs
  83. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/DTOs/UnplannedIssueRequestDetailDTO.cs
  84. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/Inputs/UnplannedIssueRequestDetailInput.cs
  85. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/DTOs/UnplannedReceiptRequestDetailDTO.cs
  86. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/Inputs/UnplannedReceiptRequestDetailInput.cs
  87. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobAppServiceBase.cs
  88. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/StoreApplicationAutoMapperProfile.cs
  89. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CheckJobs/CheckJobAutoMapperProfile.cs
  90. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAutoMapperProfile.cs
  91. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs
  92. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAutoMapperProfile.cs
  93. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs
  94. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAutoMapperProfile.cs
  95. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/JisDeliverJobs/JisDeliverJobAutoMapperProfile.cs
  96. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductReceiveJobs/ProductReceiveJobAutoMapperProfile.cs
  97. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs
  98. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAutoMapperProfile.cs
  99. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReturnJobs/PurchaseReturnJobAutoMapperProfile.cs
  100. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAutoMapperProfile.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
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 管理依赖
使用 build/src/docker/publish/ 目录下的 dev.start.cmd 和 dev.stop.cmd 管理依赖的停止启动,可以在Docker Desktop中查看和管理启动的服务
## 部署
### windows x64 supervisor 方式部署
1. 执行: `build\src\win-x64\build.cmd`
2. 上传: `build\dist\win-x64\publish` 目录到服务器
3. 修改配置,执行 publish 目录下的 start.cmd
Docker 和 Windows 部署两种方式只需要按需修改配置文件中的主机名和端口,windows单机部署时使用localhost作为主机名,docker compose单机部署时使用service name 作为主机名
### docker compose 方式部署
@ -44,7 +25,8 @@ gateway --localhost:8086--> influxdb:8086
2. 上传: `build\dist\win-x64\publish` 目录到服务器
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\publish\gateway 到 build\dist\docker\publish\gateway,保持网关的配置和应用的配置统一在 build\src\win-x64\publish\gateway 目录维护
1. 执行: `build\src\win-x64\build.cmd`
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<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
await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false);
// Logger.LogInformation($"Read Ship");
// var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>();
// var shipConverter = workerContext.ServiceProvider.GetRequiredService<ShipConverter>();
// //读取并保持Ship
// var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false);
// //转换Ship
// await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Ship");
var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>();
var shipConverter = workerContext.ServiceProvider.GetRequiredService<ShipConverter>();
//读取并保持Ship
var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false);
//转换Ship
await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false);
// Logger.LogInformation($"Read Product");
// var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>();
// var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>();
// //读取并保持Product
// var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false);
//// 转换Product
// await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Product");
var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>();
var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>();
//读取并保持Product
var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false);
// 转换Product
await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false);
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);
await _incomingToWmsManager.CreateManyAsync(supplierAsnList).ConfigureAwait(false);
var purchaseLabelList = BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList);
var purchaseLabelList = await BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(purchaseLabelList).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>();
@ -76,7 +76,7 @@ public class ShipConverter : IIncomingConverter
};
incomingToWms.SetEffectiveDate(incomingFromExternal.EffectiveDate);
var exchangeAsn = JsonSerializer.Deserialize<SupplierAsnExchangeDto>(incomingFromExternal.DestinationDataContent);
var purchaseLabel = BuildPurchaseLabelCreateDto(exchangeAsn);
var purchaseLabel = await BuildPurchaseLabelCreateDto(exchangeAsn).ConfigureAwait(false);
incomingToWms.DataContent = JsonSerializer.Serialize(purchaseLabel);
incomingToWmsList.Add(incomingToWms);
@ -85,11 +85,23 @@ public class ShipConverter : IIncomingConverter
return incomingToWmsList;
}
private InventoryLabelEditInput BuildPurchaseLabelCreateDto(SupplierAsnExchangeDto exchangeAsn)
private async Task<InventoryLabelEditInput> BuildPurchaseLabelCreateDto(SupplierAsnExchangeDto exchangeAsn)
{
var purchaseLabel = _objectMapper.Map<SupplierAsnDetailExchangeDto, InventoryLabelEditInput>(exchangeAsn.Detail);
purchaseLabel.AsnNumber = exchangeAsn.Number;
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;
}

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.Fawtyg.EOS;
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;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
@ -18,6 +18,7 @@ public class ArriveConverter : IOutgoingConverter
private readonly ISupplierAsnAppService _supplierAsnAppService;
private readonly IObjectMapper _objectMapper;
public ArriveConverter(
IOutgoingFromWmsManager outgoingFromWmsManager
, IOutgoingToExternalManager outgoingToExternalManager
@ -35,11 +36,11 @@ public class ArriveConverter : IOutgoingConverter
{
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)
{
var wmsReceipt = JsonSerializer.Deserialize<PurchaseReceiptNoteDTO>(outgoingFromWms.DataContent);
var wmsReceipt = JsonSerializer.Deserialize<PutawayNoteDTO>(outgoingFromWms.DataContent);
foreach (var detail in wmsReceipt.Details)
{
var outgoingToExternal = new OutgoingToExternal()
@ -49,14 +50,14 @@ public class ArriveConverter : IOutgoingConverter
SourceSystem = EnumSystemType.WMS.ToString(),
SourceDataId = detail.Id.ToString(),
SourceDataGroupCode = wmsReceipt.Number,
SourceDataDetailCode = detail.PackingCode,
SourceDataDetailCode = detail.ToPackingCode,
Writer = nameof(EosOutgoingBackgroundWorker),
DestinationSystem = EnumSystemType.SCP.ToString(),
DestinationSystem = EnumSystemType.EOS.ToString(),
DestinationDataId = "",
};
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);
var arrive = BuildArrive(exchangeReceipt);
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive);
@ -71,25 +72,30 @@ public class ArriveConverter : IOutgoingConverter
return outgoingToExternalList;
}
private static ArriveNote BuildArrive(PurchaseReceiptNoteExchangeDto exchangeReceipt)
private ArriveNote BuildArrive(PutawayNoteExchangeDto exchangeReceipt)
{
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()
{
PlanBillNo = exchangeReceipt.PoNumber,
ShipBillNo = exchangeReceipt.AsnNumber,
PlanBillNo = detail.PoNumber,
ShipBillNo = detail.AsnNumber,
DocNo = exchangeReceipt.Number,
DetailMatNo = detail.PackingCode,
DetailMatNo = detail.ToPackingCode,
ERP = detail.ItemCode,
Qty = detail.Qty,
Qty = detail.ShippedQty,
HgQty = detail.Qty,
ProductDate = detail.ProduceDate,
ProductBatch = detail.Lot,
Loc = detail.LocationErpCode,
ShipDate = exchangeReceipt.ShipDate,
ProductBatch = detail.ToLot,
Loc = detail.ToLocationErpCode,
ShipDate = detail.ShipDate,
ShipBillState = 0,
SupplierCode = exchangeReceipt.SupplierCode,
PlanUserCode = exchangeReceipt.ContactName,
SupplierCode = detail.SupplierCode,
PlanUserCode = detail.PlanUserCode,//筹措员
EosState = 0,
// EosDate = DateTime.MinValue,
WmsDate = DateTime.Now,
@ -98,14 +104,11 @@ public class ArriveConverter : IOutgoingConverter
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 exchangeReceiptDetail = _objectMapper.Map<PurchaseReceiptNoteDetailDTO, PurchaseReceiptNoteDetailExchangeDto>(wmsReceiptDetail);
var asn = await _supplierAsnAppService.GetByNumberAsync(exchangeReceipt.AsnNumber).ConfigureAwait(false);
exchangeReceipt.ShipDate = asn?.ShipDate;
exchangeReceipt.ContactName = asn == null ? "" : asn.ContactName;
var exchangeReceipt = _objectMapper.Map<PutawayNoteDTO, PutawayNoteExchangeDto>(wmsReceipt);
var exchangeReceiptDetail = _objectMapper.Map<PutawayNoteDetailDTO, PutawayNoteDetailExchangeDto>(wmsReceiptDetail);
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": {
"Default": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True",
"DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True",
"EOS": "Server=61.139.155.47;Database=EOSCC;Uid=wms;Pwd=1;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=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=EOSSH;Uid=wms;Pwd=1;TrustServerCertificate=True"
},
"AuthServer": {
"Authority": "http://dev.ccwin-in.com:21293/",
"Authority": "http://10.164.113.31:60083/",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*",
@ -25,13 +25,13 @@
"RemoteServices": {
"BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:21294/"
"BaseUrl": "http://10.164.113.31:60084/"
},
"Store": {
"BaseUrl": "http://dev.ccwin-in.com:21295/"
"BaseUrl": "http://10.164.113.31:60085/"
},
"Label": {
"BaseUrl": "http://dev.ccwin-in.com:21292/"
"BaseUrl": "http://10.164.113.31:60082/"
}
},
"EosOptions": {

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

@ -58,7 +58,7 @@ public class BackFluReader : IReader
try
{
var bm = BuildScrapNoteOrderExchangeMes(backflu);
incomingData.DestinationDataContent = JsonSerializer.Serialize(backflu);
incomingData.DestinationDataContent = JsonSerializer.Serialize(bm);
}
catch (Exception ex)
{
@ -94,7 +94,7 @@ public class BackFluReader : IReader
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,
Number = backflu.scmout_nbr
};

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

@ -1,12 +1,12 @@
{
"ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,21195;Database= WMS;uid=sa;pwd=aA123456!;TrustServerCertificate=True;",
"DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True;",
"MES": "Server=10.164.1.12;Port=3306;Database=erp;Uid=wms;Pwd=123456;"
"Default": "Server=10.164.113.32,1818\\SHDB;Database=Wms_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;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.113.32,1818\\SHDB;Database=MES_SH;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True"
},
"AuthServer": {
"Authority": "http://dev.ccwin-in.com:21293/",
"Authority": "http://dev.ccwin-in.com:60083/",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*",
@ -24,14 +24,15 @@
"RemoteServices": {
"BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:21294/"
"BaseUrl": "http://dev.ccwin-in.com:60084/"
},
"Store": {
"BaseUrl": "http://dev.ccwin-in.com:21295/"
"BaseUrl": "http://dev.ccwin-in.com:60085/"
},
"Label": {
"BaseUrl": "http://dev.ccwin-in.com:21292/"
"BaseUrl": "http://dev.ccwin-in.com:60082/"
}
},
"MesOptions": {
"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.InterfaceCalendar;
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.ProductionReturnNote;
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.PurchaseReturn;
using Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote;
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.TransferNote;
using Win_in.Sfs.Wms.DataExchange.WMS.UnplannedIssueNote;
@ -34,6 +37,12 @@ public class FawtygAutoMapperProfile : Profile
{
public FawtygAutoMapperProfile()
{
CreateMap<IncomingToWms, ArchivedIncomingToWms>();
CreateMap<IncomingFromExternal, ArchivedIncomingFromExternal>();
CreateMap<OutgoingFromWms, ArchivedOutgoingFromWms>();
CreateMap<OutgoingToExternal, ArchivedOutgoingToExternal>();
CreateMap<InterfaceCalendarExchangeDto, InterfaceCalendarEditInput>();
CreateMap<DictExchangeDto, DictEditInput>()
.Ignore(x => x.Items);
@ -45,6 +54,9 @@ public class FawtygAutoMapperProfile : Profile
CreateMap<BackFlushNoteDTO, BackFlushNoteExchangeDto>();
CreateMap<BackFlushNoteDetailDTO, BackFlushNoteDetailExchangeDto>();
CreateMap<BackFlushNoteExchangeDto, BackFlushNoteEditInput>();
CreateMap<BackFlushNoteDetailExchangeDto, BackFlushNoteDetailInput>();
CreateMap<RecycledMaterialReceiptNoteDTO, RecycledMaterialReceiptNoteExchangeDto>();
CreateMap<RecycledMaterialReceiptNoteDetailDTO, RecycledMaterialReceiptNoteDetailExchangeDto>();
@ -85,16 +97,25 @@ public class FawtygAutoMapperProfile : Profile
.Ignore(x => x.Detail);
CreateMap<PurchaseReturnNoteDetailDTO, PurchaseReturnNoteDetailExchangeDto>();
CreateMap<OutgoingToExternal, ArchivedOutgoingToExternal>();
CreateMap<OutgoingFromWms, ArchivedOutgoingFromWms>();
CreateMap<CountAdjustNoteDTO, CountAdjustNoteExchangeDto>();
CreateMap<CountAdjustNoteDetailDTO, CountAdjustNoteDetailExchangeDto>();
CreateMap<ItemTransformNoteDTO, ItemTransformNoteExchangeDto>();
CreateMap<ItemTransformNoteDetailDTO, ItemTransformNoteDetailExchangeDto>();
CreateMap<ScrapNoteDTO, ScrapNoteExchangeDto>();
CreateMap<ScrapNoteDetailDTO, ScrapNoteDetailExchangeDto>();
CreateMap<BomExchangeDto, BomImportInput>();
CreateMap<BomDTO, BomExchangeDto>();
CreateMap<SupplierExchangeDto, SupplierEditInput>();
CreateMap<CustomerExchangeDto, CustomerEditInput>();
CreateMap<ProductRecycleNoteDTO, ProductRecycleNoteEditInput>();
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()
{
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),
// 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,
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.isupdate = false;
//Logger.LogInformation($"Read ItemBasic");//零件
//var itemBasicReader = workerContext.ServiceProvider.GetRequiredService<ItemBasicReader>();
//var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService<ItemBasicConverter>();
////读取并保存itemBasic
//var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false);
////转换itemBasic
//await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read ItemBasic");//零件
var itemBasicReader = workerContext.ServiceProvider.GetRequiredService<ItemBasicReader>();
var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService<ItemBasicConverter>();
//读取并保存itemBasic
var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false);
//转换itemBasic
await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read User");//用户和部门
var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>();
@ -96,13 +96,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
//转换Dict
await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Bom");
//var BomReader = workerContext.ServiceProvider.GetRequiredService<BomReader>();
//var BomConverter = workerContext.ServiceProvider.GetRequiredService<BomConverter>();
////读取并保存Bom
//var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false);
////转换Bom
//await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Bom");
var BomReader = workerContext.ServiceProvider.GetRequiredService<BomReader>();
var BomConverter = workerContext.ServiceProvider.GetRequiredService<BomConverter>();
//读取并保存Bom
var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false);
//转换Bom
await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Supplier");//供应商
var SupplierReader = workerContext.ServiceProvider.GetRequiredService<SupplierReader>();
@ -132,6 +132,7 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
common.isupdate = true;
}
}
//已经挪至MES接口,tyrp暂不启动这个接口20230424(上海东阳改)
//Logger.LogInformation($"Read BackFlush");//耗用单
//var BackFlushReader = workerContext.ServiceProvider.GetRequiredService<BackFluReader>();
//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)
{
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), ItemCode = p.Key.ItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) });
foreach (var detail in details.Where(r => r.CountQty == 0))
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()
{
@ -57,13 +61,12 @@ public class CountAdjustNoteConverter : IOutgoingConverter
SourceSystem = EnumSystemType.WMS.ToString(),
SourceDataId = wmsCountAdjust.Number,
SourceDataGroupCode = wmsCountAdjust.Number,
SourceDataDetailCode = detail.ItemCode,
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);
@ -73,51 +76,40 @@ public class CountAdjustNoteConverter : IOutgoingConverter
}
}
}
await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false);
//将outgoingFromWms数据归档
await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false);
return outgoingToExternalList;
//插入到中间表OutgoingToExternal
}
private static CountAdjust BuildIssue(CountAdjustNoteExchangeDto exchangeCountAdjust, string departmentCode)
private CountAdjust BuildIssue(CountAdjustNoteExchangeDto exchangeCountAdjust, string departmentCode)
{
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()
{
mesout_asd_refc = departmentCode,
mesout_asd_dt_w = date,
mesout_asd_type = asdtype,
mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
mesout_asd_type = "4003",
mesout_asd_part = detail.ItemCode,
mesout_asd_date = exchangeCountAdjust.ActiveDate.ToShortDateString().Replace("/", "").Trim(),
mesout_asd_loc = detail.LocationErpCode,
mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"),
mesout_asd_loc = string.Empty,
mesout_asd_code = detail.ReasonCode,
mesout_asd_qty = detail.CountQty,
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)
{
await Task.CompletedTask.ConfigureAwait(false);
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;
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);
var exchangeReceiptDetail = _objectMapper.Map<IssueNoteDetailDTO, IssueNoteDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail);
var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, putawayNote.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail);
outgoingToExternalList.Add(outgoingDetailToExternal);
}
@ -115,12 +115,12 @@ public class IssueNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param>
/// <returns></returns>
private Scmsend BuildDataInterfaceDetail(IssueNoteExchangeDto exchangeOrder, IssueNoteDetailExchangeDto exchangeDetailOrder)
private Scmsend BuildDataInterfaceDetail(IssueNoteExchangeDto exchangeOrder, IssueNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{
var ret = new Scmsend()
{
scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "1",
scmsend_part = exchangeDetailOrder.ItemCode,
@ -130,7 +130,7 @@ public class IssueNoteConverter : IOutgoingConverter
scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty,
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;
}

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

@ -100,16 +100,11 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing;
private CountAdjust BuildIssue(ItemTransformNoteExchangeDto exchangeCountAdjust, string departmentCode)
{
var detail = exchangeCountAdjust.Detail;
string asdtype = "";
if (Enum.Parse<EnumTransSubType>(exchangeCountAdjust.Type) == EnumTransSubType.Item_Transform)
{
asdtype = "4003";
}
var counta = new CountAdjust()
{
mesout_asd_refc = departmentCode,
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_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"),
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;
}
public virtual async Task<List<OutgoingToExternal>> ConvertAsync()
{
var outgoingToExternalList = new List<OutgoingToExternal>();
@ -67,21 +69,21 @@ public class ProductReceiptNoteConverter : IOutgoingConverter
return outgoingToExternalList;
}
private static ProductReceiptNote BuildProductReceiptNote(ProductReceiptNoteExchangeDto exchangeProductReceiptNote)
private ProductReceiptNote BuildProductReceiptNote(ProductReceiptNoteExchangeDto exchangeProductReceiptNote)
{
var detail = exchangeProductReceiptNote.Detail;
var ret = new ProductReceiptNote()
{
mesout_ref_nbr = exchangeProductReceiptNote.Number,
mesout_id = detail.RawLocationCode,
mesout_part = detail.ItemCode,
mesout_id = string.IsNullOrEmpty(detail.RawLocationCode)?"": detail.RawLocationCode,
mesout_patr = detail.ItemCode,
mesout_date = exchangeProductReceiptNote.ActiveDate.ToString("yyyyMMdd"),
mesout_bad = detail.ReturnQty,
mesout_move = detail.ReturnQty != 0 ? 0 : detail.Qty,
mesout_unable = 0,
mesout_loc = detail.LocationErpCode,
mesout_dt = exchangeProductReceiptNote.ActiveDate.ToString("yyyyMMdd"),
memo = detail.Remark,
memo = string.IsNullOrEmpty(detail.Remark)?"": detail.Remark,
refno = "",
};
@ -90,7 +92,6 @@ public class ProductReceiptNoteConverter : IOutgoingConverter
private async Task<ProductReceiptNoteExchangeDto> BuildProductReceiptNoteExchangeDtoAsync(ProductReceiptNoteDTO wmsReceipt, ProductReceiptNoteDetailDTO wmsReceiptDetail)
{
await Task.CompletedTask.ConfigureAwait(false);
var exchangeReceipt = _objectMapper.Map<ProductReceiptNoteDTO, ProductReceiptNoteExchangeDto>(wmsReceipt);
var exchangeReceiptDetail = _objectMapper.Map<ProductReceiptNoteDetailDTO, ProductReceiptNoteDetailExchangeDto>(wmsReceiptDetail);
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,
SourceSystem = EnumSystemType.WMS.ToString(),
SourceDataId = materialDetail.Id.ToString(),
SourceDataGroupCode = detail.ItemCode,
SourceDataGroupCode = wmsReceipt.Number,
SourceDataDetailCode = materialDetail.ItemCode,
Writer = nameof(TyrpOutgoingBackgroundWorker),
DestinationSystem = EnumSystemType.ERP.ToString(),
@ -134,7 +134,7 @@ public class ProductRecycleNoteConverter : IOutgoingConverter
wmsoutm_stock_stat = "",
wmsoutm_open_part = exchangeOrder.ItemCode,
wmsoutm_open_loc = exchangeOrder.LocationErpCode,
wmsoutm_open_hours = 0,
wmsoutm_open_hours = 1,//无法取到转移工时 目前默认为1
wmsoutm_tyrp_k = "",
wmsoutm_id = 0,//明细中最大scmsend_id
wmsoutm_open_qt = exchangeOrderDetail.Qty,
@ -147,7 +147,7 @@ public class ProductRecycleNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param>
/// <returns></returns>
private static Wmsoutd BuildDataInterfaceDetail(ProductRecycleNoteExchangeDto exchangeOrder, ProductRecycleMaterialDetailExchangeDto exchangeDetailOrder)
private Wmsoutd BuildDataInterfaceDetail(ProductRecycleNoteExchangeDto exchangeOrder, ProductRecycleMaterialDetailExchangeDto exchangeDetailOrder)
{
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);
var exchangeReceiptDetail = _objectMapper.Map<ProductionReturnNoteDetailDTO, ProductionReturnNoteDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail);
var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, putawayNote.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail);
outgoingToExternalList.Add(outgoingDetailToExternal);
}
@ -114,12 +114,12 @@ public class ProductionReturnNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param>
/// <returns></returns>
private Scmsend BuildDataInterfaceDetail(ProductionReturnNoteExchangeDto exchangeOrder, ProductionReturnNoteDetailExchangeDto exchangeDetailOrder)
private Scmsend BuildDataInterfaceDetail(ProductionReturnNoteExchangeDto exchangeOrder, ProductionReturnNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{
var ret = new Scmsend()
{
scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "2",
scmsend_part = exchangeDetailOrder.ItemCode,
@ -129,7 +129,7 @@ public class ProductionReturnNoteConverter : IOutgoingConverter
scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty,
scmsend_wipd_loc = exchangeDetailOrder.FromLocationErpCode,
scmsend_userid = exchangeOrder.Worker
scmsend_userid = string.IsNullOrEmpty(exchangeOrder.Worker) ? "" : exchangeOrder.Worker
};
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);
var exchangeReceiptDetail = _objectMapper.Map<PurchaseOrderDetailDTO, PurchaseOrderDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var purchaseOrderDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail);
var purchaseOrderDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, purchaseOrder.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(purchaseOrderDetail);
outgoingToExternalList.Add(outgoingDetailToExternal);
}
@ -122,12 +122,12 @@ public class PurchaseOrderConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param>
/// <returns></returns>
private Scmsend BuildDataInterfaceDetail(PurchaseOrderExchangeDto exchangeOrder, PurchaseOrderDetailExchangeDto exchangeDetailOrder)
private Scmsend BuildDataInterfaceDetail(PurchaseOrderExchangeDto exchangeOrder, PurchaseOrderDetailExchangeDto exchangeDetailOrder, string dt_w)
{
var ret = new Scmsend()
{
scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "3",
scmsend_part = exchangeDetailOrder.ItemCode,
@ -137,7 +137,7 @@ public class PurchaseOrderConverter : IOutgoingConverter
scmsend_date = exchangeOrder.OrderDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty,
scmsend_wipd_loc = "",
scmsend_userid = exchangeOrder.ContactName
scmsend_userid = string.IsNullOrEmpty(exchangeOrder.ContactName) ? "" : exchangeOrder.ContactName
};
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);
var exchangeReceiptDetail = _objectMapper.Map<PurchaseReturnNoteDetailDTO, PurchaseReturnNoteDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var purchaseReturnDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail);
var purchaseReturnDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, purchaseReturn.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(purchaseReturnDetail);
outgoingToExternalList.Add(outgoingDetailToExternal);
}
@ -119,14 +119,14 @@ public class PurchaseReturnConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param>
/// <returns></returns>
private Scmsend BuildDataInterfaceDetail(PurchaseReturnNoteExchangeDto exchangeOrder, PurchaseReturnNoteDetailExchangeDto exchangeDetailOrder)
private Scmsend BuildDataInterfaceDetail(PurchaseReturnNoteExchangeDto exchangeOrder, PurchaseReturnNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{
var ret = new Scmsend()
{
scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "0",
scmsend_stat1 = "4",
scmsend_part = exchangeDetailOrder.ItemCode,
scmsend_delv_date = "",
scmsend_orderno = exchangeOrder.SupplierCode,
@ -134,7 +134,7 @@ public class PurchaseReturnConverter : IOutgoingConverter
scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty,
scmsend_wipd_loc = "",
scmsend_userid = exchangeOrder.ContactName
scmsend_userid = string.IsNullOrEmpty(exchangeOrder.ContactName) ? "" : exchangeOrder.ContactName
};
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);
var exchangeReceiptDetail = _objectMapper.Map<PutawayNoteDetailDTO, PutawayNoteDetailExchangeDto>(detail);
outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail);
var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail);
var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, putawayNote.scontrol_dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail);
outgoingToExternalList.Add(outgoingDetailToExternal);
}
@ -114,12 +114,12 @@ public class PutawayNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param>
/// <returns></returns>
private Scmsend BuildDataInterfaceDetail(PutawayNoteExchangeDto exchangeOrder, PutawayNoteDetailExchangeDto exchangeDetailOrder)
private Scmsend BuildDataInterfaceDetail(PutawayNoteExchangeDto exchangeOrder, PutawayNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{
var ret = new Scmsend()
{
scmsend_type = billtype,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "0",
scmsend_part = exchangeDetailOrder.ItemCode,
@ -129,7 +129,7 @@ public class PutawayNoteConverter : IOutgoingConverter
scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"),
scmsend_qty = exchangeDetailOrder.Qty,
scmsend_wipd_loc = "",
scmsend_userid = exchangeOrder.Worker
scmsend_userid = string.IsNullOrEmpty(exchangeOrder.Worker) ? "" : exchangeOrder.Worker
};
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="exchangeDetailOrder"></param>
/// <returns></returns>
private static Wmsoutd BuildDataInterfaceDetail(RecycledMaterialReceiptNoteExchangeDto exchangeOrder, RecycledMaterialReceiptNoteDetailExchangeDto exchangeDetailOrder)
private Wmsoutd BuildDataInterfaceDetail(RecycledMaterialReceiptNoteExchangeDto exchangeOrder, RecycledMaterialReceiptNoteDetailExchangeDto exchangeDetailOrder)
{
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);
}
}
try
{
//dataInterface分主子表分别写入ERP
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);
}

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()
{
var outgoingToExternalList = new List<OutgoingToExternal>();
var outgoingFromWmsList =
await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.UnplannedIssue, EnumSystemType.ERP).ConfigureAwait(false);
var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.Scrap, EnumSystemType.ERP).ConfigureAwait(false);
foreach (var outgoingFromWms in outgoingFromWmsList)
{
var wmsCountAdjust = JsonSerializer.Deserialize<ScrapNoteDTO>(outgoingFromWms.DataContent);
@ -69,36 +68,40 @@ IOutgoingFromWmsManager outgoingFromWmsManager
outgoingToExternalList.Add(outgoingToExternal);
}
}
await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false);
//将outgoingFromWms数据归档
await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false);
return outgoingToExternalList;
}
private static CountAdjust BuildIssue(ScrapNoteExchangeDto exchangeScrap, string departmentCode)
private CountAdjust BuildIssue(ScrapNoteExchangeDto exchangeScrap, string departmentCode)
{
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 = "";
if (Enum.Parse<EnumTransSubType>(exchangeScrap.Type) == EnumTransSubType.CountAdjust_WIP)
if (exchangeScrap.Type== EnumTransSubType.CountAdjust_WIP.ToString())
{
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";
}
else if (exchangeScrap.Type == EnumTransSubType.Scrap_WIP.ToString())
{
asdtype = "4042";
}
var counta = new CountAdjust()
{
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_part = detail.ItemCode,
mesout_asd_date = exchangeScrap.ActiveDate.ToShortDateString().Replace("/", "").Trim(),
mesout_asd_loc = "",//字段不明确
mesout_asd_date = exchangeScrap.ActiveDate.ToString("yyyyMMdd"),
mesout_asd_loc = detail.FromLocationErpCode,
mesout_asd_code = detail.ReasonCode,
mesout_asd_qty = detail.Qty,
mesout_asd_user = exchangeScrap.Worker,
@ -109,7 +112,6 @@ IOutgoingFromWmsManager outgoingFromWmsManager
}
private async Task<ScrapNoteExchangeDto> BuildPurchaseReceiptExchangeDtoAsync(ScrapNoteDTO wmsScrap, ScrapNoteDetailDTO wmsScrapDetail)
{
await Task.CompletedTask.ConfigureAwait(false);
var exchangeScrap = _objectMapper.Map<ScrapNoteDTO, ScrapNoteExchangeDto>(wmsScrap);
var exchangeScrapDetail = _objectMapper.Map<ScrapNoteDetailDTO, ScrapNoteDetailExchangeDto>(wmsScrapDetail);
//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;
}
public virtual async Task<List<OutgoingToExternal>> ConvertAsync()
{
var outgoingToExternalList = new List<OutgoingToExternal>();
@ -68,16 +69,17 @@ public class TransferNoteConverter : IOutgoingConverter
};
outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt);
string dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss");
if (exchangeReceipt.Type != EnumTransSubType.Transfer_Customer.ToString())
{
outgoingToExternal.DataType = EnumOutgoingDataType.TransferForErp.ToString();
var putawayNoteScontrol = BuildScontrolDataInterface(exchangeReceipt);
var putawayNoteScontrol = BuildScontrolDataInterface(exchangeReceipt, dt_w);
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteScontrol);
}
else
{
outgoingToExternal.DataType = EnumOutgoingDataType.TransferForCustom.ToString();
var putawayNoteWmsoutm = BuildWmsoutmDataInterface(exchangeReceipt, departmentCode);
var putawayNoteWmsoutm = BuildWmsoutmDataInterface(exchangeReceipt, departmentCode, dt_w);
outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteWmsoutm);
}
@ -106,7 +108,7 @@ public class TransferNoteConverter : IOutgoingConverter
if (exchangeReceipt.Type != EnumTransSubType.Transfer_Customer.ToString())
{
var putawayNoteDetailScmsend = BuildScmsendDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail);
var putawayNoteDetailScmsend = BuildScmsendDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, dt_w);
outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetailScmsend);
}
else
@ -133,12 +135,12 @@ public class TransferNoteConverter : IOutgoingConverter
/// </summary>
/// <param name="exchangeOrder"></param>
/// <returns></returns>
private Scontrol BuildScontrolDataInterface(TransferNoteExchangeDto exchangeOrder)
private Scontrol BuildScontrolDataInterface(TransferNoteExchangeDto exchangeOrder, string dt_w)
{
var ret = new Scontrol()
{
scontrol_nbr = exchangeOrder.Number,
scontrol_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
scontrol_dt_w = dt_w,
scontrol_stat = "Y",
scontrol_dt_k = "",
scontrol_type = billtype_s,
@ -152,12 +154,12 @@ public class TransferNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param>
/// <returns></returns>
private Scmsend BuildScmsendDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder)
private Scmsend BuildScmsendDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder, string dt_w)
{
var ret = new Scmsend()
{
scmsend_type = billtype_s,
scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
scmsend_dt_w = dt_w,
scmsend_nbr = exchangeOrder.Number,
scmsend_stat1 = "0",
scmsend_part = exchangeDetailOrder.ItemCode,
@ -177,13 +179,13 @@ public class TransferNoteConverter : IOutgoingConverter
/// </summary>
/// <param name="exchangeOrder"></param>
/// <returns></returns>
private Wmsoutm BuildWmsoutmDataInterface(TransferNoteExchangeDto exchangeOrder, string departmentCode)
private Wmsoutm BuildWmsoutmDataInterface(TransferNoteExchangeDto exchangeOrder, string departmentCode, string dt_w)
{
var ret = new Wmsoutm()
{
wmsoutm_nbr = exchangeOrder.Number,
wmsoutm_type = billtype_w,
wmsoutm_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"),
wmsoutm_dt_w = dt_w,
wmsoutm_stat = "Y",
wmsoutm_tyrp_dt = "",
wmsoutm_user = exchangeOrder.Worker,
@ -192,7 +194,7 @@ public class TransferNoteConverter : IOutgoingConverter
wmsoutm_cust = "",
wmsoutm_shm_nbr = "",
wmsoutm_cust_loc = "",
wmsoutm_stock_stat = "",
wmsoutm_stock_stat = "1",
wmsoutm_open_part = "",
wmsoutm_open_loc = "",
wmsoutm_open_hours = 0,
@ -208,7 +210,7 @@ public class TransferNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param>
/// <returns></returns>
private static Wmsoutd BuildWmsoutdDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder)
private Wmsoutd BuildWmsoutdDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder)
{
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)
{
Logger.LogInformation($"Starting: Handling {Outgoing}");
if (!_options.Value.IncomingOptions.Active)
{
Logger.LogInformation($"{Outgoing} is not active!");
@ -84,10 +85,11 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
var deliverNoteList = await deliverNoteConvert.ConvertAsync().ConfigureAwait(false);
await wmsoutmWriter.WriteAsync(deliverNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write CustomerReturnNote");//退货单
var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService<CustomerReturnNoteConverter>();
var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false);
await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false);
//暂无此接口
//Logger.LogInformation($"Write CustomerReturnNote");//退货单
//var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService<CustomerReturnNoteConverter>();
//var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false);
//await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write UnplannedIssueNote");//非生产领料单
var unplannedIssueNoteConvert = workerContext.ServiceProvider.GetRequiredService<UnplannedIssueNoteConverter>();
@ -109,21 +111,28 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
var productRecycleNoteList = await productRecycleNoteConvert.ConvertAsync().ConfigureAwait(false);
await wmsoutmWriter.WriteAsync(productRecycleNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write CountAdjusNote");//调整单、线边仓调整单
Logger.LogInformation($"Write CountAdjusNote");//盘点调整单
var countadjustNoteConvert = workerContext.ServiceProvider.GetRequiredService<CountAdjustNoteConverter>();
var countadjustNoteList = await countadjustNoteConvert.ConvertAsync().ConfigureAwait(false);
var countadjustWriter = workerContext.ServiceProvider.GetRequiredService<CountAdjustNoteWriter>();
await countadjustWriter.WriteAsync(countadjustNoteList).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($"Write WIPAdjusNote");//线边仓调整
var wipAdjustNoteConvert = workerContext.ServiceProvider.GetRequiredService<WIPAdjusNoteConverter>();
var wipAdjustNoteList = await wipAdjustNoteConvert.ConvertAsync().ConfigureAwait(false);
await countadjustWriter.WriteAsync(wipAdjustNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write ItemTransformNote");//回收料调整单
var ItemTransformNoteConvert = workerContext.ServiceProvider.GetRequiredService<ItemTransformNoteConverter>();
var ItemTransformNoteList = await ItemTransformNoteConvert.ConvertAsync().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}");
}

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 department = await _departmentAppService.GetByUsernameAsync(exchangeReceipt.Worker).ConfigureAwait(false);
var departmentCode = department == null ? "" : department.Code;
var purchaseOrder = BuildDataInterface(exchangeReceipt, departmentCode);
var purchaseOrder = BuildDataInterface(exchangeReceipt);
var outgoingToExternal = new OutgoingToExternal()
{
DataType = EnumOutgoingDataType.UnplannedIssue.ToString(),
@ -106,7 +106,7 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter
/// </summary>
/// <param name="exchangeOrder"></param>
/// <returns></returns>
private Wmsoutm BuildDataInterface(UnplannedIssueNoteExchangeDto exchangeOrder, string departmentCode)
private Wmsoutm BuildDataInterface(UnplannedIssueNoteExchangeDto exchangeOrder)
{
var ret = new Wmsoutm()
@ -138,7 +138,7 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter
/// <param name="exchangeOrder"></param>
/// <param name="exchangeDetailOrder"></param>
/// <returns></returns>
private static Wmsoutd BuildDataInterfaceDetail(UnplannedIssueNoteExchangeDto exchangeOrder, UnplannedIssueNoteDetailExchangeDto exchangeDetailOrder)
private Wmsoutd BuildDataInterfaceDetail(UnplannedIssueNoteExchangeDto exchangeOrder, UnplannedIssueNoteDetailExchangeDto exchangeDetailOrder)
{
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="exchangeDetailOrder"></param>
/// <returns></returns>
private static Wmsoutd BuildDataInterfaceDetail(UnplannedReceiptNoteExchangeDto exchangeOrder, UnplannedReceiptNoteDetailExchangeDto exchangeDetailOrder)
private Wmsoutd BuildDataInterfaceDetail(UnplannedReceiptNoteExchangeDto exchangeOrder, UnplannedReceiptNoteDetailExchangeDto exchangeDetailOrder)
{
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);
}
}
try
{
//dataInterface分主子表分别写入ERP
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);
}

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<TyrpOutgoingBackgroundWorker>();
context.AddBackgroundWorkerAsync<TyrpOutgoingBackgroundWorker>();
}
}

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

@ -1,13 +1,13 @@
{
"ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,21195;Database=Wms;uid=sa;pwd=aA123456!;TrustServerCertificate=True",
"DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True",
"TYRP": "Server=dev.ccwin-in.com,21195;Database=TYRP;Uid=sa;Pwd=aA123456!;TrustServerCertificate=True",
"SYBASE_TYRP": "Data Source=10.164.1.11; Port=5000; Database=mesdb; Uid=mesuser; Pwd=mesuser1234;Charset=cp850;" //iso_1
"Default": "Server=10.164.113.32,1818\\SHDB;Database=Wms_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True",
"DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;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.115.137; Port=5000; Database=mesdb; Uid=mesuser; Pwd=mesuser1234;Charset=cp850;" //iso_1
},
"AuthServer": {
"Authority": "http://dev.ccwin-in.com:21293/",
"Authority": "http://dev.ccwin-in.com:60083/",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*",
@ -26,16 +26,16 @@
"RemoteServices": {
"BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:21294/"
"BaseUrl": "http://dev.ccwin-in.com:60084/"
},
"Store": {
"BaseUrl": "http://dev.ccwin-in.com:21295/"
"BaseUrl": "http://dev.ccwin-in.com:60085/"
},
"Label": {
"BaseUrl": "http://dev.ccwin-in.com:21292/"
"BaseUrl": "http://dev.ccwin-in.com:60082/"
},
"Auth": {
"BaseUrl": "http://dev.ccwin-in.com:21293/"
"BaseUrl": "http://dev.ccwin-in.com:60083/"
}
},
"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()
{
CreateMap<MesProductL7PartsNote, MesProductL7PartsNoteDTO>()
.IgnoreAuditedObjectProperties()
.ForMember(x => x.CreationTime, y => y.MapFrom(d => d.CreationTime))
.ReverseMap();

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

@ -150,6 +150,6 @@ public class AgentModule : AbpModule
ApplicationInitializationContext context)
{
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 balanceAppService = workerContext.ServiceProvider.GetRequiredService<IBalanceAppService>();
var balanceDtos = await balanceAppService.GetRecommendBalancesAsync(new RecommendBalanceRequestInput()
{
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)
{
case EnumIncomingDataType.Department:
//await incomingToWms.HandleDepartmentsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleDepartmentsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.User:
//await incomingToWms.HandleUsersAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleUsersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Item:
//await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Location:
await incomingToWms.HandleErpLocationsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Bom:
//await incomingToWms.HandleBomsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleBomsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Dict:
await incomingToWms.HandleDictsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Supplier:
//await incomingToWms.HandleSuppliersAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleSuppliersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.SupplierItem:
//await incomingToWms.HandleSupplierItemsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleSupplierItemsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.ItemPack:
//await incomingToWms.HandleItemPacksAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleItemPacksAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Customer:
//await incomingToWms.HandleCustomersAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleCustomersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.CustomerItem:
//await incomingToWms.HandleCustomerItemsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleCustomerItemsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.InterfaceCalendar:
//await incomingToWms.HandleInterfaceCalendarsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleInterfaceCalendarsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.PurchaseOrder:
//await incomingToWms.HandlePurchaseOrdersAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandlePurchaseOrdersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.SaleOrder:
//await incomingToWms.HandleSaleOrdersAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleSaleOrdersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.SupplierAsn:
//await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.ProductReceipt:
//await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.MaterialRequest:
await incomingToWms.HandleMaterialRequestsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Scrap:
//await incomingToWms.HandleScrapsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleScrapsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.IssueConfirm:
//await incomingToWms.HandleIssueNoteConfirmAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleIssueNoteConfirmAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.PurchaseLabel:
//await incomingToWms.HandleInventoryLabelsAsync(workerContext).ConfigureAwait(false);
await incomingToWms.HandleInventoryLabelsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.BackFlush:
await incomingToWms.HandleBackFlushsAsync(workerContext).ConfigureAwait(false);

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

@ -1,13 +1,13 @@
{
"ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True",
"DataExchange": "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=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True"
},
"AuthServer": {
"Authority": "http://dev.ccwin-in.com:21293/",
"Authority": "http://dev.ccwin-in.com:60083/",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*",
@ -26,16 +26,16 @@
"RemoteServices": {
"BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:21294/"
"BaseUrl": "http://dev.ccwin-in.com:60084/"
},
"Store": {
"BaseUrl": "http://dev.ccwin-in.com:21295/"
"BaseUrl": "http://dev.ccwin-in.com:60085/"
},
"Label": {
"BaseUrl": "http://dev.ccwin-in.com:21292/"
"BaseUrl": "http://dev.ccwin-in.com:60082/"
},
"Auth": {
"BaseUrl": "http://dev.ccwin-in.com:21293/"
"BaseUrl": "http://dev.ccwin-in.com:60083/"
}
},
"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
{
/// <summary>
/// 物品代码
/// </summary>
@ -21,9 +20,18 @@ public class CountAdjustNoteDetailExchangeDto
[Display(Name = "原因代码")]
public string ReasonCode { get; set; }
/// <summary>
/// 库存数量
/// </summary>
[Display(Name = "库存数量")]
public decimal InventoryQty { get; set; }
/// <summary>
/// 调整数量
/// </summary>
[Display(Name = "调整数量")]
public decimal AdjustQty { get; set; }
/// <summary>
/// 盘点数量
/// </summary>
[Display(Name = "盘点数量")]
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;
namespace Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote;
@ -26,9 +27,58 @@ public class PutawayNoteDetailExchangeDto
[Display(Name = "目标ERP库位")]
public string ToLocationErpCode { get; set; }
/// <summary>
/// 箱标签
/// </summary>
[Display(Name = "箱标签")]
public string ToPackingCode { get; set; }
/// <summary>
/// 数量
/// </summary>
[Display(Name = "数量")]
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 = "操作员")]
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>
</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">
<summary>
盘点数量
@ -1116,11 +1126,51 @@
目标ERP库位
</summary>
</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">
<summary>
数量
</summary>
</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">
<summary>
上架单号

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

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

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

@ -24,13 +24,14 @@ public enum EnumOutgoingDataType
ProductionReturn = 16,
ProductReceipt = 17,
Deliver = 18,
CountAdjust = 19,
CountAdjust = 19,//盘点整单
CustomerReturn = 20,
UnplannedIssue = 21,
RecycledMaterialReceipt = 22,
ScrapNote = 23,
Scrap = 23,
ProductRecycle = 24,
Item_Transform = 25
Item_Transform = 25,//线边仓调整单
WIPAdjust = 26//回收料调整单
}
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()
{
CreateMap<Department, DepartmentDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
CreateMap<DepartmentCreateInput, Department>()
.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.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using IdentityModel.Client;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
@ -11,35 +12,31 @@ using Volo.Abp.Application.Services;
namespace Win_in.Sfs.Auth.Tokens;
[Route($"api/token")]
[Route($"api")]
[Authorize]
public class TokenService : ApplicationService
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IHttpClientFactory _httpClientFactory;
private readonly ILogger<TokenService> _logger;
private readonly IConfiguration _configuration;
public TokenService(IHttpClientFactory httpClientFactory, IConfiguration configuration, ILogger<TokenService> logger)
public TokenService(IHttpContextAccessor httpContextAccessor, IHttpClientFactory httpClientFactory, IConfiguration configuration, ILogger<TokenService> logger)
{
this._httpContextAccessor = httpContextAccessor;
this._httpClientFactory = httpClientFactory;
this._configuration = configuration;
this._logger = logger;
}
[HttpPost]
[HttpPost("token")]
[AllowAnonymous]
public async Task<IActionResult> CreateAsync(LoginModel model)
{
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 clientSecret = _configuration["AuthServer:ClientSecret"];
this._logger.LogInformation($"address:{address},TokenEndpoint:{discovery.TokenEndpoint},clientId:{clientId},clientSecret:{clientSecret}");
var result = await _httpClientFactory.CreateClient().RequestPasswordTokenAsync(new PasswordTokenRequest
{
Address = $"{address.TrimEnd('/')}/connect/token",
@ -49,11 +46,6 @@ public class TokenService : ApplicationService
UserName = model.UserName,
Password = model.Password
}).ConfigureAwait(false);
Console.WriteLine($"Result:${(result.IsError ? result.ErrorDescription : result.AccessToken)}");
//if (result.RefreshToken == null)
//{
// throw new UserFriendlyException("用户名或密码错误");
//}
return new JsonResult(new
{
@ -72,18 +64,26 @@ public class TokenService : ApplicationService
});
}
[HttpGet("[action]")]
[AllowAnonymous]
public string Test()
[HttpGet("token/application-configuration")]
public async Task<IActionResult> ApplicationConfiguration()
{
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]
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.Docker": "http://gateway:21093",
"ConnectionStrings": {
"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;"
},
"SwaggerAuthServer": {
"Authority": "http://localhost:59093",
"RequireHttpsMetadata": "false"
},
"IdentityServer": {
"Clients": {
"Auth_Web": {
"ClientId": "Auth_Web",
"RootUrl": "http://localhost:59093/",
"RequireHttpsMetadata": "false"
},
"Auth_App": {
"ClientId": "Auth_App",
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false"
},
"Auth_Swagger": {
"ClientId": "Auth_Swagger",
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false"
}
}
}
//"ConnectionStrings": {
// "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;"
//},
//"SwaggerAuthServer": {
// "Authority": "http://localhost:59093",
// "RequireHttpsMetadata": "false"
//},
//"IdentityServer": {
// "Clients": {
// "Auth_Web": {
// "ClientId": "Auth_Web",
// "RootUrl": "http://localhost:59093/",
// "RequireHttpsMetadata": "false"
// },
// "Auth_App": {
// "ClientId": "Auth_App",
// "ClientSecret": "1q2w3e*",
// "RootUrl": "http://localhost:59093",
// "RequireHttpsMetadata": "false"
// },
// "Auth_Swagger": {
// "ClientId": "Auth_Swagger",
// "ClientSecret": "1q2w3e*",
// "RootUrl": "http://localhost:59093",
// "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)
{
//base.ConfigureServices(context);
//ConfigureAuditing();
////
//ConfigureBlobStoring();
//Configure<AbpClockOptions>(options =>
//{
// options.Kind = DateTimeKind.Local;
//});
base.ConfigureServices(context);
ConfigureAuditing();
//
ConfigureBlobStoring();
Configure<AbpClockOptions>(options =>
{
options.Kind = DateTimeKind.Local;
});
}
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.Docker": "http://gateway:21093",
"ConnectionStrings": {
"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;"
},
"SwaggerAuthServer": {
"Authority": "http://localhost:59093",
"RequireHttpsMetadata": "false"
},
"IdentityServer": {
"Clients": {
"Auth_Web": {
"ClientId": "Auth_Web",
"RootUrl": "http://localhost:59093/",
"RequireHttpsMetadata": "false"
},
"Auth_App": {
"ClientId": "Auth_App",
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false"
},
"Auth_Swagger": {
"ClientId": "Auth_Swagger",
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false"
}
}
}
//"ConnectionStrings": {
// "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;"
//},
//"SwaggerAuthServer": {
// "Authority": "http://localhost:59093",
// "RequireHttpsMetadata": "false"
//},
//"IdentityServer": {
// "Clients": {
// "Auth_Web": {
// "ClientId": "Auth_Web",
// "RootUrl": "http://localhost:59093/",
// "RequireHttpsMetadata": "false"
// },
// "Auth_App": {
// "ClientId": "Auth_App",
// "ClientSecret": "1q2w3e*",
// "RootUrl": "http://localhost:59093",
// "RequireHttpsMetadata": "false"
// },
// "Auth_Swagger": {
// "ClientId": "Auth_Swagger",
// "ClientSecret": "1q2w3e*",
// "RootUrl": "http://localhost:59093",
// "RequireHttpsMetadata": "false"
// }
// }
//}
}

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

@ -48,8 +48,8 @@
</Content>
</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)" />
</Target>
</Target>-->
</Project>

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

@ -1,34 +1,34 @@
{
"ConfigServer": "http://localhost:21093",
"ConfigServer.Docker": "http://gateway:21093",
"ConnectionStrings": {
"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;"
},
"SwaggerAuthServer": {
"Authority": "http://localhost:59093",
"RequireHttpsMetadata": "false"
},
"IdentityServer": {
"Clients": {
"Auth_Web": {
"ClientId": "Auth_Web",
"RootUrl": "http://localhost:59093/",
"RequireHttpsMetadata": "false"
},
"Auth_App": {
"ClientId": "Auth_App",
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false"
},
"Auth_Swagger": {
"ClientId": "Auth_Swagger",
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:59093",
"RequireHttpsMetadata": "false"
}
}
}
//"ConnectionStrings": {
// "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;"
//},
//"SwaggerAuthServer": {
// "Authority": "http://localhost:59093",
// "RequireHttpsMetadata": "false"
//},
//"IdentityServer": {
// "Clients": {
// "Auth_Web": {
// "ClientId": "Auth_Web",
// "RootUrl": "http://localhost:59093/",
// "RequireHttpsMetadata": "false"
// },
// "Auth_App": {
// "ClientId": "Auth_App",
// "ClientSecret": "1q2w3e*",
// "RootUrl": "http://localhost:59093",
// "RequireHttpsMetadata": "false"
// },
// "Auth_Swagger": {
// "ClientId": "Auth_Swagger",
// "ClientSecret": "1q2w3e*",
// "RootUrl": "http://localhost:59093",
// "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] (
[Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
@ -2579,6 +2582,9 @@ CREATE TABLE [Job_UnplannedIssueJobDetail] (
CREATE TABLE [Job_UnplannedReceiptJobDetail] (
[Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
@ -2957,6 +2963,7 @@ CREATE TABLE [Store_DeliverNoteDetail] (
[ItemDesc1] nvarchar(64) NULL,
[ItemDesc2] nvarchar(64) NULL,
[ItemCode] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[FromPackingCode] nvarchar(64) NOT NULL,
@ -2993,7 +3000,6 @@ CREATE TABLE [Store_DeliverNoteDetail] (
[RecommendFromLocationGroup] nvarchar(64) NULL,
[RecommendFromLocationErpCode] nvarchar(64) NULL,
[RecommendFromWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL,
@ -3411,6 +3417,7 @@ CREATE TABLE [Store_IssueNoteDetail] (
[ItemDesc1] nvarchar(64) NULL,
[ItemDesc2] nvarchar(64) NULL,
[ItemCode] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[FromPackingCode] nvarchar(450) NULL,
@ -3447,7 +3454,6 @@ CREATE TABLE [Store_IssueNoteDetail] (
[RecommendFromLocationGroup] nvarchar(64) NULL,
[RecommendFromLocationErpCode] nvarchar(64) NULL,
[RecommendFromWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL,
@ -3855,6 +3861,7 @@ CREATE TABLE [Store_ProductionReturnNoteDetail] (
[ItemDesc1] nvarchar(64) NULL,
[ItemDesc2] nvarchar(64) NULL,
[ItemCode] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[FromPackingCode] nvarchar(450) NULL,
@ -3891,7 +3898,6 @@ CREATE TABLE [Store_ProductionReturnNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL,
@ -4021,6 +4027,7 @@ CREATE TABLE [Store_ProductReceiptNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL,
@ -4035,7 +4042,6 @@ CREATE TABLE [Store_ProductReceiptNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL,
@ -4279,6 +4285,7 @@ CREATE TABLE [Store_PurchaseReceiptNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL,
@ -4293,7 +4300,6 @@ CREATE TABLE [Store_PurchaseReceiptNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL,
@ -4378,6 +4384,7 @@ CREATE TABLE [Store_PurchaseReturnNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL,
@ -4392,7 +4399,6 @@ CREATE TABLE [Store_PurchaseReturnNoteDetail] (
[RecommendFromLocationGroup] nvarchar(64) NULL,
[RecommendFromLocationErpCode] nvarchar(64) NULL,
[RecommendFromWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL,
@ -4466,6 +4472,7 @@ CREATE TABLE [Store_PutawayNoteDetail] (
[ItemDesc1] nvarchar(64) NULL,
[ItemDesc2] nvarchar(64) NULL,
[ItemCode] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[FromPackingCode] nvarchar(450) NULL,
@ -4502,7 +4509,6 @@ CREATE TABLE [Store_PutawayNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL,
@ -4875,6 +4881,9 @@ CREATE TABLE [Store_TransferRequestDetail] (
CREATE TABLE [Store_UnplannedIssueNoteDetail] (
[Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
@ -4901,6 +4910,7 @@ CREATE TABLE [Store_UnplannedIssueNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL,
@ -4915,7 +4925,6 @@ CREATE TABLE [Store_UnplannedIssueNoteDetail] (
[RecommendFromLocationGroup] nvarchar(64) NULL,
[RecommendFromLocationErpCode] nvarchar(64) NULL,
[RecommendFromWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL,
@ -4937,6 +4946,9 @@ CREATE TABLE [Store_UnplannedIssueNoteDetail] (
CREATE TABLE [Store_UnplannedIssueRequestDetail] (
[Id] uniqueidentifier NOT NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
@ -4974,6 +4986,9 @@ CREATE TABLE [Store_UnplannedIssueRequestDetail] (
CREATE TABLE [Store_UnplannedReceiptNoteDetail] (
[Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
@ -5000,6 +5015,7 @@ CREATE TABLE [Store_UnplannedReceiptNoteDetail] (
[LocationErpCode] nvarchar(64) NOT NULL,
[WarehouseCode] nvarchar(64) NOT NULL,
[Status] nvarchar(64) NOT NULL,
[Uom] nvarchar(64) NOT NULL,
[Qty] decimal(18,6) NOT NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[RecommendContainerCode] nvarchar(64) NULL,
@ -5014,7 +5030,6 @@ CREATE TABLE [Store_UnplannedReceiptNoteDetail] (
[RecommendToLocationGroup] nvarchar(64) NULL,
[RecommendToLocationErpCode] nvarchar(64) NULL,
[RecommendToWarehouseCode] nvarchar(64) NULL,
[Uom] nvarchar(64) NOT NULL,
[RecommendQty] decimal(18,6) NOT NULL,
[HandledContainerCode] nvarchar(64) NULL,
[HandledPackingCode] nvarchar(64) NULL,
@ -5036,6 +5051,10 @@ CREATE TABLE [Store_UnplannedReceiptNoteDetail] (
CREATE TABLE [Store_UnplannedReceiptRequestDetail] (
[Id] uniqueidentifier NOT NULL,
[ReasonCode] nvarchar(max) NULL,
[CaseCode] nvarchar(max) NULL,
[ProjCapacityCode] nvarchar(max) NULL,
[OnceBusiCode] nvarchar(max) NULL,
[ExtraProperties] nvarchar(max) NULL,
[CreationTime] datetime2 NOT 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 Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Json;
using Win_in.Sfs.Basedata.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.BaseDatas;
@ -18,9 +21,11 @@ public class DictController : AbpController
///
/// </summary>
/// <param name="dictApp"></param>
public DictController(IDictAppService dictApp)
public DictController(IDictAppService dictApp,IOptions<AbpJsonOptions> options)
{
_dictApp = dictApp;
var str = options.Value.DefaultDateTimeFormat;
Console.WriteLine(str);
}
/// <summary>
@ -31,6 +36,8 @@ public class DictController : AbpController
[HttpGet("by-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.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
@ -70,13 +72,13 @@ public class JobController : AbpController
/// 获取全部任务数量统计
/// </summary>
/// <returns></returns>
[HttpGet("")]
public virtual async Task<ListResultDto<JobCountDto>> CountAsync()
[HttpGet("get-job-count/{isToday}")]
public virtual async Task<ListResultDto<JobCountDto>> CountAsync(Guid userId ,bool isToday)
{
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
var wlgCodes = await _userWorkGroupAppService.GetUserWorkGroupAsync(userId).ConfigureAwait(false);
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 list = new List<JobCountDto>();
@ -146,7 +148,7 @@ public class JobController : AbpController
}).ConfigureAwait(false);
list.Add(new JobCountDto { JobType = EnumJobType.ProductReceiveJob, Count = productReceiveJobs });
var purchaseReceiptJobs = await _purchaseReceiptJobAppService.GetCountByFilterAsync(new SfsJobRequestInputBase
var purchaseReceiptJobRequest = new SfsJobRequestInputBase
{
Condition = new Condition
{
@ -156,7 +158,13 @@ public class JobController : AbpController
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 });
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>()
.IgnoreAuditedObjectProperties();
;
CreateMap<DictImportInput, Dict>()
.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.ItemDesc1 = item.Desc1;
dto.ItemDesc2 = item.Desc2;
dto.Uom = item.BasicUom;
}
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>()
.ReverseMap();
CreateMap<ContainerDetail, ContainerDetailDTO>().IgnoreAuditedObjectProperties();
CreateMap<ContainerDetail, ContainerDetailDTO>()
;
CreateMap<ContainerDetailInput, ContainerDetail>()
.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
{
if (existBalance.IsActive == false)
{
throw new UserFriendlyException($"库位在{existBalance.LocationCode}," +
$"物品编号为{existBalance.ItemCode}," +
$"箱码为{existBalance.PackingCode}," +
$"批次为{existBalance.Lot}," +
$"状态为{existBalance.Status.GetDisplayName()}" +
$"的库存是不可用状态");
}
//如果单件管理的库存已存在,报错
transaction.CheckSingleUnitHasExist();
existBalance.IncreaseQty(transaction.Qty);
@ -202,6 +211,16 @@ public class BalanceManager : DomainService, IBalanceManager
}
else
{
if (existBalance.IsActive == false)
{
throw new UserFriendlyException($"库位在{existBalance.LocationCode}," +
$"物品编号为{existBalance.ItemCode}," +
$"箱码为{existBalance.PackingCode}," +
$"批次为{existBalance.Lot}," +
$"状态为{existBalance.Status}" +
$"的库存是不可用状态");
}
existBalance.IncreaseQty(transaction.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 IItemBasicAclService _itemBasicAclService;
private readonly ILocationAclService _locationAclService;
private readonly ITransactionTypeAclService _transactionTypeAclService;
//private readonly ITransactionTypeAclService _transactionTypeAclService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
private readonly ITransactionRepository _transactionRepository;
private readonly IBalanceRepository _balanceRepository;
private readonly ISnowflakeIdGenerator _numberGenerator;
@ -28,20 +29,22 @@ public class TransactionManager : DomainService, ITransactionManager
IBalanceManager balanceManager
, IItemBasicAclService itemBasicAclService
, ILocationAclService locationAclService
, ITransactionTypeAclService transactionTypeAclService
//, ITransactionTypeAclService transactionTypeAclService
, ITransactionRepository transactionRepository
, IBalanceRepository balanceRepository
, ISnowflakeIdGenerator numberGenerator
, ILocationCapacityManager locationCapacityManager)
, ILocationCapacityManager locationCapacityManager
, ITransactionTypeAppService transactionTypeAppService)
{
_balanceManager = balanceManager;
_itemBasicAclService = itemBasicAclService;
_locationAclService = locationAclService;
_transactionTypeAclService = transactionTypeAclService;
//_transactionTypeAclService = transactionTypeAclService;
_transactionRepository = transactionRepository;
_balanceRepository = balanceRepository;
_numberGenerator = numberGenerator;
_locationCapacityManager = locationCapacityManager;
_transactionTypeAppService = transactionTypeAppService;
}
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 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);
//执行库存余额的变动
@ -158,7 +161,7 @@ public class TransactionManager : DomainService, ITransactionManager
//库位注意大小写
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);
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()
{
CreateMap<CountLabel, CountLabelDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
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()
{
CreateMap<PalletCode, PalletCodeDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
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()
{
CreateMap<PalletLabel, PalletLabelDto>()
.IgnoreAuditedObjectProperties()
.ForMember(x => x.ItemName, y => y.MapFrom(d => d.Name))
.ForMember(x => x.ItemDesc1, y => y.MapFrom(d => d.Desc1))
.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()
{
CreateMap<SaleLabel, SaleLabelDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
}
}

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

@ -10,7 +10,6 @@ public class SerialCodeAutoMapperProfile : Profile
public SerialCodeAutoMapperProfile()
{
CreateMap<SerialCode, SerialCodeDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
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()
{
CreateMap<MessageTypeSubscribe, MessageTypeSubscribeDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
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()
{
CreateMap<MessageType, MessageTypeDto>()
.IgnoreAuditedObjectProperties()
.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()
{
CreateMap<NotifyMessage, NotifyMessageDto>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
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()
{
CreateMap<PrivateMessage, PrivateMessageDto>()
.IgnoreAuditedObjectProperties()
.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()
{
CreateMap<UserNotifyMessage, UserNotifyMessageDto>()
.IgnoreAuditedObjectProperties()
.BeforeMap((x, y) => y.UserId = x.CreatorId==null?Guid.Empty: x.CreatorId.Value)
.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 Microsoft.Extensions.Caching.Distributed;
using Volo.Abp.Caching;
using Volo.Abp.Json;
namespace Win_in.Sfs.Shared.Application;
@ -27,6 +28,10 @@ public static class CachingExtensions
{
TCacheItem cacheItem;
//return await factory.Invoke().ConfigureAwait(false);
//todo 有问题 时间转换 坑坑坑
var result = await cache.GetAsync(key).ConfigureAwait(false);
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,
input.Sorting, true).ConfigureAwait(false);
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>

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;
public enum EnumJobStatus
@ -5,30 +8,36 @@ public enum EnumJobStatus
/// <summary>
/// 空枚举
/// </summary>
[Display(Name = "空枚举")]
None = 0,
/// <summary>
/// 待处理
/// </summary>
[Display(Name = "待处理")]
Open = 1,
/// <summary>
/// 执行中
/// </summary>
[Display(Name = "执行中")]
Doing = 2,
/// <summary>
/// 完成
/// </summary>
[Display(Name = "完成")]
Done = 3,
/// <summary>
/// 关闭
/// </summary>
[Display(Name = "关闭")]
Closed = 8,
/// <summary>
/// 作废
/// </summary>
[Display(Name = "作废")]
Cancelled = 9
}

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

@ -106,7 +106,6 @@ public abstract class SfsMasterAggregateRootBase<TDetail> : SfsAggregateRootBase
property.SetValue(detail, newValue);
}
}
/*
////todo check
//var detail = GetDetail(id);

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

@ -1,10 +1,15 @@
using System;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.InkML;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
@ -20,6 +25,7 @@ using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using NUglify.Helpers;
using Serilog.Formatting.Json;
using StackExchange.Redis;
using Swashbuckle.AspNetCore.SwaggerGen;
using Volo.Abp;
@ -35,8 +41,11 @@ using Volo.Abp.Content;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Guids;
using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson.JsonConverters;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Timing;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport;
using Win_in.Sfs.Shared.Domain.Shared;
@ -70,6 +79,7 @@ public abstract class ModuleBase<T> : AbpModule where T : AbpModule
ConfigureAutoApiControllers();
ConfigureSwaggerServices();
ConfigureAddCors();
Configure();
SetFormLimit();
ConfigureExceptionHanding();
}
@ -238,6 +248,9 @@ public abstract class ModuleBase<T> : AbpModule where T : AbpModule
protected virtual void Configure()
{
//todo 解决时间
// ServiceConfigurationContext.Services.AddTransient<IJsonSerializer,ConvertAbpJson>();
}
protected virtual void ConfigureAddCors()
@ -440,4 +453,35 @@ public abstract class ModuleBase<T> : AbpModule where T : AbpModule
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,
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 = "原因代码")]
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 = "原因代码")]
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>

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;
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 = "原因代码")]
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>

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 = "原因代码")]
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 = "原因代码")]
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>

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>
[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; }
}

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 = "原因代码")]
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>

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}是必填项")]
[ImporterHeader(Name = "调拨类型")]
[ExporterHeader(DisplayName = "调拨类型")]
[ValueMapping("区域间调拨(储位调拨)", EnumTransSubType.Transfer_Area)]
[ValueMapping("线边调拨(线边仓调拨)", EnumTransSubType.Transfer_WIP)]
[ValueMapping("客户库位调拨(客户储位调拨)", EnumTransSubType.Transfer_Customer)]
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>
[Display(Name = "扩展属性")]
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>
[Display(Name = "扩展属性")]
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
, 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>

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
{
/// <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>

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.Contracts;
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.Domain;
@ -153,6 +154,12 @@ public abstract class SfsJobAppServiceBase<TEntity, TDetail, TEntityDto, TReques
public virtual async Task<TEntityDto> CompleteAsync(Guid id, TEntityDto 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 handleDto = ObjectMapper.Map<TEntity, TEntityDto>(handleResult);
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()
{
CreateMap<ExchangeData, ExchangeDataDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
// CreateMap<ExchangeDataCreateInput, ExchangeData>()
// .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();
CreateMap<CheckJobDetail, CheckJobDetailDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
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);
CreateMap<CountJobDetail, CountJobDetailDTO>()
.IgnoreAuditedObjectProperties()
;
CreateMap<CountJobDetailDTO, CountJobDetail>()
.IgnoreAuditedObjectProperties()
;
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();
CreateMap<DeliverJobDetail, DeliverJobDetailDTO>()
.IgnoreAuditedObjectProperties();
;
CreateMap<DeliverJobDetailDTO, DeliverJobDetail>()
.IgnoreAuditedObjectProperties();
;
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>()
.IgnoreAuditedObjectProperties()
;
CreateMap<InspectJobDetailDTO, InspectJobDetail>()
.IgnoreAuditedObjectProperties()
;
CreateMap<InspectJobDetailInput, InspectJobDetail>()
@ -31,11 +29,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.Id);
CreateMap<InspectJobSummaryDetail, InspectJobSummaryDetailDTO>()
.IgnoreAuditedObjectProperties()
;
CreateMap<InspectJobSummaryDetailDTO, InspectJobSummaryDetail>()
.IgnoreAuditedObjectProperties()
;
CreateMap<InspectJobSummaryDetailInput, InspectJobSummaryDetail>()
@ -47,7 +43,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
;
CreateMap<InspectRequestDTO, InspectJob>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.WarehouseCode)
.Ignore(x => x.Details)
.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 Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
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>
///

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<IssueJobDetail, IssueJobDetailDTO>()
.IgnoreAuditedObjectProperties()
;
CreateMap<IssueJobDetailDTO, IssueJobDetail>()
.IgnoreAuditedObjectProperties()
;
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();
CreateMap<JisDeliverJobDetail, JisDeliverJobDetailDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
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();
CreateMap<ProductReceiveJobDetail, ProductReceiveJobDetailDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
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();
CreateMap<ProductionReturnJobDetail, ProductionReturnJobDetailDTO>()
.IgnoreAuditedObjectProperties()
;
CreateMap<ProductionReturnJobEditInput, ProductionReturnJob>();
@ -26,7 +25,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.Id);
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>()
.IgnoreAuditedObjectProperties()
;
CreateMap<PurchaseReceiptJobDetailDTO, PurchaseReceiptJobDetail>()
.IgnoreAuditedObjectProperties()
;
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();
CreateMap<PurchaseReturnJobDetail, PurchaseReturnJobDetailDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
CreateMap<PurchaseReturnJobDetailInput, PurchaseReturnJobDetail>()

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAutoMapperProfile.cs

@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.ReverseMap();
CreateMap<UnplannedIssueJobDetail, UnplannedIssueJobDetailDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
CreateMap<UnplannedIssueJobDetailInput, UnplannedIssueJobDetail>()

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

Loading…
Cancel
Save