Browse Source

update

master
wanggang 1 year ago
parent
commit
fee381ea0f
  1. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/backup.js
  2. 94
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  3. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs
  4. 33
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiAsyncTask.cs
  5. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
  6. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
  7. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs
  8. 24
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  9. 5739
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823012043_vmi13.Designer.cs
  10. 242
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823012043_vmi13.cs
  11. 133
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/backup.js

@ -37,7 +37,7 @@ export default function () {
type: "string", type: "string",
input: "select", input: "select",
url: "settleaccount/vmi/snapshot", url: "settleaccount/vmi/snapshot",
value: "name", value: "description",
label: "name", label: "name",
defaultSelected: true, defaultSelected: true,
clearable: false, clearable: false,

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

@ -162,15 +162,17 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
using var transaction = db.Database.BeginTransaction(); using var transaction = db.Database.BeginTransaction();
try try
{ {
var time = DateTime.Now.ToString("yyyy-MM-dd_HH:mm"); var now = DateTime.Now;
var time = now.ToString("yyyy-MM-dd_HH:mm");
var table = $"Set_VmiBalance_{time}"; var table = $"Set_VmiBalance_{time}";
var snapshot = db.Set<VmiSnapshot>().Where(o => o.Name == table).FirstOrDefault(); var snapshot = db.Set<VmiSnapshot>().Where(o => o.Name == table).FirstOrDefault();
if (snapshot == null) if (snapshot == null)
{ {
snapshot = new VmiSnapshot { Name = time, Path = table }; snapshot = new VmiSnapshot { Name = time, Start = now, Description = table };
db.Set<VmiSnapshot>().Add(snapshot); db.Set<VmiSnapshot>().Add(snapshot);
db.SaveChanges(); db.SaveChanges();
var result = db.Database.ExecuteSqlRaw($"select * into {table} from Set_VmiBalance;"); var result = db.Database.ExecuteSqlRaw($"select * into {table} from Set_VmiBalance;");
snapshot.End = DateTime.Now;
transaction.Commit(); transaction.Commit();
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -690,6 +692,9 @@ public class LogRequestDto : RequestDto
public List<VmiLogType> LogTypes { get; set; } = new List<VmiLogType>(); public List<VmiLogType> LogTypes { get; set; } = new List<VmiLogType>();
} }
/// <summary>
/// 异步更新库存
/// </summary>
public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransientDependency public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransientDependency
{ {
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
@ -703,7 +708,7 @@ public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransien
{ {
using var scope = _serviceProvider.CreateScope(); using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>(); var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var query = db.Set<VmiMessage>(); var query = db.Set<VmiMessage>().AsQueryable();
using var dc = db.CreateLinqToDBConnection(); using var dc = db.CreateLinqToDBConnection();
dc.BeginTransaction(); dc.BeginTransaction();
try try
@ -779,6 +784,9 @@ public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransien
} }
} }
/// <summary>
/// 消息表定时清理
/// </summary>
public class VmiAsyncMessageService : ApplicationService, IJobService, ITransientDependency public class VmiAsyncMessageService : ApplicationService, IJobService, ITransientDependency
{ {
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
@ -798,3 +806,83 @@ public class VmiAsyncMessageService : ApplicationService, IJobService, ITransien
return Task.CompletedTask; return Task.CompletedTask;
} }
} }
/// <summary>
/// 库存事务定时备份
/// </summary>
public class VmiLogbackupService : ApplicationService, IJobService, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public VmiLogbackupService(IServiceProvider serviceProvider)
{
this._serviceProvider = serviceProvider;
}
public Task Invoke(IServiceProvider serviceProvider)
{
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
using var transaction = db.Database.BeginTransaction();
try
{
var task = db.Set<VmiSyncTask>().FirstOrDefault(o => o.Number == "Set_VmiLog");
if (task != null)
{
var now = DateTime.Now;
task.LastUpdate = now;
var query = db.Set<VmiLog>().Where(o => o.UpdatedTime >= task.LastUpdate && o.UpdatedTime < now);
foreach (var item in query)
{
//同步到questdb
}
}
}
catch
{
transaction.Rollback();
throw;
}
return Task.CompletedTask;
}
}
/// <summary>
/// 库存余额定时备份
/// </summary>
public class VmiLogBalanceService : ApplicationService, IJobService, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public VmiLogBalanceService(IServiceProvider serviceProvider)
{
this._serviceProvider = serviceProvider;
}
public Task Invoke(IServiceProvider serviceProvider)
{
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
using var transaction = db.Database.BeginTransaction();
try
{
var task = db.Set<VmiSyncTask>().FirstOrDefault(o => o.Number == "Set_VmiBalance");
if (task != null)
{
var now = DateTime.Now;
task.LastUpdate = now;
var query = db.Set<VmiBalance>().Where(o => o.UpdatedTime >= task.LastUpdate && o.UpdatedTime < now);
foreach (var item in query)
{
//同步到questdb
}
}
}
catch
{
transaction.Rollback();
throw;
}
return Task.CompletedTask;
}
}

11
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs

@ -4,11 +4,15 @@ using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class JobItem : Entity<Guid> public class JobItem : Entity<Guid>, IHasConcurrencyStamp
{ {
public JobItem(Guid id) public JobItem()
{ {
this.Id = id; ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public JobItem(Guid id):base(id)
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
} }
public bool IsDisabled { get; set; } public bool IsDisabled { get; set; }
@ -25,6 +29,5 @@ public class JobItem : Entity<Guid>
public bool IsRunning { get; set; } public bool IsRunning { get; set; }
public DateTime? HeartBeat { get; set; } public DateTime? HeartBeat { get; set; }
[Timestamp]
public string ConcurrencyStamp { get; set; } public string ConcurrencyStamp { get; set; }
} }

33
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiAsyncTask.cs

@ -0,0 +1,33 @@
using System;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiSyncTask : Entity<Guid>, IHasConcurrencyStamp
{
public VmiSyncTask()
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public VmiSyncTask(Guid id) : base(id)
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
/// <summary>
/// 任务名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 同步数据时间戳初始起点
/// </summary>
public string Number { get; set; }
/// <summary>
/// 最后同步时间
/// </summary>
public DateTime LastUpdate { get; set; }
public string ConcurrencyStamp { get; set; }
}

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

@ -20,6 +20,9 @@ public class VmiBalance : Entity<Guid>, IHasConcurrencyStamp
ConcurrencyStamp = Guid.NewGuid().ToString("N"); ConcurrencyStamp = Guid.NewGuid().ToString("N");
} }
//同步时间戳
public DateTime LastUpdate { get; set; }
public string ConcurrencyStamp { get; set; } public string ConcurrencyStamp { get; set; }
[Display(Name = "LU零件号", Order = 6)] [Display(Name = "LU零件号", Order = 6)]
@ -87,4 +90,9 @@ public class VmiBalance : Entity<Guid>, IHasConcurrencyStamp
[Display(Name = "备注", Order = 27)] [Display(Name = "备注", Order = 27)]
public string ReMark { get; set; } public string ReMark { get; set; }
//审计
public DateTime CreatedTime { get; set; }
public DateTime UpdatedTime { get; set; }
} }

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

@ -14,7 +14,7 @@ public class VmiLog : Entity<Guid>
{ {
} }
public VmiLog(Guid id):base(id) public VmiLog(Guid id) : base(id)
{ {
} }
@ -25,7 +25,7 @@ public class VmiLog : Entity<Guid>
public string ChangedNumber { get; set; } public string ChangedNumber { get; set; }
[Display(Name = "变动时间", Order = 2)] [Display(Name = "变动时间", Order = 2)]
public DateTime ChangedTime { get; set; } = DateTime.Now; public DateTime ChangedTime { get; set; }
[Display(Name = "变动类型", Order = 3)] [Display(Name = "变动类型", Order = 3)]
public VmiType ChangedType { get; set; } public VmiType ChangedType { get; set; }
@ -103,4 +103,9 @@ public class VmiLog : Entity<Guid>
[Display(Name = "备注", Order = 27)] [Display(Name = "备注", Order = 27)]
public string ReMark { get; set; } public string ReMark { get; set; }
//审计
public DateTime CreatedTime { get; set; }
public DateTime UpdatedTime { get; set; }
} }

9
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs

@ -13,8 +13,9 @@ public class VmiSnapshot : Entity<Guid>
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> public DateTime Start { get; set; }
/// 数据库文件路径
/// </summary> public DateTime End { get; set; }
public string Path { get; set; }
public string Description { get; set; }
} }

24
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -1310,6 +1310,8 @@ namespace Win.Sfs.SettleAccount
{ {
b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema); b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.Property(o => o.CreatedTime).ValueGeneratedOnAdd().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.Property(o => o.UpdatedTime).ValueGeneratedOnAddOrUpdate().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.HasIndex(o => (new b.HasIndex(o => (new
{ {
o.DeliverBillType, o.DeliverBillType,
@ -1328,6 +1330,8 @@ namespace Win.Sfs.SettleAccount
{ {
b.ToTable($"{options.TablePrefix}_VmiLog", options.Schema); b.ToTable($"{options.TablePrefix}_VmiLog", options.Schema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.Property(o => o.CreatedTime).ValueGeneratedOnAdd().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.Property(o => o.UpdatedTime).ValueGeneratedOnAddOrUpdate().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
}); });
builder.Entity<VmiSnapshot>(b => builder.Entity<VmiSnapshot>(b =>
@ -1336,8 +1340,21 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention(); b.ConfigureByConvention();
}); });
builder.Entity<VmiSyncTask>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiSyncTask", options.Schema);
b.ConfigureByConvention();
});
//seed //seed
builder.Entity<VmiSyncTask>().HasData(new VmiSyncTask("Set_VmiLog".ToGuid()) { Name = "库存事务备份", Number = "Set_VmiLog", LastUpdate = DateTime.Now.AddDays(-5).Date });
builder.Entity<VmiSyncTask>().HasData(new VmiSyncTask("Set_VmiBalance".ToGuid()) { Name = "库存余额备份", Number = "Set_VmiBalance", LastUpdate = DateTime.Now.AddDays(-5).Date });
builder.Entity<JobItem>().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" }); builder.Entity<JobItem>().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" });
builder.Entity<JobItem>().HasData(new JobItem("vmi.balance".ToGuid()) { Name = "同步库存", Cron = "0 0/1 * * * ?", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncBalanceService" });
builder.Entity<JobItem>().HasData(new JobItem("vmi.message".ToGuid()) { Name = "消息监控", Cron = "0 0/1 * * * ?", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" });
builder.Entity<JobItem>().HasData(new JobItem("vmi.log.sync".ToGuid()) { Name = "库存事务同步", Cron = "0 0/5 * * * ? *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" });
builder.Entity<JobItem>().HasData(new JobItem("vmi.balance.sync".ToGuid()) { Name = "库存余额同步", Cron = "0 0/5 * * * ? *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" });
builder.Entity<JobItem>().HasData(new JobItem("JisBBACSeSync".ToGuid()) { Name = "JisBBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("JisBBACSeSync".ToGuid()) { Name = "JisBBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("JisHBPOSeSync".ToGuid()) { Name = "JisHBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("JisHBPOSeSync".ToGuid()) { Name = "JisHBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("MaiDanBBACSeSync".ToGuid()) { Name = "买单件BBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("MaiDanBBACSeSync".ToGuid()) { Name = "买单件BBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" });
@ -1346,13 +1363,6 @@ namespace Win.Sfs.SettleAccount
builder.Entity<JobItem>().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("YinDuSeSync".ToGuid()) { Name = "印度件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("YinDuSeSync".ToGuid()) { Name = "印度件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("发运入库".ToGuid()) { Type = VmiType.In, Name = "发运入库", Number = "100" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("结算出库".ToGuid()) { Type = VmiType.Out, Name = "结算出库", Number = "200" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("调整入库".ToGuid()) { Type = VmiType.In, Name = "调整入库", Number = "400" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("调整出库".ToGuid()) { Type = VmiType.Out, Name = "调整出库", Number = "500" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("漏发补货".ToGuid()) { Type = VmiType.In, Name = "漏发补货", Number = "600" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("负库存补货".ToGuid()) { Type = VmiType.In, Name = "负库存补货", Number = "700" });
} }
} }

5739
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823012043_vmi13.Designer.cs

File diff suppressed because it is too large

242
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823012043_vmi13.cs

@ -0,0 +1,242 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi13 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("1fad01d0-8122-42d3-bb8f-5fff76230eea"));
migrationBuilder.RenameColumn(
name: "Path",
table: "Set_VmiSnapshot",
newName: "Description");
migrationBuilder.AddColumn<DateTime>(
name: "End",
table: "Set_VmiSnapshot",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "Start",
table: "Set_VmiSnapshot",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "CreatedTime",
table: "Set_VmiLog",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "UpdatedTime",
table: "Set_VmiLog",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "CreatedTime",
table: "Set_VmiBalance",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "LastUpdate",
table: "Set_VmiBalance",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "UpdatedTime",
table: "Set_VmiBalance",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.CreateTable(
name: "Set_VmiSyncTask",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(max)", nullable: true),
LastUpdate = table.Column<DateTime>(type: "datetime2", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_VmiSyncTask", x => x.Id);
});
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "9fd0847f12d44ca0888ec5468cffe209");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "c25d4ff8ba1d4f4fab5ca41211d77fa3");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "67acda8899f543e0866fd36aa29fd631");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "448d1c6b6105465b9688434d1ea931ec");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "53abb840e287470a8f7b641010ab2316");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "25bf9614ce2c42bb90499a28d9666db3");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "55f5f3c94e374afcb8409decbfbd2ca0");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "335f6624aaf94c5ba8fead27577b14cc");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "1893ae6d3ffb410c9ac2bdb293cb1367");
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "HeartBeat", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[,]
{
{ new Guid("185c5968-e02b-267e-db2f-225fccfc9716"), "0a86eea1216549839d882d9acb0e5e03", "0 0/1 * * * ?", null, false, false, "同步库存", "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncBalanceService" },
{ new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"), "637639f7ef6844789186e40ea883c0b5", "0 0/1 * * * ?", null, false, false, "消息监控", "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" },
{ new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"), "022cd0d93f234af8bb31afe5ffa94221", "0 0/5 * * * ? *", null, false, false, "库存事务同步", "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" },
{ new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"), "30efce301b314bc5b46511dca438048a", "0 0/5 * * * ? *", null, false, false, "库存余额同步", "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" }
});
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "AssembleData", "BillTime", "CodeType", "ConcurrencyStamp", "Configcode", "CustPartCode", "DeliverBillType", "DeliverSubBillType", "ErpToLoc", "IsReplenished", "LastUpdate", "MatchNumber", "OrderNum", "PjsNum", "Qty", "ReMark", "RealCode", "RealPartCode", "Seq", "SettlementPartCode", "SettlementVinCode", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("b3183f11-1cb2-48b0-8970-aa641eb5771d"), null, null, null, "a7cae35c36f14f5790ff8895f394fa3c", null, null, 1, null, "ErpToLoc", null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, "OrderNum", null, 0m, null, null, "PartCode", null, null, null, null, "VinCode", null });
migrationBuilder.InsertData(
table: "Set_VmiSyncTask",
columns: new[] { "Id", "ConcurrencyStamp", "LastUpdate", "Name", "Number" },
values: new object[,]
{
{ new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"), "2cebf1e28ade4a82a6becea62a0e7a64", new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local), "库存事务备份", "Set_VmiLog" },
{ new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"), "245f452a0bd640c2a5fae8be9f72e806", new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local), "库存余额备份", "Set_VmiBalance" }
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_VmiSyncTask");
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"));
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("b3183f11-1cb2-48b0-8970-aa641eb5771d"));
migrationBuilder.DropColumn(
name: "End",
table: "Set_VmiSnapshot");
migrationBuilder.DropColumn(
name: "Start",
table: "Set_VmiSnapshot");
migrationBuilder.DropColumn(
name: "CreatedTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "UpdatedTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CreatedTime",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "LastUpdate",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "UpdatedTime",
table: "Set_VmiBalance");
migrationBuilder.RenameColumn(
name: "Description",
table: "Set_VmiSnapshot",
newName: "Path");
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "AssembleData", "BillTime", "CodeType", "ConcurrencyStamp", "Configcode", "CustPartCode", "DeliverBillType", "DeliverSubBillType", "ErpToLoc", "IsReplenished", "MatchNumber", "OrderNum", "PjsNum", "Qty", "ReMark", "RealCode", "RealPartCode", "Seq", "SettlementPartCode", "SettlementVinCode", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("1fad01d0-8122-42d3-bb8f-5fff76230eea"), null, null, null, "302d775f40154c279dbf7bbd37489b46", null, null, 1, null, "ErpToLoc", null, null, "OrderNum", null, 0m, null, null, "PartCode", null, null, null, null, "VinCode", null });
}
}
}

133
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -4373,9 +4373,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.ValueGeneratedOnAddOrUpdate()
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("Cron") b.Property<string>("Cron")
.IsRequired() .IsRequired()
@ -4412,6 +4412,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
ConcurrencyStamp = "335f6624aaf94c5ba8fead27577b14cc",
Cron = "0 0 8 26 *", Cron = "0 0 8 26 *",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4419,8 +4420,49 @@ namespace Win.Sfs.SettleAccount.Migrations
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService"
}, },
new new
{
Id = new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
ConcurrencyStamp = "0a86eea1216549839d882d9acb0e5e03",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
Name = "同步库存",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncBalanceService"
},
new
{
Id = new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
ConcurrencyStamp = "637639f7ef6844789186e40ea883c0b5",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
Name = "消息监控",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService"
},
new
{
Id = new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
ConcurrencyStamp = "022cd0d93f234af8bb31afe5ffa94221",
Cron = "0 0/5 * * * ? *",
IsDisabled = false,
IsRunning = false,
Name = "库存事务同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService"
},
new
{
Id = new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
ConcurrencyStamp = "30efce301b314bc5b46511dca438048a",
Cron = "0 0/5 * * * ? *",
IsDisabled = false,
IsRunning = false,
Name = "库存余额同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService"
},
new
{ {
Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
ConcurrencyStamp = "53abb840e287470a8f7b641010ab2316",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4430,6 +4472,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"), Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
ConcurrencyStamp = "9fd0847f12d44ca0888ec5468cffe209",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4439,6 +4482,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"), Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
ConcurrencyStamp = "67acda8899f543e0866fd36aa29fd631",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4448,6 +4492,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
ConcurrencyStamp = "c25d4ff8ba1d4f4fab5ca41211d77fa3",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4457,6 +4502,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
ConcurrencyStamp = "1893ae6d3ffb410c9ac2bdb293cb1367",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4466,6 +4512,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
ConcurrencyStamp = "448d1c6b6105465b9688434d1ea931ec",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4475,6 +4522,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
ConcurrencyStamp = "55f5f3c94e374afcb8409decbfbd2ca0",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4484,6 +4532,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
ConcurrencyStamp = "25bf9614ce2c42bb90499a28d9666db3",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4547,6 +4596,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Configcode") b.Property<string>("Configcode")
.HasColumnType("nvarchar(450)"); .HasColumnType("nvarchar(450)");
b.Property<DateTime>("CreatedTime")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2");
b.Property<string>("CustPartCode") b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -4562,6 +4615,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<bool?>("IsReplenished") b.Property<bool?>("IsReplenished")
.HasColumnType("bit"); .HasColumnType("bit");
b.Property<DateTime>("LastUpdate")
.HasColumnType("datetime2");
b.Property<string>("MatchNumber") b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -4595,6 +4651,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("UniqueCode") b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("UpdatedTime")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime2");
b.Property<string>("VinCode") b.Property<string>("VinCode")
.HasColumnType("nvarchar(450)"); .HasColumnType("nvarchar(450)");
@ -4612,13 +4672,16 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasData( b.HasData(
new new
{ {
Id = new Guid("1fad01d0-8122-42d3-bb8f-5fff76230eea"), Id = new Guid("b3183f11-1cb2-48b0-8970-aa641eb5771d"),
ConcurrencyStamp = "302d775f40154c279dbf7bbd37489b46", ConcurrencyStamp = "a7cae35c36f14f5790ff8895f394fa3c",
CreatedTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DeliverBillType = 1, DeliverBillType = 1,
ErpToLoc = "ErpToLoc", ErpToLoc = "ErpToLoc",
LastUpdate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
OrderNum = "OrderNum", OrderNum = "OrderNum",
Qty = 0m, Qty = 0m,
RealPartCode = "PartCode", RealPartCode = "PartCode",
UpdatedTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
VinCode = "VinCode" VinCode = "VinCode"
}); });
}); });
@ -4656,6 +4719,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Configcode") b.Property<string>("Configcode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedTime")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2");
b.Property<string>("CustPartCode") b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -4707,6 +4774,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("UniqueCode") b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("UpdatedTime")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime2");
b.Property<string>("VinCode") b.Property<string>("VinCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -4755,17 +4826,67 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("Name") b.Property<string>("Description")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("Path") b.Property<DateTime>("End")
.HasColumnType("datetime2");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("Start")
.HasColumnType("datetime2");
b.HasKey("Id"); b.HasKey("Id");
b.ToTable("Set_VmiSnapshot"); b.ToTable("Set_VmiSnapshot");
}); });
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiSyncTask", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("LastUpdate")
.HasColumnType("datetime2");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("Number")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Set_VmiSyncTask");
b.HasData(
new
{
Id = new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
ConcurrencyStamp = "2cebf1e28ade4a82a6becea62a0e7a64",
LastUpdate = new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local),
Name = "库存事务备份",
Number = "Set_VmiLog"
},
new
{
Id = new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
ConcurrencyStamp = "245f452a0bd640c2a5fae8be9f72e806",
LastUpdate = new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local),
Name = "库存事务备份",
Number = "Set_VmiBalance"
});
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Boms.BomVersion", b => modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Boms.BomVersion", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")

Loading…
Cancel
Save