Browse Source

MES接口修改

集成Redis
唐明亮 2 years ago
parent
commit
8b237f6873
  1. 7
      .vs/VSWorkspaceState.json
  2. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs
  3. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs
  4. 14
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
  5. 9
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs
  6. 3
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs
  7. 14
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs
  8. 18
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs
  9. 1
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj
  10. 94
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql
  11. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs
  12. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs
  13. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs
  14. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs

7
.vs/VSWorkspaceState.json

@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\WZC2.sln",
"PreviewInSolutionExplorer": 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>

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

14
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;
@ -72,6 +73,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 +83,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)

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

@ -11,6 +11,7 @@ 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;
@ -72,16 +73,16 @@ public class PullTaskConverter : IIncomingConverter
foreach (var incomingFromExternal in group.ToList())
{
var materialRequest = JsonSerializer.Deserialize<MaterialRequestExchangeDto>(incomingFromExternal.DestinationDataContent);
var wmsMaterialRequestDetail = _objectMapper.Map<MaterialRequestDetailExchangeDto, MaterialRequestDetailInput>(materialRequest.Detail);
var wmsMaterialRequestDetail = _objectMapper.Map<MaterialRequestDetailExchangeDto, MaterialRequestDetailInput>(materialRequest.Detail);
var item = await _itemBasicAppService.GetByCodeAsync(wmsMaterialRequestDetail.ItemCode).ConfigureAwait(false);
try
{
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,
};

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

@ -78,15 +78,15 @@ public class ScrapConverter : IIncomingConverter
wmsScrapDetail.FromPackingCode = "";
wmsScrapDetail.FromLot = "";
wmsScrapDetail.FromWarehouseCode = "";
wmsScrapDetail.ToWarehouseCode = "";
wmsScrapDetail.Uom = "";
wmsScrapDetail.FromStatus = EnumInventoryStatus.OK;
var item = await _itemBasicAppService.GetByCodeAsync(wmsScrapDetail.ItemCode).ConfigureAwait(false);
wmsScrapDetail.ToWarehouseCode = "";
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.ItemName = item.Name;
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);

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

@ -7,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using 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
{
@ -153,13 +155,13 @@ public class MesAgentModule : AbpModule
typeof(LabelApplicationContractsModule).Assembly,
"Label"
);
}
public override async Task OnApplicationInitializationAsync(
ApplicationInitializationContext context)
}
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" />

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

@ -5613,96 +5613,4 @@ CREATE UNIQUE INDEX [IX_Store_ScrapNote_Number] ON [Store_ScrapNote] ([Number])
CREATE INDEX [IX_Store_ScrapNoteDetail_MasterID] ON [Store_ScrapNoteDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromLot], [FromStatus]) WHERE [FromPackingCode] IS NOT NULL AND [FromLot] IS NOT NULL
CREATE UNIQUE INDEX [IX_Store_ScrapRequest_Number] ON [Store_ScrapRequest] ([Number])
CREATE INDEX [IX_Store_ScrapRequestDetail_MasterID] ON [Store_ScrapRequestDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_ScrapRequestDetail_Number_ItemCode_LocationCode] ON [Store_ScrapRequestDetail] ([Number], [ItemCode], [LocationCode])
CREATE UNIQUE INDEX [IX_Store_SupplierAsn_Number] ON [Store_SupplierAsn] ([Number])
CREATE INDEX [IX_Store_SupplierAsn_SupplierCode] ON [Store_SupplierAsn] ([SupplierCode])
CREATE INDEX [IX_Store_SupplierAsnDetail_MasterID] ON [Store_SupplierAsnDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_SupplierAsnDetail_Number_ItemCode_PackingCode] ON [Store_SupplierAsnDetail] ([Number], [ItemCode], [PackingCode])
CREATE UNIQUE INDEX [IX_Store_TransferNote_Number] ON [Store_TransferNote] ([Number])
CREATE INDEX [IX_Store_TransferNoteDetail_MasterID] ON [Store_TransferNoteDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_TransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode_FromStatus_ToStatus] ON [Store_TransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromStatus], [ToStatus]) WHERE [FromPackingCode] IS NOT NULL
CREATE UNIQUE INDEX [IX_Store_TransferRequest_Number] ON [Store_TransferRequest] ([Number])
CREATE INDEX [IX_Store_TransferRequestDetail_MasterID] ON [Store_TransferRequestDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNote_Number] ON [Store_UnplannedIssueNote] ([Number])
CREATE INDEX [IX_Store_UnplannedIssueNoteDetail_MasterID] ON [Store_UnplannedIssueNoteDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL
CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequest_Number] ON [Store_UnplannedIssueRequest] ([Number])
CREATE INDEX [IX_Store_UnplannedIssueRequestDetail_MasterID] ON [Store_UnplannedIssueRequestDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL
CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNote_Number] ON [Store_UnplannedReceiptNote] ([Number])
CREATE INDEX [IX_Store_UnplannedReceiptNoteDetail_MasterID] ON [Store_UnplannedReceiptNoteDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL
CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequest_Number] ON [Store_UnplannedReceiptRequest] ([Number])
CREATE INDEX [IX_Store_UnplannedReceiptRequestDetail_MasterID] ON [Store_UnplannedReceiptRequestDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL
CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNote_Number] ON [Store_WarehouseTransferNote] ([Number])
CREATE INDEX [IX_Store_WarehouseTransferNoteDetail_MasterID] ON [Store_WarehouseTransferNoteDetail] ([MasterID])
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_WorkOrder_Number] ON [Store_WorkOrder] ([Number])
CREATE INDEX [IX_Store_WorkOrderDetail_MasterID] ON [Store_WorkOrderDetail] ([MasterID])
CREATE UNIQUE INDEX [IX_Store_WorkOrderDetail_Number_ItemCode] ON [Store_WorkOrderDetail] ([Number], [ItemCode])
CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs

@ -149,5 +149,6 @@ public class SfsStoreDetailWithFromToInputBase
/// </summary>
[Display(Name = "目标库存状态")]
public EnumInventoryStatus ToStatus { get; set; }
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs

@ -11,7 +11,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
{
CreateMap<ProductReceiptNote, ProductReceiptNoteDTO>()
.ReverseMap();
CreateMap<ProductReceiptNoteDetail, ProductReceiptNoteDetailDTO>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ProdLine)

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs

@ -26,7 +26,7 @@ public static class IHasLocationExtensions
{
var location = await locationAclService.GetByCodeAsync(hasFromTolocation.FromLocationCode).ConfigureAwait(false);
if (location != null)
{
{
hasFromTolocation.FromLocationErpCode = location.ErpLocationCode;
if (string.IsNullOrEmpty(hasFromTolocation.FromWarehouseCode))
{

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs

@ -85,7 +85,7 @@ public class ScrapNoteEventHandler
transferLog.Worker = scrapNote.Worker;
transferLog.DocNumber = scrapNote.Number;
transferLog.JobNumber = scrapNote.JobNumber;
transferLogs.Add(transferLog);
}

Loading…
Cancel
Save