学 赵 1 year ago
parent
commit
af7b8b5189
  1. 18
      code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs
  2. 32
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs
  3. 20
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs
  4. 22
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs
  5. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js
  6. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js
  7. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js
  8. 53
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  9. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/config/settings.js
  10. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js
  11. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js
  12. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/locale/index.js
  13. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/main.js
  14. 38
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/account.js
  15. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
  16. 27
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory-detail.js
  17. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js
  18. 11
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
  19. 12
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  20. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/index.js
  21. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/styles/site.css
  22. 17
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/index.js
  23. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js
  24. 64
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/account.js
  25. 23
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/login.js
  26. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
  27. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
  28. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js
  29. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/balance.js
  30. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  31. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs
  32. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  33. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs
  34. 64
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  35. 73
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs
  36. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
  37. 46
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs
  38. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
  39. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
  40. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs
  41. 295
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  42. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs
  43. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  44. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs
  45. 45
      code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumSaSeEdiCompareCategory.cs
  46. 82
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  47. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs
  48. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiAsyncTask.cs
  49. 80
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
  50. 83
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs
  51. 86
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
  52. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiMessage.cs
  53. 39
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiReplenished.cs
  54. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiShardingRecord.cs
  55. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  56. 327
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs
  57. 13
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs
  58. 11
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  59. 5755
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825011303_vmi14.Designer.cs
  60. 330
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825011303_vmi14.cs
  61. 5686
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825061422_vmi15.Designer.cs
  62. 499
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825061422_vmi15.cs
  63. 5842
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825063729_vmi16.Designer.cs
  64. 849
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825063729_vmi16.cs
  65. 5866
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825071603_20230825-1.Designer.cs
  66. 310
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825071603_20230825-1.cs
  67. 191
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
  68. 1
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccount.EntityFrameworkCore.csproj
  69. 183
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaEdiSeCompareExportService.cs
  70. 180
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs
  71. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs
  72. 183
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaEdiSeCompareExportService.cs
  73. 179
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs
  74. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs
  75. 92
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs
  76. 93
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs
  77. 351
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  78. 69
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs
  79. 141
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs
  80. 22
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs
  81. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

18
code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs

@ -1,3 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BaseService.BaseData;
using BaseService.BaseData.Permissions.Dto;
using BaseService.RelationBaseData;
@ -6,10 +10,6 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Omu.ValueInjecter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
@ -25,7 +25,6 @@ using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace BaseService.Systems.UserManagement
{
[Route("api/base/user")]
//[Authorize(IdentityPermissions.Users.Default)]
public class UserAppService : ApplicationService, IUserAppService
{
protected IdentityUserManager UserManager { get; }
@ -417,5 +416,14 @@ namespace BaseService.Systems.UserManagement
await UserManager.DeleteAsync(entity).ConfigureAwait(false);
return new OkResult();
}
[HttpPost]
[Route("{userId}/change-password")]
public async Task ChangePassword(Guid userId, ChangePasswordInput input)
{
var user = await UserManager.GetByIdAsync(userId).ConfigureAwait(false);
var result = await UserManager.ChangePasswordAsync(user, input.CurrentPassword, input.NewPassword).ConfigureAwait(false);
result.CheckErrors();
}
}
}

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

@ -67,22 +67,22 @@ namespace AuthServer.Host
// options.Configuration = configuration["Redis:Configuration"];
//});
context.Services.AddCors(options =>
{
options.AddPolicy(DefaultCorsPolicyName,
builder =>
{
builder.WithOrigins(configuration["App:CorsOrigins"]
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.RemovePostFix("/"))
.ToArray())
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
//context.Services.AddCors(options =>
//{
// options.AddPolicy(DefaultCorsPolicyName,
// builder =>
// {
// builder.WithOrigins(configuration["App:CorsOrigins"]
// .Split(",", StringSplitOptions.RemoveEmptyEntries)
// .Select(o => o.RemovePostFix("/"))
// .ToArray())
// .WithAbpExposedHeaders()
// .SetIsOriginAllowedToAllowWildcardSubdomains()
// .AllowAnyHeader()
// .AllowAnyMethod()
// .AllowCredentials();
// });
//});
Configure<AbpAuditingOptions>(options =>
{

20
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs

@ -15,16 +15,16 @@ public class Program
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true)
.Build();
try
{
new InfluxHelper(configuration).Start();
}
catch (Exception ex)
{
Console.Write("时序数据库启动失败");
Console.Write(ex.ToString());
//throw;
}
//try
//{
// new InfluxHelper(configuration).Start();
//}
//catch (Exception ex)
//{
// Console.Write("时序数据库启动失败");
// Console.Write(ex.ToString());
// //throw;
//}
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(configuration)

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

@ -1,3 +1,4 @@
using System;
using System.IO.Compression;
using System.Linq;
using System.Text.RegularExpressions;
@ -9,16 +10,26 @@ using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using SettleAccount.Job.SignalR;
using ShardingCore;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount;
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.Configure<GzipCompressionProviderOptions>(options => options.Level = CompressionLevel.Fastest);
@ -29,6 +40,16 @@ public class Startup
options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[] { "image/svg+xml" });
});
services.AddScheduler();
services.AddCors(options =>
{
options.AddPolicy("Default", builder =>
{
builder.SetIsOriginAllowed(isOriginAllowed => true)
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials();
});
});
services.AddSingleton<JisBBACSeEdiCompareAppService>();
services.AddSingleton<JisHBPOSeEdiCompareAppService>();
services.AddSignalR(o => o.EnableDetailedErrors = true);
@ -53,6 +74,7 @@ public class Startup
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.UseCors("Default");
app.UseResponseCompression();
app.UseRouting();
app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub"));

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js

@ -2,6 +2,7 @@ async function getLocalizationAsync() {
// const url = "abp/application-configuration";
// const data = (await get(url, null, null, true, true)).data;
return {
legacy: false,
options: [
{
value: "zh",
@ -144,6 +145,9 @@ async function getLocalizationAsync() {
isOnline: "在线",
heartbeat: "心跳",
userAgent: "用户代理",
["Invalid username or password!"]: "用户名或密码错误",
["The user account has been locked out due to invalid login attempts. Please wait a while and try again."]: "用户已锁定,请稍后重试",
["Incorrect password."]: "密码错误",
},
en: {
application: "WTA Framework",

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js

@ -9,7 +9,7 @@ import { dayjs } from "element-plus";
export default {
components: { ElConfigProvider },
template: html`
<el-config-provider :locale="localeMap.get($i18n.locale)">
<el-config-provider :locale="localeMap.get($i18n.locale)" size="small">
<router-view></router-view>
</el-config-provider>
`,

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js

@ -25,9 +25,9 @@ export default {
</el-select>
</template>
<template v-else-if="getInput(schema)==='tabs'">
<el-tabs type="card" v-model="model[prop]" style="height:32px;margin:0;" class="form">
<el-tab-pane key="all" label="全部" :value="null" />
<el-tab-pane v-for="item in options" :key="item.key" :label="item.label" :name="item.value" />
<el-tabs type="card" v-model="model[prop]" style="height:24px;margin:0;" class="form">
<el-tab-pane label="全部" key="all" :name="''" />
<el-tab-pane v-for="item in options" :label="item.label" :name="item.value" />
</el-tabs>
</template>
<template v-else-if="getInput(schema)==='month'||getInput(schema)==='datetime'||getInput(schema)==='datetimerange'">
@ -89,7 +89,7 @@ export default {
styles: html`<style>
.form .el-tabs__header,
.form .el-tabs__item {
height: 32px;
height: 24px;
}
</style>`,
props: ["modelValue", "schema", "prop", "isReadOnly", "mode"],

53
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js

@ -24,7 +24,7 @@ export default {
<app-form inline mode="query" label-position="left" :schema="config.query.schema" v-model="queryModel" @submit="load" :hideButton="true" :isQueryForm="true">
<template v-for="item in filterList.filter(o=>!o.hidden&&o.readOnly)">
<template v-if="config.edit.schema.properties[item.column]?.title">
<el-form-item :label="config.edit.schema.properties[item.column].title">
<el-form-item :label="item.title??config.edit.schema.properties[item.column].title">
<app-form-input v-model="item" :schema="config.edit.schema.properties[item.column]" prop="value" />
</el-form-item>
</template>
@ -145,6 +145,7 @@ export default {
<div style="height:52px;padding-top:20px;">
<el-scrollbar>
<el-pagination
small
v-model:currentPage="pageModel.pageIndex"
v-model:page-size="pageModel.pageSize"
:total="pageModel.total"
@ -210,33 +211,6 @@ export default {
style="height:100%;"
/>
</template>
<template v-else-if="editFormMode==='compare'">
<el-form :model="exportModel" style="height:100%;">
<el-form-item label="选择期间" label-width="100px">
<el-select v-model="exportModel.version">
<el-option v-for="item in versions" :value="item.value" :label="item.label" />
</el-select>
</el-form-item>
<template v-if="isNotJit">
<el-form-item label="发运日期" label-width="100px">
<el-date-picker v-model="exportModel.seStartDateTime" value-format="YYYY-MM-DD" />
<span style="margin:0 .5em;">-</span>
<el-date-picker v-model="exportModel.seEndDateTime" value-format="YYYY-MM-DD" />
</el-form-item>
<el-form-item label="下线日期" label-width="100px">
<el-date-picker v-model="exportModel.downLineStartDateTime" value-format="YYYY-MM-DD" />
<span style="margin:0 .5em;">-</span>
<el-date-picker v-model="exportModel.downLineEndDateTime" value-format="YYYY-MM-DD" />
</el-form-item>
</template>
<el-form-item label="通用码" label-width="100px">
<el-input type="textarea" v-model="exportModel.pn" />
</el-form-item>
<el-form-item label="客户零件号" label-width="100px">
<el-input type="textarea" v-model="exportModel.lu" />
</el-form-item>
</el-form>
</template>
<template v-else-if="editFormMode==='import'">
<app-form
ref="importFormRef"
@ -330,7 +304,7 @@ export default {
const config = reactive(props.config);
// 分页
const pageModel = reactive({
sizeList: [1, 10, 50, 100],
sizeList: [10, 50, 100, 500],
pageIndex: 1,
pageSize: 10,
total: 0,
@ -373,17 +347,6 @@ export default {
const editFormTitle = ref("");
const editFormSchema = ref(null);
const editFormModel = ref(null);
const defaultExportModel = {
version: "",
seStartDateTime: "",
seEndDateTime: "",
downLineStartDateTime: "",
downLineEndDateTime: "",
ln: "",
pn: "",
businessType: route.meta.businessType,
};
const exportModel = ref(defaultExportModel);
//
config.import ??= { schema: { type: "object", properties: {} } };
config.import.schema.properties.files ??= {
@ -657,10 +620,6 @@ export default {
} else if (editFormMode.value === "details") {
dialogVisible.value = false;
editFormMode.value = null;
} else if (editFormMode.value === "compare") {
const url = config.edit.compareUrl;
await request(url, exportModel.value, { method: config.edit.compareMethod });
dialogVisible.value = false;
} else if (editFormMode.value === "import") {
try {
const valid = await importFormRef.value.validate();
@ -842,6 +801,11 @@ export default {
//
getSortModel(queryModel.value);
filterList.value = queryModel.value?.filters ?? [];
filterList.value.forEach((o) => {
if (o.default) {
o.value = o.default.constructor === Function ? o.default() : o.default;
}
});
getColumns(config.table.schema);
// if (props.query) {
// Object.assign(queryModel.value.query, props.query);
@ -885,7 +849,6 @@ export default {
editFormTitle,
editFormSchema,
editFormModel,
exportModel,
importModel,
onPageSizeChange,
onPageIndexChange,

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/config/settings.js

@ -1,5 +1,5 @@
export default {
enableLocale: false,
//baseURL: "http://dev.ccwin-in.com:10582/api",
baseURL: "/api",
// baseURL: "http://dev.ccwin-in.com:16082/api",
baseURL: new URLSearchParams(location.search).get("api") ?? "/api",
};

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js

@ -41,13 +41,7 @@ export default {
v-model="searchModel"
:loading="searchLoading"
>
<el-option
v-for="item in searchOptions"
:key="item.meta.path"
:value="item.meta.path"
:label="item.meta.fullName"
@click="searchChange(item)"
/>
<el-option v-for="item in searchOptions" :key="item.meta.path" :value="item.meta.path" :label="item.meta.fullName" @click="searchChange(item)" />
</el-select>
<el-icon v-model="isDark" @click="toggleDark()" :size="18" class="cursor-pointer">
<ep-sunny v-if="isDark" />
@ -63,7 +57,7 @@ export default {
<img v-if="appStore.user.avatar" />
<ep-user v-else />
</el-icon>
{{ appStore.user.name }}
{{ appStore.user.userName }}
<el-icon class="el-icon--right">
<ep-arrow-down />
</el-icon>
@ -112,9 +106,7 @@ export default {
try {
searchLoading.value = true;
const menus = treeToList(router.getRoutes().find((o) => o.path === "/").children);
searchOptions.value = menus
.filter((o) => !o.children || o.children.length === 0)
.filter((o) => o.meta.fullName.indexOf(query) > -1);
searchOptions.value = menus.filter((o) => !o.children || o.children.length === 0).filter((o) => o.meta.fullName.indexOf(query) > -1);
} finally {
searchLoading.value = false;
}

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js

@ -1,8 +1,9 @@
import html from "html";
import { useAppStore } from "../store/index.js";
import { reload } from "../utils/index.js";
export default {
template: html`<a href="javascript:location.reload(true)" class="logo">
template: html`<a href="javascript:;" @click="reload" class="logo">
<div class="flex h-full items-center">
<img src="/assets/logo.svg" />
<h1 v-if="!appStore.isMenuCollapse">{{$t('application')}}</h1>
@ -12,6 +13,7 @@ export default {
const appStore = useAppStore();
return {
appStore,
reload,
};
},
};

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/locale/index.js

@ -1,13 +1,7 @@
import { createI18n } from "vue-i18n";
import { useAppStore } from "../store/index.js";
import { getLocalizationAsync } from "../api/site.js";
function useLocale() {
const appStore = useAppStore();
const i18n = createI18n({
legacy: false,
...appStore.localization,
});
return i18n;
}
const localization = await getLocalizationAsync();
const i18n = createI18n(localization);
export default useLocale;
export default i18n;

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/main.js

@ -5,12 +5,12 @@ import router from "./router/index.js";
import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import App from "/app.js";
import useLocale from "./locale/index.js";
import i18n from "./locale/index.js";
const app = createApp(App);
app.use(store);
app.use(i18n);
await useAppStore().init();
app.use(useLocale());
app.use(router);
app.use(ElementPlus);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {

38
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/account.js

@ -0,0 +1,38 @@
export default function () {
return {
title: "登录",
type: "object",
properties: {
currentPassword: {
title: "当前密码",
type: "string",
input: "password",
rules: [
{
required: true,
},
],
},
newPassword: {
title: "新密码",
type: "string",
input: "password",
rules: [
{
required: true,
},
],
},
newPassword2: {
title: "确认新密码",
type: "string",
input: "password",
rules: [
{
required: true,
},
],
},
},
};
}

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js

@ -26,7 +26,6 @@ const schema = {
invGroupNum: {
title: "发票分组号",
type: "number",
link: true,
},
businessType,
state,
@ -65,7 +64,8 @@ export default function (businessType, type) {
service = "invoice_service";
}
const queryUrl = `settleaccount/${service}/main-query`;
const exportUrl = `settleaccount/${service}/export-detail`;
const exportUrl = `settleaccount/invoice_service/export`;
const exportGroupUrl = `settleaccount/invoice_service/export-detail`;
const invoiceUrl = `settleaccount/${service}/generate-invoice`;
const receivedUrl = `settleaccount/${service}/received`;
const rejectUrl = `settleaccount/${service}/reject`;
@ -74,6 +74,7 @@ export default function (businessType, type) {
const importUrl = `settleaccount/${service}/excel-import`;
const queryMethod = "POST";
const exportMethod = "POST";
const exportGroupMethod = "POST";
const invoiceMethod = "POST";
const receivedMethod = "POST";
const rejectMethod = "POST";
@ -85,6 +86,7 @@ export default function (businessType, type) {
url: queryUrl,
method: queryMethod,
hasFilter: true,
autoSubmit: true,
schema: {
title: "商务审批",
type: "object",
@ -150,6 +152,7 @@ export default function (businessType, type) {
},
edit: {
exportUrl,
exportGroupUrl,
invoiceUrl,
receivedUrl,
rejectUrl,
@ -157,6 +160,7 @@ export default function (businessType, type) {
approvalUrl,
importUrl,
exportMethod,
exportGroupMethod,
invoiceMethod,
receivedMethod,
rejectMethod,

27
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory-detail.js

@ -6,23 +6,36 @@ const schema = {
type: "object",
properties: {
version,
state: state3,
billNum: {
title: "发票号",
type: "string",
link: true,
},
invGroupNum: {
title: "发票分组号",
type: "string",
},
groupNum: {
title: "结算分组号",
type: "string",
},
settleBillNum: {
title: "关联结算单号",
type: "string",
},
invGroupNum: {
title: "发票分组号",
lu: {
title: "厂内零件号",
type: "string",
},
pn: {
title: "生产码",
type: "string",
},
relu: {
title: "替换零件号",
type: "string",
link: true,
},
site: {
title: "地点",
extend4: {
title: "客户零件号",
type: "string",
},
},

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

@ -1,4 +1,5 @@
import { useLogSchema } from "./vmi.js";
import { dayjs } from "element-plus";
const schema = useLogSchema();
@ -19,6 +20,7 @@ const importMethod = "POST";
const exportMethod = "POST";
export default function () {
console.log(dayjs);
return {
query: {
url: queryUrl,
@ -99,13 +101,19 @@ export default function () {
action: "biggerThanOrEqual",
value: null,
readOnly: true,
title: "发运开始",
default: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false,
},
{
logic: "and",
column: "billTime",
action: "smallThanOrEqual",
action: "smallThan",
value: null,
readOnly: true,
title: "发运结束",
default: dayjs().add(1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"),
clearable: false,
},
],
},

11
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js

@ -4,10 +4,7 @@ import { useAppStore } from "../store/index.js";
import { getFileName } from "../utils/index.js";
import settings from "../config/settings.js";
import { ElMessage, ElMessageBox } from "element-plus";
// const requestSettings = {
// baseURL: "/api",
// };
import i18n from "../locale/index.js";
async function addToken(options) {
if (await isLogin()) {
@ -57,7 +54,6 @@ async function getResult(response) {
result.errors = error;
console.log(error);
}
ElMessageBox.alert(`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`, `${result.errors?.error?.code ?? "错误"}`);
}
return result;
}
@ -94,7 +90,10 @@ async function request(url, data, options, notify = false) {
if (result.data?.code && result.data.code !== 200) {
result.errors = result.data.message ?? result.data.code;
}
if (!result.errors && notify && (!result.data?.code || result.data.code === 200)) {
if (result.errors) {
const message = i18n.global.t(result.errors?.error?.message ?? result.errors?.error?.code ?? result.errors ?? "错误");
ElMessageBox({ title: "提示", message, type: "warning" });
} else if (notify && (!result.data?.code || result.data.code === 200)) {
ElMessage({
type: "success",
message: "操作成功",

12
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js

@ -90,6 +90,7 @@ function createCommerceCheckList(path, business, client, title = "商务审批")
component: "/settle/commerce",
children: [
createButton("query", "title=查询&isTop=true"),
createButton("export", "title=导出&isTop=true&pattern=paged"),
createButton(
"approval",
"title=商务审核通过&isTop=true",
@ -360,10 +361,11 @@ export default [
component: "/settle/finance",
children: [
createButton("query", "title=查询&isTop=true"),
createButton("export", "title=导出&isTop=true&pattern=paged"),
createButton(
"import",
"title=导入开票文件&isTop=true",
(_, q) => q.filters.some((o) => o.column === "state" && o.value === 3) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1)
(_, q) => q.filters.some((o) => o.column === "state" && o.value === 2) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1)
),
createButton(
"approval",
@ -371,13 +373,17 @@ export default [
(_, q) => q.filters.some((o) => o.column === "state" && o.value === 2) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1)
),
createButton("export-group", "title=导出发票分组&pattern=paged"),
createButton("approval", "title=发票重开"),
//createButton("approval", "title=发票重开"),
createButton(
"reject",
"title=退回&isTop=true",
(_, q) => q.filters.some((o) => o.column === "state" && o.value === 2) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1)
),
createButton("sync", "title=同步到QAD&isTop=true"),
createButton(
"sync",
"title=同步到QAD&isTop=true",
(_, q) => q.filters.some((o) => o.column === "state" && o.value === 4) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1)
),
],
},
],

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/index.js

@ -19,6 +19,14 @@ const routes = [
isHidden: true,
},
},
{
path: "/account",
component: () => import("../views/account.js"),
meta: {
title: "用户中心",
isHidden: true,
},
},
{
path: "/403",
component: () => import("../views/403.js"),

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

@ -97,7 +97,7 @@ a.logo {
.el-form--inline .el-form-item__content {
min-width: 192px;
/* height: 32px; */
min-height: 24px;
}
.el-table .cell {
@ -144,7 +144,8 @@ a.logo {
display: none;
}
.el-aside *,
.el-header {
.el-header,
.el-header .el-dropdown-link {
background-color: #141414;
color: #e5eaf3;
}

17
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/index.js

@ -137,16 +137,9 @@ async function importFunction(input) {
return result;
}
function reload() {
location.href = `${location.protocol}//${location.host}${location.pathname}`;
}
export default html;
export {
delay,
persentFormat,
bytesFormat,
format,
schemaToModel,
listToTree,
treeToList,
getProp,
getFileName,
importFunction,
};
export { delay, persentFormat, bytesFormat, format, schemaToModel, listToTree, treeToList, getProp, getFileName, importFunction, reload };

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js

@ -118,9 +118,7 @@ const getRules = (parentSchema, property, data) => {
if (!property.rules) {
return null;
}
const rules = [...(Array.isArray(property.rules) ? property.rules : [property.rules])].map((o) =>
JSON.parse(JSON.stringify(o))
);
const rules = [...(Array.isArray(property.rules) ? property.rules : [property.rules])].map((o) => Object.assign({}, o));
Object.values(rules).forEach((rule) => {
rule.data = data;
rule.schema = parentSchema;

64
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/account.js

@ -0,0 +1,64 @@
import html, { schemaToModel } from "html";
import { reactive } from "vue";
import AppForm from "../components/form/index.js";
import { getUser, setAccessToken } from "../api/user.js";
import router, { refreshRouter } from "../router/index.js";
import request from "../request/index.js";
import LayoutLogo from "../layouts/logo.js";
import LayoutLocale from "../layouts/locale.js";
import LayoutFooter from "../layouts/footer.js";
import { useAppStore } from "../store/index.js";
import useConfig from "../models/account.js";
import { ElMessage } from "element-plus";
export default {
components: { AppForm, LayoutLogo, LayoutLocale, LayoutFooter },
template: html`<el-container>
<el-main class="flex justify-center">
<div>
<div class="flex items-center justify-center">
<layout-logo />
<layout-locale />
</div>
<el-card class="box-card" style="width:400px;">
<app-form :schema="schema" v-model="model" @submit="submit">
<template #submitText>确定</template>
</app-form>
</el-card>
<layout-footer />
</div>
</el-main>
</el-container>`,
setup() {
const schema = useConfig();
const model = reactive(schemaToModel(schema));
schema.properties.newPassword2.rules.push({
validator: (rule, value, callback) => {
if (value !== model.newPassword) {
callback(new Error("确认新密码和新密码必须一致"));
} else {
callback();
}
},
});
const submit = async (callback, loading) => {
try {
const appStore = useAppStore();
const url = `base/user/${appStore.user.id}/change-password`;
const result = await request(url, model, { method: "POST" });
if (!result.errors) {
ElMessage.success("密码修改成功");
}
} catch (error) {
console.log(error);
} finally {
loading.value = false;
}
};
return {
schema,
model,
submit,
};
},
};

23
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/login.js

@ -9,6 +9,8 @@ import LayoutLocale from "../layouts/locale.js";
import LayoutFooter from "../layouts/footer.js";
import { useAppStore } from "../store/index.js";
import useLoginModel from "../models/login.js";
import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n";
export default {
components: { AppForm, LayoutLogo, LayoutLocale, LayoutFooter },
@ -31,20 +33,25 @@ export default {
setup() {
const schema = reactive(useLoginModel());
const model = reactive(schemaToModel(schema));
const { t } = useI18n();
const submit = async (callback, loading) => {
try {
const url = "base/token";
const appStore = useAppStore();
const result = await request(url, model, { method: "POST" });
if (!result.errors) {
appStore.token = result.data.accessToken;
if (appStore.token) {
setAccessToken(appStore.token);
//setRefreshToken(result.data.refresh_token);
appStore.user = await getUser();
await refreshRouter();
const redirect = router.currentRoute.value.query?.redirect ?? "/";
router.push(redirect);
if (result.data?.accessToken) {
appStore.token = result.data.accessToken;
if (appStore.token) {
setAccessToken(appStore.token);
//setRefreshToken(result.data.refresh_token);
appStore.user = await getUser();
await refreshRouter();
const redirect = router.currentRoute.value.query?.redirect ?? "/";
router.push(redirect);
}
} else {
ElMessage.error(t(result.data.errorDescription));
}
}
callback(result.errors);

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js

@ -244,7 +244,7 @@ export default {
};
const columns3 = {
type: "object",
title: "结分组包含不可结算零件",
title: "结分组零件",
properties: {
invGroupNum: {
type: "string",
@ -256,11 +256,11 @@ export default {
},
lu: {
type: "string",
title: "可结算分组号",
title: "零件号",
},
lu1: {
extend1: {
type: "string",
title: "不可结算分组号",
title: "状态",
},
},
};

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js

@ -32,8 +32,8 @@ export default {
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
}
} else if (item.path === "export-group") {
const url = config.edit.exportUrl;
const method = config.edit.exportMethod;
const url = config.edit.exportGroupUrl;
const method = config.edit.exportGroupMethod;
const postData = {
filters: [
{

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js

@ -32,7 +32,7 @@ export default {
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
}
} else if (item.path === "export-group") {
const url = config.edit.exportUrl;
const url = config.edit.exportGroupUrl;
const method = config.edit.exportMethod;
const postData = {
filters: [

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/balance.js

@ -20,13 +20,15 @@ export default {
config.value = useConfig(route.meta?.businessType, route.meta);
let notify = null;
PubSub.subscribe(event, async (_, data) => {
notify?.close();
notify = ElNotification({
position: "bottom-right",
title: "待同步库存数量",
message: data,
duration: 0,
});
if (route.path === "/vmi/balance") {
notify?.close();
notify = ElNotification({
position: "bottom-right",
title: "待同步库存数量",
message: data,
duration: 0,
});
}
});
});
onUnmounted(() => PubSub.unsubscribe(event));

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -152,7 +152,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
var luAssemble = lus.Select(t => t.Replace(" ", ""));
importBBACSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
importBBACSaDetail.CustomerPartCodeNoSpace = importBBACSaDetail.LU.Replace(" ", "");
importBBACSaDetail.Version = Version;
importBBACSaDetail.Site = Site;
});

19
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
@ -48,16 +47,17 @@ public class CompareService : ApplicationService
var customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = ediSeCompareRequestDto.Version });
customConditionList.Add(new CustomCondition() { Name = "LU", Value = ediSeCompareRequestDto.LU });
customConditionList.Add(new CustomCondition() { Name = "PN", Value = ediSeCompareRequestDto.PN });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName });
customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)ediSeCompareRequestDto.BusinessType).ToString() });
customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = ediSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd 00:00:00") });
customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = ediSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") });
customConditionList.Add(new CustomCondition() { Name = "LU", Value = ediSeCompareRequestDto.LU });
customConditionList.Add(new CustomCondition() { Name = "PN", Value = ediSeCompareRequestDto.PN });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName });
var jobMoudle = ediSeCompareRequestDto.BusinessType switch
{
EnumBusinessType.JisBBAC => typeof(JisBBACEdiSeCompareExportService),
EnumBusinessType.JisHBPO => typeof(JisHBPOEdiSeCompareExportService),
EnumBusinessType.JisBBAC => typeof(JisBBACSeEdiCompareExportService),
EnumBusinessType.JisHBPO => typeof(JisHBPOSeEdiCompareExportService),
_ => throw new UserFriendlyException($"{nameof(ediSeCompareRequestDto.BusinessType)}参数值无效", "403")
};
@ -85,14 +85,17 @@ public class CompareService : ApplicationService
var customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = saSeCompareRequestDto.Version });
customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)saSeCompareRequestDto.BusinessType).ToString() });
customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = saSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd 00:00:00") });
customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = saSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") });
customConditionList.Add(new CustomCondition() { Name = "LU", Value = saSeCompareRequestDto.LU });
customConditionList.Add(new CustomCondition() { Name = "PN", Value = saSeCompareRequestDto.PN });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName });
customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = saSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd 00:00:00") });
customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = saSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") });
var jobMoudle = saSeCompareRequestDto.BusinessType switch
{
EnumBusinessType.JisBBAC => typeof(JisBBACSaSeEdiCompareExportService),
EnumBusinessType.JisHBPO => typeof(JisHBPOSaSeEdiCompareExportService),
EnumBusinessType.ZhiGongJianBBAC => typeof(PubSaSeCompareExportService),
EnumBusinessType.ZhiGongJianHBPO => typeof(PubSaSeCompareExportService),
EnumBusinessType.MaiDanJianBBAC => typeof(MaiDanBBACSaSeCompareExportService),

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -436,6 +436,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
var luAssemble = lus.Select(t => t.Replace(" ", ""));
hbpoSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
hbpoSaDetail.CustomerPartCodeNoSpace = hbpoSaDetail.LU.Replace(" ", "");
hbpoSaDetail.Version = Version;
});
}

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

@ -9,7 +9,6 @@ using System.Threading;
using System.Threading.Tasks;
using Cronos;
using Microsoft.AspNetCore.SignalR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SettleAccount.Job.SignalR;
@ -164,6 +163,10 @@ public class JobHostdService : BackgroundService, IApplicationService
}
}
}
catch(CronFormatException ex)
{
Console.WriteLine($"{job.Name},Cron解析失败:{ex.Message},{ex.ToString()}");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
@ -254,7 +257,7 @@ public class JobHostdService : BackgroundService, IApplicationService
private JobItem GetJobItem(Guid id)
{
using var scope = this._serviceProvider.CreateScope();
return scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>().Set<JobItem>().AsNoTracking().FirstOrDefault(o => o.Id == id);
return scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>().Set<JobItem>().FirstOrDefault(o => o.Id == id);
}
private void JobItemHeartBeat(Guid id)
@ -298,7 +301,7 @@ public class JobHostdService : BackgroundService, IApplicationService
this._stoppingToken = stoppingToken;
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var jobs = db.Set<JobItem>().AsNoTracking().ToList();
var jobs = db.Set<JobItem>().ToList();
jobs.ForEach(this.AddJob);
return Task.CompletedTask;
}

64
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -239,6 +239,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
HandleSaDetailLU(importPubSaDetails);
#region 数据校验
var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0)
@ -274,6 +276,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
HandleSaDetailLU(importPubSaDetails);
#region 数据校验
var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0)
@ -302,6 +306,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
HandleSaDetailLU(importPubSaDetails);
#region 数据校验
var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0)
@ -331,6 +337,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
HandleSaDetailLU(importPubSaDetails);
#region 数据校验
var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0)
@ -368,19 +376,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
//验证客户对应厂内零件号是否存在
//导入的零件号集合
var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct();
importPubSaLUs.ForEach(importPubSaLU =>
{
List<string> lus = importPubSaLU.Split(" ").ToList();
importPubSaLU = lus[0].Replace(" ", "");
if (lus.Count > 1)
{
lus.RemoveAt(0);
var luAssemble = lus.Select(t => t.Replace(" ", ""));
importPubSaLU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
});
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
@ -396,6 +391,25 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
#endregion
}
/// <summary>
/// 处理结算数据LU
/// </summary>
/// <param name="pubSaDetails"></param>
private void HandleSaDetailLU(List<PUB_SA_DETAIL> pubSaDetails)
{
pubSaDetails.ForEach(pubSaDetail =>
{
var lus = pubSaDetail.LU.Split(" ").ToList();
pubSaDetail.LU = lus[0].Replace(" ", "");
if (lus.Count > 1)
{
lus.RemoveAt(0);
var luAssemble = lus.Select(t => t.Replace(" ", ""));
pubSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
});
}
/// <summary>
/// 结算数据处理
/// </summary>
@ -408,15 +422,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
pubSaDetails.ForEach(importPubSaDetail =>
{
importPubSaDetail.SetId(GuidGenerator.Create());
List<string> lus = importPubSaDetail.LU.Split(" ").ToList();
importPubSaDetail.LU = lus[0].Replace(" ", "");
if (lus.Count > 1)
{
lus.RemoveAt(0);
var luAssemble = lus.Select(t => t.Replace(" ", ""));
importPubSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
importPubSaDetail.CustomerPartCodeNoSpace = importPubSaDetail.LU.Replace(" ", "");
importPubSaDetail.KeyCode = importPubSaDetail.PN + importPubSaDetail.LU;
importPubSaDetail.Version = _version;
importPubSaDetail.BusinessType = businessType;
@ -449,20 +455,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
//导入的零件号集合
var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
//var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
///*
// * (不存在的客户零件号)差集
// * 转换为厂内零件号
// * 转换规则6个空格替换成“-”
// */
//var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes);
//noExistSettleMaterialCodes.ForEach(t =>
//{
// var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, businessType);
// materialRelationships.Add(materialRelationship);
//});
var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships);
pubSaDetails.ForEach(pubSaDetail =>

73
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Coravel.Invocable;
using EFCore.BulkExtensions;
using LinqToDB;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
@ -38,25 +39,61 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
await HandDelEdiDataAsync().ConfigureAwait(false);
lock (_lockObj)
{
var seDetailGroup = db.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU });
var ediDetailGroup = db.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU });
var keyCodes = seDetailGroup.Join(ediDetailGroup, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (se, edi) => new { se.PN, se.LU }).Take(10000).ToList();
if (keyCodes.Any())
var seDetailGroup = db.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, LU = t.Key.CustomerPartCodeNoSpace });
var ediDetailGroup = db.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU });
var keyCodes = from se in seDetailGroup
from edi in ediDetailGroup
where se.PN == edi.PN && se.LU == edi.LU
select new { se.PN, se.LU };
var seDetailsQuery = from se in db.Set<BBAC_SE_DETAIL>()
from keyCode in keyCodes
where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.LU && se.IsHaveEdiData == false
select se;
var ediDetailsQuery = from edi in db.Set<BBAC_SE_EDI>()
from keyCode in keyCodes
where edi.PN == keyCode.PN && edi.LU == keyCode.LU && edi.IsDeleted == false && edi.IsHaveSeData == false
select edi;
var seDetails = seDetailsQuery.Take(5000).ToList();
var ediDetails = ediDetailsQuery.Take(5000).ToList();
if (seDetails.Any())
{
var seDetails = db.Set<BBAC_SE_DETAIL>().Join(keyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
var ediDetails = db.Set<BBAC_SE_EDI>().Join(keyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
if (seDetails.Any())
{
seDetails.ForEach(t => t.IsHaveEdiData = true);
db.Set<BBAC_SE_DETAIL>().UpdateRange(seDetails);
}
if (ediDetails.Any())
{
ediDetails.ForEach(t => t.IsHaveSeData = true);
db.Set<BBAC_SE_EDI>().UpdateRange(ediDetails);
}
db.SaveChanges();
seDetails.ForEach(t => t.IsHaveEdiData = true);
db.BulkUpdate<BBAC_SE_DETAIL>(seDetails);
}
if (ediDetails.Any())
{
ediDetails.ForEach(t => t.IsHaveSeData = true);
db.BulkUpdate<BBAC_SE_EDI>(ediDetails);
}
db.SaveChanges();
//var keyCodes = seDetailGroup.Join(ediDetailGroup, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (se, edi) => new { se.PN, se.LU }).Take(1000).ToList();
//if (keyCodes.Any())
//{
// var pnLus = keyCodes.GroupBy(t => t.PN).Select(t => new { t.Key, Lus = t.Where(p => p.PN == t.Key).Select(t => t.LU) });
// pnLus.ForEach(pnLu =>
// {
// var pn = pnLu.Key;
// var lus = pnLu.Lus;
// var seDetails = db.Set<BBAC_SE_DETAIL>().Where(t => t.PN == pn && lus.Contains(t.CustomerPartCodeNoSpace));
// var ediDetails = db.Set<BBAC_SE_EDI>().Where(t => t.PN == pn && lus.Contains(t.LU));
// if (seDetails.Any())
// {
// seDetails.ForEach(t => t.IsHaveEdiData = true);
// db.Set<BBAC_SE_DETAIL>().UpdateRange(seDetails);
// }
// if (ediDetails.Any())
// {
// ediDetails.ForEach(t => t.IsHaveSeData = true);
// db.Set<BBAC_SE_EDI>().UpdateRange(ediDetails);
// }
// });
// db.SaveChanges();
//}
}
}
catch (Exception)
@ -83,7 +120,7 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
if (ediDelKeyCodes.Any())
{
var seDetails = db.Set<BBAC_SE_DETAIL>().Join(ediDelKeyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
var seDetails = db.Set<BBAC_SE_DETAIL>().Join(ediDelKeyCodes, a => new { a.PN, LU = a.CustomerPartCodeNoSpace }, b => new { b.PN, b.LU }, (a, b) => a);
var ediDetails = db.Set<BBAC_SE_EDI>().Join(ediDelKeyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
if (seDetails.Any())
{

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs

@ -122,6 +122,7 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
{
t.SetId(GuidGenerator.Create());
t.BusinessType = businessType;
t.CustomerPartCodeNoSpace = t.LU.Replace(" ", "");
t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{
@ -185,6 +186,7 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
{
t.SetId(GuidGenerator.Create());
t.BusinessType = businessType;
t.CustomerPartCodeNoSpace = t.LU.Replace(" ", "");
t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{

46
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs

@ -5,6 +5,7 @@ using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Coravel.Invocable;
using EFCore.BulkExtensions;
using LinqToDB;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
@ -55,25 +56,36 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
await HandDelEdiDataAsync().ConfigureAwait(false);
lock (_lockObj)
{
var seDetailGroup = db.Set<HBPO_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU });
var seDetailGroup = db.Set<HBPO_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, LU = t.Key.CustomerPartCodeNoSpace });
var ediDetailGroup = db.Set<HBPO_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU });
var keyCodes = seDetailGroup.Join(ediDetailGroup, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (se, edi) => new { se.PN, se.LU }).Take(10000).ToList();
if (keyCodes.Any())
var keyCodes = from se in seDetailGroup
from edi in ediDetailGroup
where se.PN == edi.PN && se.LU == edi.LU
select new { se.PN, se.LU };
var seDetailsQuery = from se in db.Set<HBPO_SE_DETAIL>()
from keyCode in keyCodes
where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.LU && se.IsHaveEdiData == false
select se;
var ediDetailsQuery = from edi in db.Set<HBPO_SE_EDI>()
from keyCode in keyCodes
where edi.PN == keyCode.PN && edi.LU == keyCode.LU && edi.IsDeleted == false && edi.IsHaveSeData == false
select edi;
var seDetails = seDetailsQuery.Take(5000).ToList();
var ediDetails = ediDetailsQuery.Take(5000).ToList();
if (seDetails.Any())
{
seDetails.ForEach(t => t.IsHaveEdiData = true);
db.BulkUpdate<HBPO_SE_DETAIL>(seDetails);
}
if (ediDetails.Any())
{
var seDetails = db.Set<HBPO_SE_DETAIL>().Join(keyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
var ediDetails = db.Set<HBPO_SE_EDI>().Join(keyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
if (seDetails.Any())
{
seDetails.ForEach(t => t.IsHaveEdiData = true);
db.Set<HBPO_SE_DETAIL>().UpdateRange(seDetails);
}
if (ediDetails.Any())
{
ediDetails.ForEach(t => t.IsHaveSeData = true);
db.Set<HBPO_SE_EDI>().UpdateRange(ediDetails);
}
db.SaveChanges();
ediDetails.ForEach(t => t.IsHaveSeData = true);
db.BulkUpdate<HBPO_SE_EDI>(ediDetails);
}
db.SaveChanges();
}
}
catch (Exception)
@ -94,7 +106,7 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
if (ediDelKeyCodes.Any())
{
var seDetails = db.Set<HBPO_SE_DETAIL>().Join(ediDelKeyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
var seDetails = db.Set<HBPO_SE_DETAIL>().Join(ediDelKeyCodes, a => new { a.PN, LU = a.CustomerPartCodeNoSpace }, b => new { b.PN, b.LU }, (a, b) => a);
var ediDetails = db.Set<HBPO_SE_EDI>().Join(ediDelKeyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
if (seDetails.Any())
{

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs

@ -122,6 +122,7 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
{
t.SetId(GuidGenerator.Create());
t.BusinessType = businessType;
t.CustomerPartCodeNoSpace = t.LU.Replace(" ", "");
t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{
@ -185,6 +186,7 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
{
t.SetId(GuidGenerator.Create());
t.BusinessType = businessType;
t.CustomerPartCodeNoSpace = t.LU.Replace(" ", "");
t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs

@ -119,6 +119,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
{
t.SetId(GuidGenerator.Create());
t.BusinessType = businessType;
t.CustomerPartCodeNoSpace = t.LU.Replace(" ", "");
t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{

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

@ -23,14 +23,14 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ;
/// <summary>
/// 客户替换件关系
/// 厂内物料替换件关系
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_RePartsRelationship>
{
/// <summary>
/// 客户替换件关系仓储
/// 厂内物料替换件关系仓储
/// </summary>
private readonly INormalEfCoreRepository<TB_RePartsRelationship, Guid> _repository;

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

@ -21,10 +21,9 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Extensions;
using Omu.ValueInjecter;
using Polly;
using RestSharp.Extensions;
using SettleAccount.Job.SignalR;
using SqlSugar;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.BlobStoring;
@ -34,7 +33,6 @@ using Volo.Abp.Validation;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.influxdb;
using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
@ -119,36 +117,6 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
return this.ImportInternal<PUB_ADJ_DETAIL_IMP_DTO>(ms.ToArray());
}
private List<T> ImportInternal<T>(byte[] data)
{
var list = new List<T>();
using var workbook = new XLWorkbook(new MemoryStream(data));
var properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty)
.Where(o => o.GetAttributes<ImporterHeaderAttribute>().Any())
.ToDictionary(o => o.GetAttribute<ImporterHeaderAttribute>().Name, o => o);
var ws = workbook.Worksheets.FirstOrDefault();
for (int rowIndex = 2; rowIndex <= ws.RowsUsed().Count(); rowIndex++)
{
var row = ws.Row(rowIndex);
var model = Activator.CreateInstance<T>();
list.Add(model);
for (var columnIndex = 1; columnIndex < ws.ColumnsUsed().Count(); columnIndex++)
{
var cell = row.Cell(columnIndex);
var headerName = ws.Cell(1, columnIndex).Value.ToString().Trim();
if (properties.TryGetValue(headerName, out var property))
{
var value = cell.Value.ToString();
if (!string.IsNullOrEmpty(value))
{
property.SetValue(model, Convert.ChangeType(value, property.PropertyType));
}
}
}
}
return list;
}
/// <summary>
/// 定时备份:0 0 8 26 * ?
/// </summary>
@ -211,166 +179,7 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
}
/// <summary>
/// 发运入库\反结入库\调整入库
/// </summary>
/// <param name="logType">库存事务类型</param>
/// <param name="changedNumber">关联单号</param>
/// <param name="data">入库数据</param>
/// <returns></returns>
[HttpPost]
public async Task In(VmiLogType logType, string changedNumber, VmiBalance data)
{
await Policy.Handle<Exception>().WaitAndRetryAsync(5, o => TimeSpan.FromSeconds(o), (e, i) =>
{
Console.WriteLine($"入库类型:{logType.GetDisplayName()},重试次数:{i},异常信息:{e.Message}");
}).ExecuteAsync(async () =>
{
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var balance = db.Set<VmiBalance>().FirstOrDefault(
o => o.DeliverBillType == data.DeliverBillType &&
o.CodeType == data.CodeType &&
o.DeliverBillType == data.DeliverBillType &&
o.VinCode == data.VinCode &&
o.ErpToLoc == data.ErpToLoc &&
o.OrderNum == data.OrderNum &&
o.factory == data.factory &&
o.Configcode == data.Configcode);
var log = new VmiLog(GuidGenerator.Create())
{
LogType = logType,
ChangedType = VmiType.In,
ChangedNumber = changedNumber,
ChangedTime = DateTime.Now,
ChangedBy = _currentUser.UserName,
ChangedQty = data.Qty,
};
if (balance == null)
{
balance = new VmiBalance(GuidGenerator.Create());
balance.InjectFrom(data);
await db.Set<VmiBalance>().AddAsync(balance).ConfigureAwait(false);
//新建库存,库存事务种库存备份的初始库存为0
log.InjectFrom(balance);
log.Qty = 0;
}
else
{
//已有库存,直接备份
log.InjectFrom(balance);
var qty = balance.Qty + data.Qty;
if (logType == VmiLogType.Type100)
{
//发运入库,只更新库存
}
else if (logType == VmiLogType.Type300)
{
//反结入库,只更新库存
}
else if (logType == VmiLogType.Type500)
{
//调整入库,更新库存和其他字段
balance.InjectFrom(data);
}
// 加库存
balance.Qty = qty;
if (balance.Qty == decimal.Zero)
{
db.Set<VmiBalance>().Remove(balance);
}
if (logType == VmiLogType.Type100 && balance.Qty < decimal.Zero && data.Qty > 0)
{
log.IsReplenished = true;
}
}
await db.Set<VmiLog>().AddAsync(log).ConfigureAwait(false);
await db.SaveChangesAsync().ConfigureAwait(false);
}).ConfigureAwait(false);
}
/// <summary>
/// 结算出库\退货出库\调整出库
/// </summary>
/// <param name="logType"></param>
/// <param name="changedNumber"></param>
/// <param name="data"></param>
/// <returns></returns>
[HttpPost]
public async Task Out(VmiLogType logType, string changedNumber, VmiLog data)
{
await Policy.Handle<Exception>().WaitAndRetryAsync(5, o => TimeSpan.FromSeconds(o), (e, i) =>
{
Console.WriteLine($"出库类型:{logType.GetDisplayName()},重试次数:{i},异常信息:{e.Message}");
}).ExecuteAsync(async () =>
{
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var balance = db.Set<VmiBalance>().FirstOrDefault(
o => o.DeliverBillType == data.DeliverBillType &&
o.CodeType == data.CodeType &&
o.DeliverBillType == data.DeliverBillType &&
o.VinCode == data.VinCode &&
o.ErpToLoc == data.ErpToLoc &&
o.OrderNum == data.OrderNum &&
o.factory == data.factory &&
o.Configcode == data.Configcode);
var log = new VmiLog(GuidGenerator.Create())
{
LogType = logType,
ChangedType = VmiType.Out,
ChangedNumber = changedNumber,
ChangedTime = DateTime.Now,
ChangedBy = _currentUser.UserName,
ChangedQty = data.Qty,
};
if (balance == null)
{
//负库存出库
balance = new VmiBalance(GuidGenerator.Create());
balance.InjectFrom(data);
//新建库存,库存事务种库存备份的初始库存为0
log.InjectFrom(data);
log.Qty = 0;
// 负库存
balance.Qty = -data.Qty;
await db.Set<VmiBalance>().AddAsync(balance).ConfigureAwait(false);
}
else
{
//已有库存,直接备份
log.InjectFrom(data);//更新附加字段
log.InjectFrom(balance);//备份库存
// 减库存
balance.Qty -= data.Qty; ;
if (logType == VmiLogType.Type200)
{
//结算出库,只更新库存
}
else if (logType == VmiLogType.Type400)
{
//退货出库,只更新库存
}
else if (logType == VmiLogType.Type600)
{
//调整出库,更新库存和其他字段
balance.InjectFrom(data);
}
if (balance.Qty == decimal.Zero)
{
db.Set<VmiBalance>().Remove(balance);
}
}
await db.Set<VmiLog>().AddAsync(log).ConfigureAwait(false);
await db.SaveChangesAsync().ConfigureAwait(false);
}).ConfigureAwait(false);
}
/// <summary>
/// 库存余额查询
/// 1.库存余额查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
@ -396,17 +205,31 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
}
/// <summary>
/// 库存事务查询
/// 2.库存事务查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<PagedResultDto<VmiLog>> Log(LogRequestDto input)
{
var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _logRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var format = "yyyy-MM-dd HH:mm:ssT";
var startValue = input.Filters.FirstOrDefault(o => o.Column == "billTime" && o.Action == EnumFilterAction.BiggerThanOrEqual).Value;
var endValue = input.Filters.FirstOrDefault(o => o.Column == "billTime" && o.Action == EnumFilterAction.BiggerThanOrEqual).Value;
var start = DateTime.Parse(startValue);
var end = DateTime.Parse(endValue);
var sql = $"select * from Set_VmiLog";
var query = db.Set<VmiLog>().FromSqlRaw(sql);
var filters = input.Filters.ToLambda<VmiLog>();
if (input.Filters.Count > 0)
{
query = query.Where(input.Filters.ToLambda<VmiLog>());
}
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<VmiLog>(totalCount, entities);
//return QueryLogFromTSDb(input);
}
/// <summary>
@ -428,7 +251,6 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
[HttpPost]
public async Task<string> ReplenishedExportAsync(RequestDto input)
{
//input.Filters.Add(new FilterCondition { Logic = EnumFilterLogic.And, Action = EnumFilterAction.NotEqual, Column = "IsReplenished", Value = "null" });
var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false);
//IQueryable<VmiLog> query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>());
var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx";
@ -437,56 +259,28 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
return fileName;
}
private PagedResultDto<VmiLog> QueryLogFromTSDb(RequestDto input)
{
var query = new InfluxHelper(_cfg).Query<VmiLog>().Where(input.Filters.ToLambda<VmiLog>());
var count = query.Count();
input.Sorting?.Split(',').Select(o => o.Trim()).Where(o => !string.IsNullOrEmpty(o)).ForEach(o =>
{
var values = o.Split(' ').Select(o => o.Trim()).Where(o => !string.IsNullOrEmpty(o)).ToArray();
if (values.Length == 1)
{
query = query.OrderBy(values[0]);
}
else if (values.Length == 2)
{
if (values[1].ToLowerInvariant() == "desc")
{
query = query.OrderByPropertyName(values[0], SqlSugar.OrderByType.Desc);
}
else
{
query = query.OrderBy(values[0]);
}
}
});
var entities = query.Skip(input.SkipCount).Take(input.MaxResultCount).ToList();
return new PagedResultDto<VmiLog>(count, entities);
}
/// <summary>
/// 人工调整
/// 4.寄售库存调整
/// </summary>
/// <param name="log"></param>
/// <returns></returns>
[HttpPost]
public async Task EditBalance(VmiLog log)
{
if (log.Qty >= decimal.Zero)
log.SetId(GuidGenerator.Create());
if (log.ChangedQty >= decimal.Zero)
{
log.Qty = log.ChangedQty;
log.LogType = VmiLogType.Type500;
log.ChangedType = VmiType.In;
var data = new VmiBalance();
data.InjectFrom(log);
await In(VmiLogType.Type500, null, data).ConfigureAwait(false);
}
else
{
log.Qty = -log.Qty;
log.LogType = VmiLogType.Type600;
log.ChangedType = VmiType.Out;
log.Qty = -log.Qty;
await this.Out(VmiLogType.Type600, null, log).ConfigureAwait(false);
}
log.ChangedBy = this._currentUser.UserName;
}
/// <summary>
@ -516,7 +310,7 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
}
/// <summary>
/// 时点库存查询
/// 3.时点库存查询
/// </summary>
[HttpPost]
public async Task<PagedResultDto<VmiBalance>> Backup(BackupListRequest input)
@ -562,6 +356,36 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
return fileName;
}
private List<T> ImportInternal<T>(byte[] data)
{
var list = new List<T>();
using var workbook = new XLWorkbook(new MemoryStream(data));
var properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty)
.Where(o => o.GetAttributes<ImporterHeaderAttribute>().Any())
.ToDictionary(o => o.GetAttribute<ImporterHeaderAttribute>().Name, o => o);
var ws = workbook.Worksheets.FirstOrDefault();
for (int rowIndex = 2; rowIndex <= ws.RowsUsed().Count(); rowIndex++)
{
var row = ws.Row(rowIndex);
var model = Activator.CreateInstance<T>();
list.Add(model);
for (var columnIndex = 1; columnIndex < ws.ColumnsUsed().Count(); columnIndex++)
{
var cell = row.Cell(columnIndex);
var headerName = ws.Cell(1, columnIndex).Value.ToString().Trim();
if (properties.TryGetValue(headerName, out var property))
{
var value = cell.Value.ToString();
if (!string.IsNullOrEmpty(value))
{
property.SetValue(model, Convert.ChangeType(value, property.PropertyType));
}
}
}
}
return list;
}
private byte[] GetContent<TExport>(List<TExport> entities, string name = "sheet1")
{
using var workbook = new XLWorkbook();
@ -632,6 +456,11 @@ public class VmiAppService : ApplicationService, IJobService, ITransientDependen
}
}
internal Task Out(VmiLogType type200, string v, VmiLog vmiLog)
{
throw new NotImplementedException();
}
//private void SetPropertyValue(PropertyInfo property, VmiLog entity, string value)
//{
// try

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

@ -84,12 +84,10 @@ public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransien
}
if (logType == VmiLogType.Type100 && balance.Qty < decimal.Zero && log.Qty > 0)
{
//更新补货
var log2 = db.Set<VmiLog>().FirstOrDefault(o => o.Id == log.Id);
if (log2 != null)
{
log2.IsReplenished = true;
}
//添加负库存补货记录
var log2 = new VmiReplenished();
log2.InjectFrom(log);
await db.Set<VmiReplenished>().AddAsync(log2).ConfigureAwait(false);
}
}
message.isConsumed = true;

24
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -1139,7 +1139,7 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.OrderNum))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIS_RECORD, HBPO_SE_DETAIL>()
.ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.JISNum))
@ -1150,16 +1150,8 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.OrderNum))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIS_RECORD, PUB_SE_DETAIL>()
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.OrderNum))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIT_RECORD, BBAC_SE_DETAIL>()
.ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.Seq))
@ -1170,7 +1162,7 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.JISNum))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIT_RECORD, HBPO_SE_DETAIL>()
.ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.Seq))
@ -1181,16 +1173,8 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.JISNum))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIT_RECORD, PUB_SE_DETAIL>()
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.JISNum))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_OTHER_RECORD, PUB_SE_DETAIL>()
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData))

16
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs

@ -63,13 +63,21 @@ namespace Win.Sfs.SettleAccount
{
Func<string, IExportJob> accesor = key =>
{
if (key.Equals(typeof(JisBBACEdiSeCompareExportService).FullName))
if (key.Equals(typeof(JisBBACSeEdiCompareExportService).FullName))
{
return implementationFactory.GetService<JisBBACEdiSeCompareExportService>();
return implementationFactory.GetService<JisBBACSeEdiCompareExportService>();
}
if (key.Equals(typeof(JisHBPOEdiSeCompareExportService).FullName))
if (key.Equals(typeof(JisHBPOSeEdiCompareExportService).FullName))
{
return implementationFactory.GetService<JisHBPOEdiSeCompareExportService>();
return implementationFactory.GetService<JisHBPOSeEdiCompareExportService>();
}
if (key.Equals(typeof(JisBBACSaSeEdiCompareExportService).FullName))
{
return implementationFactory.GetService<JisBBACSaSeEdiCompareExportService>();
}
if (key.Equals(typeof(JisHBPOSaSeEdiCompareExportService).FullName))
{
return implementationFactory.GetService<JisHBPOSaSeEdiCompareExportService>();
}
if (key.Equals(typeof(MaiDanBBACSaSeCompareExportService).FullName))
{

45
code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumSaSeEdiCompareCategory.cs

@ -0,0 +1,45 @@
using System.ComponentModel.DataAnnotations;
namespace Win.Sfs.SettleAccount.Enums;
/// <summary>
/// 结算、发运、Edi比对类型
/// </summary>
public enum EnumSaSeEdiCompareCategory
{
/// <summary>
/// 未定义
/// </summary>
[Display(Name = "未定义")]
None = 0,
/// <summary>
/// 有结算有发运(有EDI数据)
/// </summary>
[Display(Name = "有结算有发运(有EDI数据")]
HaveSaHaveSeHaveEdi = 1,
/// <summary>
/// 有结算有发运(无EDI数据)
/// </summary>
[Display(Name = "有结算有发运(无EDI数据)")]
HaveSaHaveSeNotHaveEdi = 2,
/// <summary>
/// 有结算无发运(有EDI数据)
/// </summary>
[Display(Name = "有结算无发运(有EDI数据)")]
HaveSaNotHaveSeHaveEdi = 3,
/// <summary>
/// 有结算无发运(无EDI数据)
/// </summary>
[Display(Name = "有结算无发运(无EDI数据)")]
HaveSaNotHaveSeNotHaveEdi = 4,
/// <summary>
/// 无结算有发运(有EDI数据)
/// </summary>
[Display(Name = "无结算有发运(有EDI数据)")]
NotHaveSaHaveSeHaveEdi = 5,
/// <summary>
/// 无结算有发运(无EDI数据)
/// </summary>
[Display(Name = "无结算有发运(无EDI数据)")]
NotHaveSaHaveSeNotHaveEdi = 6
}

82
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs

@ -94,7 +94,7 @@ namespace SettleAccount.Bases
[Display(Name = "关联结算单号")]
public virtual string SettleBillNum { get; set; } = null!;
/// <summary>
/// 可结算单状态
/// </summary>
@ -170,7 +170,7 @@ namespace SettleAccount.Bases
/// 结算日期
/// </summary>
public DateTime SettleDate { set; get; }
public string InvGroupNum { set; get; }
/// <summary>
/// 结算分组号
@ -195,7 +195,7 @@ namespace SettleAccount.Bases
/// <summary>
/// 结算日期
/// </summary>
public DateTime SettleDate { set; get;}
public DateTime SettleDate { set; get; }
/// <summary>
/// 结算分组号
/// </summary>
@ -220,7 +220,7 @@ namespace SettleAccount.Bases
}
public class RE_BASE :FullAuditedAggregateRoot<Guid>, IRE_BASE
public class RE_BASE : FullAuditedAggregateRoot<Guid>, IRE_BASE
{
public RE_BASE()
{
@ -240,18 +240,18 @@ namespace SettleAccount.Bases
/// <summary>
/// 零件號
/// </summary>
public string LU { get; set ; }
public string LU { get; set; }
/// <summary>
/// 發貨單號、
/// </summary>
public string PN { get; set ; }
public string PN { get; set; }
/// <summary>
///
/// </summary>
public string KeyCode { get; set ; }
public string KeyCode { get; set; }
}
@ -260,18 +260,18 @@ namespace SettleAccount.Bases
public interface ISE_BASE : ISBASE
{
/// <summary>
/// 期间
/// </summary>
public int Version { set; get; }
/// <summary>
/// 发货时间
/// </summary>
public DateTime ShippingDate { set; get; }
/// <summary>
/// 发运单号
/// </summary>
public string WmsBillNum { set; get; }
/// <summary>
/// 期间
/// </summary>
public int Version { set; get; }
/// <summary>
/// 发货时间
/// </summary>
public DateTime ShippingDate { set; get; }
/// <summary>
/// 发运单号
/// </summary>
public string WmsBillNum { set; get; }
}
public interface IPD_BASE : ISBASE
@ -300,7 +300,7 @@ namespace SettleAccount.Bases
/// 結算分組號
/// </summary>
public string GroupNum { set; get; }
}
/// <summary>
/// 基类检查设置
@ -318,9 +318,9 @@ namespace SettleAccount.Bases
/// <summary>
/// 是否检查BOM
/// </summary>
public bool IsBom { set; get; }
public bool IsBom { set; get; }
public bool IsPriceList { set; get; }
public bool IsPriceList { set; get; }
public BASE_CONF(bool isRelationShip, bool isMaterial, bool isBom)
@ -335,12 +335,12 @@ namespace SettleAccount.Bases
}
}
public class SA_BASE : AuditedAggregateRoot<Guid>, ISA_BASE
{
public SA_BASE() { }
public SA_BASE(Guid id) : base(id) { }
@ -364,29 +364,34 @@ namespace SettleAccount.Bases
/// <summary>
/// 客户物料号
/// </summary>
public virtual string LU { get ; set ; }
public virtual string LU { get; set; }
/// <summary>
/// 客户零件号(无空格)
/// </summary>
[MaxLength(100)]
public string CustomerPartCodeNoSpace { get; set; }
/// <summary>
/// 生產號
/// </summary>
public virtual string PN { get; set ; }
public virtual string PN { get; set; }
/// <summary>
/// 組合鍵值(LU+PN)
/// </summary>
public virtual string KeyCode { get ; set ; }
public virtual string KeyCode { get; set; }
/// <summary>
/// 數量
/// </summary>
public virtual decimal Qty { get ; set ; }
public virtual decimal Qty { get; set; }
/// <summary>
/// 結算分組號
/// </summary>
public virtual string GroupNum { get ; set ; }
public virtual string GroupNum { get; set; }
/// <summary>
/// 厂内物料号
/// </summary>
public virtual string PartCode { get; set; }
@ -403,7 +408,7 @@ namespace SettleAccount.Bases
public SA_CAN_BASE(Guid id) : base(id) { Id = id; }
/// <summary>
@ -453,7 +458,7 @@ namespace SettleAccount.Bases
public string InvbillNum { get; set; }
public string ErpLoc { get; set; }=string.Empty;
public string ErpLoc { get; set; } = string.Empty;
public string PartCode { get; set; }
public string RealPartCode { get; set; }
@ -569,6 +574,11 @@ namespace SettleAccount.Bases
/// </summary>
public string LU { get; set; }
/// <summary>
/// 客户零件号(无空格)
/// </summary>
[MaxLength(100)]
public string CustomerPartCodeNoSpace { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
public string FactoryPartCode { get; set; }
@ -627,11 +637,11 @@ namespace SettleAccount.Bases
/// <summary>
/// LU(零件号)
/// </summary>
public string LU { get ; set; }
public string LU { get; set; }
/// <summary>
/// 生产号、发货单号、交付单号等
/// </summary>
public string PN { get ; set; }
public string PN { get; set; }
/// <summary>
/// 替换LU
/// </summary>

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

@ -4,7 +4,7 @@ using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class JobItem : Entity<Guid>, IHasConcurrencyStamp
public class JobItem : Entity<Guid>
{
public JobItem()
{

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

@ -3,7 +3,7 @@ using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiSyncTask : Entity<Guid>, IHasConcurrencyStamp
public class VmiSyncTask : Entity<Guid>
{
public VmiSyncTask()
{

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

@ -1,14 +1,8 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
/// <summary>
/// ERP库位+零件号+生产码
/// </summary>
public class VmiBalance : Entity<Guid>, IHasConcurrencyStamp
public class VmiBalance : VmiBalanceBase
{
public VmiBalance()
{
@ -20,79 +14,7 @@ public class VmiBalance : Entity<Guid>, IHasConcurrencyStamp
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
//同步时间戳
public DateTime LastUpdate { get; set; }
public string ConcurrencyStamp { get; set; }
[Display(Name = "LU零件号", Order = 6)]
public string RealPartCode { get; set; }
[Display(Name = "客户零件号", Order = 7)]
public string CustPartCode { get; set; }
[Display(Name = "生产码类型", Order = 8)]
public string CodeType { get; set; }
[Display(Name = "发货类型", Order = 9)]
public EnumDeliverBjBmpBillType? DeliverBillType { get; set; }
[Display(Name = "数量", Order = 10)]
public decimal Qty { get; set; }
[Display(Name = "发运日期", Order = 11)]
public DateTime? BillTime { get; set; }
[Display(Name = "订单日期", Order = 12)]
public DateTime? AssembleData { get; set; }
[Display(Name = "ERP库位", Order = 13)]
public string ErpToLoc { get; set; }
[Display(Name = "EDI顺序号", Order = 14)]
public string Seq { get; set; }
[Display(Name = "客户订单号", Order = 15)]
public string OrderNum { get; set; }
[Display(Name = "塑件唯一码", Order = 16)]
public string UniqueCode { get; set; }
[Display(Name = "EDI总成号", Order = 17)]
public string MatchNumber { get; set; }
[Display(Name = "PJIS生产顺序号", Order = 18)]
public string PjsNum { get; set; }
[Display(Name = "实际生产码", Order = 19)]
public string RealCode { get; set; }
[Display(Name = "配置码", Order = 20)]
public string Configcode { get; set; }
[Display(Name = "工厂", Order = 21)]
public string factory { get; set; }
[Display(Name = "发货子类型", Order = 22)]
public EnumDeliverSubBillType? DeliverSubBillType { get; set; }
[Display(Name = "EDI订单生产码", Order = 23)]
public string VinCode { get; set; }
[Display(Name = "结算生产码", Order = 24)]
public string SettlementVinCode { get; set; }
[Display(Name = "结算生产码", Order = 25)]
public string SettlementPartCode { get; set; }
[Display(Name = "是否补货", Order = 26)]
public bool? IsReplenished { get; set; }
[Display(Name = "备注", Order = 27)]
public string ReMark { get; set; }
//审计
public DateTime CreatedTime { get; set; }
public DateTime UpdatedTime { get; set; }
}

83
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs

@ -0,0 +1,83 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public abstract class VmiBalanceBase : Entity<Guid>
{
public VmiBalanceBase()
{
}
public VmiBalanceBase(Guid id) : base(id)
{
}
[Display(Name = "LU零件号", Order = 6)]
public string RealPartCode { get; set; }
[Display(Name = "客户零件号", Order = 7)]
public string CustPartCode { get; set; }
[Display(Name = "生产码类型", Order = 8)]
public string CodeType { get; set; }
[Display(Name = "发货类型", Order = 9)]
public EnumDeliverBjBmpBillType? DeliverBillType { get; set; }
[Display(Name = "数量", Order = 10)]
public decimal Qty { get; set; }
[Display(Name = "发运日期", Order = 11)]
public DateTime? BillTime { get; set; }
[Display(Name = "订单日期", Order = 12)]
public DateTime? AssembleData { get; set; }
[Display(Name = "ERP库位", Order = 13)]
public string ErpToLoc { get; set; }
[Display(Name = "EDI顺序号", Order = 14)]
public string Seq { get; set; }
[Display(Name = "客户订单号", Order = 15)]
public string OrderNum { get; set; }
[Display(Name = "塑件唯一码", Order = 16)]
public string UniqueCode { get; set; }
[Display(Name = "EDI总成号", Order = 17)]
public string MatchNumber { get; set; }
[Display(Name = "PJIS生产顺序号", Order = 18)]
public string PjsNum { get; set; }
[Display(Name = "实际生产码", Order = 19)]
public string RealCode { get; set; }
[Display(Name = "配置码", Order = 20)]
public string Configcode { get; set; }
[Display(Name = "工厂", Order = 21)]
public string factory { get; set; }
[Display(Name = "发货子类型", Order = 22)]
public EnumDeliverSubBillType? DeliverSubBillType { get; set; }
[Display(Name = "EDI订单生产码", Order = 23)]
public string VinCode { get; set; }
[Display(Name = "结算生产码", Order = 24)]
public string SettlementVinCode { get; set; }
[Display(Name = "结算生产码", Order = 25)]
public string SettlementPartCode { get; set; }
[Display(Name = "是否补货", Order = 26)]
public bool? IsReplenished { get; set; }
[Display(Name = "备注", Order = 27)]
public string ReMark { get; set; }
}

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

@ -1,21 +1,26 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
/// <summary>
/// 寄售库存操作记录
/// 库存事务
/// </summary>
public class VmiLog : Entity<Guid>
public class VmiLog : VmiBalanceBase
{
public VmiLog()
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public VmiLog(Guid id) : base(id)
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public void SetId(Guid id)
{
this.Id = id;
}
[Display(Name = "库存事务分类", Order = 0)]
@ -25,7 +30,7 @@ public class VmiLog : Entity<Guid>
public string ChangedNumber { get; set; }
[Display(Name = "变动时间", Order = 2)]
public DateTime ChangedTime { get; set; }
public DateTime ChangedTime { get; set; }=DateTime.Now;
[Display(Name = "变动类型", Order = 3)]
public VmiType ChangedType { get; set; }
@ -36,76 +41,7 @@ public class VmiLog : Entity<Guid>
[Display(Name = "库存变动", Order = 5)]
public decimal ChangedQty { get; set; }
//库存余额
[Display(Name = "LU零件号", Order = 6)]
public string RealPartCode { get; set; }
[Display(Name = "客户零件号", Order = 7)]
public string CustPartCode { get; set; }
[Display(Name = "生产码类型", Order = 8)]
public string CodeType { get; set; }
[Display(Name = "发货类型", Order = 9)]
public EnumDeliverBjBmpBillType? DeliverBillType { get; set; }
[Display(Name = "数量", Order = 10)]
public decimal Qty { get; set; }
[Display(Name = "发运日期", Order = 11)]
public DateTime? BillTime { get; set; }
[Display(Name = "订单日期", Order = 12)]
public DateTime? AssembleData { get; set; }
[Display(Name = "ERP库位", Order = 13)]
public string ErpToLoc { get; set; }
[Display(Name = "EDI顺序号", Order = 14)]
public string Seq { get; set; }
[Display(Name = "客户订单号", Order = 15)]
public string OrderNum { get; set; }
[Display(Name = "塑件唯一码", Order = 16)]
public string UniqueCode { get; set; }
[Display(Name = "EDI总成号", Order = 17)]
public string MatchNumber { get; set; }
[Display(Name = "PJIS生产顺序号", Order = 18)]
public string PjsNum { get; set; }
[Display(Name = "实际生产码", Order = 19)]
public string RealCode { get; set; }
[Display(Name = "配置码", Order = 20)]
public string Configcode { get; set; }
[Display(Name = "工厂", Order = 21)]
public string factory { get; set; }
[Display(Name = "发货子类型", Order = 22)]
public EnumDeliverSubBillType? DeliverSubBillType { get; set; }
[Display(Name = "EDI订单生产码", Order = 23)]
public string VinCode { get; set; }
[Display(Name = "结算生产码", Order = 24)]
public string SettlementVinCode { get; set; }
[Display(Name = "结算生产码", Order = 25)]
public string SettlementPartCode { get; set; }
[Display(Name = "是否补货", Order = 26)]
public bool? IsReplenished { get; set; }
[Display(Name = "备注", Order = 27)]
public string ReMark { get; set; }
//审计
public string ConcurrencyStamp { get; set; }
public DateTime CreatedTime { get; set; }
public DateTime UpdatedTime { get; set; }
}

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiMessage.cs

@ -3,7 +3,7 @@ using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiMessage : Entity<Guid>, IHasConcurrencyStamp
public class VmiMessage : Entity<Guid>
{
public VmiMessage()
{

39
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiReplenished.cs

@ -0,0 +1,39 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiReplenished : VmiBalanceBase
{
public VmiReplenished()
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public VmiReplenished(Guid id) : base(id)
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
[Display(Name = "库存事务分类", Order = 0)]
public VmiLogType LogType { get; set; }
[Display(Name = "变动单号", Order = 1)]
public string ChangedNumber { get; set; }
[Display(Name = "变动时间", Order = 2)]
public DateTime ChangedTime { get; set; }
[Display(Name = "变动类型", Order = 3)]
public VmiType ChangedType { get; set; }
[Display(Name = "便动人", Order = 4)]
public string ChangedBy { get; set; }
[Display(Name = "库存变动", Order = 5)]
public decimal ChangedQty { get; set; }
public string ConcurrencyStamp { get; set; }
public DateTime CreatedTime { get; set; }
public DateTime UpdatedTime { get; set; }
}

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

@ -0,0 +1,12 @@
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; }
}

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

@ -57,6 +57,11 @@ public class PubSaSeCompareDiff
[Display(Name = "生产号")]
public string PN { set; get; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
public string LU { set; get; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
@ -111,10 +116,6 @@ public class PubSaSeCompareDiff
/// 是否已经移除
/// </summary>
public bool IsRemove { get; set; }
/// <summary>
/// 是否替换了厂内零件号
/// </summary>
public bool IsReplace { get; set; }
}
/// <summary>

327
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs

@ -0,0 +1,327 @@
using System;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Win.Sfs.SettleAccount.Enums;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 结算、EDI、发运对比
/// </summary>
public class SaSeEdiCompareDiff
{
/// <summary>
/// 类型
/// </summary>
[Display(Name = "类型")]
public EnumSaSeEdiCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 日顺序号
/// </summary>
[Display(Name = "日顺序号")]
public string SeqNumber { get; set; }
/// <summary>
/// PJIS日顺序号
/// </summary>
[Display(Name = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
public DateTime? CustomerOfflineTime { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
public decimal? SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
public decimal? SEQty { get; set; }
/// <summary>
/// Eid数量
/// </summary>
[Display(Name = "Eid数量")]
public decimal? EdiQty { get; set; }
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
public decimal? FixPrice { get; set; }
/// <summary>
/// 生产号
/// </summary>
[Display(Name = "生产号")]
public string PN { set; get; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
public string ToErpLocCode { get; set; }
/// <summary>
/// Edi客户物料号
/// </summary>
public string EdiCustomerPartCode { get; set; }
/// <summary>
/// 发运客户物料号
/// </summary>
public string SeCustomerPartCode { get; set; }
/// <summary>
/// 发运厂内物料号
/// </summary>
public string SeFactoryPartCode { get; set; }
/// <summary>
/// 结算客户物料号
/// </summary>
public string SaCustomerPartCode { get; set; }
/// <summary>
/// 结算厂内物料号
/// </summary>
public string SaFactoryPartCode { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内物料号
/// </summary>
[Display(Name = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 是否替换了厂内零件号
/// </summary>
public bool IsReplace { get; set; }
}
/// <summary>
/// 结算、发运、Eid对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class SaSeEdiCompareDetailExport
{
}
/// <summary>
/// 结算、发运、Eid对比明细
/// </summary>
public interface ISaSeEdiCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运(有EDI数据)", 1)]
[ValueMapping("有结算有发运(无EDI数据)", 2)]
[ValueMapping("有结算无发运(有EDI数据)", 3)]
[ValueMapping("有结算无发运(无EDI数据)", 4)]
[ValueMapping("无结算有发运(有EDI数据)", 5)]
[ValueMapping("无结算有发运(无EDI数据)", 6)]
public EnumSaSeEdiCompareCategory Category { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// Edi数量
/// </summary>
[Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; }
}
/// <summary>
/// JisBBAC结算、发运、Eid对比明细
/// </summary>
public class SaSeEdiCompareDetailExportJisBBAC : SaSeEdiCompareDetailExport, ISaSeEdiCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运(有EDI数据)", 1)]
[ValueMapping("有结算有发运(无EDI数据)", 2)]
[ValueMapping("有结算无发运(有EDI数据)", 3)]
[ValueMapping("有结算无发运(无EDI数据)", 4)]
[ValueMapping("无结算有发运(有EDI数据)", 5)]
[ValueMapping("无结算有发运(无EDI数据)", 6)]
public EnumSaSeEdiCompareCategory Category { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// Edi数量
/// </summary>
[Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; }
}
/// <summary>
/// JisHBPO结算、发运、Eid对比明细
/// </summary>
public class SaSeEdiCompareDetailExportJisHBPO : SaSeEdiCompareDetailExport, ISaSeEdiCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运(有EDI数据)", 1)]
[ValueMapping("有结算有发运(无EDI数据)", 2)]
[ValueMapping("有结算无发运(有EDI数据)", 3)]
[ValueMapping("有结算无发运(无EDI数据)", 4)]
[ValueMapping("无结算有发运(有EDI数据)", 5)]
[ValueMapping("无结算有发运(无EDI数据)", 6)]
public EnumSaSeEdiCompareCategory Category { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// Edi数量
/// </summary>
[Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; }
}
/// <summary>
/// PUB结算与发运对比汇总
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class SaSeEdiCompareSumExport
{
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "LU")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// Edi数量
/// </summary>
[Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; }
/// <summary>
/// 结算与EDI量差
/// </summary>
[ExporterHeader(DisplayName = "结算与EDI量差")]
public decimal SaEdiQty => SAQty - EdiQty;
/// <summary>
/// WMS发货与EDI数量差
/// </summary>
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal SeEdiQty => SEQty - EdiQty;
}

13
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs

@ -1,11 +1,13 @@
using Microsoft.EntityFrameworkCore;
using ShardingCore.Core.VirtualRoutes.TableRoutes.RouteTails.Abstractions;
using ShardingCore.Sharding.Abstractions;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount
{
[ConnectionStringName("SettleAccountService")]
public class SettleAccountDbContext : AbpDbContext<SettleAccountDbContext>, ISettleAccountDbContext
public class SettleAccountDbContext : AbpDbContext<SettleAccountDbContext>, ISettleAccountDbContext, IShardingDbContext, IShardingTableDbContext
{
/* Add DbSet for each Aggregate Root here. Example:
* public DbSet<Question> Questions { get; set; }
@ -15,14 +17,19 @@ namespace Win.Sfs.SettleAccount
: base(options)
{
this.Database.SetCommandTimeout(System.TimeSpan.FromMinutes(30));
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ConfigureSettleAccount();
}
public IShardingDbContextExecutor GetShardingExecutor()
{
throw new System.NotImplementedException();
}
public IRouteTail RouteTail { get; set; }
}
}

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

@ -1290,7 +1290,7 @@ namespace Win.Sfs.SettleAccount
b.HasIndex(o => o.Name).IsUnique();
b.Property(o => o.Service).HasMaxLength(100).IsRequired();
b.Property(o => o.Cron).HasMaxLength(50).IsRequired();
b.Property(x => x.ConcurrencyStamp).HasMaxLength(50);
b.Property(o => o.ConcurrencyStamp).HasMaxLength(50).IsConcurrencyToken();
});
builder.Entity<JobLog>(b =>
@ -1304,6 +1304,7 @@ namespace Win.Sfs.SettleAccount
b.ToTable($"{options.TablePrefix}_VmiMessage", options.Schema);
b.ConfigureByConvention();
b.Property(o => o.Number).ValueGeneratedOnAdd().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.Property(o => o.ConcurrencyStamp).HasMaxLength(50).IsConcurrencyToken();
});
builder.Entity((Action<EntityTypeBuilder<VmiBalance>>)(b =>
@ -1312,6 +1313,7 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention();
b.Property(o => o.CreatedTime).ValueGeneratedOnAdd().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.Property(o => o.UpdatedTime).ValueGeneratedOnAddOrUpdate().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.Property(o => o.ConcurrencyStamp).HasMaxLength(50).IsConcurrencyToken();
b.HasIndex(o => (new
{
o.DeliverBillType,
@ -1334,6 +1336,12 @@ namespace Win.Sfs.SettleAccount
b.Property(o => o.UpdatedTime).ValueGeneratedOnAddOrUpdate().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
});
builder.Entity<VmiReplenished>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiReplenished", options.Schema);
b.ConfigureByConvention();
});
builder.Entity<VmiSnapshot>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiSnapshot", options.Schema);
@ -1344,6 +1352,7 @@ namespace Win.Sfs.SettleAccount
{
b.ToTable($"{options.TablePrefix}_VmiSyncTask", options.Schema);
b.ConfigureByConvention();
b.Property(o => o.ConcurrencyStamp).HasMaxLength(50).IsConcurrencyToken();
});
//seed

5755
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825011303_vmi14.Designer.cs

File diff suppressed because it is too large

330
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825011303_vmi14.cs

@ -0,0 +1,330 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi14 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("eaaaf238-9865-4851-91d4-faa239bf6fca"));
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "Set_VmiSyncTask",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "Set_VmiMessage",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "Set_VmiBalance",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.CreateTable(
name: "Set_VmiReplenished",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_VmiReplenished", x => x.Id);
table.ForeignKey(
name: "FK_Set_VmiReplenished_Set_VmiLog_Id",
column: x => x.Id,
principalTable: "Set_VmiLog",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "800892b9cac64cb69669dc937238d39d");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "4794bc4fa2ad409ea64cdd2404983475");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "0efcdccaa94d4e7fb550794d50efa9ab");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "1e3131d9f8454d96b0429796010752d3");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "5f427300bdfd44a19eaf54fddde31db1");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
column: "ConcurrencyStamp",
value: "a4c7d3ff7e3b4578bc2332f114c7a6bb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "3ab808a6104c483496414711259c375b");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "4d161eb0a7154f1db4cf7dcca4ffceea");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "9186efa28e7242bf94451f40834c2160");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "742b38d034d94d4685b7f074f35cd3ce");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
column: "ConcurrencyStamp",
value: "98dff4b93f1e4b0ba88a556ab20e7973");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "e25c06d5cdd34b2bbf909e8c655f94fc");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "602c85109f6743a6949bb260b3846ca7");
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("67c5b578-8110-4674-ac1e-c3da0814244a"), null, null, null, "71adabfbf9a74d35985c08ecba2dd537", 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.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
columns: new[] { "ConcurrencyStamp", "LastUpdate" },
values: new object[] { "09290251f9914e5385fbae2fa00c4734", new DateTime(2023, 8, 20, 0, 0, 0, 0, DateTimeKind.Local) });
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
columns: new[] { "ConcurrencyStamp", "LastUpdate" },
values: new object[] { "cecf7d9ac9924ac99b3665395406b3af", new DateTime(2023, 8, 20, 0, 0, 0, 0, DateTimeKind.Local) });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_VmiReplenished");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("67c5b578-8110-4674-ac1e-c3da0814244a"));
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "Set_VmiSyncTask",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "Set_VmiMessage",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "Set_VmiBalance",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "fe58be3c510f477da0752ac73c40d681");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "5b04d6f48ea64f1594b4f54a57b74637");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "f31814e50b6f41f384278fb6f0af0998");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "0198660d53f34e529c1b72060251e05d");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "2c87caef446f428da6f3f243e8d7c3f9");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
column: "ConcurrencyStamp",
value: "613b7650456c4c97a67bcff9c90a32d0");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "b4f16078aa6f43d49da98f03072c7ce9");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "6a28afa95d824c11adf073841328d4d7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "cfd79a067c014e8fa2123fe3d3055af5");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "9df05934dd384f12a55d4469cad4ef08");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
column: "ConcurrencyStamp",
value: "79a28a9f333543219b44e10b1c50d8ef");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "40066948ecb841e4849cfb928b117045");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "134d1d1587d64f3abd932d6bc86d8e57");
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("eaaaf238-9865-4851-91d4-faa239bf6fca"), null, null, null, "506b3fdc042d453fb4ee16c3fc5fa518", 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.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
columns: new[] { "ConcurrencyStamp", "LastUpdate" },
values: new object[] { "f489e433f5f14309810179ef2498ec00", new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local) });
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
columns: new[] { "ConcurrencyStamp", "LastUpdate" },
values: new object[] { "93224b6dfb8347348e757dd7f828d28d", new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local) });
}
}
}

5686
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825061422_vmi15.Designer.cs

File diff suppressed because it is too large

499
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825061422_vmi15.cs

@ -0,0 +1,499 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi15 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("67c5b578-8110-4674-ac1e-c3da0814244a"));
migrationBuilder.DropColumn(
name: "AssembleData",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "BillTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CodeType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "Configcode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CreatedTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CustPartCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "DeliverBillType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "DeliverSubBillType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ErpToLoc",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "IsReplenished",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "MatchNumber",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "OrderNum",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "PjsNum",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "Qty",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ReMark",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "RealCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "RealPartCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "Seq",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "SettlementPartCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "SettlementVinCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "UniqueCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "UpdatedTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "VinCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "factory",
table: "Set_VmiLog");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "4e46d864aae4482e8881952792c6825d");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "ed9901e7e6e9410586a3af9111d2bb59");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "964f6aa5b6304936a93f8504f317c82e");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "79faaa6f20934b64942a91a524a87af3");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "82ac7a04c0fe4c2992bd99c8a6e73be7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
column: "ConcurrencyStamp",
value: "1c2bfef188904011b6aca9ed6af49f44");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "cc3b71fcf18245349951c249c5b56e86");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "c8069ed240614eb4a9872d260d8839b8");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "c273b5a9dcbd4fc4ba7d33f6ef464ed7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "5c56e915398d4e8d92644d811a98c5df");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
column: "ConcurrencyStamp",
value: "8069a183435141cfa0398fe295ec652c");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "e2266fce0ce94b9082a705bb6528b36c");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "54450a20639f479887d74e798aa0f00b");
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("9053e8f6-6f09-42ba-9502-2e7a2f9105c3"), null, null, null, "82e1f152724a4a9882aab30e6cc337cb", 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.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
column: "ConcurrencyStamp",
value: "ed9c903f9b4146aeb682f9e60ebff821");
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
column: "ConcurrencyStamp",
value: "b84bb2ea7bf040368718c5d9063144bf");
migrationBuilder.AddForeignKey(
name: "FK_Set_VmiLog_Set_VmiBalance_Id",
table: "Set_VmiLog",
column: "Id",
principalTable: "Set_VmiBalance",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Set_VmiLog_Set_VmiBalance_Id",
table: "Set_VmiLog");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("9053e8f6-6f09-42ba-9502-2e7a2f9105c3"));
migrationBuilder.AddColumn<DateTime>(
name: "AssembleData",
table: "Set_VmiLog",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "BillTime",
table: "Set_VmiLog",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CodeType",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Configcode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
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<string>(
name: "CustPartCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "DeliverBillType",
table: "Set_VmiLog",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "DeliverSubBillType",
table: "Set_VmiLog",
type: "int",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ErpToLoc",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsReplenished",
table: "Set_VmiLog",
type: "bit",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "MatchNumber",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "OrderNum",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PjsNum",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "Qty",
table: "Set_VmiLog",
type: "decimal(18,2)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<string>(
name: "ReMark",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RealCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RealPartCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Seq",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SettlementPartCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SettlementVinCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "UniqueCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
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<string>(
name: "VinCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "factory",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "800892b9cac64cb69669dc937238d39d");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "4794bc4fa2ad409ea64cdd2404983475");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "0efcdccaa94d4e7fb550794d50efa9ab");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "1e3131d9f8454d96b0429796010752d3");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "5f427300bdfd44a19eaf54fddde31db1");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
column: "ConcurrencyStamp",
value: "a4c7d3ff7e3b4578bc2332f114c7a6bb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "3ab808a6104c483496414711259c375b");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "4d161eb0a7154f1db4cf7dcca4ffceea");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "9186efa28e7242bf94451f40834c2160");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "742b38d034d94d4685b7f074f35cd3ce");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
column: "ConcurrencyStamp",
value: "98dff4b93f1e4b0ba88a556ab20e7973");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "e25c06d5cdd34b2bbf909e8c655f94fc");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "602c85109f6743a6949bb260b3846ca7");
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("67c5b578-8110-4674-ac1e-c3da0814244a"), null, null, null, "71adabfbf9a74d35985c08ecba2dd537", 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.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
column: "ConcurrencyStamp",
value: "09290251f9914e5385fbae2fa00c4734");
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
column: "ConcurrencyStamp",
value: "cecf7d9ac9924ac99b3665395406b3af");
}
}
}

5842
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825063729_vmi16.Designer.cs

File diff suppressed because it is too large

849
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825063729_vmi16.cs

@ -0,0 +1,849 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi16 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Set_VmiLog_Set_VmiBalance_Id",
table: "Set_VmiLog");
migrationBuilder.DropForeignKey(
name: "FK_Set_VmiReplenished_Set_VmiLog_Id",
table: "Set_VmiReplenished");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("9053e8f6-6f09-42ba-9502-2e7a2f9105c3"));
migrationBuilder.DropColumn(
name: "LastUpdate",
table: "Set_VmiBalance");
migrationBuilder.AddColumn<DateTime>(
name: "AssembleData",
table: "Set_VmiReplenished",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "BillTime",
table: "Set_VmiReplenished",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ChangedBy",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ChangedNumber",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "ChangedQty",
table: "Set_VmiReplenished",
type: "decimal(18,2)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<DateTime>(
name: "ChangedTime",
table: "Set_VmiReplenished",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<int>(
name: "ChangedType",
table: "Set_VmiReplenished",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "CodeType",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ConcurrencyStamp",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Configcode",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "CreatedTime",
table: "Set_VmiReplenished",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<string>(
name: "CustPartCode",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "DeliverBillType",
table: "Set_VmiReplenished",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "DeliverSubBillType",
table: "Set_VmiReplenished",
type: "int",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ErpToLoc",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsReplenished",
table: "Set_VmiReplenished",
type: "bit",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "LogType",
table: "Set_VmiReplenished",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "MatchNumber",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "OrderNum",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PjsNum",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "Qty",
table: "Set_VmiReplenished",
type: "decimal(18,2)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<string>(
name: "ReMark",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RealCode",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RealPartCode",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Seq",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SettlementPartCode",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SettlementVinCode",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "UniqueCode",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "UpdatedTime",
table: "Set_VmiReplenished",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<string>(
name: "VinCode",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "factory",
table: "Set_VmiReplenished",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "AssembleData",
table: "Set_VmiLog",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "BillTime",
table: "Set_VmiLog",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CodeType",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ConcurrencyStamp",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Configcode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
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<string>(
name: "CustPartCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "DeliverBillType",
table: "Set_VmiLog",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "DeliverSubBillType",
table: "Set_VmiLog",
type: "int",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ErpToLoc",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsReplenished",
table: "Set_VmiLog",
type: "bit",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "MatchNumber",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "OrderNum",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PjsNum",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "Qty",
table: "Set_VmiLog",
type: "decimal(18,2)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<string>(
name: "ReMark",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RealCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RealPartCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Seq",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SettlementPartCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SettlementVinCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "UniqueCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
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<string>(
name: "VinCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "factory",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "cda3828abfa24e43a7ff9dced0aceaeb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "ebb669926c1d4ab988edfe14269e4b20");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "03159d6b06554bf99cfbbb15d476e386");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "73e9bf92fae34390a12c393f6ed8d163");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "b22b285ec9aa48c8b7ed2aa1f9dd7af6");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
column: "ConcurrencyStamp",
value: "12581a5c89da4c8587f2696f8b02ce62");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "456fe904f19a46349489730351148e28");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "15d1504855924d95abde0dc835de555d");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "f5d16790a44b4367aeeec82ab1a35fd4");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "11cf3dd1955c4da29aa430ed0b9bafdb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
column: "ConcurrencyStamp",
value: "cedf8a69b6474171b18c5fe227b78d26");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "87fd77d7f0e04c4da372a75168619afc");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "6cdaca1650424494980e906bb44eab0f");
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("f12dd04d-4189-4f24-9501-038a2846b84a"), null, null, null, "1200fe51a7b84cfda12141b184958098", null, null, 1, null, "ErpToLoc", null, null, "OrderNum", null, 0m, null, null, "PartCode", null, null, null, null, "VinCode", null });
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
column: "ConcurrencyStamp",
value: "b301dcf7075a41768ced27af9a124f2f");
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
column: "ConcurrencyStamp",
value: "1606b33f2487461fb72fb38851576947");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("f12dd04d-4189-4f24-9501-038a2846b84a"));
migrationBuilder.DropColumn(
name: "AssembleData",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "BillTime",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "ChangedBy",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "ChangedNumber",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "ChangedQty",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "ChangedTime",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "ChangedType",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "CodeType",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "ConcurrencyStamp",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "Configcode",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "CreatedTime",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "CustPartCode",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "DeliverBillType",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "DeliverSubBillType",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "ErpToLoc",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "IsReplenished",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "LogType",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "MatchNumber",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "OrderNum",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "PjsNum",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "Qty",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "ReMark",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "RealCode",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "RealPartCode",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "Seq",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "SettlementPartCode",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "SettlementVinCode",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "UniqueCode",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "UpdatedTime",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "VinCode",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "factory",
table: "Set_VmiReplenished");
migrationBuilder.DropColumn(
name: "AssembleData",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "BillTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CodeType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ConcurrencyStamp",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "Configcode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CreatedTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CustPartCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "DeliverBillType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "DeliverSubBillType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ErpToLoc",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "IsReplenished",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "MatchNumber",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "OrderNum",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "PjsNum",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "Qty",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ReMark",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "RealCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "RealPartCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "Seq",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "SettlementPartCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "SettlementVinCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "UniqueCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "UpdatedTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "VinCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "factory",
table: "Set_VmiLog");
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.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "4e46d864aae4482e8881952792c6825d");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "ed9901e7e6e9410586a3af9111d2bb59");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "964f6aa5b6304936a93f8504f317c82e");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "79faaa6f20934b64942a91a524a87af3");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "82ac7a04c0fe4c2992bd99c8a6e73be7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
column: "ConcurrencyStamp",
value: "1c2bfef188904011b6aca9ed6af49f44");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "cc3b71fcf18245349951c249c5b56e86");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "c8069ed240614eb4a9872d260d8839b8");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "c273b5a9dcbd4fc4ba7d33f6ef464ed7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "5c56e915398d4e8d92644d811a98c5df");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
column: "ConcurrencyStamp",
value: "8069a183435141cfa0398fe295ec652c");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "e2266fce0ce94b9082a705bb6528b36c");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "54450a20639f479887d74e798aa0f00b");
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("9053e8f6-6f09-42ba-9502-2e7a2f9105c3"), null, null, null, "82e1f152724a4a9882aab30e6cc337cb", 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.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
column: "ConcurrencyStamp",
value: "ed9c903f9b4146aeb682f9e60ebff821");
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
column: "ConcurrencyStamp",
value: "b84bb2ea7bf040368718c5d9063144bf");
migrationBuilder.AddForeignKey(
name: "FK_Set_VmiLog_Set_VmiBalance_Id",
table: "Set_VmiLog",
column: "Id",
principalTable: "Set_VmiBalance",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Set_VmiReplenished_Set_VmiLog_Id",
table: "Set_VmiReplenished",
column: "Id",
principalTable: "Set_VmiLog",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

5866
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825071603_20230825-1.Designer.cs

File diff suppressed because it is too large

310
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825071603_20230825-1.cs

@ -0,0 +1,310 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202308251 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("f12dd04d-4189-4f24-9501-038a2846b84a"));
migrationBuilder.AddColumn<string>(
name: "CustomerPartCodeNoSpace",
table: "Set_PUB_SE_DETAIL",
type: "nvarchar(100)",
maxLength: 100,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CustomerPartCodeNoSpace",
table: "Set_PUB_SA_DETAIL",
type: "nvarchar(100)",
maxLength: 100,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CustomerPartCodeNoSpace",
table: "Set_HBPO_SE_DETAIL",
type: "nvarchar(100)",
maxLength: 100,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CustomerPartCodeNoSpace",
table: "Set_HBPO_SA_DETAIL",
type: "nvarchar(100)",
maxLength: 100,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CustomerPartCodeNoSpace",
table: "Set_BBAC_SE_DETAIL",
type: "nvarchar(100)",
maxLength: 100,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CustomerPartCodeNoSpace",
table: "Set_BBAC_SA_DETAIL",
type: "nvarchar(100)",
maxLength: 100,
nullable: true);
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "d6ba8aa579b04d55a23bd4bf24e6ed9f");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "72a5ae8256104547b6d5a41323c3ad84");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "03f4d0ab46de4dfa88a918fe2b3c48fa");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "143f0e0bf5b6446aafe7964aab5fcb1a");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "76e8e365e9ff48e1953f3b14e7e01fe7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
column: "ConcurrencyStamp",
value: "5bdbe6b8c451462983e460c4adcab0f1");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "955009a9778e4cd1b2dfde2aabebabfd");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "8f8d688a37e54d84aeca023750200e2f");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "041fcaa8b49347edb5b46fde3ab1032d");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "9ed27ee117aa41a681a8cdbfb30b2f25");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
column: "ConcurrencyStamp",
value: "b612ac27de904ec5b5fb5371cf427566");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "f8789477c42b476485bd7499b5facce4");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "1b569f48046046b2b908b1a3b327f104");
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("73ceebb1-5b80-48b1-ac38-80334d1f345f"), null, null, null, "bfe48a54e65e4856bd2e768456026105", null, null, 1, null, "ErpToLoc", null, null, "OrderNum", null, 0m, null, null, "PartCode", null, null, null, null, "VinCode", null });
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
column: "ConcurrencyStamp",
value: "25685f349c47487f874b9ac5dc039190");
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
column: "ConcurrencyStamp",
value: "2debe020ac9d4f37b62a52ff564577c2");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("73ceebb1-5b80-48b1-ac38-80334d1f345f"));
migrationBuilder.DropColumn(
name: "CustomerPartCodeNoSpace",
table: "Set_PUB_SE_DETAIL");
migrationBuilder.DropColumn(
name: "CustomerPartCodeNoSpace",
table: "Set_PUB_SA_DETAIL");
migrationBuilder.DropColumn(
name: "CustomerPartCodeNoSpace",
table: "Set_HBPO_SE_DETAIL");
migrationBuilder.DropColumn(
name: "CustomerPartCodeNoSpace",
table: "Set_HBPO_SA_DETAIL");
migrationBuilder.DropColumn(
name: "CustomerPartCodeNoSpace",
table: "Set_BBAC_SE_DETAIL");
migrationBuilder.DropColumn(
name: "CustomerPartCodeNoSpace",
table: "Set_BBAC_SA_DETAIL");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "cda3828abfa24e43a7ff9dced0aceaeb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "ebb669926c1d4ab988edfe14269e4b20");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "03159d6b06554bf99cfbbb15d476e386");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "73e9bf92fae34390a12c393f6ed8d163");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "b22b285ec9aa48c8b7ed2aa1f9dd7af6");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
column: "ConcurrencyStamp",
value: "12581a5c89da4c8587f2696f8b02ce62");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "456fe904f19a46349489730351148e28");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "15d1504855924d95abde0dc835de555d");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "f5d16790a44b4367aeeec82ab1a35fd4");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "11cf3dd1955c4da29aa430ed0b9bafdb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
column: "ConcurrencyStamp",
value: "cedf8a69b6474171b18c5fe227b78d26");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "87fd77d7f0e04c4da372a75168619afc");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "6cdaca1650424494980e906bb44eab0f");
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("f12dd04d-4189-4f24-9501-038a2846b84a"), null, null, null, "1200fe51a7b84cfda12141b184958098", null, null, 1, null, "ErpToLoc", null, null, "OrderNum", null, 0m, null, null, "PartCode", null, null, null, null, "VinCode", null });
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
column: "ConcurrencyStamp",
value: "b301dcf7075a41768ced27af9a124f2f");
migrationBuilder.UpdateData(
table: "Set_VmiSyncTask",
keyColumn: "Id",
keyValue: new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
column: "ConcurrencyStamp",
value: "1606b33f2487461fb72fb38851576947");
}
}
}

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

@ -564,6 +564,10 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerPartCodeNoSpace")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -677,6 +681,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("CustomerPartCodeNoSpace")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
@ -1777,6 +1785,10 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerPartCodeNoSpace")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -1890,6 +1902,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("CustomerPartCodeNoSpace")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
@ -3495,6 +3511,10 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerPartCodeNoSpace")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Extend1")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
@ -3610,6 +3630,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("CustomerPartCodeNoSpace")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
@ -4378,8 +4402,7 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)")
.HasColumnName("ConcurrencyStamp");
.HasColumnType("nvarchar(50)");
b.Property<string>("Cron")
.IsRequired()
@ -4416,7 +4439,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
ConcurrencyStamp = "40066948ecb841e4849cfb928b117045",
ConcurrencyStamp = "f8789477c42b476485bd7499b5facce4",
Cron = "0 0 8 26 *",
IsDisabled = false,
IsRunning = false,
@ -4426,7 +4449,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
ConcurrencyStamp = "fe58be3c510f477da0752ac73c40d681",
ConcurrencyStamp = "d6ba8aa579b04d55a23bd4bf24e6ed9f",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
@ -4436,7 +4459,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
ConcurrencyStamp = "5b04d6f48ea64f1594b4f54a57b74637",
ConcurrencyStamp = "72a5ae8256104547b6d5a41323c3ad84",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
@ -4446,7 +4469,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
ConcurrencyStamp = "613b7650456c4c97a67bcff9c90a32d0",
ConcurrencyStamp = "5bdbe6b8c451462983e460c4adcab0f1",
Cron = "0 0/5 * * * ? *",
IsDisabled = false,
IsRunning = false,
@ -4456,7 +4479,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
ConcurrencyStamp = "79a28a9f333543219b44e10b1c50d8ef",
ConcurrencyStamp = "b612ac27de904ec5b5fb5371cf427566",
Cron = "0 0/5 * * * ? *",
IsDisabled = false,
IsRunning = false,
@ -4466,7 +4489,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
ConcurrencyStamp = "6a28afa95d824c11adf073841328d4d7",
ConcurrencyStamp = "8f8d688a37e54d84aeca023750200e2f",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4476,7 +4499,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
ConcurrencyStamp = "f31814e50b6f41f384278fb6f0af0998",
ConcurrencyStamp = "03f4d0ab46de4dfa88a918fe2b3c48fa",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4486,7 +4509,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
ConcurrencyStamp = "2c87caef446f428da6f3f243e8d7c3f9",
ConcurrencyStamp = "76e8e365e9ff48e1953f3b14e7e01fe7",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4496,7 +4519,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
ConcurrencyStamp = "0198660d53f34e529c1b72060251e05d",
ConcurrencyStamp = "143f0e0bf5b6446aafe7964aab5fcb1a",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4506,7 +4529,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
ConcurrencyStamp = "134d1d1587d64f3abd932d6bc86d8e57",
ConcurrencyStamp = "1b569f48046046b2b908b1a3b327f104",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4516,7 +4539,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
ConcurrencyStamp = "b4f16078aa6f43d49da98f03072c7ce9",
ConcurrencyStamp = "955009a9778e4cd1b2dfde2aabebabfd",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4526,7 +4549,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
ConcurrencyStamp = "9df05934dd384f12a55d4469cad4ef08",
ConcurrencyStamp = "9ed27ee117aa41a681a8cdbfb30b2f25",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4536,7 +4559,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
ConcurrencyStamp = "cfd79a067c014e8fa2123fe3d3055af5",
ConcurrencyStamp = "041fcaa8b49347edb5b46fde3ab1032d",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4593,9 +4616,8 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Configcode")
.HasColumnType("nvarchar(450)");
@ -4619,9 +4641,6 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<bool?>("IsReplenished")
.HasColumnType("bit");
b.Property<DateTime>("LastUpdate")
.HasColumnType("datetime2");
b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)");
@ -4676,12 +4695,11 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasData(
new
{
Id = new Guid("eaaaf238-9865-4851-91d4-faa239bf6fca"),
ConcurrencyStamp = "506b3fdc042d453fb4ee16c3fc5fa518",
Id = new Guid("73ceebb1-5b80-48b1-ac38-80334d1f345f"),
ConcurrencyStamp = "bfe48a54e65e4856bd2e768456026105",
CreatedTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DeliverBillType = 1,
ErpToLoc = "ErpToLoc",
LastUpdate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
OrderNum = "OrderNum",
Qty = 0m,
RealPartCode = "PartCode",
@ -4720,6 +4738,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Configcode")
.HasColumnType("nvarchar(max)");
@ -4801,9 +4822,8 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime>("CreatedTime")
.HasColumnType("datetime2");
@ -4824,6 +4844,110 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_VmiMessage");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiReplenished", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("AssembleData")
.HasColumnType("datetime2");
b.Property<DateTime?>("BillTime")
.HasColumnType("datetime2");
b.Property<string>("ChangedBy")
.HasColumnType("nvarchar(max)");
b.Property<string>("ChangedNumber")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("ChangedQty")
.HasColumnType("decimal(18,2)");
b.Property<DateTime>("ChangedTime")
.HasColumnType("datetime2");
b.Property<int>("ChangedType")
.HasColumnType("int");
b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Configcode")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedTime")
.HasColumnType("datetime2");
b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)");
b.Property<int?>("DeliverBillType")
.HasColumnType("int");
b.Property<int?>("DeliverSubBillType")
.HasColumnType("int");
b.Property<string>("ErpToLoc")
.HasColumnType("nvarchar(max)");
b.Property<bool?>("IsReplenished")
.HasColumnType("bit");
b.Property<int>("LogType")
.HasColumnType("int");
b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrderNum")
.HasColumnType("nvarchar(max)");
b.Property<string>("PjsNum")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ReMark")
.HasColumnType("nvarchar(max)");
b.Property<string>("RealCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("RealPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Seq")
.HasColumnType("nvarchar(max)");
b.Property<string>("SettlementPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("SettlementVinCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("UpdatedTime")
.HasColumnType("datetime2");
b.Property<string>("VinCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("factory")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Set_VmiReplenished");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiSnapshot", b =>
{
b.Property<Guid>("Id")
@ -4855,9 +4979,8 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime>("LastUpdate")
.HasColumnType("datetime2");
@ -4876,16 +4999,16 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
ConcurrencyStamp = "f489e433f5f14309810179ef2498ec00",
LastUpdate = new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local),
ConcurrencyStamp = "25685f349c47487f874b9ac5dc039190",
LastUpdate = new DateTime(2023, 8, 20, 0, 0, 0, 0, DateTimeKind.Local),
Name = "库存事务备份",
Number = "Set_VmiLog"
},
new
{
Id = new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
ConcurrencyStamp = "93224b6dfb8347348e757dd7f828d28d",
LastUpdate = new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local),
ConcurrencyStamp = "2debe020ac9d4f37b62a52ff564577c2",
LastUpdate = new DateTime(2023, 8, 20, 0, 0, 0, 0, DateTimeKind.Local),
Name = "库存余额备份",
Number = "Set_VmiBalance"
});

1
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccount.EntityFrameworkCore.csproj

@ -31,6 +31,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.17" />
<PackageReference Include="ShardingCore" Version="7.5.1.13" />
<PackageReference Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="4.3.3" />
<PackageReference Include="Volo.Abp.Dapper" Version="4.3.3" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="4.3.3" />

183
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaEdiSeCompareExportService.cs

@ -1,183 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Shouldly;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// BBAC结算、Edi、发运对比导出服务
/// </summary>
public class JisBBACSaEdiSeCompareExportService : ITransientDependency, IExportJob
{
/// <summary>
/// HubContext
/// </summary>
private readonly IHubContext<PageHub> _hubContext;
/// <summary>
/// 文件容器
/// </summary>
private readonly IBlobContainer<MyFileContainer> _fileContainer;
/// <summary>
/// DbContext
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary>
/// 构造
/// </summary>
public JisBBACSaEdiSeCompareExportService(
IHubContext<PageHub> hubContext,
IBlobContainer<MyFileContainer> fileContainer,
IObjectMapper objectMapper,
SettleAccountDbContext settleAccountDbContext)
{
_hubContext = hubContext;
_fileContainer = fileContainer;
_settleAccountDbContext = settleAccountDbContext;
}
/// <summary>
/// 导出
/// </summary>
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{
var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
var lu = property.Where(p => p.Name == "LU").FirstOrDefault().Value;
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value;
var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
//有EDI无发运
var haveEdiNotHaveSeList = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsHaveSeData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisBBACEidSeCompareExport()
{
Category = "JIS",
CarModeCode = default,
LineStationcode = default,
SequenceNumber = t.Max(t => t.SeqNumber),
ParType = "01",
EdiQty = t.Sum(t => t.Qty),
AssemblyDate = default,
MatchNumber = default,
MateType = "否",
DiffDesc = "WMS漏发货EDI有订单"
}).ToList();
//无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisBBACEidSeCompareExport()
{
Category = "JIS",
WmsBillNum = t.Max(t => t.BillNum),
MESConfigCode = t.Max(t => t.MESConfigCode),
ShippingDate = t.Max(t => t.BillTime),
PN = t.Max(t => t.PN),
Seq = t.Max(t => t.Seq),
PjsNum = t.Max(t => t.PjsNum),
MaterialNumber = t.Max(t => t.CustPartCode),
MaterialDes = t.Max(t => t.PartDesc),
SEQty = t.Sum(t => t.Qty),
InjectionCode = t.Max(t => t.InjectionCode),
MateType = "否",
DiffDesc = "WMS有发货EDI无订单"
}).ToList();
//有EDI有发运
var ediGroup = from edi in _settleAccountDbContext.Set<BBAC_SE_EDI>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
group edi by new { edi.PN, edi.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
SeqNumber = groupItem.Max(t => t.SeqNumber)
};
var seGroup = from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>()
where se.IsHaveEdiData == true && se.AssembleData >= seStartDateTime && se.AssembleData <= seEndDateTime
group se by new { se.PN, se.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
BillNum = groupItem.Max(t => t.BillNum),
MESConfigCode = groupItem.Max(t => t.MESConfigCode),
BillTime = groupItem.Max(t => t.BillTime),
Seq = groupItem.Max(t => t.Seq),
PjsNum = groupItem.Max(t => t.PjsNum),
CustPartCode = groupItem.Max(t => t.CustPartCode),
PartDesc = groupItem.Max(t => t.PartDesc),
InjectionCode = groupItem.Max(t => t.InjectionCode)
};
var haveEdiHaveSeList = (from edi in ediGroup
join se in seGroup
on new { edi.PN, edi.LU } equals new { se.PN, se.LU }
//where edi.IsDeleted == false && edi.IsHaveSeData == true && se.IsHaveEdiData == true
select new JisBBACEidSeCompareExport()
{
Category = "JIS",
WmsBillNum = se.BillNum,
CarModeCode = default,
LineStationcode = default,
SequenceNumber = edi.SeqNumber,
ParType = "01",
MESConfigCode = se.MESConfigCode,
ShippingDate = se.BillTime,
PN = se.PN,
Seq = se.Seq,
PjsNum = se.PjsNum,
MaterialNumber = se.CustPartCode,
MaterialDes = se.PartDesc,
SEQty = se.Qty,
EdiQty = edi.Qty,
AssemblyDate = default,
MatchNumber = default,
InjectionCode = se.InjectionCode,
MateType = se.Qty == edi.Qty ? "是" : "否",
DiffDesc = "WMS有发货EDI有订单"
}).ToList();
haveEdiNotHaveSeList.AddRange(haveEdiHaveSeList);
notHaveEdiHaveSeList.AddRange(haveEdiHaveSeList);
ExcelExporter excelExporter = new ExcelExporter();
excelExporter
.Append(haveEdiNotHaveSeList, $"BBACEDI数据和发货对比")
.SeparateBySheet()
.Append(notHaveEdiHaveSeList, $"BBAC发货和EDI数据对比");
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);
Notify();
return id.ToString();
}
#region 私有方法
private void Notify()
{
this._hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", "");
}
#endregion
}
}

180
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs

@ -0,0 +1,180 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Dynamic.Core;
using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Shouldly;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// BBAC结算、发运、Edi对比导出服务
/// </summary>
public class JisBBACSaSeEdiCompareExportService : SaSeEdiCompareExportBaseService, ITransientDependency, IExportJob
{
/// <summary>
/// 业务类型
/// </summary>
private readonly EnumBusinessType businessType = EnumBusinessType.JisBBAC;
/// <summary>
/// 文件容器
/// </summary>
private readonly IBlobContainer<MyFileContainer> _fileContainer;
/// <summary>
/// AutoMapper
/// </summary>
private readonly IObjectMapper _objectMapper;
/// <summary>
/// DbContext
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary>
/// 构造
/// </summary>
public JisBBACSaSeEdiCompareExportService(
IHubContext<PageHub> hubContext,
IBlobContainer<MyFileContainer> fileContainer,
IObjectMapper objectMapper,
SettleAccountDbContext settleAccountDbContext) : base(hubContext)
{
_fileContainer = fileContainer;
_objectMapper = objectMapper;
_settleAccountDbContext = settleAccountDbContext;
}
/// <summary>
/// 导出
/// </summary>
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{
var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
var lu = property.Where(p => p.Name == "LU").FirstOrDefault().Value;
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value;
var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var businessTypeDisplayName = businessType.GetAttributeOfType<DisplayAttribute>()?.Name ?? businessType.ToString();
var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
var ediSeSaCompareDiffs = GetEdiSeSaCompareData(int.Parse(version), seStartDateTime, seEndDateTime);
HandleSaSeEdiCompareDiffList(ediSeSaCompareDiffs);
if (string.IsNullOrEmpty(lu) == false)
{
ediSeSaCompareDiffs = ediSeSaCompareDiffs.FindAll(p => p.CustomerPartCode == lu);
}
if (string.IsNullOrEmpty(pn) == false)
{
ediSeSaCompareDiffs = ediSeSaCompareDiffs.FindAll(p => p.PN == pn);
}
ediSeSaCompareDiffs = ediSeSaCompareDiffs.OrderBy(t => t.Category).ToList();
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBAC>>(ediSeSaCompareDiffs);
var excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisBBAC>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);
Notify();
return id.ToString();
}
#region 私有方法
/// <summary>
/// 获取比对数据
/// </summary>
public List<SaSeEdiCompareDiff> GetEdiSeSaCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime)
{
//结算
var saGroup = from sa in _settleAccountDbContext.Set<BBAC_SA_DETAIL>()
where sa.BusinessType == businessType && sa.Version == version
group sa by new { sa.PN, sa.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
//发运
var seGroup = from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
WmsBillNum = groupItem.Max(t => t.WmsBillNum),
ShippingDate = groupItem.Max(t => t.ShippingDate),
FactoryPartCode = groupItem.Max(t => t.FactoryPartCode),
ToLoc = groupItem.Max(t => t.ToLoc),
ErpToLoc = groupItem.Max(t => t.ErpToLoc)
};
var saSeCompareLeft = from sa in saGroup
join se in seGroup
on new { sa.PN, sa.LU } equals new { se.PN, se.LU }
into temp
from se in temp.DefaultIfEmpty()
select new SaSeEdiCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.LU,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
};
var saSeCompareRight = from se in seGroup
join sa in saGroup
on new { se.PN, se.LU } equals new { sa.PN, sa.LU }
into temp
from sa in temp.DefaultIfEmpty()
select new SaSeEdiCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.LU,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
};
var saSeCompareFullJoin = saSeCompareLeft.Union(saSeCompareRight).ToList();
return saSeCompareFullJoin;
}
#endregion
}
}

6
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACEdiSeCompareExportService.cs → code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs

@ -19,9 +19,9 @@ using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// BBACEdi与发运对比导出服务
/// BBAC发运、Edi对比导出服务
/// </summary>
public class JisBBACEdiSeCompareExportService : ITransientDependency, IExportJob
public class JisBBACSeEdiCompareExportService : ITransientDependency, IExportJob
{
/// <summary>
/// HubContext
@ -39,7 +39,7 @@ namespace SettleAccount.Job.Services.Report
/// <summary>
/// 构造
/// </summary>
public JisBBACEdiSeCompareExportService(
public JisBBACSeEdiCompareExportService(
IHubContext<PageHub> hubContext,
IBlobContainer<MyFileContainer> fileContainer,
IObjectMapper objectMapper,

183
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaEdiSeCompareExportService.cs

@ -1,183 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Shouldly;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// HBPO结算、Edi、发运对比导出服务
/// </summary>
public class JisHBPOSaEdiSeCompareExportService : ITransientDependency, IExportJob
{
/// <summary>
/// HubContext
/// </summary>
private readonly IHubContext<PageHub> _hubContext;
/// <summary>
/// 文件容器
/// </summary>
private readonly IBlobContainer<MyFileContainer> _fileContainer;
/// <summary>
/// DbContext
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary>
/// 构造
/// </summary>
public JisHBPOSaEdiSeCompareExportService(
IBlobContainer<MyFileContainer> fileContainer,
SettleAccountDbContext settleAccountDbContext)
{
_fileContainer = fileContainer;
_settleAccountDbContext = settleAccountDbContext;
}
/// <summary>
/// 导出
/// </summary>
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{
var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
var lu = property.Where(p => p.Name == "LU").FirstOrDefault().Value;
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value;
var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
//有EDI无发运
var haveEdiNotHaveSeList = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsHaveSeData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisHBPOEidSeCompareExport()
{
Category = "JIS",
CarModeCode = default,
LineStationcode = default,
SequenceNumber = t.Max(t => t.SeqNumber),
ParType = "01",
EdiQty = t.Sum(t => t.Qty),
AssemblyDate = default,
MatchNumber = default,
MateType = "否",
DiffDesc = "WMS漏发货EDI有订单"
}).ToList();
//无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisHBPOEidSeCompareExport()
{
Category = "JIS",
WmsBillNum = t.Max(t => t.BillNum),
MESConfigCode = t.Max(t => t.MESConfigCode),
ShippingDate = t.Max(t => t.BillTime),
PN = t.Max(t => t.PN),
Seq = t.Max(t => t.Seq),
PjsNum = t.Max(t => t.PjsNum),
ToLoc = t.Max(t => t.ToLoc),
ErpToLoc = t.Max(t => t.ErpToLoc),
MaterialNumber = t.Max(t => t.CustPartCode),
MaterialDes = t.Max(t => t.PartDesc),
SEQty = t.Sum(t => t.Qty),
InjectionCode = t.Max(t => t.InjectionCode),
MateType = "否",
DiffDesc = "WMS有发货EDI无订单"
}).ToList();
//有EDI有发运
var ediGroup = from edi in _settleAccountDbContext.Set<BBAC_SE_EDI>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
group edi by new { edi.PN, edi.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
SeqNumber = groupItem.Max(t => t.SeqNumber)
};
var seGroup = from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>()
where se.IsHaveEdiData == true && se.AssembleData >= seStartDateTime && se.AssembleData <= seEndDateTime
group se by new { se.PN, se.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
BillNum = groupItem.Max(t => t.BillNum),
MESConfigCode = groupItem.Max(t => t.MESConfigCode),
BillTime = groupItem.Max(t => t.BillTime),
Seq = groupItem.Max(t => t.Seq),
PjsNum = groupItem.Max(t => t.PjsNum),
ToLoc = groupItem.Max(t => t.ToLoc),
ErpToLoc = groupItem.Max(t => t.ErpToLoc),
CustPartCode = groupItem.Max(t => t.CustPartCode),
PartDesc = groupItem.Max(t => t.PartDesc),
InjectionCode = groupItem.Max(t => t.InjectionCode)
};
var haveEdiHaveSeList = (from edi in ediGroup
join se in seGroup
on new { edi.PN, edi.LU } equals new { se.PN, se.LU }
select new JisHBPOEidSeCompareExport()
{
Category = "JIS",
WmsBillNum = se.BillNum,
CarModeCode = default,
LineStationcode = default,
SequenceNumber = edi.SeqNumber,
ParType = "01",
MESConfigCode = se.MESConfigCode,
ShippingDate = se.BillTime,
PN = se.PN,
Seq = se.Seq,
PjsNum = se.PjsNum,
ToLoc = se.ToLoc,
ErpToLoc = se.ErpToLoc,
MaterialNumber = se.CustPartCode,
MaterialDes = se.PartDesc,
SEQty = se.Qty,
EdiQty = edi.Qty,
AssemblyDate = default,
MatchNumber = default,
InjectionCode = se.InjectionCode,
MateType = se.Qty == edi.Qty ? "是" : "否",
DiffDesc = "WMS有发货EDI有订单"
}).ToList();
haveEdiNotHaveSeList.AddRange(haveEdiHaveSeList);
notHaveEdiHaveSeList.AddRange(haveEdiHaveSeList);
ExcelExporter excelExporter = new ExcelExporter();
excelExporter
.Append(haveEdiNotHaveSeList, $"HBPOEDI数据和发货对比")
.SeparateBySheet()
.Append(notHaveEdiHaveSeList, $"HBPO发货和EDI数据对比");
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);
Notify();
return id.ToString();
}
#region 私有方法
private void Notify()
{
this._hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", "");
}
#endregion
}
}

179
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs

@ -0,0 +1,179 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Shouldly;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// HBPO结算、发运、Edi对比导出服务
/// </summary>
public class JisHBPOSaSeEdiCompareExportService : SaSeEdiCompareExportBaseService, ITransientDependency, IExportJob
{
/// <summary>
/// 业务类型
/// </summary>
private readonly EnumBusinessType businessType = EnumBusinessType.JisHBPO;
/// <summary>
/// 文件容器
/// </summary>
private readonly IBlobContainer<MyFileContainer> _fileContainer;
/// <summary>
/// AutoMapper
/// </summary>
private readonly IObjectMapper _objectMapper;
/// <summary>
/// DbContext
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary>
/// 构造
/// </summary>
public JisHBPOSaSeEdiCompareExportService(
IHubContext<PageHub> hubContext,
IBlobContainer<MyFileContainer> fileContainer,
IObjectMapper objectMapper,
SettleAccountDbContext settleAccountDbContext) : base(hubContext)
{
_fileContainer = fileContainer;
_objectMapper = objectMapper;
_settleAccountDbContext = settleAccountDbContext;
}
/// <summary>
/// 导出
/// </summary>
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{
var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
var lu = property.Where(p => p.Name == "LU").FirstOrDefault().Value;
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value;
var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var businessTypeDisplayName = businessType.GetAttributeOfType<DisplayAttribute>()?.Name ?? businessType.ToString();
var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
var ediSeSaCompareDiffs = GetEdiSeSaCompareData(int.Parse(version), seStartDateTime, seEndDateTime);
HandleSaSeEdiCompareDiffList(ediSeSaCompareDiffs);
if (string.IsNullOrEmpty(lu) == false)
{
ediSeSaCompareDiffs = ediSeSaCompareDiffs.FindAll(p => p.CustomerPartCode == lu);
}
if (string.IsNullOrEmpty(pn) == false)
{
ediSeSaCompareDiffs = ediSeSaCompareDiffs.FindAll(p => p.PN == pn);
}
ediSeSaCompareDiffs = ediSeSaCompareDiffs.OrderBy(t => t.Category).ToList();
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBAC>>(ediSeSaCompareDiffs);
var excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisBBAC>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);
Notify();
return id.ToString();
}
#region 私有方法
/// <summary>
/// 获取比对数据
/// </summary>
public List<SaSeEdiCompareDiff> GetEdiSeSaCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime)
{
//结算
var saGroup = from sa in _settleAccountDbContext.Set<HBPO_SA_DETAIL>()
where sa.BusinessType == businessType && sa.Version == version
group sa by new { sa.PN, sa.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
//发运
var seGroup = from se in _settleAccountDbContext.Set<HBPO_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
WmsBillNum = groupItem.Max(t => t.WmsBillNum),
ShippingDate = groupItem.Max(t => t.ShippingDate),
FactoryPartCode = groupItem.Max(t => t.FactoryPartCode),
ToLoc = groupItem.Max(t => t.ToLoc),
ErpToLoc = groupItem.Max(t => t.ErpToLoc)
};
var saSeCompareLeft = from sa in saGroup
join se in seGroup
on new { sa.PN, sa.LU } equals new { se.PN, se.LU }
into temp
from se in temp.DefaultIfEmpty()
select new SaSeEdiCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.LU,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
};
var saSeCompareRight = from se in seGroup
join sa in saGroup
on new { se.PN, se.LU } equals new { sa.PN, sa.LU }
into temp
from sa in temp.DefaultIfEmpty()
select new SaSeEdiCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.LU,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
};
var saSeCompareFullJoin = saSeCompareLeft.Union(saSeCompareRight).ToList();
return saSeCompareFullJoin;
}
#endregion
}
}

16
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOEdiSeCompareExportService.cs → code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs

@ -17,9 +17,9 @@ using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// HBPOEdi与发运对比导出服务
/// HBPO发运、Edi对比导出服务
/// </summary>
public class JisHBPOEdiSeCompareExportService : ITransientDependency, IExportJob
public class JisHBPOSeEdiCompareExportService : ITransientDependency, IExportJob
{
/// <summary>
/// HubContext
@ -37,10 +37,12 @@ namespace SettleAccount.Job.Services.Report
/// <summary>
/// 构造
/// </summary>
public JisHBPOEdiSeCompareExportService(
public JisHBPOSeEdiCompareExportService(
IHubContext<PageHub> hubContext,
IBlobContainer<MyFileContainer> fileContainer,
SettleAccountDbContext settleAccountDbContext)
{
_hubContext = hubContext;
_fileContainer = fileContainer;
_settleAccountDbContext = settleAccountDbContext;
}
@ -61,7 +63,7 @@ namespace SettleAccount.Job.Services.Report
var filename = exportName.FirstOrDefault();
//有EDI无发运
var haveEdiNotHaveSeList = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsHaveSeData == false)
var haveEdiNotHaveSeList = _settleAccountDbContext.Set<HBPO_SE_EDI>().Where(t => t.IsHaveSeData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisHBPOEidSeCompareExport()
{
@ -77,7 +79,7 @@ namespace SettleAccount.Job.Services.Report
DiffDesc = "WMS漏发货EDI有订单"
}).ToList();
//无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false)
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<HBPO_SE_DETAIL>().Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisHBPOEidSeCompareExport()
{
@ -98,7 +100,7 @@ namespace SettleAccount.Job.Services.Report
DiffDesc = "WMS有发货EDI无订单"
}).ToList();
//有EDI有发运
var ediGroup = from edi in _settleAccountDbContext.Set<BBAC_SE_EDI>()
var ediGroup = from edi in _settleAccountDbContext.Set<HBPO_SE_EDI>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
group edi by new { edi.PN, edi.LU } into groupItem
select new
@ -108,7 +110,7 @@ namespace SettleAccount.Job.Services.Report
Qty = groupItem.Sum(t => t.Qty),
SeqNumber = groupItem.Max(t => t.SeqNumber)
};
var seGroup = from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>()
var seGroup = from se in _settleAccountDbContext.Set<HBPO_SE_DETAIL>()
where se.IsHaveEdiData == true && se.AssembleData >= seStartDateTime && se.AssembleData <= seEndDateTime
group se by new { se.PN, se.LU } into groupItem
select new

92
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs

@ -15,6 +15,7 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
@ -48,7 +49,7 @@ namespace SettleAccount.Job.Services.Report
IHubContext<PageHub> hubContext,
IBlobContainer<MyFileContainer> fileContainer,
IObjectMapper objectMapper,
SettleAccountDbContext settleAccountDbContext) : base(hubContext)
SettleAccountDbContext settleAccountDbContext) : base(hubContext, settleAccountDbContext)
{
_fileContainer = fileContainer;
_objectMapper = objectMapper;
@ -75,6 +76,21 @@ namespace SettleAccount.Job.Services.Report
HandlePubSaSeCompareDiffList(pubSaSeCompareDiffs);
#region 二次对比
//二次匹配上的记录
var secondMatchHaveSaHaveSes = HandleSecondCompare(pubSaSeCompareDiffs, businessType);
if (secondMatchHaveSaHaveSes.Any())
{
//二次匹配 匹配上的厂内零件号、PN
var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN });
pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN }));
pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes);
//二次对比比对上的数据入库
var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
_settleAccountDbContext.Set<PUB_SEC_DETAIL>().AddRange(pubSeCDetailEntitys);
}
#endregion
if (string.IsNullOrEmpty(lu) == false)
{
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.CustomerPartCode == lu);
@ -105,12 +121,13 @@ namespace SettleAccount.Job.Services.Report
//结算
var saGroup = from sa in _settleAccountDbContext.Set<BBAC_SA_DETAIL>()
where sa.BusinessType == businessType && sa.Version == version
group sa by new { sa.PN, sa.LU } into groupItem
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
@ -118,61 +135,64 @@ namespace SettleAccount.Job.Services.Report
//发运
var seGroup = from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.LU } into groupItem
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
WmsBillNum = groupItem.Max(t => t.WmsBillNum),
ShippingDate = groupItem.Max(t => t.ShippingDate),
FactoryPartCode = groupItem.Max(t => t.FactoryPartCode),
ToLoc = groupItem.Max(t => t.ToLoc),
ErpToLoc = groupItem.Max(t => t.ErpToLoc)
};
var saSeCompareLeft = (from sa in saGroup
join se in seGroup
on new { sa.PN, sa.LU } equals new { se.PN, se.LU }
var saSeCompareLeft = from sa in saGroup
join se in seGroup
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp
from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU,
};
var saSeCompareRight = from se in seGroup
join sa in saGroup
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace }
into temp
from se in temp.DefaultIfEmpty()
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.LU,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
});
var saSeCompareRight = (from se in seGroup
join sa in saGroup
on new { se.PN, se.LU } equals new { sa.PN, sa.LU }
into temp
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.LU,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
});
var saSeCompareFullJoin = saSeCompareLeft.Concat(saSeCompareRight).ToList();
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU ?? se.LU
};
var saSeCompareFullJoin = saSeCompareLeft.Union(saSeCompareRight).ToList();
return saSeCompareFullJoin;
}
#endregion

93
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs

@ -15,8 +15,8 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Reports;
using static NPOI.HSSF.Util.HSSFColor;
namespace SettleAccount.Job.Services.Report
{
@ -49,7 +49,7 @@ namespace SettleAccount.Job.Services.Report
IHubContext<PageHub> hubContext,
IBlobContainer<MyFileContainer> fileContainer,
IObjectMapper objectMapper,
SettleAccountDbContext settleAccountDbContext) : base(hubContext)
SettleAccountDbContext settleAccountDbContext) : base(hubContext, settleAccountDbContext)
{
_fileContainer = fileContainer;
_objectMapper = objectMapper;
@ -76,6 +76,21 @@ namespace SettleAccount.Job.Services.Report
HandlePubSaSeCompareDiffList(pubSaSeCompareDiffs);
#region 二次对比
//二次匹配上的记录
var secondMatchHaveSaHaveSes = HandleSecondCompare(pubSaSeCompareDiffs, businessType);
if (secondMatchHaveSaHaveSes.Any())
{
//二次匹配 匹配上的厂内零件号、PN
var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN });
pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN }));
pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes);
//二次对比比对上的数据入库
var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
_settleAccountDbContext.Set<PUB_SEC_DETAIL>().AddRange(pubSeCDetailEntitys);
}
#endregion
if (string.IsNullOrEmpty(lu) == false)
{
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.CustomerPartCode == lu);
@ -106,12 +121,13 @@ namespace SettleAccount.Job.Services.Report
//结算
var saGroup = from sa in _settleAccountDbContext.Set<HBPO_SA_DETAIL>()
where sa.BusinessType == businessType && sa.Version == version
group sa by new { sa.PN, sa.LU } into groupItem
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
@ -119,61 +135,64 @@ namespace SettleAccount.Job.Services.Report
//发运
var seGroup = from se in _settleAccountDbContext.Set<HBPO_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.LU } into groupItem
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
WmsBillNum = groupItem.Max(t => t.WmsBillNum),
ShippingDate = groupItem.Max(t => t.ShippingDate),
FactoryPartCode = groupItem.Max(t => t.FactoryPartCode),
ToLoc = groupItem.Max(t => t.ToLoc),
ErpToLoc = groupItem.Max(t => t.ErpToLoc)
};
var saSeCompareLeft = (from sa in saGroup
join se in seGroup
on new { sa.PN, sa.LU } equals new { se.PN, se.LU }
var saSeCompareLeft = from sa in saGroup
join se in seGroup
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp
from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU
};
var saSeCompareRight = from se in seGroup
join sa in saGroup
on new { se.PN, se.LU } equals new { sa.PN, sa.LU }
into temp
from se in temp.DefaultIfEmpty()
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.LU,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
});
var saSeCompareRight = (from se in seGroup
join sa in saGroup
on new { se.PN, se.LU } equals new { sa.PN, sa.LU }
into temp
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.LU,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
});
var saSeCompareFullJoin = saSeCompareLeft.Concat(saSeCompareRight).ToList();
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU ?? se.LU
};
var saSeCompareFullJoin = saSeCompareLeft.Union(saSeCompareRight).ToList();
return saSeCompareFullJoin;
}
#endregion

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

@ -24,14 +24,10 @@ using Win.Sfs.Shared.RepositoryBase;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// Pub结算发运对比导出服务
/// 结算发运对比导出服务
/// </summary>
public class PubSaSeCompareExportService : ITransientDependency, IExportJob
public class PubSaSeCompareExportService : SaSeCompareExportBaseService, ITransientDependency, IExportJob
{
/// <summary>
/// HubContext
/// </summary>
private readonly IHubContext<PageHub> _hubContext;
/// <summary>
/// DbContext
/// </summary>
@ -40,22 +36,18 @@ namespace SettleAccount.Job.Services.Report
/// 替换件关系仓储
/// </summary>
private readonly INormalEfCoreRepository<TB_RePartsRelationship, Guid> _tbRePartsRelationshipRepository;
/// <summary>
/// PUB二次比对仓储
/// </summary>
private readonly INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> _pubSeCDetailRepository;
/// <summary>
/// Pub结算发运对比Dapper
/// </summary>
private readonly PubSaSeCompareDapperRepository _pubSaSeCompareDapperRepository;
/// <summary>
/// 文件容器
/// </summary>
private readonly IBlobContainer<MyFileContainer> _fileContainer;
/// <summary>
/// AutoMapper
/// </summary>
@ -71,9 +63,8 @@ namespace SettleAccount.Job.Services.Report
INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> pubSeCDetailRepository,
PubSaSeCompareDapperRepository pubSaSeCompareDapperRepository,
IBlobContainer<MyFileContainer> fileContainer,
IObjectMapper objectMapper)
IObjectMapper objectMapper) : base(hubContext, settleAccountDbContext)
{
_hubContext = hubContext;
_settleAccountDbContext = settleAccountDbContext;
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
_pubSeCDetailRepository = pubSeCDetailRepository;
@ -112,98 +103,11 @@ namespace SettleAccount.Job.Services.Report
//var pubSaSeCompareDiffs = _pubSaSeCompareDapperRepository.GetDetailDiffReportList(strBusinessType, version, seStartDateTime, seEndDateTime);
var pubSaSeCompareDiffs = GetSaSeCompareData(businessType, int.Parse(version), DateTime.Parse(seStartDateTime), DateTime.Parse(seEndDateTime));
pubSaSeCompareDiffs.ForEach(p =>
{
p.Category = (string.IsNullOrEmpty(p.SaCustomerPartCode), string.IsNullOrEmpty(p.SeCustomerPartCode)) switch
{
(false, false) => EnumPubSaSeCompareCategory.HaveSaHaveSe,
(false, true) => EnumPubSaSeCompareCategory.HaveSaNotHaveSe,
(true, false) => EnumPubSaSeCompareCategory.NotHaveSaHaveSe,
_ => EnumPubSaSeCompareCategory.None,
};
switch (p.Category)
{
case EnumPubSaSeCompareCategory.None:
break;
case EnumPubSaSeCompareCategory.HaveSaHaveSe:
{
p.CustomerPartCode = p.SaCustomerPartCode;
p.FactoryPartCode = p.SaFactoryPartCode;
p.ReplaceFactoryPartCode = p.SaFactoryPartCode;
}
break;
case EnumPubSaSeCompareCategory.HaveSaNotHaveSe:
{
p.CustomerPartCode = p.SaCustomerPartCode;
p.FactoryPartCode = p.SaFactoryPartCode;
p.ReplaceFactoryPartCode = p.SaFactoryPartCode;
}
break;
case EnumPubSaSeCompareCategory.NotHaveSaHaveSe:
{
p.CustomerPartCode = p.SeCustomerPartCode;
p.FactoryPartCode = p.SeFactoryPartCode;
p.ReplaceFactoryPartCode = p.SeFactoryPartCode;
}
break;
default:
break;
}
});
//有结算有发运
var haveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
//有结算无发运
var haveSaNotHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe);
//无结算有发运
var notHaveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe);
//二次匹配上的记录
var secondMatchHaveSaHaveSes = new List<PubSaSeCompareDiff>();
HandlePubSaSeCompareDiffList(pubSaSeCompareDiffs);
#region 二次对比
//二次对比(替换无结算有发运数据的厂内零件号)
var repFactoryPartCodes = notHaveSaHaveSes.Select(t => t.FactoryPartCode).Distinct().ToList();
var tbRePartsRelationships = _settleAccountDbContext.Set<TB_RePartsRelationship>().Where(t => repFactoryPartCodes.Contains(t.LU) && t.BusinessType == businessType).ToList();
//var tbRePartsRelationshipsOld = _tbRePartsRelationshipRepository.GetListAsync(t => repFactoryPartCodes.Contains(t.LU) && t.BusinessType == businessType).Result;
tbRePartsRelationships.ForEach(tbRePartsRelationship =>
{
notHaveSaHaveSes.FindAll(t => t.FactoryPartCode == tbRePartsRelationship.LU).ForEach(t =>
{
t.ReplaceFactoryPartCode = tbRePartsRelationship.RepLU;
t.IsReplace = true;
});
});
//获取二次比对上的数据
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes
join haveSaNotHaveSe in haveSaNotHaveSes
on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode }
where notHaveSaHaveSe.IsReplace == true
select new PubSaSeCompareDiff()
{
WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate,
SeqNumber = notHaveSaHaveSe.SeqNumber,
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber,
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty,
FixPrice = haveSaNotHaveSe.FixPrice,
PN = haveSaNotHaveSe.PN,
ToLocCode = notHaveSaHaveSe.ToLocCode,
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode,
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe,
SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode,
SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode,
SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode,
SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode,
CustomerPartCode = notHaveSaHaveSe.CustomerPartCode,
PartCodeDesc = notHaveSaHaveSe.PartCodeDesc,
FactoryPartCode = notHaveSaHaveSe.FactoryPartCode,
ReplaceFactoryPartCode = notHaveSaHaveSe.ReplaceFactoryPartCode
}).ToList();
//二次匹配上的记录
var secondMatchHaveSaHaveSes = HandleSecondCompare(pubSaSeCompareDiffs, businessType);
if (secondMatchHaveSaHaveSes.Any())
{
//二次匹配 匹配上的厂内零件号、PN
@ -310,19 +214,25 @@ namespace SettleAccount.Job.Services.Report
#region 私有方法
/// <summary>
/// 获取结算与发运比对数据
/// 获取比对数据
/// </summary>
public List<PubSaSeCompareDiff> GetSaSeCompareData(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime)
{
//印度件LU对比
if (businessType == EnumBusinessType.YinDuJian)
{
return GetSaSeCompareDataYinDu(version, seStartDateTime, seEndDateTime);
}
//结算
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == businessType && sa.Version == version
group sa by new { sa.PN, sa.LU } into groupItem
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
@ -330,180 +240,145 @@ namespace SettleAccount.Job.Services.Report
//发运
var seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.LU } into groupItem
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
WmsBillNum = groupItem.Max(t => t.WmsBillNum),
ShippingDate = groupItem.Max(t => t.ShippingDate),
FactoryPartCode = groupItem.Max(t => t.FactoryPartCode),
ToLocCode = groupItem.Max(t => t.ToLocCode),
ToErpLocCode = groupItem.Max(t => t.ToErpLocCode)
};
//印度件LU对比
if (businessType == EnumBusinessType.YinDuJian)
{
saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == businessType && sa.Version == version
group sa by new { sa.LU } into groupItem
var saSeCompareLeft = from sa in saGroup
join se in seGroup
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp
from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU
};
var saSeCompareRight = from se in seGroup
join sa in saGroup
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace }
into temp
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU ?? se.LU
};
var saSeCompareFullJoin = saSeCompareLeft.Union(saSeCompareRight).ToList();
return saSeCompareFullJoin;
}
/// <summary>
/// 获取比对数据
/// </summary>
public List<PubSaSeCompareDiff> GetSaSeCompareDataYinDu(int version, DateTime seStartDateTime, DateTime seEndDateTime)
{
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == EnumBusinessType.YinDuJian && sa.Version == version
group sa by new { sa.CustomerPartCodeNoSpace } into groupItem
select new
{
PN = "",
groupItem.Key.LU,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.LU } into groupItem
var seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>()
where se.BusinessType == EnumBusinessType.YinDuJian && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.CustomerPartCodeNoSpace } into groupItem
select new
{
PN = "",
groupItem.Key.LU,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
WmsBillNum = groupItem.Max(t => t.WmsBillNum),
ShippingDate = groupItem.Max(t => t.ShippingDate),
FactoryPartCode = groupItem.Max(t => t.FactoryPartCode),
ToLocCode = groupItem.Max(t => t.ToLocCode),
ToErpLocCode = groupItem.Max(t => t.ToErpLocCode)
};
}
//var saSeCompareList = (from sa in saGroup
// join se in seGroup
// on new { sa.PN, sa.LU } equals new { se.PN, se.LU }
// select new PubSaSeCompareDiff()
// {
// WmsBillNum = se.WmsBillNum,
// ShippingDate = se.ShippingDate,
// CustomerOfflineTime = sa.SettleDate,
// SAQty = sa.Qty,
// SEQty = se.Qty,
// FixPrice = sa.Price,
// ToLocCode = se.ToLocCode,
// ToErpLocCode = se.ToErpLocCode,
// SeCustomerPartCode = se.LU,
// SeFactoryPartCode = se.FactoryPartCode,
// SaCustomerPartCode = sa.LU,
// SaFactoryPartCode = sa.PartCode
// });
var saSeCompareLeft = (from sa in saGroup
join se in seGroup
on new { sa.PN, sa.LU } equals new { se.PN, se.LU }
var saSeCompareLeft = from sa in saGroup
join se in seGroup
on sa.CustomerPartCodeNoSpace equals se.CustomerPartCodeNoSpace
into temp
from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU
};
var saSeCompareRight = from se in seGroup
join sa in saGroup
on se.CustomerPartCodeNoSpace equals sa.CustomerPartCodeNoSpace
into temp
from se in temp.DefaultIfEmpty()
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.LU,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
});
var saSeCompareRight = (from se in seGroup
join sa in saGroup
on new { se.PN, se.LU } equals new { sa.PN, sa.LU }
into temp
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.LU,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.LU,
SaFactoryPartCode = sa.PartCode
});
var saSeCompareFullJoin = saSeCompareLeft.Concat(saSeCompareRight).ToList();
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU ?? se.LU
};
var saSeCompareFullJoin = saSeCompareLeft.Union(saSeCompareRight).ToList();
return saSeCompareFullJoin;
}
/// <summary>
/// 创建导出文件结构
/// </summary>
public ExcelExporter BindExcelExporter<T>(List<T> pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport, new()
{
//结算核对汇总
var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport()
{
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//有结算有发运
var haveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
//有结算有发运汇总
var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport()
{
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//有结算无发运
var haveSaNotHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe);
//有结算无发运
var haveSaNotHaveSeSumExports = haveSaNotHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport()
{
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//无结算有发运
var notHaveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe);
//无结算有发运
var notHaveSaHaveSeSumExports = notHaveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport()
{
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
ExcelExporter excelExporter = new ExcelExporter();
return excelExporter
.Append(pubSaSeCompareDetailExports, $"{businessTypeDisplayName}结算核对明细输出")
.SeparateBySheet()
.Append(pubSaSeCompareSumExports, $"{businessTypeDisplayName}结算核对汇总输出")
.SeparateBySheet()
.Append(haveSaHaveSeExports, $"{businessTypeDisplayName}有结算有发货明细输出")
.SeparateBySheet()
.Append(haveSaHaveSeSumExports, $"{businessTypeDisplayName}有结算有发货汇总输出")
.SeparateBySheet()
.Append(haveSaNotHaveSeExports, $"{businessTypeDisplayName}有结算无发货明细输出")
.SeparateBySheet()
.Append(haveSaNotHaveSeSumExports, $"{businessTypeDisplayName}有结算无发货汇总输出");
}
/// <summary>
/// 通知
/// </summary>
private void Notify()
{
this._hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", "");
}
#endregion
}
}

69
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

@ -2,22 +2,32 @@ using System.Collections.Generic;
using System.Linq;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Enums;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// 结算、发运比对导出基础服务
/// </summary>
public class SaSeCompareExportBaseService
{
/// <summary>
/// HubContext
/// </summary>
private readonly IHubContext<PageHub> _hubContext;
/// <summary>
/// DbContext
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
public SaSeCompareExportBaseService(IHubContext<PageHub> hubContext)
public SaSeCompareExportBaseService(IHubContext<PageHub> hubContext, SettleAccountDbContext settleAccountDbContext)
{
_hubContext = hubContext;
_settleAccountDbContext = settleAccountDbContext;
}
public virtual void HandlePubSaSeCompareDiffList(List<PubSaSeCompareDiff> pubSaSeCompareDiffs)
@ -37,21 +47,18 @@ namespace SettleAccount.Job.Services.Report
break;
case EnumPubSaSeCompareCategory.HaveSaHaveSe:
{
p.CustomerPartCode = p.SaCustomerPartCode;
p.FactoryPartCode = p.SaFactoryPartCode;
p.ReplaceFactoryPartCode = p.SaFactoryPartCode;
}
break;
case EnumPubSaSeCompareCategory.HaveSaNotHaveSe:
{
p.CustomerPartCode = p.SaCustomerPartCode;
p.FactoryPartCode = p.SaFactoryPartCode;
p.ReplaceFactoryPartCode = p.SaFactoryPartCode;
}
break;
case EnumPubSaSeCompareCategory.NotHaveSaHaveSe:
{
p.CustomerPartCode = p.SeCustomerPartCode;
p.FactoryPartCode = p.SeFactoryPartCode;
p.ReplaceFactoryPartCode = p.SeFactoryPartCode;
}
@ -62,6 +69,60 @@ namespace SettleAccount.Job.Services.Report
});
}
/// <summary>
/// 二次比对
/// </summary>
public virtual List<PubSaSeCompareDiff> HandleSecondCompare(List<PubSaSeCompareDiff> pubSaSeCompareDiffs, EnumBusinessType businessType)
{
//二次匹配上的记录
var secondMatchHaveSaHaveSes = new List<PubSaSeCompareDiff>();
//有结算无发运
var haveSaNotHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe);
//无结算有发运
var notHaveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe);
//二次对比(替换无结算有发运数据的厂内零件号)
var repFactoryPartCodes = notHaveSaHaveSes.Select(t => t.FactoryPartCode).Distinct().ToList();
var tbRePartsRelationships = _settleAccountDbContext.Set<TB_RePartsRelationship>().Where(t => repFactoryPartCodes.Contains(t.LU) && t.BusinessType == businessType).ToList();
tbRePartsRelationships.ForEach(tbRePartsRelationship =>
{
notHaveSaHaveSes.FindAll(t => t.FactoryPartCode == tbRePartsRelationship.LU).ForEach(t =>
{
t.ReplaceFactoryPartCode = tbRePartsRelationship.RepLU;
});
});
//获取二次比对上的数据
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes
join haveSaNotHaveSe in haveSaNotHaveSes
on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode }
select new PubSaSeCompareDiff()
{
WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate,
SeqNumber = notHaveSaHaveSe.SeqNumber,
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber,
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty,
FixPrice = haveSaNotHaveSe.FixPrice,
PN = haveSaNotHaveSe.PN,
ToLocCode = notHaveSaHaveSe.ToLocCode,
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode,
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe,
SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode,
SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode,
SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode,
SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode,
CustomerPartCode = notHaveSaHaveSe.CustomerPartCode,
PartCodeDesc = notHaveSaHaveSe.PartCodeDesc,
FactoryPartCode = notHaveSaHaveSe.FactoryPartCode,
ReplaceFactoryPartCode = notHaveSaHaveSe.ReplaceFactoryPartCode
}).ToList();
return secondMatchHaveSaHaveSes;
}
/// <summary>
/// 创建导出文件结构
/// </summary>

141
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs

@ -0,0 +1,141 @@
using System.Collections.Generic;
using System.Linq;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using SettleAccount.Job.SignalR;
using Win.Sfs.SettleAccount.Enums;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// 结算、发运、Eid比对导出基础服务
/// </summary>
public class SaSeEdiCompareExportBaseService
{
/// <summary>
/// HubContext
/// </summary>
private readonly IHubContext<PageHub> _hubContext;
public SaSeEdiCompareExportBaseService(IHubContext<PageHub> hubContext)
{
_hubContext = hubContext;
}
public virtual void HandleSaSeEdiCompareDiffList(List<SaSeEdiCompareDiff> ediSeSaCompareDiffs)
{
ediSeSaCompareDiffs.ForEach(p =>
{
p.Category = (string.IsNullOrEmpty(p.SaCustomerPartCode), string.IsNullOrEmpty(p.SeCustomerPartCode), string.IsNullOrEmpty(p.EdiCustomerPartCode)) switch
{
(false, false, false) => EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi,
(false, false, true) => EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi,
(false, true, false) => EnumSaSeEdiCompareCategory.HaveSaNotHaveSeHaveEdi,
(false, true, true) => EnumSaSeEdiCompareCategory.HaveSaNotHaveSeNotHaveEdi,
(true, false, false) => EnumSaSeEdiCompareCategory.NotHaveSaHaveSeHaveEdi,
(true, false, true) => EnumSaSeEdiCompareCategory.NotHaveSaHaveSeNotHaveEdi,
_ => EnumSaSeEdiCompareCategory.None,
};
switch (p.Category)
{
case EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi:
case EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi:
case EnumSaSeEdiCompareCategory.HaveSaNotHaveSeHaveEdi:
case EnumSaSeEdiCompareCategory.HaveSaNotHaveSeNotHaveEdi:
{
p.CustomerPartCode = p.SaCustomerPartCode;
p.FactoryPartCode = p.SaFactoryPartCode;
p.ReplaceFactoryPartCode = p.SaFactoryPartCode;
}
break;
case EnumSaSeEdiCompareCategory.NotHaveSaHaveSeHaveEdi:
case EnumSaSeEdiCompareCategory.NotHaveSaHaveSeNotHaveEdi:
{
p.CustomerPartCode = p.SeCustomerPartCode;
p.FactoryPartCode = p.SeFactoryPartCode;
p.ReplaceFactoryPartCode = p.SeFactoryPartCode;
}
break;
default:
break;
}
});
}
/// <summary>
/// 创建导出文件结构
/// </summary>
public ExcelExporter BindExcelExporter<T>(List<T> pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : SaSeEdiCompareDetailExport, ISaSeEdiCompareDetailExport, new()
{
//汇总
var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumExport()
{
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty),
EdiQty = p.Sum(t => t.EdiQty)
}).ToList();
//有结算有发运
var haveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi }.Contains(t.Category));
//有结算有发运汇总
var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumExport()
{
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty),
EdiQty = p.Sum(t => t.EdiQty)
}).ToList();
//有结算无发运
var haveSaNotHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaNotHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaNotHaveSeNotHaveEdi }.Contains(t.Category));
//有结算无发运
var haveSaNotHaveSeSumExports = haveSaNotHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumExport()
{
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty),
EdiQty = p.Sum(t => t.EdiQty)
}).ToList();
//无结算有发运
var notHaveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.NotHaveSaHaveSeHaveEdi, EnumSaSeEdiCompareCategory.NotHaveSaHaveSeNotHaveEdi }.Contains(t.Category));
//无结算有发运
var notHaveSaHaveSeSumExports = notHaveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumExport()
{
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty),
EdiQty = p.Sum(t => t.EdiQty)
}).ToList();
ExcelExporter excelExporter = new ExcelExporter();
return excelExporter
.Append(pubSaSeCompareDetailExports, $"{businessTypeDisplayName}结算核对明细输出")
.SeparateBySheet()
.Append(pubSaSeCompareSumExports, $"{businessTypeDisplayName}结算核对汇总输出")
.SeparateBySheet()
.Append(haveSaHaveSeExports, $"{businessTypeDisplayName}有结算有发货明细输出")
.SeparateBySheet()
.Append(haveSaHaveSeSumExports, $"{businessTypeDisplayName}有结算有发货汇总输出")
.SeparateBySheet()
.Append(haveSaNotHaveSeExports, $"{businessTypeDisplayName}有结算无发货明细输出")
.SeparateBySheet()
.Append(haveSaNotHaveSeSumExports, $"{businessTypeDisplayName}有结算无发货汇总输出");
}
/// <summary>
/// 通知
/// </summary>
public virtual void Notify()
{
_hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", "");
}
}
}

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

@ -8,14 +8,15 @@ namespace SettleAccount.Job
{
public SettleAccountJobAutoMapperProfile()
{
CreateMapBBACEdiSeCompare();
CreateMapPubSaSeCompare();
CreateMapEdiSeCompare();
CreateMapSaSeEdiCompare();
CreateMapSaSeCompare();
}
/// <summary>
/// BBAC EDI与发运对比
/// 发运、EDI对比
/// </summary>
public void CreateMapBBACEdiSeCompare()
public void CreateMapEdiSeCompare()
{
//CreateMap<PubSaSeCompareDiff, JisBBACEidSeCompareExport>()
// .ForMember(x => x.ReplaceLU, y => y.MapFrom(y => y.ReplaceLU));
@ -23,9 +24,18 @@ namespace SettleAccount.Job
}
/// <summary>
/// Pub结算与发运对比
/// 结算、发运、Edi对比
/// </summary>
private void CreateMapPubSaSeCompare()
public void CreateMapSaSeEdiCompare()
{
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailExportJisBBAC>();
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailExportJisHBPO>();
}
/// <summary>
/// 结算、发运对比
/// </summary>
private void CreateMapSaSeCompare()
{
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianHBPO>();

6
code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

@ -39,8 +39,10 @@ namespace Win.Sfs.SettleAccount
ConfigureAutoMapper();
GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute{ Attempts = 0});
context.Services.AddTransient<JisBBACEdiSeCompareExportService>();
context.Services.AddTransient<JisHBPOEdiSeCompareExportService>();;
context.Services.AddTransient<JisBBACSeEdiCompareExportService>();
context.Services.AddTransient<JisHBPOSeEdiCompareExportService>();
context.Services.AddTransient<JisBBACSaSeEdiCompareExportService>();
context.Services.AddTransient<JisHBPOSaSeEdiCompareExportService>();
context.Services.AddTransient<MaiDanBBACSaSeCompareExportService>();
context.Services.AddTransient<MaiDanHBPOSaSeCompareExportService>();
context.Services.AddTransient<PubSaSeCompareExportService>();

Loading…
Cancel
Save