wanggang
1 year ago
18 changed files with 6207 additions and 434 deletions
@ -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 }; |
@ -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; |
|||
} |
|||
} |
@ -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; } |
|||
} |
@ -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; } |
|||
} |
File diff suppressed because it is too large
@ -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"); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue