mahao 1 year ago
parent
commit
3f4ef21e47
  1. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj
  2. 92
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/balance.js
  3. 69
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_map_group.js
  4. 50
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_not_settle.js
  5. 117
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_service.js
  6. 66
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_wait_detail.js
  7. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_se_detail_service.js
  8. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_se_edi_service.js
  9. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_can_sa_detail_service.js
  10. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_pd_service.js
  11. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  12. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/contrast/bj_pub_sa_detail_jobservice.js
  13. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/contrast/bj_second_pub_sa_detail_jobservice.js
  14. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_can_sa_service.js
  15. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/contrast/in_pub_sa_detail_jobservice.js
  16. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/contrast/in_second_pub_sa_detail_jobservice.js
  17. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/bbac_sa_detail_jobservice.js
  18. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/first_bbac_sa_detail_jobservice.js
  19. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/second_bbac_sa_detail_jobservice.js
  20. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/third_bbac_sa_detail_jobservice.js
  21. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/first_hbpo_sa_detail_jobservice.js
  22. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/hbpo_sa_detail_jobservice.js
  23. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/second_hbpo_sa_detail_jobservice.js
  24. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/jit_pub_sa_detail_jobservice.js
  25. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/jit_second_pub_sa_detail_jobservice.js
  26. 103
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  27. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs
  28. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs
  29. 68
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
  30. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiCategory.cs
  31. 151
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
  32. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiOperatorType.cs
  33. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs
  34. 25
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs
  35. 40
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  36. 26
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/VmiSqliteContext.cs
  37. 4896
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.Designer.cs
  38. 435
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.cs
  39. 166
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
  40. 2
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountNormalEfCoreRepository.cs
  41. 5
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccount.EntityFrameworkCore.csproj
  42. 15
      code/src/Shared/Win.Sfs.Shared/SharedExtensions.cs

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj

@ -88,6 +88,7 @@
<ItemGroup>
<Folder Include="wwwroot\" />
<Folder Include="wwwroot\files\vmi\" />
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>

92
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/balance.js

@ -1,46 +1,78 @@
const schema = {
title: "通用代码",
title: "寄售库存",
type: "object",
properties: {
project: {
title: "项目",
id: {
type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
hidden: true,
},
],
erpToLoc: {
title: "ERP库位",
type: "string",
},
value: {
title: "",
lu: {
title: "LU零件号",
type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
partCode: {
title: "客户零件号",
type: "string",
},
description: {
title: "描述",
vinCode: {
title: "生产码",
type: "string",
input: "textarea",
showForList: true,
rules: [
{
required: true,
},
{ max: 60 },
],
codeType: {
title: "生产码类型",
type: "string",
},
proType: {
title: "发货类型",
type: "string",
},
qty: {
title: "数量",
type: "string",
},
shippingDate: {
title: "发运日期",
type: "string",
input: "date",
},
creationTime: {
title: "订单日期",
type: "string",
input: "date",
},
seqNumber: {
title: "EDI顺序号",
type: "string",
},
tmpe4: {
title: "客户订单号",
type: "string",
},
uniqueCode: {
title: "塑件唯一码",
type: "string",
},
matchNumber: {
title: "EDI总成号",
type: "string",
},
pjsNum: {
title: "PJIS生产顺序号",
type: "string",
},
desc: {
title: "备注",
type: "string",
},
},
};
const baseUrl = "settleaccount/code-setting";
const queryUrl = `${baseUrl}/get-list`;
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/balance`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
@ -62,7 +94,7 @@ export default function () {
method: queryMethod,
hasFilter: true,
schema: {
title: "通用代码",
title: "寄售库存",
type: "object",
properties: {
filters: {
@ -89,7 +121,7 @@ export default function () {
default: [
{
logic: "and",
column: "project",
column: "erpToLoc",
action: "like",
value: null,
readOnly: true,

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

@ -1,47 +1,48 @@
import version from "../version.js";
import { state2, state3 } from "../state.js";
const schema = {
title: "通用代码",
type: "object",
properties: {
project: {
title: "项目",
version,
invbillNum: {
title: "系统生成发票号",
type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
invGroupNum: {
title: "发票分组号",
type: "string",
},
value: {
title: "",
settleGroupNum: {
title: "结算分组号",
type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
amt: {
title: "金额",
type: "decimal",
},
description: {
title: "描述",
state2,
Extend1: {
title: "扩展字段1",
type: "string",
input: "textarea",
showForList: true,
rules: [
{
required: true,
},
{ max: 60 },
],
Extend2: {
title: "扩展字段2",
type: "string",
},
},
};
const baseUrl = "settleaccount/invoice_service";
const queryUrl = `${baseUrl}/detail_queryUrl`;
const queryUrl = "settleaccount/invoice_service/main-query";
const exportUrl = "settleaccount/invoice_service/export";
const rejectUrl = "settleaccount/invoice_service/reject";
const passedUrl = "settleaccount/invoice_service/approval-passed";
const sync_qadUrl = "settleaccount/invoice_service/sync_qad";
const queryMethod = "POST";
const exportMethod = "POST";
const rejectMethod = "POST";
const passedMethod = "POST";
const sync_qadMethod = "POST";
export default function () {
return {
@ -77,8 +78,8 @@ export default function () {
default: [
{
logic: "and",
column: "project",
action: "like",
column: "version",
action: "equal",
value: null,
readOnly: true,
},
@ -102,6 +103,14 @@ export default function () {
schema: schema,
},
edit: {
exportUrl,
rejectUrl,
passedUrl,
sync_qadUrl,
exportMethod,
rejectMethod,
passedMethod,
sync_qadMethod,
schema: schema,
},
};

50
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_not_settle.js

@ -1,46 +1,42 @@
import version from "../version.js";
const schema = {
title: "通用代码",
type: "object",
properties: {
project: {
title: "项目",
version,
inGroupNum:{
title:"发票分组号",
type:"string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
settleGroupNum:{
title:"结算分组号",
type:"string",
},
value: {
title: "值",
lu:{
title:"可结算分组号",
type:"string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
lu1:{
title:"不可结算分组号",
type:"string",
},
qty:{
title:"数量",
type:"decimal",
},
description: {
title: "描述",
extend1:{
title:"扩展字段1",
type:"string",
input: "textarea",
showForList: true,
rules: [
{
required: true,
},
{ max: 60 },
],
extend2:{
title:"扩展字段2",
type:"string",
},
},
};
const baseUrl = "settleaccount/invoice_service";
const queryUrl = `${baseUrl}/detail_queryUrl`;
const queryUrl = "settleaccount/invoice_service/detail_queryUrl";
const queryMethod = "POST";
export default function () {

117
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_service.js

@ -1,117 +0,0 @@
import version from "../version.js";
import { state2, state3 } from "../state.js";
const schema = {
title: "财务审核",
type: "object",
properties: {
version,
realnvBillNum: {
title: "实际纸质发票号",
type: "string",
},
invbillNum: {
title: "系统生成发票号",
type: "string",
},
amt: {
title: "未税金额",
type: "decimal",
},
taxAmt: {
title: "税后金额",
type: "decimal",
},
fileName: {
title: "开票Excel文件",
type: "string",
},
businessType: {
title: "业务类别",
type: "EnumBusinessType",
},
state2,
},
};
const queryUrl = "settleaccount/invoice_service/main-query";
const exportUrl = "settleaccount/invoice_service/export";
const rejectUrl = "settleaccount/invoice_service/reject";
const passedUrl = "settleaccount/invoice_service/approval-passed";
const sync_qadUrl = "settleaccount/invoice_service/sync_qad";
const queryMethod = "POST";
const exportMethod = "POST";
const rejectMethod = "POST";
const passedMethod = "POST";
const sync_qadMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "财务审核",
type: "object",
properties: {
filters: {
title: "项目",
type: "array",
hidden: true,
items: {
type: "object",
properties: {
logic: {
type: "int",
},
column: {
type: "string",
},
action: {
type: "int",
},
value: {
type: "string",
},
},
},
default: [
{
logic: "and",
column: "version",
action: "equal",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
exportUrl,
rejectUrl,
passedUrl,
sync_qadUrl,
exportMethod,
rejectMethod,
passedMethod,
sync_qadMethod,
schema: schema,
},
};
}

66
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_wait_detail.js

@ -1,46 +1,58 @@
import version from "../version.js";
const schema = {
title: "通用代码",
type: "object",
properties: {
project: {
title: "项目",
version,
invbillNum: {
title: "发票号",
type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
inGroupNum: {
title: "发票分组号",
type: "string",
},
value: {
title: "",
lu: {
title: "可结算分组号",
type: "string",
readOnly: true,
showForList: true,
rules: [
{
required: true,
},
],
price: {
title: "单价",
type: "decimal",
},
description: {
title: "描述",
qty: {
title: "数量",
type: "decimal",
},
amt: {
title: "金额",
type: "decimal",
},
bussiessType: {
title: "业务分类",
type: "EnumBusinessType",
},
extend1: {
title: "扩展字段1",
type: "string",
input: "textarea",
showForList: true,
rules: [
{
required: true,
},
{ max: 60 },
],
extend2: {
title: "扩展字段2",
type: "string",
},
extend3: {
title: "扩展字段3",
type: "string",
},
extend4: {
title: "扩展字段4",
type: "string",
},
},
};
const baseUrl = "settleaccount/invoice_service";
const queryUrl = `${baseUrl}/detail_queryUrl`;
const queryUrl = "settleaccount/invoice_service/detail_queryUrl";
const queryMethod = "POST";
export default function () {

5
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_se_detail_service.js

@ -50,11 +50,10 @@ const schema = {
},
};
const baseUrl = "settleaccount/bbac_se_detail_service";
const queryUrl = `${baseUrl}/get-list`;
const queryUrl = "settleaccount/bbac_se_detail_service/get-list";
// const deleteUrl = `${baseUrl}/delete-list`;
// const importUrl = `${baseUrl}/import`;
const exportUrl = `${baseUrl}/export`;
const exportUrl = "settleaccount/bbac_se_detail_service/export";
const queryMethod = "POST";
// const deleteMethod = "POST";
// const importMethod = "POST";

5
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/input/bbac_se_edi_service.js

@ -46,9 +46,8 @@ const schema = {
},
};
const baseUrl = "settleaccount/bbac_se_edi_service";
const queryUrl = `${baseUrl}/get-list`;
const exportUrl = `${baseUrl}/export`;
const queryUrl = "settleaccount/bbac_se_edi_service/get-list";
const exportUrl = "settleaccount/bbac_se_edi_service/export";
const queryMethod = "POST";
const exportMethod = "POST";

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_can_sa_detail_service.js

@ -53,8 +53,7 @@ const schema = {
},
};
const baseUrl = "settleaccount/bbac_can_sa_service";
const queryUrl = `${baseUrl}/detail-query`;
const queryUrl = "settleaccount/bbac_can_sa_service/detail-query";
const queryMethod = "POST";
export default function () {

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_pd_service.js

@ -29,7 +29,7 @@ const schema = {
const queryUrl = "settleaccount/b-bAC_PD_SERVICE/main-query";
const exportUrl = "settleaccount/b-bAC_PD_SERVICE/export";
const rejectUrl = "settleaccount/b-bAC_PD_SERVICE/reject";
const passedUrl = "settleaccount/b-bAC_PD_SERVICE/approval-passed"
const passedUrl = "settleaccount/b-bAC_PD_SERVICE/approval-passed";
const queryMethod = "POST";
const exportMethod = "POST";
const rejectMethod = "POST";

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

@ -384,7 +384,7 @@ export default [
path: "bbac_can_sa_service",
meta: {
type: "page",
title: "BBAC发票分组号",
title: "可结算单",
icon: "file",
},
children: [
@ -2638,7 +2638,7 @@ export default [
},
children: [
{
path: "invoice_service",
path: "invoice_map_group",
meta: {
type: "page",
title: "财务审核",
@ -2693,6 +2693,14 @@ export default [
pattern: "paged",
},
},
{
path: "reopen",
meta: {
type: "button",
title: "重开",
icon: "file",
},
},
],
},
{
@ -2716,10 +2724,10 @@ export default [
],
},
{
path: "invoice_map_group",
path: "invoice_grp",
meta: {
type: "page",
title: "发票和结算分组对应关系表",
title: "发票分组",
icon: "file",
isHidden: true,
},

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/contrast/bj_pub_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算对比";
config.query.schema.title = "发运与结算";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/contrast/bj_second_pub_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算二次对比";
config.query.schema.title = "发运与结算二次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_can_sa_service.js

@ -7,6 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/contrast/in_pub_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算对比";
config.query.schema.title = "发运与结算";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/contrast/in_second_pub_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算二次对比";
config.query.schema.title = "发运与结算二次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/bbac_sa_detail_jobservice.js

@ -1,13 +1,13 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/job-service.js";
import useConfig from "../../../models/bbac-edi-se-compare.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "EDI与发运数据对比";
config.query.schema.title = "EDI与发运数据";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/first_bbac_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "EDI、发运与结算对比";
config.query.schema.title = "EDI、发运与结算";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/second_bbac_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算数据二次对比";
config.query.schema.title = "发运与结算数据二次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/third_bbac_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "买单件发运与结算数据三次对比";
config.query.schema.title = "买单件发运与结算数据三次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/first_hbpo_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "EDI、发运与结算对比";
config.query.schema.title = "EDI、发运与结算";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/hbpo_sa_detail_jobservice.js

@ -1,13 +1,13 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/job-service.js";
import useConfig from "../../../models/hbpo-edi-se-compare.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "EDI与发运数据对比";
config.query.schema.title = "EDI与发运数据";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/second_hbpo_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算数据二次对比";
config.query.schema.title = "发运与结算数据二次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/jit_pub_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算对比";
config.query.schema.title = "发运与结算";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/contrast/jit_second_pub_sa_detail_jobservice.js

@ -7,7 +7,7 @@ export default {
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算二次对比";
config.query.schema.title = "发运与结算二次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};

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

@ -1,66 +1,145 @@
using System;
using System.IO;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.AspNetCore.Uow;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
namespace Win.Sfs.SettleAccount.Entities.BQ;
public interface IVmiService : IApplicationService, ITransientDependency, IJobService
{
string Test();
void In(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message);
void Out(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message);
Task<PagedResultDto<VmiBalance>> Query(RequestDto request);
void Run(string logGroupId, VmiType type);
}
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class VmiAppService : ApplicationService, IVmiService, IJobService, ITransientDependency
{
private readonly INormalEfCoreRepository<VmiBalance, Guid> _repository;
private readonly INormalEfCoreRepository<VmiBalance, Guid> _balanceRepository;
private readonly INormalEfCoreRepository<VmiLog, Guid> _logRepository;
private readonly INormalEfCoreRepository<VmiSnapshot, Guid> _snapshotRepository;
public VmiAppService(INormalEfCoreRepository<VmiBalance, Guid> repository)
public VmiAppService(INormalEfCoreRepository<VmiBalance, Guid> balanceRepository,
INormalEfCoreRepository<VmiLog, Guid> logRepository,
INormalEfCoreRepository<VmiSnapshot, Guid> snapshotRepository)
{
this._repository = repository;
this._balanceRepository = balanceRepository;
this._logRepository = logRepository;
this._snapshotRepository = snapshotRepository;
}
/// <summary>
/// 定时备份
/// </summary>
[HttpPost]
public void Invoke()
{
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/files/vmi"));
var date = DateTime.Now.ToString("yyyyMMddHH");
var connectionString = $"Data Source=wwwroot/files/vmi/{date}.db";
using var dbContext = new VmiSqliteContext(connectionString);
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();
}
Console.WriteLine($"{nameof(VmiAppService)}:{DateTime.Now}");
}
/// <summary>
/// 入库
/// </summary>
[HttpPost]
public void In(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message)
{
}
/// <summary>
/// 出库
/// </summary>
[HttpPost]
public void Out(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message)
{
}
/// <summary>
/// 库存事务重放
/// </summary>
/// <param name="logGroupId"></param>
/// <param name="type"></param>
[NonAction]
public void Run(string logGroupId, VmiType type)
{
}
/// <summary>
/// 库存余额查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<PagedResultDto<VmiBalance>> Query(RequestDto input)
public async Task<PagedResultDto<VmiBalance>> Balance(RequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
var entities = await _balanceRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _balanceRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
//var dtos = ObjectMapper.Map<List<CodeSetting>, List<CodeSettingDto>>(entities);
return new PagedResultDto<VmiBalance>(totalCount, entities);
}
[HttpGet]
public string Test()
/// <summary>
/// 库存事务查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<PagedResultDto<VmiLog>> Log(RequestDto 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);
//var dtos = ObjectMapper.Map<List<CodeSetting>, List<CodeSettingDto>>(entities);
return new PagedResultDto<VmiLog>(totalCount, entities);
}
/// <summary>
/// 时点库存查询
/// </summary>
/// <param name="name">备份名称</param>
/// <returns></returns>
[HttpPost("{name}")]
public async Task<PagedResultDto<VmiBalance>> Backup(string name, RequestDto input)
{
return "Test";
var connectionString = $"Data Source=wwwroot/files/vmi/{name}.db";
using var dbContext = new VmiSqliteContext(connectionString);
var repo = dbContext.Set<VmiBalance>();
var filters = input.Filters.ToLambda<VmiBalance>();
var query = (input.Filters.Count > 0 ? repo.Where(input.Filters.ToLambda<VmiBalance>()) : repo);
var totalCount = query.Count();
var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync();
return new PagedResultDto<VmiBalance>(totalCount, entities);
}
}

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

@ -1,20 +1,18 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class JobItem : Entity<Guid>, IHasConcurrencyStamp
{
public JobItem()
public JobItem(Guid id)
{
this.Id = Guid.NewGuid();
this.Id = id;
}
public string Name { get; set; }
public string Cron { get; set; }
public string Service { get; set; }
public bool IsRunning { get; set; }
public List<JobLog> Logs { get; set; } = new List<JobLog>();
public string ConcurrencyStamp { get; set; }
}

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

@ -6,7 +6,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class JobLog : Entity<Guid>
{
public JobItem Job { get; set; }
public Guid? JobId { get; set; }
public Guid JobId { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public bool Success { get; set; }

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

@ -1,56 +1,90 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
/// <summary>
/// ERP库位+零件号+生产码
/// </summary>
public class VmiBalance : Entity<Guid>
{
[Display(Name = "Erp目标库位", Description = "Key")]
public VmiBalance(Guid id)
{
this.Id = id;
}
/// <summary>
/// Erp目标库位
/// </summary>
public string ErpToLoc { get; set; }
[Display(Name = "LU零件号", Description = "Key")]
/// <summary>
/// LU零件号
/// </summary>
public string LU { get; set; }
[Display(Name = "客户零件号")]
/// <summary>
/// 客户零件号
/// </summary>
public string PartCode { get; set; }
[Display(Name = "生产码", Description = "Key")]
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "", Description = "Key")]
public string VinCode { get; set; }
[Display(Name = "生产码类型")]
/// <summary>
/// 生产码类型
/// </summary>
public string CodeType { get; set; }
[Display(Name = "发货类型")]
/// <summary>
/// 发货类型
/// </summary>
public string ProType { get; set; }
[Display(Name = "数量")]
/// <summary>
/// 数量
/// </summary>
public decimal Qty { get; set; }
[Display(Name = "发运日期")]
/// <summary>
/// 发运日期
/// </summary>
public DateTime ShippingDate { get; set; }
[Display(Name = "订单日期")]
/// <summary>
/// 订单日期
/// </summary>
public DateTime CreationTime { get; set; }
[Display(Name = "EDI顺序号")]
/// <summary>
/// EDI顺序号
/// </summary>
public string SeqNumber { get; set; }
[Display(Name = "客户订单号")]
/// <summary>
/// 客户订单号
/// </summary>
public string Tmpe4 { get; set; }
[Display(Name = "塑件唯一码")]
/// <summary>
/// 塑件唯一码
/// </summary>
public string UniqueCode { get; set; }
[Display(Name = "EDI总成号")]
/// <summary>
/// EDI总成号
/// </summary>
public string MatchNumber { get; set; }
[Display(Name = "PJIS生产顺序号")]
/// <summary>
/// PJIS生产顺序号
/// </summary>
public string PjsNum { get; set; }
[Display(Name = "备注")]
public string Desc { get; set; }
public List<VmiLog> Logs { get; set; } = new List<VmiLog>();
}

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiCategory.cs

@ -9,6 +9,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
/// </summary>
public class VmiCategory : Entity<Guid>
{
public VmiCategory(Guid id)
{
this.Id = id;
}
public VmiType Type { get; set; }
public string Number { get; set; }
public string Name { get; set; }

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

@ -1,4 +1,5 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
@ -8,18 +9,162 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
/// </summary>
public class VmiLog : Entity<Guid>
{
/// <summary>
/// 批量操作Id
/// </summary>
public string GroupId { get; set; }
/// <summary>
/// 库存事务执行类型
/// </summary>
public VmiLogType VmiType { get; set; }
/// <summary>
/// 库存事务分类
/// </summary>
public Guid CategoryId { get; set; }
/// <summary>
/// 库存Id
/// </summary>
public Guid BalanceId { get; set; }
#region 库存备份
/// <summary>
/// Erp目标库位
/// </summary>
public string ErpToLoc { get; set; }
/// <summary>
/// LU零件号
/// </summary>
public string LU { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
public string PartCode { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "", Description = "Key")]
public string VinCode { get; set; }
/// <summary>
/// 生产码类型
/// </summary>
public string CodeType { get; set; }
/// <summary>
/// 发货类型
/// </summary>
public string ProType { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { get; set; }
/// <summary>
/// 发运日期
/// </summary>
public DateTime ShippingDate { get; set; }
/// <summary>
/// 订单日期
/// </summary>
public DateTime CreationTime { get; set; }
/// <summary>
/// EDI顺序号
/// </summary>
public string SeqNumber { get; set; }
/// <summary>
/// 客户订单号
/// </summary>
public string Tmpe4 { get; set; }
/// <summary>
/// 塑件唯一码
/// </summary>
public string UniqueCode { get; set; }
/// <summary>
/// 操作范围
/// EDI总成号
/// </summary>
public string SessionId { get; set; }
public string MatchNumber { get; set; }
/// <summary>
/// PJIS生产顺序号
/// </summary>
public string PjsNum { get; set; }
/// <summary>
/// 备注
/// </summary>
public string BalanceDesc { get; set; }
#endregion 库存备份
/// <summary>
/// 变动单号
/// </summary>
public string OrderNumber { get; set; }
/// <summary>
/// 变动时间
/// </summary>
public DateTime CreatedDate { get; set; } = DateTime.Now;
/// <summary>
/// 变动类型
/// </summary>
public string D2 { get; set; }
/// <summary>
/// 便动人
/// </summary>
public string CreatedBy { get; set; }
public VmiOperatorType Type { get; set; }
/// <summary>
/// 实扣LU零件号
/// </summary>
public string F2 { get; set; }
/// <summary>
/// 实扣客户零件号
/// </summary>
public string G2 { get; set; }
/// <summary>
/// 结算LU零件号
/// </summary>
public string H2 { get; set; }
/// <summary>
/// 结算客户零件号
/// </summary>
public string I2 { get; set; }
/// <summary>
/// 实扣生产码
/// </summary>
public string J2 { get; set; }
/// <summary>
/// 结算生产码
/// </summary>
public string K2 { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Desc { get; set; }
public VmiType Type { get; set; }
public VmiCategory Category { get; set; }
public VmiBalance Balance { get; set; }
}

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

@ -1,8 +0,0 @@
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public enum VmiOperatorType
{
Do,
UnDo,
ReDo
}

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs

@ -9,9 +9,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiSnapshot : Entity<Guid>
{
/// <summary>
/// YYYY-MM-DD hh
/// 备份名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 数据库文件路径
/// </summary>
public string Path { get; set; }
}

25
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs

@ -5,6 +5,31 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
/// </summary>
public enum VmiType
{
/// <summary>
/// 入库
/// </summary>
In,
/// <summary>
/// 出库
/// </summary>
Out
}
public enum VmiLogType
{
/// <summary>
/// 初次执行
/// </summary>
Do,
/// <summary>
/// 撤销
/// </summary>
UnDo,
/// <summary>
/// 重做
/// </summary>
ReDo
}

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

@ -15,6 +15,7 @@ using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.Entities.SettleAccounts;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared;
using Win.Sfs.Shared.Constant;
namespace Win.Sfs.SettleAccount
@ -807,13 +808,10 @@ namespace Win.Sfs.SettleAccount
});
}
private static void ConfigurePUB_SEC_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<PUB_SEC_DETAIL>(b =>
{
b.ToTable($"{options.TablePrefix}_PUB_SEC_DETAIL", options.Schema);
b.ConfigureByConvention();
@ -829,12 +827,11 @@ namespace Win.Sfs.SettleAccount
b.Property(x => x.ConcurrencyStamp).HasMaxLength(50);
});
}
private static void ConfigureHBPO_SEC_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<HBPO_SEC_DETAIL>(b =>
{
b.ToTable($"{options.TablePrefix}_HBPO_SEC_DETAIL", options.Schema);
b.ConfigureByConvention();
@ -850,12 +847,11 @@ namespace Win.Sfs.SettleAccount
b.Property(x => x.ConcurrencyStamp).HasMaxLength(50);
});
}
private static void ConfigureBBAC_SEC_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<BBAC_SEC_DETAIL>(b =>
{
b.ToTable($"{options.TablePrefix}_BBAC_SEC_DETAIL", options.Schema);
b.ConfigureByConvention();
@ -872,14 +868,6 @@ namespace Win.Sfs.SettleAccount
});
}
private static void ConfigureHBPO_SE_EDI(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<HBPO_SE_EDI>(b =>
@ -1165,7 +1153,6 @@ namespace Win.Sfs.SettleAccount
private static void ConfigureVmi(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<JobItem>().HasData(new JobItem { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiService" });
builder.Entity<JobItem>(b =>
{
b.ToTable($"{options.TablePrefix}_JobItem", options.Schema);
@ -1176,7 +1163,12 @@ namespace Win.Sfs.SettleAccount
b.Property(o => o.Cron).HasMaxLength(50).IsRequired();
b.Property(x => x.ConcurrencyStamp).HasMaxLength(50);
});
builder.Entity<JobLog>().HasOne(o => o.Job).WithMany(o => o.Logs).HasForeignKey(o => o.JobId).OnDelete(DeleteBehavior.SetNull);
builder.Entity<JobLog>(b =>
{
b.ToTable($"{options.TablePrefix}_JobLog", options.Schema);
b.ConfigureByConvention();
});
builder.Entity<VmiCategory>(b =>
{
@ -1185,6 +1177,7 @@ namespace Win.Sfs.SettleAccount
b.Property(o => o.Number).HasMaxLength(50).IsRequired();
b.HasIndex(o => o.Number).IsUnique();
b.Property(o => o.Name).HasMaxLength(50).IsRequired();
b.HasIndex(o => o.Name).IsUnique();
});
builder.Entity<VmiBalance>(b =>
@ -1193,20 +1186,29 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention();
b.HasAlternateKey(o => new { o.ErpToLoc, o.PartCode, o.LU });
});
builder.Entity<VmiBalance>().HasData(new VmiBalance("test".ToGuid()) { ErpToLoc = "key1", PartCode = "key2", LU = "key3", Desc = "test" });
builder.Entity<VmiLog>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiLog", options.Schema);
b.ConfigureByConvention();
});
builder.Entity<VmiLog>().HasOne(o => o.Category).WithMany(o => o.Logs).HasForeignKey(o => o.CategoryId).OnDelete(DeleteBehavior.Cascade);
builder.Entity<VmiLog>().HasOne(o => o.Balance).WithMany(o => o.Logs).HasForeignKey(o => o.BalanceId).OnDelete(DeleteBehavior.Cascade);
builder.Entity<VmiSnapshot>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiSnapshot", options.Schema);
b.ConfigureByConvention();
});
//seed
builder.Entity<JobItem>().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiService" });
builder.Entity<VmiCategory>().HasData(new VmiCategory("发运".ToGuid()) { Type = VmiType.In, Name = "发运", Number = "100" });
builder.Entity<VmiCategory>().HasData(new VmiCategory("结算".ToGuid()) { Type = VmiType.Out, Name = "结算", Number = "200" });
builder.Entity<VmiCategory>().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" });
builder.Entity<VmiCategory>().HasData(new VmiCategory("调整入库".ToGuid()) { Type = VmiType.In, Name = "调整入库", Number = "400" });
builder.Entity<VmiCategory>().HasData(new VmiCategory("调整出库".ToGuid()) { Type = VmiType.Out, Name = "调整出库", Number = "500" });
builder.Entity<VmiCategory>().HasData(new VmiCategory("漏发补货".ToGuid()) { Type = VmiType.In, Name = "漏发补货", Number = "600" });
builder.Entity<VmiCategory>().HasData(new VmiCategory("负库存补货".ToGuid()) { Type = VmiType.In, Name = "负库存补货", Number = "700" });
}
}

26
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/VmiSqliteContext.cs

@ -0,0 +1,26 @@
using System;
using Microsoft.EntityFrameworkCore;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
namespace Win.Sfs.SettleAccount.EntityFrameworkCore;
public class VmiSqliteContext : DbContext
{
private readonly string _connectionString;
public VmiSqliteContext(string connectionString)
{
this._connectionString = connectionString;
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite(this._connectionString);
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<VmiBalance>().HasKey(o => o.Id);
modelBuilder.Entity<VmiBalance>().Property<DateTime>("BackupDate");
}
}

4896
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.Designer.cs

File diff suppressed because it is too large

435
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.cs

@ -0,0 +1,435 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi3 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_JobLog_Set_JobItem_JobId",
table: "JobLog");
migrationBuilder.DropPrimaryKey(
name: "PK_JobLog",
table: "JobLog");
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c318a2b7-df89-4c68-aa3a-0e9c470d584f"));
migrationBuilder.RenameTable(
name: "JobLog",
newName: "Set_JobLog");
migrationBuilder.RenameColumn(
name: "SessionId",
table: "Set_VmiLog",
newName: "VinCode");
migrationBuilder.RenameIndex(
name: "IX_JobLog_JobId",
table: "Set_JobLog",
newName: "IX_Set_JobLog_JobId");
migrationBuilder.AddColumn<string>(
name: "BalanceDesc",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CodeType",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "CreationTime",
table: "Set_VmiLog",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<string>(
name: "D2",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Desc",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ErpToLoc",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "F2",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "G2",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "GroupId",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "H2",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "I2",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "J2",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "K2",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "LU",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "MatchNumber",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PartCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PjsNum",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ProType",
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: "SeqNumber",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "ShippingDate",
table: "Set_VmiLog",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<string>(
name: "Tmpe4",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "UniqueCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "VmiType",
table: "Set_VmiLog",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AlterColumn<Guid>(
name: "JobId",
table: "Set_JobLog",
type: "uniqueidentifier",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uniqueidentifier",
oldNullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_Set_JobLog",
table: "Set_JobLog",
column: "Id");
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), null, "0 0 8 26 *", false, "库存快照", "Win.Sfs.SettleAccount.Entities.BQ.VmiService" });
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "CodeType", "CreationTime", "Desc", "ErpToLoc", "LU", "MatchNumber", "PartCode", "PjsNum", "ProType", "Qty", "SeqNumber", "ShippingDate", "Tmpe4", "UniqueCode", "VinCode" },
values: new object[] { new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "test", "key1", "key3", null, "key2", null, null, 0m, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, null });
migrationBuilder.InsertData(
table: "Set_VmiCategory",
columns: new[] { "Id", "Name", "Number", "Type" },
values: new object[,]
{
{ new Guid("a6462ee4-6e2c-bc8b-b1cb-5203c8dcaea8"), "发运", "100", 0 },
{ new Guid("869f1589-9063-a545-719e-a83b6dca03c3"), "结算", "200", 1 },
{ new Guid("c9199f7f-7cc8-7423-d608-f206167ae0b6"), "客户退货", "300", 1 },
{ new Guid("5fda8ad4-f424-a9e1-8174-72c0f29fc225"), "调整入库", "400", 0 },
{ new Guid("42230472-9f26-7484-ff2a-451878e9955f"), "调整出库", "500", 1 },
{ new Guid("3e0655a6-2532-a861-344f-b9c53c809c64"), "漏发补货", "600", 0 },
{ new Guid("27b1609e-05af-cef7-f5f4-dd598c31b4de"), "负库存补货", "700", 0 }
});
migrationBuilder.CreateIndex(
name: "IX_Set_VmiCategory_Name",
table: "Set_VmiCategory",
column: "Name",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_Set_JobLog_Set_JobItem_JobId",
table: "Set_JobLog",
column: "JobId",
principalTable: "Set_JobItem",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Set_JobLog_Set_JobItem_JobId",
table: "Set_JobLog");
migrationBuilder.DropIndex(
name: "IX_Set_VmiCategory_Name",
table: "Set_VmiCategory");
migrationBuilder.DropPrimaryKey(
name: "PK_Set_JobLog",
table: "Set_JobLog");
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"));
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"));
migrationBuilder.DeleteData(
table: "Set_VmiCategory",
keyColumn: "Id",
keyValue: new Guid("27b1609e-05af-cef7-f5f4-dd598c31b4de"));
migrationBuilder.DeleteData(
table: "Set_VmiCategory",
keyColumn: "Id",
keyValue: new Guid("3e0655a6-2532-a861-344f-b9c53c809c64"));
migrationBuilder.DeleteData(
table: "Set_VmiCategory",
keyColumn: "Id",
keyValue: new Guid("42230472-9f26-7484-ff2a-451878e9955f"));
migrationBuilder.DeleteData(
table: "Set_VmiCategory",
keyColumn: "Id",
keyValue: new Guid("5fda8ad4-f424-a9e1-8174-72c0f29fc225"));
migrationBuilder.DeleteData(
table: "Set_VmiCategory",
keyColumn: "Id",
keyValue: new Guid("869f1589-9063-a545-719e-a83b6dca03c3"));
migrationBuilder.DeleteData(
table: "Set_VmiCategory",
keyColumn: "Id",
keyValue: new Guid("a6462ee4-6e2c-bc8b-b1cb-5203c8dcaea8"));
migrationBuilder.DeleteData(
table: "Set_VmiCategory",
keyColumn: "Id",
keyValue: new Guid("c9199f7f-7cc8-7423-d608-f206167ae0b6"));
migrationBuilder.DropColumn(
name: "BalanceDesc",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CodeType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CreationTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "D2",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "Desc",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ErpToLoc",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "F2",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "G2",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "GroupId",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "H2",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "I2",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "J2",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "K2",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "LU",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "MatchNumber",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "PartCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "PjsNum",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ProType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "Qty",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "SeqNumber",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ShippingDate",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "Tmpe4",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "UniqueCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "VmiType",
table: "Set_VmiLog");
migrationBuilder.RenameTable(
name: "Set_JobLog",
newName: "JobLog");
migrationBuilder.RenameColumn(
name: "VinCode",
table: "Set_VmiLog",
newName: "SessionId");
migrationBuilder.RenameIndex(
name: "IX_Set_JobLog_JobId",
table: "JobLog",
newName: "IX_JobLog_JobId");
migrationBuilder.AlterColumn<Guid>(
name: "JobId",
table: "JobLog",
type: "uniqueidentifier",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AddPrimaryKey(
name: "PK_JobLog",
table: "JobLog",
column: "Id");
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("c318a2b7-df89-4c68-aa3a-0e9c470d584f"), null, "0 0 8 26 *", false, "库存快照", "Win.Sfs.SettleAccount.Entities.BQ.VmiService" });
migrationBuilder.AddForeignKey(
name: "FK_JobLog_Set_JobItem_JobId",
table: "JobLog",
column: "JobId",
principalTable: "Set_JobItem",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
}
}

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

@ -18,7 +18,7 @@ namespace Win.Sfs.SettleAccount.Migrations
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.8")
.HasAnnotation("ProductVersion", "5.0.17")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA", b =>
@ -3674,7 +3674,7 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasData(
new
{
Id = new Guid("c318a2b7-df89-4c68-aa3a-0e9c470d584f"),
Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
Cron = "0 0 8 26 *",
IsRunning = false,
Name = "库存快照",
@ -3694,7 +3694,7 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Exception")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("JobId")
b.Property<Guid>("JobId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("Start")
@ -3707,7 +3707,7 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasIndex("JobId");
b.ToTable("JobLog");
b.ToTable("Set_JobLog");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiBalance", b =>
@ -3769,6 +3769,19 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasAlternateKey("ErpToLoc", "PartCode", "LU");
b.ToTable("Set_VmiBalance");
b.HasData(
new
{
Id = new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Desc = "test",
ErpToLoc = "key1",
LU = "key3",
PartCode = "key2",
Qty = 0m,
ShippingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiCategory", b =>
@ -3792,10 +3805,64 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.HasIndex("Number")
.IsUnique();
b.ToTable("Set_VmiCategory");
b.HasData(
new
{
Id = new Guid("a6462ee4-6e2c-bc8b-b1cb-5203c8dcaea8"),
Name = "发运",
Number = "100",
Type = 0
},
new
{
Id = new Guid("869f1589-9063-a545-719e-a83b6dca03c3"),
Name = "结算",
Number = "200",
Type = 1
},
new
{
Id = new Guid("c9199f7f-7cc8-7423-d608-f206167ae0b6"),
Name = "客户退货",
Number = "300",
Type = 1
},
new
{
Id = new Guid("5fda8ad4-f424-a9e1-8174-72c0f29fc225"),
Name = "调整入库",
Number = "400",
Type = 0
},
new
{
Id = new Guid("42230472-9f26-7484-ff2a-451878e9955f"),
Name = "调整出库",
Number = "500",
Type = 1
},
new
{
Id = new Guid("3e0655a6-2532-a861-344f-b9c53c809c64"),
Name = "漏发补货",
Number = "600",
Type = 0
},
new
{
Id = new Guid("27b1609e-05af-cef7-f5f4-dd598c31b4de"),
Name = "负库存补货",
Number = "700",
Type = 0
});
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiLog", b =>
@ -3804,27 +3871,99 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BalanceDesc")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("BalanceId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("CategoryId")
.HasColumnType("uniqueidentifier");
b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)");
b.Property<string>("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
b.Property<string>("D2")
.HasColumnType("nvarchar(max)");
b.Property<string>("Desc")
.HasColumnType("nvarchar(max)");
b.Property<string>("ErpToLoc")
.HasColumnType("nvarchar(max)");
b.Property<string>("F2")
.HasColumnType("nvarchar(max)");
b.Property<string>("G2")
.HasColumnType("nvarchar(max)");
b.Property<string>("GroupId")
.HasColumnType("nvarchar(max)");
b.Property<string>("H2")
.HasColumnType("nvarchar(max)");
b.Property<string>("I2")
.HasColumnType("nvarchar(max)");
b.Property<string>("J2")
.HasColumnType("nvarchar(max)");
b.Property<string>("K2")
.HasColumnType("nvarchar(max)");
b.Property<string>("LU")
.HasColumnType("nvarchar(max)");
b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrderNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("SessionId")
b.Property<string>("PartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("PjsNum")
.HasColumnType("nvarchar(max)");
b.Property<string>("ProType")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("SeqNumber")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("ShippingDate")
.HasColumnType("datetime2");
b.Property<string>("Tmpe4")
.HasColumnType("nvarchar(max)");
b.Property<int>("Type")
.HasColumnType("int");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("VinCode")
.HasColumnType("nvarchar(max)");
b.Property<int>("VmiType")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("BalanceId");
@ -4718,9 +4857,10 @@ namespace Win.Sfs.SettleAccount.Migrations
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobLog", b =>
{
b.HasOne("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", "Job")
.WithMany("Logs")
.WithMany()
.HasForeignKey("JobId")
.OnDelete(DeleteBehavior.SetNull);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Job");
});
@ -4728,7 +4868,7 @@ namespace Win.Sfs.SettleAccount.Migrations
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiLog", b =>
{
b.HasOne("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiBalance", "Balance")
.WithMany("Logs")
.WithMany()
.HasForeignKey("BalanceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@ -4744,16 +4884,6 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Navigation("Category");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", b =>
{
b.Navigation("Logs");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiBalance", b =>
{
b.Navigation("Logs");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiCategory", b =>
{
b.Navigation("Logs");

2
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountNormalEfCoreRepository.cs

@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;

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

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
@ -26,10 +26,11 @@
<ItemGroup>
<PackageReference Include="FlexLabs.EntityFrameworkCore.Upsert" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.8">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.17">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.17" />
<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" />

15
code/src/Shared/Win.Sfs.Shared/SharedExtensions.cs

@ -0,0 +1,15 @@
using System;
using System.Security.Cryptography;
using System.Text;
namespace Win.Sfs.Shared
{
public static class SharedExtensions
{
public static Guid ToGuid(this string input)
{
var hash = MD5.HashData(Encoding.UTF8.GetBytes(input));
return new Guid(hash);
}
}
}
Loading…
Cancel
Save