唐明亮 2 years ago
parent
commit
7b653afb31
  1. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Arrives/ArriveDbContextModelCreatingExtensions.cs
  2. 3
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanDbContextModelCreatingExtensions.cs
  3. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Returns/ReturnDbContextModelCreatingExtensions.cs
  4. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Ships/ShipDbContextModelCreatingExtensions.cs
  5. 18
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs
  6. 28
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
  7. 13
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs
  8. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent.csproj
  9. 14
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json
  10. 44
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs
  11. 11
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs
  12. 7
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs
  13. 10
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs
  14. 1
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs
  15. 43
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Filters/FilterExtensions.cs

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -59,13 +59,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
common.updatedt = DateTime.Now; common.updatedt = DateTime.Now;
common.isupdate = false; common.isupdate = false;
//Logger.LogInformation($"Read ItemBasic");//零件 Logger.LogInformation($"Read ItemBasic");//零件
//var itemBasicReader = workerContext.ServiceProvider.GetRequiredService<ItemBasicReader>(); var itemBasicReader = workerContext.ServiceProvider.GetRequiredService<ItemBasicReader>();
//var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService<ItemBasicConverter>(); var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService<ItemBasicConverter>();
////读取并保存itemBasic //读取并保存itemBasic
//var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false); var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false);
////转换itemBasic //转换itemBasic
//await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read User");//用户和部门 //Logger.LogInformation($"Read User");//用户和部门
//var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>(); //var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>();
@ -80,21 +80,21 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
////转换department ////转换department
//await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false); //await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read InterfaceCalendar");//账期 Logger.LogInformation($"Read InterfaceCalendar");//账期
//var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarReader>(); var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarReader>();
//var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarConverter>(); var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarConverter>();
////读取并保存InterfaceCalendar //读取并保存InterfaceCalendar
//var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync(); var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false);
////转换InterfaceCalendar //转换InterfaceCalendar
//await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList); await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Dict");//系统代码 //Logger.LogInformation($"Read Dict");//系统代码
var dictReader = workerContext.ServiceProvider.GetRequiredService<DictReader>(); //var dictReader = workerContext.ServiceProvider.GetRequiredService<DictReader>();
var dictConverter = workerContext.ServiceProvider.GetRequiredService<DictConverter>(); //var dictConverter = workerContext.ServiceProvider.GetRequiredService<DictConverter>();
//读取并保存Dict ////读取并保存Dict
var dictOutsFromExternalList = await dictReader.ReadAsync().ConfigureAwait(false); //var dictOutsFromExternalList = await dictReader.ReadAsync().ConfigureAwait(false);
//转换Dict ////转换Dict
await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); //await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Bom"); //Logger.LogInformation($"Read Bom");
//var BomReader = workerContext.ServiceProvider.GetRequiredService<BomReader>(); //var BomReader = workerContext.ServiceProvider.GetRequiredService<BomReader>();

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

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

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

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

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

@ -280,11 +280,11 @@ public class BalanceController : AbpController
} }
} }
if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any()) //if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any())
{ //{
input.Condition.Filters.Add( // input.Condition.Filters.Add(
new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In")); // new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In"));
} //}
var balanceDTOs = await _balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false); var balanceDTOs = await _balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false);

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

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

43
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Filters/FilterExtensions.cs

@ -206,27 +206,28 @@ public static class FilterExtensions
var parameterExpression = Expression.Parameter(typeof(T), "p"); var parameterExpression = Expression.Parameter(typeof(T), "p");
Type lstType = typeof(List<>).MakeGenericType(propertyType); Type lstType = typeof(List<>).MakeGenericType(propertyType);
if (propertyType.IsEnum) //转换枚举
{ //if (propertyType.IsEnum)
var valueArrayStrings = JsonSerializer.Deserialize<List<string>>(filter.Value); //{
List<object> newValues = new List<object>(); // var valueArrayStrings = JsonSerializer.Deserialize<List<string>>(filter.Value);
// List<object> newValues = new List<object>();
var enumValues = propertyType.GetEnumValues();
// var enumValues = propertyType.GetEnumValues();
foreach (var valueArray in valueArrayStrings)
{ // foreach (var valueArray in valueArrayStrings)
foreach (var enumValue in enumValues) // {
{ // foreach (var enumValue in enumValues)
if (enumValue.ToString() == valueArray) // {
{ // if (enumValue.ToString() == valueArray)
newValues.Add(enumValue); // {
break; // newValues.Add(enumValue);
} // break;
} // }
} // }
var newValue = JsonSerializer.Serialize(newValues); // }
filter.Value = newValue; // var newValue = JsonSerializer.Serialize(newValues);
} // filter.Value = newValue;
//}
object propertyValue = JsonSerializer.Deserialize(filter.Value, lstType); object propertyValue = JsonSerializer.Deserialize(filter.Value, lstType);
if (propertyValue != null) if (propertyValue != null)

Loading…
Cancel
Save