mahao 1 year ago
parent
commit
2badbf4db3
  1. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs
  2. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js
  3. 9
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  4. BIN
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/influxdb/influxd.exe
  5. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/influxdb/influxdb.conf
  6. 11
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/influxdb/start.cmd
  7. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/influxdb/stop.cmd
  8. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/material-relationship.js
  9. 128
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js
  10. 262
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js
  11. 139
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/backup.js
  12. 123
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/balance.js
  13. 248
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js
  14. 92
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/vmi.js
  15. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/adjust.js
  16. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/backup.js
  17. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/balance.js
  18. 0
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/inventory.js
  19. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js
  20. 34
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/vmi.js
  21. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  22. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/_list.js
  23. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js
  24. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs
  25. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs
  26. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  27. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  28. 169
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  29. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  30. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  31. 39
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs
  32. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  33. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  34. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs
  35. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  36. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  37. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  38. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs
  39. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
  40. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
  41. 28
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
  42. 151
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  43. 363
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  44. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
  45. 68
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs
  46. 126
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  47. 20
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs
  48. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs
  49. 33
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiAsyncTask.cs
  50. 92
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
  51. 163
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
  52. 22
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiMessage.cs
  53. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs
  54. 46
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  55. 25
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/VmiSqliteContext.cs
  56. 5618
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230822072327_vmi12.Designer.cs
  57. 236
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230822072327_vmi12.cs
  58. 5739
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823012043_vmi13.Designer.cs
  59. 242
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823012043_vmi13.cs
  60. 235
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
  61. 30
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs

@ -102,9 +102,9 @@ namespace Win.Sfs.SettleAccount
//注册BOLB容器
ConfigureBLOBServices(configuration);
//注册大众的二配实际输出文件的容器
ConfigureBLOBSecSummaryServices(configuration);
//ConfigureBLOBSecSummaryServices(configuration);
//注册奔腾的二配实际输出文件的容器
ConfigureBLOBTSecSummaryServices(configuration);
//ConfigureBLOBTSecSummaryServices(configuration);
ConfigureHangfire(context, configuration);
//context.Services.Configure<AbpExceptionHttpStatusCodeOptions>(options =>

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

@ -11,7 +11,6 @@ export default {
template: html`
<el-config-provider :locale="localeMap.get($i18n.locale)">
<router-view></router-view>
<el-popconfirm title="服务端已更新,是否刷新?"> </el-popconfirm>
</el-config-provider>
`,
setup() {

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

@ -23,9 +23,12 @@ export default {
<el-col>
<app-form inline mode="query" label-position="left" :schema="config.query.schema" v-model="queryModel" @submit="load" :hideButton="true" :isQueryForm="true">
<template v-for="item in filterList.filter(o=>!o.hidden&&o.readOnly)">
<el-form-item :label="config.edit.schema.properties[item.column].title">
<app-form-input v-model="item" :schema="config.edit.schema.properties[item.column]" prop="value" />
</el-form-item>
<template v-if="config.edit.schema.properties[item.column]?.title">
<el-form-item :label="config.edit.schema.properties[item.column].title">
<app-form-input v-model="item" :schema="config.edit.schema.properties[item.column]" prop="value" />
</el-form-item>
</template>
<div v-else>{{item.column}}</div>
</template>
</app-form>
<template v-for="item in buttons">

BIN
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/influxdb/influxd.exe

Binary file not shown.

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/influxdb/influxdb.conf

@ -1,6 +0,0 @@
[meta]
dir = "./data/meta"
[data]
dir = "./data/data"
wal-dir = "./data/wal"

11
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/influxdb/start.cmd

@ -1,11 +0,0 @@
@echo off
tasklist|find /i "influxd.exe"
if %errorlevel% == 0 (
¡¡¡¡exit
)
%1 start mshta vbscript:createobject("wscript.shell").run("""%~0"" ::",0)(window.close)&&exit
start /b ./influxd.exe -config ./influxdb.conf

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/influxdb/stop.cmd

@ -1,3 +0,0 @@
@ECHO OFF
taskkill /im influxd.exe /f /t

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/material-relationship.js

@ -1,3 +1,5 @@
import businessType from "../_options.js";
const schema = {
title: "客户零件关系",
type: "object",
@ -14,6 +16,7 @@ const schema = {
title: "厂内物料描述",
type: "string",
},
businessType,
},
};

128
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js

@ -16,7 +16,56 @@ const schema = {
},
};
export default function (businessType) {
const querySchema = {
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,
},
},
};
export default function (businessType, meta) {
let service = null;
let detailService = null;
if (businessType === "JisBBAC") {
@ -38,69 +87,40 @@ export default function (businessType) {
const importMethod = "POST";
const exportMethod = "POST";
const importSchema = {
properties: {
version: Object.assign(version, { rules: [{ required: true }] }),
},
};
if (meta.client === "bbac-104" || meta.client === "bbac-1046") {
schema.properties.site = importSchema.properties.site = {
type: "number",
options: [],
hidden: true,
default: meta.client === "bbac-104" ? 104 : 1046,
};
querySchema.properties.filters.default.push({
logic: "and",
column: "site",
action: "equal",
hidden: true,
value: schema.properties.site.default,
readOnly: true,
});
}
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,
},
},
},
schema: querySchema,
},
table: {
schema: schema,
},
import: {
schema: {
properties: {
version: Object.assign(version, { rules: [{ required: true }] }),
},
},
schema: importSchema,
},
edit: {
deleteUrl,

262
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js

@ -1,262 +0,0 @@
import { billType, codeType, subBillType } from "./inventory.js";
const schema = {
title: "寄售库存调整",
type: "object",
properties: {
logType: {
title: "库存事务分类",
type: "string",
default: "Type500",
hidden: true,
},
changedType: {
title: "变动类型",
type: "string",
default: "in",
hidden: true,
},
partCode: {
title: "LU零件号",
type: "string",
rules: [
{
required: true,
},
],
},
customerPartCode: {
title: "客户零件号",
type: "string",
rules: [
{
required: true,
},
],
},
codeType,
billType,
qty: {
title: "数量",
type: "number",
input: "number",
},
billTime: {
title: "发运日期",
type: "string",
input: "datetime",
},
changedNumber: {
title: "变动单号",
type: "string",
rules: [
{
required: true,
},
],
},
changedTime: {
title: "变动时间",
type: "string",
input: "datetime",
},
deliverTime: {
title: "订单日期",
type: "string",
input: "datetime",
},
erpToLoc: {
title: "ERP库位",
type: "string",
rules: [
{
required: true,
},
],
},
orderNum: {
title: "EDI原始订单号",
type: "string",
rules: [
{
required: true,
},
],
},
changedBy: {
title: "变动人",
type: "string",
rules: [
{
required: true,
},
],
},
subBillType,
reMark: {
title: "备注",
type: "string",
input: "textarea",
},
vinCode: {
title: "EDI订单生产码",
type: "string",
rules: [
{
required: true,
},
],
},
billNum: {
title: "WMS发运单号",
type: "string",
rules: [
{
required: true,
},
],
},
},
};
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/log`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = "settleaccount/vmi/edit-balance";
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/import`;
const exportUrl = `${baseUrl}/export`;
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "通用代码",
type: "object",
properties: {
logTypes: { type: "array", hidden: true, default: ["Type500", "Type600"] },
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: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "createdDate",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "lu",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "tmpe4",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "vinCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "codeType",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "proType",
action: "like",
value: null,
readOnly: true,
},
// {
// logic: "and",
// column: "logType",
// action: "in",
// value: "Type500, Type600",
// readOnly: true,
// },
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
schema: schema,
},
};
}

139
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/backup.js

@ -1,139 +0,0 @@
import useVmi from "./vmi.js";
const schema = useVmi();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/backup`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/code-setting-upload-excel-import`;
const exportUrl = `${baseUrl}/backup-export`;
const invokeUrl = "settleaccount/vmi/invoke";
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "POST";
const invokeMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
autoSubmit: true,
disableQueryOnLoad: true,
schema: {
title: "时点库存余额查询",
type: "object",
properties: {
name: {
title: "时间",
type: "string",
input: "select",
url: "settleaccount/vmi/snapshot",
value: "name",
label: "name",
defaultSelected: true,
clearable: false,
},
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: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "partCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "vinCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "codeType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billType",
action: "equal",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
invokeUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
invokeMethod,
schema: schema,
},
};
}

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

@ -1,123 +0,0 @@
import useVmi from "./vmi.js";
const schema = useVmi();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/balance`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/code-setting-upload-excel-import`;
const exportUrl = `${baseUrl}/balance-export`;
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "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: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "partCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "vinCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "codeType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billType",
action: "equal",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
schema: schema,
},
};
}

248
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js

@ -1,248 +0,0 @@
import { billType, codeType, subBillType } from "./inventory.js";
//变动单据号、发生时间、生产码类型、、订单号、库位、变动数、EDI顺序号、备注、变动类型(In、Out标识)、发货类型(JIS\JIT\买单件\备件等)、
//实扣LU零件号、实扣客户零件号、结算LU零件号、结算客户零件号、实扣生产码、结算生产码
//库位、开始结束时间段、发货类型、生产码、生产码类型、LU零件号、订单号
const options = [
{ value: null, label: "" },
{ value: true, label: "是" },
{ value: false, label: "否" },
];
const schema = {
title: "库存事务日志",
type: "object",
properties: {
partCode: {
title: "LU零件号",
type: "string",
},
customerPartCode: {
title: "客户零件号",
type: "string",
},
codeType,
billType,
qty: {
title: "数量",
type: "number",
},
billTime: {
title: "发运日期",
type: "string",
input: "datetime",
},
deliverTime: {
title: "订单日期",
type: "string",
input: "datetime",
},
erpToLoc: {
title: "ERP库位",
type: "string",
},
seq: {
title: "EDI顺序号",
type: "string",
},
orderNum: {
title: "客户订单号",
type: "string",
},
uniqueCode: {
title: "塑件唯一码",
type: "string",
},
matchNumber: {
title: "EDI总成号",
type: "string",
},
pjsNum: {
title: "PJIS生产顺序号",
type: "string",
},
changedNumber: {
title: "变动单号",
type: "string",
},
changedTime: {
title: "变动时间",
type: "string",
input: "datetime",
},
changedBy: {
title: "变动人",
type: "string",
},
partCode2: {
title: "结算厂内零件号",
type: "string",
},
realCode: {
title: "WMS实发生产码",
type: "string",
},
vinCode: {
title: "EDI订单生产码",
type: "string",
},
settlementVinCode: {
title: "结算生产码",
type: "string",
},
subBillType,
isReplenished: {
title: "是否补货",
type: "boolean",
input: "select",
options,
},
configcode: {
title: "配置码",
type: "string",
},
},
};
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/log`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/log-import`;
const exportUrl = `${baseUrl}/log-export`;
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
const importMethod = "POST";
const exportMethod = "POST";
export default function () {
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "通用代码",
type: "object",
properties: {
// logTypes: { type: "array", hidden: true, default: ["Type200", "Type400"] },
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: "erpToLoc",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "vinCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "codeType",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "partCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "orderNum",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "billTime",
action: "biggerThanOrEqual",
value: null,
readOnly: true,
hidden: true,
},
{
logic: "and",
column: "billTime",
action: "smallThanOrEqual",
value: null,
readOnly: true,
hidden: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
schema: schema,
},
};
}

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

@ -1,92 +0,0 @@
import { billType, codeType, subBillType } from "./inventory.js";
export default function () {
return {
title: "寄售库存",
type: "object",
properties: {
// id: {
// type: "string",
// hidden: true,
// showForList: false,
// },
// lu: {
// title: "LU零件号",
// type: "string",
// },
partCode: {
title: "LU零件号",
type: "string",
},
customerPartCode: {
title: "客户零件号",
type: "string",
},
codeType,
billType,
qty: {
title: "数量",
type: "string",
},
billTime: {
title: "发运日期",
type: "string",
input: "datetime",
},
deliverTime: {
title: "订单日期",
type: "string",
input: "datetime",
},
erpToLoc: {
title: "ERP库位",
type: "string",
},
seq: {
title: "EDI顺序号",
type: "string",
},
orderNum: {
title: "客户订单号",
type: "string",
},
uniqueCode: {
title: "塑件唯一码",
type: "string",
},
matchNumber: {
title: "EDI总成号",
type: "string",
},
pjsNum: {
title: "PJIS生产顺序号",
type: "string",
},
reMark: {
title: "备注",
type: "string",
},
configcode: {
title: "配置码",
type: "string",
},
factory: {
title: "工厂",
type: "string",
},
subBillType,
realCode: {
title: "WMS实发生产码",
type: "string",
},
vinCode: {
title: "EDI订单生产码",
type: "string",
},
settlementVinCode: {
title: "结算生产码",
type: "string",
},
},
};
}

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/adjust.js

@ -60,8 +60,8 @@ export default function () {
},
{
logic: "and",
column: "billType",
action: "equal",
column: "realPartCode",
action: "like",
value: null,
readOnly: true,
},
@ -81,8 +81,8 @@ export default function () {
},
{
logic: "and",
column: "partCode",
action: "like",
column: "deliverBillType",
action: "equal",
value: null,
readOnly: true,
},

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

@ -1,6 +1,6 @@
import useSchema from "./vmi.js";
import useVmi from "./vmi.js";
const schema = useSchema();
const schema = useVmi();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/backup`;
@ -37,7 +37,7 @@ export default function () {
type: "string",
input: "select",
url: "settleaccount/vmi/snapshot",
value: "name",
value: "description",
label: "name",
defaultSelected: true,
clearable: false,
@ -73,7 +73,7 @@ export default function () {
},
{
logic: "and",
column: "partCode",
column: "realPartCode",
action: "like",
value: null,
readOnly: true,
@ -94,7 +94,7 @@ export default function () {
},
{
logic: "and",
column: "billType",
column: "deliverBillType",
action: "equal",
value: null,
readOnly: true,

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/balance.js

@ -1,6 +1,6 @@
import useSchema from "./vmi.js";
import useVmi from "./vmi.js";
const schema = useSchema();
const schema = useVmi();
const baseUrl = "settleaccount/vmi";
const queryUrl = `${baseUrl}/balance`;
@ -59,7 +59,7 @@ export default function () {
},
{
logic: "and",
column: "partCode",
column: "realPartCode",
action: "like",
value: null,
readOnly: true,
@ -80,7 +80,7 @@ export default function () {
},
{
logic: "and",
column: "billType",
column: "deliverBillType",
action: "equal",
value: null,
readOnly: true,

0
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/inventory.js → code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/inventory.js

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

@ -60,8 +60,8 @@ export default function () {
},
{
logic: "and",
column: "billType",
action: "equal",
column: "realPartCode",
action: "like",
value: null,
readOnly: true,
},
@ -81,8 +81,8 @@ export default function () {
},
{
logic: "and",
column: "partCode",
action: "like",
column: "deliverBillType",
action: "equal",
value: null,
readOnly: true,
},

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

@ -5,16 +5,16 @@ function useSchema() {
title: "寄售库存",
type: "object",
properties: {
partCode: {
realPartCode: {
title: "LU零件号",
type: "string",
},
customerPartCode: {
custPartCode: {
title: "客户零件号",
type: "string",
},
codeType,
billType: deliverBillType,
deliverBillType,
qty: {
title: "数量",
type: "string",
@ -24,7 +24,7 @@ function useSchema() {
type: "string",
input: "datetime",
},
deliverTime: {
assembleData: {
title: "订单日期",
type: "string",
input: "datetime",
@ -53,8 +53,8 @@ function useSchema() {
title: "PJIS生产顺序号",
type: "string",
},
reMark: {
title: "备注",
realCode: {
title: "实际生产码",
type: "string",
},
configcode: {
@ -65,17 +65,13 @@ function useSchema() {
title: "工厂",
type: "string",
},
subBillType: deliverSubBillType,
realCode: {
title: "WMS实发生产码",
type: "string",
},
deliverSubBillType,
vinCode: {
title: "EDI订单生产码",
type: "string",
},
settlementVinCode: {
title: "结算生产码",
reMark: {
title: "备注",
type: "string",
},
},
@ -111,14 +107,22 @@ function useLogSchema() {
title: "变动人",
type: "string",
},
partCode2: {
title: "结算厂内零件号",
changedQty: {
title: "变动数量",
type: "string",
},
isReplenished: {
type: "boolean",
title: "是否补货",
},
settlementVinCode: {
title: "结算生产码",
type: "string",
},
settlementPartCode: {
title: "结算厂内零件号",
type: "string",
},
},
useSchema()
);

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

@ -125,7 +125,8 @@ export default [
{
...createRoute("input", "title=数据输入"),
children: [
createInputJieSuanShuju("bbac_sa_service", "JisBBAC", "bbac", "JIS-BBAC 结算数据"),
createInputJieSuanShuju("bbac_sa_service", "JisBBAC", "bbac-104", "JIS-BBAC 结算数据"),
createInputJieSuanShuju("bbac_sa_service2", "JisBBAC", "bbac-1046", "JIS-BBAC顺义 结算数据"),
createInputFaYunShuJu("bbac_se_detail_service", "JisBBAC", "bbac", "JIS-BBAC 发运数据"),
createInputEdiShuJu("bbac_se_edi_service", "JisBBAC", "bbac", "JIS-BBAC EDI数据"),
],
@ -186,7 +187,8 @@ export default [
{
...createRoute("input", "title=数据输入"),
children: [
createInputJieSuanShuju("bbac_jit_pub_sa_service", "ZhiGongJianBBAC", "bbac", "直供件-BBAC 结算数据"),
createInputJieSuanShuju("bbac_jit_pub_sa_service", "ZhiGongJianBBAC", "bbac-104", "直供件-BBAC 结算数据"),
createInputJieSuanShuju("bbac_jit_pub_sa_service2", "ZhiGongJianBBAC", "bbac-1046", "直供件-BBAC顺义 结算数据"),
createInputFaYunShuJu("bbac_jit_pub_se_detail_service", "ZhiGongJianBBAC", "bbac", "直供件-BBAC 发运数据"),
],
},

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

@ -15,7 +15,7 @@ export default function (model) {
};
onMounted(async () => {
const useConfig = (await import(`../models/${model}.js`)).default;
config.value = useConfig(route.meta?.businessType);
config.value = useConfig(route.meta?.businessType, route.meta);
});
return { config, onCommand };
},

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

@ -17,7 +17,7 @@ export default {
const url = config.edit.addUrl;
if (item.path === "add") {
const invbillNum = rows[0].billNum;
await appListRef.value.onClick(async () => await request(url, { invbillNum }, { method: "POST" }, true), `确认为${invbillNum}创建发票?`, true);
await appListRef.value.onClick(async () => await request(url, invbillNum, { method: "POST" }, true), `确认为${invbillNum}创建发票?`, true);
}
};
return { appListRef, config, onCommand };

16
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs

@ -162,10 +162,6 @@ public class ADJ_SERVICE : BASE_SERVICE
oldinv: itm.InvBillNum,
inv: string.Empty,
partcode: itm.PartCode
);
await _repository.DbContext.BulkDeleteAsync(deletels);//删除发票下所有调整明细
await _repository.DbContext.BulkInsertAsync(query.ToList());
@ -173,18 +169,6 @@ public class ADJ_SERVICE : BASE_SERVICE
}
/// <summary>
/// 导入文件
/// </summary>

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs

@ -40,7 +40,6 @@ namespace Win.Sfs.SettleAccount.Bases
_excelImportService = excelImportService;
_snowflakeIdGenerator = snowflakeIdGenerator;
_commonManager = commonManager;
}
@ -57,15 +56,12 @@ namespace Win.Sfs.SettleAccount.Bases
{
return ApplicationConsts.SuccessStr;
}
if (string.IsNullOrEmpty(fileName))
{
//导出文件名称
fileName = CommonMethod.GetExcelFileNameByUserID(ApplicationConsts.CheckErroFileName, _snowflakeIdGenerator.Create().ToString(), ApplicationConsts.FileExtension);
}
errorList = errorList.Distinct().OrderBy(p => p.Type).ThenBy(p => p.Model).ThenBy(p => p.ItemCode).ToList();
//声明导出容器
ExportImporter _exportImporter = new ExportImporter();

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs

@ -115,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Bases
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public virtual async Task<IActionResult> ReissueInvoice(string input)
public virtual async Task<IActionResult> ReissueInvoice([FromBody] string input)
{
// await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.商务已审核);
@ -204,7 +204,7 @@ namespace Win.Sfs.SettleAccount.Bases
/// <param name="input">主表查询条件</param>
/// <returns></returns>
[HttpPost]
public virtual async Task<IActionResult> RejectAsync(string p_invGroupNum)
public virtual async Task<IActionResult> RejectAsync([FromBody] string p_invGroupNum)
{
bool issuc= await _invMng.Reject(p_invGroupNum);
if (issuc == true)
@ -228,7 +228,7 @@ namespace Win.Sfs.SettleAccount.Bases
}
return new JsonResult(new { Code = 200, Message = "收票成功" });
return new JsonResult(new { Code = 400, Message = "收票失败" });
}
protected virtual async Task<List<INVOICE_MAP_GROUP_DTO>> GetMapGroupAsync(INVOICE_GRP_REQ_DTO input)
{
@ -249,7 +249,7 @@ namespace Win.Sfs.SettleAccount.Bases
return sdtos;
}
protected virtual async Task<List<INVOICE_NOT_SETTLE>> GetNotDetailAsync(string p_invbillNum)
protected virtual async Task<List<INVOICE_NOT_SETTLE>> GetNotDetailAsync( string p_invbillNum)
{
List<FilterCondition> filters = new List<FilterCondition>();

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs

@ -133,7 +133,7 @@ namespace Win.Sfs.SettleAccount.Bases
/// <returns></returns>
[HttpPost]
//[Route("generateinvoice")]
public virtual async Task<IActionResult> GenerateInvoice(string input)
public virtual async Task<IActionResult> GenerateInvoice([FromBody] string input)
{
return new JsonResult(new { Code = 200, Message = "创建成功" }); ;

169
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs

@ -138,170 +138,7 @@ namespace Win.Sfs.SettleAccount.Bases
public virtual async Task<string> ApprovalPassed(List<string> p_list)
{
//_repository.Where(p => p_list.Contains(p.BillNum));
//public VmiLog()
//{
//}
//public VmiLog(Guid id)
//{
// this.Id = id;
//}
///// <summary>
///// 分组编号
///// </summary>
//public string GroupId { get; set; }
// /// <summary>
// /// 库存事务分类
// /// </summary>
// public VmiLogType LogType { get; set; }
// [Display(Name = "库存变动")]
// public decimal ChangedQty { get; set; }
// [Display(Name = "变动单号")]
// public string ChangedNumber { get; set; }
// [Display(Name = "变动时间")]
// public DateTime ChangedTime { get; set; } = DateTime.Now;
// [Display(Name = "变动类型")]
// public VmiType ChangedType { get; set; }
// [Display(Name = "便动人")]
// public string ChangedBy { get; set; }
// [Display(Name = "是否补货")]
// public bool? IsReplenished { get; set; }
// #region 附加信息
// //[Display(Name = "实扣厂内零件号")]
// //public string PartCode { get; set; }
// [Display(Name = "结算厂内零件号")]
// public string PartCode2 { get; set; }
// //[Display(Name = "结算客户零件号")]
// //public string CustomerPartCode { get; set; }
// //[Display(Name = "EDI订单生产码")]
// //public string VinCode { get; set; }
// [Display(Name = "结算生产码")]
// public string SettlementVinCode { get; set; }
// #endregion 附加信息
// #region 库存备份
// /// <summary>
// /// LU零件号
// /// </summary>
// [Display(Name = "LU零件号")]
// public string PartCode { get; set; }
// [Display(Name = "生产码")]
// public string VinCode { get; set; }
// /// <summary>
// /// 根据零件关系表匹配
// /// </summary>
// [Display(Name = "客户零件号")]
// public string CustomerPartCode { get; set; }
// [Display(Name = "生产码类型")]
// public string CodeType { get; set; }
// [Display(Name = "发货类型")]
// public EnumDeliverBjBmpBillType BillType { get; set; }
// [Display(Name = "数量")]
// public decimal Qty { get; set; }
// [Display(Name = "发运日期")]
// public DateTime BillTime { get; set; }
// [Display(Name = "订单日期")]
// public DateTime DeliverTime { get; set; }
// /// <summary>
// /// ERP库位
// /// </summary>
// [Display(Name = "ERP库位")]
// public string ErpToLoc { get; set; }
// [Display(Name = "EDI顺序号")]
// public string Seq { get; set; }
// [Display(Name = "客户订单号")]
// public string OrderNum { get; set; }
// [Display(Name = "塑件唯一码")]
// public string UniqueCode { get; set; }
// [Display(Name = "EDI总成号")]
// public string MatchNumber { get; set; }
// [Display(Name = "PJIS生产顺序号")]
// public string PjsNum { get; set; }
// [Display(Name = "配置码")]
// public string Configcode { get; set; }
// [Display(Name = "工厂")]
// public string factory { get; set; }
// [Display(Name = "发货子类型")]
// public EnumDeliverSubBillType SubBillType { get; set; }
// [Display(Name = "WMS实发生产码")]
// public string RealCode { get; set; }
// [Display(Name = "备注")]
// public string ReMark { get; set; }
// #endregion 库存备份
// public enum VmiLogType
//{
// /// <summary>
// /// 发运入库
// /// </summary>
// [Display(Name = "发运入库")]
// Type100 = 100,
// /// <summary>
// /// 结算出库
// /// </summary>
// [Display(Name = "结算出库")]
// Type200 = 200,
// /// <summary>
// /// 反结入库
// /// </summary>
// [Display(Name = "反结入库")]
// Type300 = 300,
// /// <summary>
// /// 退货出库
// /// </summary>
// [Display(Name = "退货出库")]
// Type400 = 400,
// /// <summary>
// /// 调整入库
// /// </summary>
// [Display(Name = "调整入库")]
// Type500 = 500,
// /// <summary>
// /// 调整出库
// /// </summary>
// [Display(Name = "调整出库")]
// Type600 = 600,
//}
return ApplicationConsts.SuccessStr;
}
/// <summary>
@ -342,12 +179,12 @@ namespace Win.Sfs.SettleAccount.Bases
return ApplicationConsts.SuccessStr;
}
public virtual async Task<TEntity> GetMainAsync(string billNum)
public virtual async Task<TEntity> GetMainAsync([FromBody] string billNum)
{
return await _repository.Where(p=>p.InvGroupNum == billNum).FirstOrDefaultAsync();
}
public virtual async Task<List<TEntityDetail>> GetDetailAsync(string billNum)
public virtual async Task<List<TEntityDetail>> GetDetailAsync([FromBody] string billNum)
{
return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync();
}

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

@ -66,7 +66,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<IActionResult> ReissueInvoice(string p_invbillnum)
public override async Task<IActionResult> ReissueInvoice([FromBody] string p_invbillnum)
{
//var mappingList= await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
//if (mappingList != null && mappingList.Count() > 0)

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

@ -82,12 +82,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <returns></returns>
[HttpPost]
public async override Task<IActionResult> GenerateInvoice(string invbillNum)
public async override Task<IActionResult> GenerateInvoice([FromBody] string invbillNum)
{
var main =await _bbacMng.GetMainAsync(invbillNum);
if (main != null)
{
if (main.State != SettleBillState.)
{
return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" });
@ -165,7 +167,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
else
{
return new JsonResult(new { Code = 400, Message = "不存在发票记录" });
return new JsonResult(new { Code = 400, Message = "不存在可结算单记录" });
}
return new JsonResult(new { Code = 200, Message = "生成成功" });
}

39
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs

@ -51,13 +51,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
List<CustomCondition> customConditionList = new List<CustomCondition>();
//var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value;
//var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value;
customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value =string.Join(",",p_list) });
customConditionList.Add(new CustomCondition() { Name = "Type", Value = EnumBusinessType.JisBBAC.ToString() });
//customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
//customConditionList.Add(new CustomCondition() { Name = "State", Value = string.IsNullOrEmpty(input.State) ? string.Empty : input.State });
var _taskid = await _service.ExportEnqueueAsync("BBAC待扣减任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PendingDeductionService), customConditionList, (rs) =>
{
});
@ -65,39 +61,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
// _bbacSecRepository.Where(p=>)
//if (detailist != null && detailist.Count > 0)
//{
// foreach (var itm in detailist)
// {
// await _vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
// {
// BillTime = itm.CreationTime,
// ChangedTime = DateTime.Now,
// Qty = itm.Qty,
// DeliverTime = itm.CreationTime,
// LogType = Entities.BQ.Vmi.VmiLogType.Type200,
// ChangedQty = itm.Qty,
// ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.小件BBAC,
// BillType = EnumDeliverBjBmpBillType.JIS件,
// PartCode = itm.LU,
// SettlementVinCode = itm.PN,
// PartCode2 = itm.LU,
// CustomerPartCode = itm.LU,
// VinCode = itm.PN,
// OrderNum = itm.GroupNum,
// ErpToLoc = "C0001"
// });
// }
//}
// return ApplicationConsts.SuccessStr;
}
}
}

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

@ -54,7 +54,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<IActionResult> ReissueInvoice(string p_invbillnum)
public override async Task<IActionResult> ReissueInvoice([FromBody] string p_invbillnum)
{
//var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
//if (mappingList != null && mappingList.Count() > 0)

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

@ -75,7 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <returns></returns>
[HttpPost]
//[Route("generateinvoice")]
public async override Task<IActionResult> GenerateInvoice(string invbillnum)
public async override Task<IActionResult> GenerateInvoice([FromBody] string invbillnum)
{
var main =await _hbpoMng.GetMainAsync(invbillnum);
@ -84,7 +84,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
if (main.State != SettleBillState.)
{
return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" });
}
@ -162,7 +161,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
else
{
return new JsonResult(new { Code = 400, Message = "不存在发票记录" });
return new JsonResult(new { Code = 400, Message = "不存在可结算单记录" });
}
return new JsonResult(new { Code = 200, Message = "生成成功" });
}

12
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs

@ -78,16 +78,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
AssembleData = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
DeliverSubBillType = EnumDeliverSubBillType.BBAC,
DeliverBillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
//PartCode2 = itm.LU,
CustPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"

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

@ -207,7 +207,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
[HttpPost]
public virtual async Task<string> RejectAsync(string p_invGroupNum)
public virtual async Task<string> RejectAsync([FromBody] string p_invGroupNum)
{
bool state = await _invMng.Reject(p_invGroupNum);

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

@ -187,7 +187,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// <param name="input"></param>
/// <returns></returns>
public override async Task<IActionResult> ReissueInvoice(string p_invbillnum)
public override async Task<IActionResult> ReissueInvoice([FromBody] string p_invbillnum)
{
//var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组
//if (mappingList != null && mappingList.Count() > 0)

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

@ -66,7 +66,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_pricebjRepository = pricebjRepository;
}
[HttpPost]
public async override Task<IActionResult> GenerateInvoice(string billnum)
public async override Task<IActionResult> GenerateInvoice( [FromBody] string billnum)
{
var main = await _pubMng.GetMainAsync(billnum);
@ -144,7 +144,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
else
{
return new JsonResult(new { Code = 400, Message = "不存在发票记录" });
return new JsonResult(new { Code = 400, Message = "不存在可结算单记录" });
}
return new JsonResult(new { Code = 200, Message = "生成成功" });

12
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs

@ -42,16 +42,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
AssembleData = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
DeliverSubBillType = EnumDeliverSubBillType.BBAC,
DeliverBillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
//PartCode2 = itm.LU,
CustPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"

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

@ -46,7 +46,7 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
/// </summary>
private readonly MaterialRelationshipManager _materialRelationshipManager;
private readonly IVmiService _vmiService;
//private readonly IVmiService _vmiService;
/// <summary>
/// 构造
@ -64,7 +64,7 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
_syncPositionFlagRepository = syncPositionFlagRepository;
_jisSeDetailRepository = jisSeDetailRepository;
_materialRelationshipManager = materialRelationshipManager;
_vmiService = vmiService;
//_vmiService = vmiService;
}
/// <summary>

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

@ -46,7 +46,7 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
/// </summary>
private readonly MaterialRelationshipManager _materialRelationshipManager;
private readonly IVmiService _vmiService;
//private readonly IVmiService _vmiService;
/// <summary>
/// 构造
@ -64,7 +64,7 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
_syncPositionFlagRepository = syncPositionFlagRepository;
_jisSeDetailRepository = jisSeDetailRepository;
_materialRelationshipManager = materialRelationshipManager;
_vmiService = vmiService;
//_vmiService = vmiService;
}
/// <summary>

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

@ -50,7 +50,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
/// </summary>
private readonly MaterialRelationshipManager _materialRelationshipManager;
private readonly IVmiService _vmiService;
//private readonly IVmiService _vmiService;
/// <summary>
/// 构造
@ -68,7 +68,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
_syncPositionFlagRepository = syncPositionFlagRepository;
_pubSeDetailRepository = pubSeDetailRepository;
_materialRelationshipManager = materialRelationshipManager;
_vmiService = vmiService;
//_vmiService = vmiService;
}
/// <summary>
@ -149,14 +149,14 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
{
var vmiBalance = new VmiBalance()
{
PartCode = pubSeDetail.PartCode,
RealPartCode = pubSeDetail.PartCode,
VinCode = pubSeDetail.PN,
CustomerPartCode = default,
CustPartCode = default,
CodeType = default,
BillType = pubSeDetail.DeliverBillType,
DeliverBillType = pubSeDetail.DeliverBillType,
Qty = pubSeDetail.Qty,
BillTime = pubSeDetail.BillTime ?? new DateTime(),
DeliverTime = pubSeDetail.AssembleData,
AssembleData = pubSeDetail.AssembleData,
ErpToLoc = pubSeDetail.ToErpLocCode,
Seq = default,
OrderNum = pubSeDetail.DeliveryIndex,
@ -165,24 +165,24 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
PjsNum = default,
Configcode = default,
factory = default,
SubBillType = pubSeDetail.DeliverSubBillType,
DeliverSubBillType = pubSeDetail.DeliverSubBillType,
RealCode = default,
ReMark = pubSeDetail.Remark,
};
await _vmiService.In(logType: Vmi.VmiLogType.Type100, changedNumber: pubSeDetail.DnBillNum, data: vmiBalance).ConfigureAwait(false);
//await _vmiService.In(logType: Vmi.VmiLogType.Type100, changedNumber: pubSeDetail.DnBillNum, data: vmiBalance).ConfigureAwait(false);
}
else if (pubSeDetail.TransType == EnumDelTransType.退)
{
var vmiLog = new VmiLog()
{
PartCode = pubSeDetail.PartCode,
RealPartCode = pubSeDetail.PartCode,
VinCode = pubSeDetail.PN,
CustomerPartCode = default,
CustPartCode = default,
CodeType = default,
BillType = pubSeDetail.DeliverBillType,
DeliverBillType = pubSeDetail.DeliverBillType,
Qty = pubSeDetail.Qty,
BillTime = pubSeDetail.BillTime ?? new DateTime(),
DeliverTime = pubSeDetail.DnBillTime,
AssembleData = pubSeDetail.DnBillTime,
ErpToLoc = pubSeDetail.ToErpLocCode,
Seq = default,
OrderNum = pubSeDetail.DnBillNum,
@ -191,11 +191,11 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
PjsNum = default,
Configcode = default,
factory = default,
SubBillType = pubSeDetail.DeliverSubBillType,
DeliverSubBillType = pubSeDetail.DeliverSubBillType,
RealCode = default,
ReMark = pubSeDetail.Remark,
};
await _vmiService.Out(VmiLogType.Type400, pubSeDetail.DnBillNum, vmiLog).ConfigureAwait(false);
//await _vmiService.Out(VmiLogType.Type400, pubSeDetail.DnBillNum, vmiLog).ConfigureAwait(false);
}
}
}

151
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs

@ -34,9 +34,7 @@ public class PendingDeductionService : ITransientDependency, IExportJob
INormalEfCoreRepository<BBAC_PD_DETAIL, Guid> bbacRepository,
INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> hbpoRepository,
INormalEfCoreRepository<PUB_PD_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<CodeSetting, Guid> codesetRepository,
VmiAppService vimservice
)
{
@ -47,6 +45,7 @@ public class PendingDeductionService : ITransientDependency, IExportJob
_hbpoSecRepository= hbpoSecRepository;
_pubSecRepository= pubSecRepository;
_vimservice =vimservice;
_codesetRepository = codesetRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
@ -54,21 +53,14 @@ public class PendingDeductionService : ITransientDependency, IExportJob
var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value;
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value;
var list=billList.Split(",");
var projectList=_codesetRepository.Where(p => p.Project == "库位");
if (type == "JisBBAC")
{
var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan==false);
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan ==true);
var query = from itm in jisdetail
join itm1 in _bbacSecRepository
on new { itm.PN, itm.LU } equals new { itm1.PN, LU = itm1.PrimitiveLU } into temp1
from tm in temp1
where tm == null
select
var query = from itm in jisdetail
select
new
{
BillTime = DateTime.Now,
@ -80,13 +72,13 @@ public class PendingDeductionService : ITransientDependency, IExportJob
ChangedType = VmiType.Out,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = tm != null ? tm.ReplaceLU : itm.LU,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = tm != null ? tm.ReplaceLU : itm.LU,
PartCode2 = itm.LU,
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
//ErpToLoc = string.IsNullOrEmpty()
};
var ls=query.ToList();
if (ls != null && ls.Count > 0)
@ -98,26 +90,68 @@ public class PendingDeductionService : ITransientDependency, IExportJob
BillTime = itm.BillTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.BillTime,
AssembleData = itm.BillTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.PartCode,
RealPartCode = itm.PartCode,
SettlementVinCode = itm.VinCode,
PartCode2 = itm.PartCode2,
CustomerPartCode = itm.CustomerPartCode,
//PartCode2 = itm.PartCode2,
CustPartCode = itm.CustomerPartCode,
VinCode = itm.VinCode,
//OrderNum = itm.OrderNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
var query1 = from itm in mdetail
select new
{
BillTime = DateTime.Now,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
};
var ls1 = query1.ToList();
if (ls1 != null && ls1.Count > 0)
{
foreach (var itm in ls1)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.BillTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
//SubBillType = EnumDeliverSubBillType.小件BBAC,
//BillType = EnumDeliverBjBmpBillType.JIS件,
SettlementVinCode = itm.VinCode,
VinCode = itm.VinCode,
//OrderNum = itm.OrderNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
//var query1=
}
else if (type == "JisHBPO")
{
@ -131,18 +165,16 @@ public class PendingDeductionService : ITransientDependency, IExportJob
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
// DeliverTime = ,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
CustPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
@ -170,10 +202,10 @@ public class PendingDeductionService : ITransientDependency, IExportJob
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.PN,
ErpToLoc = "C0001"
@ -199,19 +231,16 @@ public class PendingDeductionService : ITransientDependency, IExportJob
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.PN,// 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
break;
case "MaiDanJianBBAC":
@ -230,22 +259,16 @@ public class PendingDeductionService : ITransientDependency, IExportJob
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
break;
case "MaiDanJianHBPO":
@ -265,10 +288,10 @@ public class PendingDeductionService : ITransientDependency, IExportJob
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
@ -298,10 +321,10 @@ public class PendingDeductionService : ITransientDependency, IExportJob
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
@ -331,10 +354,10 @@ public class PendingDeductionService : ITransientDependency, IExportJob
ChangedType = VmiType.Out,
// SubBillType = EnumDeliverSubBillType.保险杠HBPO,
// BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,//客户
RealPartCode = itm.LU,//客户
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,//厂内
CustomerPartCode = itm.LU,
//PartCode2 = itm.LU,//厂内
CustPartCode = itm.LU,
VinCode = itm.PN,
// OrderNum = itm.GroupNum, 非JIS传ASN 交付识别号
ErpToLoc = "C0001"
@ -360,16 +383,16 @@ public class PendingDeductionService : ITransientDependency, IExportJob
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
AssembleData = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
DeliverSubBillType = EnumDeliverSubBillType.BBAC,
DeliverBillType = EnumDeliverBjBmpBillType.JIS件,
RealPartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
//PartCode2 = itm.LU,
CustPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"

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

@ -6,9 +6,11 @@ using System.IO;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Reflection;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using ClosedXML.Excel;
using EFCore.BulkExtensions;
using LinqToDB.Data;
using LinqToDB.EntityFrameworkCore;
using Magicodes.ExporterAndImporter.Core;
@ -18,8 +20,6 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Extensions;
@ -35,25 +35,15 @@ using Volo.Abp.Validation;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.influxdb;
using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ;
public interface IVmiService : IApplicationService, ITransientDependency, IJobService
{
Task In(VmiLogType logType, string changedNumber, VmiBalance data);
Task Out(VmiLogType logType, string changedNumber, VmiLog data);
//Task UnDo(string groupId);
}
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class VmiAppService : ApplicationService, IVmiService, IJobService, ITransientDependency
public class VmiAppService : ApplicationService, IJobService, ITransientDependency
{
public static SemaphoreSlim backupLock = new SemaphoreSlim(1);
private readonly IConfiguration _cfg;
@ -85,6 +75,40 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
LinqToDBForEFTools.Initialize();
}
[HttpPost]
public async Task Test(List<VmiLog> logs, int size = 1000)
{
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
using var dc = db.CreateLinqToDBConnection();
dc.BeginTransaction();
try
{
//var skip = 0;
//var count = logs.Count;
//while (count > 0)
//{
// var batchSize = count > size ? size : count;
// var tempLogs = logs.Skip(skip).Take(batchSize);
// var tempMessages = tempLogs.Select(o => new VmiMessage { Message = JsonSerializer.Serialize(o) });
// await dc.BulkCopyAsync(new BulkCopyOptions { TableName = "Set_VmiLog" }, tempLogs).ConfigureAwait(false);
// await dc.BulkCopyAsync(new BulkCopyOptions { TableName = "Set_VmiMessage" }, tempMessages).ConfigureAwait(false);
// count -= batchSize;
// skip += batchSize;
//}
await dc.BulkCopyAsync(new BulkCopyOptions { TableName = "Set_VmiMessage", MaxBatchSize = 1 }, new List<VmiMessage> {
new VmiMessage(Guid.NewGuid()) { Message="1" },
new VmiMessage(Guid.NewGuid()) { Message="2" }
}).ConfigureAwait(false);
dc.Transaction.Commit();
}
catch
{
dc.Transaction.Rollback();
throw;
}
}
/// <summary>
/// Excel 转 JSON
/// </summary>
@ -131,60 +155,34 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
/// </summary>
[NonAction]
[DisableValidation]
public virtual async Task Invoke(IServiceProvider serviceProvider)
public virtual Task Invoke(IServiceProvider serviceProvider)
{
await backupLock.WaitAsync().ConfigureAwait(false);
using var scope = serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
using var transaction = db.Database.BeginTransaction();
try
{
//this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", "");
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/files/vmi"));
var date = DateTime.Now.ToString("yyyy-MM-dd_HH.mm.ss");
var connectionString = $"Data Source=wwwroot/files/vmi/{date}.db";
using var dbContext = new VmiSqliteContext(connectionString);
if (!dbContext.GetService<IRelationalDatabaseCreator>().Exists() && dbContext.Database.EnsureCreated())
var now = DateTime.Now;
var time = now.ToString("yyyy-MM-dd_HH:mm");
var table = $"Set_VmiBalance_{time}";
var snapshot = db.Set<VmiSnapshot>().Where(o => o.Name == table).FirstOrDefault();
if (snapshot == null)
{
var query = serviceProvider.GetRequiredService<SettleAccountDbContext>().Set<VmiBalance>().AsNoTracking();
var list = new List<VmiBalance>();
using var dc = dbContext.CreateLinqToDBConnection();
dc.BeginTransaction();
try
{
var now = DateTime.Now;
var table = "VmiBalance";
foreach (var item in query)
{
item.BackupTime = now;
list.Add(item);
if (list.Count == 10000)
{
//dbContext.Set<VmiBalance>().AddRange(list);
await dc.BulkCopyAsync(new BulkCopyOptions { TableName = table }, list).ConfigureAwait(false);
list.Clear();
}
}
if (list.Count > 0)
{
await dc.BulkCopyAsync(new BulkCopyOptions { TableName = table }, list).ConfigureAwait(false);
}
dc.Transaction.Commit();
var snapshot = new VmiSnapshot { Name = date, Path = connectionString };
await _snapshotRepository.InsertAsync(snapshot).ConfigureAwait(false);
}
catch
{
dc.Transaction.Rollback();
throw;
}
snapshot = new VmiSnapshot { Name = time, Start = now, Description = table };
db.Set<VmiSnapshot>().Add(snapshot);
db.SaveChanges();
var result = db.Database.ExecuteSqlRaw($"select * into {table} from Set_VmiBalance;");
snapshot.End = DateTime.Now;
transaction.Commit();
return Task.CompletedTask;
}
throw new Exception("备份程序正在运行");
}
catch
{
transaction.Rollback();
throw;
}
finally
{
backupLock.Release();
}
}
/// <summary>
@ -192,9 +190,26 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
/// </summary>
[HttpPost("invoke")]
[DisableValidation]
public virtual async Task VmiBackup()
public virtual async Task<IActionResult> VmiBackup()
{
await Invoke(_serviceProvider).ConfigureAwait(false);
if (backupLock.CurrentCount == 1)
{
return new JsonResult(new { Code = 500, Message = "备份程序正在运行" });
}
await backupLock.WaitAsync().ConfigureAwait(false);
try
{
await Invoke(_serviceProvider).ConfigureAwait(false);
return new JsonResult(new { Code = 200, Message = "备份成功" });
}
catch (Exception ex)
{
return new JsonResult(new { Code = 500, Message = ex.Message, Data = ex.ToString() });
}
finally
{
backupLock.Release();
}
}
/// <summary>
@ -216,9 +231,9 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var balance = db.Set<VmiBalance>().FirstOrDefault(
o => o.BillType == data.BillType &&
o => o.DeliverBillType == data.DeliverBillType &&
o.CodeType == data.CodeType &&
o.PartCode == data.PartCode &&
o.DeliverBillType == data.DeliverBillType &&
o.VinCode == data.VinCode &&
o.ErpToLoc == data.ErpToLoc &&
o.OrderNum == data.OrderNum &&
@ -296,9 +311,9 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var balance = db.Set<VmiBalance>().FirstOrDefault(
o => o.BillType == data.BillType &&
o => o.DeliverBillType == data.DeliverBillType &&
o.CodeType == data.CodeType &&
o.PartCode == data.PartCode &&
o.DeliverBillType == data.DeliverBillType &&
o.VinCode == data.VinCode &&
o.ErpToLoc == data.ErpToLoc &&
o.OrderNum == data.OrderNum &&
@ -508,11 +523,16 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
[HttpPost]
public async Task<PagedResultDto<VmiBalance>> Backup(BackupListRequest input)
{
var connectionString = $"Data Source=wwwroot/files/vmi/{input.Name}.db";
using var dbContext = new VmiSqliteContext(connectionString);
var repo = dbContext.Set<VmiBalance>();
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var name = input.Name;
var sql = $"select * from {name}";
var query = db.Set<VmiBalance>().FromSqlRaw(sql);
var filters = input.Filters.ToLambda<VmiBalance>();
var query = (input.Filters.Count > 0 ? repo.Where(input.Filters.ToLambda<VmiBalance>()) : repo);
if (input.Filters.Count > 0)
{
query = query.Where(input.Filters.ToLambda<VmiBalance>());
}
var totalCount = query.Count();
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting);
var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false);
@ -525,11 +545,17 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
[HttpPost]
public async Task<string> BackupExport(BackupListRequest input)
{
var connectionString = $"Data Source=wwwroot/files/vmi/{input.Name}.db";
using var dbContext = new VmiSqliteContext(connectionString);
var repo = dbContext.Set<VmiBalance>();
using var scope = this._serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var name = input.Name;
var sql = $"select * from {name}";
var query = db.Set<VmiBalance>().FromSqlRaw(sql);
var filters = input.Filters.ToLambda<VmiBalance>();
var query = (input.Filters.Count > 0 ? repo.Where(input.Filters.ToLambda<VmiBalance>()) : repo);
if (input.Filters.Count > 0)
{
query = query.Where(input.Filters.ToLambda<VmiBalance>());
}
var totalCount = query.Count();
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting);
var entities = await query.ToListAsync().ConfigureAwait(false);
var fileName = $"库存备份_{input.Name}.xlsx";
@ -665,3 +691,198 @@ public class LogRequestDto : RequestDto
{
public List<VmiLogType> LogTypes { get; set; } = new List<VmiLogType>();
}
/// <summary>
/// 异步更新库存
/// </summary>
public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public VmiAsyncBalanceService(IServiceProvider serviceProvider)
{
this._serviceProvider = serviceProvider;
}
public async Task Invoke(IServiceProvider serviceProvider)
{
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var query = db.Set<VmiMessage>().AsQueryable();
using var dc = db.CreateLinqToDBConnection();
dc.BeginTransaction();
try
{
var repo = db.Set<VmiBalance>();
foreach (var message in query)
{
var log = JsonSerializer.Deserialize<VmiLog>(message.Message);
var balance = db.Set<VmiBalance>().FirstOrDefault(
o => o.DeliverBillType == log.DeliverBillType &&
o.CodeType == log.CodeType &&
o.DeliverBillType == log.DeliverBillType &&
o.VinCode == log.VinCode &&
o.ErpToLoc == log.ErpToLoc &&
o.OrderNum == log.OrderNum &&
o.factory == log.factory &&
o.Configcode == log.Configcode);
if (balance == null)
{
balance = new VmiBalance(GuidGenerator.Create());
balance.InjectFrom(log);
await repo.AddAsync(balance).ConfigureAwait(false);
log.InjectFrom(balance);
}
else
{
var logType = log.LogType;
var qty = balance.Qty + log.Qty;
if (logType == VmiLogType.Type100)
{
//发运入库,负库存字段需要更新
if (balance.Qty < decimal.Zero)
{
balance.InjectFrom(log);
}
}
else if (logType == VmiLogType.Type300)
{
//反结入库,只更新库存
}
else if (logType == VmiLogType.Type500)
{
//调整入库,更新库存和其他字段
balance.InjectFrom(log);
}
// 更新库存
balance.Qty = qty;
if (balance.Qty == decimal.Zero)
{
//删除0库存
repo.Remove(balance);
}
if (logType == VmiLogType.Type100 && balance.Qty < decimal.Zero && log.Qty > 0)
{
//更新补货
var log2 = db.Set<VmiLog>().FirstOrDefault(o => o.Id == log.Id);
if (log2 != null)
{
log2.IsReplenished = true;
}
}
}
message.isConsumed = true;
}
dc.Transaction.Commit();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
dc.Transaction.Rollback();
throw;
}
}
}
/// <summary>
/// 消息表定时清理
/// </summary>
public class VmiAsyncMessageService : ApplicationService, IJobService, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public VmiAsyncMessageService(IServiceProvider serviceProvider)
{
this._serviceProvider = serviceProvider;
}
public Task Invoke(IServiceProvider serviceProvider)
{
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
db.Set<VmiMessage>().Where(o => o.isConsumed).BatchDelete();
var count = db.Set<VmiMessage>().Where(o => !o.isConsumed).Count();
scope.ServiceProvider.GetService<IHubContext<PageHub>>().Clients.All.ServerToClient("VmiBalance", count.ToString(), "");
return Task.CompletedTask;
}
}
/// <summary>
/// 库存事务定时备份
/// </summary>
public class VmiLogbackupService : ApplicationService, IJobService, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public VmiLogbackupService(IServiceProvider serviceProvider)
{
this._serviceProvider = serviceProvider;
}
public Task Invoke(IServiceProvider serviceProvider)
{
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
using var transaction = db.Database.BeginTransaction();
try
{
var task = db.Set<VmiSyncTask>().FirstOrDefault(o => o.Number == "Set_VmiLog");
if (task != null)
{
var now = DateTime.Now;
task.LastUpdate = now;
var query = db.Set<VmiLog>().Where(o => o.UpdatedTime >= task.LastUpdate && o.UpdatedTime < now);
foreach (var item in query)
{
//同步到questdb
}
}
}
catch
{
transaction.Rollback();
throw;
}
return Task.CompletedTask;
}
}
/// <summary>
/// 库存余额定时备份
/// </summary>
public class VmiLogBalanceService : ApplicationService, IJobService, ITransientDependency
{
private readonly IServiceProvider _serviceProvider;
public VmiLogBalanceService(IServiceProvider serviceProvider)
{
this._serviceProvider = serviceProvider;
}
public Task Invoke(IServiceProvider serviceProvider)
{
using var scope = _serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
using var transaction = db.Database.BeginTransaction();
try
{
var task = db.Set<VmiSyncTask>().FirstOrDefault(o => o.Number == "Set_VmiBalance");
if (task != null)
{
var now = DateTime.Now;
task.LastUpdate = now;
var query = db.Set<VmiBalance>().Where(o => o.UpdatedTime >= task.LastUpdate && o.UpdatedTime < now);
foreach (var item in query)
{
//同步到questdb
}
}
}
catch
{
transaction.Rollback();
throw;
}
return Task.CompletedTask;
}
}

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

@ -138,6 +138,7 @@
<PackageReference Include="Volo.Abp.AutoMapper" Version="4.3.3" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Abstractions" Version="4.3.3" />
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="4.3.3" />
<PackageReference Include="Volo.Abp.BlobStoring.Minio" Version="4.3.3" />
<PackageReference Include="Volo.Abp.Dapper" Version="4.3.3" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="4.3.3" />
<PackageReference Include="Volo.Abp.EventBus.RabbitMQ" Version="4.3.3" />

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

@ -1,20 +1,19 @@
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SettleAccount.Job.Services.Report;
using TaskJob.Interfaces;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.Application;
using Volo.Abp.BlobStoring;
using Volo.Abp.BlobStoring.Minio;
using Volo.Abp.Dapper;
using Volo.Abp.Http.Client.IdentityModel;
using Volo.Abp.Identity;
using Volo.Abp.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Dapper;
using Volo.Abp.Modularity;
using Win.Abp.Snowflakes;
using Volo.Abp.EventBus.RabbitMq;
using Volo.Abp.RabbitMQ;
using System;
using TaskJob.Interfaces;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using SettleAccount.Job.Services.Report;
using SettleAccount.Job.Services;
namespace Win.Sfs.SettleAccount
{
@ -27,33 +26,39 @@ namespace Win.Sfs.SettleAccount
typeof(AbpIdentityHttpApiClientModule),
typeof(AbpAutoMapperModule),
typeof(AbpAspNetCoreMvcModule),
typeof(AbpDapperModule)
//typeof(AbpEventBusRabbitMqModule)
typeof(AbpDapperModule),
typeof(AbpBlobStoringMinioModule)
)]
public class SettleAccountApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var cfg = context.Services.GetConfiguration();
//Configure<AbpBlobStoringOptions>(options =>
//{
// options.Containers.ConfigureDefault(container =>
// {
// container.UseMinio(minio =>
// {
// minio.EndPoint = cfg.GetValue("MinIO:EndPoint", "");
// minio.AccessKey = cfg.GetValue("MinIO:AccessKey", "");
// minio.SecretKey = cfg.GetValue("MinIO:SecretKey", "");
// minio.BucketName = cfg.GetValue("MinIO:BucketName", "");
// });
// });
//});
//context.Services.AddAutoMapperObjectMapper<SettleAccountApplicationModule>();
//Configure<AbpAutoMapperOptions>(options =>
//{
// options.AddMaps<SettleAccountApplicationModule>(validate: true);
//});
ConfigureAutoMapper();
ConfigureJson(context);
//context.Services.AddTransient(typeof(INormalEfCoreRepository<,>),
//typeof(SettleAccountNormalEfCoreRepository<,>));
context.Services.AddTransient(implementationFactory =>
{
Func<string, IExportJob> accesor = key =>
@ -74,26 +79,13 @@ namespace Win.Sfs.SettleAccount
{
return implementationFactory.GetService<PendingDeductionService>();
}
else
{
throw new ArgumentException($"Not Support key:{key}");
}
}; return accesor;
});
//context.Services.AddTransient(implementationFactory =>
//{
// Func<string, IExportJob> accesor = key =>
@ -110,16 +102,8 @@ namespace Win.Sfs.SettleAccount
// };
// return accesor;
//});
}
private static void ConfigureJson(ServiceConfigurationContext context)
{
context.Services.Configure<JsonOptions>(opt =>

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

@ -163,7 +163,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
throw new UserFriendlyException($"提交发票状态不一致");
}
var nols = appls.Where(p => p.InvoiceState == InvoiceBillState. || p.State == SettleBillState.).ToList();
if (nols.Count > 0)
{
@ -426,12 +425,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var involdList= invList.Where(p => oldinvs.Contains(p.ParentInvbillNum)).ToList();
var involdname=involdList.Select(p => p.InvbillNum);
var adjlist=_adjRepository.Where(p => involdname.Contains(p.InvBillNum));
if (adjlist != null && adjlist.Count() > 0)
{
foreach (var itm in adjlist)
{
entityList.Add(new BBAC_CAN_SA_DETAIL(
var detail = new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
@ -449,9 +448,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: itm.InvGroupNum,
contactid: itm.Extend1,//生产号
invbillnum: itm.InvBillNum,
partcode:itm.PartCode
));
partcode: itm.PartCode);
detail.ErpLoc = itm.ErpLoc;
detail.RealPartCode = itm.RealPartCode;
entityList.Add(detail);
}
}
}
@ -464,7 +464,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
foreach (var itm in adjlist)
{
entityDetail.Add(new BBAC_CAN_SA_DETAIL(
var detail = new BBAC_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
@ -482,9 +482,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: itm.InvGroupNum,
contactid: itm.Extend1,//生产号
invbillnum: itm.InvBillNum,
partcode:itm.PartCode
));
partcode: itm.PartCode
);
detail.ErpLoc = itm.ErpLoc;
detail.RealPartCode = itm.RealPartCode;
entityDetail.Add(detail);
}
}
entityList.AddRange(entityDetail);
@ -500,12 +502,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
state: SettleBillState.,
invGroupNum: itm.InvGroupNum,
site: string.Empty
);
bbacmainlist.Add( bbac );
}
var bbacDetail = new List<BBAC_PD_DETAIL>();
foreach (var itm in entityList)
@ -570,8 +568,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
}
newlist = p_invs.Where(p => !oldlist.Contains(p)).ToList();//不存在扣减记录的发票号
List<HBPO_CAN_SA_DETAIL> entityList = new List<HBPO_CAN_SA_DETAIL>();//结算明细
var namelist = invList.Select(p => p.InvbillNum).ToList();
if (oldlist.Count > 0)
@ -584,24 +580,27 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
foreach (var itm in adjlist)
{
entityList.Add(new HBPO_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: 0,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum,
partcode:itm.PartCode
));
var detail = new HBPO_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: 0,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum,
partcode: itm.PartCode
);
detail.ErpLoc = itm.ErpLoc;
detail.RealPartCode = itm.RealPartCode;
entityList.Add(detail);
}
}
}
@ -631,8 +630,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum,
partcode: itm.PartCode);
entityDetail.Add(entity
);
entity.ErpLoc = itm.ErpLoc;//补字段库位
entity.PartCode = itm.RealPartCode;//真实零件号
entityDetail.Add(entity);
}
}
entityList.AddRange(entityDetail);
@ -724,7 +725,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
foreach (var itm in adjlist)
{
entityList.Add(new PUB_CAN_SA_DETAIL(
var detail = new PUB_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
@ -740,11 +741,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum,
partcode:itm.PartCode,
pobillnum:string.Empty
partcode: itm.PartCode,
pobillnum: string.Empty
);
detail.RealPartCode = itm.RealPartCode;//厂内替换零件号
detail.ErpLoc = itm.ErpLoc;//ERP库位
));
entityList.Add(detail);
}
}
}
@ -757,25 +760,28 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
foreach (var itm in adjlist)
{
entityDetail.Add(new PUB_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: 0,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum,
partcode: itm.PartCode,
pobillnum: string.Empty
));
var detail = new PUB_CAN_SA_DETAIL(
guid: GuidGenerator.Create(),
keyCode: itm.KeyCode,
version: itm.Version,
billNum: itm.InvGroupNum,
settleBillNum: itm.SettleBillNum,
lU: itm.LU,
pN: itm.PN,
site: itm.Site,
qty: itm.Qty,
price: 0,
businessType: itm.BusinessType,
settleDate: itm.SettleDate,
groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum,
partcode: itm.PartCode,
pobillnum: string.Empty
);
detail.RealPartCode = itm.RealPartCode;//厂内替换零件号
detail.ErpLoc = itm.ErpLoc;//ERP库位
entityDetail.Add(detail);
}
}
entityList.AddRange(entityDetail);

20
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs

@ -71,12 +71,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{
var ls = p_list.Select(p => p.GroupNum).Distinct().ToList();
var notlist = _notRepository.Where(p => ls.Contains(p.GroupNum)).ToList();//JIT_ASN整发
var priceErrors = await _service.CheckPriceList(notlist);
List<PUB_NOT_SA_DETAIL> priceErrors = new List<PUB_NOT_SA_DETAIL>();
string name = "ASN单号或发运ID";
if (first.BusinessType == EnumBusinessType.BeiJian)
{
name = "备件";
priceErrors = await _service.CheckPriceList(notlist,true);
}
else
{
priceErrors = await _service.CheckPriceList(notlist);
}
if (priceErrors.Count > 0)
{
foreach (var itm in priceErrors)
{
errors.Add($"发货单号或交付识别号零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据");
errors.Add($"{name}零件{itm.LU}结算日期{itm.SettleDate}无价格区间数据");
}
}
if (errors.Count > 0)
@ -157,13 +167,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
await _notRepository.DbContext.BulkDeleteAsync(p_list);
await _repository.DbContext.BulkInsertAsync(new List<PUB_CAN_SA>() { _entity });
await _repository.DbContext.BulkInsertAsync(_entityList);
}
return errors;
}

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

@ -4,11 +4,15 @@ using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class JobItem : Entity<Guid>
public class JobItem : Entity<Guid>, IHasConcurrencyStamp
{
public JobItem(Guid id)
public JobItem()
{
this.Id = id;
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public JobItem(Guid id):base(id)
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public bool IsDisabled { get; set; }
@ -25,6 +29,5 @@ public class JobItem : Entity<Guid>
public bool IsRunning { get; set; }
public DateTime? HeartBeat { get; set; }
[Timestamp]
public string ConcurrencyStamp { get; set; }
}

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

@ -0,0 +1,33 @@
using System;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiSyncTask : Entity<Guid>, IHasConcurrencyStamp
{
public VmiSyncTask()
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public VmiSyncTask(Guid id) : base(id)
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
/// <summary>
/// 任务名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 同步数据时间戳初始起点
/// </summary>
public string Number { get; set; }
/// <summary>
/// 最后同步时间
/// </summary>
public DateTime LastUpdate { get; set; }
public string ConcurrencyStamp { get; set; }
}

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

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

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

@ -8,165 +8,104 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
/// <summary>
/// 寄售库存操作记录
/// </summary>
public class VmiLog : BasicAggregateRoot<Guid>
public class VmiLog : Entity<Guid>
{
public VmiLog()
{
}
public VmiLog(Guid id)
public VmiLog(Guid id) : base(id)
{
this.Id = id;
}
/// <summary>
/// 分组编号
/// </summary>
public string GroupId { get; set; }
/// <summary>
/// 库存事务分类
/// </summary>
[Display(Name = "库存事务分类", Order = 0)]
public VmiLogType LogType { get; set; }
/// <summary>
/// 库存变动
/// </summary>
[Display(Name = "库存变动")]
public decimal ChangedQty { get; set; }
/// <summary>
/// 变动单号
/// </summary>
[Display(Name = "变动单号")]
[Display(Name = "变动单号", Order = 1)]
public string ChangedNumber { get; set; }
/// <summary>
/// 变动时间
/// </summary>
[Display(Name = "变动时间")]
public DateTime ChangedTime { get; set; } = DateTime.Now;
[Display(Name = "变动时间", Order = 2)]
public DateTime ChangedTime { get; set; }
/// <summary>
/// 变动类型
/// </summary>
[Display(Name = "变动类型")]
[Display(Name = "变动类型", Order = 3)]
public VmiType ChangedType { get; set; }
/// <summary>
/// 变动人
/// </summary>
[Display(Name = "便动人")]
[Display(Name = "便动人", Order = 4)]
public string ChangedBy { get; set; }
/// <summary>
/// 是否补货
/// </summary>
[Display(Name = "是否补货")]
public bool? IsReplenished { get; set; }
#region 附加信息
//[Display(Name = "实扣厂内零件号")]
//public string PartCode { get; set; }
/// <summary>
/// 结算厂内零件号
/// </summary>
[Display(Name = "结算厂内零件号")]
public string PartCode2 { get; set; }
//[Display(Name = "结算客户零件号")]
//public string CustomerPartCode { get; set; }
//[Display(Name = "EDI订单生产码")]
//public string VinCode { get; set; }
/// <summary>
/// 结算生产码
/// </summary>
[Display(Name = "结算生产码")]
public string SettlementVinCode { get; set; }
#endregion 附加信息
#region 库存备份
[Display(Name = "库存变动", Order = 5)]
public decimal ChangedQty { get; set; }
/// <summary>
/// LU零件号
/// </summary>
[Display(Name = "LU零件号")]
public string PartCode { get; set; }
//库存余额
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
public string VinCode { get; set; }
[Display(Name = "LU零件号", Order = 6)]
public string RealPartCode { get; set; }
/// <summary>
/// 根据零件关系表匹配
/// </summary>
[Display(Name = "客户零件号")]
public string CustomerPartCode { get; set; }
[Display(Name = "客户零件号", Order = 7)]
public string CustPartCode { get; set; }
/// <summary>
/// 生产码类型
/// </summary>
[Display(Name = "生产码类型")]
[Display(Name = "生产码类型", Order = 8)]
public string CodeType { get; set; }
/// <summary>
/// 发货类型
/// </summary>
[Display(Name = "发货类型")]
public EnumDeliverBjBmpBillType? BillType { get; set; }
[Display(Name = "发货类型", Order = 9)]
public EnumDeliverBjBmpBillType? DeliverBillType { get; set; }
[Display(Name = "数量")]
[Display(Name = "数量", Order = 10)]
public decimal Qty { get; set; }
[Display(Name = "发运日期")]
[Display(Name = "发运日期", Order = 11)]
public DateTime? BillTime { get; set; }
[Display(Name = "订单日期")]
public DateTime? DeliverTime { get; set; }
[Display(Name = "订单日期", Order = 12)]
public DateTime? AssembleData { get; set; }
/// <summary>
/// ERP库位
/// </summary>
[Display(Name = "ERP库位")]
[Display(Name = "ERP库位", Order = 13)]
public string ErpToLoc { get; set; }
[Display(Name = "EDI顺序号")]
[Display(Name = "EDI顺序号", Order = 14)]
public string Seq { get; set; }
[Display(Name = "客户订单号")]
[Display(Name = "客户订单号", Order = 15)]
public string OrderNum { get; set; }
[Display(Name = "塑件唯一码")]
[Display(Name = "塑件唯一码", Order = 16)]
public string UniqueCode { get; set; }
[Display(Name = "EDI总成号")]
[Display(Name = "EDI总成号", Order = 17)]
public string MatchNumber { get; set; }
[Display(Name = "PJIS生产顺序号")]
[Display(Name = "PJIS生产顺序号", Order = 18)]
public string PjsNum { get; set; }
[Display(Name = "配置码")]
[Display(Name = "实际生产码", Order = 19)]
public string RealCode { get; set; }
[Display(Name = "配置码", Order = 20)]
public string Configcode { get; set; }
[Display(Name = "工厂")]
[Display(Name = "工厂", Order = 21)]
public string factory { get; set; }
[Display(Name = "发货子类型")]
public EnumDeliverSubBillType? SubBillType { get; set; }
[Display(Name = "发货子类型", Order = 22)]
public EnumDeliverSubBillType? DeliverSubBillType { get; set; }
[Display(Name = "WMS实发生产码")]
public string RealCode { get; set; }
[Display(Name = "EDI订单生产码", Order = 23)]
public string VinCode { get; set; }
[Display(Name = "备注")]
[Display(Name = "结算生产码", Order = 24)]
public string SettlementVinCode { get; set; }
[Display(Name = "结算生产码", Order = 25)]
public string SettlementPartCode { get; set; }
[Display(Name = "是否补货", Order = 26)]
public bool? IsReplenished { get; set; }
[Display(Name = "备注", Order = 27)]
public string ReMark { get; set; }
#endregion 库存备份
//审计
public DateTime CreatedTime { get; set; }
public DateTime UpdatedTime { get; set; }
}

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

@ -0,0 +1,22 @@
using System;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiMessage : Entity<Guid>, IHasConcurrencyStamp
{
public VmiMessage()
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public VmiMessage(Guid id) : base(id)
{
ConcurrencyStamp = Guid.NewGuid().ToString("N");
}
public long Number { get; set; }
public string Message { get; set; }
public bool isConsumed { get; set; }
public DateTime CreatedTime { get; set; } = DateTime.Now;
public string ConcurrencyStamp { get; set; }
}

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

@ -13,8 +13,9 @@ public class VmiSnapshot : Entity<Guid>
/// </summary>
public string Name { get; set; }
/// <summary>
/// 数据库文件路径
/// </summary>
public string Path { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public string Description { get; set; }
}

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

@ -1,5 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using SettleAccount.Domain.BQ;
using Volo.Abp;
@ -1298,25 +1299,24 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention();
});
//builder.Entity<VmiCategory>(b =>
//{
// b.ToTable($"{options.TablePrefix}_VmiCategory", options.Schema);
// b.ConfigureByConvention();
// 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<VmiMessage>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiMessage", options.Schema);
b.ConfigureByConvention();
b.Property(o => o.Number).ValueGeneratedOnAdd().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
});
builder.Entity((Action<EntityTypeBuilder<VmiBalance>>)(b =>
{
b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema);
b.ConfigureByConvention();
b.Property(o => o.CreatedTime).ValueGeneratedOnAdd().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.Property(o => o.UpdatedTime).ValueGeneratedOnAddOrUpdate().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.HasIndex(o => (new
{
o.BillType,
o.DeliverBillType,
o.CodeType,
o.PartCode,
o.RealPartCode,
o.VinCode,
o.ErpToLoc,
o.OrderNum,
@ -1324,12 +1324,14 @@ namespace Win.Sfs.SettleAccount
o.Configcode
})).IsUnique();
}));
builder.Entity<VmiBalance>().HasData(new VmiBalance(Guid.NewGuid()) { BillType = EnumDeliverBjBmpBillType.JIS件, PartCode = "PartCode", VinCode = "VinCode", ErpToLoc = "ErpToLoc", OrderNum = "OrderNum" });
builder.Entity<VmiBalance>().HasData(new VmiBalance(Guid.NewGuid()) { DeliverBillType = EnumDeliverBjBmpBillType.JIS件, RealPartCode = "PartCode", VinCode = "VinCode", ErpToLoc = "ErpToLoc", OrderNum = "OrderNum" });
builder.Entity<VmiLog>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiLog", options.Schema);
b.ConfigureByConvention();
b.Property(o => o.CreatedTime).ValueGeneratedOnAdd().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
b.Property(o => o.UpdatedTime).ValueGeneratedOnAddOrUpdate().Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore);
});
builder.Entity<VmiSnapshot>(b =>
@ -1338,8 +1340,21 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention();
});
builder.Entity<VmiSyncTask>(b =>
{
b.ToTable($"{options.TablePrefix}_VmiSyncTask", options.Schema);
b.ConfigureByConvention();
});
//seed
builder.Entity<VmiSyncTask>().HasData(new VmiSyncTask("Set_VmiLog".ToGuid()) { Name = "库存事务备份", Number = "Set_VmiLog", LastUpdate = DateTime.Now.AddDays(-5).Date });
builder.Entity<VmiSyncTask>().HasData(new VmiSyncTask("Set_VmiBalance".ToGuid()) { Name = "库存余额备份", Number = "Set_VmiBalance", LastUpdate = DateTime.Now.AddDays(-5).Date });
builder.Entity<JobItem>().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" });
builder.Entity<JobItem>().HasData(new JobItem("vmi.balance".ToGuid()) { Name = "同步库存", Cron = "0 0/1 * * * ?", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncBalanceService" });
builder.Entity<JobItem>().HasData(new JobItem("vmi.message".ToGuid()) { Name = "消息监控", Cron = "0 0/1 * * * ?", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" });
builder.Entity<JobItem>().HasData(new JobItem("vmi.log.sync".ToGuid()) { Name = "库存事务同步", Cron = "0 0/5 * * * ? *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" });
builder.Entity<JobItem>().HasData(new JobItem("vmi.balance.sync".ToGuid()) { Name = "库存余额同步", Cron = "0 0/5 * * * ? *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" });
builder.Entity<JobItem>().HasData(new JobItem("JisBBACSeSync".ToGuid()) { Name = "JisBBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("JisHBPOSeSync".ToGuid()) { Name = "JisHBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("MaiDanBBACSeSync".ToGuid()) { Name = "买单件BBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" });
@ -1348,13 +1363,6 @@ namespace Win.Sfs.SettleAccount
builder.Entity<JobItem>().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("YinDuSeSync".ToGuid()) { Name = "印度件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" });
//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" });
}
}

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

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

5618
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230822072327_vmi12.Designer.cs

File diff suppressed because it is too large

236
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230822072327_vmi12.cs

@ -0,0 +1,236 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi12 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Set_VmiBalance_BillType_CodeType_PartCode_VinCode_ErpToLoc_OrderNum_factory_Configcode",
table: "Set_VmiBalance");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("daf33f05-698e-49cf-b688-9288f5e94be5"));
migrationBuilder.DropColumn(
name: "CustomerPartCode",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "BackupTime",
table: "Set_VmiBalance");
migrationBuilder.RenameColumn(
name: "SubBillType",
table: "Set_VmiLog",
newName: "DeliverSubBillType");
migrationBuilder.RenameColumn(
name: "PartCode2",
table: "Set_VmiLog",
newName: "SettlementPartCode");
migrationBuilder.RenameColumn(
name: "PartCode",
table: "Set_VmiLog",
newName: "RealPartCode");
migrationBuilder.RenameColumn(
name: "GroupId",
table: "Set_VmiLog",
newName: "CustPartCode");
migrationBuilder.RenameColumn(
name: "DeliverTime",
table: "Set_VmiLog",
newName: "AssembleData");
migrationBuilder.RenameColumn(
name: "BillType",
table: "Set_VmiLog",
newName: "DeliverBillType");
migrationBuilder.RenameColumn(
name: "SubBillType",
table: "Set_VmiBalance",
newName: "DeliverSubBillType");
migrationBuilder.RenameColumn(
name: "PartCode",
table: "Set_VmiBalance",
newName: "RealPartCode");
migrationBuilder.RenameColumn(
name: "DeliverTime",
table: "Set_VmiBalance",
newName: "AssembleData");
migrationBuilder.RenameColumn(
name: "CustomerPartCode",
table: "Set_VmiBalance",
newName: "SettlementVinCode");
migrationBuilder.RenameColumn(
name: "BillType",
table: "Set_VmiBalance",
newName: "DeliverBillType");
migrationBuilder.AddColumn<string>(
name: "CustPartCode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsReplenished",
table: "Set_VmiBalance",
type: "bit",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SettlementPartCode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.CreateTable(
name: "Set_VmiMessage",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Number = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Message = table.Column<string>(type: "nvarchar(max)", nullable: true),
isConsumed = table.Column<bool>(type: "bit", nullable: false),
CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_VmiMessage", x => x.Id);
});
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "AssembleData", "BillTime", "CodeType", "ConcurrencyStamp", "Configcode", "CustPartCode", "DeliverBillType", "DeliverSubBillType", "ErpToLoc", "IsReplenished", "MatchNumber", "OrderNum", "PjsNum", "Qty", "ReMark", "RealCode", "RealPartCode", "Seq", "SettlementPartCode", "SettlementVinCode", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("1fad01d0-8122-42d3-bb8f-5fff76230eea"), null, null, null, "302d775f40154c279dbf7bbd37489b46", null, null, 1, null, "ErpToLoc", null, null, "OrderNum", null, 0m, null, null, "PartCode", null, null, null, null, "VinCode", null });
migrationBuilder.CreateIndex(
name: "IX_Set_VmiBalance_DeliverBillType_CodeType_RealPartCode_VinCode_ErpToLoc_OrderNum_factory_Configcode",
table: "Set_VmiBalance",
columns: new[] { "DeliverBillType", "CodeType", "RealPartCode", "VinCode", "ErpToLoc", "OrderNum", "factory", "Configcode" },
unique: true,
filter: "[DeliverBillType] IS NOT NULL AND [CodeType] IS NOT NULL AND [RealPartCode] IS NOT NULL AND [VinCode] IS NOT NULL AND [ErpToLoc] IS NOT NULL AND [OrderNum] IS NOT NULL AND [factory] IS NOT NULL AND [Configcode] IS NOT NULL");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_VmiMessage");
migrationBuilder.DropIndex(
name: "IX_Set_VmiBalance_DeliverBillType_CodeType_RealPartCode_VinCode_ErpToLoc_OrderNum_factory_Configcode",
table: "Set_VmiBalance");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("1fad01d0-8122-42d3-bb8f-5fff76230eea"));
migrationBuilder.DropColumn(
name: "CustPartCode",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "IsReplenished",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "SettlementPartCode",
table: "Set_VmiBalance");
migrationBuilder.RenameColumn(
name: "SettlementPartCode",
table: "Set_VmiLog",
newName: "PartCode2");
migrationBuilder.RenameColumn(
name: "RealPartCode",
table: "Set_VmiLog",
newName: "PartCode");
migrationBuilder.RenameColumn(
name: "DeliverSubBillType",
table: "Set_VmiLog",
newName: "SubBillType");
migrationBuilder.RenameColumn(
name: "DeliverBillType",
table: "Set_VmiLog",
newName: "BillType");
migrationBuilder.RenameColumn(
name: "CustPartCode",
table: "Set_VmiLog",
newName: "GroupId");
migrationBuilder.RenameColumn(
name: "AssembleData",
table: "Set_VmiLog",
newName: "DeliverTime");
migrationBuilder.RenameColumn(
name: "SettlementVinCode",
table: "Set_VmiBalance",
newName: "CustomerPartCode");
migrationBuilder.RenameColumn(
name: "RealPartCode",
table: "Set_VmiBalance",
newName: "PartCode");
migrationBuilder.RenameColumn(
name: "DeliverSubBillType",
table: "Set_VmiBalance",
newName: "SubBillType");
migrationBuilder.RenameColumn(
name: "DeliverBillType",
table: "Set_VmiBalance",
newName: "BillType");
migrationBuilder.RenameColumn(
name: "AssembleData",
table: "Set_VmiBalance",
newName: "DeliverTime");
migrationBuilder.AddColumn<string>(
name: "CustomerPartCode",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "BackupTime",
table: "Set_VmiBalance",
type: "datetime2",
nullable: true);
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("daf33f05-698e-49cf-b688-9288f5e94be5"), null, null, 1, null, "2232ce1052044e5db3c50a381547b2bc", null, null, null, "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, null, null, "VinCode", null });
migrationBuilder.CreateIndex(
name: "IX_Set_VmiBalance_BillType_CodeType_PartCode_VinCode_ErpToLoc_OrderNum_factory_Configcode",
table: "Set_VmiBalance",
columns: new[] { "BillType", "CodeType", "PartCode", "VinCode", "ErpToLoc", "OrderNum", "factory", "Configcode" },
unique: true,
filter: "[BillType] IS NOT NULL AND [CodeType] IS NOT NULL AND [PartCode] IS NOT NULL AND [VinCode] IS NOT NULL AND [ErpToLoc] IS NOT NULL AND [OrderNum] IS NOT NULL AND [factory] IS NOT NULL AND [Configcode] IS NOT NULL");
}
}
}

5739
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823012043_vmi13.Designer.cs

File diff suppressed because it is too large

242
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823012043_vmi13.cs

@ -0,0 +1,242 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi13 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("1fad01d0-8122-42d3-bb8f-5fff76230eea"));
migrationBuilder.RenameColumn(
name: "Path",
table: "Set_VmiSnapshot",
newName: "Description");
migrationBuilder.AddColumn<DateTime>(
name: "End",
table: "Set_VmiSnapshot",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "Start",
table: "Set_VmiSnapshot",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "CreatedTime",
table: "Set_VmiLog",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "UpdatedTime",
table: "Set_VmiLog",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "CreatedTime",
table: "Set_VmiBalance",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "LastUpdate",
table: "Set_VmiBalance",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "UpdatedTime",
table: "Set_VmiBalance",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.CreateTable(
name: "Set_VmiSyncTask",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(max)", nullable: true),
LastUpdate = table.Column<DateTime>(type: "datetime2", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_VmiSyncTask", x => x.Id);
});
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "9fd0847f12d44ca0888ec5468cffe209");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "c25d4ff8ba1d4f4fab5ca41211d77fa3");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "67acda8899f543e0866fd36aa29fd631");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "448d1c6b6105465b9688434d1ea931ec");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "53abb840e287470a8f7b641010ab2316");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "25bf9614ce2c42bb90499a28d9666db3");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "55f5f3c94e374afcb8409decbfbd2ca0");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "335f6624aaf94c5ba8fead27577b14cc");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "1893ae6d3ffb410c9ac2bdb293cb1367");
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "HeartBeat", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[,]
{
{ new Guid("185c5968-e02b-267e-db2f-225fccfc9716"), "0a86eea1216549839d882d9acb0e5e03", "0 0/1 * * * ?", null, false, false, "同步库存", "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncBalanceService" },
{ new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"), "637639f7ef6844789186e40ea883c0b5", "0 0/1 * * * ?", null, false, false, "消息监控", "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" },
{ new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"), "022cd0d93f234af8bb31afe5ffa94221", "0 0/5 * * * ? *", null, false, false, "库存事务同步", "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" },
{ new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"), "30efce301b314bc5b46511dca438048a", "0 0/5 * * * ? *", null, false, false, "库存余额同步", "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService" }
});
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "AssembleData", "BillTime", "CodeType", "ConcurrencyStamp", "Configcode", "CustPartCode", "DeliverBillType", "DeliverSubBillType", "ErpToLoc", "IsReplenished", "LastUpdate", "MatchNumber", "OrderNum", "PjsNum", "Qty", "ReMark", "RealCode", "RealPartCode", "Seq", "SettlementPartCode", "SettlementVinCode", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("b3183f11-1cb2-48b0-8970-aa641eb5771d"), null, null, null, "a7cae35c36f14f5790ff8895f394fa3c", null, null, 1, null, "ErpToLoc", null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, "OrderNum", null, 0m, null, null, "PartCode", null, null, null, null, "VinCode", null });
migrationBuilder.InsertData(
table: "Set_VmiSyncTask",
columns: new[] { "Id", "ConcurrencyStamp", "LastUpdate", "Name", "Number" },
values: new object[,]
{
{ new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"), "2cebf1e28ade4a82a6becea62a0e7a64", new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local), "库存事务备份", "Set_VmiLog" },
{ new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"), "245f452a0bd640c2a5fae8be9f72e806", new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local), "库存余额备份", "Set_VmiBalance" }
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_VmiSyncTask");
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"));
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("b3183f11-1cb2-48b0-8970-aa641eb5771d"));
migrationBuilder.DropColumn(
name: "End",
table: "Set_VmiSnapshot");
migrationBuilder.DropColumn(
name: "Start",
table: "Set_VmiSnapshot");
migrationBuilder.DropColumn(
name: "CreatedTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "UpdatedTime",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CreatedTime",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "LastUpdate",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "UpdatedTime",
table: "Set_VmiBalance");
migrationBuilder.RenameColumn(
name: "Description",
table: "Set_VmiSnapshot",
newName: "Path");
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "AssembleData", "BillTime", "CodeType", "ConcurrencyStamp", "Configcode", "CustPartCode", "DeliverBillType", "DeliverSubBillType", "ErpToLoc", "IsReplenished", "MatchNumber", "OrderNum", "PjsNum", "Qty", "ReMark", "RealCode", "RealPartCode", "Seq", "SettlementPartCode", "SettlementVinCode", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("1fad01d0-8122-42d3-bb8f-5fff76230eea"), null, null, null, "302d775f40154c279dbf7bbd37489b46", null, null, 1, null, "ErpToLoc", null, null, "OrderNum", null, 0m, null, null, "PartCode", null, null, null, null, "VinCode", null });
}
}
}

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

@ -4373,9 +4373,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.ValueGeneratedOnAddOrUpdate()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("nvarchar(50)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("Cron")
.IsRequired()
@ -4412,6 +4412,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
ConcurrencyStamp = "335f6624aaf94c5ba8fead27577b14cc",
Cron = "0 0 8 26 *",
IsDisabled = false,
IsRunning = false,
@ -4419,8 +4420,49 @@ namespace Win.Sfs.SettleAccount.Migrations
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService"
},
new
{
Id = new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
ConcurrencyStamp = "0a86eea1216549839d882d9acb0e5e03",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
Name = "同步库存",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncBalanceService"
},
new
{
Id = new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
ConcurrencyStamp = "637639f7ef6844789186e40ea883c0b5",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
Name = "消息监控",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService"
},
new
{
Id = new Guid("8e1cb5a9-8bcf-17fd-97e3-4c10532a5794"),
ConcurrencyStamp = "022cd0d93f234af8bb31afe5ffa94221",
Cron = "0 0/5 * * * ? *",
IsDisabled = false,
IsRunning = false,
Name = "库存事务同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService"
},
new
{
Id = new Guid("c3fe2b66-28cc-c612-eca6-a362769ae90c"),
ConcurrencyStamp = "30efce301b314bc5b46511dca438048a",
Cron = "0 0/5 * * * ? *",
IsDisabled = false,
IsRunning = false,
Name = "库存余额同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAsyncMessageService"
},
new
{
Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
ConcurrencyStamp = "53abb840e287470a8f7b641010ab2316",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4430,6 +4472,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
ConcurrencyStamp = "9fd0847f12d44ca0888ec5468cffe209",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4439,6 +4482,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
ConcurrencyStamp = "67acda8899f543e0866fd36aa29fd631",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4448,6 +4492,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
ConcurrencyStamp = "c25d4ff8ba1d4f4fab5ca41211d77fa3",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4457,6 +4502,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
ConcurrencyStamp = "1893ae6d3ffb410c9ac2bdb293cb1367",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4466,6 +4512,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
ConcurrencyStamp = "448d1c6b6105465b9688434d1ea931ec",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4475,6 +4522,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
ConcurrencyStamp = "55f5f3c94e374afcb8409decbfbd2ca0",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4484,6 +4532,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
ConcurrencyStamp = "25bf9614ce2c42bb90499a28d9666db3",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4529,15 +4578,12 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("BackupTime")
b.Property<DateTime?>("AssembleData")
.HasColumnType("datetime2");
b.Property<DateTime?>("BillTime")
.HasColumnType("datetime2");
b.Property<int?>("BillType")
.HasColumnType("int");
b.Property<string>("CodeType")
.HasColumnType("nvarchar(450)");
@ -4550,24 +4596,34 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Configcode")
.HasColumnType("nvarchar(450)");
b.Property<string>("CustomerPartCode")
b.Property<DateTime>("CreatedTime")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2");
b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("DeliverTime")
.HasColumnType("datetime2");
b.Property<int?>("DeliverBillType")
.HasColumnType("int");
b.Property<int?>("DeliverSubBillType")
.HasColumnType("int");
b.Property<string>("ErpToLoc")
.HasColumnType("nvarchar(450)");
b.Property<bool?>("IsReplenished")
.HasColumnType("bit");
b.Property<DateTime>("LastUpdate")
.HasColumnType("datetime2");
b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("OrderNum")
.HasColumnType("nvarchar(450)");
b.Property<string>("PartCode")
.HasColumnType("nvarchar(450)");
b.Property<string>("PjsNum")
.HasColumnType("nvarchar(max)");
@ -4580,15 +4636,25 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("RealCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("RealPartCode")
.HasColumnType("nvarchar(450)");
b.Property<string>("Seq")
.HasColumnType("nvarchar(max)");
b.Property<int?>("SubBillType")
.HasColumnType("int");
b.Property<string>("SettlementPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("SettlementVinCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("UpdatedTime")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime2");
b.Property<string>("VinCode")
.HasColumnType("nvarchar(450)");
@ -4597,22 +4663,25 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasKey("Id");
b.HasIndex("BillType", "CodeType", "PartCode", "VinCode", "ErpToLoc", "OrderNum", "factory", "Configcode")
b.HasIndex("DeliverBillType", "CodeType", "RealPartCode", "VinCode", "ErpToLoc", "OrderNum", "factory", "Configcode")
.IsUnique()
.HasFilter("[BillType] IS NOT NULL AND [CodeType] IS NOT NULL AND [PartCode] IS NOT NULL AND [VinCode] IS NOT NULL AND [ErpToLoc] IS NOT NULL AND [OrderNum] IS NOT NULL AND [factory] IS NOT NULL AND [Configcode] IS NOT NULL");
.HasFilter("[DeliverBillType] IS NOT NULL AND [CodeType] IS NOT NULL AND [RealPartCode] IS NOT NULL AND [VinCode] IS NOT NULL AND [ErpToLoc] IS NOT NULL AND [OrderNum] IS NOT NULL AND [factory] IS NOT NULL AND [Configcode] IS NOT NULL");
b.ToTable("Set_VmiBalance");
b.HasData(
new
{
Id = new Guid("daf33f05-698e-49cf-b688-9288f5e94be5"),
BillType = 1,
ConcurrencyStamp = "2232ce1052044e5db3c50a381547b2bc",
Id = new Guid("b3183f11-1cb2-48b0-8970-aa641eb5771d"),
ConcurrencyStamp = "a7cae35c36f14f5790ff8895f394fa3c",
CreatedTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DeliverBillType = 1,
ErpToLoc = "ErpToLoc",
LastUpdate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
OrderNum = "OrderNum",
PartCode = "PartCode",
Qty = 0m,
RealPartCode = "PartCode",
UpdatedTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
VinCode = "VinCode"
});
});
@ -4623,11 +4692,11 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("BillTime")
b.Property<DateTime?>("AssembleData")
.HasColumnType("datetime2");
b.Property<int?>("BillType")
.HasColumnType("int");
b.Property<DateTime?>("BillTime")
.HasColumnType("datetime2");
b.Property<string>("ChangedBy")
.HasColumnType("nvarchar(max)");
@ -4650,16 +4719,20 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Configcode")
.HasColumnType("nvarchar(max)");
b.Property<string>("CustomerPartCode")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("DeliverTime")
b.Property<DateTime>("CreatedTime")
.ValueGeneratedOnAdd()
.HasColumnType("datetime2");
b.Property<string>("ErpToLoc")
b.Property<string>("CustPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("GroupId")
b.Property<int?>("DeliverBillType")
.HasColumnType("int");
b.Property<int?>("DeliverSubBillType")
.HasColumnType("int");
b.Property<string>("ErpToLoc")
.HasColumnType("nvarchar(max)");
b.Property<bool?>("IsReplenished")
@ -4674,12 +4747,6 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("OrderNum")
.HasColumnType("nvarchar(max)");
b.Property<string>("PartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("PartCode2")
.HasColumnType("nvarchar(max)");
b.Property<string>("PjsNum")
.HasColumnType("nvarchar(max)");
@ -4692,18 +4759,25 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("RealCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("RealPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Seq")
.HasColumnType("nvarchar(max)");
b.Property<string>("SettlementVinCode")
b.Property<string>("SettlementPartCode")
.HasColumnType("nvarchar(max)");
b.Property<int?>("SubBillType")
.HasColumnType("int");
b.Property<string>("SettlementVinCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("UpdatedTime")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("datetime2");
b.Property<string>("VinCode")
.HasColumnType("nvarchar(max)");
@ -4715,23 +4789,104 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_VmiLog");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiMessage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreatedTime")
.HasColumnType("datetime2");
b.Property<string>("Message")
.HasColumnType("nvarchar(max)");
b.Property<long>("Number")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<bool>("isConsumed")
.HasColumnType("bit");
b.HasKey("Id");
b.ToTable("Set_VmiMessage");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiSnapshot", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Path")
b.Property<DateTime>("End")
.HasColumnType("datetime2");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("Start")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("Set_VmiSnapshot");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiSyncTask", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("LastUpdate")
.HasColumnType("datetime2");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("Number")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Set_VmiSyncTask");
b.HasData(
new
{
Id = new Guid("08de7a37-5ede-f524-cb3d-3c80888fd7d8"),
ConcurrencyStamp = "2cebf1e28ade4a82a6becea62a0e7a64",
LastUpdate = new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local),
Name = "库存事务备份",
Number = "Set_VmiLog"
},
new
{
Id = new Guid("b8ba69e3-f5a3-c95e-8f82-c9c2fec960b4"),
ConcurrencyStamp = "245f452a0bd640c2a5fae8be9f72e806",
LastUpdate = new DateTime(2023, 8, 18, 0, 0, 0, 0, DateTimeKind.Local),
Name = "库存事务备份",
Number = "Set_VmiBalance"
});
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Boms.BomVersion", b =>
{
b.Property<Guid>("Id")

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

@ -264,22 +264,22 @@ namespace Win.Sfs.SettleAccount
//});
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.Configure<OutPutErrorContainer>(container =>
{
container.UseFileSystem(fileSystem =>
{
var filestreampath = Environment.CurrentDirectory + @"\wwwroot\files\OutputError";
if (!Directory.Exists(filestreampath))
{
Directory.CreateDirectory(filestreampath);
}
fileSystem.BasePath = filestreampath;
});
//Configure<AbpBlobStoringOptions>(options =>
//{
// options.Containers.Configure<OutPutErrorContainer>(container =>
// {
// container.UseFileSystem(fileSystem =>
// {
// var filestreampath = Environment.CurrentDirectory + @"\wwwroot\files\OutputError";
// if (!Directory.Exists(filestreampath))
// {
// Directory.CreateDirectory(filestreampath);
// }
// fileSystem.BasePath = filestreampath;
// });
});
});
// });
//});
}

Loading…
Cancel
Save