Browse Source

update

master
wanggang 1 year ago
parent
commit
c5eb5ec603
  1. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs
  2. 18
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs
  3. 24
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs
  4. 36
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs
  5. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  6. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
  7. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs

@ -62,10 +62,10 @@ namespace AuthServer.Host
options.Languages.Add(new LanguageInfo("en", "en", "English"));
});
context.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = configuration["Redis:Configuration"];
});
//context.Services.AddStackExchangeRedisCache(options =>
//{
// options.Configuration = configuration["Redis:Configuration"];
//});
context.Services.AddCors(options =>
{
@ -90,9 +90,9 @@ namespace AuthServer.Host
options.ApplicationName = "AuthServer";
});
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
//var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
//context.Services.AddDataProtection()
// .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)

18
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs

@ -1,4 +1,4 @@
using BaseService.EntityFrameworkCore;
using BaseService.EntityFrameworkCore;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors;
@ -145,14 +145,14 @@ namespace BaseService
private static void ConfigureRedis(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = configuration["Redis:Configuration"];
});
//context.Services.AddStackExchangeRedisCache(options =>
//{
// options.Configuration = configuration["Redis:Configuration"];
//});
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
//var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
//context.Services.AddDataProtection()
// .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
}
private void ConfigureDbContext()
@ -271,4 +271,4 @@ namespace BaseService
});
}
}
}
}

24
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs

@ -375,18 +375,18 @@ namespace Win.Sfs.SettleAccount
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
context.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = configuration["Redis:Configuration"];
});
//context.Services.AddStackExchangeRedisCache(options =>
//{
// options.Configuration = configuration["Redis:Configuration"];
//});
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
}
//if (!hostingEnvironment.IsDevelopment())
//{
// var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
// context.Services
// .AddDataProtection()
// .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
//}
}
private void ConfigureHangfire(ServiceConfigurationContext context, IConfiguration configuration)
@ -460,4 +460,4 @@ namespace Win.Sfs.SettleAccount
});
}
}
}
}

36
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs

@ -2,6 +2,7 @@ using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
@ -21,6 +22,7 @@ public class JobHostdService : BackgroundService, IApplicationService
{
private readonly object _lockObj = new object();
private readonly IServiceProvider _serviceProvider;
private FileSystemWatcher _watcher;
private CancellationToken _stoppingToken;
public JobHostdService(IServiceProvider serviceProvider)
@ -28,6 +30,40 @@ public class JobHostdService : BackgroundService, IApplicationService
this._serviceProvider = serviceProvider;
}
public override Task StartAsync(CancellationToken cancellationToken)
{
var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot");
var filter = "*.js";
this._watcher = new FileSystemWatcher(path, filter);
this._watcher.NotifyFilter = NotifyFilters.Attributes
| NotifyFilters.CreationTime
| NotifyFilters.DirectoryName
| NotifyFilters.FileName
| NotifyFilters.LastAccess
| NotifyFilters.LastWrite
| NotifyFilters.Security
| NotifyFilters.Size;
this._watcher.Created += _watcher_Created;
this._watcher.Deleted += _watcher_Created;
this._watcher.Changed += _watcher_Created;
this._watcher.Renamed += _watcher_Created;
this._watcher.IncludeSubdirectories = true;
this._watcher.EnableRaisingEvents = true;
return base.StartAsync(cancellationToken);
}
private void _watcher_Created(object sender, FileSystemEventArgs e)
{
using var scope = this._serviceProvider.CreateScope();
scope.ServiceProvider.GetRequiredService<IHubContext<PageHub>>().Clients.All.ServerToClient("Refresh", e.FullPath, "");
}
public override Task StopAsync(CancellationToken cancellationToken)
{
this._watcher?.Dispose();
return base.StopAsync(cancellationToken);
}
public static List<Type> ServiceTypes { get; private set; }
public ConcurrentDictionary<JobItem, Tuple<CancellationTokenSource, Thread>> Jobs { get; } = new();

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -192,13 +192,9 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
/// </summary>
[HttpPost("invoke")]
[DisableValidation]
public virtual Task VmiBackup()
public virtual async Task VmiBackup()
{
Task.Run(async () =>
{
await Invoke(_serviceProvider).ConfigureAwait(false);
});
return Task.CompletedTask;
await Invoke(_serviceProvider).ConfigureAwait(false);
}
/// <summary>

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs

@ -48,16 +48,16 @@ public class VmiBalance : BasicAggregateRoot<Guid>, IHasConcurrencyStamp
/// 发货类型
/// </summary>
[Display(Name = "发货类型")]
public EnumDeliverBjBmpBillType BillType { get; set; }
public EnumDeliverBjBmpBillType? BillType { get; set; }
[Display(Name = "数量")]
public decimal Qty { get; set; }
[Display(Name = "发运日期")]
public DateTime BillTime { get; set; }
public DateTime? BillTime { get; set; }
[Display(Name = "订单日期")]
public DateTime DeliverTime { get; set; }
public DateTime? DeliverTime { get; set; }
/// <summary>
/// ERP库位
@ -87,7 +87,7 @@ public class VmiBalance : BasicAggregateRoot<Guid>, IHasConcurrencyStamp
public string factory { get; set; }
[Display(Name = "发货子类型")]
public EnumDeliverSubBillType SubBillType { get; set; }
public EnumDeliverSubBillType? SubBillType { get; set; }
[Display(Name = "WMS实发生产码")]
public string RealCode { get; set; }

19
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs

@ -99,6 +99,9 @@ public class VmiLog : BasicAggregateRoot<Guid>
[Display(Name = "LU零件号")]
public string PartCode { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
public string VinCode { get; set; }
@ -108,22 +111,26 @@ public class VmiLog : BasicAggregateRoot<Guid>
[Display(Name = "客户零件号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 生产码类型
/// </summary>
[Display(Name = "生产码类型")]
public string CodeType { get; set; }
[Display(Name = "发货类型")]
public EnumDeliverBjBmpBillType BillType { get; set; }
/// <summary>
/// 数量
/// 发货类型
/// </summary>
[Display(Name = "发货类型")]
public EnumDeliverBjBmpBillType? BillType { get; set; }
[Display(Name = "数量")]
public decimal Qty { get; set; }
[Display(Name = "发运日期")]
public DateTime BillTime { get; set; }
public DateTime? BillTime { get; set; }
[Display(Name = "订单日期")]
public DateTime DeliverTime { get; set; }
public DateTime? DeliverTime { get; set; }
/// <summary>
/// ERP库位
@ -153,7 +160,7 @@ public class VmiLog : BasicAggregateRoot<Guid>
public string factory { get; set; }
[Display(Name = "发货子类型")]
public EnumDeliverSubBillType SubBillType { get; set; }
public EnumDeliverSubBillType? SubBillType { get; set; }
[Display(Name = "WMS实发生产码")]
public string RealCode { get; set; }

Loading…
Cancel
Save