学 赵 2 years ago
parent
commit
29991abb0f
  1. 9
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs
  2. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  3. 67
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  4. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_map_group.js
  5. 101
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-item.js
  6. 92
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-log.js
  7. 12
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/price-list-app-service-bj.js
  8. 84
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js
  9. 416
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  10. 22
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-item.js
  11. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-log.js
  12. 0
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/bbac_jit_pub_sa_detail_jobservice.js
  13. 0
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/hbpo_jit_pub_sa_detail_jobservice.js
  14. 0
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_sa_detail_service.js
  15. 0
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_sa_service.js
  16. 0
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_se_detail_service.js
  17. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_sa_detail_service.js
  18. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_sa_service.js
  19. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_se_detail_service.js
  20. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
  21. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  22. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  23. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  24. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  25. 204
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs
  26. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  27. 143
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs
  28. 213
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs
  29. 31
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs
  30. 122
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs
  31. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
  32. 39
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  33. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs
  34. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  35. 28
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/SyncPositionFlag.cs
  36. 107
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIS_RECORD.cs
  37. 178
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIT_RECORD.cs
  38. 91
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs
  39. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs
  40. 58
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs
  41. 16
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  42. 16
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs
  43. 39
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSBJBMPTDbContext.cs
  44. 5001
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064841_20230726-2.Designer.cs
  45. 24
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064841_20230726-2.cs
  46. 5001
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064930_20230726-3.Designer.cs
  47. 34
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064930_20230726-3.cs
  48. 5007
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727024321_20230727-1.Designer.cs
  49. 46
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727024321_20230727-1.cs
  50. 43
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

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

@ -2,6 +2,7 @@ using System;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Coravel; using Coravel;
using Coravel.Invocable;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.AspNetCore.Mvc.ApplicationModels;
@ -12,6 +13,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using NUglify.Helpers; using NUglify.Helpers;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
namespace Win.Sfs.SettleAccount; namespace Win.Sfs.SettleAccount;
@ -25,6 +27,10 @@ public class Startup
.Where(o => o.IsClass && !o.IsAbstract && o.IsAssignableTo(typeof(IJobService))) .Where(o => o.IsClass && !o.IsAbstract && o.IsAssignableTo(typeof(IJobService)))
.ForEach(o => services.AddTransient(o)); .ForEach(o => services.AddTransient(o));
services.AddScheduler(); services.AddScheduler();
services.AddTransient<HBPOSeSyncAppService>();
services.AddTransient<BBACSeSyncAppService>();
services.AddTransient<ZhiGongBBACSeSyncAppService>();
services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer)); services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer));
services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer()))); services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer())));
services.AddApplication<SettleAccountHttpApiHostModule>(); services.AddApplication<SettleAccountHttpApiHostModule>();
@ -47,6 +53,9 @@ public class Startup
app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub")); app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub"));
app.ApplicationServices.UseScheduler(scheduler => app.ApplicationServices.UseScheduler(scheduler =>
{ {
//scheduler.Schedule<HBPOSeSyncAppService>().EveryMinute();
scheduler.Schedule<ZhiGongBBACSeSyncAppService>().EveryMinute();
using var scope = app.ApplicationServices.CreateScope(); using var scope = app.ApplicationServices.CreateScope();
var jobs = scope.ServiceProvider.GetService<SettleAccountDbContext>().Set<JobItem>().ToList(); var jobs = scope.ServiceProvider.GetService<SettleAccountDbContext>().Set<JobItem>().ToList();
jobs?.ForEach(job => jobs?.ForEach(job =>

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

@ -4,7 +4,8 @@
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,13319;Database=BJABP;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True", "Default": "Server=dev.ccwin-in.com,13319;Database=BJABP;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True",
"SettleAccountService": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;" "SettleAccountService": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;",
"WMSBJBMPT": "Server=dev.ccwin-in.com,6208;Database=WMS_BJBMPT_2;User ID=sa;Password=ChangkeTec@2021;Trusted_Connection=False;TrustServerCertificate=True;"
}, },
"Serilog": { "Serilog": {
"Using": [], "Using": [],

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

@ -197,9 +197,9 @@ export default {
<el-scrollbar> <el-scrollbar>
<app-list <app-list
v-if="subDrawer" v-if="subDrawer"
:controller="subListQuery.controller"
:query="subListQuery.query" :query="subListQuery.query"
:buttons="subListQuery.buttons" :buttons="subListQuery.buttons"
:config="subListQuery.config"
/> />
</el-scrollbar> </el-scrollbar>
<template #footer> <template #footer>
@ -261,7 +261,6 @@ export default {
<template v-else-if="editFormMode==='import'"> <template v-else-if="editFormMode==='import'">
<app-form <app-form
inline
mode="import" mode="import"
label-position="left" label-position="left"
:schema="config.import?.schema" :schema="config.import?.schema"
@ -362,7 +361,7 @@ export default {
width: 100%; width: 100%;
} }
</style>`, </style>`,
props: ["modelValue", "config", "querySchema", "controller", "query", "buttons"], props: ["modelValue", "config", "querySchema", "query", "buttons"],
emits: ["command"], emits: ["command"],
setup(props, context) { setup(props, context) {
/*变量定义*/ /*变量定义*/
@ -396,7 +395,6 @@ export default {
// const buttons = ref(props.buttons ?? route.meta.children.filter((o) => o.meta.hasPermission)); // const buttons = ref(props.buttons ?? route.meta.children.filter((o) => o.meta.hasPermission));
// 添加下行代码暂停权限验证 // 添加下行代码暂停权限验证
const buttons = ref(props.buttons ?? route.meta.children); const buttons = ref(props.buttons ?? route.meta.children);
const baseUrl = props.controller ?? `${route.meta.path}`;
const queryModel = ref(schemaToModel(config.query.schema)); const queryModel = ref(schemaToModel(config.query.schema));
watch(queryModel.value, async (value, oldValue, a) => { watch(queryModel.value, async (value, oldValue, a) => {
if (config.query.autoSubmit) { if (config.query.autoSubmit) {
@ -612,18 +610,18 @@ export default {
editFormTitle.value = `${t(item.path)}${config.query.schema.title}`; editFormTitle.value = `${t(item.path)}${config.query.schema.title}`;
fileList.value = []; fileList.value = [];
dialogVisible.value = true; dialogVisible.value = true;
versions.value = ( // versions.value = (
await request("settleaccount/centralized-control/get-all", null, { method: "POST" }) // await request("settleaccount/centralized-control/get-all", null, { method: "POST" })
).data.items.map((o) => ({ // ).data.items.map((o) => ({
value: o.version, // value: o.version,
label: o.version, // label: o.version,
})); // }));
factories.value = ( // factories.value = (
await request("settleaccount/code-setting/get-all", null, { method: "POST" }) // await request("settleaccount/code-setting/get-all", null, { method: "POST" })
).data.items.map((o) => ({ // ).data.items.map((o) => ({
value: o.project, // value: o.project,
label: o.project, // label: o.project,
})); // }));
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} finally { } finally {
@ -633,7 +631,7 @@ export default {
editFormTitle.value = t("自定义查询"); editFormTitle.value = t("自定义查询");
dialogVisible.value = true; dialogVisible.value = true;
} else { } else {
context.emit("command", item, rows, load); context.emit("command", item, rows, showList);
} }
editFormloading.value = false; editFormloading.value = false;
}; };
@ -703,25 +701,17 @@ export default {
dialogVisible.value = false; dialogVisible.value = false;
} }
}; };
const showList = (value, nav) => { const showList = (value, nav, config) => {
if (!subDrawer.value) { if (!subDrawer.value) {
const controller = nav.substr(0, nav.lastIndexOf(".")).toLowerCase(); const targetRoute = router.getRoutes().find((o) => o.meta?.path === nav);
const findRoute = (tree) => { // subListQuery.value = {
for (const item of tree) { // query: value,
if (item.meta.controller === controller) { // buttons: targetRoute.meta.children,
return item; // config,
} // };
if (item.children) { subListQuery.value.query = value;
return findRoute(item.children); subListQuery.value.buttons = targetRoute.meta.children;
} subListQuery.value.config = config;
}
};
const targetRoute = router.getRoutes().find((o) => o.meta?.controller === controller);
subListQuery.value = {
controller,
query: { [camelCase(nav.substr(nav.lastIndexOf(".") + 1))]: value },
buttons: targetRoute.meta.buttons,
};
subDrawer.value = true; subDrawer.value = true;
} }
}; };
@ -820,6 +810,7 @@ export default {
queryModel.value.skipCount = (pageModel.pageIndex - 1) * pageModel.pageSize; queryModel.value.skipCount = (pageModel.pageIndex - 1) * pageModel.pageSize;
// //
const postData = JSON.parse(JSON.stringify(queryModel.value)); const postData = JSON.parse(JSON.stringify(queryModel.value));
Object.assign(postData, subListQuery.value.query);
postData.filters = filterList.value.filter((o) => o.column && o.action && (o.value || o.value === false)); postData.filters = filterList.value.filter((o) => o.column && o.action && (o.value || o.value === false));
if (postData.items) { if (postData.items) {
delete postData["items"]; delete postData["items"];
@ -862,9 +853,9 @@ export default {
getSortModel(queryModel.value); getSortModel(queryModel.value);
filterList.value = queryModel.value?.filters ?? []; filterList.value = queryModel.value?.filters ?? [];
getColumns(config.table.schema); getColumns(config.table.schema);
if (props.query) { // if (props.query) {
Object.assign(queryModel.value.query, props.query); // Object.assign(queryModel.value.query, props.query);
} // }
if (!config.query.disableQueryOnLoad) { if (!config.query.disableQueryOnLoad) {
await load(); await load();
} }

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_map_group.js

@ -1,5 +1,5 @@
import version from "../version.js"; import version from "../version.js";
import { state2, state3 } from "../state.js"; import { state2 as state, state3 } from "../state.js";
const schema = { const schema = {
title: "通用代码", title: "通用代码",
@ -22,10 +22,10 @@ const schema = {
title: "金额", title: "金额",
type: "decimal", type: "decimal",
}, },
state2, state ,
Extend1: { taxAmt: {
title: "扩展字段1", title: "税额",
type: "string", type: "decimal",
}, },
Extend2: { Extend2: {
title: "扩展字段2", title: "扩展字段2",

101
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-item.js

@ -0,0 +1,101 @@
const schema = {
title: "定时任务",
type: "object",
properties: {
isDisabled: {
title: "是否禁用",
type: "boolean",
},
name: {
title: "名称",
type: "string",
},
cron: {
title: "表达式",
type: "string",
},
service: {
title: "服务",
type: "string",
},
isRunning: {
title: "运行中",
type: "boolean",
readOnly: true,
},
},
};
const queryUrl = "settleaccount/job-item/get-list";
const createUrl = "settleaccount/job-item/create";
const updateUrl = "settleaccount/job-item/update/%s";
const deleteUrl = "settleaccount/job-item/delete-list";
const detailsUrl = "settleaccount/job-item/details/%s";
const queryMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const detailsMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
schema: {
title: "定时任务",
type: "object",
properties: {
filters: {
type: "array",
hidden: true,
items: {
type: "object",
properties: {
logic: {
type: "int",
},
column: {
type: "string",
},
action: {
type: "int",
},
value: {
type: "string",
},
},
},
default: [],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
createUrl,
updateUrl,
deleteUrl,
detailsUrl,
createMethod,
updateMethod,
deleteMethod,
detailsMethod,
schema: schema,
},
};
}

92
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-log.js

@ -0,0 +1,92 @@
const schema = {
title: "定时任务",
type: "object",
properties: {
start: {
title: "开始",
type: "string",
input: "datetime",
},
end: {
title: "结束",
type: "string",
input: "datetime",
},
success: {
title: "成功",
type: "boolean",
},
exception: {
title: "异常",
type: "string",
},
},
};
const queryUrl = "settleaccount/job-log/get-list";
const queryMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
schema: {
title: "定时任务",
type: "object",
properties: {
filters: {
type: "array",
hidden: true,
items: {
type: "object",
properties: {
logic: {
type: "int",
},
column: {
type: "string",
},
action: {
type: "int",
},
value: {
type: "string",
},
},
},
default: [
{
logic: "and",
column: "jobId",
action: "equal",
value: null,
readOnly: true,
hidden: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
schema: schema,
},
};
}

12
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/price-list-app-service-bj.js

@ -18,6 +18,18 @@ const schema = {
title: "结算时间", title: "结算时间",
type: "DateTime", type: "DateTime",
}, },
clientCode: {
title: "客户编码",
type: "string",
},
date: {
title: "合同签订时间",
type: "DateTime",
},
contractNo: {
title: "合同号",
type: "string",
},
}, },
}; };

84
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js

@ -86,6 +86,16 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
// { // {
// path: "update", // path: "update",
// meta: { // meta: {
@ -95,7 +105,6 @@ export default [
// htmlClass: "el-button--primary", // htmlClass: "el-button--primary",
// permission: "AbpIdentity.Users.Update", // permission: "AbpIdentity.Users.Update",
// disabled: `(o) => o.isStatic`, // disabled: `(o) => o.isStatic`,
// }, // },
// }, // },
{ {
@ -469,6 +478,79 @@ export default [
], ],
}, },
}, },
{
path: "job-item",
meta: {
type: "page",
title: "定时任务",
icon: "file",
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "create",
meta: {
type: "button",
title: "新建",
icon: "file",
isTop: true,
},
},
{
path: "update",
meta: {
type: "button",
title: "编辑",
icon: "file",
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "log",
meta: {
type: "button",
title: "日志",
icon: "file",
},
},
],
},
},
{
path: "job-log",
meta: {
type: "page",
title: "日志",
icon: "file",
isHidden: true,
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
],
},
},
], ],
}, },
]; ];

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

@ -118,10 +118,10 @@ export default [
// }, // },
// }, // },
{ {
path: "import", path: "synchronous",
meta: { meta: {
type: "button", type: "button",
title: "导入", title: "手动同步",
icon: "file", icon: "file",
isTop: true, isTop: true,
}, },
@ -155,6 +155,15 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "synchronous",
meta: {
type: "button",
title: "手动同步",
icon: "file",
isTop: true,
},
},
{ {
path: "export", path: "export",
meta: { meta: {
@ -278,98 +287,6 @@ export default [
}, },
], ],
}, },
{
path: "second_bbac_sa_detail_jobservice",
meta: {
type: "page",
title: "发运与结算数据二次比对",
icon: "file",
enumBusinessType: "BBAC",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "compare",
meta: {
type: "button",
title: "生成对比",
icon: "file",
isTop: true,
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "下载",
icon: "file",
},
},
],
},
{
path: "third_bbac_sa_detail_jobservice",
meta: {
type: "page",
title: "买单件发运与结算数据三次比对",
icon: "file",
enumBusinessType: "BBAC",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "compare",
meta: {
type: "button",
title: "生成对比",
icon: "file",
isTop: true,
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "下载",
icon: "file",
},
},
],
},
], ],
}, },
{ {
@ -737,10 +654,10 @@ export default [
// }, // },
// }, // },
{ {
path: "import", path: "synchronous",
meta: { meta: {
type: "button", type: "button",
title: "导入", title: "手动同步",
icon: "file", icon: "file",
isTop: true, isTop: true,
}, },
@ -774,6 +691,15 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "synchronous",
meta: {
type: "button",
title: "手动同步",
icon: "file",
isTop: true,
},
},
{ {
path: "export", path: "export",
meta: { meta: {
@ -897,52 +823,6 @@ export default [
}, },
], ],
}, },
{
path: "second_hbpo_sa_detail_jobservice",
meta: {
type: "page",
title: "发运与结算数据二次比对",
icon: "file",
enumBusinessType: "HBPO",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "compare",
meta: {
type: "button",
title: "生成对比",
icon: "file",
isTop: true,
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "下载",
icon: "file",
},
},
],
},
], ],
}, },
{ {
@ -1209,10 +1089,10 @@ export default [
}, },
children: [ children: [
{ {
path: "jit_jit_pub_sa_service", path: "bbac_jit_pub_sa_service",
meta: { meta: {
type: "page", type: "page",
title: "结算数据", title: "BBAC结算数据",
icon: "file", icon: "file",
}, },
children: [ children: [
@ -1225,6 +1105,15 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
{ {
path: "delete", path: "delete",
meta: { meta: {
@ -1237,10 +1126,10 @@ export default [
], ],
}, },
{ {
path: "jit_pub_sa_detail_service", path: "bbac_jit_pub_sa_detail_service",
meta: { meta: {
type: "page", type: "page",
title: "结算数据明细", title: "BBAC结算数据明细",
icon: "file", icon: "file",
isHidden: true, isHidden: true,
}, },
@ -1255,19 +1144,39 @@ export default [
}, },
}, },
{ {
path: "delete", path: "export",
meta: { meta: {
type: "button", type: "button",
title: "删除", title: "导出",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged",
}, },
}, },
],
},
{
path: "bbac_jit_pub_se_detail_service",
meta: {
type: "page",
title: "BBAC发运数据",
icon: "file",
},
children: [
{ {
path: "import", path: "query",
meta: { meta: {
type: "button", type: "button",
title: "导入", title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "synchronous",
meta: {
type: "button",
title: "手动同步",
icon: "file", icon: "file",
isTop: true, isTop: true,
}, },
@ -1285,10 +1194,10 @@ export default [
], ],
}, },
{ {
path: "jit_pub_se_detail_service", path: "hbpo_jit_pub_sa_service",
meta: { meta: {
type: "page", type: "page",
title: "发运数据", title: "HBPO结算数据",
icon: "file", icon: "file",
}, },
children: [ children: [
@ -1301,15 +1210,6 @@ export default [
isTop: true, isTop: true,
}, },
}, },
// {
// path: "delete",
// meta: {
// type: "button",
// title: "删除",
// icon: "file",
// isTop: true,
// },
// },
{ {
path: "import", path: "import",
meta: { meta: {
@ -1319,6 +1219,73 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
],
},
{
path: "hbpo_jit_pub_sa_detail_service",
meta: {
type: "page",
title: "HBPO结算数据明细",
icon: "file",
isHidden: true,
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "导出",
icon: "file",
isTop: true,
pattern: "paged",
},
},
],
},
{
path: "hbpo_jit_pub_se_detail_service",
meta: {
type: "page",
title: "HBPO发运数据",
icon: "file",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "synchronous",
meta: {
type: "button",
title: "手动同步",
icon: "file",
isTop: true,
},
},
{ {
path: "export", path: "export",
meta: { meta: {
@ -1342,10 +1309,10 @@ export default [
}, },
children: [ children: [
{ {
path: "jit_pub_sa_detail_jobservice", path: "bbac_jit_pub_sa_detail_jobservice",
meta: { meta: {
type: "page", type: "page",
title: "发运与结算比对", title: "BBAC发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "ZhiGongJian", enumBusinessType: "ZhiGongJian",
}, },
@ -1397,10 +1364,10 @@ export default [
], ],
}, },
{ {
path: "jit_second_pub_sa_detail_jobservice", path: "hbpo_jit_pub_sa_detail_jobservice",
meta: { meta: {
type: "page", type: "page",
title: "发运与结算二次比对", title: "HBPO发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "ZhiGongJian", enumBusinessType: "ZhiGongJian",
}, },
@ -1432,6 +1399,15 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "update-data",
meta: {
type: "button",
title: "更新结算数据状态",
icon: "file",
isTop: true,
},
},
{ {
path: "export", path: "export",
meta: { meta: {
@ -1790,10 +1766,10 @@ export default [
// }, // },
// }, // },
{ {
path: "import", path: "synchronous",
meta: { meta: {
type: "button", type: "button",
title: "导入", title: "手动同步",
icon: "file", icon: "file",
isTop: true, isTop: true,
}, },
@ -1875,52 +1851,6 @@ export default [
}, },
], ],
}, },
{
path: "bj_second_pub_sa_detail_jobservice",
meta: {
type: "page",
title: "发运与结算二次比对",
icon: "file",
enumBusinessType: "BeiJian",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "compare",
meta: {
type: "button",
title: "生成对比",
icon: "file",
isTop: true,
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "下载",
icon: "file",
},
},
],
},
], ],
}, },
{ {
@ -2269,10 +2199,10 @@ export default [
// }, // },
// }, // },
{ {
path: "import", path: "synchronous",
meta: { meta: {
type: "button", type: "button",
title: "导入", title: "手动同步",
icon: "file", icon: "file",
isTop: true, isTop: true,
}, },
@ -2354,52 +2284,6 @@ export default [
}, },
], ],
}, },
{
path: "in_second_pub_sa_detail_jobservice",
meta: {
type: "page",
title: "发运与结算二次比对",
icon: "file",
enumBusinessType: "YingDuJian",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "compare",
meta: {
type: "button",
title: "生成对比",
icon: "file",
isTop: true,
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "下载",
icon: "file",
},
},
],
},
], ],
}, },
{ {
@ -2930,6 +2814,16 @@ export default [
pattern: "paged", pattern: "paged",
}, },
}, },
{
path: "backups",
meta: {
type: "button",
title: "手动备份",
icon: "file",
isTop: true,
pattern: "paged",
},
},
], ],
}, },
], ],

22
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-item.js

@ -0,0 +1,22 @@
import AppList from "../../components/list/index.js";
import html from "html";
import useConfig from "../../models/job-item.js";
import { defineAsyncComponent, ref, reactive, onMounted, watch } from "vue";
import useConfig2 from "../../models/job-log.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" ref="appListRef" />`,
setup() {
const config = useConfig();
const appListRef = ref(null);
const onCommand = async (item, rows, showList) => {
console.log(item.path, item, rows);
console.log(showList);
const config = useConfig2();
// config.query.schema.properties.filters.default[0].value = rows[0].id;
showList({ jobId: rows[0].id }, "/base-data/job-log", config);
};
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-log.js

@ -0,0 +1,15 @@
import AppList from "../../components/list/index.js";
import html from "html";
import useConfig from "../../models/job-log.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

0
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/jit_pub_sa_detail_jobservice.js → code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/bbac_jit_pub_sa_detail_jobservice.js

0
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/jit_second_pub_sa_detail_jobservice.js → code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/hbpo_jit_pub_sa_detail_jobservice.js

0
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/jit_pub_sa_detail_service.js → code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_sa_detail_service.js

0
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/jit_jit_pub_sa_service.js → code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_sa_service.js

0
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/jit_pub_se_detail_service.js → code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/bbac_jit_pub_se_detail_service.js

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_sa_detail_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_sa_detail_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_sa_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_sa_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/input/hbpo_jit_pub_se_detail_service.js

@ -0,0 +1,15 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/pub_se_detail_service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

12
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs

@ -107,7 +107,7 @@ public class PriceListExportDto
/// 销售价格导入 /// 销售价格导入
/// </summary> /// </summary>
[ImportProject(Name = SettleAccountModuleName.PriceList)] [ImportProject(Name = SettleAccountModuleName.PriceList)]
[Importer(HeaderRowIndex = 22)] [Importer(HeaderRowIndex = 21)]
public class PriceListImportDto public class PriceListImportDto
{ {
/// <summary> /// <summary>
@ -129,31 +129,31 @@ public class PriceListImportDto
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "零件号")]
[Required(ErrorMessage = "{0}是必填项")] [Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "Part No.")] [ImporterHeader(Name = "*Part No.")]
public string PartNo { get; set; } public string PartNo { get; set; }
/// <summary> /// <summary>
/// 价格 /// 价格
/// </summary> /// </summary>
[ImporterHeader(Name = "Total Price")] [ImporterHeader(Name = "Total Price (Old)")]
public string TotalPrice { get; set; } public string TotalPrice { get; set; }
/// <summary> /// <summary>
/// 开始时间 /// 开始时间
/// </summary> /// </summary>
[ImporterHeader(Name = "Valid From")] [ImporterHeader(Name = "*Valid From")]
public string ValidFrom { get; set; } public string ValidFrom { get; set; }
/// <summary> /// <summary>
/// 结束时间 /// 结束时间
/// </summary> /// </summary>
[ImporterHeader(Name = "Valid To")] [ImporterHeader(Name = "*Valid To")]
public string ValidTo { get; set; } public string ValidTo { get; set; }
/// <summary> /// <summary>
/// 客户编码 /// 客户编码
/// </summary> /// </summary>
[ImporterHeader(Name = "Plant")] [ImporterHeader(Name = "*Plant")]
public string Plant { get; set; } public string Plant { get; set; }
} }

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs

@ -254,7 +254,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
lU: detail.LU, lU: detail.LU,
qty: detail.Qty, qty: detail.Qty,
bussiessType: EnumBusinessType.BBAC, bussiessType: EnumBusinessType.JisBBAC,
amt: detail.Amt, amt: detail.Amt,
pRICE: detail.Price, pRICE: detail.Price,
extend1: detail.ContactDocID, extend1: detail.ContactDocID,
@ -296,7 +296,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
amt: amt, amt: amt,
taxAmt: txtAmt, taxAmt: txtAmt,
fileName: string.Empty, fileName: string.Empty,
businessType: EnumBusinessType.BBAC, businessType: EnumBusinessType.JisBBAC,
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,
@ -410,7 +410,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
lU: detail.LU, lU: detail.LU,
qty: detail.Qty, qty: detail.Qty,
bussiessType: EnumBusinessType.BBAC, bussiessType: EnumBusinessType.JisBBAC,
amt: detail.Amt, amt: detail.Amt,
pRICE: detail.Price, pRICE: detail.Price,
extend1: detail.ContractDocID, extend1: detail.ContractDocID,
@ -455,7 +455,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
amt: amt, amt: amt,
taxAmt: txtAmt, taxAmt: txtAmt,
fileName: string.Empty, fileName: string.Empty,
businessType: EnumBusinessType.BBAC, businessType: EnumBusinessType.JisBBAC,
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs

@ -249,7 +249,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
lU: detail.LU, lU: detail.LU,
qty: detail.Qty, qty: detail.Qty,
bussiessType: EnumBusinessType.HBPO, bussiessType: EnumBusinessType.JisHBPO,
amt: detail.Amt, amt: detail.Amt,
pRICE: detail.Price, pRICE: detail.Price,
extend1: string.Empty, extend1: string.Empty,
@ -290,7 +290,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
amt: amt, amt: amt,
taxAmt: txtAmt, taxAmt: txtAmt,
fileName: string.Empty, fileName: string.Empty,
businessType: EnumBusinessType.HBPO, businessType: EnumBusinessType.JisHBPO,
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,
@ -387,7 +387,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
lU: detail.LU, lU: detail.LU,
qty: detail.Qty, qty: detail.Qty,
bussiessType: EnumBusinessType.BBAC, bussiessType: EnumBusinessType.JisBBAC,
amt: detail.Amt, amt: detail.Amt,
pRICE: detail.Price, pRICE: detail.Price,
extend1: string.Empty, extend1: string.Empty,
@ -432,7 +432,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
amt: amt, amt: amt,
taxAmt: txtAmt, taxAmt: txtAmt,
fileName: string.Empty, fileName: string.Empty,
businessType: EnumBusinessType.HBPO, businessType: EnumBusinessType.JisHBPO,
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,

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

@ -108,7 +108,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
public async Task<string> ImportAsync([FromForm] IFormFileCollection files) public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
{ {
//业务类型 //业务类型
var businessType = EnumBusinessType.HBPO; var businessType = EnumBusinessType.JisHBPO;
//数据校验 //数据校验
var checkList = new List<ErrorExportDto>(); var checkList = new List<ErrorExportDto>();
//结算单号 //结算单号

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -142,16 +142,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
case EnumBusinessType.BeiJian: case EnumBusinessType.BeiJian:
await _pubMng.SetNewState(input.InvGroupNum); await _pubMng.SetNewState(input.InvGroupNum);
break; break;
case EnumBusinessType.ZhiGongJian: case EnumBusinessType.ZhiGongJianBBAC:
case EnumBusinessType.ZhiGongJianHBPO:
await _pubMng.SetNewState(input.InvGroupNum); await _pubMng.SetNewState(input.InvGroupNum);
break; break;
case EnumBusinessType.YingDuJian: case EnumBusinessType.YingDuJian:
await _pubMng.SetNewState(input.InvGroupNum); await _pubMng.SetNewState(input.InvGroupNum);
break; break;
case EnumBusinessType.BBAC: case EnumBusinessType.JisBBAC:
await _bbacMng.SetNewState(input.InvGroupNum); await _bbacMng.SetNewState(input.InvGroupNum);
break; break;
case EnumBusinessType.HBPO: case EnumBusinessType.JisHBPO:
await _hbpoMng.SetNewState(input.InvGroupNum); await _hbpoMng.SetNewState(input.InvGroupNum);
break; break;
} }

204
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs

@ -1,27 +1,202 @@
using System; using System;
using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core; using System.Linq.Dynamic.Core;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using EFCore.BulkExtensions; using Cronos;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Omu.ValueInjecter; using Omu.ValueInjecter;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ; namespace Win.Sfs.SettleAccount.Entities.BQ;
public class JobHostdService : BackgroundService
{
private readonly object _lockObj = new object();
private readonly IServiceProvider _serviceProvider;
private CancellationToken _stoppingToken;
public JobHostdService(IServiceProvider serviceProvider)
{
this._serviceProvider = serviceProvider;
}
public ConcurrentDictionary<JobItem, Tuple<CancellationTokenSource, Thread>> Jobs { get; } = new();
public static List<Type> ServiceTypes { get; private set; }
public static void AddService(IServiceCollection services)
{
ServiceTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(o => o.GetTypes())
.Where(o => o.IsClass && !o.IsAbstract && o.IsAssignableTo(typeof(IJobService)))
.ToList();
ServiceTypes.ForEach(o =>
{
services.AddTransient(typeof(IJobService), o);
services.AddTransient(o);
});
}
public void AddJob(JobItem job)
{
lock (_lockObj)
{
if (!Jobs.Keys.Any(o => o.Id == job.Id))
{
try
{
var source = new CancellationTokenSource();
var token = source.Token;
var thread = new Thread(async () =>
{
var expression = CronExpression.Parse(job.Cron);
using var scope1 = this._serviceProvider.CreateScope();
var serviceType = ServiceTypes.FirstOrDefault(o => o.FullName == job.Service);
if (serviceType != null)
{
while (!_stoppingToken.IsCancellationRequested && !token.IsCancellationRequested)
{
try
{
var nextUtc = expression.GetNextOccurrence(DateTime.UtcNow);
var span = nextUtc - DateTime.UtcNow;
await Task.Delay(span.Value).ConfigureAwait(false);
using var scope = this._serviceProvider.CreateScope();
if (scope.ServiceProvider.GetService(serviceType) is IJobService jobService)
{
var db = scope.ServiceProvider.GetService<SettleAccountDbContext>();
var jobItemRepository = db.Set<JobItem>();
var jobLogRepository = db.Set<JobLog>();
var jobItem = jobItemRepository.FirstOrDefault(o => o.Id == job.Id);
if (!jobItem.IsDisabled)
{
jobItem.IsRunning = true;
db.SaveChanges();
var jobLog = new JobLog { JobId = job.Id, Start = DateTime.Now };
try
{
jobService.Invoke();
jobLog.Success = true;
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
jobLog.Exception = ex.ToString();
}
finally
{
jobLog.End = DateTime.Now;
jobLogRepository.Add(jobLog);
jobItem.IsRunning = false;
db.SaveChanges();
}
}
}
}
catch (Exception)
{
throw;
}
}
}
});
thread.IsBackground = true;
if (this.Jobs.TryAdd(job, new Tuple<CancellationTokenSource, Thread>(source, thread)))
{
thread.Start();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
}
public void RemoveJob(JobItem item)
{
lock (_lockObj)
{
var key = this.Jobs.Keys.FirstOrDefault(o => o.Id == item.Id);
if (key != null)
{
try
{
if (this.Jobs.TryRemove(key, out var value))
{
value.Item1.Cancel();
value.Item2.Interrupt();
value.Item2.Join();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
}
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
this._stoppingToken = stoppingToken;
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var jobs = db.Set<JobItem>().AsNoTracking().ToList();
jobs.ForEach(this.AddJob);
return Task.CompletedTask;
}
}
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class JobItemAppService : SettleAccountApplicationBase<Material> public class JobItemAppService : ApplicationService, ITransientDependency
{ {
private readonly INormalEfCoreRepository<JobItem, Guid> _repository; private readonly INormalEfCoreRepository<JobItem, Guid> _repository;
private readonly JobHostdService _jobHostdService;
public JobItemAppService(INormalEfCoreRepository<JobItem, Guid> repository) public JobItemAppService(INormalEfCoreRepository<JobItem, Guid> repository, JobHostdService jobHostdService)
{ {
this._repository = repository; this._repository = repository;
this._jobHostdService = jobHostdService;
}
[HttpPost]
public async Task<JobItem> CreateAsync(JobItem input)
{
var entity = await _repository.InsertAsync(input).ConfigureAwait(false);
this._jobHostdService.AddJob(entity);
return entity;
}
[HttpPost]
public async Task<bool> DeleteListAsync(List<Guid> ids)
{
var entites = _repository.Where(p => ids.Contains(p.Id)).ToList();
foreach (var item in entites)
{
await _repository.DeleteAsync(item).ConfigureAwait(false);
this._jobHostdService.RemoveJob(item);
}
return entites.Count > 0;
}
[HttpPost("{id}")]
public async Task<JobItem> DetailsAsync(Guid id)
{
var entity = await _repository.FindAsync(id).ConfigureAwait(false);
return entity;
} }
[HttpPost] [HttpPost]
@ -33,13 +208,6 @@ public class JobItemAppService : SettleAccountApplicationBase<Material>
return new PagedResultDto<JobItem>(totalCount, entities); return new PagedResultDto<JobItem>(totalCount, entities);
} }
[HttpPost]
public async Task<JobItem> CreateAsync(JobItem input)
{
await _repository.InsertAsync(input).ConfigureAwait(false);
return input;
}
[HttpPost("{id}")] [HttpPost("{id}")]
public async Task<JobItem> UpdateAsync(Guid id, JobItem input) public async Task<JobItem> UpdateAsync(Guid id, JobItem input)
{ {
@ -47,22 +215,16 @@ public class JobItemAppService : SettleAccountApplicationBase<Material>
if (entity != null) if (entity != null)
{ {
entity.InjectFrom(input); entity.InjectFrom(input);
await _repository.UpdateAsync(entity).ConfigureAwait(false);
this._jobHostdService.RemoveJob(entity);
this._jobHostdService.AddJob(entity);
} }
await _repository.UpdateAsync(entity).ConfigureAwait(false);
return input; return input;
} }
[HttpPost]
public async Task<bool> DeleteListAsync(List<Guid> ids)
{
var _query = _repository.Where(p => ids.Contains(p.Id));
int i = await _query.BatchDeleteAsync().ConfigureAwait(false);
return i == 0;
}
} }
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class JobLogAppService : SettleAccountApplicationBase<Material> public class JobLogAppService : ApplicationService, ITransientDependency
{ {
private readonly INormalEfCoreRepository<JobLog, Guid> _repository; private readonly INormalEfCoreRepository<JobLog, Guid> _repository;

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs

@ -240,7 +240,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
lU: detail.LU, lU: detail.LU,
qty: detail.Qty, qty: detail.Qty,
bussiessType: EnumBusinessType.HBPO, bussiessType: EnumBusinessType.JisHBPO,
amt: detail.Amt, amt: detail.Amt,
pRICE: detail.Price, pRICE: detail.Price,
extend1: string.Empty, extend1: string.Empty,
@ -281,7 +281,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
amt: amt, amt: amt,
taxAmt: txtAmt, taxAmt: txtAmt,
fileName: string.Empty, fileName: string.Empty,
businessType: EnumBusinessType.HBPO, businessType: EnumBusinessType.JisHBPO,
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,
@ -381,7 +381,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
lU: detail.LU, lU: detail.LU,
qty: detail.Qty, qty: detail.Qty,
bussiessType: EnumBusinessType.BBAC, bussiessType: EnumBusinessType.JisBBAC,
amt: detail.Amt, amt: detail.Amt,
pRICE: detail.Price, pRICE: detail.Price,
extend1: string.Empty, extend1: string.Empty,
@ -426,7 +426,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
amt: amt, amt: amt,
taxAmt: txtAmt, taxAmt: txtAmt,
fileName: string.Empty, fileName: string.Empty,
businessType: EnumBusinessType.HBPO, businessType: EnumBusinessType.JisHBPO,
invGroupNum: main.InvGroupNum, invGroupNum: main.InvGroupNum,
state: SettleBillState., state: SettleBillState.,
invoiceBillState: InvoiceBillState., invoiceBillState: InvoiceBillState.,

143
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs

@ -0,0 +1,143 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Coravel.Invocable;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// HBPO发运数据同步服务
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class BBACSeSyncAppService : ApplicationService, IInvocable
{
/// <summary>
/// WMS数据上下文
/// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 同步位置标记
/// </summary>
private readonly INormalEfCoreRepository<SyncPositionFlag, Guid> _syncPositionFlagRepository;
/// <summary>
/// HBPO发运数据仓储
/// </summary>
private readonly INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> _bbacSeDetailRepository;
/// <summary>
/// 构造
/// </summary>
public BBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> bbacSeDetailRepository)
{
_wmsBJBMPTContext = wmsBJBMPTContext;
_syncPositionFlagRepository = syncPositionFlagRepository;
_bbacSeDetailRepository = bbacSeDetailRepository;
}
[HttpPost]
public async Task Invoke()
{
await SyncJitRecord();
//await SyncJisRecord();
}
/// <summary>
/// 同步JitRecord
/// </summary>
/// <returns></returns>
private async Task SyncJitRecord()
{
//同步表名称
var syncTableName = "TM_BJBMPT_JIT_RECORD";
//BBAC类型集合
var EnumDeliverSubBillTypes = new List<EnumDeliverSubBillType>
{
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.JIT直供件BBAC
};
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName);
if (syncPositionFlag != null)
{
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> expression = (t) => t.UID > int.Parse(syncPositionFlag.Position);
var body = expression.Body;
predicate = Expression.Lambda<Func<TM_BJBMPT_JIT_RECORD, bool>>(Expression.And(predicate.Body, body), predicate.Parameters);
}
var jitRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD.Where(predicate).OrderBy(b => b.UID).ToList();
var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<BBAC_SE_DETAIL>>(jitRecords);
if (bbacSeDetails.Any())
{
await _bbacSeDetailRepository.InsertManyAsync(bbacSeDetails);
if (syncPositionFlag != null)
{
syncPositionFlag.Position = jitRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag);
}
else
{
syncPositionFlag = new SyncPositionFlag()
{
TableName = syncTableName,
Position = jitRecords.Last().UID.ToString()
};
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag);
}
}
}
private async Task SyncJisRecord()
{
//同步表名称
var syncTableName = "TM_BJBMPT_JIS_RECORD";
Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => true;
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName);
if (syncPositionFlag != null)
{
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position);
}
var jisRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).ToList();
var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<BBAC_SE_DETAIL>>(jisRecords);
if (bbacSeDetails.Any())
{
await _bbacSeDetailRepository.InsertManyAsync(bbacSeDetails);
if (syncPositionFlag != null)
{
syncPositionFlag.Position = jisRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag);
}
else
{
syncPositionFlag = new SyncPositionFlag()
{
TableName = syncTableName,
Position = jisRecords.Last().UID.ToString()
};
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag);
}
}
}
}

213
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs

@ -0,0 +1,213 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Coravel.Invocable;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// HBPO发运数据同步服务
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class HBPOSeSyncAppService : ApplicationService, IInvocable //IJobService
{
/// <summary>
/// WMS数据上下文
/// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 同步位置标记
/// </summary>
private readonly INormalEfCoreRepository<SyncPositionFlag, Guid> _syncPositionFlagRepository;
/// <summary>
/// HBPO发运数据仓储
/// </summary>
private readonly INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> _hbpoSeDetailRepository;
/// <summary>
/// 构造
/// </summary>
public HBPOSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> hbpoSeDetailRepository)
{
_wmsBJBMPTContext = wmsBJBMPTContext;
_syncPositionFlagRepository = syncPositionFlagRepository;
_hbpoSeDetailRepository = hbpoSeDetailRepository;
}
//private readonly IRepository<TM_BJBMPT_JIT_RECORD> _TMBJBMPTJITRECORDRepository;
//public HBPOSeSyncAppService(IRepository<TM_BJBMPT_JIT_RECORD> TMBJBMPTJITRECORDRepository)
//{
// _TMBJBMPTJITRECORDRepository = TMBJBMPTJITRECORDRepository;
//}
[HttpPost]
public async Task Invoke()
{
await SyncJitRecord();
//await SyncJisRecord();
//if (!dbContext.GetService<IRelationalDatabaseCreator>().Exists() && dbContext.Database.EnsureCreated())
//{
// this._balanceRepository.AsNoTracking().ForEachAsync(o =>
// {
// dbContext.Set<VmiBalance>().Add(o);
// });
// dbContext.SaveChanges();
// var snapshot = new VmiSnapshot { Name = date, Path = connectionString };
// this._snapshotRepository.InsertAsync(snapshot).Wait();
//}
//using (var context = new HouseDbContext(optionsBuilder.Options))
//{
// var one = context.Notices.FirstOrDefault(n => n.Id == notice.Id);
// // 当然你也可以直接初始化其他的Service
// var nService = new NoticeService(context, null);
// var one = nService.FindOne(notice.Id);
//}
//var TM_BJBMPT_JIT_RECORDs = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD
// .Where(b => b.UID > 3)
// .OrderBy(b => b.BillTime)
// .ToList();
//foreach (var TM_BJBMPT_JIT_RECORD in TM_BJBMPT_JIT_RECORDs)
//{
// Console.WriteLine($"{TM_BJBMPT_JIT_RECORD.UID}");
//}
//using (var db = new WMSBJBMPTDbContext())
//{
// var blogs = db.TM_BJBMPT_JIT_RECORD
// .Where(b => b.UID > 3)
// .OrderBy(b => b.BillTime)
// .ToList();
// foreach (var blog in blogs)
// {
// Console.WriteLine($"{blog.UID}");
// }
//}
Console.WriteLine($"{GetType().FullName}执行了");
}
/// <summary>
/// 同步JitRecord
/// </summary>
/// <returns></returns>
private async Task SyncJitRecord()
{
//同步表名称
var syncTableName = "TM_BJBMPT_JIT_RECORD";
//HBPO类型集合
var EnumDeliverSubBillTypes = new List<EnumDeliverSubBillType>
{
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.JIT直供件HBPO
};
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName);
if (syncPositionFlag != null)
{
//var inv = Expression.Invoke(t=>t.UID > int.Parse(syncPositionFlag.Position), predicate.Parameters);
//return Expression.Lambda<Func<T, bool>>(Expression.And(exp.Body, inv), exp.Parameters);
//predicate.And(t => t.UID > int.Parse(syncPositionFlag.Position));
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> expression = (t) => t.UID > int.Parse(syncPositionFlag.Position);
var body = expression.Body;
//var inv = Expression.Invoke(condition, exp.Parameters);
predicate = Expression.Lambda<Func<TM_BJBMPT_JIT_RECORD, bool>>(Expression.And(predicate.Body, body), predicate.Parameters);
//Expression.Lambda<Func<T, bool>>(Expression.Equal(member, constant), parameter);
//var expression = predicate.And(t => t.UID > int.Parse(syncPositionFlag.Position));
}
Console.WriteLine($"表达式:{predicate}");
var jitRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD
.Where(predicate)
.OrderBy(b => b.UID)
.ToList();
var hbpoSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<HBPO_SE_DETAIL>>(jitRecords);
if (hbpoSeDetails.Any())
{
await _hbpoSeDetailRepository.InsertManyAsync(hbpoSeDetails);
if (syncPositionFlag != null)
{
syncPositionFlag.Position = jitRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag);
}
else
{
syncPositionFlag = new SyncPositionFlag()
{
TableName = syncTableName,
Position = jitRecords.Last().UID.ToString()
};
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag);
}
}
}
private async Task SyncJisRecord()
{
//同步表名称
var syncTableName = "TM_BJBMPT_JIS_RECORD";
Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => true;
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName);
if (syncPositionFlag != null)
{
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position);
}
var jisRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD
.Where(predicate)
.OrderBy(b => b.UID)
.ToList();
var hbpoSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<HBPO_SE_DETAIL>>(jisRecords);
if (hbpoSeDetails.Any())
{
await _hbpoSeDetailRepository.InsertManyAsync(hbpoSeDetails);
if (syncPositionFlag != null)
{
syncPositionFlag.Position = jisRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag);
}
else
{
syncPositionFlag = new SyncPositionFlag()
{
TableName = syncTableName,
Position = jisRecords.Last().UID.ToString()
};
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag);
}
}
}
}

31
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs

@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.ComponentModel;
using DocumentFormat.OpenXml.Office2010.ExcelAc;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// 发运同步配置
/// </summary>
public class SeSyncConfig
{
/// <summary>
/// 同步表名称
/// </summary>
public string SyncTableName { get; set; }
/// <summary>
/// 同步发运主类型
/// </summary>
public EnumDeliverBjBmpBillType SyncDeliverBillType { get; set; }
/// <summary>
/// 同步发运子类型
/// </summary>
public List<EnumDeliverSubBillType> SyncDeliverSubBillTypes { get; set; }
/// <summary>
///
/// </summary>
public EnumBusinessType BusinessType { get; set; }
}

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

@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Coravel.Invocable;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// 直供件BBAC发运同步
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService
{
/// <summary>
/// 构造
/// </summary>
public ZhiGongBBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository)
{
base.SeSyncConfigInfo = new SeSyncConfig()
{
SyncTableName = "ZhiGongBBACSeSync",
SyncDeliverBillType = EnumDeliverBjBmpBillType.JIT直供件,
SyncDeliverSubBillTypes = new List<EnumDeliverSubBillType>
{
EnumDeliverSubBillType.JIT直供件BBAC
}
};
}
}
/// <summary>
/// Jit发运数据同步
/// </summary>
public class JitSeSyncAppService : ApplicationService, IInvocable
{
/// <summary>
/// WMS数据上下文
/// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 同步位置标记
/// </summary>
private readonly INormalEfCoreRepository<SyncPositionFlag, Guid> _syncPositionFlagRepository;
/// <summary>
/// Jit发运数据仓储
/// </summary>
private readonly INormalEfCoreRepository<PUB_SE_DETAIL, Guid> _pubSeDetailRepository;
/// <summary>
/// 构造
/// </summary>
public JitSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository)
{
_wmsBJBMPTContext = wmsBJBMPTContext;
_syncPositionFlagRepository = syncPositionFlagRepository;
_pubSeDetailRepository = pubSeDetailRepository;
}
public SeSyncConfig SeSyncConfigInfo { get; set; }
[HttpPost]
public async Task Invoke()
{
//同步表名称
var syncTableName = SeSyncConfigInfo.SyncTableName;
//同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型
var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes;
Expression<Func<TM_BJBMPT_OTHER_RECORD, bool>> predicate = (t) => t.DeliverBillType == deliverBillType && (!deliverSubBillTypes.Any() || deliverSubBillTypes.Contains(t.DeliverSubBillType));
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName);
if (syncPositionFlag != null)
{
Expression<Func<TM_BJBMPT_OTHER_RECORD, bool>> expression = (t) => t.UID > int.Parse(syncPositionFlag.Position);
var body = expression.Body;
predicate = Expression.Lambda<Func<TM_BJBMPT_OTHER_RECORD, bool>>(Expression.And(predicate.Body, body), predicate.Parameters);
}
var jitRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).OrderBy(b => b.UID)?.ToList();
var pubSeDetails = ObjectMapper.Map<List<TM_BJBMPT_OTHER_RECORD>, List<PUB_SE_DETAIL>>(jitRecords);
if (pubSeDetails.Any())
{
await _pubSeDetailRepository.InsertManyAsync(pubSeDetails);
if (syncPositionFlag != null)
{
syncPositionFlag.Position = jitRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag);
}
else
{
syncPositionFlag = new SyncPositionFlag()
{
TableName = syncTableName,
Position = jitRecords.Last().UID.ToString()
};
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag);
}
}
await Task.CompletedTask;
}
}

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj

@ -116,7 +116,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Coravel" Version="4.2.1" />
<PackageReference Include="ClosedXML" Version="0.102.0" /> <PackageReference Include="ClosedXML" Version="0.102.0" />
<PackageReference Include="Cronos" Version="0.7.1" />
<PackageReference Include="EFCore.BulkExtensions" Version="5.3.0" /> <PackageReference Include="EFCore.BulkExtensions" Version="5.3.0" />
<PackageReference Include="Flurl" Version="3.0.7" /> <PackageReference Include="Flurl" Version="3.0.7" />
<PackageReference Include="Flurl.Http" Version="3.2.4" /> <PackageReference Include="Flurl.Http" Version="3.2.4" />

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

@ -58,6 +58,7 @@ using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Reflection; using System.Reflection;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount namespace Win.Sfs.SettleAccount
{ {
@ -151,6 +152,8 @@ namespace Win.Sfs.SettleAccount
CreateMapPUB_SA(); CreateMapPUB_SA();
CreateMapPUB_SA_DETAIL(); CreateMapPUB_SA_DETAIL();
CreateMapSeSync();
CreateMapBBAC_CAN_SA(); CreateMapBBAC_CAN_SA();
@ -1020,5 +1023,41 @@ namespace Win.Sfs.SettleAccount
CreateMap<PUB_SA_DETAIL_IMPORT_DTO, PUB_SA_DETAIL>(); CreateMap<PUB_SA_DETAIL_IMPORT_DTO, PUB_SA_DETAIL>();
} }
/// <summary>
/// 发运同步
/// </summary>
private void CreateMapSeSync()
{
CreateMap<TM_BJBMPT_JIT_RECORD, HBPO_SE_DETAIL>()
.ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.JISNum))
.ForMember(x => x.AssemblyCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.InjectionCode, y => y.MapFrom(d => d.DeliverCode))
.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.PartCode))
.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))
.ForMember(x => x.AssemblyCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.InjectionCode, y => y.MapFrom(d => d.DeliverCode))
.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.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.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.DnBillTime))
.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.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
}
} }
} }

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs

@ -49,7 +49,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
_entity.Version = DateTime.Now.Year + DateTime.Now.Month; _entity.Version = DateTime.Now.Year + DateTime.Now.Month;
_entity.State = SettleBillState.; _entity.State = SettleBillState.;
_entity.SettleBillNum = string.Empty; _entity.SettleBillNum = string.Empty;
_entity.BusinessType = EnumBusinessType.BBAC; _entity.BusinessType = EnumBusinessType.JisBBAC;
var _entityList = new List<BBAC_CAN_SA_DETAIL>(); var _entityList = new List<BBAC_CAN_SA_DETAIL>();
foreach (var itm in p_list) foreach (var itm in p_list)
{ {

14
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -76,8 +76,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
if (p_entiy.BusinessType == EnumBusinessType.BeiJian || if (p_entiy.BusinessType == EnumBusinessType.BeiJian ||
p_entiy.BusinessType == EnumBusinessType.YingDuJian || p_entiy.BusinessType == EnumBusinessType.YingDuJian ||
p_entiy.BusinessType == EnumBusinessType.MaiDanJian || p_entiy.BusinessType == EnumBusinessType.MaiDanJianBBAC ||
p_entiy.BusinessType == EnumBusinessType.ZhiGongJian p_entiy.BusinessType == EnumBusinessType.MaiDanJianHBPO ||
p_entiy.BusinessType == EnumBusinessType.ZhiGongJianBBAC ||
p_entiy.BusinessType == EnumBusinessType.ZhiGongJianHBPO
) )
{ {
bool isSucc = false; bool isSucc = false;
@ -91,7 +93,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
return isSucc; return isSucc;
} }
else if (p_entiy.BusinessType == EnumBusinessType.BBAC) else if (p_entiy.BusinessType == EnumBusinessType.JisBBAC)
{ {
bool isSucc = false; bool isSucc = false;
if (IsForward == true) if (IsForward == true)
@ -105,7 +107,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return isSucc; return isSucc;
} }
else if (p_entiy.BusinessType == EnumBusinessType.HBPO) else if (p_entiy.BusinessType == EnumBusinessType.JisHBPO)
{ {
bool isSucc = false; bool isSucc = false;
@ -266,7 +268,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
public virtual async Task<bool> ReceivedAsync(string p_groupbillnum) public virtual async Task<bool> ReceivedAsync(string p_groupbillnum)
{ {
var inv = _repository.Where(p => p.InvGroupNum == p_groupbillnum).FirstOrDefault(); var inv = _repository.Where(p => p.InvGroupNum == p_groupbillnum).FirstOrDefault();
if (inv.BusinessType == EnumBusinessType.BBAC) if (inv.BusinessType == EnumBusinessType.JisBBAC)
{ {
var entity = await _bbacMng.GetMainAsync(inv.InvGroupNum); var entity = await _bbacMng.GetMainAsync(inv.InvGroupNum);
if (entity == null) if (entity == null)
@ -313,7 +315,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
} }
} }
else if (inv.BusinessType == EnumBusinessType.HBPO) else if (inv.BusinessType == EnumBusinessType.JisHBPO)
{ {
var entity = await _hbpoMng.GetMainAsync(inv.InvGroupNum); var entity = await _hbpoMng.GetMainAsync(inv.InvGroupNum);
if (entity != null) if (entity != null)

28
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/SyncPositionFlag.cs

@ -0,0 +1,28 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// 同步位置标记
/// </summary>
public class SyncPositionFlag : AuditedAggregateRoot<Guid>
{
/// <summary>
/// 表名称
/// </summary>
[Display(Name = "表名称")]
public string TableName { get; set; }
/// <summary>
/// 位置(可排序)
/// </summary>
[Display(Name = "位置")]
public string Position { get; set; }
/// <summary>
/// 构造
/// </summary>
public SyncPositionFlag() { }
}

107
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIS_RECORD.cs

@ -0,0 +1,107 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
public class TM_BJBMPT_JIS_RECORD
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int UID { get; set; }
[DisplayName("JIS单据编号")]
public string JISNum { get; set; }
[DisplayName("发货时间")]
public DateTime? BillTime { get; set; }
[DisplayName("发货人")]
public string Oper { get; set; }
[DisplayName("JIS排序单号")]
public string OrderNum { get; set; }
[DisplayName("订单序号")]
public string Seq { get; set; }
[DisplayName("JIS实际生产码")]
public string RealCode { get; set; }
[DisplayName("订单生产码")]
public string VinCode { get; set; }
[DisplayName("JIS生产码类型")]
public string CodeType { get; set; }
[DisplayName("订单零件号")]
public string PartCode { get; set; }
[DisplayName("数量")]
public decimal? Qty { get; set; }
[DisplayName("发货单号")]
public string BillNum { get; set; }
public string MESConfigCode { get; set; }
[DisplayName("来源库位")]
public string FromLoc { get; set; }
[DisplayName("目标库位")]
public string ToLoc { get; set; }
public string RealPartCode { get; set; }
public string Batch { get; set; }
[DisplayName("参照订单生产码")]
public string RefVinCode { get; set; }
//[DisplayName("单据类型")]
//public EnumBillType BillType { get; set; }
//[DisplayName("子单据类型")]
//public EnumSubBillType SubBillType { get; set; }
[DisplayName("单据性质")]
public string BillCharacter { get; set; }
[DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; }
[DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
[DisplayName("发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
[DisplayName("发货关联单号")]
public string RefBillNum { get; set; }
[DisplayName("Erp目标库位")]
public string ErpToLoc { get; set; }
[DisplayName("原生产码")]
public string OrigiCode { get; set; }
[DisplayName("备注")]
public string Remark { get; set; }
[DisplayName("塑件唯一码")]
public string UniqueCode { get; set; }
[DisplayName("PJS顺序号")]
public string PjsNum { get; set; }
[DisplayName("虚拟小总成")]
public string MatchNumber { get; set; }
//[DisplayName("业务类型")]
//public EnumProTpe ProType { get; set; }
public string DeliverCode { get; set; }
public string Position { get; set; }
}

178
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIT_RECORD.cs

@ -0,0 +1,178 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// Jis小件
/// </summary>
public class TM_BJBMPT_JIT_RECORD
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int UID { get; set; }
[DisplayName("JIT订单号")]
public string JISNum { get; set; }
[DisplayName("JIT排序生产码")]
public string VinCode { get; set; }
[DisplayName("JIT排序生产码类型")]
public string CodeType { get; set; }
[DisplayName("订单零件号")]
public string PartCode { get; set; }
[DisplayName("订单零件号")]
public string RealPartCode { get; set; }
[DisplayName("订单序号")]
public string Seq { get; set; }
[DisplayName("发货条码")]
public string DeliverCode { get; set; }
[DisplayName("数量")]
public decimal? Qty { get; set; }
[DisplayName("发货单号")]
public string BillNum { get; set; }
[DisplayName("发货时间")]
public DateTime? BillTime { get; set; }
[DisplayName("发货人")]
public string Oper { get; set; }
[DisplayName("客户位置")]
public string Position { get; set; }
public string MESConfigCode { get; set; }
[DisplayName("生产线")]
public string Line { get; set; }
[DisplayName("目标库位")]
public string ToLoc { get; set; }
[DisplayName("备注")]
public string Remark { get; set; }
//[DisplayName("单据类型")]
//public EnumBillType BillType { get; set; }
//[DisplayName("子单据类型")]
//public EnumSubBillType SubBillType { get; set; }
[DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; }
[DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
[DisplayName("发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
[DisplayName("单据性质")]
public string BillCharacter { get; set; }
//[DisplayName("业务类型")]
//public EnumProTpe ProType { get; set; }
public string OrderNum { get; set; }
public string RealCode { get; set; }
public string FromLoc { get; set; }
public string RefBillNum { get; set; }
public string ErpToLoc { get; set; }
public string UniqueCode { get; set; }
public string PjsNum { get; set; }
public string MatchNumber { get; set; }
public string RefVinCode { get; set; }
}
public enum EnumProTpe
{
= 0,
Jit发货 = 1,
Jit补发订单 = 2,
Jit备件 = 3,
Jit买单件 = 4,
Jit匹配件 = 5,
Jis发货 = 6,
Jis备件 = 7,
Jis买单件 = 8,
Jis匹配件 = 9,
Jis补发订单 = 10,
Jis退货 = 11,
Jis备件退货 = 12,
Jis买单件退货 = 13,
Jis匹配件退货 = 14,
Jis补发订单退货 = 15,
Jit退货 = 16,
Jit备件退货 = 17,
Jit买单件退货 = 18,
Jit匹配件退货 = 19,
Jit补发订单退货 = 20,
4S发货 = 21,
HBPO发货 = 22,
= 23,
= 24,
4S退货 = 25,
HBPO退货 = 26,
退 = 27,
退 = 28,
}
public enum EnumBillType { }
public enum EnumSubBillType { }
/// <summary>
/// 事务类型
/// </summary>
public enum EnumDelTransType
{
= 1,
退 = -1,
}
/// <summary>
/// 发运主类型
/// </summary>
public enum EnumDeliverBjBmpBillType
{
= 0,
JIS件 = 1,
JIT直供件 = 2,
= 3,
4S备件 = 4,
}
/// <summary>
/// 发运子类型
/// </summary>
public enum EnumDeliverSubBillType
{
= 0,
BBAC = 1,
HBPO = 2,
BBAC = 3,
HBPO = 4,
BBAC = 5,
HBPO = 6,
BBAC = 7,
HBPO = 8,
JIT直供件BBAC = 9,
JIT直供件HBPO = 10,
}

91
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs

@ -0,0 +1,91 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// Jit(非Jis
/// </summary>
public class TM_BJBMPT_OTHER_RECORD
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[DisplayName("发货单号")]
public string BillNum { get; set; }
[DisplayName("发货时间")]
public DateTime? BillTime { get; set; }
[DisplayName("零件号")]
public string PartCode { get; set; }
[DisplayName("批次")]
public string Batch { get; set; }
[DisplayName("发货人")]
public string Oper { get; set; }
[DisplayName("DN单据号")]
public string DnBillNum { get; set; }
[DisplayName("DN单据时间")]
public DateTime? DnBillTime { get; set; }
[DisplayName("DN单添加人")]
public string DnOper { get; set; }
[DisplayName("交付索引")]
public string DeliveryIndex { get; set; }
[DisplayName("客户")]
public string CustId { get; set; }
[DisplayName("发货仓库")]
public string DeliveryHose { get; set; }
[DisplayName("来源库位")]
public string FromLocCode { get; set; }
[DisplayName("来源仓库")]
public string FromHose { get; set; }
[DisplayName("来源ERP库存")]
public string FromErpLocCode { get; set; }
[DisplayName("目标库位")]
public string ToLocCode { get; set; }
[DisplayName("目标仓库")]
public string ToHose { get; set; }
[DisplayName("目标Erp库位")]
public string ToErpLocCode { get; set; }
[DisplayName("数量")]
public decimal? Qty { get; set; }
//[DisplayName("单据类型")]
//public EnumBillType BillType { get; set; }
//[DisplayName("子单据类型")]
//public EnumSubBillType SubBillType { get; set; }
[DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; }
[DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
[DisplayName("发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
//[DisplayName("业务类型")]
//public EnumProTpe ProType { get; set; }
[DisplayName("备注")]
public string Remark { get; set; }
}

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

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
@ -11,9 +12,16 @@ public class JobItem : Entity<Guid>, IHasConcurrencyStamp
} }
public bool IsDisabled { get; set; } public bool IsDisabled { get; set; }
[Required]
public string Name { get; set; } public string Name { get; set; }
[Required]
public string Cron { get; set; } public string Cron { get; set; }
[Required]
public string Service { get; set; } public string Service { get; set; }
public bool IsRunning { get; set; } public bool IsRunning { get; set; }
public string ConcurrencyStamp { get; set; } public string ConcurrencyStamp { get; set; }
} }

58
code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs

@ -14,39 +14,63 @@ namespace Win.Sfs.SettleAccount
None = 0, None = 0,
/// <summary> /// <summary>
/// 直供件 /// JisBBAC
/// </summary> /// </summary>
[Display(Name = "直供件")] [Display(Name = "JisBBAC")]
ZhiGongJian = 1, JisBBAC = 1,
/// <summary> /// <summary>
/// 买单件 /// JisHBPO
/// </summary> /// </summary>
[Display(Name = "买单件")] [Display(Name = "JisHBPO")]
MaiDanJian = 2, JisHBPO = 2,
/// <summary> /// <summary>
/// 备件 /// 直供件BBAC
/// </summary> /// </summary>
[Display(Name = "备件")] [Display(Name = "直供件BBAC")]
BeiJian = 3, ZhiGongJianBBAC = 3,
/// <summary> /// <summary>
/// 印度件 /// 直供件HBPO
/// </summary> /// </summary>
[Display(Name = "印度件")] [Display(Name = "直供件HBPO")]
YingDuJian = 4, ZhiGongJianHBPO = 4,
/// <summary> /// <summary>
/// /// 买单件BBAC
/// </summary> /// </summary>
[Display(Name = "HBPO-JIS")] [Display(Name = "买单件BBAC")]
HBPO = 5, MaiDanJianBBAC = 5,
/// <summary>
/// 买单件HBPO
/// </summary>
[Display(Name = "买单件HBPO")]
MaiDanJianHBPO = 6,
/// <summary>
/// 备件
/// </summary>
[Display(Name = "备件")]
BeiJian = 7,
/// <summary> /// <summary>
/// 印度件 /// 印度件
/// </summary> /// </summary>
[Display(Name = "BBAC-JIS")] [Display(Name = "印度件")]
BBAC = 6 YingDuJian = 8,
///// <summary>
/////
///// </summary>
//[Display(Name = "HBPO-JIS")]
//HBPO = 5,
///// <summary>
///// 印度件
///// </summary>
//[Display(Name = "BBAC-JIS")]
//BBAC = 6
} }
} }

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

@ -7,6 +7,7 @@ using Win.Sfs.SettleAccount.Boms;
using Win.Sfs.SettleAccount.Entities; using Win.Sfs.SettleAccount.Entities;
using Win.Sfs.SettleAccount.Entities.Boms; using Win.Sfs.SettleAccount.Entities.Boms;
using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.SettleAccount.Entities.CodeSettings;
using Win.Sfs.SettleAccount.Entities.Controls; using Win.Sfs.SettleAccount.Entities.Controls;
@ -57,7 +58,8 @@ namespace Win.Sfs.SettleAccount
builder.ConfigurePURCHASE_PRICE(options); builder.ConfigurePURCHASE_PRICE(options);
//客户替换件关系 //客户替换件关系
builder.ConfigureTB_RePartsRelationship(options); builder.ConfigureTB_RePartsRelationship(options);
//同步位置标记
builder.ConfigureSyncPositionFlag(options);
#endregion 基础数据 #endregion 基础数据
#region 北汽结算 #region 北汽结算
@ -299,6 +301,18 @@ namespace Win.Sfs.SettleAccount
}); });
} }
/// <summary>
/// 同步位置标记
/// </summary>
private static void ConfigureSyncPositionFlag(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<SyncPositionFlag>(b =>
{
b.ToTable($"{options.TablePrefix}_SyncPositionFlag", options.Schema);
b.ConfigureByConvention();
});
}
#endregion 基础数据 #endregion 基础数据
#region 北汽 #region 北汽

16
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs

@ -1,4 +1,6 @@
using System.Configuration;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Dapper; using Volo.Abp.Dapper;
@ -55,15 +57,21 @@ namespace Win.Sfs.SettleAccount
//options.AddDefaultRepositories(includeAllEntities: true); //options.AddDefaultRepositories(includeAllEntities: true);
}); });
context.Services.AddAbpDbContext<UnInterfaceDbContext>(options => context.Services.AddAbpDbContext<UnInterfaceDbContext>(options =>
{ {
options.AddDefaultRepositories(); options.AddDefaultRepositories();
}); });
context.Services.AddDbContext<WMSBJBMPTDbContext>(options =>
{
//IConfiguration config = new ConfigurationBuilder()
// .SetBasePath(Directory.GetCurrentDirectory())
// .AddJsonFile("appsettings.json")
// .Build();
//var ConnectStr = config.GetConnectionString("WMSBJBMPT");
//optionsBuilder.UseSqlServer(ConnectStr);
options.UseSqlServer("Server=dev.ccwin-in.com,6208;Database=WMS_BJBMPT_2;User ID=sa;Password=ChangkeTec@2021;Trusted_Connection=False;TrustServerCertificate=True;");
});
// context.Services.AddTransient(typeof(IInventoryDetailRepository), // context.Services.AddTransient(typeof(IInventoryDetailRepository),
//typeof(InventoryDetailRepository)); //typeof(InventoryDetailRepository));

39
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSBJBMPTDbContext.cs

@ -0,0 +1,39 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.EntityFrameworkCore;
[ConnectionStringName("WMSBJBMPT")]
public class WMSBJBMPTDbContext : DbContext
{
public DbSet<TM_BJBMPT_JIT_RECORD> TM_BJBMPT_JIT_RECORD { get; set; }
public DbSet<TM_BJBMPT_JIS_RECORD> TM_BJBMPT_JIS_RECORD { get; set; }
public DbSet<TM_BJBMPT_OTHER_RECORD> TM_BJBMPT_OTHER_RECORD { get; set; }
public WMSBJBMPTDbContext()
{
}
public WMSBJBMPTDbContext(DbContextOptions<WMSBJBMPTDbContext> options) : base(options)
{
}
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
//{
// if (!optionsBuilder.IsConfigured)
// {
// IConfiguration config = new ConfigurationBuilder()
// .SetBasePath(Directory.GetCurrentDirectory())
// .AddJsonFile("appsettings.json")
// .Build();
// var ConnectStr = config.GetConnectionString("WMSBJBMPT");
// optionsBuilder.UseSqlServer(ConnectStr);
// }
//}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
}

5001
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064841_20230726-2.Designer.cs

File diff suppressed because it is too large

24
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064841_20230726-2.cs

@ -0,0 +1,24 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202307262 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("92cce083-20a8-5335-31ea-e390c57cac1f"), null, "0 0/1 * * * ?", false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.HBPOSeSyncAppService" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("92cce083-20a8-5335-31ea-e390c57cac1f"));
}
}
}

5001
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064930_20230726-3.Designer.cs

File diff suppressed because it is too large

34
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064930_20230726-3.cs

@ -0,0 +1,34 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202307263 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("92cce083-20a8-5335-31ea-e390c57cac1f"));
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"), null, "0 0/1 * * * ?", false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.HBPOSeSyncAppService" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"));
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("92cce083-20a8-5335-31ea-e390c57cac1f"), null, "0 0/1 * * * ?", false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.HBPOSeSyncAppService" });
}
}
}

5007
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727024321_20230727-1.Designer.cs

File diff suppressed because it is too large

46
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727024321_20230727-1.cs

@ -0,0 +1,46 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202307271 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"));
migrationBuilder.CreateTable(
name: "Set_SyncPositionFlag",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TableName = table.Column<string>(type: "nvarchar(max)", nullable: true),
Position = table.Column<string>(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_SyncPositionFlag", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_SyncPositionFlag");
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"), null, "0 0/1 * * * ?", false, false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.HBPOSeSyncAppService" });
}
}
}

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

@ -3639,6 +3639,49 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_PUB_SEC_DETAIL"); b.ToTable("Set_PUB_SEC_DETAIL");
}); });
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Syncs.SyncPositionFlag", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Position")
.HasColumnType("nvarchar(max)");
b.Property<string>("TableName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Set_SyncPositionFlag");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", b => modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")

Loading…
Cancel
Save