Browse Source

EF迁移

master
mahao 1 year ago
parent
commit
7cb36d8389
  1. 24
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs
  2. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
  3. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs
  4. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  5. 1
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  6. 5288
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.Designer.cs
  7. 38
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.cs
  8. 11
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
  9. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  10. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

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

@ -33,12 +33,12 @@ public class Startup
JobHostdService.AddService(services); JobHostdService.AddService(services);
services.AddSingleton<JobHostdService>(); services.AddSingleton<JobHostdService>();
services.AddHostedService(o => o.GetRequiredService<JobHostdService>()); services.AddHostedService(o => o.GetRequiredService<JobHostdService>());
services.AddTransient<HBPOSeSyncAppService>(); //services.AddTransient<HBPOSeSyncAppService>();
services.AddTransient<BBACSeSyncAppService>(); //services.AddTransient<BBACSeSyncAppService>();
services.AddTransient<ZhiGongBBACSeSyncAppService>(); //services.AddTransient<ZhiGongBBACSeSyncAppService>();
services.AddTransient<ZhiGongHBPOSeSyncAppService>(); //services.AddTransient<ZhiGongHBPOSeSyncAppService>();
services.AddTransient<BeiSeSyncAppService>(); //services.AddTransient<BeiSeSyncAppService>();
services.AddTransient<YinDuSeSyncAppService>(); //services.AddTransient<YinDuSeSyncAppService>();
services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer)); services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer));
services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer()))); services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer())));
services.AddApplication<SettleAccountHttpApiHostModule>(); services.AddApplication<SettleAccountHttpApiHostModule>();
@ -62,12 +62,12 @@ public class Startup
app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub")); app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub"));
app.ApplicationServices.UseScheduler(scheduler => app.ApplicationServices.UseScheduler(scheduler =>
{ {
scheduler.Schedule<HBPOSeSyncAppService>().EveryMinute(); //scheduler.Schedule<HBPOSeSyncAppService>().EveryMinute();
scheduler.Schedule<BBACSeSyncAppService>().EveryMinute(); //scheduler.Schedule<BBACSeSyncAppService>().EveryMinute();
scheduler.Schedule<ZhiGongBBACSeSyncAppService>().EveryMinute(); //scheduler.Schedule<ZhiGongBBACSeSyncAppService>().EveryMinute();
scheduler.Schedule<ZhiGongHBPOSeSyncAppService>().EveryMinute(); //scheduler.Schedule<ZhiGongHBPOSeSyncAppService>().EveryMinute();
scheduler.Schedule<BeiSeSyncAppService>().EveryMinute(); //scheduler.Schedule<BeiSeSyncAppService>().EveryMinute();
scheduler.Schedule<YinDuSeSyncAppService>().EveryMinute(); //scheduler.Schedule<YinDuSeSyncAppService>().EveryMinute();
}); });
var contentTypeProvider = new FileExtensionContentTypeProvider(); var contentTypeProvider = new FileExtensionContentTypeProvider();
contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); contentTypeProvider.Mappings.Add(".mjs", "text/javascript");

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs

@ -120,8 +120,8 @@ public class PUB_SA_DETAIL_SERVICE : SettleAccountApplicationBase<PUB_SA_DETAIL>
customConditionList.Add(new CustomCondition() { Name = "LU", Value = pubSaSeCompareRequestDto.LU }); customConditionList.Add(new CustomCondition() { Name = "LU", Value = pubSaSeCompareRequestDto.LU });
customConditionList.Add(new CustomCondition() { Name = "PN", Value = pubSaSeCompareRequestDto.PN }); customConditionList.Add(new CustomCondition() { Name = "PN", Value = pubSaSeCompareRequestDto.PN });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName }); customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName });
customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = pubSaSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd") }); customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = pubSaSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd 00:00:00") });
customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = pubSaSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd") }); customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = pubSaSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") });
var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, pubSaSeCompareRequestDto.Version, string.Empty, CurrentUser, typeof(PubSaSeCompareExportService), customConditionList, (rs) => var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, pubSaSeCompareRequestDto.Version, string.Empty, CurrentUser, typeof(PubSaSeCompareExportService), customConditionList, (rs) =>
{ {

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs

@ -1,8 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -13,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService, IJobService
{ {
/// <summary> /// <summary>
/// 构造 /// 构造
@ -35,4 +37,10 @@ public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService
BusinessType = EnumBusinessType.ZhiGongJianBBAC BusinessType = EnumBusinessType.ZhiGongJianBBAC
}; };
} }
[ApiExplorerSettings(IgnoreApi = true)]
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke();
}
} }

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs

@ -306,6 +306,14 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp
{ {
} }
/// <summary>
/// 买单件HBPO结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExport
{
}
/// <summary> /// <summary>
/// 备件结算与发运对比明细 /// 备件结算与发运对比明细
/// </summary> /// </summary>

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

@ -1337,6 +1337,7 @@ namespace Win.Sfs.SettleAccount
//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("ZhiGongBBACSeSync".ToGuid()) { Name = "直供件BBAC发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("发运入库".ToGuid()) { Type = VmiType.In, Name = "发运入库", Number = "100" }); //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 = "200" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" }); //builder.Entity<VmiCategory>().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" });

5288
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.Designer.cs

File diff suppressed because it is too large

38
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.cs

@ -0,0 +1,38 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202308081 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "Cron", "HeartBeat", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), "0 0/30 * * * ? ", null, false, false, "直供件BBAC发运同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" });
migrationBuilder.UpdateData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
column: "ConcurrencyStamp",
value: "210607a13a294958a95ea0faddc6eb65");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"));
migrationBuilder.UpdateData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
column: "ConcurrencyStamp",
value: "f0b58114c8bf4491b657f275bd0631b0");
}
}
}

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

@ -4149,6 +4149,15 @@ namespace Win.Sfs.SettleAccount.Migrations
IsRunning = false, IsRunning = false,
Name = "库存快照", Name = "库存快照",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService"
},
new
{
Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
Name = "直供件BBAC发运同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService"
}); });
}); });
@ -4271,7 +4280,7 @@ namespace Win.Sfs.SettleAccount.Migrations
Id = new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"), Id = new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
BillType = 1, BillType = 1,
ConcurrencyStamp = "f0b58114c8bf4491b657f275bd0631b0", ConcurrencyStamp = "210607a13a294958a95ea0faddc6eb65",
DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ErpToLoc = "ErpToLoc", ErpToLoc = "ErpToLoc",
OrderNum = "OrderNum", OrderNum = "OrderNum",

4
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

@ -258,6 +258,10 @@ namespace SettleAccount.Job.Services.Report
case EnumBusinessType.MaiDanJianBBAC: case EnumBusinessType.MaiDanJianBBAC:
break; break;
case EnumBusinessType.MaiDanJianHBPO: case EnumBusinessType.MaiDanJianHBPO:
{
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDetailExports);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName);
}
break; break;
case EnumBusinessType.BeiJian: case EnumBusinessType.BeiJian:
{ {

1
code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

@ -23,6 +23,7 @@ namespace SettleAccount.Job
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianBBAC>(); CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianHBPO>(); CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportBeiJian>(); CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportBeiJian>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportYinDuJian>(); CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportYinDuJian>();
} }

Loading…
Cancel
Save