Browse Source

update

master
wanggang 1 year ago
parent
commit
49ef480ab5
  1. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-item.js
  2. 37
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/adjust.js
  3. 7
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/backup.js
  4. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/balance.js
  5. 69
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/inventory.js
  6. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js
  7. 46
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/vmi.js
  8. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/styles/site.css
  9. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/backup.js
  10. 176
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  11. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs
  12. 116
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncMessageService.cs
  13. 33
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiAsyncTask.cs
  14. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiShardingRecord.cs
  15. 19
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  16. 5803
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828042700_vmi18.Designer.cs
  17. 186
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828042700_vmi18.cs
  18. 109
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-item.js

@ -8,7 +8,7 @@ export default {
AppFormInput: defineAsyncComponent(() => import("./form-input.js")), AppFormInput: defineAsyncComponent(() => import("./form-input.js")),
}, },
template: html` template: html`
<template v-if="!schema.hidden"> <template v-if="!schema.hidden&&showItem()">
<template v-if="schema.type==='object'"></template> <template v-if="schema.type==='object'"></template>
<template v-else-if="schema.type!=='array'||schema.items?.type!=='array'"> <template v-else-if="schema.type!=='array'||schema.items?.type!=='array'">
<el-form-item <el-form-item

37
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/adjust.js

@ -19,14 +19,39 @@ const deleteMethod = "POST";
const importMethod = "POST"; const importMethod = "POST";
const exportMethod = "POST"; const exportMethod = "POST";
const keys = [
"changedTime",
"realPartCode",
"custPartCode",
"custPartCode",
"codeType",
"deliverBillType",
"changedQty",
"billTime",
"changedNumber",
"assembleData",
"erpToLoc",
"orderNum",
"deliverSubBillType",
"vinCode",
"reMark",
];
export default function () { export default function () {
return { const editSchema = Object.assign({}, schema);
Object.keys(editSchema.properties).forEach((key) => {
if (!keys.some((o) => o === key)) {
delete editSchema.properties[key];
}
});
const result = {
query: { query: {
url: queryUrl, url: queryUrl,
method: queryMethod, method: queryMethod,
hasFilter: true, hasFilter: true,
schema: { schema: {
title: "通用代码", title: "人工库存调整",
type: "object", type: "object",
properties: { properties: {
logTypes: { type: "array", hidden: true, default: ["Type500", "Type600"] }, logTypes: { type: "array", hidden: true, default: ["Type500", "Type600"] },
@ -58,7 +83,7 @@ export default function () {
action: "biggerThanOrEqual", action: "biggerThanOrEqual",
value: null, value: null,
readOnly: true, readOnly: true,
title: "发运开始", title: "变动开始",
default: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"), default: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false, clearable: false,
}, },
@ -68,7 +93,7 @@ export default function () {
action: "smallThan", action: "smallThan",
value: null, value: null,
readOnly: true, readOnly: true,
title: "发运结束", title: "变动结束",
default: dayjs().add(1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"), default: dayjs().add(1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false, clearable: false,
}, },
@ -146,7 +171,9 @@ export default function () {
deleteMethod, deleteMethod,
importMethod, importMethod,
exportMethod, exportMethod,
schema: schema, schema: editSchema,
}, },
}; };
return result;
} }

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

@ -2,6 +2,8 @@ import useBalance from "./balance.js";
export default function () { export default function () {
const result = useBalance(); const result = useBalance();
result.query.disableQueryOnLoad = true;
//result.query.autoSubmit = true;
result.query.schema.properties = Object.assign( result.query.schema.properties = Object.assign(
{ {
name: { name: {
@ -11,11 +13,14 @@ export default function () {
url: "settleaccount/vmi/snapshot", url: "settleaccount/vmi/snapshot",
value: "description", value: "description",
label: "name", label: "name",
defaultSelected: true, //defaultSelected: true,
clearable: false, clearable: false,
}, },
}, },
result.query.schema.properties result.query.schema.properties
); );
result.query.url = "settleaccount/vmi/backup";
result.edit.exportUrl = "settleaccount/vmi/backup-export";
result.edit.backupUrl = "settleaccount/vmi/vmi-backup/invoke";
return result; return result;
} }

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

@ -59,7 +59,6 @@ export default function () {
readOnly: true, readOnly: true,
title: "发运开始", title: "发运开始",
default: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"), default: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false,
}, },
{ {
logic: "and", logic: "and",
@ -69,7 +68,6 @@ export default function () {
readOnly: true, readOnly: true,
title: "发运结束", title: "发运结束",
default: dayjs().add(1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"), default: dayjs().add(1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false,
}, },
{ {
logic: "and", logic: "and",

69
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/inventory.js

@ -1,69 +0,0 @@
const options1 = [
{ value: 0, label: "无" },
{ value: 1, label: "JIS件" },
{ value: 2, label: "JIT直供件" },
{ value: 3, label: "印度件" },
{ value: 4, label: "北汽4S备件" },
];
const options2 = [
{ value: "01", label: "前保" },
{ value: " 02", label: "后保" },
{ value: "03", label: " 左门槛" },
{ value: "04", label: "右门槛" },
{ value: "05", label: "扰流板" },
{ value: "06", label: "前左轮眉" },
{ value: "07", label: "前右轮眉 " },
{ value: "08", label: "后左轮眉" },
{ value: "09", label: "后右轮眉" },
];
const options3 = [
{ value: 0, label: "无" },
{ value: 1, label: "保险杠BBAC" },
{ value: 2, label: "保险杠HBPO" },
{ value: 3, label: "买单件保险杠BBAC" },
{ value: 4, label: "买单件保险杠HBPO" },
{ value: 5, label: "买单件小件BBAC" },
{ value: 6, label: "买单件小件HBPO" },
{ value: 7, label: "小件BBAC" },
{ value: 8, label: "小件HBPO" },
{ value: 9, label: "JIT直供件BBAC" },
{ value: 10, label: "JIT直供件HBPO" },
];
const billType = {
title: "发货类型",
type: "number",
input: "select",
options: options1,
clearable: true,
rules: [
{
required: true,
},
],
};
const codeType = {
title: "生产码类型",
type: "string",
input: "select",
options: options2,
clearable: true,
rules: [
{
required: true,
},
],
};
const subBillType = {
title: "发货子类型",
type: "number",
input: "select",
options: options3,
clearable: true,
rules: [
{
required: true,
},
],
};
export { billType, codeType, subBillType };

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js

@ -59,7 +59,7 @@ export default function () {
action: "biggerThanOrEqual", action: "biggerThanOrEqual",
value: null, value: null,
readOnly: true, readOnly: true,
title: "事务开始", title: "变动开始",
default: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"), default: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false, clearable: false,
}, },
@ -69,7 +69,7 @@ export default function () {
action: "smallThan", action: "smallThan",
value: null, value: null,
readOnly: true, readOnly: true,
title: "事务结束", title: "变动结束",
default: dayjs().add(1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"), default: dayjs().add(1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false, clearable: false,
}, },

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

@ -8,22 +8,38 @@ function useSchema() {
realPartCode: { realPartCode: {
title: "LU零件号", title: "LU零件号",
type: "string", type: "string",
rules: [
{
required: true,
},
],
}, },
custPartCode: { custPartCode: {
title: "客户零件号", title: "客户零件号",
type: "string", type: "string",
rules: [
{
required: true,
},
],
}, },
codeType, codeType,
deliverBillType, deliverBillType,
qty: { qty: {
title: "数量", title: "数量",
type: "string", type: "string",
input: "number",
}, },
rules: [
{
required: true,
},
],
billTime: { billTime: {
title: "发运日期", title: "发运日期",
type: "string", type: "string",
input: "datetime", input: "datetime",
clearable: false, clearable: true,
}, },
assembleData: { assembleData: {
title: "订单日期", title: "订单日期",
@ -33,6 +49,11 @@ function useSchema() {
erpToLoc: { erpToLoc: {
title: "ERP库位", title: "ERP库位",
type: "string", type: "string",
rules: [
{
required: true,
},
],
}, },
seq: { seq: {
title: "EDI顺序号", title: "EDI顺序号",
@ -41,6 +62,11 @@ function useSchema() {
orderNum: { orderNum: {
title: "客户订单号", title: "客户订单号",
type: "string", type: "string",
rules: [
{
required: true,
},
],
}, },
uniqueCode: { uniqueCode: {
title: "塑件唯一码", title: "塑件唯一码",
@ -70,10 +96,16 @@ function useSchema() {
vinCode: { vinCode: {
title: "EDI订单生产码", title: "EDI订单生产码",
type: "string", type: "string",
rules: [
{
required: true,
},
],
}, },
reMark: { reMark: {
title: "备注", title: "备注",
type: "string", type: "string",
input: "textarea",
}, },
}, },
}; };
@ -86,12 +118,18 @@ function useLogSchema() {
changedNumber: { changedNumber: {
title: "变动单号", title: "变动单号",
type: "string", type: "string",
rules: [
{
required: true,
},
],
}, },
changedTime: { changedTime: {
title: "变动时间", title: "变动时间",
type: "string", type: "string",
input: "datetime", input: "datetime",
clearable: false, clearable: false,
readOnly: true,
}, },
changedType: { changedType: {
title: "变动类型", title: "变动类型",
@ -113,6 +151,12 @@ function useLogSchema() {
changedQty: { changedQty: {
title: "变动数量", title: "变动数量",
type: "string", type: "string",
input: "number",
rules: [
{
required: true,
},
],
}, },
isReplenished: { isReplenished: {
type: "boolean", type: "boolean",

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/styles/site.css

@ -124,8 +124,10 @@ a.logo {
} }
.el-select, .el-select,
.el-input-number { .el-input-number,
/* width: 100%; */ .el-date-editor.el-input,
.el-date-editor.el-input__wrapper {
width: 100%;
} }
/* markdown component */ /* markdown component */

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

@ -14,7 +14,7 @@ export default {
const appStore = useAppStore(); const appStore = useAppStore();
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
if (item.path === "invoke") { if (item.path === "invoke") {
const url = "settleaccount/vmi/vmi-backup/invoke"; const url = config.edit.backupUrl;
await appListRef.value.onClick( await appListRef.value.onClick(
async () => { async () => {
const result = await request(url, null, { method: "POST" }, true); const result = await request(url, null, { method: "POST" }, true);

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

@ -8,6 +8,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core; using System.Linq.Dynamic.Core;
using System.Reflection; using System.Reflection;
using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using ClosedXML.Excel; using ClosedXML.Excel;
using LinqToDB.Data; using LinqToDB.Data;
@ -48,7 +49,6 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly INormalEfCoreRepository<VmiBalance, Guid> _balanceRepository; private readonly INormalEfCoreRepository<VmiBalance, Guid> _balanceRepository;
private readonly INormalEfCoreRepository<VmiLog, Guid> _logRepository; private readonly INormalEfCoreRepository<VmiLog, Guid> _logRepository;
private readonly INormalEfCoreRepository<VmiSnapshot, Guid> _snapshotRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer; private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly IHubContext<PageHub> _hubContext; private readonly IHubContext<PageHub> _hubContext;
private readonly ICurrentUser _currentUser; private readonly ICurrentUser _currentUser;
@ -57,7 +57,6 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
IServiceProvider serviceProvider, IServiceProvider serviceProvider,
INormalEfCoreRepository<VmiBalance, Guid> balanceRepository, INormalEfCoreRepository<VmiBalance, Guid> balanceRepository,
INormalEfCoreRepository<VmiLog, Guid> logRepository, INormalEfCoreRepository<VmiLog, Guid> logRepository,
INormalEfCoreRepository<VmiSnapshot, Guid> snapshotRepository,
IBlobContainer<MyFileContainer> fileContainer, IBlobContainer<MyFileContainer> fileContainer,
IHubContext<PageHub> hubContext, IHubContext<PageHub> hubContext,
ICurrentUser currentUser) ICurrentUser currentUser)
@ -66,7 +65,6 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
this._serviceProvider = serviceProvider; this._serviceProvider = serviceProvider;
this._balanceRepository = balanceRepository; this._balanceRepository = balanceRepository;
this._logRepository = logRepository; this._logRepository = logRepository;
this._snapshotRepository = snapshotRepository;
this._fileContainer = fileContainer; this._fileContainer = fileContainer;
this._hubContext = hubContext; this._hubContext = hubContext;
this._currentUser = currentUser; this._currentUser = currentUser;
@ -140,6 +138,7 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
db.SaveChanges(); db.SaveChanges();
db.Database.ExecuteSqlRaw($"select * into {table} from Set_VmiBalance;"); db.Database.ExecuteSqlRaw($"select * into {table} from Set_VmiBalance;");
db.Database.ExecuteSqlRaw($"create clustered index IX_{table}_BillTime on {table} (BillTime)"); db.Database.ExecuteSqlRaw($"create clustered index IX_{table}_BillTime on {table} (BillTime)");
db.Database.ExecuteSqlRaw($"alter table {table} add constraint PK_{table} primary key (Id);");
snapshot.End = DateTime.Now; snapshot.End = DateTime.Now;
transaction.Commit(); transaction.Commit();
return Task.CompletedTask; return Task.CompletedTask;
@ -188,7 +187,7 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
} }
/// <summary> /// <summary>
/// 库存余额导出 /// 1.1库存余额导出
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> BalanceExport(RequestDto input) public async Task<string> BalanceExport(RequestDto input)
@ -201,7 +200,69 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
} }
/// <summary> /// <summary>
/// 2.库存事务查询 /// 快照列表
/// </summary>
[HttpPost]
public async Task<List<VmiSnapshot>> Snapshot()
{
var connectionString = this._serviceProvider.GetRequiredService<IConfiguration>().GetConnectionString("SettleAccountService");
using var connection = new SqlConnection(connectionString);
connection.Open();
var options = new DbContextOptionsBuilder<SettleAccountDbContext>().UseSqlServer(connection).Options;
using var db = new SettleAccountDbContext(options);
var list = db.Set<VmiSnapshot>().AsNoTracking().OrderByDescending(o => o.Start).ToList();
return list;
}
/// <summary>
/// 2.时点库存查询
/// </summary>
[HttpPost]
public async Task<PagedResultDto<VmiBalance>> Backup(BackupListRequest input)
{
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var name = input.Name;
var sql = $"select * from {name}";
var query = db.Set<VmiBalance>().FromSqlRaw(sql);
var filters = input.Filters.ToLambda<VmiBalance>();
if (input.Filters.Count > 0)
{
query = query.Where(input.Filters.ToLambda<VmiBalance>());
}
var totalCount = query.Count();
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting);
var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false);
return new PagedResultDto<VmiBalance>(totalCount, entities);
}
/// <summary>
/// 2.1时点库存导出
/// </summary>
[HttpPost]
public async Task<string> BackupExport(BackupListRequest input)
{
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var name = input.Name;
var sql = $"select * from {name}";
var query = db.Set<VmiBalance>().FromSqlRaw(sql);
var filters = input.Filters.ToLambda<VmiBalance>();
if (input.Filters.Count > 0)
{
query = query.Where(input.Filters.ToLambda<VmiBalance>());
}
var totalCount = query.Count();
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting);
var entities = await query.ToListAsync().ConfigureAwait(false);
var fileName = $"库存快照_{input.Name}.xlsx";
var content = this.GetContent(entities, "库存快照");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName;
}
/// <summary>
/// 3.库存事务查询
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
@ -256,12 +317,12 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
} }
/// <summary> /// <summary>
/// 库存事务导出 /// 3.1库存事务导出
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> LogExport(RequestDto input) public async Task<string> LogExport(RequestDto input)
{ {
var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false);
var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx"; var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx";
var content = this.GetContent(entities, "库存事务_"); var content = this.GetContent(entities, "库存事务_");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
@ -288,22 +349,42 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
/// <param name="log"></param> /// <param name="log"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task EditBalance(VmiLog log) public IActionResult EditBalance(VmiLog log)
{ {
log.SetId(GuidGenerator.Create()); var connectionString = this._serviceProvider.GetRequiredService<IConfiguration>().GetConnectionString("SettleAccountService");
if (log.ChangedQty >= decimal.Zero) using var connection = new SqlConnection(connectionString);
connection.Open();
using var transaction = connection.BeginTransaction();
try
{ {
log.Qty = log.ChangedQty; var options = new DbContextOptionsBuilder<SettleAccountDbContext>().UseSqlServer(connection).Options;
log.LogType = VmiLogType.Type500; using var db = new SettleAccountDbContext(options);
log.ChangedType = VmiType.In; log.SetId(GuidGenerator.Create());
if (log.ChangedQty >= decimal.Zero)
{
log.Qty = log.ChangedQty;
log.LogType = VmiLogType.Type500;
log.ChangedType = VmiType.In;
}
else
{
log.Qty = -log.Qty;
log.LogType = VmiLogType.Type600;
log.ChangedType = VmiType.Out;
}
log.ChangedBy = this._currentUser.UserName;
log.ChangedTime = DateTime.Now;
db.Set<VmiLog>().Add(log);
db.Set<VmiMessage>().Add(new VmiMessage(GuidGenerator.Create()) { Message = JsonSerializer.Serialize(log) });
transaction.Commit();
return new OkResult();
} }
else catch (Exception ex)
{ {
log.Qty = -log.Qty; transaction.Rollback();
log.LogType = VmiLogType.Type600; Console.WriteLine(ex.ToString());
log.ChangedType = VmiType.Out; return new JsonResult(new { code = 400, data = ex.ToString(), message = ex.Message }); ;
} }
log.ChangedBy = this._currentUser.UserName;
} }
/// <summary> /// <summary>
@ -318,67 +399,10 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
var list = this.ImportInternal<VmiLog>(ms.ToArray()); var list = this.ImportInternal<VmiLog>(ms.ToArray());
foreach (var file in list) foreach (var file in list)
{ {
await EditBalance(file).ConfigureAwait(false); EditBalance(file);
} }
} }
/// <summary>
/// 快照列表
/// </summary>
[HttpPost]
public async Task<ListResultDto<VmiSnapshot>> Snapshot()
{
var list = await _snapshotRepository.GetListAsync().ConfigureAwait(false);
return new ListResultDto<VmiSnapshot>(list);
}
/// <summary>
/// 3.时点库存查询
/// </summary>
[HttpPost]
public async Task<PagedResultDto<VmiBalance>> Backup(BackupListRequest input)
{
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var name = input.Name;
var sql = $"select * from {name}";
var query = db.Set<VmiBalance>().FromSqlRaw(sql);
var filters = input.Filters.ToLambda<VmiBalance>();
if (input.Filters.Count > 0)
{
query = query.Where(input.Filters.ToLambda<VmiBalance>());
}
var totalCount = query.Count();
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting);
var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false);
return new PagedResultDto<VmiBalance>(totalCount, entities);
}
/// <summary>
/// 时点库存导出
/// </summary>
[HttpPost]
public async Task<string> BackupExport(BackupListRequest input)
{
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var name = input.Name;
var sql = $"select * from {name}";
var query = db.Set<VmiBalance>().FromSqlRaw(sql);
var filters = input.Filters.ToLambda<VmiBalance>();
if (input.Filters.Count > 0)
{
query = query.Where(input.Filters.ToLambda<VmiBalance>());
}
var totalCount = query.Count();
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting);
var entities = await query.ToListAsync().ConfigureAwait(false);
var fileName = $"库存备份_{input.Name}.xlsx";
var content = this.GetContent(entities, "库存备份");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName;
}
private List<T> ImportInternal<T>(byte[] data) private List<T> ImportInternal<T>(byte[] data)
{ {
var list = new List<T>(); var list = new List<T>();

12
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs

@ -45,20 +45,20 @@ public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransien
{ {
var log = JsonSerializer.Deserialize<VmiLog>(message.Message); var log = JsonSerializer.Deserialize<VmiLog>(message.Message);
//插入分表 //插入分表
var tableName = $"Set_VmiLog_{log.ChangedTime.Year}_{(log.ChangedTime.Month - 1) / 3 + 1}"; var table = $"Set_VmiLog_{log.ChangedTime.Year}_{(log.ChangedTime.Month - 1) / 3 + 1}";
var command = connection.CreateCommand(); var command = connection.CreateCommand();
command.Transaction = transaction; command.Transaction = transaction;
command.CommandText = $"select OBJECT_ID('{tableName}', 'U')"; command.CommandText = $"select OBJECT_ID('{table}', 'U')";
var result = command.ExecuteScalar().ToString(); var result = command.ExecuteScalar().ToString();
if (result == string.Empty) if (result == string.Empty)
{ {
command.CommandText = $"select * into {tableName} from Set_VmiLog where 1=0;"; command.CommandText = $"select * into {table} from Set_VmiLog where 1=0;";
command.CommandText += $"create unique index IX_{tableName}_Id on {tableName} (Id);"; command.CommandText += $"create clustered index IX_{table}_ChangedTime on {table} (ChangedTime);";
command.CommandText += $"create clustered index IX_{tableName}_ChangedTime on {tableName} (ChangedTime);"; db.Database.ExecuteSqlRaw($"alter table {table} add constraint PK_{table} primary key (Id);");
command.ExecuteNonQuery(); command.ExecuteNonQuery();
} }
//插入到分表 //插入到分表
command.CommandText = $"insert into {tableName} select * from Set_VmiLog where id ='{log.Id}'"; command.CommandText = $"insert into {table} select * from Set_VmiLog where id ='{log.Id}'";
//插入库存 //插入库存
var balance = db.Set<VmiBalance>().FirstOrDefault( var balance = db.Set<VmiBalance>().FirstOrDefault(
o => o.DeliverBillType == log.DeliverBillType && o => o.DeliverBillType == log.DeliverBillType &&

116
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncMessageService.cs

@ -1,116 +0,0 @@
using System;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using SettleAccount.Job.SignalR;
using Volo.Abp.Application.Services;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
namespace Win.Sfs.SettleAccount.Entities.BQ;
/// <summary>
/// 消息表定时清理
/// </summary>
public class VmiAsyncMessageService : ApplicationService, IJobService, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public VmiAsyncMessageService(IServiceProvider serviceProvider)
{
this._serviceProvider = serviceProvider;
}
public Task Invoke(IServiceProvider serviceProvider)
{
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
db.Set<VmiMessage>().Where(o => o.isConsumed).BatchDelete();
var count = db.Set<VmiMessage>().Where(o => !o.isConsumed).Count();
scope.ServiceProvider.GetService<IHubContext<PageHub>>().Clients.All.ServerToClient("VmiBalance", count.ToString(), "");
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;
}
}

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

@ -1,33 +0,0 @@
using System;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiSyncTask : Entity<Guid>
{
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; }
}

12
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiShardingRecord.cs

@ -1,12 +0,0 @@
using System;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiShardingRecord : Entity<Guid>
{
public string MainTable { get; set; }
public string ShardingTable { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
}

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

@ -1327,7 +1327,6 @@ namespace Win.Sfs.SettleAccount
o.Configcode o.Configcode
})).IsUnique(); })).IsUnique();
})); }));
//builder.Entity<VmiBalance>().HasData(new VmiBalance(Guid.NewGuid()) { DeliverBillType = EnumDeliverBjBmpBillType.JIS件, RealPartCode = "PartCode", VinCode = "VinCode", ErpToLoc = "ErpToLoc", OrderNum = "OrderNum" });
builder.Entity<VmiLog>(b => builder.Entity<VmiLog>(b =>
{ {
@ -1342,6 +1341,7 @@ namespace Win.Sfs.SettleAccount
{ {
b.ToTable($"{options.TablePrefix}_VmiReplenished", options.Schema); b.ToTable($"{options.TablePrefix}_VmiReplenished", options.Schema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasIndex(o => o.BillTime).IsClustered();
}); });
builder.Entity<VmiSnapshot>(b => builder.Entity<VmiSnapshot>(b =>
@ -1350,21 +1350,10 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention(); b.ConfigureByConvention();
}); });
builder.Entity<VmiSyncTask>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiSyncTask", options.Schema);
b.ConfigureByConvention();
b.Property(o => o.ConcurrencyStamp).HasMaxLength(50).IsConcurrencyToken();
});
//seed //seed
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.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.message".ToGuid()) { Name = "事务消息监控", Cron = "0 0/1 * * * ?", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" });
//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.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" });

5803
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828042700_vmi18.Designer.cs

File diff suppressed because it is too large

186
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828042700_vmi18.cs

@ -0,0 +1,186 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi18 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_VmiSyncTask");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
columns: new[] { "ConcurrencyStamp", "Name" },
values: new object[] { "89413f316dbf4647954b6669de927488", "同步结算库存" });
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
columns: new[] { "ConcurrencyStamp", "Name" },
values: new object[] { "ebb73d81d23c4ed9a6ae59730d163f4b", "事务消息监控" });
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "e581ee4de97a46b1a1c0ba75a101c064");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "a7be915b8a5541c58081c668219edfb7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "1fb801f3cbff422082d888ee8b5dab64");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "df723d768280494e88d49734cc6e55e5");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "93962cebd40f490b9df08b215b2c7bd2");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "1c542463eb8746db949bcda48eabdbd8");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "c5b29d7fa18e4b9cb8bc1e354d10c3ac");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
columns: new[] { "ConcurrencyStamp", "Name" },
values: new object[] { "25ec0d7c647f42d88882c4187af74201", "库存快照备份" });
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "7bbeaa02b39947c089eda7f4b05babb9");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Set_VmiSyncTask",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
LastUpdate = table.Column<DateTime>(type: "datetime2", nullable: false),
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_VmiSyncTask", x => x.Id);
});
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
columns: new[] { "ConcurrencyStamp", "Name" },
values: new object[] { "b282d04b720a4453bac838a6d2702c5e", "同步库存" });
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
columns: new[] { "ConcurrencyStamp", "Name" },
values: new object[] { "af7e13c541954124a384db3d957e96f8", "消息监控" });
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "1c63ae9d135a409da20ef2956f075921");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "7d2a76e6327d46f4a93d15d91794de13");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "448472749b8e4be587a6c8a9079bb4c1");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "ffca086d0a884f118ec61e00c1ea11cf");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "9758552b36a24d20bc4fd3efaa2c828a");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "7ac5c23ffc254496b3bfeac777aceb78");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "a9ef4db8c8c547ff880badc98ecb3fb7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
columns: new[] { "ConcurrencyStamp", "Name" },
values: new object[] { "38598fb3653c48be8f63119787de2df8", "库存快照" });
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "298ad96e7d61427ba492ccdb1db7e900");
}
}
}

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

@ -4445,57 +4445,37 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
ConcurrencyStamp = "3ed217e9603d4496bdef3a001ab0ebec", ConcurrencyStamp = "25ec0d7c647f42d88882c4187af74201",
Cron = "0 0 8 26 *", Cron = "0 0 8 26 *",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "库存快照", Name = "库存快照备份",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService"
}, },
new new
{ {
Id = new Guid("185c5968-e02b-267e-db2f-225fccfc9716"), Id = new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
ConcurrencyStamp = "81072f462eba41b9914f4d4aea716611", ConcurrencyStamp = "89413f316dbf4647954b6669de927488",
Cron = "0 0/1 * * * ?", Cron = "0 0/1 * * * ?",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "同步库存", Name = "同步结算库存",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncBalanceService" Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncBalanceService"
}, },
new new
{ {
Id = new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"), Id = new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
ConcurrencyStamp = "ed944c8844f24f12b7dde63809c8efb4", ConcurrencyStamp = "ebb73d81d23c4ed9a6ae59730d163f4b",
Cron = "0 0/1 * * * ?", Cron = "0 0/1 * * * ?",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "消息监控", Name = "事务消息监控",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService"
},
new
{
Id = new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
ConcurrencyStamp = "7e294c644f7946db8b942f19392c4776",
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 = "da5ea88f24154621ab2f8d9359cfa895",
Cron = "0 0/5 * * * ? *",
IsDisabled = false,
IsRunning = false,
Name = "库存余额同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService"
}, },
new new
{ {
Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
ConcurrencyStamp = "6c6d5badb49649a2a18d3decb6284fce", ConcurrencyStamp = "93962cebd40f490b9df08b215b2c7bd2",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4505,7 +4485,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 = "6ff457ddc814405c9c517c0554d8fa7d", ConcurrencyStamp = "e581ee4de97a46b1a1c0ba75a101c064",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4515,7 +4495,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 = "b1285c03732a43fd87da115020b75c23", ConcurrencyStamp = "1fb801f3cbff422082d888ee8b5dab64",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4525,7 +4505,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 = "7622bd2d62f54b079835ce7a62bf95fe", ConcurrencyStamp = "a7be915b8a5541c58081c668219edfb7",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4535,7 +4515,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 = "4b3d04cc418647a99b64f9f52a100a87", ConcurrencyStamp = "7bbeaa02b39947c089eda7f4b05babb9",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4545,7 +4525,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 = "8c945bdfee354e9c88563c30b9396674", ConcurrencyStamp = "df723d768280494e88d49734cc6e55e5",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4555,7 +4535,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 = "f25821caa51d4bbf95187d3fdd95ce74", ConcurrencyStamp = "c5b29d7fa18e4b9cb8bc1e354d10c3ac",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4565,7 +4545,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 = "24f4ab4ebe854c7184e77ae0150e9659", ConcurrencyStamp = "1c542463eb8746db949bcda48eabdbd8",
Cron = "0 0/30 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
@ -4700,21 +4680,6 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasFilter("[DeliverBillType] IS NOT NULL AND [CodeType] IS NOT NULL AND [RealPartCode] IS NOT NULL AND [VinCode] IS NOT NULL AND [ErpToLoc] IS NOT NULL AND [OrderNum] IS NOT NULL AND [factory] IS NOT NULL AND [Configcode] IS NOT NULL"); .HasFilter("[DeliverBillType] IS NOT NULL AND [CodeType] IS NOT NULL AND [RealPartCode] IS NOT NULL AND [VinCode] IS NOT NULL AND [ErpToLoc] IS NOT NULL AND [OrderNum] IS NOT NULL AND [factory] IS NOT NULL AND [Configcode] IS NOT NULL");
b.ToTable("Set_VmiBalance"); b.ToTable("Set_VmiBalance");
b.HasData(
new
{
Id = new Guid("ba5e008b-7d8e-4b5f-b404-9a57092fab41"),
ConcurrencyStamp = "ebb6e4f20f8c42e1862802982fd5331f",
CreatedTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DeliverBillType = 1,
ErpToLoc = "ErpToLoc",
OrderNum = "OrderNum",
Qty = 0m,
RealPartCode = "PartCode",
UpdatedTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
VinCode = "VinCode"
});
}); });
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiLog", b => modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiLog", b =>
@ -4957,6 +4922,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("BillTime")
.IsClustered();
b.ToTable("Set_VmiReplenished"); b.ToTable("Set_VmiReplenished");
}); });
@ -4983,49 +4951,6 @@ namespace Win.Sfs.SettleAccount.Migrations
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(50)
.HasColumnType("nvarchar(50)");
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 = "a3393ee4620443ac9a692157914f162e",
LastUpdate = new DateTime(2023, 8, 21, 0, 0, 0, 0, DateTimeKind.Local),
Name = "库存事务备份",
Number = "Set_VmiLog"
},
new
{
Id = new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
ConcurrencyStamp = "b4ffe8f9e39f466a948d4f642593d0e9",
LastUpdate = new DateTime(2023, 8, 21, 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