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. 16
      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. 14
      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. 15
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs
  29. 14
      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. 9
      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. 23
      be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs
  61. 90
      be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs
  62. 86
      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. 48
      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. 3
      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. 13
      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;
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
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.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Services;
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()
{
var plans = await _repository.GetListAsync(p => p.WmsState == 0).ConfigureAwait(false);
return plans;
}
@ -29,6 +32,6 @@ public class PlanManager : DomainService, IPlanManager
p.WmsState = 1;
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>
public decimal Planqty { get; set; }
public string Planqty { get; set; }
/// <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 =>
{
//Configure table & schema Name
b.ToTable(options.TablePrefix + "Sync_arrive", options.Schema);
b.ToTable(options.TablePrefix + "Sync_arrrive", options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Properties
b.Property(q => q.Id).UseIdentityColumn();
b.Property(q => q.Id).ValueGeneratedOnAdd();
b.Property(q => q.PlanBillNo).HasMaxLength(255);
b.Property(q => q.ShipBillNo).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 Volo.Abp.Domain.Entities;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
@ -16,7 +17,7 @@ public static class PlanDbContextModelCreatingExtensions
b.ConfigureByConvention();
//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.ERP).HasMaxLength(255);
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.EntityFrameworkCore;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.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)
: 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();
//Properties
b.Property(q => q.Id).UseIdentityColumn();
b.Property(q => q.Id).ValueGeneratedOnAdd();
b.Property(q => q.PlanBillNo).HasMaxLength(255);
b.Property(q => q.ShipBillNo).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();
//Properties
b.Property(q => q.Id).UseIdentityColumn();
b.Property(q => q.Id);
b.Property(q => q.PlanBillNo).HasMaxLength(255);
b.Property(q => q.ShipBillNo).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.Itemno).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);
});

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>
<TargetFramework>net6.0</TargetFramework>

16
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 Polly;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper;
using Volo.Abp.BackgroundJobs;
@ -39,7 +40,8 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent;
typeof(DataExchangeDomainModule),
typeof(DataExchangeEntityFrameworkCoreModule),
typeof(DataExchangeDomainFawtygEosModule),
typeof(DataExchangeEntityFrameworkCoreFawtygModule)
typeof(DataExchangeEntityFrameworkCoreFawtygModule),
typeof(AbpAccountApplicationContractsModule)
)]
public class EosAgentModule : AbpModule
{
@ -143,6 +145,10 @@ public class EosAgentModule : AbpModule
context.Services.AddHttpClientProxies(
typeof(BasedataApplicationContractsModule).Assembly,
"BaseData"
);
context.Services.AddHttpClientProxies(
typeof(AbpAccountApplicationContractsModule).Assembly,
"Auth"
);
context.Services.AddHttpClientProxies(
typeof(StoreApplicationContractsModule).Assembly,
@ -154,11 +160,13 @@ public class EosAgentModule : AbpModule
);
}
public override async Task OnApplicationInitializationAsync(
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 Volo.Abp.AutoMapper;
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.Domain.Shared;
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.SupplierPackQty, y => y.MapFrom(d => d.PackQty))
.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
await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Ship");
var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>();
var shipConverter = workerContext.ServiceProvider.GetRequiredService<ShipConverter>();
//读取并保持Ship
var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false);
//转换Ship
await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false);
// Logger.LogInformation($"Read Ship");
// var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>();
// var shipConverter = workerContext.ServiceProvider.GetRequiredService<ShipConverter>();
// //读取并保持Ship
// var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false);
// //转换Ship
// await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Product");
var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>();
var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>();
//读取并保持Product
var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false);
//转换Product
await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false);
// Logger.LogInformation($"Read Product");
// var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>();
// var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>();
// //读取并保持Product
// var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false);
//// 转换Product
// await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Completed: Handling {Incoming}");
}

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
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IItemPackAppService _itemPackAppService;
@ -27,10 +28,12 @@ public class PlanConverter : IIncomingConverter
IItemPackAppService itemPackAppService,
IObjectMapper objectMapper,
ILogger<PlanConverter> logger,
IConfiguration configuration
IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager
)
{
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager;
_itemBasicAppService = itemBasicAppService;
_itemPackAppService = itemPackAppService;
@ -48,7 +51,8 @@ public class PlanConverter : IIncomingConverter
//按PlanBillNo合并PurchaseOrder
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
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.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Volo.Abp.Guids;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
@ -18,16 +19,19 @@ public class PlanReader : IReader
private readonly IPlanManager _planManager;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly ILogger<PlanReader> _logger;
private readonly IGuidGenerator _guidGenerator;
public PlanReader(
IPlanManager planManager
, IIncomingFromExternalManager incomingFromExternalManager
, ILogger<PlanReader> logger
, IGuidGenerator guidGenerator
)
{
_planManager = planManager;
_incomingFromExternalManager = incomingFromExternalManager;
_logger = logger;
_guidGenerator = guidGenerator;
}
public virtual async Task<List<IncomingFromExternal>> ReadAsync()
@ -41,7 +45,7 @@ public class PlanReader : IReader
}
//Plan逐一转换为PurchaseOrder
var incomingDataList = BuildIncomingFromExternalFromPlanAsync(toBeProcessedPlans);
await _incomingFromExternalManager.CreateManyAsync(incomingDataList).ConfigureAwait(false);
await _incomingFromExternalManager.CreateBulkAsync(incomingDataList).ConfigureAwait(false);
//更新EOS数据状态
await _planManager.UpdateProcessedListAsync(toBeProcessedPlans).ConfigureAwait(false);
return incomingDataList;
@ -55,7 +59,7 @@ public class PlanReader : IReader
var incomingData = BuildIncomingFromExternal(plan);
incomingData.SetEffectiveDate(plan.EosDate);
incomingData.SetId(_guidGenerator.Create());
try
{
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.ObjectMapping;
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.Shared;
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
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly ISupplierAppService _supplierAppService;
private readonly IObjectMapper _objectMapper;
@ -27,9 +29,11 @@ public class ProductConverter : IIncomingConverter
IObjectMapper objectMapper,
ILogger<ProductConverter> logger,
IGuidGenerator guidGenerator,
IConfiguration configuration
IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager
)
{
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_supplierAppService = supplierAppService;
@ -53,7 +57,8 @@ public class ProductConverter : IIncomingConverter
incomingToWmsDataList.AddRange(supplierItemIncomingToWmsDataList);
//添加IncomingToWms
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
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
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly IItemBasicAppService _itemBasicAppService;
@ -29,9 +30,11 @@ public class ShipConverter : IIncomingConverter
, IItemBasicAppService itemBasicAppService
, IItemPackAppService itemPackAppService
, ILogger<ShipConverter> logger,
IConfiguration configuration
IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager
)
{
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_itemBasicAppService = itemBasicAppService;
@ -54,6 +57,8 @@ public class ShipConverter : IIncomingConverter
var purchaseLabelList = BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList);
await _incomingToWmsManager.CreateManyAsync(purchaseLabelList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
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 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)
{

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

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.Extensions.Hosting" Version="6.0.*" />
<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.BackgroundJobs" 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": {
"Default": "Server=dev.ccwin-in.com,13319;Database=DyWmsAuth;uid=ccwin-in;pwd=Microsoft@2022;",
"DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;",
"EOS": "Server=dev.ccwin-in.com,13319;Database=EOS;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!;TrustServerCertificate=True",
"EOS": "Server=61.139.155.47;Database=EOSCC;Uid=wms;Pwd=1;TrustServerCertificate=True"
},
"AuthServer": {
"Authority": "http://dev.ccwin-in.com:59093/",
"Authority": "http://dev.ccwin-in.com:21293/",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*",
@ -25,13 +25,13 @@
"RemoteServices": {
"BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:59094/"
"BaseUrl": "http://dev.ccwin-in.com:21294/"
},
"Store": {
"BaseUrl": "http://dev.ccwin-in.com:59095/"
"BaseUrl": "http://dev.ccwin-in.com:21295/"
},
"Label": {
"BaseUrl": "http://dev.ccwin-in.com:59092/"
"BaseUrl": "http://dev.ccwin-in.com:21292/"
}
},
"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
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper;
@ -25,10 +26,12 @@ public class IssueConverter : IIncomingConverter
IItemBasicAppService itemBasicAppService,
IObjectMapper objectMapper,
ILogger<IssueConverter> logger,
IConfiguration configuration
IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager
)
{
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager;
_itemBasicAppService = itemBasicAppService;
_objectMapper = objectMapper;
@ -44,7 +47,8 @@ public class IssueConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
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 Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Org.BouncyCastle.Asn1.Pkcs;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
@ -16,6 +17,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
public class MesOutConverter : IIncomingConverter
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly IItemBasicAppService _itemBasicAppService;
@ -29,7 +31,8 @@ public class MesOutConverter : IIncomingConverter
, IItemBasicAppService itemBasicAppService
, ILogger<MesOutConverter> logger,
IConfiguration configuration,
ILocationAppService locationAppService)
ILocationAppService locationAppService,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
@ -37,6 +40,7 @@ public class MesOutConverter : IIncomingConverter
_logger = logger;
_configuration = configuration;
_locationAppService = locationAppService;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -49,6 +53,8 @@ public class MesOutConverter : IIncomingConverter
var productReceiptNoteList = await BuildIncomingToWmsOfProductReceiptNoteAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(productReceiptNoteList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfProductReceiptNoteAsync(List<IncomingFromExternal> incomingDataList)
@ -72,6 +78,7 @@ public class MesOutConverter : IIncomingConverter
wmsProductReceiptNote.WorkShop = "";//车间
wmsProductReceiptNote.Worker = _configuration["Authentication:username"];//操作人
wmsProductReceiptNote.ReceiptType = EnumReceiptType.MesScanReceipt;//完工收货方式
wmsProductReceiptNote.WarehouseCode = "";
wmsProductReceiptNote.Details = new List<ProductReceiptNoteDetailInput>();
foreach (var incomingFromExternal in group.ToList())
@ -81,20 +88,24 @@ public class MesOutConverter : IIncomingConverter
wmsProductReceiptNoteDetail.Lot = ""; //排序批次
wmsProductReceiptNoteDetail.PackingCode = "";//箱标签
wmsProductReceiptNoteDetail.Status = EnumInventoryStatus.OK;
wmsProductReceiptNoteDetail.WarehouseCode = "";
wmsProductReceiptNoteDetail.LocationArea = "";
wmsProductReceiptNoteDetail.LocationGroup = "";
var loc = await _locationAppService.GetListByTypesAndErpCodeAsync(types, wmsProductReceiptNoteDetail.LocationErpCode).ConfigureAwait(false);
if (loc != null)
{
wmsProductReceiptNoteDetail.LocationCode = loc[0].Code;
}
; try
try
{
var item = await _itemBasicAppService.GetByCodeAsync(wmsProductReceiptNoteDetail.ItemCode).ConfigureAwait(false);
if (item != null)
{
wmsProductReceiptNoteDetail.ItemName = item.Name;
wmsProductReceiptNoteDetail.ItemDesc1 = item.Desc1;
wmsProductReceiptNoteDetail.ItemDesc2 = item.Desc2;
wmsProductReceiptNoteDetail.Uom = item.BasicUom;
wmsProductReceiptNoteDetail.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : "";
wmsProductReceiptNoteDetail.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : "";
wmsProductReceiptNoteDetail.Uom = !string.IsNullOrEmpty(item.BasicUom) ? item.BasicUom : "";
}
}
catch (Exception)

14
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.WMS.MaterialRequest;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
public class PullTaskConverter : IIncomingConverter
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly IItemBasicAppService _itemBasicAppService;
@ -27,13 +29,15 @@ public class PullTaskConverter : IIncomingConverter
, IObjectMapper objectMapper
, IItemBasicAppService itemBasicAppService
, ILogger<PullTaskConverter> logger
, IConfiguration configuration)
, IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_itemBasicAppService = itemBasicAppService;
_logger = logger;
_configuration = configuration;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -47,6 +51,8 @@ public class PullTaskConverter : IIncomingConverter
//按Number合并MaterialRequest单据
var materialRequestList = await BuildIncomingToWmsOfMaterialRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfMaterialRequestAsync(List<IncomingFromExternal> incomingDataList)
@ -79,9 +85,9 @@ public class PullTaskConverter : IIncomingConverter
if (item != null)
{
wmsMaterialRequestDetail.ItemName = item.Name;
wmsMaterialRequestDetail.ItemDesc1 = item.Desc1;
wmsMaterialRequestDetail.ItemDesc2 = item.Desc2;
wmsMaterialRequestDetail.Uom = item.BasicUom;
wmsMaterialRequestDetail.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : "";
wmsMaterialRequestDetail.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : "";
wmsMaterialRequestDetail.Uom = !string.IsNullOrEmpty(item.BasicUom) ? item.BasicUom : "";
}
}
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()
{
//从MES读取待处理PullTask
var toBeProcessedPillTasks = await _pullTaskManager.GetToBeProcessedListAsync().ConfigureAwait(false);
@ -101,7 +102,7 @@ public class PullTaskReader : IReader
var materialRequestDetail = new MaterialRequestDetailExchangeDto()
{
ItemCode = pullTask.Itemno,
Qty = pullTask.Planqty,
Qty = decimal.Parse(pullTask.Planqty),
ToLocationCode = pullTask.Plant,
};

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

14
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 Polly;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper;
using Volo.Abp.BackgroundJobs;
@ -39,7 +40,8 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
typeof(DataExchangeDomainModule),
typeof(DataExchangeEntityFrameworkCoreModule),
typeof(DataExchangeDomainFawtygMesModule),
typeof(DataExchangeEntityFrameworkCoreFawtygModule)
typeof(DataExchangeEntityFrameworkCoreFawtygModule),
typeof(AbpAccountApplicationContractsModule)
)]
public class MesAgentModule : AbpModule
{
@ -154,12 +156,12 @@ public class MesAgentModule : AbpModule
"Label"
);
}
public override async Task OnApplicationInitializationAsync(
public override void OnApplicationInitialization(
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.Extensions.Hosting" Version="6.0.*" />
<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.BackgroundJobs" 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
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper;
@ -22,6 +23,8 @@ public class BackFluConverter : IIncomingConverter
IItemBasicAppService itemBasicAppService,
IObjectMapper objectMapper,
ILogger<BackFluConverter> logger
,
IIncomingFromExternalManager incomingFromExternalManager
)
{
@ -29,6 +32,7 @@ public class BackFluConverter : IIncomingConverter
_itemBasicAppService = itemBasicAppService;
_objectMapper = objectMapper;
_logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{
@ -39,6 +43,8 @@ public class BackFluConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).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
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper;
@ -25,7 +26,8 @@ public class BomConverter : IIncomingConverter
IObjectMapper objectMapper,
ILogger<BomConverter> logger,
IGuidGenerator guidGenerator,
IConfiguration configuration)
IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
@ -34,6 +36,7 @@ public class BomConverter : IIncomingConverter
_logger = logger;
_guidGenerator = guidGenerator;
_configuration = configuration;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{
@ -44,7 +47,8 @@ public class BomConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
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(),
SourceDataId = bom.mes_bom_assy.ToString(),
SourceDataDetailCode = bom.mes_bom_part.ToString(),
SourceDataGroupCode = bom.mes_bom_part.ToString(),
SourceDataContent = JsonSerializer.Serialize(bom),
WriteTime = DateTime.Now,
Writer = nameof(TyrpIncomingBackgroundWorker),
@ -114,8 +115,8 @@ public class BomReader : IReader
{
Product = bom.mes_bom_assy,
Component = bom.mes_bom_part,
BeginTime = DateTime.ParseExact(bom.mes_bom_chg_e, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture),
EndTime = DateTime.ParseExact(bom.mes_bom_chg_b, "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_e, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture),
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 ILogger<CustomerConverter> _logger;
private readonly IGuidGenerator _guidGenerator;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public CustomerConverter(
IIncomingToWmsManager incomingToWmsManager,
IObjectMapper objectMapper,
ILogger<CustomerConverter> logger,
IGuidGenerator guidGenerator
,
IIncomingFromExternalManager incomingFromExternalManager
)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
_guidGenerator = guidGenerator;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{
@ -38,6 +44,8 @@ public class CustomerConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
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 IObjectMapper _objectMapper;
private readonly ILogger<DepartmentConverter> _logger;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public DepartmentConverter(
IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper
, ILogger<DepartmentConverter> logger)
, ILogger<DepartmentConverter> logger,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -37,6 +40,8 @@ public class DepartmentConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfDepartmentRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
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 ILogger<DictConverter> _logger;
private readonly IGuidGenerator _guidGenerator;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public DictConverter(
IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper
, ILogger<DictConverter> logger,
IGuidGenerator guidGenerator)
IGuidGenerator guidGenerator,
IIncomingFromExternalManager incomingFromExternalManager)
{
_guidGenerator = guidGenerator;
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_objectMapper = objectMapper;
_logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -41,6 +44,8 @@ public class DictConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfDictRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
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 Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Volo.Abp.Guids;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp;
@ -20,13 +21,16 @@ public class DictpjReader : IReader
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly ILogger<DictpjReader> _logger;
private readonly IConfiguration _configuration;
private readonly IGuidGenerator _guidGenerator;
public DictpjReader(
IDictpjManager dictpjManager
, IIncomingFromExternalManager incomingFromExternalManager
, ILogger<DictpjReader> logger
, IConfiguration configuration
, IGuidGenerator guidGenerator
)
{
_guidGenerator = guidGenerator;
_configuration = configuration;
_dictpjManager = dictpjManager;
_incomingFromExternalManager = incomingFromExternalManager;
@ -55,6 +59,7 @@ public class DictpjReader : IReader
var incomingData = BuildIncomingFromExternal(dict);
incomingData.SetEffectiveDate(DateTime.Now);
incomingData.SetSuccess();
incomingData.SetId(_guidGenerator.Create());
try
{
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 IObjectMapper _objectMapper;
private readonly ILogger<InterfaceCalendarConverter> _logger;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public InterfaceCalendarConverter(
IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper
, ILogger<InterfaceCalendarConverter> logger)
, ILogger<InterfaceCalendarConverter> logger,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -37,6 +40,8 @@ public class InterfaceCalendarConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfInterfaceCalendarRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
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
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly ILogger<ItemBasicConverter> _logger;
@ -25,8 +26,10 @@ public class ItemBasicConverter : IIncomingConverter
, IObjectMapper objectMapper
, ILogger<ItemBasicConverter> logger,
IGuidGenerator guidGenerator,
IConfiguration configuration)
IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
@ -45,6 +48,8 @@ public class ItemBasicConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfItemBasicRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList);
}
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 ILogger<SupplierConverter> _logger;
private readonly IGuidGenerator _guidGenerator;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public SupplierConverter(
IIncomingToWmsManager incomingToWmsManager,
IObjectMapper objectMapper,
ILogger<SupplierConverter> logger,
IGuidGenerator guidGenerator
IGuidGenerator guidGenerator,
IIncomingFromExternalManager incomingFromExternalManage
)
{
@ -39,7 +41,8 @@ public class SupplierConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
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
//await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read User");//用户和部门
//var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>();
//var userConverter = workerContext.ServiceProvider.GetRequiredService<UserConverter>();
//var departmentConverter = workerContext.ServiceProvider.GetRequiredService<DepartmentConverter>();
////读取并保存user
//var outsFromExternalList = await userReader.ReadAsync().ConfigureAwait(false);
//var userOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.User.ToString()).ToList();
//var departmentOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.Department.ToString()).ToList();
////转换user
//await userConverter.ConvertAsync(userOutsFromExternalList).ConfigureAwait(false);
////转换department
//await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read InterfaceCalendar");//账期
//var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarReader>();
//var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarConverter>();
////读取并保存InterfaceCalendar
//var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync();
////转换InterfaceCalendar
//await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList);
Logger.LogInformation($"Read User");//用户和部门
var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>();
var userConverter = workerContext.ServiceProvider.GetRequiredService<UserConverter>();
var departmentConverter = workerContext.ServiceProvider.GetRequiredService<DepartmentConverter>();
//读取并保存user
var outsFromExternalList = await userReader.ReadAsync().ConfigureAwait(false);
var userOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.User.ToString()).ToList();
var departmentOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.Department.ToString()).ToList();
//转换user
await userConverter.ConvertAsync(userOutsFromExternalList).ConfigureAwait(false);
//转换department
await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read InterfaceCalendar");//账期
var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarReader>();
var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarConverter>();
//读取并保存InterfaceCalendar
var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false);
//转换InterfaceCalendar
await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Dict");//系统代码
var dictReader = workerContext.ServiceProvider.GetRequiredService<DictReader>();
@ -104,28 +104,28 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
////转换Bom
//await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Supplier");//供应商
//var SupplierReader = workerContext.ServiceProvider.GetRequiredService<SupplierReader>();
//var SupplierConverter = workerContext.ServiceProvider.GetRequiredService<SupplierConverter>();
////读取并保存Supplier
//var suppliersFromExternalList = await SupplierReader.ReadAsync().ConfigureAwait(false);
////转换Supplier
//await SupplierConverter.ConvertAsync(suppliersFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Dictpj");//专案代码
//var DictpjReader = workerContext.ServiceProvider.GetRequiredService<DictpjReader>();
////读取并保存Dictpj
//var dictpjOutsFromExternalList = await DictpjReader.ReadAsync().ConfigureAwait(false);
////转换Dictpj
//await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Customer");//客户资料
//var CustomerReader = workerContext.ServiceProvider.GetRequiredService<CustomerReader>();
//var CustomerConverter = workerContext.ServiceProvider.GetRequiredService<CustomerConverter>();
////读取并保存Customer
//var customersFromExternalList = await CustomerReader.ReadAsync().ConfigureAwait(false);
////转换Customer
//await CustomerConverter.ConvertAsync(customersFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Supplier");//供应商
var SupplierReader = workerContext.ServiceProvider.GetRequiredService<SupplierReader>();
var SupplierConverter = workerContext.ServiceProvider.GetRequiredService<SupplierConverter>();
//读取并保存Supplier
var suppliersFromExternalList = await SupplierReader.ReadAsync().ConfigureAwait(false);
//转换Supplier
await SupplierConverter.ConvertAsync(suppliersFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Dictpj");//专案代码
var DictpjReader = workerContext.ServiceProvider.GetRequiredService<DictpjReader>();
//读取并保存Dictpj
var dictpjOutsFromExternalList = await DictpjReader.ReadAsync().ConfigureAwait(false);
//转换Dictpj
await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Customer");//客户资料
var CustomerReader = workerContext.ServiceProvider.GetRequiredService<CustomerReader>();
var CustomerConverter = workerContext.ServiceProvider.GetRequiredService<CustomerConverter>();
//读取并保存Customer
var customersFromExternalList = await CustomerReader.ReadAsync().ConfigureAwait(false);
//转换Customer
await CustomerConverter.ConvertAsync(customersFromExternalList).ConfigureAwait(false);
}
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 IObjectMapper _objectMapper;
private readonly ILogger<UserConverter> _logger;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public UserConverter(
IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper
, ILogger<UserConverter> logger)
, ILogger<UserConverter> logger, IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
@ -37,6 +38,8 @@ public class UserConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfIdentityUserRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
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.Text.Json;
using System.Threading.Tasks;
using Volo.Abp.Uow;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
@ -25,11 +26,12 @@ public class ScontrolWriter : IWriter
/// <returns></returns>
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);
foreach (var group in groups)
{
var dataInterfaceList = new List<Scontrol>();
var dataInterfaceDetailList = new List<Scmsend>();
var entitys = group.ToList();
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);
await wmsoutmWriter.WriteAsync(unplannedIssueNoteNoteList).ConfigureAwait(false);
//Logger.LogInformation($"Write UnplannedReceiptNote");//非生产退料
//var unplannedReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<UnplannedReceiptNoteConverter>();
//var unplannedReceiptNoteList = await unplannedReceiptNoteConvert.ConvertAsync();
//await wmsoutmWriter.WriteAsync(unplannedReceiptNoteList);
Logger.LogInformation($"Write UnplannedReceiptNote");//非生产退料
var unplannedReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<UnplannedReceiptNoteConverter>();
var unplannedReceiptNoteList = await unplannedReceiptNoteConvert.ConvertAsync().ConfigureAwait(false);
await wmsoutmWriter.WriteAsync(unplannedReceiptNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write RecycledMaterialReceiptNote");//回收料入库单
var recycledMaterialReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<RecycledMaterialReceiptNoteConverter>();
@ -120,6 +120,10 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
var scrapNoteList = await scrapNoteConvert.ConvertAsync().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}");
}

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

@ -27,11 +27,11 @@ public class WmsoutmWriter : IWriter
/// <returns></returns>
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);
foreach (var group in groups)
{
var dataInterfaceList = new List<Wmsoutm>();
var dataInterfaceDetailList = new List<Wmsoutd>();
var entitys = group.ToList();
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.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>
<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\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" />

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

@ -26,13 +26,13 @@
"RemoteServices": {
"BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:59094/"
"BaseUrl": "http://dev.ccwin-in.com:21294/"
},
"Store": {
"BaseUrl": "http://dev.ccwin-in.com:59095/"
"BaseUrl": "http://dev.ccwin-in.com:21295/"
},
"Label": {
"BaseUrl": "http://dev.ccwin-in.com:59092/"
"BaseUrl": "http://dev.ccwin-in.com:21292/"
},
"Auth": {
"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)]
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;
@ -34,7 +34,7 @@ public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppServ
IConfiguration configuration
)
{
_purchaseOrderAppService = purchaseOrderAppService;
//_purchaseOrderAppService = purchaseOrderAppService;
_po_mstrRepository = po_mstrRepository;
_configuration = configuration;
}
@ -77,7 +77,7 @@ public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppServ
targetObj.ContactEmail = "";
#endregion
await _purchaseOrderAppService.UpsertAsync(targetObj).ConfigureAwait(false);
//await _purchaseOrderAppService.UpsertAsync(targetObj).ConfigureAwait(false);
}
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(
ApplicationInitializationContext context)
{
context.AddBackgroundWorkerAsync<IncomingToWmsWorker>();
// context.AddBackgroundWorker<OutgoingFromWmsWorker>();
// context.AddBackgroundWorkerAsync<IncomingToWmsWorker>();
context.AddBackgroundWorkerAsync<OutgoingFromWmsWorker>();
}
}

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

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

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

@ -30,6 +30,7 @@ public enum EnumOutgoingDataType
RecycledMaterialReceipt = 22,
ScrapNote = 23,
ProductRecycle = 24,
Item_Transform = 25
}
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,
JIS = 4,
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;
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<List<IncomingFromExternal>> CreateBulkAsync(List<IncomingFromExternal> entities);
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);
}
[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]
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,
[SupplierItemCode] nvarchar(max) NULL,
[SupplierItemName] nvarchar(max) NULL,
[PlanArriveDate] datetime2 NOT NULL,
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) 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;
using System.Diagnostics.Metrics;
using System.Linq;
using Win_in.Sfs.Basedata.Application.Contracts;
@ -29,28 +30,28 @@ public class AsnTimeWindowController : AbpController
[HttpGet("asn-time-window")]
public virtual async Task<List<AsnTimeWindowDashboardDto>> GetAsnTimeWindowsAsync()
{
return await GetAsnTimeWindowDashboardsAsync().ConfigureAwait(false);
return await 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 suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false);
var suppliers = await GetSuppliersAsync(supplierCodes);
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,
suppliers,
purchaseReceiptNotes);
}
private static List<AsnTimeWindowDashboardDto> ConvertToAsnTimeWindowDashboards(
private List<AsnTimeWindowDashboardDto> ConvertToAsnTimeWindowDashboards(
List<SupplierAsnDTO> supplierAsns,
List<SupplierDTO> suppliers,
List<PurchaseReceiptNoteDTO> purchaseReceiptNotes)
@ -70,16 +71,12 @@ public class AsnTimeWindowController : AbpController
var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
if (supplier == null)
{
continue;
}
supplierShortName = supplier.ShortName;
if (dtos.Exists(t => t.TimeSpan == timeSpan && t.SupplierShortName == supplierShortName))
{
continue;
}
var purchaseReceiptNote =
purchaseReceiptNotes.FirstOrDefault(t => t.AsnNumber == supplierAsn.Number);
@ -111,17 +108,26 @@ public class AsnTimeWindowController : AbpController
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)
{
return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false);
return await this._supplierApp.GetByCodesAsync(codes);
}
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");
}
}

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

@ -2,16 +2,19 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Label.Application.Contracts;
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 NUglify.Helpers;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using static IdentityServer4.Models.IdentityResources;
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}material-request")]
@ -32,7 +35,7 @@ public class MaterialRequestController : AbpController
{
var dto = new MaterialRequestUnHandledOrderSumDto();
var list = await GetMaterialRequestAsync().ConfigureAwait(false);
var list = await GetMaterialRequestAsync();
dto.Sum = list.Where(t => t.RequestStatus == EnumRequestStatus.New).Count();
@ -44,7 +47,7 @@ public class MaterialRequestController : AbpController
{
var dto = new MaterialRequestUnIssuedItemQtySumDto();
var list = await GetMaterialRequestAsync().ConfigureAwait(false);
var list = await GetMaterialRequestAsync();
dto.Sum = list.Where(t => t.RequestStatus != EnumRequestStatus.New)
.Sum(t => t.Details.Sum(t1 => t1.Qty - t1.IssuedQty));
@ -58,7 +61,7 @@ public class MaterialRequestController : AbpController
{
var dtos = new List<MaterialRequestUnReceivedItemQtyByItemDto>();
var list = await GetMaterialRequestAsync().ConfigureAwait(false);
var list = await GetMaterialRequestAsync();
var details = new List<MaterialRequestDetailDTO>();
@ -96,7 +99,7 @@ public class MaterialRequestController : AbpController
var Received = 0.0M;
var list = await GetMaterialRequestAsync().ConfigureAwait(false);
var list = await GetMaterialRequestAsync();
list.ForEach(
item =>
@ -106,6 +109,7 @@ public class MaterialRequestController : AbpController
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 });
@ -118,7 +122,7 @@ public class MaterialRequestController : AbpController
{
var dtos = new List<MaterialRequestUnReceivedItemDto>();
var notes = await GetIssueNotesAsync().ConfigureAwait(false);
var notes = await this.GetIssueNotesAsync();
foreach (var note in notes)
{
@ -142,11 +146,12 @@ public class MaterialRequestController : AbpController
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()
{
return await _materialRequestApp.GetListByTypeAsync(EnumTransSubType.Issue_WIP.ToString()).ConfigureAwait(false);
return await this._materialRequestApp.GetListByTypeAsync(EnumTransSubType.Issue_WIP.ToString());
}
}
}

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

@ -1,15 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Serilog;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts;
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;
namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers;
namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
{
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}plan-and-actual")]
@ -21,39 +22,44 @@ public class PlanAndActualController : AbpController
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)
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;
}
[HttpGet("plan-actual-list")]
public virtual async Task<List<PlanAndActualDashboardDto>> GetPlanAndActualListAsync()
{
return await GetPlanAndActualDashboardsAsync().ConfigureAwait(false);
return await GetPlanAndActualDashboardsAsync();
}
private async Task<List<PlanAndActualDashboardDto>> GetPlanAndActualDashboardsAsync()
{
var supplierAsns = await GetSupplierAsnsAsync().ConfigureAwait(false);
var supplierAsns = await this.GetSupplierAsnsAsync();
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 purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers).ConfigureAwait(false);
var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers);
var putawayNotes = await GetPutawayNotesAsync(asnNumbers).ConfigureAwait(false);
var putawayNotes = await this.GetPutawayNotesAsync(asnNumbers);
var itemSafetyStorks = await GetItemSafetyStocksAsync(supplierAsns).ConfigureAwait(false);
var itemSafetyStorks = await this.GetItemSafetyStocksAsync(supplierAsns);
return ConvertToPlanAndActualDashboards(
return await this.ConvertToPlanAndActualDashboards(
supplierAsns,
suppliers,
purchaseReceiptNotes,
@ -61,7 +67,7 @@ public class PlanAndActualController : AbpController
itemSafetyStorks);
}
private static List<PlanAndActualDashboardDto> ConvertToPlanAndActualDashboards(List<SupplierAsnDTO> supplierAsns, List<SupplierDTO> suppliers, List<PurchaseReceiptNoteDTO> purchaseReceiptNotes, List<PutawayNoteDTO> putawayNotes, List<ItemSafetyStockDTO> itemSafetyStorks)
private async Task<List<PlanAndActualDashboardDto>> ConvertToPlanAndActualDashboards(List<SupplierAsnDTO> supplierAsns, List<SupplierDTO> suppliers, List<PurchaseReceiptNoteDTO> purchaseReceiptNotes, List<PutawayNoteDTO> putawayNotes, List<ItemSafetyStockDTO> itemSafetyStorks)
{
var dtos = new List<PlanAndActualDashboardDto>();
@ -75,9 +81,7 @@ public class PlanAndActualController : AbpController
var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
if (supplier == null)
{
continue;
}
supplierShortName = supplier.ShortName;
@ -102,35 +106,50 @@ public class PlanAndActualController : AbpController
dto.MinQty = itemSafetyStork.MinStock;
}
dto.ReceiptNoteCount = CountReceiptNoteCount(purchaseReceipts, detail.ItemCode, detail.Lot);
dto.ReceiptQty = CountReceiptQty(purchaseReceipts, detail.ItemCode, detail.Lot);
dto.PutawayQty = CountPutawayQty(putawayNotes, detail.ItemCode, detail.Lot);
var purchaseOrderDtos = await _purchaseOrderApp.GetListBySupplierCodeAsync(supplierAsn.SupplierCode, detail.ItemCode);
var supllierAsn = await _supplierAsnApp.GetForTodayListAsync();
var poNumberList = supllierAsn.Select(p => p.PoNumber).ToList();
purchaseOrderDtos = purchaseOrderDtos.Where(p => poNumberList.Contains(p.Number)).ToList();
decimal allPutawayQty = 0;
decimal allReceiptQty = 0;
decimal allPlanArriveQty = 0;
foreach (var purchaseOrderDTO in purchaseOrderDtos)
{
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);
}
dto.PutawayQty = allPutawayQty;
dto.PlanArriveQty = allPlanArriveQty;
dto.ReceiptQty = allReceiptQty;
dtos.Add(dto);
}
dto.SupplierAsnCount += 1;
var purchaseReceiptJobDtos = await _purchaseReceiptJobApp.GetListBySupplierCodeOnTodayAsync(supplierAsn.SupplierCode);
dto.PlanArriveQty += detail.Qty;
dto.ReceiptNoteCount = purchaseReceiptJobDtos.Count(p => p.JobStatus == EnumJobStatus.Done);
dto.SupplierAsnCount = purchaseReceiptJobDtos.Count();
}
}
return dtos.OrderBy(t => t.SupplierShortName).ToList();
}
private static decimal CountPutawayQty(List<PutawayNoteDTO> putawayNotes, string itemCode, string lot)
private decimal CountReceiptQty(List<PurchaseReceiptNoteDTO> purchaseReceipts, string itemCode)
{
return putawayNotes.Sum(t => t.Details.Where(t => t.ItemCode == itemCode && t.ToLot == lot).Sum(t => t.Qty));
return purchaseReceipts.Sum(t => t.Details.Where(t => t.ItemCode == itemCode).Sum(t => t.Qty));
}
private static decimal CountReceiptQty(List<PurchaseReceiptNoteDTO> purchaseReceipts, string itemCode, string lot)
private int CountReceiptNoteCount(List<PurchaseReceiptNoteDTO> purchaseReceipts, string itemCode)
{
return purchaseReceipts.Sum(t => t.Details.Where(t => t.ItemCode == itemCode && t.HandledLot == lot).Sum(t => t.Qty));
}
private static int CountReceiptNoteCount(List<PurchaseReceiptNoteDTO> purchaseReceipts, string itemCode, string lot)
{
return purchaseReceipts.Sum(t => t.Details.Count(t => t.ItemCode == itemCode && t.Lot == lot));
return purchaseReceipts.Sum(t => t.Details.Count(t => t.ItemCode == itemCode));
}
private async Task<List<SupplierAsnDTO>> GetSupplierAsnsAsync()
@ -145,22 +164,22 @@ public class PlanAndActualController : AbpController
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)
{
return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false);
return await this._supplierApp.GetByCodesAsync(codes);
}
private async Task<List<PurchaseReceiptNoteDTO>> GetPurchaseReceiptNotesAsync(IEnumerable<string> asnNumbers)
{
return await _purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false);
return await this._purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers);
}
private async Task<List<PutawayNoteDTO>> GetPutawayNotesAsync(IEnumerable<string> asnNumbers)
{
return await _putawayNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false);
return await this._putawayNoteApp.GetListByAsnNumbers(asnNumbers);
}
private async Task<List<ItemSafetyStockDTO>> GetItemSafetyStocksAsync(List<SupplierAsnDTO> supplierAsns)
{
@ -168,7 +187,8 @@ public class PlanAndActualController : AbpController
supplierAsns.ForEach(t => { itemCodes.AddRange(t.Details.Select(t => t.ItemCode).ToList()); });
var itemSafetyStorks = await _itemSafetyStockApp.GetByItemCodesAsync(itemCodes).ConfigureAwait(false);
var itemSafetyStorks = await this._itemSafetyStockApp.GetByItemCodesAsync(itemCodes);
return itemSafetyStorks;
}
}
}

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

@ -5,11 +5,15 @@ using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts;
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;
using System.Linq;
using Volo.Abp;
using Win_in.Sfs.Label.Application.Contracts;
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;
@ -23,31 +27,43 @@ public class PurchaseReceiptController : AbpController
private readonly IInventoryLabelAppService _labelService;
private readonly ISupplierAppService _supplierApp;
private readonly ISupplierAsnAppService _supplierAsnApp;
private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteAppService;
private readonly IInspectNoteAppService _inspectNoteAppService;
public PurchaseReceiptController(IBalanceAppService balanceApp, IInventoryLabelAppService labelService, ISupplierAppService supplierApp, ISupplierAsnAppService supplierAsnApp)
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")]
public virtual async Task<PurchaseReceiptSumQtyDashboardDto> GetReceiptSumQtyAsync()
/// <summary>
/// 未上架数量
/// </summary>
/// <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) };
return dto;
}
[HttpGet("receipt-count-by-supplier")]
public virtual async Task<List<PurchaseReceiptCountBySupplierDashboardDto>> GetReceiptCountBySupplierQtyAsync()
/// <summary>
/// 未上架汇总
/// </summary>
/// <returns></returns>
[HttpGet("no-put-away-by-supplier")]
public virtual async Task<List<PurchaseReceiptCountBySupplierDashboardDto>> GetNoPutAwayBySupplierAsync()
{
var items = await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
var items = await GetPurchaseReceiptItemDashboardAsync();
var dtos = items.GroupBy(t => t.SupplierShortName)
.Select(
@ -60,10 +76,14 @@ public class PurchaseReceiptController : AbpController
return dtos;
}
[HttpGet("receipt-item-list")]
/// <summary>
/// 未上架明细
/// </summary>
/// <returns></returns>
[HttpGet("no-put-away-item-list")]
public virtual async Task<List<PurchaseReceiptItemDashboardDto>> GetReceiptItemListAsync()
{
return await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
return await GetPurchaseReceiptItemDashboardAsync();
}
[HttpGet("un-receipt-sum-qty")]
@ -71,7 +91,7 @@ public class PurchaseReceiptController : AbpController
{
var dto = new PurchaseReceiptSumQtyDashboardDto();
var items = await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
var items = await this.GetUnPurchaseReceiptItemDashboardAsync();
dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) };
@ -81,7 +101,7 @@ public class PurchaseReceiptController : AbpController
[HttpGet("un-receipt-count-by-supplier")]
public virtual async Task<List<PurchaseReceiptCountBySupplierDashboardDto>> GetUnReceiptCountBySupplierQtyAsync()
{
var items = await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
var items = await GetUnPurchaseReceiptItemDashboardAsync();
var dtos = items.GroupBy(t => t.SupplierShortName)
.Select(
@ -97,25 +117,30 @@ public class PurchaseReceiptController : AbpController
[HttpGet("un-receipt-item-list")]
public virtual async Task<List<PurchaseReceiptItemDashboardDto>> GetUnReceiptItemListAsync()
{
return await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
return await this.GetUnPurchaseReceiptItemDashboardAsync();
}
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 balances = await GetBalancesAsync("INSPECT", EnumInventoryStatus.OK);
var packingcodes = balances.Select(t => t.PackingCode).Distinct();
var labels = await GetLabelsAsync(packingcodes).ConfigureAwait(false);
var labels = await GetLabelsAsync(packingcodes);
var supplierCodes = labels.Select(t => t.SupplierCode).Distinct();
var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false);
var suppliers = await GetSuppliersAsync(supplierCodes);
return ConvertToPurchaseReceiptItemDashboard(balances, labels, suppliers);
}
private static List<PurchaseReceiptItemDashboardDto> ConvertToPurchaseReceiptItemDashboard(
private List<PurchaseReceiptItemDashboardDto> ConvertToPurchaseReceiptItemDashboard(
List<BalanceDTO> balances,
List<InventoryLabelDto> labels,
List<SupplierDTO> suppliers)
@ -129,16 +154,12 @@ public class PurchaseReceiptController : AbpController
var label = labels.FirstOrDefault(t => t.Code == balance.PackingCode);
if (label == null)
{
continue;
}
var supplier = suppliers.FirstOrDefault(t => t != null && t.Code == label.SupplierCode);
if (supplier == null)
{
continue;
}
supplierShortName = supplier.ShortName;
@ -164,23 +185,23 @@ public class PurchaseReceiptController : AbpController
private async Task<List<BalanceDTO>> GetBalancesAsync(string locationCode, EnumInventoryStatus status)
{
return await _balanceApp.GetListByLocationCodeAndStatusAsync(locationCode, status).ConfigureAwait(false);
return await this._balanceApp.GetListByLocationCodeAndStatusAsync(locationCode, status);
}
private async Task<List<InventoryLabelDto>> GetLabelsAsync(IEnumerable<string> codes)
{
return await _labelService.GetByCodesAsync(codes).ConfigureAwait(false);
return await this._labelService.GetByCodesAsync(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<SupplierAsnDTO>> GetSupplierAsnsAsync()
{
return await _supplierAsnApp.GetForTodayUnReceivedListAsync().ConfigureAwait(false);
return await this._supplierAsnApp.GetForTodayUnReceivedListAsync();
}
private static List<PurchaseReceiptItemDashboardDto> ConvertToUnPurchaseReceiptItemDashboard(
private List<PurchaseReceiptItemDashboardDto> ConvertToUnPurchaseReceiptItemDashboard(
List<SupplierAsnDTO> supplierAsns,
List<SupplierDTO> suppliers)
{
@ -193,9 +214,7 @@ public class PurchaseReceiptController : AbpController
var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
if (supplier == null)
{
continue;
}
supplierShortName = supplier.ShortName;
@ -226,12 +245,15 @@ public class PurchaseReceiptController : AbpController
{
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 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.Text.Json.Serialization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@ -83,6 +84,12 @@ public class StoreHttpApiHostModule : ModuleBase<StoreHttpApiHostModule>
{
base.ConfigureServices(context);
ConfigureVirtualFileSystem();
//将枚举返回时都变为字符串
//context.Services.AddControllers().AddJsonOptions(options =>
//{
// options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
//});
//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,
[DeliverRequestNumber] nvarchar(max) NULL,
[DeliverRequestType] nvarchar(64) NOT NULL,
[CountPrint] int NOT NULL,
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL,
[CreationTime] datetime2 NOT NULL,
@ -1280,7 +1281,7 @@ CREATE TABLE [Store_ProductReceiptRequest] (
[Shift] nvarchar(64) NULL,
[Team] nvarchar(64) NULL,
[PlanDate] datetime2 NOT NULL,
[Type] nvarchar(64) NULL,
[Type] nvarchar(64) NOT NULL,
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) 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] (
[Id] uniqueidentifier NOT NULL,
[WorkOrderId] nvarchar(64) NULL,
@ -3068,6 +3115,7 @@ CREATE TABLE [Store_InspectNoteDetail] (
[Weight] nvarchar(max) NULL,
[OtherPropertyJson] nvarchar(max) NULL,
[StdPackQty] decimal(18,6) NOT NULL,
[InspectDate] datetime2 NOT NULL,
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier 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] (
[Id] uniqueidentifier 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_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])

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.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts;
@ -29,6 +31,8 @@ public class BalanceController : AbpController
private readonly ILocationAppService _locationAppService;
private readonly IExpectOutAppService _expectOutAppService;
/// <summary>
///
/// </summary>
@ -38,10 +42,11 @@ public class BalanceController : AbpController
public BalanceController(
IBalanceAppService balanceAppService,
IItemBasicAppService itemBasicAppService,
ILocationAppService locationAppService)
ILocationAppService locationAppService, IExpectOutAppService expectOutAppService)
{
this._balanceAppService = balanceAppService;
this._locationAppService = locationAppService;
_expectOutAppService = expectOutAppService;
this._itemBasicAppService = itemBasicAppService;
}
@ -280,11 +285,11 @@ public class BalanceController : AbpController
}
}
if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any())
{
input.Condition.Filters.Add(
new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In"));
}
//if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any())
//{
// input.Condition.Filters.Add(
// new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In"));
//}
var balanceDTOs = await _balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false);
@ -426,6 +431,56 @@ public class BalanceController : AbpController
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>
/// 查询库余额

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 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 request = new SfsJobRequestInputBase
@ -133,7 +133,7 @@ public class CountJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 requestInput = new SfsJobRequestInputBase
@ -165,7 +165,7 @@ public class CountJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 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);
_ = 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 request = new SfsJobRequestInputBase
@ -132,7 +132,7 @@ public class DeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 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 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 request = new SfsJobRequestInputBase
@ -108,7 +108,7 @@ public class InspectJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 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 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 request = new SfsJobRequestInputBase
@ -143,7 +143,7 @@ public class IssueJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 requestInput = new SfsJobRequestInputBase
@ -175,7 +175,7 @@ public class IssueJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 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 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 request = new SfsJobRequestInputBase
@ -106,7 +106,7 @@ public class JisDeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 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 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 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 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 request = new SfsJobRequestInputBase
@ -106,7 +106,7 @@ public class ProductReceiveJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 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 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 request = new SfsJobRequestInputBase
@ -113,7 +113,7 @@ public class ProductionReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 request = new SfsJobRequestInputBase

48
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>
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}job/purchase-receipt")]
public class PurchaseReceiptJobController : AbpController
{
private readonly ISupplierAppService _supplierAppService;
private readonly IPurchaseReceiptRequestAppService _purchaseReceiptRequestAppService;
private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService;
private readonly IFileAppService _fileAppService;
private readonly IUserWorkGroupAppService _userWorkGroupAppService;
/// <summary>
@ -42,15 +38,11 @@ public class PurchaseReceiptJobController : AbpController
public PurchaseReceiptJobController(
IPurchaseReceiptJobAppService purchaseReceiptJobAppService
, IUserWorkGroupAppService userWorkGroupAppService
, IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService
, ISupplierAppService supplierAppService
, IFileAppService fileAppService)
, ISupplierAppService supplierAppService)
{
_userWorkGroupAppService = userWorkGroupAppService;
_purchaseReceiptJobAppService = purchaseReceiptJobAppService;
_purchaseReceiptRequestAppService = purchaseReceiptRequestAppService;
_supplierAppService = supplierAppService;
_fileAppService = fileAppService;
}
/// <summary>
@ -59,7 +51,6 @@ public class PurchaseReceiptJobController : AbpController
/// <param name="id"></param>
/// <returns></returns>
[HttpGet("{id}")]
public virtual async Task<ActionResult<PurchaseReceiptJobDTO>> GetAsync(Guid id)
{
var result = await _purchaseReceiptJobAppService.GetAsync(id).ConfigureAwait(false);
@ -79,12 +70,13 @@ public class PurchaseReceiptJobController : AbpController
/// <param name="isToday">是否今天</param>
/// <returns></returns>
[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 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 request = new SfsJobRequestInputBase
@ -104,8 +96,10 @@ public class PurchaseReceiptJobController : AbpController
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) //窗口时间排序
{
request.Sorting = $"{nameof(PurchaseReceiptJobDTO.TimeWindow)} ASC";
@ -131,7 +125,8 @@ public class PurchaseReceiptJobController : AbpController
[HttpPost("list")]
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;
}
@ -155,22 +150,27 @@ public class PurchaseReceiptJobController : AbpController
{
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}");
}
if (!wlgCodes.Any(r => r == jobDto.WorkGroupCode))
{
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}");
}
if (jobDto.JobStatus == EnumJobStatus.Doing && jobDto.AcceptUserId != CurrentUser.Id)
{
return new NotFoundObjectResult($"任务正在被 {jobDto.AcceptUserName} 处理");
}
if (isToday) //只看当日
{
if (jobDto.PlanArriveDate.ToString("yyyy-MM-dd") == Clock.Now.ToString("yyyy-MM-dd"))
{
return jobDto;
}
return new NotFoundObjectResult($"不是当天的收货任务");
}
return jobDto;
}
@ -181,12 +181,13 @@ public class PurchaseReceiptJobController : AbpController
/// <param name="isToday"></param>
/// <returns></returns>
[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 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 requestInput = new SfsJobRequestInputBase
@ -206,9 +207,12 @@ public class PurchaseReceiptJobController : AbpController
};
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;
}
@ -222,7 +226,7 @@ public class PurchaseReceiptJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 request = new SfsJobRequestInputBase
@ -292,9 +296,11 @@ public class PurchaseReceiptJobController : AbpController
/// </summary>
/// <returns></returns>
[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>

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 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 request = new SfsJobRequestInputBase
@ -132,7 +132,7 @@ public class PurchaseReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 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 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 request = new SfsJobRequestInputBase
@ -106,7 +106,7 @@ public class PutawayJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
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 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 Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
@ -29,9 +30,17 @@ public class IssueNoteController : AbpController
/// 创建发料记录
/// </summary>
/// <returns></returns>
[HttpPost("{input}")]
public virtual async Task CreateAsync(IssueNoteEditInput input)
[HttpPost("")]
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);
}
@ -45,5 +54,4 @@ public class IssueNoteController : AbpController
{
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")]
public virtual async Task<ProductRecycleNoteDTO> CreateProductRecycleNoteWithL7Async(ProductRecycleNoteEditInput input)
{
return await _productRecycleNoteAppService.CreateWithL7Async(input).ConfigureAwait(false);
return await _productRecycleNoteAppService.CreateAsync(input).ConfigureAwait(false);
}
/// <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);
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 Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Domain.Entities.Auditing;
using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Label.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@ -109,33 +110,34 @@ public class PurchaseReturnNoteController : AbpController
{
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)
{
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;
createInput.ReturnTime = returnTime;
createInput.ReturnReason = returnReason;
returnNoteEditInput.ReturnType = returnType;
returnNoteEditInput.ReturnTime = returnTime;
returnNoteEditInput.ReturnReason = returnReason;
var createInputDetail = new PurchaseReturnNoteDetailInput();
createInputDetail.PoNumber = poNumber;
createInputDetail.Reason = returnReason;
//createInputDetail.WarehouseCode= poNumberItem.
await SetDetailByBalanceAsync(packingCode, createInputDetail).ConfigureAwait(false);
createInput.Details.Add(createInputDetail);
returnNoteEditInput.Details.Add(createInputDetail);
}
createInputs.Add(createInput);
createInputs.Add(returnNoteEditInput);
}
return createInputs;
@ -149,6 +151,9 @@ public class PurchaseReturnNoteController : AbpController
createInputDetail.LocationCode = balance.LocationCode;
createInputDetail.LocationErpCode = balance.LocationErpCode;
createInputDetail.LocationArea = balance.LocationArea;
createInputDetail.LocationGroup= balance.LocationGroup;
createInputDetail.WarehouseCode= balance.WarehouseCode;
createInputDetail.PackingCode = balance.PackingCode;
createInputDetail.ContainerCode = balance.ContainerCode;
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>
/// <param name="id"></param>
/// <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>
[Display(Name = "名称")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
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.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>()
.IgnoreAuditedObjectProperties()
.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.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>()
.Ignore(x => x.ReportStatus)
.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.ExtraProperties)
.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>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x=>x.Id)
.Ignore(x => x.ExtraProperties)
.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>()
.Ignore(x => x.ItemCategory)
.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>()
.Ignore(x => x.ReportStatus)
.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);
}
}

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

@ -22,5 +22,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<Supplier, SupplierImportInput>()
.Ignore(x => x.ReportStatus)
.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>> GetListByItemAsync(string itemCode);
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>()
.Ignore(x => x.JobNumber)
.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
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 Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
@ -23,15 +24,17 @@ public class TransferLogAppService
{
private readonly ITransferLogManager _transferLogManager;
private readonly IInterfaceCalendarAclService _interfaceCalendarAclService;
private readonly ILocationAppService _locationAppService;
public TransferLogAppService(
ITransferLogRepository repository
, ITransferLogManager transferLogManager
, IInterfaceCalendarAclService interfaceCalendarAclService
) : base(repository)
, ILocationAppService locationAppService) : base(repository)
{
_transferLogManager = transferLogManager;
_interfaceCalendarAclService = interfaceCalendarAclService;
_locationAppService = locationAppService;
}
[HttpPost("add")]

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

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

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

@ -214,4 +214,11 @@ public class InventoryLabelDto : SfsBasicDTOBase
/// </summary>
[Display(Name = "供应商零件名")]
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}是必填项")]
public EnumLabelType LabelType { get; set; }
/// <summary>
/// 要求到货时间
/// </summary>
[Display(Name = "要求到货时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime PlanArriveDate { get; set; }
#endregion
}

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

Loading…
Cancel
Save