diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json
new file mode 100644
index 000000000..8d5c24c89
--- /dev/null
+++ b/.vs/VSWorkspaceState.json
@@ -0,0 +1,7 @@
+{
+ "ExpandedNodes": [
+ ""
+ ],
+ "SelectedNode": "\\WZC2.sln",
+ "PreviewInSolutionExplorer": false
+}
\ No newline at end of file
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/Backflu.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/Backflu.cs
new file mode 100644
index 000000000..ef57f4aff
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/Backflu.cs
@@ -0,0 +1,58 @@
+using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Domain.Entities;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
+public class Backflu : Entity
+{
+
+ ///
+ /// MES写入时间
+ ///
+ public string scmout_dt_w { get; set; }
+ ///
+ /// 单据类型
+ ///
+ public string scmout_type { get; set; }
+ ///
+ /// TYRP单号
+ ///
+ [Key]
+ public string scmout_nbr { get; set; }
+ ///
+ /// 料号
+ ///
+ public string scmout_part { get; set; }
+ ///
+ /// 追加码/预定交货日/序号/储位
+ ///
+ public string scmout_no { get; set; }
+ ///
+ /// TYRP异动储位
+ ///
+ public string scmout_loc { get; set; }
+ ///
+ /// 库存交易年月
+ ///
+ public string scmout_ym { get; set; }
+ ///
+ /// 库存交易日
+ ///
+ public string scmout_date { get; set; }
+ ///
+ /// 数量
+ ///
+ public decimal scmout_qty { get; set; }
+ ///
+ /// 调入储位
+ ///
+ public string scmout_in_loc { get; set; }
+ ///
+ /// 有效码
+ ///
+ public string scmout_stat { get; set; }
+
+ public override object[] GetKeys()
+ {
+ return new object[] { scmout_nbr };
+ }
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/BackfluManager.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/BackfluManager.cs
new file mode 100644
index 000000000..aa2e1a195
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/BackfluManager.cs
@@ -0,0 +1,28 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.Domain.Services;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
+public class BackfluManager : DomainService, IBackfluManager
+{
+ private readonly IBackfluRepository _repository;
+ public BackfluManager(IBackfluRepository repository)
+ {
+ _repository = repository;
+ }
+ public async Task> GetToBeProcessedListAsync()
+ {
+ var Backflu = await _repository.GetListAsync().ConfigureAwait(false);
+
+ return Backflu.ToList();
+ }
+ public virtual async Task UpdateProcessedListAsync(List entities)
+ {
+ foreach (var entitie in entities)
+ {
+ entitie.scmout_stat = "N";
+ await _repository.UpdateAsync(entitie).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/IBackfluManager.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/IBackfluManager.cs
new file mode 100644
index 000000000..d87b62978
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/IBackfluManager.cs
@@ -0,0 +1,10 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Volo.Abp.Domain.Services;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
+public interface IBackfluManager : IDomainService
+{
+ Task> GetToBeProcessedListAsync();
+ Task UpdateProcessedListAsync(List entities);
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/IBackfluRepository.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/IBackfluRepository.cs
new file mode 100644
index 000000000..26f50aeb3
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/Backflus/IBackfluRepository.cs
@@ -0,0 +1,7 @@
+using Volo.Abp.Domain.Repositories;
+
+namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
+public interface IBackfluRepository : IRepository
+{
+
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs
index a00d40b80..0fc592abd 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes/PullTask/PullTask.cs
@@ -19,7 +19,7 @@ public class PullTask : Entity
///
/// 数量
///
- public decimal Planqty { get; set; }
+ public string Planqty { get; set; }
///
/// 单号
///
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Backflus/BackfluManager.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Backflus/BackfluManager.cs
index fbdaa8e1d..d25f37ee5 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Backflus/BackfluManager.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Backflus/BackfluManager.cs
@@ -19,5 +19,12 @@ public class BackfluManager : DomainService, IBackfluManager
return Backflu.ToList();
}
-
+ public virtual async Task UpdateProcessedListAsync(List entities)
+ {
+ foreach (var entitie in entities)
+ {
+ entitie.scmout_stat = "N";
+ await _repository.UpdateAsync(entitie).ConfigureAwait(false);
+ }
+ }
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Backflus/IBackfluManager.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Backflus/IBackfluManager.cs
index c7face679..6de3f20b1 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Backflus/IBackfluManager.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Backflus/IBackfluManager.cs
@@ -7,5 +7,5 @@ namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp;
public interface IBackfluManager : IDomainService
{
Task> GetToBeProcessedListAsync();
- //Task UpdateProcessedListAsync(List entities);
+ Task UpdateProcessedListAsync(List entities);
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Backflus/BackflusDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Backflus/BackflusDbContextModelCreatingExtensions.cs
new file mode 100644
index 000000000..46b15138e
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Backflus/BackflusDbContextModelCreatingExtensions.cs
@@ -0,0 +1,31 @@
+
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore.Modeling;
+using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
+
+namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes;
+public static class BackfluDbContextModelCreatingExtensions
+{
+ public static void ConfigureBackflu(this ModelBuilder builder, MesModelBuilderConfigurationOptions options)
+ {
+ builder.Entity(b =>
+ {
+ //Configure table & schema Name
+ b.ToTable(options.TablePrefix + "scmout", options.Schema);
+ //Configure ABP properties
+ b.ConfigureByConvention();
+ b.Property(q => q.scmout_dt_w).HasMaxLength(20);
+ b.Property(q => q.scmout_type).HasMaxLength(6);
+ b.Property(q => q.scmout_nbr).HasMaxLength(12);
+ b.Property(q => q.scmout_part).HasMaxLength(20);
+ b.Property(q => q.scmout_no).HasMaxLength(10);
+ b.Property(q => q.scmout_loc).HasMaxLength(10);
+ b.Property(q => q.scmout_ym).HasMaxLength(6);
+ b.Property(q => q.scmout_date).HasMaxLength(8);
+ b.Property(q => q.scmout_qty).HasPrecision(10, 2);
+ b.Property(q => q.scmout_in_loc).HasMaxLength(10);
+ b.Property(q => q.scmout_stat).HasMaxLength(1);
+ });
+
+ }
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Backflus/BackflusEfCoreRepository.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Backflus/BackflusEfCoreRepository.cs
new file mode 100644
index 000000000..b0b452778
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/Backflus/BackflusEfCoreRepository.cs
@@ -0,0 +1,12 @@
+using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
+using Volo.Abp.EntityFrameworkCore;
+using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
+
+namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes;
+public class BackfluEfCoreRepository : EfCoreRepository, IBackfluRepository
+{
+ public BackfluEfCoreRepository(IDbContextProvider dbContextProvider)
+ : base(dbContextProvider)
+ {
+ }
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeDbContextModelCreatingExtensions.cs
index d9a084b20..3d5d56d79 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeDbContextModelCreatingExtensions.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeDbContextModelCreatingExtensions.cs
@@ -26,6 +26,6 @@ public static class DataExchangeDbContextModelCreatingExtensions
builder.ConfigurePullTask(options);
builder.ConfigureScrap(options);
builder.ConfigurePck(options);
-
+ builder.ConfigureBackflu(options);
}
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeEntityFrameworkCoreFawtygModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeEntityFrameworkCoreFawtygModule.cs
index 13459e207..ea5d271be 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeEntityFrameworkCoreFawtygModule.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/DataExchangeEntityFrameworkCoreFawtygModule.cs
@@ -31,5 +31,6 @@ public class DataExchangeEntityFrameworkCoreFawtygModule : AbpModule
context.Services.AddTransient();
context.Services.AddTransient();
context.Services.AddTransient();
+ context.Services.AddTransient();
}
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/IMesDbContext.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/IMesDbContext.cs
index 10caffc24..60810373f 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/IMesDbContext.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/IMesDbContext.cs
@@ -19,4 +19,5 @@ public interface IMesDbContext : IEfCoreDbContext
DbSet MesOuts { get; }
DbSet PullTasks { get; }
+ DbSet Backflu { get; }
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesDbContext.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesDbContext.cs
index f99c3cac6..775047674 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesDbContext.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/MesDbContext.cs
@@ -20,6 +20,7 @@ public class MesDbContext :
public virtual DbSet PullTasks { get; }
public virtual DbSet Issue { get; }
+ public virtual DbSet Backflu { get; }
public MesDbContext(DbContextOptions options)
: base(options)
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs
index 0c955f22e..77c9c9330 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Mes/PullTask/PullTaskDbContextModelCreatingExtensions.cs
+++ b/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);
});
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluConverter.cs
new file mode 100644
index 000000000..87a025842
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluConverter.cs
@@ -0,0 +1,83 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using Volo.Abp.ObjectMapping;
+using Win_in.Sfs.Basedata.Application.Contracts;
+using Win_in.Sfs.Wms.DataExchange.Domain;
+using Win_in.Sfs.Wms.DataExchange.WMS.BackFlushNote;
+using Win_in.Sfs.Wms.Store.Application.Contracts;
+
+namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
+
+public class BackFluConverter : IIncomingConverter
+{
+ private readonly IIncomingFromExternalManager _incomingFromExternalManager;
+ private readonly IIncomingToWmsManager _incomingToWmsManager;
+ private readonly IItemBasicAppService _itemBasicAppService;
+ private readonly IObjectMapper _objectMapper;
+ private readonly ILogger _logger;
+ public BackFluConverter(
+ IIncomingToWmsManager incomingToWmsManager,
+ IItemBasicAppService itemBasicAppService,
+ IObjectMapper objectMapper,
+ ILogger logger
+,
+ IIncomingFromExternalManager incomingFromExternalManager
+
+)
+ {
+ _incomingToWmsManager = incomingToWmsManager;
+ _itemBasicAppService = itemBasicAppService;
+ _objectMapper = objectMapper;
+ _logger = logger;
+ _incomingFromExternalManager = incomingFromExternalManager;
+ }
+ public virtual async Task ConvertAsync(List incomingFromExternalList)
+ {
+ if (!incomingFromExternalList.Any())
+ {
+ _logger.LogInformation("no backflus");
+ return;
+ }
+ var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
+ await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
+ //归档
+ await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
+
+ }
+
+ private async Task> BuildIncomingToWmsOfPurchaseOrderAsync(List incomingDataList)
+ {
+ await Task.CompletedTask.ConfigureAwait(false);
+ var incomingToWmsList = new List();
+ var groups = incomingDataList.GroupBy(p => p.SourceDataGroupCode);
+ foreach (var group in groups)
+ {
+ var first = group.First();
+ var incomingToWms = new IncomingToWms()
+ {
+ DataType = first.DataType,
+ DataAction = first.DataAction,
+ SourceSystem = first.SourceSystem,
+ DataIdentityCode = first.SourceDataGroupCode,
+ };
+ incomingToWms.SetEffectiveDate(first.EffectiveDate);
+ var exchangeBack = JsonSerializer.Deserialize(first.DestinationDataContent);
+ var wmsBack = _objectMapper.Map(exchangeBack);
+ wmsBack.Details = new List();
+ foreach (var incomingFromExternal in group.ToList())
+ {
+ var back = JsonSerializer.Deserialize(incomingFromExternal.DestinationDataContent);
+ var wmsBackDetail = _objectMapper.Map(back.Detail);
+
+ wmsBack.Details.Add(wmsBackDetail);
+ }
+ incomingToWms.DataContent = JsonSerializer.Serialize(wmsBack);
+ incomingToWmsList.Add(incomingToWms);
+ }
+ return incomingToWmsList;
+ }
+
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluReader.cs
new file mode 100644
index 000000000..f479fed59
--- /dev/null
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluReader.cs
@@ -0,0 +1,112 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using Win_in.Sfs.Wms.DataExchange.Domain;
+using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
+using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
+
+using Win_in.Sfs.Wms.DataExchange.WMS.BackFlushNote;
+
+namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
+
+public class BackFluReader : IReader
+{
+ private readonly IBackfluManager _ibackfluManager;
+ private readonly IIncomingFromExternalManager _incomingFromExternalManager;
+ private readonly ILogger _logger;
+ private readonly IConfiguration _configuration;
+ public BackFluReader(
+ IBackfluManager ibackfuManager
+ , IIncomingFromExternalManager incomingFromExternalManager
+ , ILogger logger
+ , IConfiguration configuration
+ )
+ {
+ _ibackfluManager = ibackfuManager;
+ _incomingFromExternalManager = incomingFromExternalManager;
+ _logger = logger;
+ _configuration = configuration;
+ }
+ public virtual async Task> ReadAsync()
+ {
+ //从Tyrp读取待处理bom
+ var BackFull = await _ibackfluManager.GetToBeProcessedListAsync().ConfigureAwait(false);
+ var toBeProcessedBack = BackFull.Where(p => p.scmout_stat == "Y").ToList();
+ if (!toBeProcessedBack.Any())
+ {
+ _logger.LogInformation("no backflus");
+ return new List();
+ }
+ //bom逐一转换为bomNote
+ var incomingDataList = BuildIncomingFromExternalFromBomAsync(toBeProcessedBack);
+ await _incomingFromExternalManager.CreateManyAsync(incomingDataList).ConfigureAwait(false);
+ await _ibackfluManager.UpdateProcessedListAsync(toBeProcessedBack).ConfigureAwait(false);
+ return incomingDataList;
+ }
+ private List BuildIncomingFromExternalFromBomAsync(List toBeProcessedIssue)
+ {
+ var incomingDataList = new List();
+ foreach (var backflu in toBeProcessedIssue)
+ {
+ var incomingData = BuildIncomingFromExternal(backflu);
+
+ incomingData.SetEffectiveDate(DateTime.Now);
+
+ try
+ {
+ var bm = BuildScrapNoteOrderExchangeMes(backflu);
+ incomingData.DestinationDataContent = JsonSerializer.Serialize(backflu);
+ }
+ catch (Exception ex)
+ {
+ incomingData.SetError(EnumExchangeDataErrorCode.Exception, ex.Message, ex.ToString());
+ }
+
+ incomingDataList.Add(incomingData);
+
+ }
+ return incomingDataList;
+ }
+ private IncomingFromExternal BuildIncomingFromExternal(Backflu backflu)
+ {
+ var incomingData = new IncomingFromExternal()
+ {
+ DataType = EnumIncomingDataType.BackFlush.ToString(),
+ DataAction = EnumExchangeDataAction.Add,
+ SourceSystem = EnumSystemType.ERP.ToString(),
+ SourceDataId = backflu.scmout_type,
+ SourceDataGroupCode = backflu.scmout_nbr,
+ SourceDataDetailCode = backflu.scmout_part,
+ SourceDataContent = JsonSerializer.Serialize(backflu),
+ WriteTime = DateTime.Now,
+ Writer = nameof(MesIncomingBackgroundWorker),
+ DestinationSystem = EnumSystemType.ERP.ToString(),
+ };
+ return incomingData;
+ }
+
+ private static BackFlushNoteExchangeDto BuildScrapNoteOrderExchangeMes(Backflu backflu)
+ {
+
+ var back = new BackFlushNoteExchangeDto()
+ {
+
+ ActiveDate = Convert.ToDateTime(backflu.scmout_dt_w.Substring(0, 4) + "-" + backflu.scmout_dt_w.Substring(4, 2) + "-" + backflu.scmout_dt_w.Substring(6, 2)),
+ ItemCode = backflu.scmout_part,
+ Number = backflu.scmout_nbr
+ };
+ var bakcdetail = new BackFlushNoteDetailExchangeDto()
+ {
+ Number = backflu.scmout_nbr,
+ ItemCode = backflu.scmout_part,
+ Qty = backflu.scmout_qty,
+ LocationErpCode = backflu.scmout_loc
+ };
+ back.Detail = bakcdetail;
+ return back;
+ }
+}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
index 558588868..750af9290 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesIncomingBackgroundWorker.cs
@@ -34,21 +34,21 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
Logger.LogInformation($"{Incoming} is not active!");
return;
}
- Logger.LogInformation($"Read MesOut");//缴库
- var mesOutReader = workerContext.ServiceProvider.GetRequiredService();
- var mesOutConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取并保存MesOut
- var mesOutsFromExternalList = await mesOutReader.ReadAsync().ConfigureAwait(false);
- //转换MesOut
- await mesOutConverter.ConvertAsync(mesOutsFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"Read MesOut");//缴库
+ //var mesOutReader = workerContext.ServiceProvider.GetRequiredService();
+ //var mesOutConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保存MesOut
+ //var mesOutsFromExternalList = await mesOutReader.ReadAsync().ConfigureAwait(false);
+ ////转换MesOut
+ //await mesOutConverter.ConvertAsync(mesOutsFromExternalList).ConfigureAwait(false);
- Logger.LogInformation($"Read PullTask");//拉动任务
- var pullTaskReader = workerContext.ServiceProvider.GetRequiredService();
- var pullTaskConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取并保存PullTask
- var pullTaskFromExternalList = await pullTaskReader.ReadAsync().ConfigureAwait(false);
- //转换PullTask
- await pullTaskConverter.ConvertAsync(pullTaskFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"Read PullTask");//拉动任务
+ //var pullTaskReader = workerContext.ServiceProvider.GetRequiredService();
+ //var pullTaskConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保存PullTask
+ //var pullTaskFromExternalList = await pullTaskReader.ReadAsync().ConfigureAwait(false);
+ ////转换PullTask
+ //await pullTaskConverter.ConvertAsync(pullTaskFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Scrap");
var scrapReader = workerContext.ServiceProvider.GetRequiredService();
@@ -58,14 +58,21 @@ public class MesIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
//转换Scrap
await scrapConverter.ConvertAsync(scrapsFromExternalList).ConfigureAwait(false);
- Logger.LogInformation($"Read Issue");
- var pckHandleService = workerContext.ServiceProvider.GetRequiredService();
- var pckConverter = workerContext.ServiceProvider.GetRequiredService();
- //读取并保持Pck
- var pcksFromExternalList = await pckHandleService.ReadAsync().ConfigureAwait(false);
- //转换Pck
- await pckConverter.ConvertAsync(pcksFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"Read Issue");
+ //var pckHandleService = workerContext.ServiceProvider.GetRequiredService();
+ //var pckConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保持Pck
+ //var pcksFromExternalList = await pckHandleService.ReadAsync().ConfigureAwait(false);
+ ////转换Pck
+ //await pckConverter.ConvertAsync(pcksFromExternalList).ConfigureAwait(false);
+ //Logger.LogInformation($"Read BackFlush");//耗用单
+ //var BackFlushReader = workerContext.ServiceProvider.GetRequiredService();
+ //var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService();
+ ////读取并保存Customer
+ //var backFlushsFromExternalList = await BackFlushReader.ReadAsync().ConfigureAwait(false);
+ ////转换Customer
+ //await BackFlushConverter.ConvertAsync(backFlushsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Completed: Handling {Incoming}");
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
index ea92dcf1d..097550573 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
+++ b/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;
@@ -77,6 +78,7 @@ public class MesOutConverter : IIncomingConverter
wmsProductReceiptNote.WorkShop = "";//车间
wmsProductReceiptNote.Worker = _configuration["Authentication:username"];//操作人
wmsProductReceiptNote.ReceiptType = EnumReceiptType.MesScanReceipt;//完工收货方式
+ wmsProductReceiptNote.WarehouseCode = "";
wmsProductReceiptNote.Details = new List();
foreach (var incomingFromExternal in group.ToList())
@@ -86,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)
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs
index 9c452e010..06d94bf12 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs
+++ b/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;
@@ -77,16 +78,16 @@ public class PullTaskConverter : IIncomingConverter
foreach (var incomingFromExternal in group.ToList())
{
var materialRequest = JsonSerializer.Deserialize(incomingFromExternal.DestinationDataContent);
- var wmsMaterialRequestDetail = _objectMapper.Map(materialRequest.Detail);
+ var wmsMaterialRequestDetail = _objectMapper.Map(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)
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs
index 1faa0b6f8..5996e66ef 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskReader.cs
+++ b/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> 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,
};
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs
index 11d70263a..4a096d624 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs
@@ -85,15 +85,17 @@ public class ScrapConverter : IIncomingConverter
wmsScrapDetail.FromPackingCode = "";
wmsScrapDetail.FromLot = "";
wmsScrapDetail.FromWarehouseCode = "";
- wmsScrapDetail.ToWarehouseCode = "";
- wmsScrapDetail.Uom = "";
+ wmsScrapDetail.ToWarehouseCode = "";
wmsScrapDetail.FromStatus = EnumInventoryStatus.OK;
- var item = await _itemBasicAppService.GetByCodeAsync(wmsScrapDetail.ItemCode).ConfigureAwait(false);
+ wmsScrapDetail.FromLocationArea = "";
+ wmsScrapDetail.ToLocationGroup = "";
+ 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);
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapReader.cs
index 2112becd3..f01b1ab02 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapReader.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapReader.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
+using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
@@ -95,8 +96,8 @@ public class ScrapReader : IReader
var crap = new ScrapNoteExchangeDto()
{
Worker = scrap.mesout_asd_user,
- ActiveDate = DateTime.ParseExact(scrap.Mesout_asd_date, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture)
-
+ ActiveDate = DateTime.ParseExact(scrap.Mesout_asd_date, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture),
+ Type = EnumTransSubType.Scrap_WIP.ToString()
};
var crapDetail = new ScrapNoteDetailExchangeDto()
{
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs
index 388c48ee8..2a845ffc5 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/MesAgentModule.cs
+++ b/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().ConfigureAwait(false);
- await context.AddBackgroundWorkerAsync().ConfigureAwait(false);
- }
+ context.AddBackgroundWorkerAsync();
+ //context.AddBackgroundWorkerAsync();
+ }
}
+
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj
index 464b89db6..3637b0414 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.csproj
@@ -11,6 +11,7 @@
+
@@ -27,6 +28,7 @@
+
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/appsettings.json b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/appsettings.json
index 72ca5624c..2ea101bee 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/appsettings.json
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/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!;",
- "MES": "Server=dev.ccwin-in.com;Port=13306;Database=MES;Uid=ccwinin;Pwd=Microsoft@2022;"
+ "Default": "Server=dev.ccwin-in.com,21195;Database= WMS;uid=sa;pwd=aA123456!;TrustServerCertificate=True;",
+ "DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True;",
+ "MES": "Server=10.164.1.12;Port=3306;Database=erp;Uid=wms;Pwd=123456;"
},
"AuthServer": {
- "Authority": "http://dev.ccwin-in.com:59093/",
+ "Authority": "http://dev.ccwin-in.com:21293/",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "admin",
"SwaggerClientSecret": "1q2w3E*",
@@ -24,13 +24,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/"
}
},
"MesOptions": {
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs
index 933f3328b..a8676a368 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs
@@ -43,7 +43,7 @@ public class BackFluReader : IReader
//bom逐一转换为bomNote
var incomingDataList = BuildIncomingFromExternalFromBomAsync(toBeProcessedBack);
await _incomingFromExternalManager.CreateManyAsync(incomingDataList).ConfigureAwait(false);
- //await _ibackfluManager.UpdateProcessedListAsync(toBeProcessedBack);
+ await _ibackfluManager.UpdateProcessedListAsync(toBeProcessedBack).ConfigureAwait(false);
return incomingDataList;
}
private List BuildIncomingFromExternalFromBomAsync(List toBeProcessedIssue)
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs
index e489620b7..a50d73ebf 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs
@@ -49,7 +49,7 @@ public class ItemBasicConverter : IIncomingConverter
var materialRequestList = await BuildIncomingToWmsOfItemBasicRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false);
//归档
- await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList);
+ await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task> BuildIncomingToWmsOfItemBasicRequestAsync(List incomingDataList)
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs
new file mode 100644
index 000000000..8e25bb6a7
--- /dev/null
+++ b/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> ConvertAsync()
+ {
+ var outgoingToExternalList = new List();
+ var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.Item_Transform, EnumSystemType.ERP).ConfigureAwait(false);
+ foreach (var outgoingFromWms in outgoingFromWmsList)
+ {
+ var wmsCountAdjust = JsonSerializer.Deserialize(outgoingFromWms.DataContent);
+ if (Enum.Parse(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 ItemTransform = new List();
+ 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(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 BuildPurchaseReceiptExchangeDtoAsync(
+ ItemTransformNoteDTO wmsCountAdjust, ItemTransformNoteDetailExchangeDto wmsCountAdjustDetail)
+ {
+
+ var exchangeCountAdjust = _objectMapper.Map(wmsCountAdjust);
+
+ exchangeCountAdjust.Detail = wmsCountAdjustDetail;
+ return exchangeCountAdjust;
+ }
+ }
+
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
index 0344a59ed..52ca1123a 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
@@ -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();
+ var ItemTransformNoteList = await ItemTransformNoteConvert.ConvertAsync().ConfigureAwait(false);
+ await countadjustWriter.WriteAsync(ItemTransformNoteList).ConfigureAwait(false);
Logger.LogInformation($"Completed: Handling {Outgoing}");
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj
index bdec28966..f7135a83a 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.csproj
@@ -31,6 +31,7 @@
+
diff --git a/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs b/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs
index 085cf9304..441352764 100644
--- a/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs
+++ b/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)
{
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
index de009e0fb..3b5a3402e 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
+++ b/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();
- context.AddBackgroundWorkerAsync();
+ context.AddBackgroundWorkerAsync();
+ //context.AddBackgroundWorkerAsync();
}
}
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
index 907622f56..9dafc2553 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
@@ -79,64 +79,64 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
switch (dataType)
{
case EnumIncomingDataType.Department:
- await incomingToWms.HandleDepartmentsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleDepartmentsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.User:
- await incomingToWms.HandleUsersAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleUsersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Item:
- await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Location:
await incomingToWms.HandleErpLocationsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Bom:
- await incomingToWms.HandleBomsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleBomsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Dict:
await incomingToWms.HandleDictsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Supplier:
- await incomingToWms.HandleSuppliersAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleSuppliersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.SupplierItem:
- await incomingToWms.HandleSupplierItemsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleSupplierItemsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.ItemPack:
- await incomingToWms.HandleItemPacksAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleItemPacksAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Customer:
- await incomingToWms.HandleCustomersAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleCustomersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.CustomerItem:
- await incomingToWms.HandleCustomerItemsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleCustomerItemsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.InterfaceCalendar:
- await incomingToWms.HandleInterfaceCalendarsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleInterfaceCalendarsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.PurchaseOrder:
- await incomingToWms.HandlePurchaseOrdersAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandlePurchaseOrdersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.SaleOrder:
- await incomingToWms.HandleSaleOrdersAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleSaleOrdersAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.SupplierAsn:
- await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.ProductReceipt:
- await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.MaterialRequest:
await incomingToWms.HandleMaterialRequestsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.Scrap:
- await incomingToWms.HandleScrapsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleScrapsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.IssueConfirm:
- await incomingToWms.HandleIssueNoteConfirmAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleIssueNoteConfirmAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.PurchaseLabel:
- await incomingToWms.HandleInventoryLabelsAsync(workerContext).ConfigureAwait(false);
+ //await incomingToWms.HandleInventoryLabelsAsync(workerContext).ConfigureAwait(false);
break;
case EnumIncomingDataType.BackFlush:
await incomingToWms.HandleBackFlushsAsync(workerContext).ConfigureAwait(false);
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs
index 1378228d0..c5d859310 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs
@@ -30,6 +30,7 @@ public enum EnumOutgoingDataType
RecycledMaterialReceipt = 22,
Scrap = 23,
ProductRecycle = 24,
+ Item_Transform = 25
}
public enum EnumExchangeTableType
{
diff --git a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/AsnTimeWindowController.cs b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/AsnTimeWindowController.cs
index 939f02642..be8a7352b 100644
--- a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/AsnTimeWindowController.cs
+++ b/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> GetAsnTimeWindowsAsync()
{
- return await GetAsnTimeWindowDashboardsAsync().ConfigureAwait(false);
+ return await GetAsnTimeWindowDashboardsAsync();
}
private async Task> 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 ConvertToAsnTimeWindowDashboards(
+ private List ConvertToAsnTimeWindowDashboards(
List supplierAsns,
List suppliers,
List 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> GetSuppliersAsync(IEnumerable codes)
{
- return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false);
+ return await this._supplierApp.GetByCodesAsync(codes);
}
private async Task> GetPurchaseReceiptNotesAsync(IEnumerable asnNumbers)
{
- return await _purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false);
+ return await this._purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers);
}
+ ///
+ ///
+ ///
+ ///
+ [HttpGet("get-server-date-time")]
+ public virtual async Task GetServerDate()
+ {
+ return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ }
}
diff --git a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs
index c3ff248e8..3e1eea770 100644
--- a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs
+++ b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/MaterialRequestController.cs
@@ -2,151 +2,156 @@ 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;
-
-using System.Linq;
-
-using NUglify.Helpers;
+namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
+{
+ using System.Linq;
-using Win_in.Sfs.Shared.Domain.Shared;
-using Win_in.Sfs.Wms.Store.Application.Contracts;
+ using NUglify.Helpers;
-[ApiController]
-[Route($"{PdaHostConst.ROOT_ROUTE}material-request")]
+ 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;
-public class MaterialRequestController : AbpController
-{
- private readonly IMaterialRequestAppService _materialRequestApp;
+ [ApiController]
+ [Route($"{PdaHostConst.ROOT_ROUTE}material-request")]
- private readonly IIssueNoteAppService _issueNoteApp;
- public MaterialRequestController(IMaterialRequestAppService materialRequestApp, IIssueNoteAppService issueNoteApp)
+ public class MaterialRequestController : AbpController
{
- _materialRequestApp = materialRequestApp;
- _issueNoteApp = issueNoteApp;
- }
+ private readonly IMaterialRequestAppService _materialRequestApp;
- [HttpGet("un-handled-order-sum")]
- public virtual async Task GetUnHandledOrderSumAsync()
- {
- var dto = new MaterialRequestUnHandledOrderSumDto();
+ private readonly IIssueNoteAppService _issueNoteApp;
+ public MaterialRequestController(IMaterialRequestAppService materialRequestApp, IIssueNoteAppService issueNoteApp)
+ {
+ _materialRequestApp = materialRequestApp;
+ _issueNoteApp = issueNoteApp;
+ }
- var list = await GetMaterialRequestAsync().ConfigureAwait(false);
+ [HttpGet("un-handled-order-sum")]
+ public virtual async Task GetUnHandledOrderSumAsync()
+ {
+ var dto = new MaterialRequestUnHandledOrderSumDto();
- dto.Sum = list.Where(t => t.RequestStatus == EnumRequestStatus.New).Count();
+ var list = await GetMaterialRequestAsync();
- return dto;
- }
+ dto.Sum = list.Where(t => t.RequestStatus == EnumRequestStatus.New).Count();
- [HttpGet("un-issued-item-qty-sum")]
- public virtual async Task GetUnIssuedItemQtySumAsync()
- {
- var dto = new MaterialRequestUnIssuedItemQtySumDto();
+ return dto;
+ }
- var list = await GetMaterialRequestAsync().ConfigureAwait(false);
+ [HttpGet("un-issued-item-qty-sum")]
+ public virtual async Task GetUnIssuedItemQtySumAsync()
+ {
+ var dto = new MaterialRequestUnIssuedItemQtySumDto();
- dto.Sum = list.Where(t => t.RequestStatus != EnumRequestStatus.New)
- .Sum(t => t.Details.Sum(t1 => t1.Qty - t1.IssuedQty));
+ var list = await GetMaterialRequestAsync();
- return dto;
- }
+ dto.Sum = list.Where(t => t.RequestStatus != EnumRequestStatus.New)
+ .Sum(t => t.Details.Sum(t1 => t1.Qty - t1.IssuedQty));
- [HttpGet("un-received-item-qty-by-item-list")]
- public virtual async Task>
- GetUnIssuedItemQtySumByItemListAsync()
- {
- var dtos = new List();
+ return dto;
+ }
- var list = await GetMaterialRequestAsync().ConfigureAwait(false);
+ [HttpGet("un-received-item-qty-by-item-list")]
+ public virtual async Task>
+ GetUnIssuedItemQtySumByItemListAsync()
+ {
+ var dtos = new List();
+
+ var list = await GetMaterialRequestAsync();
- var details = new List();
+ var details = new List();
- list.Where(t => t.RequestStatus != EnumRequestStatus.New).ForEach(
- item =>
+ list.Where(t => t.RequestStatus != EnumRequestStatus.New).ForEach(
+ item =>
{
item.Details.ForEach(
detail =>
+ {
+ if (detail.IssuedQty - detail.ReceivedQty > 0)
{
- if (detail.IssuedQty - detail.ReceivedQty > 0)
- {
- details.Add(detail);
- }
- });
+ details.Add(detail);
+ }
+ });
});
- dtos = details.GroupBy(t => t.ItemCode).Select(
- item => new MaterialRequestUnReceivedItemQtyByItemDto()
- {
- ItemCode = item.Key,
- Sum = item.Sum(t => t.IssuedQty - t.ReceivedQty)
- }).ToList();
+ dtos = details.GroupBy(t => t.ItemCode).Select(
+ item => new MaterialRequestUnReceivedItemQtyByItemDto()
+ {
+ ItemCode = item.Key,
+ Sum = item.Sum(t => t.IssuedQty - t.ReceivedQty)
+ }).ToList();
- return dtos;
- }
+ return dtos;
+ }
- [HttpGet("item-qty-by-received-status-list")]
- public virtual async Task> GetItemQtyByReceivedStatusListAsync()
- {
- var dtos = new List();
+ [HttpGet("item-qty-by-received-status-list")]
+ public virtual async Task> GetItemQtyByReceivedStatusListAsync()
+ {
+ var dtos = new List();
- var ToBeIssuedQty = 0.0M;
+ var ToBeIssuedQty = 0.0M;
- var ToBeReceivedQty = 0.0M;
+ var ToBeReceivedQty = 0.0M;
- var Received = 0.0M;
+ var Received = 0.0M;
- var list = await GetMaterialRequestAsync().ConfigureAwait(false);
+ var list = await GetMaterialRequestAsync();
- list.ForEach(
- item =>
+ list.ForEach(
+ item =>
{
ToBeIssuedQty += item.Details.Sum(t => t.ToBeIssuedQty);
ToBeReceivedQty += item.Details.Sum(t => t.ToBeReceivedQty);
Received += item.Details.Sum(t => t.ReceivedQty);
});
- dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求未发", Sum = ToBeIssuedQty });
- dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "已发未收", Sum = ToBeReceivedQty });
- dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求已收", Sum = Received });
-
- return dtos;
- }
- [HttpGet("un-received-item-list")]
- public virtual async Task> GetUnReceivedItemListAsync()
- {
- var dtos = new List();
+ dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求未发", Sum = ToBeIssuedQty });
+ dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "已发未收", Sum = ToBeReceivedQty });
+ dtos.Add(new MaterialRequestItemQtyByReceivedStatusDto() { ReceivedStatus = "请求已收", Sum = Received });
- var notes = await GetIssueNotesAsync().ConfigureAwait(false);
+ return dtos;
+ }
- foreach (var note in notes)
+ [HttpGet("un-received-item-list")]
+ public virtual async Task> GetUnReceivedItemListAsync()
{
- foreach (var noteDetail in note.Details)
+ var dtos = new List();
+
+ var notes = await this.GetIssueNotesAsync();
+
+ foreach (var note in notes)
{
- var dto = new MaterialRequestUnReceivedItemDto();
+ foreach (var noteDetail in note.Details)
+ {
+ var dto = new MaterialRequestUnReceivedItemDto();
- dto.Number = note.RequestNumber;
- dto.ItemCode = noteDetail.ItemCode;
- dto.ItemDesc1 = noteDetail.ItemDesc1;
- dto.PackingCode = noteDetail.FromPackingCode;
- dto.IssuedQty = noteDetail.Qty;
- dto.IssuedTime = note.ActiveDate;
+ dto.Number = note.RequestNumber;
+ dto.ItemCode = noteDetail.ItemCode;
+ dto.ItemDesc1 = noteDetail.ItemDesc1;
+ dto.PackingCode = noteDetail.FromPackingCode;
+ dto.IssuedQty = noteDetail.Qty;
+ dto.IssuedTime = note.ActiveDate;
- dtos.Add(dto);
+ dtos.Add(dto);
+ }
}
- }
- return dtos;
- }
+ return dtos;
+ }
- private async Task> GetIssueNotesAsync()
- {
- return await _issueNoteApp.GetListUnConfirmedByTypeAsync(EnumTransSubType.Issue_WIP.ToString()).ConfigureAwait(false);
- }
+ private async Task> GetIssueNotesAsync()
+ {
+ return await this._issueNoteApp.GetListUnConfirmedByTypeAsync(EnumTransSubType.Issue_WIP.ToString());
+ }
- private async Task> GetMaterialRequestAsync()
- {
- return await _materialRequestApp.GetListByTypeAsync(EnumTransSubType.Issue_WIP.ToString()).ConfigureAwait(false);
+ private async Task> GetMaterialRequestAsync()
+ {
+ return await this._materialRequestApp.GetListByTypeAsync(EnumTransSubType.Issue_WIP.ToString());
+ }
}
}
diff --git a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs
index 0dc46b18f..d54bb4b54 100644
--- a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs
+++ b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PlanAndActualController.cs
@@ -1,174 +1,194 @@
-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;
-
-[ApiController]
-[Route($"{PdaHostConst.ROOT_ROUTE}plan-and-actual")]
-
-public class PlanAndActualController : AbpController
+namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
{
- private readonly ISupplierAsnAppService _supplierAsnApp;
- private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteApp;
- private readonly IPutawayNoteAppService _putawayNoteApp;
- private readonly ISupplierAppService _supplierApp;
- private readonly IItemSafetyStockAppService _itemSafetyStockApp;
- public PlanAndActualController(ISupplierAsnAppService supplierAsnApp, IPurchaseReceiptNoteAppService purchaseReceiptNoteApp, IPutawayNoteAppService putawayNoteApp, ISupplierAppService supplierApp, IItemSafetyStockAppService itemSafetyStockApp)
- {
- _supplierAsnApp = supplierAsnApp;
- _purchaseReceiptNoteApp = purchaseReceiptNoteApp;
- _putawayNoteApp = putawayNoteApp;
- _supplierApp = supplierApp;
- _itemSafetyStockApp = itemSafetyStockApp;
- }
+ [ApiController]
+ [Route($"{PdaHostConst.ROOT_ROUTE}plan-and-actual")]
- [HttpGet("plan-actual-list")]
- public virtual async Task> GetPlanAndActualListAsync()
+ public class PlanAndActualController : AbpController
{
- return await GetPlanAndActualDashboardsAsync().ConfigureAwait(false);
- }
+ private readonly ISupplierAsnAppService _supplierAsnApp;
+ private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteApp;
+ private readonly IPutawayNoteAppService _putawayNoteApp;
+ private readonly ISupplierAppService _supplierApp;
+ private readonly IItemSafetyStockAppService _itemSafetyStockApp;
+ private readonly IPurchaseOrderAppService _purchaseOrderApp;
+ private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobApp;
+
+ public PlanAndActualController(ISupplierAsnAppService supplierAsnApp, IPurchaseReceiptNoteAppService purchaseReceiptNoteApp, IPutawayNoteAppService putawayNoteApp, ISupplierAppService supplierApp, IItemSafetyStockAppService itemSafetyStockApp, IPurchaseOrderAppService purchaseOrderApp, IPurchaseReceiptJobAppService purchaseReceiptJobApp)
+ {
+ _supplierAsnApp = supplierAsnApp;
+ _purchaseReceiptNoteApp = purchaseReceiptNoteApp;
+ _putawayNoteApp = putawayNoteApp;
+ _supplierApp = supplierApp;
+ _itemSafetyStockApp = itemSafetyStockApp;
+ _purchaseOrderApp = purchaseOrderApp;
+ _purchaseReceiptJobApp = purchaseReceiptJobApp;
+ }
- private async Task> GetPlanAndActualDashboardsAsync()
- {
- var supplierAsns = await GetSupplierAsnsAsync().ConfigureAwait(false);
- var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct();
+ [HttpGet("plan-actual-list")]
+ public virtual async Task> GetPlanAndActualListAsync()
+ {
+ return await GetPlanAndActualDashboardsAsync();
+ }
- var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false);
+ private async Task> GetPlanAndActualDashboardsAsync()
+ {
+ var supplierAsns = await this.GetSupplierAsnsAsync();
- var asnNumbers = supplierAsns.Select(t => t.Number);
+ var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct();
- var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers).ConfigureAwait(false);
+ var suppliers = await GetSuppliersAsync(supplierCodes);
- var putawayNotes = await GetPutawayNotesAsync(asnNumbers).ConfigureAwait(false);
+ var asnNumbers = supplierAsns.Select(t => t.Number);
- var itemSafetyStorks = await GetItemSafetyStocksAsync(supplierAsns).ConfigureAwait(false);
+ var purchaseReceiptNotes = await GetPurchaseReceiptNotesAsync(asnNumbers);
- return ConvertToPlanAndActualDashboards(
- supplierAsns,
- suppliers,
- purchaseReceiptNotes,
- putawayNotes,
- itemSafetyStorks);
- }
+ var putawayNotes = await this.GetPutawayNotesAsync(asnNumbers);
- private static List ConvertToPlanAndActualDashboards(List supplierAsns, List suppliers, List purchaseReceiptNotes, List putawayNotes, List itemSafetyStorks)
- {
- var dtos = new List();
+ var itemSafetyStorks = await this.GetItemSafetyStocksAsync(supplierAsns);
+
+ return await this.ConvertToPlanAndActualDashboards(
+ supplierAsns,
+ suppliers,
+ purchaseReceiptNotes,
+ putawayNotes,
+ itemSafetyStorks);
+ }
- foreach (var supplierAsn in supplierAsns)
+ private async Task> ConvertToPlanAndActualDashboards(List supplierAsns, List suppliers, List purchaseReceiptNotes, List putawayNotes, List itemSafetyStorks)
{
- var purchaseReceipts = purchaseReceiptNotes.FindAll(t => t.AsnNumber == supplierAsn.Number);
- var putaways = putawayNotes.FindAll(t => t.AsnNumber == supplierAsn.Number);
+ var dtos = new List();
- var supplierShortName = string.Empty;
+ foreach (var supplierAsn in supplierAsns)
+ {
+ var purchaseReceipts = purchaseReceiptNotes.FindAll(t => t.AsnNumber == supplierAsn.Number);
+ var putaways = putawayNotes.FindAll(t => t.AsnNumber == supplierAsn.Number);
- var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
+ var supplierShortName = string.Empty;
- if (supplier == null)
- {
- continue;
- }
+ var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
- supplierShortName = supplier.ShortName;
+ if (supplier == null)
+ continue;
- foreach (var detail in supplierAsn.Details)
- {
- var dto = dtos.FirstOrDefault(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode);
+ supplierShortName = supplier.ShortName;
- if (dto == null)
+ foreach (var detail in supplierAsn.Details)
{
- dto = new PlanAndActualDashboardDto();
+ var dto = dtos.FirstOrDefault(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode);
- dto.SupplierShortName = supplierShortName;
- dto.ItemCode = detail.ItemCode;
- dto.ItemDesc1 = detail.ItemDesc1;
- dto.ItemName = detail.ItemName;
+ if (dto == null)
+ {
+ dto = new PlanAndActualDashboardDto();
- var itemSafetyStork = itemSafetyStorks.FirstOrDefault(t => t.ItemCode == detail.ItemCode);
+ dto.SupplierShortName = supplierShortName;
+ dto.ItemCode = detail.ItemCode;
+ dto.ItemDesc1 = detail.ItemDesc1;
+ dto.ItemName = detail.ItemName;
- if (itemSafetyStork != null)
- {
- dto.MaxQty = itemSafetyStork.MaxStock;
- dto.MinQty = itemSafetyStork.MinStock;
- }
+ var itemSafetyStork = itemSafetyStorks.FirstOrDefault(t => t.ItemCode == detail.ItemCode);
- dto.ReceiptNoteCount = CountReceiptNoteCount(purchaseReceipts, detail.ItemCode, detail.Lot);
- dto.ReceiptQty = CountReceiptQty(purchaseReceipts, detail.ItemCode, detail.Lot);
- dto.PutawayQty = CountPutawayQty(putawayNotes, detail.ItemCode, detail.Lot);
+ if (itemSafetyStork != null)
+ {
+ dto.MaxQty = itemSafetyStork.MaxStock;
+ dto.MinQty = itemSafetyStork.MinStock;
+ }
- dtos.Add(dto);
- }
+ var purchaseOrderDtos = await _purchaseOrderApp.GetListBySupplierCodeAsync(supplierAsn.SupplierCode, detail.ItemCode);
+ var supllierAsn = await _supplierAsnApp.GetForTodayListAsync();
+ var poNumberList = supllierAsn.Select(p => p.PoNumber).ToList();
- dto.SupplierAsnCount += 1;
+ purchaseOrderDtos = purchaseOrderDtos.Where(p => poNumberList.Contains(p.Number)).ToList();
- dto.PlanArriveQty += detail.Qty;
- }
- }
- return dtos.OrderBy(t => t.SupplierShortName).ToList();
- }
+ decimal allPutawayQty = 0;
+ decimal allReceiptQty = 0;
+ decimal allPlanArriveQty = 0;
- private static decimal CountPutawayQty(List putawayNotes, string itemCode, string lot)
- {
- return putawayNotes.Sum(t => t.Details.Where(t => t.ItemCode == itemCode && t.ToLot == lot).Sum(t => t.Qty));
- }
+ 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);
+ }
- private static decimal CountReceiptQty(List purchaseReceipts, string itemCode, string lot)
- {
- return purchaseReceipts.Sum(t => t.Details.Where(t => t.ItemCode == itemCode && t.HandledLot == lot).Sum(t => t.Qty));
- }
+ dto.PutawayQty = allPutawayQty;
+ dto.PlanArriveQty = allPlanArriveQty;
+ dto.ReceiptQty = allReceiptQty;
- private static int CountReceiptNoteCount(List purchaseReceipts, string itemCode, string lot)
- {
- return purchaseReceipts.Sum(t => t.Details.Count(t => t.ItemCode == itemCode && t.Lot == lot));
- }
+ dtos.Add(dto);
+ }
- private async Task> GetSupplierAsnsAsync()
- {
- var startTime = DateTime.Today.AddHours(DashboardConst.AsnReceiptTimeLimitHour);
+ var purchaseReceiptJobDtos = await _purchaseReceiptJobApp.GetListBySupplierCodeOnTodayAsync(supplierAsn.SupplierCode);
+
+ dto.ReceiptNoteCount = purchaseReceiptJobDtos.Count(p => p.JobStatus == EnumJobStatus.Done);
- var endTime = startTime.AddDays(1).AddSeconds(-1);
+ dto.SupplierAsnCount = purchaseReceiptJobDtos.Count();
+ }
+ }
+
+ return dtos.OrderBy(t => t.SupplierShortName).ToList();
+ }
- if (DateTime.Now.Hour < DashboardConst.AsnReceiptTimeLimitHour)
+ private decimal CountReceiptQty(List purchaseReceipts, string itemCode)
{
- startTime.AddDays(-1);
- endTime.AddDays(-1);
+ return purchaseReceipts.Sum(t => t.Details.Where(t => t.ItemCode == itemCode).Sum(t => t.Qty));
}
- return await _supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime).ConfigureAwait(false);
- }
+ private int CountReceiptNoteCount(List purchaseReceipts, string itemCode)
+ {
+ return purchaseReceipts.Sum(t => t.Details.Count(t => t.ItemCode == itemCode));
+ }
- private async Task> GetSuppliersAsync(IEnumerable codes)
- {
- return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false);
- }
+ private async Task> GetSupplierAsnsAsync()
+ {
+ var startTime = DateTime.Today.AddHours(DashboardConst.AsnReceiptTimeLimitHour);
- private async Task> GetPurchaseReceiptNotesAsync(IEnumerable asnNumbers)
- {
- return await _purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false);
- }
+ var endTime = startTime.AddDays(1).AddSeconds(-1);
- private async Task> GetPutawayNotesAsync(IEnumerable asnNumbers)
- {
- return await _putawayNoteApp.GetListByAsnNumbers(asnNumbers).ConfigureAwait(false);
- }
- private async Task> GetItemSafetyStocksAsync(List supplierAsns)
- {
- var itemCodes = new List();
+ if (DateTime.Now.Hour < DashboardConst.AsnReceiptTimeLimitHour)
+ {
+ startTime.AddDays(-1);
+ endTime.AddDays(-1);
+ }
- supplierAsns.ForEach(t => { itemCodes.AddRange(t.Details.Select(t => t.ItemCode).ToList()); });
+ return await this._supplierAsnApp.GetByStartTimeEndTimeAsync(startTime, endTime);
+ }
- var itemSafetyStorks = await _itemSafetyStockApp.GetByItemCodesAsync(itemCodes).ConfigureAwait(false);
- return itemSafetyStorks;
+ private async Task> GetSuppliersAsync(IEnumerable codes)
+ {
+ return await this._supplierApp.GetByCodesAsync(codes);
+ }
+
+ private async Task> GetPurchaseReceiptNotesAsync(IEnumerable asnNumbers)
+ {
+ return await this._purchaseReceiptNoteApp.GetListByAsnNumbers(asnNumbers);
+ }
+
+ private async Task> GetPutawayNotesAsync(IEnumerable asnNumbers)
+ {
+ return await this._putawayNoteApp.GetListByAsnNumbers(asnNumbers);
+ }
+ private async Task> GetItemSafetyStocksAsync(List supplierAsns)
+ {
+ var itemCodes = new List();
+
+ supplierAsns.ForEach(t => { itemCodes.AddRange(t.Details.Select(t => t.ItemCode).ToList()); });
+
+ var itemSafetyStorks = await this._itemSafetyStockApp.GetByItemCodesAsync(itemCodes);
+ return itemSafetyStorks;
+ }
}
}
diff --git a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs
index d4ff0307c..6ecbf7f47 100644
--- a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs
+++ b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Controllers/PurchaseReceiptController.cs
@@ -5,233 +5,255 @@ using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Wms.Dashboard.Host.Models;
-namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers;
-
-using System.Linq;
+namespace Win_in.Sfs.Wms.Dashboard.Host.Controllers
+{
+ using System;
+ using System.Linq;
-using Win_in.Sfs.Label.Application.Contracts;
-using Win_in.Sfs.Shared.Domain.Shared;
-using Win_in.Sfs.Wms.Inventory.Application.Contracts;
-using Win_in.Sfs.Wms.Store.Application.Contracts;
+ using Volo.Abp;
-[ApiController]
-[Route($"{PdaHostConst.ROOT_ROUTE}purchase-receipt")]
+ 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;
-public class PurchaseReceiptController : AbpController
-{
- private readonly IBalanceAppService _balanceApp;
- private readonly IInventoryLabelAppService _labelService;
- private readonly ISupplierAppService _supplierApp;
- private readonly ISupplierAsnAppService _supplierAsnApp;
+ [ApiController]
+ [Route($"{PdaHostConst.ROOT_ROUTE}purchase-receipt")]
- public PurchaseReceiptController(IBalanceAppService balanceApp, IInventoryLabelAppService labelService, ISupplierAppService supplierApp, ISupplierAsnAppService supplierAsnApp)
+ public class PurchaseReceiptController : AbpController
{
- this._balanceApp = balanceApp;
- this._labelService = labelService;
- this._supplierApp = supplierApp;
- this._supplierAsnApp = supplierAsnApp;
- }
+ private readonly IBalanceAppService _balanceApp;
+ 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, 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 GetReceiptSumQtyAsync()
- {
- var dto = new PurchaseReceiptSumQtyDashboardDto();
+ ///
+ /// 未上架数量
+ ///
+ ///
+ [HttpGet("no-put-away-sum-qty")]
+ public virtual async Task GetNoPutAwaySumQtyAsync()
+ {
+ var dto = new PurchaseReceiptSumQtyDashboardDto();
- var items = await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
+ var items = await GetPurchaseReceiptItemDashboardAsync();
- dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) };
+ dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) };
- return dto;
- }
+ return dto;
+ }
- [HttpGet("receipt-count-by-supplier")]
- public virtual async Task> GetReceiptCountBySupplierQtyAsync()
- {
- var items = await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
+ ///
+ /// 未上架汇总
+ ///
+ ///
+ [HttpGet("no-put-away-by-supplier")]
+ public virtual async Task> GetNoPutAwayBySupplierAsync()
+ {
+ var items = await GetPurchaseReceiptItemDashboardAsync();
- var dtos = items.GroupBy(t => t.SupplierShortName)
- .Select(
- t => new PurchaseReceiptCountBySupplierDashboardDto
- {
- SupplierShortName = t.Key,
- Qty = t.Sum(t1 => t1.Qty)
- }).OrderBy(t => t.SupplierShortName).ToList();
+ var dtos = items.GroupBy(t => t.SupplierShortName)
+ .Select(
+ t => new PurchaseReceiptCountBySupplierDashboardDto
+ {
+ SupplierShortName = t.Key,
+ Qty = t.Sum(t1 => t1.Qty)
+ }).OrderBy(t => t.SupplierShortName).ToList();
- return dtos;
- }
+ return dtos;
+ }
- [HttpGet("receipt-item-list")]
- public virtual async Task> GetReceiptItemListAsync()
- {
- return await GetPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
- }
+ ///
+ /// 未上架明细
+ ///
+ ///
+ [HttpGet("no-put-away-item-list")]
+ public virtual async Task> GetReceiptItemListAsync()
+ {
+ return await GetPurchaseReceiptItemDashboardAsync();
+ }
- [HttpGet("un-receipt-sum-qty")]
- public virtual async Task GetUnReceiptSumQtyAsync()
- {
- var dto = new PurchaseReceiptSumQtyDashboardDto();
+ [HttpGet("un-receipt-sum-qty")]
+ public virtual async Task GetUnReceiptSumQtyAsync()
+ {
+ var dto = new PurchaseReceiptSumQtyDashboardDto();
- var items = await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
+ var items = await this.GetUnPurchaseReceiptItemDashboardAsync();
- dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) };
+ dto = new PurchaseReceiptSumQtyDashboardDto() { Qty = items.Sum(t => t.Qty) };
- return dto;
- }
+ return dto;
+ }
- [HttpGet("un-receipt-count-by-supplier")]
- public virtual async Task> GetUnReceiptCountBySupplierQtyAsync()
- {
- var items = await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
+ [HttpGet("un-receipt-count-by-supplier")]
+ public virtual async Task> GetUnReceiptCountBySupplierQtyAsync()
+ {
+ var items = await GetUnPurchaseReceiptItemDashboardAsync();
- var dtos = items.GroupBy(t => t.SupplierShortName)
- .Select(
- t => new PurchaseReceiptCountBySupplierDashboardDto
- {
- SupplierShortName = t.Key,
- Qty = t.Sum(t1 => t1.Qty)
- }).OrderBy(t => t.SupplierShortName).ToList();
+ var dtos = items.GroupBy(t => t.SupplierShortName)
+ .Select(
+ t => new PurchaseReceiptCountBySupplierDashboardDto
+ {
+ SupplierShortName = t.Key,
+ Qty = t.Sum(t1 => t1.Qty)
+ }).OrderBy(t => t.SupplierShortName).ToList();
- return dtos;
- }
+ return dtos;
+ }
- [HttpGet("un-receipt-item-list")]
- public virtual async Task> GetUnReceiptItemListAsync()
- {
- return await GetUnPurchaseReceiptItemDashboardAsync().ConfigureAwait(false);
- }
+ [HttpGet("un-receipt-item-list")]
+ public virtual async Task> GetUnReceiptItemListAsync()
+ {
+ return await this.GetUnPurchaseReceiptItemDashboardAsync();
+ }
- private async Task> GetPurchaseReceiptItemDashboardAsync()
- {
- var balances = await GetBalancesAsync("INSPECT", EnumInventoryStatus.OK).ConfigureAwait(false);
+ private async Task> GetPurchaseReceiptItemDashboardAsync()
+ {
+ var inspectNoteDetailDto = await _inspectNoteAppService.GetInspectNoteDetailByToDayTaskAsync();
+ var packingCodeList = inspectNoteDetailDto.Where(p => p.Status == EnumInventoryStatus.OK).Select(p => p.PackingCode).ToList();
+ var balances = await _balanceApp.GetListByPackingCodesAsync(packingCodeList);
+ balances = balances.Where(p => p.LocationCode == "INSPECT").ToList();
- var packingcodes = balances.Select(t => t.PackingCode).Distinct();
+ //var balances = await GetBalancesAsync("INSPECT", EnumInventoryStatus.OK);
- var labels = await GetLabelsAsync(packingcodes).ConfigureAwait(false);
+ var packingcodes = balances.Select(t => t.PackingCode).Distinct();
- var supplierCodes = labels.Select(t => t.SupplierCode).Distinct();
+ var labels = await GetLabelsAsync(packingcodes);
- var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false);
+ var supplierCodes = labels.Select(t => t.SupplierCode).Distinct();
- return ConvertToPurchaseReceiptItemDashboard(balances, labels, suppliers);
- }
+ var suppliers = await GetSuppliersAsync(supplierCodes);
- private static List ConvertToPurchaseReceiptItemDashboard(
- List balances,
- List labels,
- List suppliers)
- {
- var dtos = new List();
+ return ConvertToPurchaseReceiptItemDashboard(balances, labels, suppliers);
+ }
- foreach (var balance in balances)
+ private List ConvertToPurchaseReceiptItemDashboard(
+ List balances,
+ List labels,
+ List suppliers)
{
- var supplierShortName = string.Empty;
+ var dtos = new List();
- var label = labels.FirstOrDefault(t => t.Code == balance.PackingCode);
-
- if (label == null)
+ foreach (var balance in balances)
{
- continue;
- }
+ var supplierShortName = string.Empty;
- var supplier = suppliers.FirstOrDefault(t => t != null && t.Code == label.SupplierCode);
+ var label = labels.FirstOrDefault(t => t.Code == balance.PackingCode);
- if (supplier == null)
- {
- continue;
- }
+ if (label == null)
+ continue;
- supplierShortName = supplier.ShortName;
+ var supplier = suppliers.FirstOrDefault(t => t != null && t.Code == label.SupplierCode);
- var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == balance.ItemCode);
+ if (supplier == null)
+ continue;
- if (dto == null)
- {
- dto = new PurchaseReceiptItemDashboardDto();
+ supplierShortName = supplier.ShortName;
- dto.SupplierShortName = supplierShortName;
- dto.ItemCode = balance.ItemCode;
- dto.ItemDesc1 = balance.ItemDesc1;
- dto.Qty = 0;
+ var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == balance.ItemCode);
- dtos.Add(dto);
- }
+ if (dto == null)
+ {
+ dto = new PurchaseReceiptItemDashboardDto();
- dto.Qty += balance.Qty;
- }
+ dto.SupplierShortName = supplierShortName;
+ dto.ItemCode = balance.ItemCode;
+ dto.ItemDesc1 = balance.ItemDesc1;
+ dto.Qty = 0;
- return dtos.OrderBy(t => t.SupplierShortName).ToList();
- }
+ dtos.Add(dto);
+ }
- private async Task> GetBalancesAsync(string locationCode, EnumInventoryStatus status)
- {
- return await _balanceApp.GetListByLocationCodeAndStatusAsync(locationCode, status).ConfigureAwait(false);
- }
- private async Task> GetLabelsAsync(IEnumerable codes)
- {
- return await _labelService.GetByCodesAsync(codes).ConfigureAwait(false);
- }
- private async Task> GetSuppliersAsync(IEnumerable codes)
- {
- return await _supplierApp.GetByCodesAsync(codes).ConfigureAwait(false);
- }
+ dto.Qty += balance.Qty;
+ }
- private async Task> GetSupplierAsnsAsync()
- {
- return await _supplierAsnApp.GetForTodayUnReceivedListAsync().ConfigureAwait(false);
- }
+ return dtos.OrderBy(t => t.SupplierShortName).ToList();
+ }
- private static List ConvertToUnPurchaseReceiptItemDashboard(
- List supplierAsns,
- List suppliers)
- {
- var dtos = new List();
+ private async Task> GetBalancesAsync(string locationCode, EnumInventoryStatus status)
+ {
+ return await this._balanceApp.GetListByLocationCodeAndStatusAsync(locationCode, status);
+ }
+ private async Task> GetLabelsAsync(IEnumerable codes)
+ {
+ return await this._labelService.GetByCodesAsync(codes);
+ }
+ private async Task> GetSuppliersAsync(IEnumerable codes)
+ {
+ return await this._supplierApp.GetByCodesAsync(codes);
+ }
- foreach (var supplierAsn in supplierAsns)
+ private async Task> GetSupplierAsnsAsync()
{
- var supplierShortName = string.Empty;
+ return await this._supplierAsnApp.GetForTodayUnReceivedListAsync();
+ }
- var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
+ private List ConvertToUnPurchaseReceiptItemDashboard(
+ List supplierAsns,
+ List suppliers)
+ {
+ var dtos = new List();
- if (supplier == null)
+ foreach (var supplierAsn in supplierAsns)
{
- continue;
- }
+ var supplierShortName = string.Empty;
- supplierShortName = supplier.ShortName;
+ var supplier = suppliers.FirstOrDefault(t => t.Code == supplierAsn.SupplierCode);
- foreach (var detail in supplierAsn.Details)
- {
- var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode);
+ if (supplier == null)
+ continue;
- if (dto == null)
+ supplierShortName = supplier.ShortName;
+
+ foreach (var detail in supplierAsn.Details)
{
- dto = new PurchaseReceiptItemDashboardDto();
+ var dto = dtos.Find(t => t.SupplierShortName == supplierShortName && t.ItemCode == detail.ItemCode);
- dto.SupplierShortName = supplierShortName;
- dto.ItemCode = detail.ItemCode;
- dto.ItemDesc1 = detail.ItemDesc1;
- dto.Qty = 0;
+ if (dto == null)
+ {
+ dto = new PurchaseReceiptItemDashboardDto();
- dtos.Add(dto);
- }
+ dto.SupplierShortName = supplierShortName;
+ dto.ItemCode = detail.ItemCode;
+ dto.ItemDesc1 = detail.ItemDesc1;
+ dto.Qty = 0;
+
+ dtos.Add(dto);
+ }
- dto.Qty += detail.Qty;
+ dto.Qty += detail.Qty;
+ }
}
- }
- return dtos.OrderBy(t => t.SupplierShortName).ToList();
- }
+ return dtos.OrderBy(t => t.SupplierShortName).ToList();
+ }
- private async Task> GetUnPurchaseReceiptItemDashboardAsync()
- {
- var dtos = new List();
+ private async Task> GetUnPurchaseReceiptItemDashboardAsync()
+ {
+ var dtos = new List();
- var supplierAsns = await GetSupplierAsnsAsync().ConfigureAwait(false);
+ var supplierAsns = await this.GetSupplierAsnsAsync();
- var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct();
+ var supplierCodes = supplierAsns.Select(t => t.SupplierCode).Distinct();
- var suppliers = await GetSuppliersAsync(supplierCodes).ConfigureAwait(false);
+ var suppliers = await GetSuppliersAsync(supplierCodes);
- return ConvertToUnPurchaseReceiptItemDashboard(supplierAsns, suppliers);
+ return this.ConvertToUnPurchaseReceiptItemDashboard(supplierAsns, suppliers);
+ }
}
+
+
}
diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql
index 8cbecdc09..9e908aedd 100644
--- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql
+++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql
@@ -1863,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,
@@ -3069,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,
@@ -5068,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,
@@ -5698,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])
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Accounts/AccountController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Accounts/AccountController.cs
index dbaf0e54a..3c2da6dba 100644
--- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Accounts/AccountController.cs
+++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Accounts/AccountController.cs
@@ -21,7 +21,7 @@ using PdaMenuGroupDto = Win_in.Sfs.Wms.Pda.Models.PdaMenuGroupDto;
namespace Win_in.Sfs.Wms.Pda.Controllers.Accounts;
///
-///
+///
///
[AllowAnonymous]
[ApiController]
@@ -38,12 +38,15 @@ public class AccountController : AbpController
private readonly ILogger _logger;
///
- ///
+ ///
///
///
///
///
///
+ ///
+ ///
+ ///
public AccountController(IProfileAppService profileAppService
, ITokenService tokenService
, IUserMenuAppService userMenuAppService
@@ -59,13 +62,22 @@ public class AccountController : AbpController
_logger = logger;
}
+ ///
+ ///
+ ///
[Display]
public class LoginModel
{
+ ///
+ ///
+ ///
[Display]
[Required]
public string UserName { get; set; }
+ ///
+ ///
+ ///
[Display]
[Required]
public string Password { get; set; }
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs
index 4c5488710..444f4c83c 100644
--- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs
+++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs
@@ -39,6 +39,7 @@ public class BalanceController : AbpController
///
///
///
+ ///
public BalanceController(
IBalanceAppService balanceAppService,
IItemBasicAppService itemBasicAppService,
@@ -440,7 +441,7 @@ public class BalanceController : AbpController
public async Task> GetListByLocationTypeAndInventoryStatusAndNotExpectOutAsync(
BalanceListByIssueInputByInventoryStatusAndLocationType listInput)
{
- var expectOut = await _expectOutAppService.GetListByPackingCodeAsync(listInput.packingCode);
+ var expectOut = await _expectOutAppService.GetListByPackingCodeAsync(listInput.packingCode).ConfigureAwait(false);
if (expectOut != null && expectOut.Any())
{
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs
index ead6be2c7..b6d428c62 100644
--- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs
+++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs
@@ -71,7 +71,7 @@ public class JobController : AbpController
///
///
[HttpGet("")]
- public virtual async Task> CountAsync()
+ public virtual async Task> CountAsync(bool isToday)
{
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
@@ -146,7 +146,7 @@ public class JobController : AbpController
}).ConfigureAwait(false);
list.Add(new JobCountDto { JobType = EnumJobType.ProductReceiveJob, Count = productReceiveJobs });
- var purchaseReceiptJobs = await _purchaseReceiptJobAppService.GetCountByFilterAsync(new SfsJobRequestInputBase
+ var purchaseReceiptJobRequest = new SfsJobRequestInputBase
{
Condition = new Condition
{
@@ -156,8 +156,12 @@ public class JobController : AbpController
new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In")
}
}
- }).ConfigureAwait(false);
- list.Add(new JobCountDto { JobType = EnumJobType.PurchaseReceiptJob, Count = purchaseReceiptJobs });
+ };
+ if (isToday)//只看当日
+ {
+ purchaseReceiptJobRequest.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.ToString("yyyy-MM-dd"), ">=", "And"));
+ purchaseReceiptJobRequest.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.AddDays(1).ToString("yyyy-MM-dd"), "<=", "And"));
+ }
var purchaseReturnJobs = await _purchaseReturnJobAppService.GetCountByFilterAsync(new SfsJobRequestInputBase
{
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs
index dc0477c94..d9b57eb5d 100644
--- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs
+++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs
@@ -32,9 +32,7 @@ public class PurchaseReceiptJobController : AbpController
///
///
///
- ///
///
- ///
public PurchaseReceiptJobController(
IPurchaseReceiptJobAppService purchaseReceiptJobAppService
, IUserWorkGroupAppService userWorkGroupAppService
@@ -53,7 +51,7 @@ public class PurchaseReceiptJobController : AbpController
[HttpGet("{id}")]
public virtual async Task> GetAsync(Guid id)
{
- var result = await _purchaseReceiptJobAppService.GetNoCacheAsync(id).ConfigureAwait(false);
+ var result = await _purchaseReceiptJobAppService.GetAsync(id).ConfigureAwait(false);
var supplier = await _supplierAppService.GetByCodeAsync(result.SupplierCode).ConfigureAwait(false);
result.SupplierName = supplier.Name;
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs
index 450e9326c..86c329304 100644
--- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs
+++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs
@@ -33,7 +33,7 @@ public class IssueNoteController : AbpController
[HttpPost("")]
public virtual async Task CreateAsync([FromBody] IssueNoteEditInput input)
{
- input.RequestType = EnumMaterialRequestType.Direct_Issue.ToString();
+ input.RequestType = EnumMaterialRequestType.Issue_Direct.ToString();
input.Details.ForEach(p =>
{
@@ -54,5 +54,4 @@ public class IssueNoteController : AbpController
{
return await _issueNoteAppService.ConfirmAsync(id).ConfigureAwait(false);
}
-
}
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs
index a3b534eaa..6b6a9fd09 100644
--- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs
+++ b/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 CreateProductRecycleNoteWithL7Async(ProductRecycleNoteEditInput input)
{
- return await _productRecycleNoteAppService.CreateWithL7Async(input).ConfigureAwait(false);
+ return await _productRecycleNoteAppService.CreateAsync(input).ConfigureAwait(false);
}
///
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs
index 0fd4dd012..c5682b153 100644
--- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs
+++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs
@@ -26,7 +26,7 @@ public class RecycledMaterialReceiptNoteController : AbpController
}
///
- /// 获取盘点任务详情
+ /// 回收料调整
///
///
///
diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/TestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/TestController.cs
deleted file mode 100644
index 3c8af2a80..000000000
--- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/TestController.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Volo.Abp.Account;
-using Volo.Abp.Application.Services;
-using Volo.Abp.AspNetCore.Mvc;
-using Win_in.Sfs.Auth.Application.Contracts;
-using Win_in.Sfs.Wms.Pda.Authenticaitons;
-using Win_in.Sfs.Wms.Pda.Models;
-using PdaMenuDto = Win_in.Sfs.Wms.Pda.Models.PdaMenuDto;
-using PdaMenuGroupDto = Win_in.Sfs.Wms.Pda.Models.PdaMenuGroupDto;
-
-namespace Win_in.Sfs.Wms.Pda.Controllers.Accounts;
-
-///
-///
-///
-[AllowAnonymous]
-[ApiController]
-[Route($"{PdaHostConst.ROOT_ROUTE}asfasf")]
-
-public class TestController: AbpController
-{
- //private readonly IProfileAppService _profileAppService;
- //private readonly ITokenService _tokenService;
- private readonly IUserMenuAppService _userMenuAppService;
- //private readonly IUserWorkGroupAppService _userWorkGroupAppService;
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public TestController(
- IUserMenuAppService userMenuAppService
- , IUserWorkGroupAppService userWorkGroupAppService
- )
- {
- //_profileAppService = profileAppService;
- //_tokenService = tokenService;
- _userMenuAppService = userMenuAppService;
- //_userWorkGroupAppService = userWorkGroupAppService;
- }
-
- ///
- /// Test
- ///
- ///
- [HttpGet("Test")]
- public virtual async Task> Test()
- {
- return new List() { "sdfsdf'" };
- }
-}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs
index 43aadd97c..ee648999a 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Uoms/Inputs/UomImportInput.cs
@@ -19,6 +19,7 @@ public class UomImportInput : SfsBaseDataImportInputBase
/// 名称
///
[Display(Name = "名称")]
+ [Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Name { get; set; }
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs
new file mode 100644
index 000000000..211d70c8c
--- /dev/null
+++ b/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
+{
+ ///
+ /// 物品代码
+ ///
+ [Display(Name = "物品代码")]
+ public string ItemCode { get; set; }
+ ///
+ /// ERP库位
+ ///
+ [Display(Name = "ERP库位")]
+ public string LocationErpCode { get; set; }
+ ///
+ /// 原因代码
+ ///
+ [Display(Name = "原因代码")]
+ public string ReasonCode { get; set; }
+ ///
+ /// 调整数量
+ ///
+ [Display(Name = "来源数量")]
+ public decimal FromQty { get; set; }
+ ///
+ /// 目标数量
+ ///
+ [Display(Name = "目标数量")]
+ public decimal ToQty { get; set; }
+ ///
+ /// 目标库位
+ ///
+ [Display(Name = "目标库位")]
+ [Required(ErrorMessage = "{0}是必填项")]
+ public string ToLocationCode { get; set; }
+ ///
+ /// 目标物品代码
+ ///
+ [Display(Name = "目标物品代码")]
+ public string ToItemCode { get; set; }
+
+}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteExchangeDto.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteExchangeDto.cs
new file mode 100644
index 000000000..64c529b77
--- /dev/null
+++ b/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
+{
+ ///
+ /// 单据号
+ ///
+ public string Number { get; set; }
+ ///
+ /// 生效日期
+ ///
+ public DateTime ActiveDate { get; set; } = DateTime.Now.Date;
+ ///
+ /// 操作员
+ ///
+ public string Worker { get; set; }
+
+ ///
+ /// 类型
+ ///
+ public string Type { get; set; }
+
+ ///
+ /// 明细
+ ///
+ [Display(Name = "明细")]
+ public ItemTransformNoteDetailExchangeDto Detail { get; set; } = new();
+}
diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs
index e30d65560..68b010434 100644
--- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/TransferLogs/TransferLogAppService.cs
+++ b/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")]
diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs
index 7eb2e6173..a7babf41a 100644
--- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs
+++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs
@@ -105,6 +105,15 @@ public class BalanceManager : DomainService, IBalanceManager
}
else
{
+ if (existBalance.IsActive == false)
+ {
+ throw new UserFriendlyException($"库位在{existBalance.LocationCode}," +
+ $"物品编号为{existBalance.ItemCode}," +
+ $"箱码为{existBalance.PackingCode}," +
+ $"批次为{existBalance.Lot}," +
+ $"状态为{existBalance.Status.GetDisplayName()}" +
+ $"的库存是不可用状态");
+ }
//如果单件管理的库存已存在,报错
transaction.CheckSingleUnitHasExist();
existBalance.IncreaseQty(transaction.Qty);
@@ -202,6 +211,16 @@ public class BalanceManager : DomainService, IBalanceManager
}
else
{
+ if (existBalance.IsActive == false)
+ {
+ throw new UserFriendlyException($"库位在{existBalance.LocationCode}," +
+ $"物品编号为{existBalance.ItemCode}," +
+ $"箱码为{existBalance.PackingCode}," +
+ $"批次为{existBalance.Lot}," +
+ $"状态为{existBalance.Status}" +
+ $"的库存是不可用状态");
+ }
+
existBalance.IncreaseQty(transaction.Qty);
switch (existBalance.Qty)
{
@@ -244,6 +263,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;
@@ -423,9 +452,12 @@ public class BalanceManager : DomainService, IBalanceManager
expression = expression.And(p => p.ExpireDate > DateTime.Now);
}
//筛选有效库区
- if (validLocationAreas.Any())
+ if (validLocationAreas.Any() )
{
- expression = expression.And(p => validLocationAreas.Contains(p.LocationArea));
+ if (!string.IsNullOrEmpty(validLocationAreas[0]))
+ {
+ expression = expression.And(p => validLocationAreas.Contains(p.LocationArea));
+ }
}
var allBalances = await
(await _balanceRepository.GetDbSetAsync().ConfigureAwait(false))
diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs
index d2dc012b1..723b2350c 100644
--- a/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs
+++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs
@@ -207,4 +207,11 @@ public class InventoryLabelWithoutCodeCreateInput
[Display(Name = "要求到货时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime PlanArriveDate { get; set; }
+
+ ///
+ /// 备注
+ ///
+ [Display(Name = "备注")]
+ public string Remark { get; set; }
+
}
diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/Bases/SfsLabelAppServiceWithCodeBase.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/Bases/SfsLabelAppServiceWithCodeBase.cs
index 312404b9c..033bb43b3 100644
--- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/Bases/SfsLabelAppServiceWithCodeBase.cs
+++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/Bases/SfsLabelAppServiceWithCodeBase.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -38,10 +39,12 @@ public class SfsLabelAppServiceWithCodeBase GetByCodeAsync(string code)
{
- var dto = await Cache.GetOrAddItemAsync(
- $"{typeof(TEntityDto).Name}:{code}".ToString(),
- async () => await GetFromRepositoryAsync(code).ConfigureAwait(false),
- SfsCacheConst.SeveralMinutes).ConfigureAwait(false);
+ // var dto = await Cache.GetOrAddItemAsync(
+ // $"{typeof(TEntityDto).Name}:{code}".ToString(),
+ // async () => await GetFromRepositoryAsync(code).ConfigureAwait(false),
+ // SfsCacheConst.SeveralMinutes).ConfigureAwait(false);
+
+ var dto = await GetFromRepositoryAsync(code).ConfigureAwait(false);
return dto;
}
@@ -50,18 +53,22 @@ public class SfsLabelAppServiceWithCodeBase> GetByCodesAsync(IEnumerable codes)
{
- var dtoList = new List();
- foreach (var code in codes)
- {
- var dto = await Cache.GetOrAddItemAsync(
- $"{typeof(TEntityDto).Name}:{code}".ToString(),
- async () => await GetFromRepositoryAsync(code).ConfigureAwait(false),
- SfsCacheConst.SeveralMinutes).ConfigureAwait(false);
- if (dto != null)
- {
- dtoList.Add(dto);
- }
- }
+ // var dtoList = new List();
+ // foreach (var code in codes)
+ // {
+ // var dto = await Cache.GetOrAddItemAsync(
+ // $"{typeof(TEntityDto).Name}:{code}".ToString(),
+ // async () => await GetFromRepositoryAsync(code).ConfigureAwait(false),
+ // SfsCacheConst.SeveralMinutes).ConfigureAwait(false);
+ // if (dto != null)
+ // {
+ // dtoList.Add(dto);
+ // }
+ // }
+ // return dtoList;
+
+ var entities = await _repository.GetListAsync(p => codes.Contains(p.Code)).ConfigureAwait(false);
+ var dtoList = ObjectMapper.Map, List>(entities);
return dtoList;
}
diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs
index 76770e7eb..e88e07199 100644
--- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs
+++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@@ -15,6 +16,7 @@ using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Label.Domain;
using Win_in.Sfs.Label.Domain.Shared;
using Win_in.Sfs.Shared.Application.Contracts;
+using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Label.Application;
@@ -33,12 +35,14 @@ public class InventoryLabelAppService
private new readonly IInventoryLabelRepository _repository;
private readonly ISupplierAppService _supplierAppService;
private readonly ISupplierItemAppService _supplierItemAppService;
+ private readonly IItemBasicAppService _itemBasicAppService;
public InventoryLabelAppService(
IInventoryLabelRepository repository, ILabelDefinitionManager labelDefinitionManager
, ISupplierAppService supplierAppService
, IItemPackAppService itemPackAppService
, ISupplierItemAppService supplierItemAppService
+ , IItemBasicAppService itemBasicAppService
) : base(repository)
{
_repository = repository;
@@ -46,6 +50,7 @@ public class InventoryLabelAppService
_supplierAppService = supplierAppService;
_itemPackAppService = itemPackAppService;
_supplierItemAppService = supplierItemAppService;
+ _itemBasicAppService = itemBasicAppService;
}
[HttpPost("")]
@@ -60,6 +65,45 @@ public class InventoryLabelAppService
return await base.CreateAsync(input).ConfigureAwait(false);
}
+ ///
+ /// 按Id获取实体
+ ///
+ /// 实体Id
+ ///
+ [HttpGet("{id}")]
+ public override async Task GetAsync(Guid id)
+ {
+ var dto = await base.GetAsync(id).ConfigureAwait(false);
+
+ if (dto != null)
+ {
+ var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(dto.ItemCode).ConfigureAwait(false);
+ if (itemBasicDto != null)
+ {
+ switch (itemBasicDto.ValidityUnit)
+ {
+ case EnumValidityUnit.Infinite:
+ dto.ExpireDate = DateTime.MaxValue;
+ break;
+ case EnumValidityUnit.Day:
+ dto.ExpireDate = DateTime.Now.AddDays(itemBasicDto.Validity);
+ break;
+ case EnumValidityUnit.WeeK:
+ dto.ExpireDate = DateTime.Now.AddDays(itemBasicDto.Validity * 7);
+ break;
+ case EnumValidityUnit.Month:
+ dto.ExpireDate = DateTime.Now.AddMonths(itemBasicDto.Validity);
+ break;
+ case EnumValidityUnit.None:
+ default:
+ break;
+ }
+ }
+ }
+
+ return dto;
+ }
+
[HttpPost("many")]
[UnitOfWork]
public virtual async Task> CreateManyAsync(List inputs)
@@ -83,7 +127,7 @@ public class InventoryLabelAppService
[UnitOfWork]
public virtual async Task> CreateManyByNoCodeAsync(List inputs)
{
- var entitys= ObjectMapper.Map, List>(inputs);
+ var entitys = ObjectMapper.Map, List>(inputs);
await _repository.InsertManyAsync(entitys).ConfigureAwait(false);
return ObjectMapper.Map, List>(entitys);
}
@@ -129,6 +173,36 @@ public class InventoryLabelAppService
var createInput = ObjectMapper.Map(input);
createInput.Code = numbers[i];
var dto = await base.CreateAsync(createInput).ConfigureAwait(false);
+
+ dto.SupplierCode = input.SupplierCode;
+ dto.PoNumber = input.PoNumber;
+ dto.Remark = input.Remark;
+ dto.AsnNumber = input.AsnNumber;
+ dto.FullBarcodeString = dto.Code;
+
+ var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(dto.ItemCode).ConfigureAwait(false);
+ if (itemBasicDto != null)
+ {
+ switch (itemBasicDto.ValidityUnit)
+ {
+ case EnumValidityUnit.Infinite:
+ dto.ExpireDate = DateTime.MaxValue;
+ break;
+ case EnumValidityUnit.Day:
+ dto.ExpireDate = DateTime.Now.AddDays(itemBasicDto.Validity);
+ break;
+ case EnumValidityUnit.WeeK:
+ dto.ExpireDate = DateTime.Now.AddDays(itemBasicDto.Validity * 7);
+ break;
+ case EnumValidityUnit.Month:
+ dto.ExpireDate = DateTime.Now.AddMonths(itemBasicDto.Validity);
+ break;
+ case EnumValidityUnit.None:
+ default:
+ break;
+ }
+ }
+
dtos.Add(dto);
}
return dtos;
diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs
index 2c022d8d3..600523dce 100644
--- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs
+++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs
@@ -512,7 +512,6 @@ public abstract class SfsCrudWithDetailsAppServiceBase
/// 导入数据具体实现,可重写
///
- //[UnitOfWork]
protected virtual async Task ImportInternalAsync(SfsImportRequestInput requestInput, byte[] inputFileBytes)
{
IList modelList = null;
@@ -559,7 +558,7 @@ public abstract class SfsCrudWithDetailsAppServiceBase
protected virtual async Task> ImportProcessingEntityAsync(Dictionary dictionary)
{
+ await Task.CompletedTask.ConfigureAwait(false);
return dictionary;
}
diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs
index f99e6672e..451f73df2 100644
--- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs
+++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs
@@ -127,6 +127,12 @@ public enum EnumTransSubType
[Display(Name = "安全库存拉动")]
Issue_SafetyStock = 1504,
+ ///
+ /// 直接发料
+ ///
+ [Display(Name = "直接发料")]
+ Issue_Direct = 1505,
+
///
/// 标准发货
///
diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs
index 245c1f9e8..0fa48dec0 100644
--- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs
+++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs
@@ -28,5 +28,5 @@ public enum EnumMaterialRequestType
//Issue_SfaetyStock = 1504,
[Display(Name = "直接发料")]
- Direct_Issue = 1505
+ Issue_Direct = 1505
}
diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs
index 5319f16a2..189e69c1d 100644
--- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs
+++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs
@@ -45,6 +45,7 @@ public static class HostBuilderExtensions
AddJsonByUrl(cb, $"{configUrl}appsettings.{builder.Environment.EnvironmentName}.json");
if (builder.Environment.IsDevelopment())
{
+ cb.AddJsonFile(Path.Combine(Directory.GetCurrentDirectory(), "appsettings.json"));
cb.AddJsonFile(Path.Combine(Directory.GetCurrentDirectory(), $"appsettings.{builder.Environment.EnvironmentName}.json"));
}
});
@@ -79,7 +80,14 @@ public static class HostBuilderExtensions
private static void AddJsonByUrl(IConfigurationBuilder configurationBuilder, string url)
{
Console.WriteLine($"load config form:{url}");
- var stream = new HttpClient().GetStreamAsync(url).Result;
- configurationBuilder.AddJsonStream(stream);
+ try
+ {
+ var stream = new HttpClient().GetStreamAsync(url).Result;
+ configurationBuilder.AddJsonStream(stream);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e.Message);
+ }
}
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendFromDetailWithFromToDTOBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendFromDetailWithFromToDTOBase.cs
index 34ad65d0c..57e22858e 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendFromDetailWithFromToDTOBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendFromDetailWithFromToDTOBase.cs
@@ -79,11 +79,6 @@ public abstract class SfsStoreRecommendFromDetailWithFromToDTOBase : SfsStoreDet
[Display(Name = "推荐仓库")]
public string RecommendFromWarehouseCode { get; set; }
- ///
- /// 计量单位
- ///
- [Display(Name = "计量单位")]
- public string Uom { get; set; }
///
/// 推荐数量
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatusDTOBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatusDTOBase.cs
index 60677c614..1879df552 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatusDTOBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatusDTOBase.cs
@@ -79,12 +79,6 @@ public abstract class SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatus
[Display(Name = "推荐仓库")]
public string RecommendFromWarehouseCode { get; set; }
- ///
- /// 计量单位
- ///
- [Display(Name = "计量单位")]
- public string Uom { get; set; }
-
///
/// 推荐数量
///
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendToDetailWithFromToDTOBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendToDetailWithFromToDTOBase.cs
index ada92e47f..76239bc02 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendToDetailWithFromToDTOBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendToDetailWithFromToDTOBase.cs
@@ -79,12 +79,6 @@ public abstract class SfsStoreRecommendToDetailWithFromToDTOBase : SfsStoreDetai
[Display(Name = "推荐仓库")]
public string RecommendToWarehouseCode { get; set; }
- ///
- /// 计量单位
- ///
- [Display(Name = "计量单位")]
- public string Uom { get; set; }
-
///
/// 推荐数量
///
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusDTOBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusDTOBase.cs
index 158f925ff..cc6884027 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusDTOBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusDTOBase.cs
@@ -79,12 +79,6 @@ public abstract class SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusDT
[Display(Name = "推荐仓库")]
public string RecommendToWarehouseCode { get; set; }
- ///
- /// 计量单位
- ///
- [Display(Name = "计量单位")]
- public string Uom { get; set; }
-
///
/// 推荐数量
///
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRequestDTOBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRequestDTOBase.cs
index b0b98b116..ef7d69ea2 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRequestDTOBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/DTOs/SfsStoreRequestDTOBase.cs
@@ -3,7 +3,7 @@ using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
-public class SfsStoreRequestDTOBase : SfsStoreDTOBase
+public abstract class SfsStoreRequestDTOBase : SfsStoreDTOBase
{
///
/// 自动提交审批
@@ -18,7 +18,7 @@ public class SfsStoreRequestDTOBase : SfsStoreDTOBase
public bool AutoAgree { get; set; }
///
- /// 自动执行
+ /// 自动执行
///
[Display(Name = "自动执行")]
public bool AutoHandle { get; set; }
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreCreateOrUpdateInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreCreateOrUpdateInputBase.cs
index b2d51a740..6e5d4644f 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreCreateOrUpdateInputBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreCreateOrUpdateInputBase.cs
@@ -5,7 +5,7 @@ using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
-public class SfsStoreCreateOrUpdateInputBase : SfsCreateOrUpdateInputBase
+public abstract class SfsStoreCreateOrUpdateInputBase : SfsCreateOrUpdateInputBase
{
///
/// 操作员
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs
index 2fac6fbd8..9839fd7a7 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreDetailWithFromToInputBase.cs
@@ -5,7 +5,7 @@ using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
-public class SfsStoreDetailWithFromToInputBase
+public abstract class SfsStoreDetailWithFromToInputBase
: SfsStoreDetailWithQtyInputBase
, IHasFromToPacking
, IHasFromToLot
@@ -149,5 +149,6 @@ public class SfsStoreDetailWithFromToInputBase
///
[Display(Name = "目标库存状态")]
public EnumInventoryStatus ToStatus { get; set; }
+
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreImportInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreImportInputBase.cs
index 5773575ac..4918540e4 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreImportInputBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreImportInputBase.cs
@@ -3,7 +3,7 @@ using Win_in.Sfs.Shared.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
-public class SfsStoreImportInputBase : SfsImportInputBase
+public abstract class SfsStoreImportInputBase : SfsImportInputBase
{
//[Display(Name = "单号")]
@@ -35,7 +35,7 @@ public class SfsStoreImportInputBase : SfsImportInputBase
public bool AutoAgree { get; set; } = true;
///
- /// 自动执行
+ /// 自动执行
///
[Display(Name = "自动执行")]
[ImporterHeader(IsIgnore = true)]
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithFromToInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithFromToInputBase.cs
index 9f0990c48..4cc36f820 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithFromToInputBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithFromToInputBase.cs
@@ -4,7 +4,7 @@ using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
-public class SfsStoreRecommendFromDetailWithFromToInputBase : SfsStoreDetailWithFromToInputBase, IHasRecommendAndHandledFrom
+public abstract class SfsStoreRecommendFromDetailWithFromToInputBase : SfsStoreDetailWithFromToInputBase, IHasRecommendAndHandledFrom
{
#region IHasRecommendFrom
///
@@ -79,12 +79,6 @@ public class SfsStoreRecommendFromDetailWithFromToInputBase : SfsStoreDetailWith
[Display(Name = "推荐仓库")]
public string RecommendFromWarehouseCode { get; set; }
- ///
- /// 计量单位
- ///
- [Display(Name = "计量单位")]
- public string Uom { get; set; }
-
///
/// 推荐数量
///
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatusInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatusInputBase.cs
index b10259de3..1285007db 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatusInputBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatusInputBase.cs
@@ -79,12 +79,6 @@ public abstract class SfsStoreRecommendFromDetailWithLotPackingQtyLocationStatus
[Display(Name = "推荐仓库")]
public string RecommendFromWarehouseCode { get; set; }
- ///
- /// 计量单位
- ///
- [Display(Name = "计量单位")]
- public string Uom { get; set; }
-
///
/// 推荐数量
///
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithFromToInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithFromToInputBase.cs
index fe80cb038..ce905ac06 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithFromToInputBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithFromToInputBase.cs
@@ -4,7 +4,7 @@ using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
-public class SfsStoreRecommendToDetailWithFromToInputBase : SfsStoreDetailWithFromToInputBase, IHasRecommendAndHandledTo
+public abstract class SfsStoreRecommendToDetailWithFromToInputBase : SfsStoreDetailWithFromToInputBase, IHasRecommendAndHandledTo
{
#region IHasRecommendTo
///
@@ -79,12 +79,6 @@ public class SfsStoreRecommendToDetailWithFromToInputBase : SfsStoreDetailWithFr
[Display(Name = "推荐仓库")]
public string RecommendToWarehouseCode { get; set; }
- ///
- /// 计量单位
- ///
- [Display(Name = "计量单位")]
- public string Uom { get; set; }
-
///
/// 推荐数量
///
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusInputBase.cs
index c019b0583..f27d709cd 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusInputBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusInputBase.cs
@@ -81,12 +81,6 @@ public abstract class SfsStoreRecommendToDetailWithLotPackingQtyLocationStatusIn
[Display(Name = "推荐仓库")]
public string RecommendToWarehouseCode { get; set; }
- ///
- /// 计量单位
- ///
- [Display(Name = "计量单位")]
- public string Uom { get; set; }
-
///
/// 推荐数量
///
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRequestCreateOrUpdateInputBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRequestCreateOrUpdateInputBase.cs
index 19703dfd1..264637389 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRequestCreateOrUpdateInputBase.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Bases/Inputs/SfsStoreRequestCreateOrUpdateInputBase.cs
@@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
-public class SfsStoreRequestCreateOrUpdateInputBase : SfsStoreCreateOrUpdateInputBase
+public abstract class SfsStoreRequestCreateOrUpdateInputBase : SfsStoreCreateOrUpdateInputBase
{
///
/// 自动提交审批
@@ -17,7 +17,7 @@ public class SfsStoreRequestCreateOrUpdateInputBase : SfsStoreCreateOrUpdateInpu
public bool AutoAgree { get; set; } = true;
///
- /// 自动执行
+ /// 自动执行
///
[Display(Name = "自动执行")]
public bool AutoHandle { get; set; } = true;
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs
index 1b26733b8..027134838 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs
@@ -42,10 +42,8 @@ public interface IPurchaseReceiptJobAppService
Task> SetInspectWithNotInspectAsync(Guid id);
///
- /// 按Id获取实体 不走缓存
+ /// 根据供应商编号获取收货任务
///
- /// 实体Id
- ///
///
- Task GetNoCacheAsync(Guid id);
+ Task