wanggang 2 years ago
parent
commit
59d2ef34d5
  1. 7
      .vs/VSWorkspaceState.json
  2. BIN
      .vs/东阳程序最新版/v17/.suo
  3. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/IPlanRepository.cs
  4. 5
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/PlanManager.cs
  5. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs
  6. 4
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs
  7. 3
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanDbContextModelCreatingExtensions.cs
  8. 27
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanEfCoreRepository.cs
  9. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs
  10. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Ships/ShipDbContextModelCreatingExtensions.cs
  11. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs
  12. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp.csproj
  13. 18
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs
  14. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs
  15. 28
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
  16. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanConverter.cs
  17. 10
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs
  18. 9
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs
  19. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs
  20. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs
  21. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs
  22. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.csproj
  23. 14
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json
  24. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/IssueConverter.cs
  25. 21
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
  26. 16
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs
  27. 3
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs
  28. 23
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs
  29. 18
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs
  30. 1
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj
  31. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluConverter.cs
  32. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomConverter.cs
  33. 5
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomReader.cs
  34. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/CustomerConverter.cs
  35. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DepartmentConverter.cs
  36. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs
  37. 5
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictpjReader.cs
  38. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/InterfaceCalendarConverter.cs
  39. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs
  40. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/SupplierConverter.cs
  41. 84
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs
  42. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/UserConverter.cs
  43. 139
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs
  44. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs
  45. 12
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
  46. 4
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs
  47. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs
  48. 1
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj
  49. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json
  50. 6
      be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs
  51. 4
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
  52. 11
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs
  53. 1
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs
  54. 1
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumSystemType.cs
  55. 3
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/ArchivedIncomingFromExternal/IArchivedIncomingFromExternalRepository.cs
  56. 1
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IIncomingFromExternalManager.cs
  57. 8
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IncomingFromExternalManager.cs
  58. 1
      be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.LabelDbContext.sql
  59. 32
      be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/AsnTimeWindowController.cs
  60. 199
      be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs
  61. 262
      be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs
  62. 352
      be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs
  63. 7
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs
  64. 157
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql
  65. 67
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs
  66. 6
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs
  67. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs
  68. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs
  69. 6
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs
  70. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs
  71. 2
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs
  72. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs
  73. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs
  74. 70
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs
  75. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs
  76. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs
  77. 14
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs
  78. 2
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs
  79. 13
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs
  80. 23
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs
  81. 2
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs
  82. 1
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs
  83. 4
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAutoMapperProfile.cs
  84. 3
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Calendars/InterfaceCalendarAutoMapperProfile.cs
  85. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAutoMapperProfile.cs
  86. 4
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Customers/CustomerAutoMapperProfile.cs
  87. 4
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ErpLocations/ErpLocationAutoMapperProfile.cs
  88. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs
  89. 45
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs
  90. 30
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteExchangeDto.cs
  91. 3
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAutoMapperProfile.cs
  92. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierItems/SupplierItemAutoMapperProfile.cs
  93. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Suppliers/SupplierAutoMapperProfile.cs
  94. 1
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs
  95. 1
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs
  96. 8
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs
  97. 5
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs
  98. 17
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs
  99. 7
      be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelDto.cs
  100. 7
      be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelEditInput.cs

7
.vs/VSWorkspaceState.json

@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\WZC2.sln",
"PreviewInSolutionExplorer": false
}

BIN
.vs/东阳程序最新版/v17/.suo

Binary file not shown.

6
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/IPlanRepository.cs

@ -1,7 +1,13 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
public interface IPlanRepository : IRepository<Plan, decimal> public interface IPlanRepository : IRepository<Plan, decimal>
{ {
Task BulkUpdateAsync(IList<Plan> entities, BulkConfig bulkConfig = null, Action<decimal> progress = null, Type type = null, CancellationToken cancellationToken = default);
} }

5
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/PlanManager.cs

@ -1,6 +1,8 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Services; using Volo.Abp.Domain.Services;
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
@ -16,6 +18,7 @@ public class PlanManager : DomainService, IPlanManager
public virtual async Task<List<Plan>> GetToBeProcessedListAsync() public virtual async Task<List<Plan>> GetToBeProcessedListAsync()
{ {
var plans = await _repository.GetListAsync(p => p.WmsState == 0).ConfigureAwait(false); var plans = await _repository.GetListAsync(p => p.WmsState == 0).ConfigureAwait(false);
return plans; return plans;
} }
@ -29,6 +32,6 @@ public class PlanManager : DomainService, IPlanManager
p.WmsState = 1; p.WmsState = 1;
p.WmsDate = Clock.Now; p.WmsDate = Clock.Now;
}); });
await _repository.UpdateManyAsync(plans).ConfigureAwait(false); await _repository.BulkUpdateAsync(plans).ConfigureAwait(false);
} }
} }

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs

@ -19,7 +19,7 @@ public class PullTask : Entity<long>
/// <summary> /// <summary>
/// 数量 /// 数量
/// </summary> /// </summary>
public decimal Planqty { get; set; } public string Planqty { get; set; }
/// <summary> /// <summary>
/// 单号 /// 单号
/// </summary> /// </summary>

4
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs

@ -11,12 +11,12 @@ public static class ArriveDbContextModelCreatingExtensions
builder.Entity<ArriveNote>(b => builder.Entity<ArriveNote>(b =>
{ {
//Configure table & schema Name //Configure table & schema Name
b.ToTable(options.TablePrefix + "Sync_arrive", options.Schema); b.ToTable(options.TablePrefix + "Sync_arrrive", options.Schema);
//Configure ABP properties //Configure ABP properties
b.ConfigureByConvention(); b.ConfigureByConvention();
//Properties //Properties
b.Property(q => q.Id).UseIdentityColumn(); b.Property(q => q.Id).ValueGeneratedOnAdd();
b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.PlanBillNo).HasMaxLength(255);
b.Property(q => q.ShipBillNo).HasMaxLength(255); b.Property(q => q.ShipBillNo).HasMaxLength(255);
b.Property(q => q.DocNo).HasMaxLength(255); b.Property(q => q.DocNo).HasMaxLength(255);

3
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanDbContextModelCreatingExtensions.cs

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Entities;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
@ -16,7 +17,7 @@ public static class PlanDbContextModelCreatingExtensions
b.ConfigureByConvention(); b.ConfigureByConvention();
//Properties //Properties
b.Property(q => q.Id).UseIdentityColumn(); b.Property(q => q.Id).IsRequired().HasColumnType("numeric(18,0)");//.HasPrecision(18, 0);
b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.PlanBillNo).HasMaxLength(255);
b.Property(q => q.ERP).HasMaxLength(255); b.Property(q => q.ERP).HasMaxLength(255);
b.Property(q => q.Qty).HasPrecision(18, 5); b.Property(q => q.Qty).HasPrecision(18, 5);

27
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanEfCoreRepository.cs

@ -1,5 +1,12 @@
using EFCore.BulkExtensions;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading;
using System;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos.EOS; namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos.EOS;
@ -9,5 +16,25 @@ public class PlanEfCoreRepository : EfCoreRepository<EosDbContext, Plan, decimal
public PlanEfCoreRepository(IDbContextProvider<EosDbContext> dbContextProvider) public PlanEfCoreRepository(IDbContextProvider<EosDbContext> dbContextProvider)
: base(dbContextProvider) : base(dbContextProvider)
{ {
}
/// <summary>
/// 批量更新数据
/// </summary>
/// <param name="entities"></param>
/// <param name="bulkConfig"></param>
/// <param name="progress"></param>
/// <param name="type"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public virtual async Task BulkUpdateAsync(IList<Plan> entities, BulkConfig bulkConfig = null, Action<decimal> progress = null, Type type = null, CancellationToken cancellationToken = default(CancellationToken))
{
var context = (await GetDbContextAsync().ConfigureAwait(false)) as DbContext;
if (entities != null && entities.Count > 0)
{
await context.BulkUpdateAsync(entities, bulkConfig, progress, type, cancellationToken).ConfigureAwait(false);
}
} }
} }

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs

@ -16,7 +16,7 @@ public static class ReturnDbContextModelCreatingExtensions
b.ConfigureByConvention(); b.ConfigureByConvention();
//Properties //Properties
b.Property(q => q.Id).UseIdentityColumn(); b.Property(q => q.Id).ValueGeneratedOnAdd();
b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.PlanBillNo).HasMaxLength(255);
b.Property(q => q.ShipBillNo).HasMaxLength(255); b.Property(q => q.ShipBillNo).HasMaxLength(255);
b.Property(q => q.DocNo).HasMaxLength(255); b.Property(q => q.DocNo).HasMaxLength(255);

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Ships/ShipDbContextModelCreatingExtensions.cs

@ -16,7 +16,7 @@ public static class ShipDbContextModelCreatingExtensions
b.ConfigureByConvention(); b.ConfigureByConvention();
//Properties //Properties
b.Property(q => q.Id).UseIdentityColumn(); b.Property(q => q.Id);
b.Property(q => q.PlanBillNo).HasMaxLength(255); b.Property(q => q.PlanBillNo).HasMaxLength(255);
b.Property(q => q.ShipBillNo).HasMaxLength(255); b.Property(q => q.ShipBillNo).HasMaxLength(255);
b.Property(q => q.DetailMatNo).HasMaxLength(255); b.Property(q => q.DetailMatNo).HasMaxLength(255);

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs

@ -20,7 +20,7 @@ public static class PullTaskDbContextModelCreatingExtensions
b.Property(q => q.no).HasMaxLength(255); b.Property(q => q.no).HasMaxLength(255);
b.Property(q => q.Itemno).HasMaxLength(255); b.Property(q => q.Itemno).HasMaxLength(255);
b.Property(q => q.Plant).HasMaxLength(255); b.Property(q => q.Plant).HasMaxLength(255);
b.Property(q => q.Planqty).HasPrecision(18, 2); b.Property(q => q.Planqty).HasMaxLength(255);
b.Property(q => q.Yl1); b.Property(q => q.Yl1);
}); });

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Tyrp.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>

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

@ -7,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Polly; using Polly;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper; using Volo.Abp.AutoMapper;
using Volo.Abp.BackgroundJobs; using Volo.Abp.BackgroundJobs;
@ -39,7 +40,8 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
typeof(DataExchangeDomainModule), typeof(DataExchangeDomainModule),
typeof(DataExchangeEntityFrameworkCoreModule), typeof(DataExchangeEntityFrameworkCoreModule),
typeof(DataExchangeDomainFawtygEosModule), typeof(DataExchangeDomainFawtygEosModule),
typeof(DataExchangeEntityFrameworkCoreFawtygModule) typeof(DataExchangeEntityFrameworkCoreFawtygModule),
typeof(AbpAccountApplicationContractsModule)
)] )]
public class EosAgentModule : AbpModule public class EosAgentModule : AbpModule
{ {
@ -144,6 +146,10 @@ public class EosAgentModule : AbpModule
typeof(BasedataApplicationContractsModule).Assembly, typeof(BasedataApplicationContractsModule).Assembly,
"BaseData" "BaseData"
); );
context.Services.AddHttpClientProxies(
typeof(AbpAccountApplicationContractsModule).Assembly,
"Auth"
);
context.Services.AddHttpClientProxies( context.Services.AddHttpClientProxies(
typeof(StoreApplicationContractsModule).Assembly, typeof(StoreApplicationContractsModule).Assembly,
"Store" "Store"
@ -154,11 +160,13 @@ public class EosAgentModule : AbpModule
); );
} }
public override async Task OnApplicationInitializationAsync(
ApplicationInitializationContext context) public override void OnApplicationInitialization(
ApplicationInitializationContext context)
{ {
await context.AddBackgroundWorkerAsync<EosIncomingBackgroundWorker>().ConfigureAwait(false);
await context.AddBackgroundWorkerAsync<EosOutgoingBackgroundWorker>().ConfigureAwait(false); context.AddBackgroundWorkerAsync<EosIncomingBackgroundWorker>();
// context.AddBackgroundWorkerAsync<EosOutgoingBackgroundWorker>();
} }
} }

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs

@ -1,6 +1,7 @@
using AutoMapper; using AutoMapper;
using Volo.Abp.AutoMapper; using Volo.Abp.AutoMapper;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Label.Domain.Shared; using Win_in.Sfs.Label.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain;
@ -102,5 +103,12 @@ public class FawtygAutoMapperProfile : Profile
.ForMember(x => x.Version, y => y.MapFrom(d => d.Remark)) .ForMember(x => x.Version, y => y.MapFrom(d => d.Remark))
.ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => d.PackQty)) .ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => d.PackQty))
.ForMember(x => x.SupplierPackUom, y => y.MapFrom(d => d.PackUom)); .ForMember(x => x.SupplierPackUom, y => y.MapFrom(d => d.PackUom));
CreateMap<SupplierItemEditInput, SupplierItem>()
.IgnoreAuditedObjectProperties()
//.ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => new UomQty(d.SupplierPackUom, d.SupplierPackQty)))
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id);
} }
} }

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

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

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanConverter.cs

@ -14,6 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
public class PlanConverter : IIncomingConverter public class PlanConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
private readonly IItemPackAppService _itemPackAppService; private readonly IItemPackAppService _itemPackAppService;
@ -27,10 +28,12 @@ public class PlanConverter : IIncomingConverter
IItemPackAppService itemPackAppService, IItemPackAppService itemPackAppService,
IObjectMapper objectMapper, IObjectMapper objectMapper,
ILogger<PlanConverter> logger, ILogger<PlanConverter> logger,
IConfiguration configuration IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager
) )
{ {
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_itemBasicAppService = itemBasicAppService; _itemBasicAppService = itemBasicAppService;
_itemPackAppService = itemPackAppService; _itemPackAppService = itemPackAppService;
@ -48,7 +51,8 @@ public class PlanConverter : IIncomingConverter
//按PlanBillNo合并PurchaseOrder //按PlanBillNo合并PurchaseOrder
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)

10
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs

@ -4,6 +4,7 @@ using System.Linq;
using System.Text.Json; using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Volo.Abp.Guids;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
@ -18,16 +19,19 @@ public class PlanReader : IReader
private readonly IPlanManager _planManager; private readonly IPlanManager _planManager;
private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly ILogger<PlanReader> _logger; private readonly ILogger<PlanReader> _logger;
private readonly IGuidGenerator _guidGenerator;
public PlanReader( public PlanReader(
IPlanManager planManager IPlanManager planManager
, IIncomingFromExternalManager incomingFromExternalManager , IIncomingFromExternalManager incomingFromExternalManager
, ILogger<PlanReader> logger , ILogger<PlanReader> logger
, IGuidGenerator guidGenerator
) )
{ {
_planManager = planManager; _planManager = planManager;
_incomingFromExternalManager = incomingFromExternalManager; _incomingFromExternalManager = incomingFromExternalManager;
_logger = logger; _logger = logger;
_guidGenerator = guidGenerator;
} }
public virtual async Task<List<IncomingFromExternal>> ReadAsync() public virtual async Task<List<IncomingFromExternal>> ReadAsync()
@ -41,7 +45,7 @@ public class PlanReader : IReader
} }
//Plan逐一转换为PurchaseOrder //Plan逐一转换为PurchaseOrder
var incomingDataList = BuildIncomingFromExternalFromPlanAsync(toBeProcessedPlans); var incomingDataList = BuildIncomingFromExternalFromPlanAsync(toBeProcessedPlans);
await _incomingFromExternalManager.CreateManyAsync(incomingDataList).ConfigureAwait(false); await _incomingFromExternalManager.CreateBulkAsync(incomingDataList).ConfigureAwait(false);
//更新EOS数据状态 //更新EOS数据状态
await _planManager.UpdateProcessedListAsync(toBeProcessedPlans).ConfigureAwait(false); await _planManager.UpdateProcessedListAsync(toBeProcessedPlans).ConfigureAwait(false);
return incomingDataList; return incomingDataList;
@ -55,7 +59,7 @@ public class PlanReader : IReader
var incomingData = BuildIncomingFromExternal(plan); var incomingData = BuildIncomingFromExternal(plan);
incomingData.SetEffectiveDate(plan.EosDate); incomingData.SetEffectiveDate(plan.EosDate);
incomingData.SetId(_guidGenerator.Create());
try try
{ {
var po = BuildPurchaseOrderExchangeDto(plan); var po = BuildPurchaseOrderExchangeDto(plan);

9
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs

@ -7,6 +7,7 @@ using Microsoft.Extensions.Logging;
using Volo.Abp.Guids; using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.WMS.ItemPack; using Win_in.Sfs.Wms.DataExchange.WMS.ItemPack;
@ -15,6 +16,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.Incoming;
public class ProductConverter : IIncomingConverter public class ProductConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly ISupplierAppService _supplierAppService; private readonly ISupplierAppService _supplierAppService;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
@ -27,9 +29,11 @@ public class ProductConverter : IIncomingConverter
IObjectMapper objectMapper, IObjectMapper objectMapper,
ILogger<ProductConverter> logger, ILogger<ProductConverter> logger,
IGuidGenerator guidGenerator, IGuidGenerator guidGenerator,
IConfiguration configuration IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager
) )
{ {
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_supplierAppService = supplierAppService; _supplierAppService = supplierAppService;
@ -53,7 +57,8 @@ public class ProductConverter : IIncomingConverter
incomingToWmsDataList.AddRange(supplierItemIncomingToWmsDataList); incomingToWmsDataList.AddRange(supplierItemIncomingToWmsDataList);
//添加IncomingToWms //添加IncomingToWms
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildItemPackIncomingToWmsOfProductAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildItemPackIncomingToWmsOfProductAsync(List<IncomingFromExternal> incomingDataList)

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

@ -17,6 +17,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
public class ShipConverter : IIncomingConverter public class ShipConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
@ -29,9 +30,11 @@ public class ShipConverter : IIncomingConverter
, IItemBasicAppService itemBasicAppService , IItemBasicAppService itemBasicAppService
, IItemPackAppService itemPackAppService , IItemPackAppService itemPackAppService
, ILogger<ShipConverter> logger, , ILogger<ShipConverter> logger,
IConfiguration configuration IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager
) )
{ {
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_itemBasicAppService = itemBasicAppService; _itemBasicAppService = itemBasicAppService;
@ -54,6 +57,8 @@ public class ShipConverter : IIncomingConverter
var purchaseLabelList = BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList); var purchaseLabelList = BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList);
await _incomingToWmsManager.CreateManyAsync(purchaseLabelList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(purchaseLabelList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private List<IncomingToWms> BuildIncomingToWmsOfPurchaseLabelAsync(List<IncomingFromExternal> incomingFromExternalList) private List<IncomingToWms> BuildIncomingToWmsOfPurchaseLabelAsync(List<IncomingFromExternal> incomingFromExternalList)

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

@ -35,7 +35,7 @@ public class ArriveConverter : IOutgoingConverter
{ {
var outgoingToExternalList = new List<OutgoingToExternal>(); var outgoingToExternalList = new List<OutgoingToExternal>();
var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReceipt, EnumSystemType.SCP).ConfigureAwait(false); var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReceipt, EnumSystemType.EOS).ConfigureAwait(false);
foreach (var outgoingFromWms in outgoingFromWmsList) foreach (var outgoingFromWms in outgoingFromWmsList)
{ {

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ReturnConverter.cs

@ -35,7 +35,7 @@ public class ReturnConverter : IOutgoingConverter
{ {
var outgoingToExternalList = new List<OutgoingToExternal>(); var outgoingToExternalList = new List<OutgoingToExternal>();
var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReturn, EnumSystemType.SCP).ConfigureAwait(false); var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReturn, EnumSystemType.EOS).ConfigureAwait(false);
foreach (var outgoingFromWms in outgoingFromWmsList) foreach (var outgoingFromWms in outgoingFromWmsList)
{ {

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.csproj

@ -15,6 +15,13 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.12" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.12" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.*" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.*" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.12" /> <PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.12" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="6.3.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="6.0.2" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="5.3.5" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="5.3.5" />
<PackageReference Include="Volo.Abp.BackgroundJobs" Version="5.3.5" /> <PackageReference Include="Volo.Abp.BackgroundJobs" Version="5.3.5" />
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="5.3.5" /> <PackageReference Include="Volo.Abp.BackgroundWorkers" Version="5.3.5" />

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

@ -1,12 +1,12 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,13319;Database=DyWmsAuth;uid=ccwin-in;pwd=Microsoft@2022;", "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!;", "DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True",
"EOS": "Server=dev.ccwin-in.com,13319;Database=EOS;Uid=ccwin-in;Pwd=Microsoft@2022;" "EOS": "Server=61.139.155.47;Database=EOSCC;Uid=wms;Pwd=1;TrustServerCertificate=True"
}, },
"AuthServer": { "AuthServer": {
"Authority": "http://dev.ccwin-in.com:59093/", "Authority": "http://dev.ccwin-in.com:21293/",
"RequireHttpsMetadata": "false", "RequireHttpsMetadata": "false",
"SwaggerClientId": "admin", "SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*", "SwaggerClientSecret": "1q2w3E*",
@ -25,13 +25,13 @@
"RemoteServices": { "RemoteServices": {
"BaseData": { "BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:59094/" "BaseUrl": "http://dev.ccwin-in.com:21294/"
}, },
"Store": { "Store": {
"BaseUrl": "http://dev.ccwin-in.com:59095/" "BaseUrl": "http://dev.ccwin-in.com:21295/"
}, },
"Label": { "Label": {
"BaseUrl": "http://dev.ccwin-in.com:59092/" "BaseUrl": "http://dev.ccwin-in.com:21292/"
} }
}, },
"EosOptions": { "EosOptions": {

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/IssueConverter.cs

@ -14,6 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
public class IssueConverter : IIncomingConverter public class IssueConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
@ -25,10 +26,12 @@ public class IssueConverter : IIncomingConverter
IItemBasicAppService itemBasicAppService, IItemBasicAppService itemBasicAppService,
IObjectMapper objectMapper, IObjectMapper objectMapper,
ILogger<IssueConverter> logger, ILogger<IssueConverter> logger,
IConfiguration configuration IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager
) )
{ {
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_itemBasicAppService = itemBasicAppService; _itemBasicAppService = itemBasicAppService;
_objectMapper = objectMapper; _objectMapper = objectMapper;
@ -44,7 +47,8 @@ public class IssueConverter : IIncomingConverter
} }
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)

21
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs

@ -5,6 +5,7 @@ using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Org.BouncyCastle.Asn1.Pkcs;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
@ -16,6 +17,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
public class MesOutConverter : IIncomingConverter public class MesOutConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
@ -29,7 +31,8 @@ public class MesOutConverter : IIncomingConverter
, IItemBasicAppService itemBasicAppService , IItemBasicAppService itemBasicAppService
, ILogger<MesOutConverter> logger, , ILogger<MesOutConverter> logger,
IConfiguration configuration, IConfiguration configuration,
ILocationAppService locationAppService) ILocationAppService locationAppService,
IIncomingFromExternalManager incomingFromExternalManager)
{ {
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
@ -37,6 +40,7 @@ public class MesOutConverter : IIncomingConverter
_logger = logger; _logger = logger;
_configuration = configuration; _configuration = configuration;
_locationAppService = locationAppService; _locationAppService = locationAppService;
_incomingFromExternalManager = incomingFromExternalManager;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -49,6 +53,8 @@ public class MesOutConverter : IIncomingConverter
var productReceiptNoteList = await BuildIncomingToWmsOfProductReceiptNoteAsync(incomingFromExternalList).ConfigureAwait(false); var productReceiptNoteList = await BuildIncomingToWmsOfProductReceiptNoteAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(productReceiptNoteList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(productReceiptNoteList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfProductReceiptNoteAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfProductReceiptNoteAsync(List<IncomingFromExternal> incomingDataList)
@ -72,6 +78,7 @@ public class MesOutConverter : IIncomingConverter
wmsProductReceiptNote.WorkShop = "";//车间 wmsProductReceiptNote.WorkShop = "";//车间
wmsProductReceiptNote.Worker = _configuration["Authentication:username"];//操作人 wmsProductReceiptNote.Worker = _configuration["Authentication:username"];//操作人
wmsProductReceiptNote.ReceiptType = EnumReceiptType.MesScanReceipt;//完工收货方式 wmsProductReceiptNote.ReceiptType = EnumReceiptType.MesScanReceipt;//完工收货方式
wmsProductReceiptNote.WarehouseCode = "";
wmsProductReceiptNote.Details = new List<ProductReceiptNoteDetailInput>(); wmsProductReceiptNote.Details = new List<ProductReceiptNoteDetailInput>();
foreach (var incomingFromExternal in group.ToList()) foreach (var incomingFromExternal in group.ToList())
@ -81,20 +88,24 @@ public class MesOutConverter : IIncomingConverter
wmsProductReceiptNoteDetail.Lot = ""; //排序批次 wmsProductReceiptNoteDetail.Lot = ""; //排序批次
wmsProductReceiptNoteDetail.PackingCode = "";//箱标签 wmsProductReceiptNoteDetail.PackingCode = "";//箱标签
wmsProductReceiptNoteDetail.Status = EnumInventoryStatus.OK; wmsProductReceiptNoteDetail.Status = EnumInventoryStatus.OK;
wmsProductReceiptNoteDetail.WarehouseCode = "";
wmsProductReceiptNoteDetail.LocationArea = "";
wmsProductReceiptNoteDetail.LocationGroup = "";
var loc = await _locationAppService.GetListByTypesAndErpCodeAsync(types, wmsProductReceiptNoteDetail.LocationErpCode).ConfigureAwait(false); var loc = await _locationAppService.GetListByTypesAndErpCodeAsync(types, wmsProductReceiptNoteDetail.LocationErpCode).ConfigureAwait(false);
if (loc != null) if (loc != null)
{ {
wmsProductReceiptNoteDetail.LocationCode = loc[0].Code; wmsProductReceiptNoteDetail.LocationCode = loc[0].Code;
} }
; try try
{ {
var item = await _itemBasicAppService.GetByCodeAsync(wmsProductReceiptNoteDetail.ItemCode).ConfigureAwait(false); var item = await _itemBasicAppService.GetByCodeAsync(wmsProductReceiptNoteDetail.ItemCode).ConfigureAwait(false);
if (item != null) if (item != null)
{ {
wmsProductReceiptNoteDetail.ItemName = item.Name; wmsProductReceiptNoteDetail.ItemName = item.Name;
wmsProductReceiptNoteDetail.ItemDesc1 = item.Desc1; wmsProductReceiptNoteDetail.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : "";
wmsProductReceiptNoteDetail.ItemDesc2 = item.Desc2; wmsProductReceiptNoteDetail.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : "";
wmsProductReceiptNoteDetail.Uom = item.BasicUom; wmsProductReceiptNoteDetail.Uom = !string.IsNullOrEmpty(item.BasicUom) ? item.BasicUom : "";
} }
} }
catch (Exception) catch (Exception)

16
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs

@ -11,11 +11,13 @@ using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.WMS.MaterialRequest; using Win_in.Sfs.Wms.DataExchange.WMS.MaterialRequest;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
public class PullTaskConverter : IIncomingConverter public class PullTaskConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
@ -27,13 +29,15 @@ public class PullTaskConverter : IIncomingConverter
, IObjectMapper objectMapper , IObjectMapper objectMapper
, IItemBasicAppService itemBasicAppService , IItemBasicAppService itemBasicAppService
, ILogger<PullTaskConverter> logger , ILogger<PullTaskConverter> logger
, IConfiguration configuration) , IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager)
{ {
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_itemBasicAppService = itemBasicAppService; _itemBasicAppService = itemBasicAppService;
_logger = logger; _logger = logger;
_configuration = configuration; _configuration = configuration;
_incomingFromExternalManager = incomingFromExternalManager;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -47,6 +51,8 @@ public class PullTaskConverter : IIncomingConverter
//按Number合并MaterialRequest单据 //按Number合并MaterialRequest单据
var materialRequestList = await BuildIncomingToWmsOfMaterialRequestAsync(incomingFromExternalList).ConfigureAwait(false); var materialRequestList = await BuildIncomingToWmsOfMaterialRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfMaterialRequestAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfMaterialRequestAsync(List<IncomingFromExternal> incomingDataList)
@ -72,16 +78,16 @@ public class PullTaskConverter : IIncomingConverter
foreach (var incomingFromExternal in group.ToList()) foreach (var incomingFromExternal in group.ToList())
{ {
var materialRequest = JsonSerializer.Deserialize<MaterialRequestExchangeDto>(incomingFromExternal.DestinationDataContent); var materialRequest = JsonSerializer.Deserialize<MaterialRequestExchangeDto>(incomingFromExternal.DestinationDataContent);
var wmsMaterialRequestDetail = _objectMapper.Map<MaterialRequestDetailExchangeDto, MaterialRequestDetailInput>(materialRequest.Detail); var wmsMaterialRequestDetail = _objectMapper.Map<MaterialRequestDetailExchangeDto, MaterialRequestDetailInput>(materialRequest.Detail);
var item = await _itemBasicAppService.GetByCodeAsync(wmsMaterialRequestDetail.ItemCode).ConfigureAwait(false); var item = await _itemBasicAppService.GetByCodeAsync(wmsMaterialRequestDetail.ItemCode).ConfigureAwait(false);
try try
{ {
if (item != null) if (item != null)
{ {
wmsMaterialRequestDetail.ItemName = item.Name; wmsMaterialRequestDetail.ItemName = item.Name;
wmsMaterialRequestDetail.ItemDesc1 = item.Desc1; wmsMaterialRequestDetail.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : "";
wmsMaterialRequestDetail.ItemDesc2 = item.Desc2; wmsMaterialRequestDetail.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : "";
wmsMaterialRequestDetail.Uom = item.BasicUom; wmsMaterialRequestDetail.Uom = !string.IsNullOrEmpty(item.BasicUom) ? item.BasicUom : "";
} }
} }
catch (Exception) catch (Exception)

3
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs

@ -29,6 +29,7 @@ public class PullTaskReader : IReader
} }
public virtual async Task<List<IncomingFromExternal>> ReadAsync() public virtual async Task<List<IncomingFromExternal>> ReadAsync()
{ {
//从MES读取待处理PullTask //从MES读取待处理PullTask
var toBeProcessedPillTasks = await _pullTaskManager.GetToBeProcessedListAsync().ConfigureAwait(false); var toBeProcessedPillTasks = await _pullTaskManager.GetToBeProcessedListAsync().ConfigureAwait(false);
@ -101,7 +102,7 @@ public class PullTaskReader : IReader
var materialRequestDetail = new MaterialRequestDetailExchangeDto() var materialRequestDetail = new MaterialRequestDetailExchangeDto()
{ {
ItemCode = pullTask.Itemno, ItemCode = pullTask.Itemno,
Qty = pullTask.Planqty, Qty = decimal.Parse(pullTask.Planqty),
ToLocationCode = pullTask.Plant, ToLocationCode = pullTask.Plant,
}; };

23
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs

@ -16,6 +16,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
public class ScrapConverter : IIncomingConverter public class ScrapConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
@ -27,6 +28,10 @@ public class ScrapConverter : IIncomingConverter
IObjectMapper objectMapper, IObjectMapper objectMapper,
ILogger<ScrapConverter> logger, ILogger<ScrapConverter> logger,
IConfiguration configuration IConfiguration configuration
,
IIncomingFromExternalManager incomingFromExternalManager
) )
{ {
@ -35,6 +40,7 @@ public class ScrapConverter : IIncomingConverter
_objectMapper = objectMapper; _objectMapper = objectMapper;
_logger = logger; _logger = logger;
_configuration = configuration; _configuration = configuration;
_incomingFromExternalManager = incomingFromExternalManager;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{ {
@ -46,7 +52,8 @@ public class ScrapConverter : IIncomingConverter
//按PlanBillNo合并PurchaseOrder //按PlanBillNo合并PurchaseOrder
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)
@ -78,15 +85,15 @@ public class ScrapConverter : IIncomingConverter
wmsScrapDetail.FromPackingCode = ""; wmsScrapDetail.FromPackingCode = "";
wmsScrapDetail.FromLot = ""; wmsScrapDetail.FromLot = "";
wmsScrapDetail.FromWarehouseCode = ""; wmsScrapDetail.FromWarehouseCode = "";
wmsScrapDetail.ToWarehouseCode = ""; wmsScrapDetail.ToWarehouseCode = "";
wmsScrapDetail.Uom = ""; wmsScrapDetail.FromStatus = EnumInventoryStatus.OK;
wmsScrapDetail.FromStatus = EnumInventoryStatus.OK; var item = await _itemBasicAppService.GetByCodeAsync(wmsScrapDetail.ItemCode).ConfigureAwait(false);
var item = await _itemBasicAppService.GetByCodeAsync(wmsScrapDetail.ItemCode).ConfigureAwait(false);
if (item != null) if (item != null)
{ {
wmsScrapDetail.ItemName = item.Name; wmsScrapDetail.ItemName = item.Name;
wmsScrapDetail.ItemDesc1 = item.Desc1; wmsScrapDetail.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : "";
wmsScrapDetail.ItemDesc2 = item.Desc2; wmsScrapDetail.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : "";
wmsScrapDetail.Uom = !string.IsNullOrEmpty(item.BasicUom) ? item.BasicUom : "";
} }
wmsScarp.Details.Add(wmsScrapDetail); wmsScarp.Details.Add(wmsScrapDetail);

18
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs

@ -7,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Polly; using Polly;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper; using Volo.Abp.AutoMapper;
using Volo.Abp.BackgroundJobs; using Volo.Abp.BackgroundJobs;
@ -39,7 +40,8 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
typeof(DataExchangeDomainModule), typeof(DataExchangeDomainModule),
typeof(DataExchangeEntityFrameworkCoreModule), typeof(DataExchangeEntityFrameworkCoreModule),
typeof(DataExchangeDomainFawtygMesModule), typeof(DataExchangeDomainFawtygMesModule),
typeof(DataExchangeEntityFrameworkCoreFawtygModule) typeof(DataExchangeEntityFrameworkCoreFawtygModule),
typeof(AbpAccountApplicationContractsModule)
)] )]
public class MesAgentModule : AbpModule public class MesAgentModule : AbpModule
{ {
@ -153,13 +155,13 @@ public class MesAgentModule : AbpModule
typeof(LabelApplicationContractsModule).Assembly, typeof(LabelApplicationContractsModule).Assembly,
"Label" "Label"
); );
} }
public override void OnApplicationInitialization(
public override async Task OnApplicationInitializationAsync( ApplicationInitializationContext context)
ApplicationInitializationContext context)
{ {
await context.AddBackgroundWorkerAsync<MesIncomingBackgroundWorker>().ConfigureAwait(false);
await context.AddBackgroundWorkerAsync<MesOutgoingBackgroundWorker>().ConfigureAwait(false);
}
context.AddBackgroundWorkerAsync<MesIncomingBackgroundWorker>();
//context.AddBackgroundWorkerAsync<MesOutgoingBackgroundWorker>();
}
} }

1
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj

@ -11,6 +11,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.12" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.12" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.*" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.*" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.12" /> <PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.12" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="6.3.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="5.3.5" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="5.3.5" />
<PackageReference Include="Volo.Abp.BackgroundJobs" Version="5.3.5" /> <PackageReference Include="Volo.Abp.BackgroundJobs" Version="5.3.5" />
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="5.3.5" /> <PackageReference Include="Volo.Abp.BackgroundWorkers" Version="5.3.5" />

6
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluConverter.cs

@ -13,6 +13,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming;
public class BackFluConverter : IIncomingConverter public class BackFluConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
@ -22,6 +23,8 @@ public class BackFluConverter : IIncomingConverter
IItemBasicAppService itemBasicAppService, IItemBasicAppService itemBasicAppService,
IObjectMapper objectMapper, IObjectMapper objectMapper,
ILogger<BackFluConverter> logger ILogger<BackFluConverter> logger
,
IIncomingFromExternalManager incomingFromExternalManager
) )
{ {
@ -29,6 +32,7 @@ public class BackFluConverter : IIncomingConverter
_itemBasicAppService = itemBasicAppService; _itemBasicAppService = itemBasicAppService;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_logger = logger; _logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{ {
@ -39,6 +43,8 @@ public class BackFluConverter : IIncomingConverter
} }
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
} }

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomConverter.cs

@ -13,6 +13,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming;
public class BomConverter : IIncomingConverter public class BomConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
@ -25,7 +26,8 @@ public class BomConverter : IIncomingConverter
IObjectMapper objectMapper, IObjectMapper objectMapper,
ILogger<BomConverter> logger, ILogger<BomConverter> logger,
IGuidGenerator guidGenerator, IGuidGenerator guidGenerator,
IConfiguration configuration) IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager)
{ {
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
@ -34,6 +36,7 @@ public class BomConverter : IIncomingConverter
_logger = logger; _logger = logger;
_guidGenerator = guidGenerator; _guidGenerator = guidGenerator;
_configuration = configuration; _configuration = configuration;
_incomingFromExternalManager = incomingFromExternalManager;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{ {
@ -44,7 +47,8 @@ public class BomConverter : IIncomingConverter
} }
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)
{ {

5
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomReader.cs

@ -99,6 +99,7 @@ public class BomReader : IReader
SourceSystem = EnumSystemType.ERP.ToString(), SourceSystem = EnumSystemType.ERP.ToString(),
SourceDataId = bom.mes_bom_assy.ToString(), SourceDataId = bom.mes_bom_assy.ToString(),
SourceDataDetailCode = bom.mes_bom_part.ToString(), SourceDataDetailCode = bom.mes_bom_part.ToString(),
SourceDataGroupCode = bom.mes_bom_part.ToString(),
SourceDataContent = JsonSerializer.Serialize(bom), SourceDataContent = JsonSerializer.Serialize(bom),
WriteTime = DateTime.Now, WriteTime = DateTime.Now,
Writer = nameof(TyrpIncomingBackgroundWorker), Writer = nameof(TyrpIncomingBackgroundWorker),
@ -114,8 +115,8 @@ public class BomReader : IReader
{ {
Product = bom.mes_bom_assy, Product = bom.mes_bom_assy,
Component = bom.mes_bom_part, Component = bom.mes_bom_part,
BeginTime = DateTime.ParseExact(bom.mes_bom_chg_e, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture), BeginTime = DateTime.ParseExact(bom.mes_bom_chg_b, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture),
EndTime = DateTime.ParseExact(bom.mes_bom_chg_b, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture), EndTime = DateTime.ParseExact(bom.mes_bom_chg_e, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture),
ComponentQty = bom.mes_bom_qty ComponentQty = bom.mes_bom_qty
}; };

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/CustomerConverter.cs

@ -17,17 +17,23 @@ public class CustomerConverter : IIncomingConverter
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly ILogger<CustomerConverter> _logger; private readonly ILogger<CustomerConverter> _logger;
private readonly IGuidGenerator _guidGenerator; private readonly IGuidGenerator _guidGenerator;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public CustomerConverter( public CustomerConverter(
IIncomingToWmsManager incomingToWmsManager, IIncomingToWmsManager incomingToWmsManager,
IObjectMapper objectMapper, IObjectMapper objectMapper,
ILogger<CustomerConverter> logger, ILogger<CustomerConverter> logger,
IGuidGenerator guidGenerator IGuidGenerator guidGenerator
,
IIncomingFromExternalManager incomingFromExternalManager
) )
{ {
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_logger = logger; _logger = logger;
_guidGenerator = guidGenerator; _guidGenerator = guidGenerator;
_incomingFromExternalManager = incomingFromExternalManager;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{ {
@ -38,6 +44,8 @@ public class CustomerConverter : IIncomingConverter
} }
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DepartmentConverter.cs

@ -15,15 +15,18 @@ public class DepartmentConverter : IIncomingConverter
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly ILogger<DepartmentConverter> _logger; private readonly ILogger<DepartmentConverter> _logger;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public DepartmentConverter( public DepartmentConverter(
IIncomingToWmsManager incomingToWmsManager IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper , IObjectMapper objectMapper
, ILogger<DepartmentConverter> logger) , ILogger<DepartmentConverter> logger,
IIncomingFromExternalManager incomingFromExternalManager)
{ {
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_logger = logger; _logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -37,6 +40,8 @@ public class DepartmentConverter : IIncomingConverter
//按流水号创建单据 //按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfDepartmentRequestAsync(incomingFromExternalList).ConfigureAwait(false); var materialRequestList = await BuildIncomingToWmsOfDepartmentRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfDepartmentRequestAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfDepartmentRequestAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs

@ -17,17 +17,20 @@ public class DictConverter : IIncomingConverter
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly ILogger<DictConverter> _logger; private readonly ILogger<DictConverter> _logger;
private readonly IGuidGenerator _guidGenerator; private readonly IGuidGenerator _guidGenerator;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public DictConverter( public DictConverter(
IIncomingToWmsManager incomingToWmsManager IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper , IObjectMapper objectMapper
, ILogger<DictConverter> logger, , ILogger<DictConverter> logger,
IGuidGenerator guidGenerator) IGuidGenerator guidGenerator,
IIncomingFromExternalManager incomingFromExternalManager)
{ {
_guidGenerator = guidGenerator; _guidGenerator = guidGenerator;
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_logger = logger; _logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -41,6 +44,8 @@ public class DictConverter : IIncomingConverter
//按流水号创建单据 //按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfDictRequestAsync(incomingFromExternalList).ConfigureAwait(false); var materialRequestList = await BuildIncomingToWmsOfDictRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfDictRequestAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfDictRequestAsync(List<IncomingFromExternal> incomingDataList)

5
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictpjReader.cs

@ -5,6 +5,7 @@ using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Volo.Abp.Guids;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp;
@ -20,13 +21,16 @@ public class DictpjReader : IReader
private readonly IIncomingFromExternalManager _incomingFromExternalManager; private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly ILogger<DictpjReader> _logger; private readonly ILogger<DictpjReader> _logger;
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
private readonly IGuidGenerator _guidGenerator;
public DictpjReader( public DictpjReader(
IDictpjManager dictpjManager IDictpjManager dictpjManager
, IIncomingFromExternalManager incomingFromExternalManager , IIncomingFromExternalManager incomingFromExternalManager
, ILogger<DictpjReader> logger , ILogger<DictpjReader> logger
, IConfiguration configuration , IConfiguration configuration
, IGuidGenerator guidGenerator
) )
{ {
_guidGenerator = guidGenerator;
_configuration = configuration; _configuration = configuration;
_dictpjManager = dictpjManager; _dictpjManager = dictpjManager;
_incomingFromExternalManager = incomingFromExternalManager; _incomingFromExternalManager = incomingFromExternalManager;
@ -55,6 +59,7 @@ public class DictpjReader : IReader
var incomingData = BuildIncomingFromExternal(dict); var incomingData = BuildIncomingFromExternal(dict);
incomingData.SetEffectiveDate(DateTime.Now); incomingData.SetEffectiveDate(DateTime.Now);
incomingData.SetSuccess(); incomingData.SetSuccess();
incomingData.SetId(_guidGenerator.Create());
try try
{ {
var DictRequest = BuildDictRequestCreateInput(dict); var DictRequest = BuildDictRequestCreateInput(dict);

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/InterfaceCalendarConverter.cs

@ -15,15 +15,18 @@ public class InterfaceCalendarConverter : IIncomingConverter
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly ILogger<InterfaceCalendarConverter> _logger; private readonly ILogger<InterfaceCalendarConverter> _logger;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public InterfaceCalendarConverter( public InterfaceCalendarConverter(
IIncomingToWmsManager incomingToWmsManager IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper , IObjectMapper objectMapper
, ILogger<InterfaceCalendarConverter> logger) , ILogger<InterfaceCalendarConverter> logger,
IIncomingFromExternalManager incomingFromExternalManager)
{ {
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_logger = logger; _logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
} }
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -37,6 +40,8 @@ public class InterfaceCalendarConverter : IIncomingConverter
//按流水号创建单据 //按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfInterfaceCalendarRequestAsync(incomingFromExternalList).ConfigureAwait(false); var materialRequestList = await BuildIncomingToWmsOfInterfaceCalendarRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfInterfaceCalendarRequestAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfInterfaceCalendarRequestAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs

@ -14,6 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming;
public class ItemBasicConverter : IIncomingConverter public class ItemBasicConverter : IIncomingConverter
{ {
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly ILogger<ItemBasicConverter> _logger; private readonly ILogger<ItemBasicConverter> _logger;
@ -25,8 +26,10 @@ public class ItemBasicConverter : IIncomingConverter
, IObjectMapper objectMapper , IObjectMapper objectMapper
, ILogger<ItemBasicConverter> logger, , ILogger<ItemBasicConverter> logger,
IGuidGenerator guidGenerator, IGuidGenerator guidGenerator,
IConfiguration configuration) IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager)
{ {
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_logger = logger; _logger = logger;
@ -45,6 +48,8 @@ public class ItemBasicConverter : IIncomingConverter
//按流水号创建单据 //按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfItemBasicRequestAsync(incomingFromExternalList).ConfigureAwait(false); var materialRequestList = await BuildIncomingToWmsOfItemBasicRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfItemBasicRequestAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfItemBasicRequestAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/SupplierConverter.cs

@ -17,11 +17,13 @@ public class SupplierConverter : IIncomingConverter
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly ILogger<SupplierConverter> _logger; private readonly ILogger<SupplierConverter> _logger;
private readonly IGuidGenerator _guidGenerator; private readonly IGuidGenerator _guidGenerator;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public SupplierConverter( public SupplierConverter(
IIncomingToWmsManager incomingToWmsManager, IIncomingToWmsManager incomingToWmsManager,
IObjectMapper objectMapper, IObjectMapper objectMapper,
ILogger<SupplierConverter> logger, ILogger<SupplierConverter> logger,
IGuidGenerator guidGenerator IGuidGenerator guidGenerator,
IIncomingFromExternalManager incomingFromExternalManage
) )
{ {
@ -39,7 +41,8 @@ public class SupplierConverter : IIncomingConverter
} }
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false); var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false); await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)
{ {

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

@ -67,26 +67,26 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
////转换itemBasic ////转换itemBasic
//await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); //await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read User");//用户和部门 Logger.LogInformation($"Read User");//用户和部门
//var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>(); var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>();
//var userConverter = workerContext.ServiceProvider.GetRequiredService<UserConverter>(); var userConverter = workerContext.ServiceProvider.GetRequiredService<UserConverter>();
//var departmentConverter = workerContext.ServiceProvider.GetRequiredService<DepartmentConverter>(); var departmentConverter = workerContext.ServiceProvider.GetRequiredService<DepartmentConverter>();
////读取并保存user //读取并保存user
//var outsFromExternalList = await userReader.ReadAsync().ConfigureAwait(false); var outsFromExternalList = await userReader.ReadAsync().ConfigureAwait(false);
//var userOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.User.ToString()).ToList(); var userOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.User.ToString()).ToList();
//var departmentOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.Department.ToString()).ToList(); var departmentOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.Department.ToString()).ToList();
////转换user //转换user
//await userConverter.ConvertAsync(userOutsFromExternalList).ConfigureAwait(false); await userConverter.ConvertAsync(userOutsFromExternalList).ConfigureAwait(false);
////转换department //转换department
//await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false); await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read InterfaceCalendar");//账期 Logger.LogInformation($"Read InterfaceCalendar");//账期
//var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarReader>(); var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarReader>();
//var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarConverter>(); var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarConverter>();
////读取并保存InterfaceCalendar //读取并保存InterfaceCalendar
//var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync(); var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false);
////转换InterfaceCalendar //转换InterfaceCalendar
//await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList); await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Dict");//系统代码 Logger.LogInformation($"Read Dict");//系统代码
var dictReader = workerContext.ServiceProvider.GetRequiredService<DictReader>(); var dictReader = workerContext.ServiceProvider.GetRequiredService<DictReader>();
@ -104,28 +104,28 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
////转换Bom ////转换Bom
//await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false); //await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Supplier");//供应商 Logger.LogInformation($"Read Supplier");//供应商
//var SupplierReader = workerContext.ServiceProvider.GetRequiredService<SupplierReader>(); var SupplierReader = workerContext.ServiceProvider.GetRequiredService<SupplierReader>();
//var SupplierConverter = workerContext.ServiceProvider.GetRequiredService<SupplierConverter>(); var SupplierConverter = workerContext.ServiceProvider.GetRequiredService<SupplierConverter>();
////读取并保存Supplier //读取并保存Supplier
//var suppliersFromExternalList = await SupplierReader.ReadAsync().ConfigureAwait(false); var suppliersFromExternalList = await SupplierReader.ReadAsync().ConfigureAwait(false);
////转换Supplier //转换Supplier
//await SupplierConverter.ConvertAsync(suppliersFromExternalList).ConfigureAwait(false); await SupplierConverter.ConvertAsync(suppliersFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Dictpj");//专案代码 Logger.LogInformation($"Read Dictpj");//专案代码
//var DictpjReader = workerContext.ServiceProvider.GetRequiredService<DictpjReader>(); var DictpjReader = workerContext.ServiceProvider.GetRequiredService<DictpjReader>();
////读取并保存Dictpj //读取并保存Dictpj
//var dictpjOutsFromExternalList = await DictpjReader.ReadAsync().ConfigureAwait(false); var dictpjOutsFromExternalList = await DictpjReader.ReadAsync().ConfigureAwait(false);
////转换Dictpj //转换Dictpj
//await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Customer");//客户资料 Logger.LogInformation($"Read Customer");//客户资料
//var CustomerReader = workerContext.ServiceProvider.GetRequiredService<CustomerReader>(); var CustomerReader = workerContext.ServiceProvider.GetRequiredService<CustomerReader>();
//var CustomerConverter = workerContext.ServiceProvider.GetRequiredService<CustomerConverter>(); var CustomerConverter = workerContext.ServiceProvider.GetRequiredService<CustomerConverter>();
////读取并保存Customer //读取并保存Customer
//var customersFromExternalList = await CustomerReader.ReadAsync().ConfigureAwait(false); var customersFromExternalList = await CustomerReader.ReadAsync().ConfigureAwait(false);
////转换Customer //转换Customer
//await CustomerConverter.ConvertAsync(customersFromExternalList).ConfigureAwait(false); await CustomerConverter.ConvertAsync(customersFromExternalList).ConfigureAwait(false);
} }
else else
{ {

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/UserConverter.cs

@ -15,12 +15,13 @@ public class UserConverter : IIncomingConverter
private readonly IIncomingToWmsManager _incomingToWmsManager; private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper; private readonly IObjectMapper _objectMapper;
private readonly ILogger<UserConverter> _logger; private readonly ILogger<UserConverter> _logger;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public UserConverter( public UserConverter(
IIncomingToWmsManager incomingToWmsManager IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper , IObjectMapper objectMapper
, ILogger<UserConverter> logger) , ILogger<UserConverter> logger, IIncomingFromExternalManager incomingFromExternalManager)
{ {
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager; _incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper; _objectMapper = objectMapper;
_logger = logger; _logger = logger;
@ -37,6 +38,8 @@ public class UserConverter : IIncomingConverter
//按流水号创建单据 //按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfIdentityUserRequestAsync(incomingFromExternalList).ConfigureAwait(false); var materialRequestList = await BuildIncomingToWmsOfIdentityUserRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
} }
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfIdentityUserRequestAsync(List<IncomingFromExternal> incomingDataList) private async Task<List<IncomingToWms>> BuildIncomingToWmsOfIdentityUserRequestAsync(List<IncomingFromExternal> incomingDataList)

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

@ -0,0 +1,139 @@
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.ItemTransformNote;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing;
public class ItemTransformNoteConverter : IOutgoingConverter
{
private readonly IOutgoingFromWmsManager _outgoingFromWmsManager;
private readonly IOutgoingToExternalManager _outgoingToExternalManager;
private readonly ISupplierAsnAppService _supplierAsnAppService;
private readonly IDepartmentAppService _departmentAppService;
private readonly IObjectMapper _objectMapper;
public ItemTransformNoteConverter(
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.Item_Transform, EnumSystemType.ERP).ConfigureAwait(false);
foreach (var outgoingFromWms in outgoingFromWmsList)
{
var wmsCountAdjust = JsonSerializer.Deserialize<ItemTransformNoteDTO>(outgoingFromWms.DataContent);
if (Enum.Parse<EnumTransSubType>(wmsCountAdjust.Type) == EnumTransSubType.Item_Transform)
{
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.ToItemCode, r.LocationErpCode, r.ToLocationCode }).Select(p => new ItemTransformNoteDetailExchangeDto { ToQty = p.Sum(itm => itm.ToQty), FromQty = p.Sum(itm => itm.FromQty), ItemCode = p.Key.ItemCode, ToItemCode = p.Key.ToItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) });
foreach (var detail in details)
{
List<ItemTransformNoteDetailExchangeDto> ItemTransform = new List<ItemTransformNoteDetailExchangeDto>();
ItemTransformNoteDetailExchangeDto ItemTrans = new ItemTransformNoteDetailExchangeDto();
ItemTrans.ItemCode = detail.ItemCode;
ItemTrans.LocationErpCode = detail.LocationErpCode;
ItemTrans.FromQty = detail.FromQty - detail.FromQty - detail.FromQty;
ItemTrans.ReasonCode = detail.ReasonCode;
ItemTransform.Add(ItemTrans);
ItemTransformNoteDetailExchangeDto ItemTranss = new ItemTransformNoteDetailExchangeDto();
ItemTranss.ItemCode = detail.ToItemCode;
ItemTranss.LocationErpCode = detail.LocationErpCode;
ItemTranss.FromQty = detail.ToQty;
ItemTranss.ReasonCode = detail.ReasonCode;
ItemTransform.Add(ItemTranss);
foreach (var Item in ItemTransform)
{
var outgoingToExternal = new OutgoingToExternal()
{
DataType = outgoingFromWms.DataType,
DataAction = outgoingFromWms.DataAction,
SourceSystem = EnumSystemType.WMS.ToString(),
SourceDataId = wmsCountAdjust.Number,
SourceDataGroupCode = wmsCountAdjust.Number,
SourceDataDetailCode = Item.ItemCode,
Writer = nameof(TyrpOutgoingBackgroundWorker),
DestinationSystem = EnumSystemType.ERP.ToString(),
DestinationDataId = "",
};
outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate);
var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, Item).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(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_part = detail.ItemCode,
mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"),
mesout_asd_loc = detail.LocationErpCode,
mesout_asd_code = detail.ReasonCode,
mesout_asd_qty = detail.FromQty,
mesout_asd_user = exchangeCountAdjust.Worker,
mesout_asd_k = string.Empty,
mesout_asd_stat = "Y"
};
return counta;
}
private async Task<ItemTransformNoteExchangeDto> BuildPurchaseReceiptExchangeDtoAsync(
ItemTransformNoteDTO wmsCountAdjust, ItemTransformNoteDetailExchangeDto wmsCountAdjustDetail)
{
var exchangeCountAdjust = _objectMapper.Map<ItemTransformNoteDTO, ItemTransformNoteExchangeDto>(wmsCountAdjust);
exchangeCountAdjust.Detail = wmsCountAdjustDetail;
return exchangeCountAdjust;
}
}

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

@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.Json; using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Uow;
using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
@ -25,11 +26,12 @@ public class ScontrolWriter : IWriter
/// <returns></returns> /// <returns></returns>
public virtual async Task WriteAsync(List<OutgoingToExternal> outgoingDataList) public virtual async Task WriteAsync(List<OutgoingToExternal> outgoingDataList)
{ {
var dataInterfaceList = new List<Scontrol>();
var dataInterfaceDetailList = new List<Scmsend>();
var groups = outgoingDataList.GroupBy(r => r.SourceDataGroupCode); var groups = outgoingDataList.GroupBy(r => r.SourceDataGroupCode);
foreach (var group in groups) foreach (var group in groups)
{ {
var dataInterfaceList = new List<Scontrol>();
var dataInterfaceDetailList = new List<Scmsend>();
var entitys = group.ToList(); var entitys = group.ToList();
foreach (var entity in entitys) foreach (var entity in entitys)

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

@ -94,10 +94,10 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
var unplannedIssueNoteNoteList = await unplannedIssueNoteConvert.ConvertAsync().ConfigureAwait(false); var unplannedIssueNoteNoteList = await unplannedIssueNoteConvert.ConvertAsync().ConfigureAwait(false);
await wmsoutmWriter.WriteAsync(unplannedIssueNoteNoteList).ConfigureAwait(false); await wmsoutmWriter.WriteAsync(unplannedIssueNoteNoteList).ConfigureAwait(false);
//Logger.LogInformation($"Write UnplannedReceiptNote");//非生产退料 Logger.LogInformation($"Write UnplannedReceiptNote");//非生产退料
//var unplannedReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<UnplannedReceiptNoteConverter>(); var unplannedReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<UnplannedReceiptNoteConverter>();
//var unplannedReceiptNoteList = await unplannedReceiptNoteConvert.ConvertAsync(); var unplannedReceiptNoteList = await unplannedReceiptNoteConvert.ConvertAsync().ConfigureAwait(false);
//await wmsoutmWriter.WriteAsync(unplannedReceiptNoteList); await wmsoutmWriter.WriteAsync(unplannedReceiptNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write RecycledMaterialReceiptNote");//回收料入库单 Logger.LogInformation($"Write RecycledMaterialReceiptNote");//回收料入库单
var recycledMaterialReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<RecycledMaterialReceiptNoteConverter>(); var recycledMaterialReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<RecycledMaterialReceiptNoteConverter>();
@ -120,6 +120,10 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
var scrapNoteList = await scrapNoteConvert.ConvertAsync().ConfigureAwait(false); var scrapNoteList = await scrapNoteConvert.ConvertAsync().ConfigureAwait(false);
await countadjustWriter.WriteAsync(scrapNoteList).ConfigureAwait(false); await countadjustWriter.WriteAsync(scrapNoteList).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($"Completed: Handling {Outgoing}"); Logger.LogInformation($"Completed: Handling {Outgoing}");
} }

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

@ -27,11 +27,11 @@ public class WmsoutmWriter : IWriter
/// <returns></returns> /// <returns></returns>
public virtual async Task WriteAsync(List<OutgoingToExternal> outgoingDataList) public virtual async Task WriteAsync(List<OutgoingToExternal> outgoingDataList)
{ {
var dataInterfaceList = new List<Wmsoutm>();
var dataInterfaceDetailList = new List<Wmsoutd>();
var groups = outgoingDataList.GroupBy(r => r.SourceDataGroupCode); var groups = outgoingDataList.GroupBy(r => r.SourceDataGroupCode);
foreach (var group in groups) foreach (var group in groups)
{ {
var dataInterfaceList = new List<Wmsoutm>();
var dataInterfaceDetailList = new List<Wmsoutd>();
var entitys = group.ToList(); var entitys = group.ToList();
foreach (var entity in entitys) foreach (var entity in entitys)

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

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

1
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj

@ -31,6 +31,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\Hosts\Auth.Host\src\Win_in.Sfs.Auth.Application.Contracts\Win_in.Sfs.Auth.Application.Contracts.csproj" /> <ProjectReference Include="..\..\..\Hosts\Auth.Host\src\Win_in.Sfs.Auth.Application.Contracts\Win_in.Sfs.Auth.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\Modules\BaseData\src\Win_in.Sfs.Basedata.Application\Win_in.Sfs.Basedata.Application.csproj" />
<ProjectReference Include="..\..\..\Modules\Label\src\Win_in.Sfs.Label.Application.Contracts\Win_in.Sfs.Label.Application.Contracts.csproj" /> <ProjectReference Include="..\..\..\Modules\Label\src\Win_in.Sfs.Label.Application.Contracts\Win_in.Sfs.Label.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\Modules\Shared\src\Win_in.Sfs.Shared.Host\Win_in.Sfs.Shared.Host.csproj" /> <ProjectReference Include="..\..\..\Modules\Shared\src\Win_in.Sfs.Shared.Host\Win_in.Sfs.Shared.Host.csproj" />
<ProjectReference Include="..\..\..\Modules\Store\src\Win_in.Sfs.Wms.Store.Application.Contracts\Win_in.Sfs.Wms.Store.Application.Contracts.csproj" /> <ProjectReference Include="..\..\..\Modules\Store\src\Win_in.Sfs.Wms.Store.Application.Contracts\Win_in.Sfs.Wms.Store.Application.Contracts.csproj" />

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

@ -26,13 +26,13 @@
"RemoteServices": { "RemoteServices": {
"BaseData": { "BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:59094/" "BaseUrl": "http://dev.ccwin-in.com:21294/"
}, },
"Store": { "Store": {
"BaseUrl": "http://dev.ccwin-in.com:59095/" "BaseUrl": "http://dev.ccwin-in.com:21295/"
}, },
"Label": { "Label": {
"BaseUrl": "http://dev.ccwin-in.com:59092/" "BaseUrl": "http://dev.ccwin-in.com:21292/"
}, },
"Auth": { "Auth": {
"BaseUrl": "http://dev.ccwin-in.com:21293/" "BaseUrl": "http://dev.ccwin-in.com:21293/"

6
be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs

@ -22,7 +22,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad;
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.WmsWebApi)] [ApiExplorerSettings(GroupName = SwaggerGroupConsts.WmsWebApi)]
public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppService public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppService
{ {
private readonly Store.Application.Contracts.IPurchaseOrderAppService _purchaseOrderAppService; //private readonly Store.Application.Contracts.IPurchaseOrderAppService _purchaseOrderAppService;
private readonly IPo_mstrRepository _po_mstrRepository; private readonly IPo_mstrRepository _po_mstrRepository;
@ -34,7 +34,7 @@ public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppServ
IConfiguration configuration IConfiguration configuration
) )
{ {
_purchaseOrderAppService = purchaseOrderAppService; //_purchaseOrderAppService = purchaseOrderAppService;
_po_mstrRepository = po_mstrRepository; _po_mstrRepository = po_mstrRepository;
_configuration = configuration; _configuration = configuration;
} }
@ -77,7 +77,7 @@ public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppServ
targetObj.ContactEmail = ""; targetObj.ContactEmail = "";
#endregion #endregion
await _purchaseOrderAppService.UpsertAsync(targetObj).ConfigureAwait(false); //await _purchaseOrderAppService.UpsertAsync(targetObj).ConfigureAwait(false);
} }
catch (Exception ex) catch (Exception ex)
{ {

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

@ -149,7 +149,7 @@ public class AgentModule : AbpModule
public override void OnApplicationInitialization( public override void OnApplicationInitialization(
ApplicationInitializationContext context) ApplicationInitializationContext context)
{ {
context.AddBackgroundWorkerAsync<IncomingToWmsWorker>(); // context.AddBackgroundWorkerAsync<IncomingToWmsWorker>();
// context.AddBackgroundWorker<OutgoingFromWmsWorker>(); context.AddBackgroundWorkerAsync<OutgoingFromWmsWorker>();
} }
} }

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

@ -33,16 +33,7 @@ public static class IncomingToWmsExtensions
{ {
var Dict = JsonSerializer.Deserialize<DictEditInput>(incomingConverted.DataContent); var Dict = JsonSerializer.Deserialize<DictEditInput>(incomingConverted.DataContent);
var DictBasicAppService = workerContext.ServiceProvider.GetRequiredService<IDictAppService>(); var DictBasicAppService = workerContext.ServiceProvider.GetRequiredService<IDictAppService>();
try await DictBasicAppService.UpdateAsync(Dict).ConfigureAwait(false);
{
await DictBasicAppService.UpdateAsync(Dict).ConfigureAwait(false);
}
catch (System.Exception ex)
{
throw;
}
} }
public static async Task HandleUsersAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext) public static async Task HandleUsersAsync(this IncomingToWms incomingConverted, PeriodicBackgroundWorkerContext workerContext)
{ {

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

@ -30,6 +30,7 @@ public enum EnumOutgoingDataType
RecycledMaterialReceipt = 22, RecycledMaterialReceipt = 22,
ScrapNote = 23, ScrapNote = 23,
ProductRecycle = 24, ProductRecycle = 24,
Item_Transform = 25
} }
public enum EnumExchangeTableType public enum EnumExchangeTableType
{ {

1
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumSystemType.cs

@ -12,5 +12,6 @@ public enum EnumSystemType
MES = 3, MES = 3,
JIS = 4, JIS = 4,
QMS = 5, QMS = 5,
EOS= 6,
} }

3
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/ArchivedIncomingFromExternal/IArchivedIncomingFromExternalRepository.cs

@ -1,7 +1,8 @@
using System;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.DataExchange.Domain; namespace Win_in.Sfs.Wms.DataExchange.Domain;
public interface IArchivedIncomingFromExternalRepository : ISfsRepositoryBase<ArchivedIncomingFromExternal> public interface IArchivedIncomingFromExternalRepository : ISfsRepositoryBase<ArchivedIncomingFromExternal>, ISfsBulkRepositoryBase<ArchivedIncomingFromExternal>
{ {
} }

1
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IIncomingFromExternalManager.cs

@ -12,4 +12,5 @@ public interface IIncomingFromExternalManager : IDomainService
Task ArchiveManyAsync(List<IncomingFromExternal> entities); Task ArchiveManyAsync(List<IncomingFromExternal> entities);
Task<List<IncomingFromExternal>> CreateBulkAsync(List<IncomingFromExternal> entities); Task<List<IncomingFromExternal>> CreateBulkAsync(List<IncomingFromExternal> entities);
Task<string> GetDataByMaxEffectiveDate(string dataType); Task<string> GetDataByMaxEffectiveDate(string dataType);
Task ArchiveBulkAsync(List<IncomingFromExternal> entities);
} }

8
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IncomingFromExternalManager.cs

@ -62,7 +62,15 @@ public class IncomingFromExternalManager : DomainService, IIncomingFromExternalM
await _historyRepository.InsertAsync(archivedEntity).ConfigureAwait(false); await _historyRepository.InsertAsync(archivedEntity).ConfigureAwait(false);
} }
[UnitOfWork]
public virtual async Task ArchiveBulkAsync(List<IncomingFromExternal> entities)
{
await _repository.BulkDeleteAsync(entities).ConfigureAwait(false);
var archivedEntities = _objectMapper.Map<List<IncomingFromExternal>, List<ArchivedIncomingFromExternal>>(entities);
await _historyRepository.BulkInsertAsync(archivedEntities).ConfigureAwait(false);
}
[UnitOfWork] [UnitOfWork]
public virtual async Task ArchiveManyAsync(List<IncomingFromExternal> entities) public virtual async Task ArchiveManyAsync(List<IncomingFromExternal> entities)
{ {

1
be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.LabelDbContext.sql

@ -49,6 +49,7 @@ CREATE TABLE [Label_InventoryLabel] (
[SupplierSimpleName] nvarchar(max) NULL, [SupplierSimpleName] nvarchar(max) NULL,
[SupplierItemCode] nvarchar(max) NULL, [SupplierItemCode] nvarchar(max) NULL,
[SupplierItemName] nvarchar(max) NULL, [SupplierItemName] nvarchar(max) NULL,
[PlanArriveDate] datetime2 NOT NULL,
[ExtraProperties] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL, [ConcurrencyStamp] nvarchar(40) NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,

32
be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/AsnTimeWindowController.cs

@ -8,6 +8,7 @@ using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers; namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers;
using System.Diagnostics.Metrics;
using System.Linq; using System.Linq;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
@ -29,28 +30,28 @@ public class AsnTimeWindowController : AbpController
[HttpGet("asn-time-window")] [HttpGet("asn-time-window")]
public virtual async Task<List<AsnTimeWindowDashboardDto>> GetAsnTimeWindowsAsync() public virtual async Task<List<AsnTimeWindowDashboardDto>> GetAsnTimeWindowsAsync()
{ {
return await GetAsnTimeWindowDashboardsAsync().ConfigureAwait(false); return await GetAsnTimeWindowDashboardsAsync();
} }
private async Task<List<AsnTimeWindowDashboardDto>> GetAsnTimeWindowDashboardsAsync() private async Task<List<AsnTimeWindowDashboardDto>> GetAsnTimeWindowDashboardsAsync()
{ {
var supplierAsns = await GetSupplierAsnsAsync().ConfigureAwait(false); var supplierAsns = await this.GetSupplierAsnsAsync();
var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct(); var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct();
var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false); var suppliers = await GetSuppliersAsync(supplierCodes);
var asnNumbers = supplierAsns.Select(t => t.Number); var asnNumbers = supplierAsns.Select(t => t.Number);
var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers).ConfigureAwait(false); var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers);
return ConvertToAsnTimeWindowDashboards( return this.ConvertToAsnTimeWindowDashboards(
supplierAsns, supplierAsns,
suppliers, suppliers,
purchaseReceiptNotes); purchaseReceiptNotes);
} }
private static List<AsnTimeWindowDashboardDto> ConvertToAsnTimeWindowDashboards( private List<AsnTimeWindowDashboardDto> ConvertToAsnTimeWindowDashboards(
List<SupplierAsnDTO> supplierAsns, List<SupplierAsnDTO> supplierAsns,
List<SupplierDTO> suppliers, List<SupplierDTO> suppliers,
List<PurchaseReceiptNoteDTO> purchaseReceiptNotes) List<PurchaseReceiptNoteDTO> purchaseReceiptNotes)
@ -70,16 +71,12 @@ public class AsnTimeWindowController : AbpController
var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode); var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
if (supplier == null) if (supplier == null)
{
continue; continue;
}
supplierShortName = supplier.ShortName; supplierShortName = supplier.ShortName;
if (dtos.Exists(t => t.TimeSpan == timeSpan && t.SupplierShortName == supplierShortName)) if (dtos.Exists(t => t.TimeSpan == timeSpan && t.SupplierShortName == supplierShortName))
{
continue; continue;
}
var purchaseReceiptNote = var purchaseReceiptNote =
purchaseReceiptNotes.FirstOrDefault(t => t.AsnNumber == supplierAsn.Number); purchaseReceiptNotes.FirstOrDefault(t => t.AsnNumber == supplierAsn.Number);
@ -111,17 +108,26 @@ public class AsnTimeWindowController : AbpController
endTime.AddDays(-1); endTime.AddDays(-1);
} }
return await _supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime).ConfigureAwait(false); return await this._supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime);
} }
private async Task<List<SupplierDTO>> GetSuppliersAsync(IEnumerable<string> codes) private async Task<List<SupplierDTO>> GetSuppliersAsync(IEnumerable<string> codes)
{ {
return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false); return await this._supplierApp.GetByCodesAsync(codes);
} }
private async Task<List<PurchaseReceiptNoteDTO>> GetPurchaseReceiptNotesAsync(IEnumerable<string> asnNumbers) private async Task<List<PurchaseReceiptNoteDTO>> GetPurchaseReceiptNotesAsync(IEnumerable<string> asnNumbers)
{ {
return await _purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false); return await this._purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers);
} }
/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpGet("get-server-date-time")]
public virtual async Task<string> GetServerDate()
{
return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
} }

199
be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs

@ -2,151 +2,156 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Wms.Dashboard.Host.Models; using Win_in.Sfs.Wms.Dashboard.Host.Models;
namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers; namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
{
using System.Linq; using System.Linq;
using NUglify.Helpers;
using Win_in.Sfs.Shared.Domain.Shared; using NUglify.Helpers;
using Win_in.Sfs.Wms.Store.Application.Contracts;
[ApiController] using Win_in.Sfs.Shared.Domain.Shared;
[Route($"{PdaHostConst.ROOT_ROUTE}material-request")] using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using static IdentityServer4.Models.IdentityResources;
public class MaterialRequestController : AbpController [ApiController]
{ [Route($"{PdaHostConst.ROOT_ROUTE}material-request")]
private readonly IMaterialRequestAppService _materialRequestApp;
private readonly IIssueNoteAppService _issueNoteApp; public class MaterialRequestController : AbpController
public MaterialRequestController(IMaterialRequestAppService materialRequestApp, IIssueNoteAppService issueNoteApp)
{ {
_materialRequestApp = materialRequestApp; private readonly IMaterialRequestAppService _materialRequestApp;
_issueNoteApp = issueNoteApp;
}
[HttpGet("un-handled-order-sum")] private readonly IIssueNoteAppService _issueNoteApp;
public virtual async Task<MaterialRequestUnHandledOrderSumDto> GetUnHandledOrderSumAsync() public MaterialRequestController(IMaterialRequestAppService materialRequestApp, IIssueNoteAppService issueNoteApp)
{ {
var dto = new MaterialRequestUnHandledOrderSumDto(); _materialRequestApp = materialRequestApp;
_issueNoteApp = issueNoteApp;
}
var list = await GetMaterialRequestAsync().ConfigureAwait(false); [HttpGet("un-handled-order-sum")]
public virtual async Task<MaterialRequestUnHandledOrderSumDto> GetUnHandledOrderSumAsync()
{
var dto = new MaterialRequestUnHandledOrderSumDto();
dto.Sum = list.Where(t => t.RequestStatus == EnumRequestStatus.New).Count(); var list = await GetMaterialRequestAsync();
return dto; dto.Sum = list.Where(t => t.RequestStatus == EnumRequestStatus.New).Count();
}
[HttpGet("un-issued-item-qty-sum")] return dto;
public virtual async Task<MaterialRequestUnIssuedItemQtySumDto> GetUnIssuedItemQtySumAsync() }
{
var dto = new MaterialRequestUnIssuedItemQtySumDto();
var list = await GetMaterialRequestAsync().ConfigureAwait(false); [HttpGet("un-issued-item-qty-sum")]
public virtual async Task<MaterialRequestUnIssuedItemQtySumDto> GetUnIssuedItemQtySumAsync()
{
var dto = new MaterialRequestUnIssuedItemQtySumDto();
dto.Sum = list.Where(t => t.RequestStatus != EnumRequestStatus.New) var list = await GetMaterialRequestAsync();
.Sum(t => t.Details.Sum(t1 => t1.Qty - t1.IssuedQty));
return dto; dto.Sum = list.Where(t => t.RequestStatus != EnumRequestStatus.New)
} .Sum(t => t.Details.Sum(t1 => t1.Qty - t1.IssuedQty));
[HttpGet("un-received-item-qty-by-item-list")] return dto;
public virtual async Task<List<MaterialRequestUnReceivedItemQtyByItemDto>> }
GetUnIssuedItemQtySumByItemListAsync()
{
var dtos = new List<MaterialRequestUnReceivedItemQtyByItemDto>();
var list = await GetMaterialRequestAsync().ConfigureAwait(false); [HttpGet("un-received-item-qty-by-item-list")]
public virtual async Task<List<MaterialRequestUnReceivedItemQtyByItemDto>>
GetUnIssuedItemQtySumByItemListAsync()
{
var dtos = new List<MaterialRequestUnReceivedItemQtyByItemDto>();
var list = await GetMaterialRequestAsync();
var details = new List<MaterialRequestDetailDTO>(); var details = new List<MaterialRequestDetailDTO>();
list.Where(t => t.RequestStatus != EnumRequestStatus.New).ForEach( list.Where(t => t.RequestStatus != EnumRequestStatus.New).ForEach(
item => item =>
{ {
item.Details.ForEach( item.Details.ForEach(
detail => detail =>
{
if (detail.IssuedQty - detail.ReceivedQty > 0)
{ {
if (detail.IssuedQty - detail.ReceivedQty > 0) details.Add(detail);
{ }
details.Add(detail); });
}
});
}); });
dtos = details.GroupBy(t => t.ItemCode).Select( dtos = details.GroupBy(t => t.ItemCode).Select(
item => new MaterialRequestUnReceivedItemQtyByItemDto() item => new MaterialRequestUnReceivedItemQtyByItemDto()
{ {
ItemCode = item.Key, ItemCode = item.Key,
Sum = item.Sum(t => t.IssuedQty - t.ReceivedQty) Sum = item.Sum(t => t.IssuedQty - t.ReceivedQty)
}).ToList(); }).ToList();
return dtos; return dtos;
} }
[HttpGet("item-qty-by-received-status-list")] [HttpGet("item-qty-by-received-status-list")]
public virtual async Task<List<MaterialRequestItemQtyByReceivedStatusDto>> GetItemQtyByReceivedStatusListAsync() public virtual async Task<List<MaterialRequestItemQtyByReceivedStatusDto>> GetItemQtyByReceivedStatusListAsync()
{ {
var dtos = new List<MaterialRequestItemQtyByReceivedStatusDto>(); var dtos = new List<MaterialRequestItemQtyByReceivedStatusDto>();
var ToBeIssuedQty = 0.0M; var ToBeIssuedQty = 0.0M;
var ToBeReceivedQty = 0.0M; var ToBeReceivedQty = 0.0M;
var Received = 0.0M; var Received = 0.0M;
var list = await GetMaterialRequestAsync().ConfigureAwait(false); var list = await GetMaterialRequestAsync();
list.ForEach( list.ForEach(
item => item =>
{ {
ToBeIssuedQty += item.Details.Sum(t => t.ToBeIssuedQty); ToBeIssuedQty += item.Details.Sum(t => t.ToBeIssuedQty);
ToBeReceivedQty += item.Details.Sum(t => t.ToBeReceivedQty); ToBeReceivedQty += item.Details.Sum(t => t.ToBeReceivedQty);
Received += item.Details.Sum(t => t.ReceivedQty); Received += item.Details.Sum(t => t.ReceivedQty);
}); });
dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求未发", Sum = ToBeIssuedQty });
dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "已发未收", Sum = ToBeReceivedQty });
dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求已收", Sum = Received });
return dtos;
}
[HttpGet("un-received-item-list")] dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求未发", Sum = ToBeIssuedQty });
public virtual async Task<List<MaterialRequestUnReceivedItemDto>> GetUnReceivedItemListAsync() dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "已发未收", Sum = ToBeReceivedQty });
{ dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求已收", Sum = Received });
var dtos = new List<MaterialRequestUnReceivedItemDto>();
var notes = await GetIssueNotesAsync().ConfigureAwait(false); return dtos;
}
foreach (var note in notes) [HttpGet("un-received-item-list")]
public virtual async Task<List<MaterialRequestUnReceivedItemDto>> GetUnReceivedItemListAsync()
{ {
foreach (var noteDetail in note.Details) var dtos = new List<MaterialRequestUnReceivedItemDto>();
var notes = await this.GetIssueNotesAsync();
foreach (var note in notes)
{ {
var dto = new MaterialRequestUnReceivedItemDto(); foreach (var noteDetail in note.Details)
{
var dto = new MaterialRequestUnReceivedItemDto();
dto.Number = note.RequestNumber; dto.Number = note.RequestNumber;
dto.ItemCode = noteDetail.ItemCode; dto.ItemCode = noteDetail.ItemCode;
dto.ItemDesc1 = noteDetail.ItemDesc1; dto.ItemDesc1 = noteDetail.ItemDesc1;
dto.PackingCode = noteDetail.FromPackingCode; dto.PackingCode = noteDetail.FromPackingCode;
dto.IssuedQty = noteDetail.Qty; dto.IssuedQty = noteDetail.Qty;
dto.IssuedTime = note.ActiveDate; dto.IssuedTime = note.ActiveDate;
dtos.Add(dto); dtos.Add(dto);
}
} }
}
return dtos; return dtos;
} }
private async Task<List<IssueNoteDTO>> GetIssueNotesAsync() private async Task<List<IssueNoteDTO>> GetIssueNotesAsync()
{ {
return await _issueNoteApp.GetListUnConfirmedByTypeAsync(EnumTransSubType.Issue_WIP.ToString()).ConfigureAwait(false); return await this._issueNoteApp.GetListUnConfirmedByTypeAsync(EnumTransSubType.Issue_WIP.ToString());
} }
private async Task<List<MaterialRequestDTO>> GetMaterialRequestAsync() private async Task<List<MaterialRequestDTO>> GetMaterialRequestAsync()
{ {
return await _materialRequestApp.GetListByTypeAsync(EnumTransSubType.Issue_WIP.ToString()).ConfigureAwait(false); return await this._materialRequestApp.GetListByTypeAsync(EnumTransSubType.Issue_WIP.ToString());
}
} }
} }

262
be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs

@ -1,174 +1,194 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Serilog;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Wms.Dashboard.Host.Models; using Win_in.Sfs.Wms.Dashboard.Host.Models;
using System;
using System.Linq;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers; namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}plan-and-actual")]
public class PlanAndActualController : AbpController
{ {
private readonly ISupplierAsnAppService _supplierAsnApp;
private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteApp;
private readonly IPutawayNoteAppService _putawayNoteApp;
private readonly ISupplierAppService _supplierApp;
private readonly IItemSafetyStockAppService _itemSafetyStockApp;
public PlanAndActualController(ISupplierAsnAppService supplierAsnApp, IPurchaseReceiptNoteAppService purchaseReceiptNoteApp, IPutawayNoteAppService putawayNoteApp, ISupplierAppService supplierApp, IItemSafetyStockAppService itemSafetyStockApp) [ApiController]
{ [Route($"{PdaHostConst.ROOT_ROUTE}plan-and-actual")]
_supplierAsnApp = supplierAsnApp;
_purchaseReceiptNoteApp = purchaseReceiptNoteApp;
_putawayNoteApp = putawayNoteApp;
_supplierApp = supplierApp;
_itemSafetyStockApp = itemSafetyStockApp;
}
[HttpGet("plan-actual-list")] public class PlanAndActualController : AbpController
public virtual async Task<List<PlanAndActualDashboardDto>> GetPlanAndActualListAsync()
{ {
return await GetPlanAndActualDashboardsAsync().ConfigureAwait(false); private readonly ISupplierAsnAppService _supplierAsnApp;
} private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteApp;
private readonly IPutawayNoteAppService _putawayNoteApp;
private readonly ISupplierAppService _supplierApp;
private readonly IItemSafetyStockAppService _itemSafetyStockApp;
private readonly IPurchaseOrderAppService _purchaseOrderApp;
private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobApp;
public PlanAndActualController(ISupplierAsnAppService supplierAsnApp, IPurchaseReceiptNoteAppService purchaseReceiptNoteApp, IPutawayNoteAppService putawayNoteApp, ISupplierAppService supplierApp, IItemSafetyStockAppService itemSafetyStockApp, IPurchaseOrderAppService purchaseOrderApp, IPurchaseReceiptJobAppService purchaseReceiptJobApp)
{
_supplierAsnApp = supplierAsnApp;
_purchaseReceiptNoteApp = purchaseReceiptNoteApp;
_putawayNoteApp = putawayNoteApp;
_supplierApp = supplierApp;
_itemSafetyStockApp = itemSafetyStockApp;
_purchaseOrderApp = purchaseOrderApp;
_purchaseReceiptJobApp = purchaseReceiptJobApp;
}
private async Task<List<PlanAndActualDashboardDto>> GetPlanAndActualDashboardsAsync()
{
var supplierAsns = await GetSupplierAsnsAsync().ConfigureAwait(false);
var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct(); [HttpGet("plan-actual-list")]
public virtual async Task<List<PlanAndActualDashboardDto>> GetPlanAndActualListAsync()
{
return await GetPlanAndActualDashboardsAsync();
}
var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false); private async Task<List<PlanAndActualDashboardDto>> GetPlanAndActualDashboardsAsync()
{
var supplierAsns = await this.GetSupplierAsnsAsync();
var asnNumbers = supplierAsns.Select(t => t.Number); var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct();
var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers).ConfigureAwait(false); var suppliers = await GetSuppliersAsync(supplierCodes);
var putawayNotes = await GetPutawayNotesAsync(asnNumbers).ConfigureAwait(false); var asnNumbers = supplierAsns.Select(t => t.Number);
var itemSafetyStorks = await GetItemSafetyStocksAsync(supplierAsns).ConfigureAwait(false); var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers);
return ConvertToPlanAndActualDashboards( var putawayNotes = await this.GetPutawayNotesAsync(asnNumbers);
supplierAsns,
suppliers,
purchaseReceiptNotes,
putawayNotes,
itemSafetyStorks);
}
private static List<PlanAndActualDashboardDto> ConvertToPlanAndActualDashboards(List<SupplierAsnDTO> supplierAsns, List<SupplierDTO> suppliers, List<PurchaseReceiptNoteDTO> purchaseReceiptNotes, List<PutawayNoteDTO> putawayNotes, List<ItemSafetyStockDTO> itemSafetyStorks) var itemSafetyStorks = await this.GetItemSafetyStocksAsync(supplierAsns);
{
var dtos = new List<PlanAndActualDashboardDto>(); return await this.ConvertToPlanAndActualDashboards(
supplierAsns,
suppliers,
purchaseReceiptNotes,
putawayNotes,
itemSafetyStorks);
}
foreach (var supplierAsn in supplierAsns) private async Task<List<PlanAndActualDashboardDto>> ConvertToPlanAndActualDashboards(List<SupplierAsnDTO> supplierAsns, List<SupplierDTO> suppliers, List<PurchaseReceiptNoteDTO> purchaseReceiptNotes, List<PutawayNoteDTO> putawayNotes, List<ItemSafetyStockDTO> itemSafetyStorks)
{ {
var purchaseReceipts = purchaseReceiptNotes.FindAll(t => t.AsnNumber == supplierAsn.Number); var dtos = new List<PlanAndActualDashboardDto>();
var putaways = putawayNotes.FindAll(t => t.AsnNumber == supplierAsn.Number);
var supplierShortName = string.Empty; foreach (var supplierAsn in supplierAsns)
{
var purchaseReceipts = purchaseReceiptNotes.FindAll(t => t.AsnNumber == supplierAsn.Number);
var putaways = putawayNotes.FindAll(t => t.AsnNumber == supplierAsn.Number);
var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode); var supplierShortName = string.Empty;
if (supplier == null) var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
{
continue;
}
supplierShortName = supplier.ShortName; if (supplier == null)
continue;
foreach (var detail in supplierAsn.Details) supplierShortName = supplier.ShortName;
{
var dto = dtos.FirstOrDefault(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode);
if (dto == null) foreach (var detail in supplierAsn.Details)
{ {
dto = new PlanAndActualDashboardDto(); var dto = dtos.FirstOrDefault(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode);
dto.SupplierShortName = supplierShortName; if (dto == null)
dto.ItemCode = detail.ItemCode; {
dto.ItemDesc1 = detail.ItemDesc1; dto = new PlanAndActualDashboardDto();
dto.ItemName = detail.ItemName;
var itemSafetyStork = itemSafetyStorks.FirstOrDefault(t => t.ItemCode == detail.ItemCode); dto.SupplierShortName = supplierShortName;
dto.ItemCode = detail.ItemCode;
dto.ItemDesc1 = detail.ItemDesc1;
dto.ItemName = detail.ItemName;
if (itemSafetyStork != null) var itemSafetyStork = itemSafetyStorks.FirstOrDefault(t => t.ItemCode == detail.ItemCode);
{
dto.MaxQty = itemSafetyStork.MaxStock;
dto.MinQty = itemSafetyStork.MinStock;
}
dto.ReceiptNoteCount = CountReceiptNoteCount(purchaseReceipts, detail.ItemCode, detail.Lot); if (itemSafetyStork != null)
dto.ReceiptQty = CountReceiptQty(purchaseReceipts, detail.ItemCode, detail.Lot); {
dto.PutawayQty = CountPutawayQty(putawayNotes, detail.ItemCode, detail.Lot); dto.MaxQty = itemSafetyStork.MaxStock;
dto.MinQty = itemSafetyStork.MinStock;
}
dtos.Add(dto); var purchaseOrderDtos = await _purchaseOrderApp.GetListBySupplierCodeAsync(supplierAsn.SupplierCode, detail.ItemCode);
} var supllierAsn = await _supplierAsnApp.GetForTodayListAsync();
var poNumberList = supllierAsn.Select(p => p.PoNumber).ToList();
dto.SupplierAsnCount += 1; purchaseOrderDtos = purchaseOrderDtos.Where(p => poNumberList.Contains(p.Number)).ToList();
dto.PlanArriveQty += detail.Qty;
}
}
return dtos.OrderBy(t => t.SupplierShortName).ToList(); decimal allPutawayQty = 0;
} decimal allReceiptQty = 0;
decimal allPlanArriveQty = 0;
private static decimal CountPutawayQty(List<PutawayNoteDTO> putawayNotes, string itemCode, string lot) foreach (var purchaseOrderDTO in purchaseOrderDtos)
{ {
return putawayNotes.Sum(t => t.Details.Where(t => t.ItemCode == itemCode && t.ToLot == lot).Sum(t => t.Qty)); allPutawayQty += purchaseOrderDTO.Details.Where(p => p.ItemCode == detail.ItemCode).Sum(p => p.PutAwayQty);
} allReceiptQty += purchaseOrderDTO.Details.Where(p => p.ItemCode == detail.ItemCode).Sum(p => p.ReceivedQty);
allPlanArriveQty += purchaseOrderDTO.Details.Where(p => p.ItemCode == detail.ItemCode).Sum(p => p.ShippedQty);
}
private static decimal CountReceiptQty(List<PurchaseReceiptNoteDTO> purchaseReceipts, string itemCode, string lot) dto.PutawayQty = allPutawayQty;
{ dto.PlanArriveQty = allPlanArriveQty;
return purchaseReceipts.Sum(t => t.Details.Where(t => t.ItemCode == itemCode && t.HandledLot == lot).Sum(t => t.Qty)); dto.ReceiptQty = allReceiptQty;
}
private static int CountReceiptNoteCount(List<PurchaseReceiptNoteDTO> purchaseReceipts, string itemCode, string lot) dtos.Add(dto);
{ }
return purchaseReceipts.Sum(t => t.Details.Count(t => t.ItemCode == itemCode && t.Lot == lot));
}
private async Task<List<SupplierAsnDTO>> GetSupplierAsnsAsync() var purchaseReceiptJobDtos = await _purchaseReceiptJobApp.GetListBySupplierCodeOnTodayAsync(supplierAsn.SupplierCode);
{
var startTime = DateTime.Today.AddHours(DashboardConst.AsnReceiptTimeLimitHour); dto.ReceiptNoteCount = purchaseReceiptJobDtos.Count(p => p.JobStatus == EnumJobStatus.Done);
var endTime = startTime.AddDays(1).AddSeconds(-1); dto.SupplierAsnCount = purchaseReceiptJobDtos.Count();
}
}
return dtos.OrderBy(t => t.SupplierShortName).ToList();
}
if (DateTime.Now.Hour < DashboardConst.AsnReceiptTimeLimitHour) private decimal CountReceiptQty(List<PurchaseReceiptNoteDTO> purchaseReceipts, string itemCode)
{ {
startTime.AddDays(-1); return purchaseReceipts.Sum(t => t.Details.Where(t => t.ItemCode == itemCode).Sum(t => t.Qty));
endTime.AddDays(-1);
} }
return await _supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime).ConfigureAwait(false); private int CountReceiptNoteCount(List<PurchaseReceiptNoteDTO> purchaseReceipts, string itemCode)
} {
return purchaseReceipts.Sum(t => t.Details.Count(t => t.ItemCode == itemCode));
}
private async Task<List<SupplierDTO>> GetSuppliersAsync(IEnumerable<string> codes) private async Task<List<SupplierAsnDTO>> GetSupplierAsnsAsync()
{ {
return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false); var startTime = DateTime.Today.AddHours(DashboardConst.AsnReceiptTimeLimitHour);
}
private async Task<List<PurchaseReceiptNoteDTO>> GetPurchaseReceiptNotesAsync(IEnumerable<string> asnNumbers) var endTime = startTime.AddDays(1).AddSeconds(-1);
{
return await _purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false);
}
private async Task<List<PutawayNoteDTO>> GetPutawayNotesAsync(IEnumerable<string> asnNumbers) if (DateTime.Now.Hour < DashboardConst.AsnReceiptTimeLimitHour)
{ {
return await _putawayNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false); startTime.AddDays(-1);
} endTime.AddDays(-1);
private async Task<List<ItemSafetyStockDTO>> GetItemSafetyStocksAsync(List<SupplierAsnDTO> supplierAsns) }
{
var itemCodes = new List<string>();
supplierAsns.ForEach(t => { itemCodes.AddRange(t.Details.Select(t => t.ItemCode).ToList()); }); return await this._supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime);
}
var itemSafetyStorks = await _itemSafetyStockApp.GetByItemCodesAsync(itemCodes).ConfigureAwait(false); private async Task<List<SupplierDTO>> GetSuppliersAsync(IEnumerable<string> codes)
return itemSafetyStorks; {
return await this._supplierApp.GetByCodesAsync(codes);
}
private async Task<List<PurchaseReceiptNoteDTO>> GetPurchaseReceiptNotesAsync(IEnumerable<string> asnNumbers)
{
return await this._purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers);
}
private async Task<List<PutawayNoteDTO>> GetPutawayNotesAsync(IEnumerable<string> asnNumbers)
{
return await this._putawayNoteApp.GetListByAsnNumbers(asnNumbers);
}
private async Task<List<ItemSafetyStockDTO>> GetItemSafetyStocksAsync(List<SupplierAsnDTO> supplierAsns)
{
var itemCodes = new List<string>();
supplierAsns.ForEach(t => { itemCodes.AddRange(t.Details.Select(t => t.ItemCode).ToList()); });
var itemSafetyStorks = await this._itemSafetyStockApp.GetByItemCodesAsync(itemCodes);
return itemSafetyStorks;
}
} }
} }

352
be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs

@ -5,233 +5,255 @@ using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Wms.Dashboard.Host.Models; using Win_in.Sfs.Wms.Dashboard.Host.Models;
namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers; namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
{
using System.Linq; using System;
using System.Linq;
using Win_in.Sfs.Label.Application.Contracts; using Volo.Abp;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
[ApiController] using Win_in.Sfs.Label.Application.Contracts;
[Route($"{PdaHostConst.ROOT_ROUTE}purchase-receipt")] using Win_in.Sfs.Label.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
public class PurchaseReceiptController : AbpController [ApiController]
{ [Route($"{PdaHostConst.ROOT_ROUTE}purchase-receipt")]
private readonly IBalanceAppService _balanceApp;
private readonly IInventoryLabelAppService _labelService;
private readonly ISupplierAppService _supplierApp;
private readonly ISupplierAsnAppService _supplierAsnApp;
public PurchaseReceiptController(IBalanceAppService balanceApp, IInventoryLabelAppService labelService, ISupplierAppService supplierApp, ISupplierAsnAppService supplierAsnApp) public class PurchaseReceiptController : AbpController
{ {
this._balanceApp = balanceApp; private readonly IBalanceAppService _balanceApp;
this._labelService = labelService; private readonly IInventoryLabelAppService _labelService;
this._supplierApp = supplierApp; private readonly ISupplierAppService _supplierApp;
this._supplierAsnApp = supplierAsnApp; private readonly ISupplierAsnAppService _supplierAsnApp;
} private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteAppService;
private readonly IInspectNoteAppService _inspectNoteAppService;
public PurchaseReceiptController(IBalanceAppService balanceApp, IInventoryLabelAppService labelService, ISupplierAppService supplierApp, ISupplierAsnAppService supplierAsnApp, IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService, IInspectNoteAppService inspectNoteAppService)
{
this._balanceApp = balanceApp;
this._labelService = labelService;
this._supplierApp = supplierApp;
this._supplierAsnApp = supplierAsnApp;
_purchaseReceiptNoteAppService = purchaseReceiptNoteAppService;
_inspectNoteAppService = inspectNoteAppService;
}
[HttpGet("receipt-sum-qty")] /// <summary>
public virtual async Task<PurchaseReceiptSumQtyDashboardDto> GetReceiptSumQtyAsync() /// 未上架数量
{ /// </summary>
var dto = new PurchaseReceiptSumQtyDashboardDto(); /// <returns></returns>
[HttpGet("no-put-away-sum-qty")]
public virtual async Task<PurchaseReceiptSumQtyDashboardDto> GetNoPutAwaySumQtyAsync()
{
var dto = new PurchaseReceiptSumQtyDashboardDto();
var items = await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); var items = await GetPurchaseReceiptItemDashboardAsync();
dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) }; dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) };
return dto; return dto;
} }
[HttpGet("receipt-count-by-supplier")] /// <summary>
public virtual async Task<List<PurchaseReceiptCountBySupplierDashboardDto>> GetReceiptCountBySupplierQtyAsync() /// 未上架汇总
{ /// </summary>
var items = await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); /// <returns></returns>
[HttpGet("no-put-away-by-supplier")]
public virtual async Task<List<PurchaseReceiptCountBySupplierDashboardDto>> GetNoPutAwayBySupplierAsync()
{
var items = await GetPurchaseReceiptItemDashboardAsync();
var dtos = items.GroupBy(t => t.SupplierShortName) var dtos = items.GroupBy(t => t.SupplierShortName)
.Select( .Select(
t => new PurchaseReceiptCountBySupplierDashboardDto t => new PurchaseReceiptCountBySupplierDashboardDto
{ {
SupplierShortName = t.Key, SupplierShortName = t.Key,
Qty = t.Sum(t1 => t1.Qty) Qty = t.Sum(t1 => t1.Qty)
}).OrderBy(t => t.SupplierShortName).ToList(); }).OrderBy(t => t.SupplierShortName).ToList();
return dtos; return dtos;
} }
[HttpGet("receipt-item-list")] /// <summary>
public virtual async Task<List<PurchaseReceiptItemDashboardDto>> GetReceiptItemListAsync() /// 未上架明细
{ /// </summary>
return await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); /// <returns></returns>
} [HttpGet("no-put-away-item-list")]
public virtual async Task<List<PurchaseReceiptItemDashboardDto>> GetReceiptItemListAsync()
{
return await GetPurchaseReceiptItemDashboardAsync();
}
[HttpGet("un-receipt-sum-qty")] [HttpGet("un-receipt-sum-qty")]
public virtual async Task<PurchaseReceiptSumQtyDashboardDto> GetUnReceiptSumQtyAsync() public virtual async Task<PurchaseReceiptSumQtyDashboardDto> GetUnReceiptSumQtyAsync()
{ {
var dto = new PurchaseReceiptSumQtyDashboardDto(); var dto = new PurchaseReceiptSumQtyDashboardDto();
var items = await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); var items = await this.GetUnPurchaseReceiptItemDashboardAsync();
dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) }; dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) };
return dto; return dto;
} }
[HttpGet("un-receipt-count-by-supplier")] [HttpGet("un-receipt-count-by-supplier")]
public virtual async Task<List<PurchaseReceiptCountBySupplierDashboardDto>> GetUnReceiptCountBySupplierQtyAsync() public virtual async Task<List<PurchaseReceiptCountBySupplierDashboardDto>> GetUnReceiptCountBySupplierQtyAsync()
{ {
var items = await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); var items = await GetUnPurchaseReceiptItemDashboardAsync();
var dtos = items.GroupBy(t => t.SupplierShortName) var dtos = items.GroupBy(t => t.SupplierShortName)
.Select( .Select(
t => new PurchaseReceiptCountBySupplierDashboardDto t => new PurchaseReceiptCountBySupplierDashboardDto
{ {
SupplierShortName = t.Key, SupplierShortName = t.Key,
Qty = t.Sum(t1 => t1.Qty) Qty = t.Sum(t1 => t1.Qty)
}).OrderBy(t => t.SupplierShortName).ToList(); }).OrderBy(t => t.SupplierShortName).ToList();
return dtos; return dtos;
} }
[HttpGet("un-receipt-item-list")] [HttpGet("un-receipt-item-list")]
public virtual async Task<List<PurchaseReceiptItemDashboardDto>> GetUnReceiptItemListAsync() public virtual async Task<List<PurchaseReceiptItemDashboardDto>> GetUnReceiptItemListAsync()
{ {
return await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false); return await this.GetUnPurchaseReceiptItemDashboardAsync();
} }
private async Task<List<PurchaseReceiptItemDashboardDto>> GetPurchaseReceiptItemDashboardAsync() private async Task<List<PurchaseReceiptItemDashboardDto>> GetPurchaseReceiptItemDashboardAsync()
{ {
var balances = await GetBalancesAsync("INSPECT", EnumInventoryStatus.OK).ConfigureAwait(false); var inspectNoteDetailDto = await _inspectNoteAppService.GetInspectNoteDetailByToDayTaskAsync();
var packingCodeList = inspectNoteDetailDto.Where(p => p.Status == EnumInventoryStatus.OK).Select(p => p.PackingCode).ToList();
var balances = await _balanceApp.GetListByPackingCodesAsync(packingCodeList);
balances = balances.Where(p => p.LocationCode == "INSPECT").ToList();
var packingcodes = balances.Select(t => t.PackingCode).Distinct(); //var balances = await GetBalancesAsync("INSPECT", EnumInventoryStatus.OK);
var labels = await GetLabelsAsync(packingcodes).ConfigureAwait(false); var packingcodes = balances.Select(t => t.PackingCode).Distinct();
var supplierCodes = labels.Select(t => t.SupplierCode).Distinct(); var labels = await GetLabelsAsync(packingcodes);
var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false); var supplierCodes = labels.Select(t => t.SupplierCode).Distinct();
return ConvertToPurchaseReceiptItemDashboard(balances, labels, suppliers); var suppliers = await GetSuppliersAsync(supplierCodes);
}
private static List<PurchaseReceiptItemDashboardDto> ConvertToPurchaseReceiptItemDashboard( return ConvertToPurchaseReceiptItemDashboard(balances, labels, suppliers);
List<BalanceDTO> balances, }
List<InventoryLabelDto> labels,
List<SupplierDTO> suppliers)
{
var dtos = new List<PurchaseReceiptItemDashboardDto>();
foreach (var balance in balances) private List<PurchaseReceiptItemDashboardDto> ConvertToPurchaseReceiptItemDashboard(
List<BalanceDTO> balances,
List<InventoryLabelDto> labels,
List<SupplierDTO> suppliers)
{ {
var supplierShortName = string.Empty; var dtos = new List<PurchaseReceiptItemDashboardDto>();
var label = labels.FirstOrDefault(t => t.Code == balance.PackingCode); foreach (var balance in balances)
if (label == null)
{ {
continue; var supplierShortName = string.Empty;
}
var supplier = suppliers.FirstOrDefault(t => t != null && t.Code == label.SupplierCode); var label = labels.FirstOrDefault(t => t.Code == balance.PackingCode);
if (supplier == null) if (label == null)
{ continue;
continue;
}
supplierShortName = supplier.ShortName; var supplier = suppliers.FirstOrDefault(t => t != null && t.Code == label.SupplierCode);
var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == balance.ItemCode); if (supplier == null)
continue;
if (dto == null) supplierShortName = supplier.ShortName;
{
dto = new PurchaseReceiptItemDashboardDto();
dto.SupplierShortName = supplierShortName; var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == balance.ItemCode);
dto.ItemCode = balance.ItemCode;
dto.ItemDesc1 = balance.ItemDesc1;
dto.Qty = 0;
dtos.Add(dto); if (dto == null)
} {
dto = new PurchaseReceiptItemDashboardDto();
dto.Qty += balance.Qty; dto.SupplierShortName = supplierShortName;
} dto.ItemCode = balance.ItemCode;
dto.ItemDesc1 = balance.ItemDesc1;
dto.Qty = 0;
return dtos.OrderBy(t => t.SupplierShortName).ToList(); dtos.Add(dto);
} }
private async Task<List<BalanceDTO>> GetBalancesAsync(string locationCode, EnumInventoryStatus status) dto.Qty += balance.Qty;
{ }
return await _balanceApp.GetListByLocationCodeAndStatusAsync(locationCode, status).ConfigureAwait(false);
}
private async Task<List<InventoryLabelDto>> GetLabelsAsync(IEnumerable<string> codes)
{
return await _labelService.GetByCodesAsync(codes).ConfigureAwait(false);
}
private async Task<List<SupplierDTO>> GetSuppliersAsync(IEnumerable<string> codes)
{
return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false);
}
private async Task<List<SupplierAsnDTO>> GetSupplierAsnsAsync() return dtos.OrderBy(t => t.SupplierShortName).ToList();
{ }
return await _supplierAsnApp.GetForTodayUnReceivedListAsync().ConfigureAwait(false);
}
private static List<PurchaseReceiptItemDashboardDto> ConvertToUnPurchaseReceiptItemDashboard( private async Task<List<BalanceDTO>> GetBalancesAsync(string locationCode, EnumInventoryStatus status)
List<SupplierAsnDTO> supplierAsns, {
List<SupplierDTO> suppliers) return await this._balanceApp.GetListByLocationCodeAndStatusAsync(locationCode, status);
{ }
var dtos = new List<PurchaseReceiptItemDashboardDto>(); private async Task<List<InventoryLabelDto>> GetLabelsAsync(IEnumerable<string> codes)
{
return await this._labelService.GetByCodesAsync(codes);
}
private async Task<List<SupplierDTO>> GetSuppliersAsync(IEnumerable<string> codes)
{
return await this._supplierApp.GetByCodesAsync(codes);
}
foreach (var supplierAsn in supplierAsns) private async Task<List<SupplierAsnDTO>> GetSupplierAsnsAsync()
{ {
var supplierShortName = string.Empty; return await this._supplierAsnApp.GetForTodayUnReceivedListAsync();
}
var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode); private List<PurchaseReceiptItemDashboardDto> ConvertToUnPurchaseReceiptItemDashboard(
List<SupplierAsnDTO> supplierAsns,
List<SupplierDTO> suppliers)
{
var dtos = new List<PurchaseReceiptItemDashboardDto>();
if (supplier == null) foreach (var supplierAsn in supplierAsns)
{ {
continue; var supplierShortName = string.Empty;
}
supplierShortName = supplier.ShortName; var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
foreach (var detail in supplierAsn.Details) if (supplier == null)
{ continue;
var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode);
if (dto == null) supplierShortName = supplier.ShortName;
foreach (var detail in supplierAsn.Details)
{ {
dto = new PurchaseReceiptItemDashboardDto(); var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode);
dto.SupplierShortName = supplierShortName; if (dto == null)
dto.ItemCode = detail.ItemCode; {
dto.ItemDesc1 = detail.ItemDesc1; dto = new PurchaseReceiptItemDashboardDto();
dto.Qty = 0;
dtos.Add(dto); dto.SupplierShortName = supplierShortName;
} dto.ItemCode = detail.ItemCode;
dto.ItemDesc1 = detail.ItemDesc1;
dto.Qty = 0;
dtos.Add(dto);
}
dto.Qty += detail.Qty; dto.Qty += detail.Qty;
}
} }
}
return dtos.OrderBy(t => t.SupplierShortName).ToList(); return dtos.OrderBy(t => t.SupplierShortName).ToList();
} }
private async Task<List<PurchaseReceiptItemDashboardDto>> GetUnPurchaseReceiptItemDashboardAsync() private async Task<List<PurchaseReceiptItemDashboardDto>> GetUnPurchaseReceiptItemDashboardAsync()
{ {
var dtos = new List<PurchaseReceiptItemDashboardDto>(); var dtos = new List<PurchaseReceiptItemDashboardDto>();
var supplierAsns = await GetSupplierAsnsAsync().ConfigureAwait(false); var supplierAsns = await this.GetSupplierAsnsAsync();
var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct(); var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct();
var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false); var suppliers = await GetSuppliersAsync(supplierCodes);
return ConvertToUnPurchaseReceiptItemDashboard(supplierAsns, suppliers); return this.ConvertToUnPurchaseReceiptItemDashboard(supplierAsns, suppliers);
}
} }
} }

7
be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs

@ -1,4 +1,5 @@
using System.IO; using System.IO;
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
@ -83,6 +84,12 @@ public class StoreHttpApiHostModule : ModuleBase<StoreHttpApiHostModule>
{ {
base.ConfigureServices(context); base.ConfigureServices(context);
ConfigureVirtualFileSystem(); ConfigureVirtualFileSystem();
//将枚举返回时都变为字符串
//context.Services.AddControllers().AddJsonOptions(options =>
//{
// options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
//});
//ConfigureSwaggerServices(context, context.Services.GetConfiguration()); //ConfigureSwaggerServices(context, context.Services.GetConfiguration());
} }

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

@ -700,6 +700,7 @@ CREATE TABLE [Store_DeliverNote] (
[DeliverTime] datetime2 NOT NULL, [DeliverTime] datetime2 NOT NULL,
[DeliverRequestNumber] nvarchar(max) NULL, [DeliverRequestNumber] nvarchar(max) NULL,
[DeliverRequestType] nvarchar(64) NOT NULL, [DeliverRequestType] nvarchar(64) NOT NULL,
[CountPrint] int NOT NULL,
[ExtraProperties] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL, [ConcurrencyStamp] nvarchar(40) NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,
@ -1280,7 +1281,7 @@ CREATE TABLE [Store_ProductReceiptRequest] (
[Shift] nvarchar(64) NULL, [Shift] nvarchar(64) NULL,
[Team] nvarchar(64) NULL, [Team] nvarchar(64) NULL,
[PlanDate] datetime2 NOT NULL, [PlanDate] datetime2 NOT NULL,
[Type] nvarchar(64) NULL, [Type] nvarchar(64) NOT NULL,
[ExtraProperties] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL, [ConcurrencyStamp] nvarchar(40) NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,
@ -1862,6 +1863,52 @@ CREATE TABLE [Store_WarehouseTransferNote] (
) )
CREATE TABLE [Store_WipWarehouseAdjustNote] (
[Id] uniqueidentifier NOT NULL,
[Type] nvarchar(64) NULL,
[RequestNumber] nvarchar(max) NULL,
[JobNumber] nvarchar(64) NULL,
[Confirmed] bit NOT NULL,
[ConfirmTime] datetime2 NULL,
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
[LastModificationTime] datetime2 NULL,
[LastModifierId] uniqueidentifier NULL,
[TenantId] uniqueidentifier NULL,
[Remark] nvarchar(3072) NULL,
[Worker] nvarchar(max) NULL,
[Number] nvarchar(64) NOT NULL,
[ActiveDate] datetime2 NOT NULL,
CONSTRAINT [PK_Store_WipWarehouseAdjustNote] PRIMARY KEY ([Id])
)
CREATE TABLE [Store_WipWarehouseAdjustRequest] (
[Id] uniqueidentifier NOT NULL,
[Type] nvarchar(64) NULL,
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
[LastModificationTime] datetime2 NULL,
[LastModifierId] uniqueidentifier NULL,
[TenantId] uniqueidentifier NULL,
[Remark] nvarchar(3072) NULL,
[Worker] nvarchar(max) NULL,
[Number] nvarchar(64) NOT NULL,
[ActiveDate] datetime2 NOT NULL,
[AutoSubmit] bit NOT NULL,
[AutoAgree] bit NOT NULL,
[AutoHandle] bit NOT NULL,
[AutoCompleteJob] bit NOT NULL,
[DirectCreateNote] bit NOT NULL,
[RequestStatus] nvarchar(64) NOT NULL,
CONSTRAINT [PK_Store_WipWarehouseAdjustRequest] PRIMARY KEY ([Id])
)
CREATE TABLE [Store_WorkOrder] ( CREATE TABLE [Store_WorkOrder] (
[Id] uniqueidentifier NOT NULL, [Id] uniqueidentifier NOT NULL,
[WorkOrderId] nvarchar(64) NULL, [WorkOrderId] nvarchar(64) NULL,
@ -3068,6 +3115,7 @@ CREATE TABLE [Store_InspectNoteDetail] (
[Weight] nvarchar(max) NULL, [Weight] nvarchar(max) NULL,
[OtherPropertyJson] nvarchar(max) NULL, [OtherPropertyJson] nvarchar(max) NULL,
[StdPackQty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL,
[InspectDate] datetime2 NOT NULL,
[CreationTime] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL, [CreatorId] uniqueidentifier NULL,
[LastModificationTime] datetime2 NULL, [LastModificationTime] datetime2 NULL,
@ -5067,6 +5115,98 @@ CREATE TABLE [Store_WarehouseTransferNoteDetail] (
) )
CREATE TABLE [Store_WipWarehouseAdjustNoteDetail] (
[Id] uniqueidentifier NOT NULL,
[Reason] nvarchar(64) NULL,
[ReasonCode] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
[LastModificationTime] datetime2 NULL,
[LastModifierId] uniqueidentifier NULL,
[MasterID] uniqueidentifier NOT NULL,
[TenantId] uniqueidentifier NULL,
[Number] nvarchar(64) NOT NULL,
[Remark] nvarchar(3072) NULL,
[ItemName] nvarchar(64) NULL,
[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,
[ToPackingCode] nvarchar(max) NULL,
[FromContainerCode] nvarchar(max) NULL,
[ToContainerCode] nvarchar(max) NULL,
[FromLot] nvarchar(max) NULL,
[ToLot] nvarchar(max) NULL,
[SupplierBatch] nvarchar(64) NULL,
[ArriveDate] datetime2 NOT NULL,
[ProduceDate] datetime2 NOT NULL,
[ExpireDate] datetime2 NOT NULL,
[FromLocationCode] nvarchar(64) NOT NULL,
[FromLocationArea] nvarchar(64) NULL,
[FromLocationGroup] nvarchar(64) NULL,
[FromLocationErpCode] nvarchar(64) NOT NULL,
[FromWarehouseCode] nvarchar(64) NOT NULL,
[FromStatus] nvarchar(64) NOT NULL,
[ToLocationCode] nvarchar(64) NOT NULL,
[ToLocationArea] nvarchar(64) NULL,
[ToLocationGroup] nvarchar(64) NULL,
[ToLocationErpCode] nvarchar(64) NOT NULL,
[ToWarehouseCode] nvarchar(64) NOT NULL,
[ToStatus] nvarchar(64) NOT NULL,
CONSTRAINT [PK_Store_WipWarehouseAdjustNoteDetail] PRIMARY KEY ([Id]),
CONSTRAINT [FK_Store_WipWarehouseAdjustNoteDetail_Store_WipWarehouseAdjustNote_MasterID] FOREIGN KEY ([MasterID]) REFERENCES [Store_WipWarehouseAdjustNote] ([Id]) ON DELETE CASCADE
)
CREATE TABLE [Store_WipWarehouseAdjustRequestDetail] (
[Id] uniqueidentifier NOT NULL,
[Reason] nvarchar(max) NULL,
[ReasonCode] nvarchar(max) NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
[LastModificationTime] datetime2 NULL,
[LastModifierId] uniqueidentifier NULL,
[MasterID] uniqueidentifier NOT NULL,
[TenantId] uniqueidentifier NULL,
[Number] nvarchar(64) NOT NULL,
[Remark] nvarchar(3072) NULL,
[ItemName] nvarchar(64) NULL,
[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(max) NULL,
[ToPackingCode] nvarchar(max) NULL,
[FromContainerCode] nvarchar(max) NULL,
[ToContainerCode] nvarchar(max) NULL,
[FromLot] nvarchar(max) NULL,
[ToLot] nvarchar(max) NULL,
[SupplierBatch] nvarchar(64) NULL,
[ArriveDate] datetime2 NOT NULL,
[ProduceDate] datetime2 NOT NULL,
[ExpireDate] datetime2 NOT NULL,
[FromLocationCode] nvarchar(64) NOT NULL,
[FromLocationArea] nvarchar(64) NULL,
[FromLocationGroup] nvarchar(64) NULL,
[FromLocationErpCode] nvarchar(64) NOT NULL,
[FromWarehouseCode] nvarchar(64) NOT NULL,
[FromStatus] nvarchar(64) NOT NULL,
[ToLocationCode] nvarchar(64) NOT NULL,
[ToLocationArea] nvarchar(64) NULL,
[ToLocationGroup] nvarchar(64) NULL,
[ToLocationErpCode] nvarchar(64) NOT NULL,
[ToWarehouseCode] nvarchar(64) NOT NULL,
[ToStatus] nvarchar(64) NOT NULL,
CONSTRAINT [PK_Store_WipWarehouseAdjustRequestDetail] PRIMARY KEY ([Id]),
CONSTRAINT [FK_Store_WipWarehouseAdjustRequestDetail_Store_WipWarehouseAdjustRequest_MasterID] FOREIGN KEY ([MasterID]) REFERENCES [Store_WipWarehouseAdjustRequest] ([Id]) ON DELETE CASCADE
)
CREATE TABLE [Store_WorkOrderDetail] ( CREATE TABLE [Store_WorkOrderDetail] (
[Id] uniqueidentifier NOT NULL, [Id] uniqueidentifier NOT NULL,
[EffectiveDate] datetime2 NOT NULL, [EffectiveDate] datetime2 NOT NULL,
@ -5697,6 +5837,21 @@ CREATE INDEX [IX_Store_WarehouseTransferNoteDetail_MasterID] ON [Store_Warehouse
CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode] ON [Store_WarehouseTransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode]) WHERE [FromPackingCode] IS NOT NULL CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode] ON [Store_WarehouseTransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode]) WHERE [FromPackingCode] IS NOT NULL
CREATE UNIQUE INDEX [IX_Store_WipWarehouseAdjustNote_Number] ON [Store_WipWarehouseAdjustNote] ([Number])
CREATE INDEX [IX_Store_WipWarehouseAdjustNoteDetail_MasterID] ON [Store_WipWarehouseAdjustNoteDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_WipWarehouseAdjustNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode_FromStatus_ToStatus] ON [Store_WipWarehouseAdjustNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromStatus], [ToStatus]) WHERE [FromPackingCode] IS NOT NULL
CREATE UNIQUE INDEX [IX_Store_WipWarehouseAdjustRequest_Number] ON [Store_WipWarehouseAdjustRequest] ([Number])
CREATE INDEX [IX_Store_WipWarehouseAdjustRequestDetail_MasterID] ON [Store_WipWarehouseAdjustRequestDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_WorkOrder_Number] ON [Store_WorkOrder] ([Number]) CREATE UNIQUE INDEX [IX_Store_WorkOrder_Number] ON [Store_WorkOrder] ([Number])

67
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs

@ -5,6 +5,8 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Volo.Abp;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
@ -29,6 +31,8 @@ public class BalanceController : AbpController
private readonly ILocationAppService _locationAppService; private readonly ILocationAppService _locationAppService;
private readonly IExpectOutAppService _expectOutAppService;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -38,10 +42,11 @@ public class BalanceController : AbpController
public BalanceController( public BalanceController(
IBalanceAppService balanceAppService, IBalanceAppService balanceAppService,
IItemBasicAppService itemBasicAppService, IItemBasicAppService itemBasicAppService,
ILocationAppService locationAppService) ILocationAppService locationAppService, IExpectOutAppService expectOutAppService)
{ {
this._balanceAppService = balanceAppService; this._balanceAppService = balanceAppService;
this._locationAppService = locationAppService; this._locationAppService = locationAppService;
_expectOutAppService = expectOutAppService;
this._itemBasicAppService = itemBasicAppService; this._itemBasicAppService = itemBasicAppService;
} }
@ -280,11 +285,11 @@ public class BalanceController : AbpController
} }
} }
if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any()) //if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any())
{ //{
input.Condition.Filters.Add( // input.Condition.Filters.Add(
new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In")); // new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In"));
} //}
var balanceDTOs = await _balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false); var balanceDTOs = await _balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false);
@ -426,6 +431,56 @@ public class BalanceController : AbpController
return balanceDTOs; return balanceDTOs;
} }
/// <summary>
/// 查询库存余额 根据 物品 库位 库位类型 库存状态 批次 并且没有被预计出 占用
/// </summary>
/// <param name="listInput"></param>
/// <returns></returns>
[HttpPost("by-balances-request-many-parameter-not-in-expect-out")]
public async Task<PagedResultDto<BalanceDTO>> GetListByLocationTypeAndInventoryStatusAndNotExpectOutAsync(
BalanceListByIssueInputByInventoryStatusAndLocationType listInput)
{
var expectOut = await _expectOutAppService.GetListByPackingCodeAsync(listInput.packingCode);
if (expectOut != null && expectOut.Any())
{
throw new UserFriendlyException($"箱码为 {listInput.packingCode} 已被任务{expectOut[0].JobNumber}使用");
}
var input = new SfsInventoryRequestInputBase()
{
MaxResultCount = listInput.pageSize,
SkipCount = (listInput.pageIndex - 1) * listInput.pageSize,
Sorting = listInput.sortBy,
Condition = new Condition { Filters = new List<Filter>() }
};
if (!string.IsNullOrWhiteSpace(listInput.itemCode))
input.Condition.Filters.Add(new Filter("ItemCode", listInput.itemCode));
if (!string.IsNullOrWhiteSpace(listInput.locationCode))
input.Condition.Filters.Add(new Filter("LocationCode", listInput.locationCode));
if (!string.IsNullOrWhiteSpace(listInput.lot)) input.Condition.Filters.Add(new Filter("Lot", listInput.lot));
if (!string.IsNullOrWhiteSpace(listInput.packingCode))
input.Condition.Filters.Add(new Filter("PackingCode", listInput.packingCode));
if (!string.IsNullOrWhiteSpace(listInput.containerCode))
input.Condition.Filters.Add(new Filter("ContainerCode", listInput.containerCode));
if (listInput.locationTypes != null && listInput.locationTypes.Any())
{
var locationCodes = (await this._locationAppService.GetListByTypesAsync(listInput.locationTypes).ConfigureAwait(false))
.Select(t => t.Code).ToList();
if (locationCodes.Any())
input.Condition.Filters.Add(
new Filter("LocationCode", JsonConvert.SerializeObject(locationCodes), "In"));
}
if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any())
input.Condition.Filters.Add(
new Filter("Status", JsonConvert.SerializeObject(listInput.inventoryStatuses), "In"));
return await this._balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false);
}
/* /*
/// <summary> /// <summary>
/// 查询库余额 /// 查询库余额

6
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs

@ -75,7 +75,7 @@ public class CountJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -133,7 +133,7 @@ public class CountJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes);
var status = new List<string>() {EnumJobStatus.Open.ToString(),EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var requestInput = new SfsJobRequestInputBase var requestInput = new SfsJobRequestInputBase
@ -165,7 +165,7 @@ public class CountJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs

@ -75,7 +75,7 @@ public class DeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
_ = JsonSerializer.Serialize(wlgCodes); _ = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -132,7 +132,7 @@ public class DeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs

@ -64,7 +64,7 @@ public class InspectJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -108,7 +108,7 @@ public class InspectJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase

6
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs

@ -65,7 +65,7 @@ public class IssueJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes);
var status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -143,7 +143,7 @@ public class IssueJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes);
var status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var requestInput = new SfsJobRequestInputBase var requestInput = new SfsJobRequestInputBase
@ -175,7 +175,7 @@ public class IssueJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs

@ -74,7 +74,7 @@ public class JisDeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -106,7 +106,7 @@ public class JisDeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase

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

@ -76,7 +76,7 @@ public class JobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var list = new List<JobCountDto>(); var list = new List<JobCountDto>();

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs

@ -62,7 +62,7 @@ public class ProductReceiveJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -106,7 +106,7 @@ public class ProductReceiveJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs

@ -69,7 +69,7 @@ public class ProductionReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -113,7 +113,7 @@ public class ProductionReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase

70
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs

@ -21,14 +21,10 @@ namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs;
/// </summary> /// </summary>
[ApiController] [ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}job/purchase-receipt")] [Route($"{PdaHostConst.ROOT_ROUTE}job/purchase-receipt")]
public class PurchaseReceiptJobController : AbpController public class PurchaseReceiptJobController : AbpController
{ {
private readonly ISupplierAppService _supplierAppService; private readonly ISupplierAppService _supplierAppService;
private readonly IPurchaseReceiptRequestAppService _purchaseReceiptRequestAppService;
private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService; private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService;
private readonly IFileAppService _fileAppService;
private readonly IUserWorkGroupAppService _userWorkGroupAppService; private readonly IUserWorkGroupAppService _userWorkGroupAppService;
/// <summary> /// <summary>
@ -42,15 +38,11 @@ public class PurchaseReceiptJobController : AbpController
public PurchaseReceiptJobController( public PurchaseReceiptJobController(
IPurchaseReceiptJobAppService purchaseReceiptJobAppService IPurchaseReceiptJobAppService purchaseReceiptJobAppService
, IUserWorkGroupAppService userWorkGroupAppService , IUserWorkGroupAppService userWorkGroupAppService
, IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService , ISupplierAppService supplierAppService)
, ISupplierAppService supplierAppService
, IFileAppService fileAppService)
{ {
_userWorkGroupAppService = userWorkGroupAppService; _userWorkGroupAppService = userWorkGroupAppService;
_purchaseReceiptJobAppService = purchaseReceiptJobAppService; _purchaseReceiptJobAppService = purchaseReceiptJobAppService;
_purchaseReceiptRequestAppService = purchaseReceiptRequestAppService;
_supplierAppService = supplierAppService; _supplierAppService = supplierAppService;
_fileAppService = fileAppService;
} }
/// <summary> /// <summary>
@ -59,7 +51,6 @@ public class PurchaseReceiptJobController : AbpController
/// <param name="id"></param> /// <param name="id"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("{id}")] [HttpGet("{id}")]
public virtual async Task<ActionResult<PurchaseReceiptJobDTO>> GetAsync(Guid id) public virtual async Task<ActionResult<PurchaseReceiptJobDTO>> GetAsync(Guid id)
{ {
var result = await _purchaseReceiptJobAppService.GetAsync(id).ConfigureAwait(false); var result = await _purchaseReceiptJobAppService.GetAsync(id).ConfigureAwait(false);
@ -79,12 +70,13 @@ public class PurchaseReceiptJobController : AbpController
/// <param name="isToday">是否今天</param> /// <param name="isToday">是否今天</param>
/// <returns></returns> /// <returns></returns>
[HttpGet("list")] [HttpGet("list")]
public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListAsync(int pageSize, int pageIndex, bool isTimeWindowSorting, bool isToday) public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListAsync(int pageSize, int pageIndex,
bool isTimeWindowSorting, bool isToday)
{ {
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -96,17 +88,19 @@ public class PurchaseReceiptJobController : AbpController
{ {
Filters = new List<Filter> Filters = new List<Filter>
{ {
new(nameof(PurchaseReceiptJobDTO.WorkGroupCode),jsonCodes,"In"), new(nameof(PurchaseReceiptJobDTO.WorkGroupCode), jsonCodes, "In"),
new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In") new(nameof(PurchaseReceiptJobDTO.JobStatus), jsonStatus, "In")
} }
} }
}; };
if (isToday)//只看当日 if (isToday) //只看当日
{ {
request.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.ToString("yyyy-MM-dd"), ">=", "And")); request.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate),
Clock.Now.ToString("yyyy-MM-dd"), ">=", "And"));
} }
if (isTimeWindowSorting)//窗口时间排序
if (isTimeWindowSorting) //窗口时间排序
{ {
request.Sorting = $"{nameof(PurchaseReceiptJobDTO.TimeWindow)} ASC"; request.Sorting = $"{nameof(PurchaseReceiptJobDTO.TimeWindow)} ASC";
} }
@ -131,7 +125,8 @@ public class PurchaseReceiptJobController : AbpController
[HttpPost("list")] [HttpPost("list")]
public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListAsync(SfsJobRequestInputBase sfsRequestDTO) public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListAsync(SfsJobRequestInputBase sfsRequestDTO)
{ {
var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(sfsRequestDTO, true).ConfigureAwait(false); var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(sfsRequestDTO, true)
.ConfigureAwait(false);
return list; return list;
} }
@ -155,22 +150,27 @@ public class PurchaseReceiptJobController : AbpController
{ {
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}"); return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}");
} }
if (!wlgCodes.Any(r => r == jobDto.WorkGroupCode)) if (!wlgCodes.Any(r => r == jobDto.WorkGroupCode))
{ {
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}"); return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}");
} }
if (jobDto.JobStatus == EnumJobStatus.Doing && jobDto.AcceptUserId != CurrentUser.Id) if (jobDto.JobStatus == EnumJobStatus.Doing && jobDto.AcceptUserId != CurrentUser.Id)
{ {
return new NotFoundObjectResult($"任务正在被 {jobDto.AcceptUserName} 处理"); return new NotFoundObjectResult($"任务正在被 {jobDto.AcceptUserName} 处理");
} }
if (isToday)//只看当日
if (isToday) //只看当日
{ {
if (jobDto.PlanArriveDate.ToString("yyyy-MM-dd") == Clock.Now.ToString("yyyy-MM-dd")) if (jobDto.PlanArriveDate.ToString("yyyy-MM-dd") == Clock.Now.ToString("yyyy-MM-dd"))
{ {
return jobDto; return jobDto;
} }
return new NotFoundObjectResult($"不是当天的收货任务"); return new NotFoundObjectResult($"不是当天的收货任务");
} }
return jobDto; return jobDto;
} }
@ -181,12 +181,13 @@ public class PurchaseReceiptJobController : AbpController
/// <param name="isToday"></param> /// <param name="isToday"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("list/by-asn")] [HttpGet("list/by-asn")]
public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListByAsnNumberAsync(string asnNumber, bool isToday) public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListByAsnNumberAsync(string asnNumber,
bool isToday)
{ {
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var requestInput = new SfsJobRequestInputBase var requestInput = new SfsJobRequestInputBase
@ -198,17 +199,20 @@ public class PurchaseReceiptJobController : AbpController
{ {
Filters = new List<Filter> Filters = new List<Filter>
{ {
new(nameof(PurchaseReceiptJobDTO.AsnNumber),asnNumber), new(nameof(PurchaseReceiptJobDTO.AsnNumber), asnNumber),
new(nameof(IssueJobDTO.WorkGroupCode),jsonWlgCodes,"In"), new(nameof(IssueJobDTO.WorkGroupCode), jsonWlgCodes, "In"),
new(nameof(IssueJobDTO.JobStatus),jsonStatus,"In"), new(nameof(IssueJobDTO.JobStatus), jsonStatus, "In"),
} }
} }
}; };
if (isToday)//只看当日 if (isToday) //只看当日
{ {
requestInput.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.ToString("yyyy-MM-dd"), ">=", "And")); requestInput.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate),
Clock.Now.ToString("yyyy-MM-dd"), ">=", "And"));
} }
var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(requestInput, true).ConfigureAwait(false);
var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(requestInput, true)
.ConfigureAwait(false);
return list; return list;
} }
@ -222,7 +226,7 @@ public class PurchaseReceiptJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -232,8 +236,8 @@ public class PurchaseReceiptJobController : AbpController
{ {
Filters = new List<Filter> Filters = new List<Filter>
{ {
new(nameof(PurchaseReceiptJobDTO.WorkGroupCode),jsonCodes,"In"), new(nameof(PurchaseReceiptJobDTO.WorkGroupCode), jsonCodes, "In"),
new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In") new(nameof(PurchaseReceiptJobDTO.JobStatus), jsonStatus, "In")
} }
} }
}; };
@ -292,9 +296,11 @@ public class PurchaseReceiptJobController : AbpController
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost("save-detail-inspect/{id}")] [HttpPost("save-detail-inspect/{id}")]
public virtual async Task<PurchaseReceiptJobDetailDTO> SaveDetailAsync(Guid id, PurchaseReceiptJobDetailSaveInput purchaseReceiptJobDetailSaveInput) public virtual async Task<PurchaseReceiptJobDetailDTO> SaveDetailAsync(Guid id,
PurchaseReceiptJobDetailSaveInput purchaseReceiptJobDetailSaveInput)
{ {
return await _purchaseReceiptJobAppService.SaveDetailInspectAsync(id, purchaseReceiptJobDetailSaveInput).ConfigureAwait(false); return await _purchaseReceiptJobAppService.SaveDetailInspectAsync(id, purchaseReceiptJobDetailSaveInput)
.ConfigureAwait(false);
} }
/// <summary> /// <summary>

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs

@ -63,7 +63,7 @@ public class PurchaseReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -132,7 +132,7 @@ public class PurchaseReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs

@ -62,7 +62,7 @@ public class PutawayJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase
@ -106,7 +106,7 @@ public class PutawayJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes); var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status); var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase var request = new SfsJobRequestInputBase

14
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs

@ -2,6 +2,7 @@ using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores; namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
@ -29,9 +30,17 @@ public class IssueNoteController : AbpController
/// 创建发料记录 /// 创建发料记录
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost("{input}")] [HttpPost("")]
public virtual async Task CreateAsync(IssueNoteEditInput input) public virtual async Task CreateAsync([FromBody] IssueNoteEditInput input)
{ {
input.RequestType = EnumMaterialRequestType.Issue_Direct.ToString();
input.Details.ForEach(p =>
{
p.ToLot = string.Empty;
p.ToPackingCode = string.Empty;
});
await _issueNoteAppService.CreateAsync(input).ConfigureAwait(false); await _issueNoteAppService.CreateAsync(input).ConfigureAwait(false);
} }
@ -45,5 +54,4 @@ public class IssueNoteController : AbpController
{ {
return await _issueNoteAppService.ConfirmAsync(id).ConfigureAwait(false); return await _issueNoteAppService.ConfirmAsync(id).ConfigureAwait(false);
} }
} }

2
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs

@ -54,7 +54,7 @@ public class L7Controller : AbpController
[HttpPost("create-product-recycle-note-with-l7")] [HttpPost("create-product-recycle-note-with-l7")]
public virtual async Task<ProductRecycleNoteDTO> CreateProductRecycleNoteWithL7Async(ProductRecycleNoteEditInput input) public virtual async Task<ProductRecycleNoteDTO> CreateProductRecycleNoteWithL7Async(ProductRecycleNoteEditInput input)
{ {
return await _productRecycleNoteAppService.CreateWithL7Async(input).ConfigureAwait(false); return await _productRecycleNoteAppService.CreateAsync(input).ConfigureAwait(false);
} }
/// <summary> /// <summary>

13
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs

@ -35,4 +35,17 @@ public class PurchaseReceiptRequestController : AbpController
var result = await _purchaseReceiptRequestAppService.GetByNumberAsync(number).ConfigureAwait(false); var result = await _purchaseReceiptRequestAppService.GetByNumberAsync(number).ConfigureAwait(false);
return Ok(result); return Ok(result);
} }
/// <summary>
/// 根据 物品 箱 获取收货记录
/// </summary>
/// <param name="itemCode"></param>
/// <param name="packingCode"></param>
/// <returns></returns>
[HttpGet("detail-by-item-and-packing")]
public virtual async Task<PurchaseReceiptRequestDetailDTO> GetDetailByItemAndPackingAsync(string itemCode,
string packingCode)
{
return await _purchaseReceiptRequestAppService.GetDetailByItemAndPackingAsync(itemCode, packingCode).ConfigureAwait(false);
}
} }

23
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Domain.Entities.Auditing;
using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Label.Domain; using Win_in.Sfs.Label.Domain;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
@ -109,33 +110,34 @@ public class PurchaseReturnNoteController : AbpController
{ {
var poNumber = poNumberItem.Key; var poNumber = poNumberItem.Key;
var createInput = new PurchaseReturnNoteEditInput() { Details = new List<PurchaseReturnNoteDetailInput>() }; var returnNoteEditInput = new PurchaseReturnNoteEditInput() { Details = new List<PurchaseReturnNoteDetailInput>() };
createInput.PoNumber = poNumber; returnNoteEditInput.PoNumber = poNumber;
foreach (var poNumberDetail in poNumberItem) foreach (var poNumberDetail in poNumberItem)
{ {
var packingCode = poNumberDetail.PackingCode; var packingCode = poNumberDetail.PackingCode;
await SetFromInventoryLabelAsync(packingCode, createInput).ConfigureAwait(false); await SetFromInventoryLabelAsync(packingCode, returnNoteEditInput).ConfigureAwait(false);
await SetFormPurchaseOrderAsync(poNumber, createInput).ConfigureAwait(false); await SetFormPurchaseOrderAsync(poNumber, returnNoteEditInput).ConfigureAwait(false);
createInput.ReturnType = returnType; returnNoteEditInput.ReturnType = returnType;
createInput.ReturnTime = returnTime; returnNoteEditInput.ReturnTime = returnTime;
createInput.ReturnReason = returnReason; returnNoteEditInput.ReturnReason = returnReason;
var createInputDetail = new PurchaseReturnNoteDetailInput(); var createInputDetail = new PurchaseReturnNoteDetailInput();
createInputDetail.PoNumber = poNumber; createInputDetail.PoNumber = poNumber;
createInputDetail.Reason = returnReason; createInputDetail.Reason = returnReason;
//createInputDetail.WarehouseCode= poNumberItem.
await SetDetailByBalanceAsync(packingCode, createInputDetail).ConfigureAwait(false); await SetDetailByBalanceAsync(packingCode, createInputDetail).ConfigureAwait(false);
createInput.Details.Add(createInputDetail); returnNoteEditInput.Details.Add(createInputDetail);
} }
createInputs.Add(createInput); createInputs.Add(returnNoteEditInput);
} }
return createInputs; return createInputs;
@ -149,6 +151,9 @@ public class PurchaseReturnNoteController : AbpController
createInputDetail.LocationCode = balance.LocationCode; createInputDetail.LocationCode = balance.LocationCode;
createInputDetail.LocationErpCode = balance.LocationErpCode; createInputDetail.LocationErpCode = balance.LocationErpCode;
createInputDetail.LocationArea = balance.LocationArea;
createInputDetail.LocationGroup= balance.LocationGroup;
createInputDetail.WarehouseCode= balance.WarehouseCode;
createInputDetail.PackingCode = balance.PackingCode; createInputDetail.PackingCode = balance.PackingCode;
createInputDetail.ContainerCode = balance.ContainerCode; createInputDetail.ContainerCode = balance.ContainerCode;
createInputDetail.Uom = balance.Uom; createInputDetail.Uom = balance.Uom;

2
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs

@ -26,7 +26,7 @@ public class RecycledMaterialReceiptNoteController : AbpController
} }
/// <summary> /// <summary>
/// 获取盘点任务详情 /// 回收料调整
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns></returns> /// <returns></returns>

1
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs

@ -19,6 +19,7 @@ public class UomImportInput : SfsBaseDataImportInputBase
/// 名称 /// 名称
/// </summary> /// </summary>
[Display(Name = "名称")] [Display(Name = "名称")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Name { get; set; } public string Name { get; set; }

4
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAutoMapperProfile.cs

@ -26,6 +26,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
.Ignore(x => x.ExtraProperties) .Ignore(x => x.ExtraProperties)
// .Ignore(x => x.Remark) // .Ignore(x => x.Remark)
; ;
CreateMap<BomEditInput, Bom>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
} }
} }

3
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Calendars/InterfaceCalendarAutoMapperProfile.cs

@ -12,5 +12,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<InterfaceCalendar, InterfaceCalendarDTO>() CreateMap<InterfaceCalendar, InterfaceCalendarDTO>()
.IgnoreAuditedObjectProperties() .IgnoreAuditedObjectProperties()
.ReverseMap(); .ReverseMap();
CreateMap<InterfaceCalendarEditInput, InterfaceCalendar>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
} }
} }

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAutoMapperProfile.cs

@ -23,7 +23,10 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
.Ignore(x => x.ReportStatus) .Ignore(x => x.ReportStatus)
.Ignore(x => x.ReportReason) .Ignore(x => x.ReportReason)
; ;
CreateMap<CustomerItemEditInput, CustomerItem>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id);
} }
} }

4
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Customers/CustomerAutoMapperProfile.cs

@ -23,6 +23,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<Customer, CustomerImportInput>() CreateMap<Customer, CustomerImportInput>()
.Ignore(x => x.ReportStatus) .Ignore(x => x.ReportStatus)
.Ignore(x => x.ReportReason); .Ignore(x => x.ReportReason);
CreateMap<CustomerEditInput, Customer>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
} }
} }

4
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ErpLocations/ErpLocationAutoMapperProfile.cs

@ -18,6 +18,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
.Ignore(x => x.Remark) .Ignore(x => x.Remark)
.Ignore(x => x.ExtraProperties) .Ignore(x => x.ExtraProperties)
.Ignore(x => x.ConcurrencyStamp); .Ignore(x => x.ConcurrencyStamp);
CreateMap<ErpLocationEditInput, ErpLocation>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
} }
} }

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs

@ -22,9 +22,12 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<ItemPackEditInput, ItemPack>() CreateMap<ItemPackEditInput, ItemPack>()
.IgnoreAuditedObjectProperties() .IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId) .Ignore(x => x.TenantId)
.Ignore(x=>x.Id)
.Ignore(x => x.ExtraProperties) .Ignore(x => x.ExtraProperties)
.Ignore(x => x.ConcurrencyStamp) .Ignore(x => x.ConcurrencyStamp)
; ;
CreateMap<ItemPackEditInput, ItemPack>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
} }
} }

45
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs

@ -0,0 +1,45 @@
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote;
public class ItemTransformNoteDetailExchangeDto
{
/// <summary>
/// 物品代码
/// </summary>
[Display(Name = "物品代码")]
public string ItemCode { get; set; }
/// <summary>
/// ERP库位
/// </summary>
[Display(Name = "ERP库位")]
public string LocationErpCode { get; set; }
/// <summary>
/// 原因代码
/// </summary>
[Display(Name = "原因代码")]
public string ReasonCode { get; set; }
/// <summary>
/// 调整数量
/// </summary>
[Display(Name = "来源数量")]
public decimal FromQty { get; set; }
/// <summary>
/// 目标数量
/// </summary>
[Display(Name = "目标数量")]
public decimal ToQty { get; set; }
/// <summary>
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
[Required(ErrorMessage = "{0}是必填项")]
public string ToLocationCode { get; set; }
/// <summary>
/// 目标物品代码
/// </summary>
[Display(Name = "目标物品代码")]
public string ToItemCode { get; set; }
}

30
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteExchangeDto.cs

@ -0,0 +1,30 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote;
public class ItemTransformNoteExchangeDto
{
/// <summary>
/// 单据号
/// </summary>
public string Number { get; set; }
/// <summary>
/// 生效日期
/// </summary>
public DateTime ActiveDate { get; set; } = DateTime.Now.Date;
/// <summary>
/// 操作员
/// </summary>
public string Worker { get; set; }
/// <summary>
/// 类型
/// </summary>
public string Type { get; set; }
/// <summary>
/// 明细
/// </summary>
[Display(Name = "明细")]
public ItemTransformNoteDetailExchangeDto Detail { get; set; } = new();
}

3
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Items/ItemBasicAutoMapperProfile.cs

@ -28,5 +28,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<ItemBasic, ItemBasicForDongyangExportDTO>() CreateMap<ItemBasic, ItemBasicForDongyangExportDTO>()
.Ignore(x => x.ItemCategory) .Ignore(x => x.ItemCategory)
.Ignore(x => x.Color); .Ignore(x => x.Color);
CreateMap<ItemBasicEditInput, ItemBasic>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
} }
} }

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierItems/SupplierItemAutoMapperProfile.cs

@ -24,5 +24,10 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<SupplierItem, SupplierItemImportInput>() CreateMap<SupplierItem, SupplierItemImportInput>()
.Ignore(x => x.ReportStatus) .Ignore(x => x.ReportStatus)
.Ignore(x => x.ReportReason); .Ignore(x => x.ReportReason);
CreateMap<SupplierItemEditInput, SupplierItem>()
.IgnoreAuditedObjectProperties()
//.ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => new UomQty(d.SupplierPackUom, d.SupplierPackQty)))
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id);
} }
} }

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Suppliers/SupplierAutoMapperProfile.cs

@ -21,6 +21,9 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<Supplier, SupplierImportInput>() CreateMap<Supplier, SupplierImportInput>()
.Ignore(x => x.ReportStatus) .Ignore(x => x.ReportStatus)
.Ignore(x => x.ReportReason); .Ignore(x => x.ReportReason);
CreateMap<SupplierEditInput, Supplier>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
} }
} }

1
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs

@ -13,4 +13,5 @@ public interface IExpectOutAppService
Task<List<ExpectOutDTO>> GetListByJobAsync(string jobNumber); Task<List<ExpectOutDTO>> GetListByJobAsync(string jobNumber);
Task<List<ExpectOutDTO>> GetListByItemAsync(string itemCode); Task<List<ExpectOutDTO>> GetListByItemAsync(string itemCode);
Task<List<ExpectOutDTO>> GetListByLocationAsync(string locationCode); Task<List<ExpectOutDTO>> GetListByLocationAsync(string locationCode);
Task<List<ExpectOutDTO>> GetListByPackingCodeAsync(string packingCode);
} }

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

@ -31,5 +31,6 @@ public partial class InventoryApplicationAutoMapperProfile : Profile
CreateMap<BalanceDTO, ExpectInEditInput>() CreateMap<BalanceDTO, ExpectInEditInput>()
.Ignore(x => x.JobNumber) .Ignore(x => x.JobNumber)
.Ignore(x => x.Worker); .Ignore(x => x.Worker);
} }
} }

8
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs

@ -146,4 +146,12 @@ public class ExpectOutAppService
//TODO //TODO
throw new UserFriendlyException(""); throw new UserFriendlyException("");
} }
[HttpGet("list/by-packing/{packingCode}")]
public virtual async Task<List<ExpectOutDTO>> GetListByPackingCodeAsync(string packingCode)
{
var entitys = await _repository.GetListAsync(p => p.PackingCode == packingCode).ConfigureAwait(false);
return ObjectMapper.Map<List<ExpectOut>, List<ExpectOutDTO>>(entitys);
}
} }

5
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs

@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Inventory.Application.Contracts;
@ -23,15 +24,17 @@ public class TransferLogAppService
{ {
private readonly ITransferLogManager _transferLogManager; private readonly ITransferLogManager _transferLogManager;
private readonly IInterfaceCalendarAclService _interfaceCalendarAclService; private readonly IInterfaceCalendarAclService _interfaceCalendarAclService;
private readonly ILocationAppService _locationAppService;
public TransferLogAppService( public TransferLogAppService(
ITransferLogRepository repository ITransferLogRepository repository
, ITransferLogManager transferLogManager , ITransferLogManager transferLogManager
, IInterfaceCalendarAclService interfaceCalendarAclService , IInterfaceCalendarAclService interfaceCalendarAclService
) : base(repository) , ILocationAppService locationAppService) : base(repository)
{ {
_transferLogManager = transferLogManager; _transferLogManager = transferLogManager;
_interfaceCalendarAclService = interfaceCalendarAclService; _interfaceCalendarAclService = interfaceCalendarAclService;
_locationAppService = locationAppService;
} }
[HttpPost("add")] [HttpPost("add")]

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

@ -244,6 +244,16 @@ public class BalanceManager : DomainService, IBalanceManager
balance.Status balance.Status
).ConfigureAwait(false); ).ConfigureAwait(false);
//if (!existBalance.IsActive)
//{
// throw new UserFriendlyException(
// $"箱码为{balance.PackingCode}," +
// $"库位在{balance.LocationCode}," +
// $"批次为{balance.Lot}," +
// $"状态为{balance.Status.GetDisplayName()}" +
// $"的库存是不可用状态");
//}
existBalance.Qty = balance.Qty; existBalance.Qty = balance.Qty;
existBalance.ItemName = balance.ItemName; existBalance.ItemName = balance.ItemName;
existBalance.ItemDesc1 = balance.ItemDesc1; existBalance.ItemDesc1 = balance.ItemDesc1;
@ -423,9 +433,12 @@ public class BalanceManager : DomainService, IBalanceManager
expression = expression.And(p => p.ExpireDate > DateTime.Now); expression = expression.And(p => p.ExpireDate > DateTime.Now);
} }
//筛选有效库区 //筛选有效库区
if (validLocationAreas.Any()) if (validLocationAreas.Any() )
{ {
expression = expression.And(p => validLocationAreas.Contains(p.LocationArea)); if (!string.IsNullOrEmpty(validLocationAreas[0]))
{
expression = expression.And(p => validLocationAreas.Contains(p.LocationArea));
}
} }
var allBalances = await var allBalances = await
(await _balanceRepository.GetDbSetAsync().ConfigureAwait(false)) (await _balanceRepository.GetDbSetAsync().ConfigureAwait(false))

7
be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelDto.cs

@ -214,4 +214,11 @@ public class InventoryLabelDto : SfsBasicDTOBase
/// </summary> /// </summary>
[Display(Name = "供应商零件名")] [Display(Name = "供应商零件名")]
public string SupplierItemName { get; set; } public string SupplierItemName { get; set; }
/// <summary>
/// 计划到货时间
/// </summary>
[Display(Name = "要求到货时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime PlanArriveDate { get; set; }
} }

7
be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelEditInput.cs

@ -221,5 +221,12 @@ public class InventoryLabelEditInput : SfsLabelCreateOrUpdateInputBase
[Required(ErrorMessage = "{0}是必填项")] [Required(ErrorMessage = "{0}是必填项")]
public EnumLabelType LabelType { get; set; } public EnumLabelType LabelType { get; set; }
/// <summary>
/// 要求到货时间
/// </summary>
[Display(Name = "要求到货时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime PlanArriveDate { get; set; }
#endregion #endregion
} }

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

Loading…
Cancel
Save