mahao 1 year ago
parent
commit
c4994f778d
  1. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js
  2. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js
  3. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js
  4. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-item.js
  5. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/index.js
  6. 44
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  7. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html
  8. 45
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/contrast/bbac_sa_detail_jobservice.js
  9. 40
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  10. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs
  11. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs
  12. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  13. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  14. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  15. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  16. 176
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  17. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs
  18. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  19. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  20. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs
  21. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs
  22. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  23. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  24. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  25. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs
  26. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs
  27. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs
  28. 90
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs
  29. 255
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  30. 44
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PD_MNG.cs
  31. 57
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
  32. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
  33. 3
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  34. 4411
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230720012742_vmi2.Designer.cs
  35. 227
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230720012742_vmi2.cs
  36. 52
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

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

@ -91,6 +91,7 @@ async function getLocalizationAsync() {
remove: "移除", remove: "移除",
restore: "还原", restore: "还原",
delete: "删除", delete: "删除",
compare: "对比",
authenticate: "验证", authenticate: "验证",
loginModel: "登录", loginModel: "登录",
login: "登录", login: "登录",

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

@ -2,10 +2,10 @@ import html from "html";
import { ElConfigProvider } from "element-plus"; import { ElConfigProvider } from "element-plus";
import zh from "./lib/element-plus/locale/zh-cn.min.mjs"; import zh from "./lib/element-plus/locale/zh-cn.min.mjs";
import en from "./lib/element-plus/locale/en.min.mjs"; import en from "./lib/element-plus/locale/en.min.mjs";
import { Suspense, reactive, onMounted } from "vue"; import { reactive, onMounted } from "vue";
export default { export default {
components: { ElConfigProvider, Suspense }, components: { ElConfigProvider },
template: html` template: html`
<el-config-provider :locale="localeMap.get($i18n.locale)"> <el-config-provider :locale="localeMap.get($i18n.locale)">
<router-view></router-view> <router-view></router-view>

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

@ -1,7 +1,7 @@
import html from "html"; import html from "html";
import { ref, reactive, watch, onMounted } from "vue"; import { ref, reactive, watch, onMounted } from "vue";
import { dayjs } from "element-plus"; import { dayjs } from "element-plus";
import request, { post } from "../../request/index.js"; import request from "../../request/index.js";
import { importFunction } from "../../utils/index.js"; import { importFunction } from "../../utils/index.js";
export default { export default {
@ -127,6 +127,9 @@ export default {
value: o[props.schema.value], value: o[props.schema.value],
label: o[props.schema.label], label: o[props.schema.label],
})); }));
if (props.schema.defaultSelected && options.value.length) {
model[props.prop] = options.value[0].value;
}
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-item.js

@ -4,7 +4,9 @@ import { getRules } from "../../utils/validation.js";
export default { export default {
name: "formItem", name: "formItem",
components: { AppFormInput: defineAsyncComponent(() => import("./form-input.js")) }, components: {
AppFormInput: defineAsyncComponent(() => import("./form-input.js")),
},
template: html` template: html`
<template v-if="!schema.hidden"> <template v-if="!schema.hidden">
<template v-if="schema.type==='object'"></template> <template v-if="schema.type==='object'"></template>

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/index.js

@ -1,8 +1,10 @@
import html from "html"; import html from "html";
import { defineAsyncComponent, ref, reactive, watch } from "vue"; import { defineAsyncComponent, ref, reactive, watch, onMounted } from "vue";
export default { export default {
components: { AppFormItem: defineAsyncComponent(() => import("./form-item.js")) }, components: {
AppFormItem: defineAsyncComponent(() => import("./form-item.js")),
},
name: "AppForm", name: "AppForm",
template: html`<div v-loading="loading"> template: html`<div v-loading="loading">
<el-form ref="formRef" :model="model" label-width="auto" :inline="inline"> <el-form ref="formRef" :model="model" label-width="auto" :inline="inline">

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

@ -1,6 +1,6 @@
import html, { getProp } from "html"; import html, { getProp } from "html";
import request, { get, getUrl, post } from "../../request/index.js"; import request, { get, getUrl, post } from "../../request/index.js";
import { defineAsyncComponent, ref, reactive, onMounted } from "vue"; import { defineAsyncComponent, ref, reactive, onMounted, watch } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { listToTree, schemaToModel, importFunction, format } from "../../utils/index.js"; import { listToTree, schemaToModel, importFunction, format } from "../../utils/index.js";
@ -226,7 +226,7 @@ export default {
style="height:100%;" style="height:100%;"
/> />
</template> </template>
<template v-else-if="editFormMode==='export'"> <template v-else-if="editFormMode==='compare'">
<el-form :model="exportModel" style="height:100%;"> <el-form :model="exportModel" style="height:100%;">
<el-form-item label="选择期间" label-width="100px"> <el-form-item label="选择期间" label-width="100px">
<el-select v-model="exportModel.version"> <el-select v-model="exportModel.version">
@ -235,14 +235,14 @@ export default {
</el-form-item> </el-form-item>
<template v-if="isNotJit"> <template v-if="isNotJit">
<el-form-item label="发运日期" label-width="100px"> <el-form-item label="发运日期" label-width="100px">
<el-date-picker v-model="exportModel.date1" value-format="YYYY-MM-DD" /> <el-date-picker v-model="exportModel.seStartDateTime" value-format="YYYY-MM-DD" />
<span style="margin:0 .5em;">-</span> <span style="margin:0 .5em;">-</span>
<el-date-picker v-model="exportModel.date2" value-format="YYYY-MM-DD" /> <el-date-picker v-model="exportModel.seEndDateTime" value-format="YYYY-MM-DD" />
</el-form-item> </el-form-item>
<el-form-item label="下线日期" label-width="100px"> <el-form-item label="下线日期" label-width="100px">
<el-date-picker v-model="exportModel.date3" value-format="YYYY-MM-DD" /> <el-date-picker v-model="exportModel.downLineStartDateTime" value-format="YYYY-MM-DD" />
<span style="margin:0 .5em;">-</span> <span style="margin:0 .5em;">-</span>
<el-date-picker v-model="exportModel.date4" value-format="YYYY-MM-DD" /> <el-date-picker v-model="exportModel.downLineEndDateTime" value-format="YYYY-MM-DD" />
</el-form-item> </el-form-item>
</template> </template>
<el-form-item label="通用码" label-width="100px"> <el-form-item label="通用码" label-width="100px">
@ -384,7 +384,7 @@ export default {
const filterDrawer = ref(false); const filterDrawer = ref(false);
const subDrawer = ref(false); const subDrawer = ref(false);
const subListQuery = ref({}); const subListQuery = ref({});
const tableLoading = ref(true); const tableLoading = ref(false);
const selectedRows = ref([]); const selectedRows = ref([]);
const dialogVisible = ref(false); const dialogVisible = ref(false);
const route = useRoute(); const route = useRoute();
@ -396,7 +396,12 @@ export default {
// 添加下行代码暂停权限验证 // 添加下行代码暂停权限验证
const buttons = ref(props.buttons ?? route.meta.children); const buttons = ref(props.buttons ?? route.meta.children);
const baseUrl = props.controller ?? `${route.meta.path}`; const baseUrl = props.controller ?? `${route.meta.path}`;
const queryModel = ref({}); const queryModel = ref(schemaToModel(config.query.schema));
watch(queryModel.value, async (value, oldValue, a) => {
if (config.query.autoSubmit) {
await load();
}
});
const sortColumns = ref(new Map()); const sortColumns = ref(new Map());
const querySchema = ref(props.querySchema); const querySchema = ref(props.querySchema);
const filterList = ref([]); const filterList = ref([]);
@ -410,10 +415,10 @@ export default {
const editFormModel = ref(null); const editFormModel = ref(null);
const defaultExportModel = { const defaultExportModel = {
version: "", version: "",
date1: "", seStartDateTime: "",
date2: "", seEndDateTime: "",
date3: "", downLineStartDateTime: "",
date4: "", downLineEndDateTime: "",
ln: "", ln: "",
pn: "", pn: "",
enumBusinessType: route.meta.enumBusinessType, enumBusinessType: route.meta.enumBusinessType,
@ -581,7 +586,8 @@ export default {
if (!response.errors) { if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`)); window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
} }
} else if (item.meta.isTop) { }
} else if (item.path === "compare") {
exportModel.value = defaultExportModel; exportModel.value = defaultExportModel;
versions.value = ( versions.value = (
await request("settleaccount/centralized-control/get-all", null, { method: "POST" }) await request("settleaccount/centralized-control/get-all", null, { method: "POST" })
@ -591,7 +597,6 @@ export default {
})); }));
editFormTitle.value = `${t(item.path)}${config.query.schema.title}`; editFormTitle.value = `${t(item.path)}${config.query.schema.title}`;
dialogVisible.value = true; dialogVisible.value = true;
}
} else if (item.path === "import") { } else if (item.path === "import") {
//import //import
try { try {
@ -654,7 +659,7 @@ export default {
} else if (editFormMode.value === "details") { } else if (editFormMode.value === "details") {
dialogVisible.value = false; dialogVisible.value = false;
editFormMode.value = null; editFormMode.value = null;
} else if (editFormMode.value === "export") { } else if (editFormMode.value === "compare") {
// const postData = JSON.parse(JSON.stringify(queryModel.value)); // const postData = JSON.parse(JSON.stringify(queryModel.value));
// postData.filters = filterList.value.filter((o) => o.property && o.value); // postData.filters = filterList.value.filter((o) => o.property && o.value);
// delete postData.query["items"]; // delete postData.query["items"];
@ -662,8 +667,8 @@ export default {
// const url = `${baseUrl}/${editFormMode.value}?${qs.stringify(exportModel)}`; // const url = `${baseUrl}/${editFormMode.value}?${qs.stringify(exportModel)}`;
// const response = await post(url, postData); // const response = await post(url, postData);
// download(response); // download(response);
const url = config.edit.exportUrl; const url = config.edit.compareUrl;
await request(url, exportModel.value, { method: config.edit.exportMethod }); await request(url, exportModel.value, { method: config.edit.compareMethod });
dialogVisible.value = false; dialogVisible.value = false;
} else if (editFormMode.value === "import") { } else if (editFormMode.value === "import") {
editFormloading.value = true; editFormloading.value = true;
@ -825,16 +830,15 @@ export default {
} }
} }
// //
queryModel.value = schemaToModel(config.query.schema);
getSortModel(queryModel.value); getSortModel(queryModel.value);
filterList.value = queryModel.value?.filters ?? []; filterList.value = queryModel.value?.filters ?? [];
getColumns(config.table.schema); getColumns(config.table.schema);
if (props.query) { if (props.query) {
Object.assign(queryModel.value.query, props.query); Object.assign(queryModel.value.query, props.query);
} }
// getSortModel(data.value); if (!route.meta.disableQueryOnLoad) {
// getColumns(vm.schema.properties.query);
await load(); await load();
}
}); });
context.expose({ load }); context.expose({ load });
return { return {

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html

@ -49,7 +49,7 @@
"html":"./utils/index.js", "html":"./utils/index.js",
"detect-it":"./lib/detect-it/detect-it.esm.js", "detect-it":"./lib/detect-it/detect-it.esm.js",
"lodash":"./lib/lodash/lodash.esm.js", "lodash":"./lib/lodash/lodash.esm.js",
"vue": "./lib/vue/vue.esm-browser.js", "vue": "./lib/vue/vue.esm-browser.prod.js",
"vue-router": "./lib/vue-router/vue-router.esm-browser.js", "vue-router": "./lib/vue-router/vue-router.esm-browser.js",
"vue-i18n":"./lib/vue-i18n/vue-i18n.esm-browser.prod.js", "vue-i18n":"./lib/vue-i18n/vue-i18n.esm-browser.prod.js",
"pinia": "./lib/pinia/pinia.esm-browser.js", "pinia": "./lib/pinia/pinia.esm-browser.js",

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

@ -1,3 +1,5 @@
import version from "../../../models/version.js";
const schema = { const schema = {
title: "期间设置", title: "期间设置",
type: "object", type: "object",
@ -53,16 +55,14 @@ const schema = {
}; };
const baseUrl = "settleaccount/centralized-control"; const baseUrl = "settleaccount/centralized-control";
const queryUrl = `${baseUrl}/get-list`; const queryUrl = "settleaccount/Job/list";
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`; const deleteUrl = `${baseUrl}/delete-list`;
const exportUrl = "settleaccount/pub_sa_detail_service/export";
const compareUrl = "settleaccount/pub_sa_detail_service/pub-sa-se-compare";
const queryMethod = "POST"; const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST"; const deleteMethod = "POST";
const exportMethod = "POST";
const compareMethod = "POST";
export default function () { export default function () {
return { return {
@ -71,10 +71,17 @@ export default function () {
url: queryUrl, url: queryUrl,
method: queryMethod, method: queryMethod,
hasFilter: true, hasFilter: true,
autoSubmit: true,
schema: { schema: {
title: "期间设置", title: "期间设置",
type: "object", type: "object",
properties: { properties: {
type: Object.assign({ defaultSelected: true }, version),
name: {
type: "string",
default: null,
hidden: true,
},
filters: { filters: {
type: "array", type: "array",
hidden: true, hidden: true,
@ -96,13 +103,13 @@ export default function () {
}, },
}, },
default: [ default: [
{ // {
logic: "and", // logic: "and",
column: "year", // column: "year",
action: "like", // action: "like",
value: null, // value: null,
readOnly: true, // readOnly: true,
}, // },
], ],
}, },
skipCount: { skipCount: {
@ -123,14 +130,12 @@ export default function () {
schema: schema, schema: schema,
}, },
edit: { edit: {
detailsUrl,
createUrl,
updateUrl,
deleteUrl, deleteUrl,
detailsMethod, exportUrl,
createMethod, compareUrl,
updateMethod,
deleteMethod, deleteMethod,
exportMethod,
compareMethod,
schema: schema, schema: schema,
}, },
}; };

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

@ -183,6 +183,8 @@ export default [
type: "page", type: "page",
title: "EDI与发运数据对比", title: "EDI与发运数据对比",
icon: "file", icon: "file",
enumBusinessType: "BBAC",
disableQueryOnLoad: true,
}, },
children: [ children: [
{ {
@ -195,7 +197,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -228,6 +230,7 @@ export default [
type: "page", type: "page",
title: "EDI、发运与结算比对", title: "EDI、发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "BBAC",
}, },
children: [ children: [
{ {
@ -240,7 +243,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -273,6 +276,7 @@ export default [
type: "page", type: "page",
title: "发运与结算数据二次比对", title: "发运与结算数据二次比对",
icon: "file", icon: "file",
enumBusinessType: "BBAC",
}, },
children: [ children: [
{ {
@ -285,7 +289,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -318,6 +322,7 @@ export default [
type: "page", type: "page",
title: "买单件发运与结算数据三次比对", title: "买单件发运与结算数据三次比对",
icon: "file", icon: "file",
enumBusinessType: "BBAC",
}, },
children: [ children: [
{ {
@ -330,7 +335,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -749,6 +754,7 @@ export default [
type: "page", type: "page",
title: "EDI与发运数据对比", title: "EDI与发运数据对比",
icon: "file", icon: "file",
enumBusinessType: "HBPO",
}, },
children: [ children: [
{ {
@ -761,7 +767,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -794,6 +800,7 @@ export default [
type: "page", type: "page",
title: "EDI、发运与结算比对", title: "EDI、发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "HBPO",
}, },
children: [ children: [
{ {
@ -806,7 +813,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -839,6 +846,7 @@ export default [
type: "page", type: "page",
title: "发运与结算数据二次比对", title: "发运与结算数据二次比对",
icon: "file", icon: "file",
enumBusinessType: "HBPO",
}, },
children: [ children: [
{ {
@ -851,7 +859,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -1242,6 +1250,7 @@ export default [
type: "page", type: "page",
title: "发运与结算比对", title: "发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "ZhiGongJian",
}, },
children: [ children: [
{ {
@ -1254,7 +1263,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -1287,6 +1296,7 @@ export default [
type: "page", type: "page",
title: "发运与结算二次比对", title: "发运与结算二次比对",
icon: "file", icon: "file",
enumBusinessType: "ZhiGongJian",
}, },
children: [ children: [
{ {
@ -1299,7 +1309,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -1670,6 +1680,7 @@ export default [
type: "page", type: "page",
title: "发运与结算比对", title: "发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "BeiJian",
}, },
children: [ children: [
{ {
@ -1682,7 +1693,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -1715,6 +1726,7 @@ export default [
type: "page", type: "page",
title: "发运与结算二次比对", title: "发运与结算二次比对",
icon: "file", icon: "file",
enumBusinessType: "BeiJian",
}, },
children: [ children: [
{ {
@ -1727,7 +1739,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -2098,6 +2110,7 @@ export default [
type: "page", type: "page",
title: "发运与结算比对", title: "发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "YingDuJian",
}, },
children: [ children: [
{ {
@ -2110,7 +2123,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",
@ -2143,6 +2156,7 @@ export default [
type: "page", type: "page",
title: "发运与结算二次比对", title: "发运与结算二次比对",
icon: "file", icon: "file",
enumBusinessType: "YingDuJian",
}, },
children: [ children: [
{ {
@ -2155,7 +2169,7 @@ export default [
}, },
}, },
{ {
path: "export", path: "compare",
meta: { meta: {
type: "button", type: "button",
title: "生成对比", title: "生成对比",

6
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs

@ -94,6 +94,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 结算分组号 /// 结算分组号
/// </summary> /// </summary>
public string GroupNum { get; set; } public string GroupNum { get; set; }
/// <summary>
/// 金额
/// </summary>
public decimal Amt { get; set; }
} }
public class BBAC_CAN_SA_DETAIL_EXP_DTO public class BBAC_CAN_SA_DETAIL_EXP_DTO
@ -191,6 +195,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public string SettleBillNum { get; set; } public string SettleBillNum { get; set; }
[Display(Name = "状态")] [Display(Name = "状态")]
public string State { get; set; } public string State { get; set; }
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
} }
public class BBAC_CAN_SA_DETAIL_REQ_DTO : RequestInputBase public class BBAC_CAN_SA_DETAIL_REQ_DTO : RequestInputBase

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

@ -83,12 +83,5 @@ namespace Win.Sfs.SettleAccount.Bases
); );
return fileName; return fileName;
} }
} }
} }

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

@ -31,7 +31,7 @@ namespace Win.Sfs.SettleAccount.Bases
{ {
public abstract class BA_SERVICE: BASE_SERVICE public abstract class BA_SERVICE: BASE_SERVICE
{ {
private readonly INormalEfCoreRepository<INVOICE_GRP, Guid> _repository; protected readonly INormalEfCoreRepository<INVOICE_GRP, Guid> _repository;
private readonly INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> _wRepository; private readonly INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> _wRepository;
private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _sRepository; private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _sRepository;
private readonly INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> _mRepository; private readonly INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> _mRepository;
@ -77,8 +77,13 @@ namespace Win.Sfs.SettleAccount.Bases
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
public virtual async Task<string> GenerateInvoice(INVOICE_GRP_REQ_DTO input) public virtual async Task<string> GenerateInvoice(INVOICE_GRP_REQ_DTO input)
{ {
await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.);
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;
} }
@ -183,7 +188,7 @@ namespace Win.Sfs.SettleAccount.Bases
bool flag = await _invMng.ReceivedAsync(entity.InvGroupNum); bool flag = await _invMng.ReceivedAsync(entity.InvGroupNum);
if (flag == true) if (flag == true)
{ {
await _invMng.SetForwardState(entity, InvoiceBillState.); await _invMng.SetForwardState(entity,SettleBillState.);
} }
} }

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

@ -22,6 +22,7 @@ using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -38,18 +39,19 @@ namespace Win.Sfs.SettleAccount.Bases
where TEntityDetailExportDto : class, new() where TEntityDetailExportDto : class, new()
{ {
private readonly INormalEfCoreRepository<TEntity, Guid> _repository; protected readonly INormalEfCoreRepository<TEntity, Guid> _repository;
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository; protected readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService; private readonly IExcelImportAppService _excelImportService;
protected readonly INV_MNG _invmng;
protected CAN_SA_SERVICE( protected CAN_SA_SERVICE(
INormalEfCoreRepository<TEntity, Guid> repository, INormalEfCoreRepository<TEntity, Guid> repository,
IExcelImportAppService excelImportService, IExcelImportAppService excelImportService,
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository INormalEfCoreRepository<TEntityDetail, Guid> detailRepository,
INV_MNG invmng
) )
{ {
_invmng= invmng;
_excelImportService = excelImportService; _excelImportService = excelImportService;
_repository = repository; _repository = repository;
_detailRepository = detailRepository; _detailRepository = detailRepository;

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

@ -142,12 +142,12 @@ namespace Win.Sfs.SettleAccount.Bases
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;
} }
public virtual async Task<TEntity> GetMainByBillNum(string billNum) public virtual async Task<TEntity> GetMainAsync(string billNum)
{ {
return await _repository.Where(p=>p.InvGroupNum == billNum).FirstOrDefaultAsync(); return await _repository.Where(p=>p.InvGroupNum == billNum).FirstOrDefaultAsync();
} }
public virtual async Task<List<TEntityDetail>> GetDetailByBillNum(string billNum) public virtual async Task<List<TEntityDetail>> GetDetailAsync(string billNum)
{ {
return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync(); return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync();
} }

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

@ -18,7 +18,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// BBAC业务商务审核 /// BBAC业务商务审核
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/bbac_ba_service")] [Route("api/settleaccount/[controller]/[action]")]
public class BBAC_BA_SERVICE : BA_SERVICE public class BBAC_BA_SERVICE : BA_SERVICE
{ {
public BBAC_BA_SERVICE(INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService, CAN_SA_MNG<PUB_CAN_SA, PUB_CAN_SA_DETAIL> pubMng, CAN_SA_MNG<BBAC_CAN_SA, BBAC_CAN_SA_DETAIL> bbacMng, CAN_SA_MNG<HBPO_CAN_SA, HBPO_CAN_SA_DETAIL> hbpoMng, INV_MNG invMng) : base(repository, wRepository, sRepository, mRepository, excelImportService, pubMng, bbacMng, hbpoMng, invMng) public BBAC_BA_SERVICE(INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService, CAN_SA_MNG<PUB_CAN_SA, PUB_CAN_SA_DETAIL> pubMng, CAN_SA_MNG<BBAC_CAN_SA, BBAC_CAN_SA_DETAIL> bbacMng, CAN_SA_MNG<HBPO_CAN_SA, HBPO_CAN_SA_DETAIL> hbpoMng, INV_MNG invMng) : base(repository, wRepository, sRepository, mRepository, excelImportService, pubMng, bbacMng, hbpoMng, invMng)

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

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using NPOI.SS.Formula.Functions; using NPOI.SS.Formula.Functions;
@ -10,10 +10,12 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
@ -35,57 +37,189 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
BBAC_CAN_SA_DETAIL_EXP_DTO BBAC_CAN_SA_DETAIL_EXP_DTO
> >
{ {
protected BBAC_CAN_SA_SERVICE(INormalEfCoreRepository<BBAC_CAN_SA, Guid> repository, IExcelImportAppService excelImportService, INormalEfCoreRepository<BBAC_CAN_SA_DETAIL, Guid> detailRepository) : base(repository, excelImportService, detailRepository) private readonly INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> _notRepository;
public BBAC_CAN_SA_SERVICE(
INormalEfCoreRepository<BBAC_CAN_SA, Guid> repository,
IExcelImportAppService excelImportService,
INormalEfCoreRepository<BBAC_CAN_SA_DETAIL, Guid> detailRepository,
INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> notRepository,
INV_MNG invmng) : base(repository, excelImportService, detailRepository, invmng)
{ {
_notRepository = notRepository;
} }
/// <summary>
/// 生成发票
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost] [HttpPost]
//[Route("generateinvoice")] //[Route("generateinvoice")]
public async override Task<string> GenerateInvoice(BBAC_CAN_SA_REQ_DTO input) public async override Task<string> GenerateInvoice(BBAC_CAN_SA_REQ_DTO input)
{ {
List<BBAC_CAN_SA_DETAIL_DTO> _ls = new List<BBAC_CAN_SA_DETAIL_DTO>();
var _query= _ls.GroupBy(p => new { p.GroupNum }).Select(p =>new {GroupNum=p.Key.GroupNum, Qty=p.Sum(itm=>itm.Price)}); var main=_repository.Where(p => p.InvGroupNum == input.Filters.Where(p => p.Column == "BillNum").FirstOrDefault().Value).FirstOrDefault();
Dictionary<string, decimal> _dic = new Dictionary<string, decimal>(); var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);//可结算
Dictionary<string, decimal> _dic1 = new Dictionary<string, decimal>();
var groupNumList= entitys.Select(p=>p.GroupNum).Distinct().ToList();
var notList =_notRepository.Where(p => groupNumList.Contains(p.InvGroupNum)).ToList();//不能结算
var dtos = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
dtos.ForEach(dto =>
{
dto.Amt = Math.Round(dto.Price * dto.Qty, 2);
});
var _query= dtos.GroupBy(p => new { p.GroupNum }).Select(p =>new {GroupNum=p.Key.GroupNum, Amt=p.Sum(itm=>itm.Amt)});
Dictionary<string, decimal> dic = new Dictionary<string, decimal>();//原本
Dictionary<string, decimal> copyDic = new Dictionary<string, decimal>();//变换数组副本
foreach (var itm in _query.ToList()) foreach (var itm in _query.ToList())
{ {
_dic.Add(itm.GroupNum, itm.Qty); dic.Add(itm.GroupNum, itm.Amt);
_dic1.Add(itm.GroupNum, itm.Qty); copyDic.Add(itm.GroupNum, itm.Amt);
} }
Dictionary<string, List<string>> _invoice=new Dictionary<string,List<string>>(); Dictionary<string, List<string>> invoiceMap=new Dictionary<string,List<string>>();
foreach (var _itm in _dic) foreach (var itm in dic)
{ {
string invoiceBillNum = Guid.NewGuid().ToString(); string invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("INV");
List<string> invoiceGroupNumList = new List<string>(); List<string> invoiceGroupNumList = new List<string>();//每个发票对应的结算分组号
List<string> List = new List<string>(); List<string> List = new List<string>();
decimal sum = _itm.Value;//初始价格 decimal sum = itm.Value;//初始分组合计金额
List<string> luList= _ls.Where(p => p.GroupNum == _itm.Key).Select(p => p.LU).Distinct().ToList(); //初始LU种类 List<string> luList= dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU).Distinct().ToList(); //初始LU种类
foreach (var _itm1 in _dic1)
if (copyDic.ContainsKey(itm.Key)==true)//是否存在分组
{ {
if (_itm.Key == _itm1.Key) foreach (var _itm1 in copyDic)
{ {
if (itm.Key == _itm1.Key)//相同结算分组项不计算,已初始化
{
invoiceGroupNumList.Add(itm.Key);
continue; continue;
} }
var grouplist=_ls.Where(p => p.GroupNum == _itm1.Key).Select(p => p.LU).Distinct().ToList();//每项LU种类 var grouplist = dtos.Where(p => p.GroupNum == _itm1.Key).Select(p => p.LU).Distinct().ToList();//每项LU种类
luList.AddRange(grouplist); luList.AddRange(grouplist);
luList = luList.Distinct().ToList(); luList = luList.Distinct().ToList();
if (luList.Count > 20)//累加零件不超过20种 if (luList.Count > 20)//累加零件不超过20种
{ {
continue; continue;
} }
sum += _itm1.Value;
if (sum > 10000000) if (sum > 10000000)
{ {
continue; break;
} }
sum += _itm1.Value;
invoiceGroupNumList.Add(_itm1.Key);//所有条件都满足添加发票和结算分组对应关系 invoiceGroupNumList.Add(_itm1.Key);//所有条件都满足添加发票和结算分组对应关系
} }
invoiceMap.Add(invoiceBillNum, invoiceGroupNumList);//记录发票对应关系
foreach (var rem in invoiceGroupNumList)//移除
{
copyDic.Remove(rem);
}
} }
}
if(invoiceMap.Keys.Count > 0) {
return ApplicationConsts.SuccessStr; var inv=new INVOICE_GRP();
var groupList = new List<INVOICE_MAP_GROUP>();
var notDetialList=new List<INVOICE_NOT_SETTLE>();
var detailList= new List<INVOICE_WAIT_DETAIL>();
foreach (var itm in invoiceMap)
{
var key = itm.Key;//发票票号
var ls = itm.Value;//结算分组号列表
var detailDtos= dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p=>new {p.InvGroupNum, p.LU,p.Price })
.Select(itm=>new { InvGroupNum=itm.Key.InvGroupNum,
LU=itm.Key.LU,
Price=itm.Key.Price,Amt=Math.Round(itm.Sum(k=>k.Qty)*itm.Key.Price,2) ,
Qty= itm.Sum(k => k.Qty) })
.ToList();
var invbill=new INVOICE_GRP();
// return true;
foreach (var obj in detailDtos)
{
new INVOICE_WAIT_DETAIL(
guid: GuidGenerator.Create(),
version:main.Version,
invbillNum: key,
invGroupNum: obj.InvGroupNum,
lU: obj.LU,
qty: obj.Qty,
bussiessType: EnumBusinessType.BBAC,
amt: obj.Amt,
pRICE:obj.Price,
extend1: string.Empty, extend2: string.Empty, extend3: string.Empty, extend4: string.Empty
);
}
foreach (var groupnum in ls)
{
}
}
}
return ApplicationConsts.SuccessStr;
} }
//private Dictionary<string, decimal> GenerateInvoice(Dictionary<string, decimal> p_dic)
//{
// string invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("INV");
// List<string> invoiceGroupNumList = new List<string>();//每个发票对应的结算分组号
// List<string> List = new List<string>();
// decimal sum = p_dic.Value;//初始分组合计金额
// List<string> luList = dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU).Distinct().ToList(); //初始LU种类
// foreach (var _itm1 in copyDic)
// {
// if (itm.Key == _itm1.Key)//相同结算分组项不计算
// {
// invoiceGroupNumList.Add(itm.Key);
// continue;
// }
// var grouplist = dtos.Where(p => p.GroupNum == _itm1.Key).Select(p => p.LU).Distinct().ToList();//每项LU种类
// luList.AddRange(grouplist);
// luList = luList.Distinct().ToList();
// if (luList.Count > 20)//累加零件不超过20种
// {
// continue;
// }
// if (sum > 10000000)
// {
// break;
// }
// sum += _itm1.Value;
// invoiceGroupNumList.Add(_itm1.Key);//所有条件都满足添加发票和结算分组对应关系
// }
// foreach (var rem in invoiceGroupNumList)//移除
// {
// copyDic.Remove(rem);
// }
// return
//}
} }
} }

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

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using System; using System;
@ -18,7 +18,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// BBAC寄售库库存扣减审批 /// BBAC寄售库库存扣减审批
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/bbac_pd_service")] [Route("api/settleaccount/[controller]/[action]")]
public class BBAC_PD_SERVICE : PD_SERVICE<BBAC_PD, BBAC_PD_DTO, public class BBAC_PD_SERVICE : PD_SERVICE<BBAC_PD, BBAC_PD_DTO,
BBAC_PD_DETAIL, BBAC_PD_DETAIL_DTO, BBAC_PD_REQ_DTO, BBAC_PD_DETAIL, BBAC_PD_DETAIL_DTO, BBAC_PD_REQ_DTO,
BBAC_PD_DETAIL_REQ_DTO, BBAC_PD_DETAIL_EXP_DTO> BBAC_PD_DETAIL_REQ_DTO, BBAC_PD_DETAIL_EXP_DTO>

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

@ -15,7 +15,7 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/hbpo_ba_service")] [Route("api/settleaccount/[controller]/[action]")]
public class HBPO_BA_SERVICE : BA_SERVICE public class HBPO_BA_SERVICE : BA_SERVICE
{ {
public HBPO_BA_SERVICE(INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService, CAN_SA_MNG<PUB_CAN_SA, PUB_CAN_SA_DETAIL> pubMng, CAN_SA_MNG<BBAC_CAN_SA, BBAC_CAN_SA_DETAIL> bbacMng, CAN_SA_MNG<HBPO_CAN_SA, HBPO_CAN_SA_DETAIL> hbpoMng, INV_MNG invMng) : base(repository, wRepository, sRepository, mRepository, excelImportService, pubMng, bbacMng, hbpoMng, invMng) public HBPO_BA_SERVICE(INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService, CAN_SA_MNG<PUB_CAN_SA, PUB_CAN_SA_DETAIL> pubMng, CAN_SA_MNG<BBAC_CAN_SA, BBAC_CAN_SA_DETAIL> bbacMng, CAN_SA_MNG<HBPO_CAN_SA, HBPO_CAN_SA_DETAIL> hbpoMng, INV_MNG invMng) : base(repository, wRepository, sRepository, mRepository, excelImportService, pubMng, bbacMng, hbpoMng, invMng)

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

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
@ -12,6 +12,7 @@ using Volo.Abp.Application.Services;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
@ -33,7 +34,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
HBPO_CAN_SA_DETAIL_EXP_DTO HBPO_CAN_SA_DETAIL_EXP_DTO
> >
{ {
protected HBPO_CAN_SA_SERVICE(INormalEfCoreRepository<HBPO_CAN_SA, Guid> repository, IExcelImportAppService excelImportService, INormalEfCoreRepository<HBPO_CAN_SA_DETAIL, Guid> detailRepository) : base(repository, excelImportService, detailRepository) public HBPO_CAN_SA_SERVICE(INormalEfCoreRepository<HBPO_CAN_SA, Guid> repository, IExcelImportAppService excelImportService, INormalEfCoreRepository<HBPO_CAN_SA_DETAIL, Guid> detailRepository, INV_MNG invmng) : base(repository, excelImportService, detailRepository, invmng)
{ {
} }
} }

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

@ -44,6 +44,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
state: SettleBillState., state: SettleBillState.,
invGroupNum: billNum, invGroupNum: billNum,
site:entitys.FirstOrDefault().Site site:entitys.FirstOrDefault().Site
); );
List<HBPO_CAN_SA_DETAIL> ls = new List<HBPO_CAN_SA_DETAIL>(); List<HBPO_CAN_SA_DETAIL> ls = new List<HBPO_CAN_SA_DETAIL>();

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

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using System; using System;
@ -16,7 +16,7 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/hbpo_pd_service")] [Route("api/settleaccount/[controller]/[action]")]
public class HBPO_PD_SERVICE : PD_SERVICE<HBPO_PD, HBPO_PD_DTO, public class HBPO_PD_SERVICE : PD_SERVICE<HBPO_PD, HBPO_PD_DTO,
HBPO_PD_DETAIL, HBPO_PD_DETAIL_DTO, HBPO_PD_REQ_DTO, HBPO_PD_DETAIL, HBPO_PD_DETAIL_DTO, HBPO_PD_REQ_DTO,
HBPO_PD_DETAIL_REQ_DTO, HBPO_PD_DETAIL_EXP_DTO> HBPO_PD_DETAIL_REQ_DTO, HBPO_PD_DETAIL_EXP_DTO>

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

@ -68,7 +68,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
await _invMng.SetForwardState(inv, InvoiceBillState.); await _invMng.SetForwardState(inv, SettleBillState.);

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

@ -15,7 +15,7 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/pub_ba_service")] [Route("api/settleaccount/[controller]/[action]")]
public class PUB_BA_SERVICE : BA_SERVICE public class PUB_BA_SERVICE : BA_SERVICE
{ {
public PUB_BA_SERVICE(INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService, CAN_SA_MNG<PUB_CAN_SA, PUB_CAN_SA_DETAIL> pubMng, CAN_SA_MNG<BBAC_CAN_SA, BBAC_CAN_SA_DETAIL> bbacMng, CAN_SA_MNG<HBPO_CAN_SA, HBPO_CAN_SA_DETAIL> hbpoMng, INV_MNG invMng) : base(repository, wRepository, sRepository, mRepository, excelImportService, pubMng, bbacMng, hbpoMng, invMng) public PUB_BA_SERVICE(INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService, CAN_SA_MNG<PUB_CAN_SA, PUB_CAN_SA_DETAIL> pubMng, CAN_SA_MNG<BBAC_CAN_SA, BBAC_CAN_SA_DETAIL> bbacMng, CAN_SA_MNG<HBPO_CAN_SA, HBPO_CAN_SA_DETAIL> hbpoMng, INV_MNG invMng) : base(repository, wRepository, sRepository, mRepository, excelImportService, pubMng, bbacMng, hbpoMng, invMng)

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

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
@ -12,6 +12,7 @@ using Volo.Abp.Application.Services;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
@ -33,7 +34,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
PUB_CAN_SA_DETAIL_EXP_DTO PUB_CAN_SA_DETAIL_EXP_DTO
> >
{ {
protected PUB_CAN_SA_SERVICE(INormalEfCoreRepository<PUB_CAN_SA, Guid> repository, IExcelImportAppService excelImportService, INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> detailRepository) : base(repository, excelImportService, detailRepository) public PUB_CAN_SA_SERVICE(INormalEfCoreRepository<PUB_CAN_SA, Guid> repository, IExcelImportAppService excelImportService, INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> detailRepository, INV_MNG invmng) : base(repository, excelImportService, detailRepository, invmng)
{ {
} }
} }

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

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using System; using System;
@ -16,7 +16,7 @@ using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/pub_pd_service")] [Route("api/settleaccount/[controller]/[action]")]
public class PUB_PD_SERVICE : PD_SERVICE<PUB_PD, PUB_PD_DTO, public class PUB_PD_SERVICE : PD_SERVICE<PUB_PD, PUB_PD_DTO,
PUB_PD_DETAIL, PUB_PD_DETAIL_DTO, PUB_PD_REQ_DTO, PUB_PD_DETAIL, PUB_PD_DETAIL_DTO, PUB_PD_REQ_DTO,
PUB_PD_DETAIL_REQ_DTO, PUB_PD_DETAIL_EXP_DTO> PUB_PD_DETAIL_REQ_DTO, PUB_PD_DETAIL_EXP_DTO>

12
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs

@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.Domain.Entities.Auditing;
using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount;
@ -33,9 +33,14 @@ public class INVOICE_GRP : FullAuditedAggregateRoot<Guid>
[Display(Name = "状态")] [Display(Name = "状态")]
public InvoiceBillState State { get; set; } public SettleBillState State { get; set; }
public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, string invGroupNum, string fileName, EnumBusinessType businessType, InvoiceBillState state) [Display(Name = "发票状态")]
public InvoiceBillState InvoiceState { get; set; }
public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, string invGroupNum, string fileName, EnumBusinessType businessType, SettleBillState state,InvoiceBillState invoiceBillState)
{ {
Id= guid; Id= guid;
RealnvBillNum = realnvBillNum; RealnvBillNum = realnvBillNum;
@ -46,6 +51,7 @@ public class INVOICE_GRP : FullAuditedAggregateRoot<Guid>
FileName = fileName; FileName = fileName;
BusinessType = businessType; BusinessType = businessType;
State = state; State = state;
InvoiceState = invoiceBillState;
} }

7
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs

@ -1,6 +1,7 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.Domain.Entities.Auditing;
using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ; namespace SettleAccount.Domain.BQ;
@ -32,7 +33,7 @@ public class INVOICE_WAIT_DETAIL :FullAuditedAggregateRoot<Guid>
/// 1、BBAC-JIS 2、HBPO-JIS 3、JIT 4、备件 5、印度件 /// 1、BBAC-JIS 2、HBPO-JIS 3、JIT 4、备件 5、印度件
/// </summary> /// </summary>
[Display(Name = "业务分类")] [Display(Name = "业务分类")]
public string BussiessType { get; set; } = null!; public EnumBusinessType BussiessType { get; set; }
[Display(Name = "扩展字段1")] [Display(Name = "扩展字段1")]
public string Extend1 { get; set; } = null!; public string Extend1 { get; set; } = null!;
@ -46,7 +47,7 @@ public class INVOICE_WAIT_DETAIL :FullAuditedAggregateRoot<Guid>
[Display(Name = "扩展字段4")] [Display(Name = "扩展字段4")]
public string Extend4 { get; set; } = null!; public string Extend4 { get; set; } = null!;
public INVOICE_WAIT_DETAIL(Guid guid, int version, string invbillNum, string invGroupNum, string lU, decimal pRICE, decimal qty, decimal amt, string bussiessType, string extend1, string extend2, string extend3, string extend4) public INVOICE_WAIT_DETAIL(Guid guid, int version, string invbillNum, string invGroupNum, string lU, decimal pRICE, decimal qty, decimal amt, EnumBusinessType bussiessType, string extend1, string extend2, string extend3, string extend4)
{ {
Id = guid; Id = guid;
Version = version; Version = version;

90
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/CAN_SA_MNG.cs

@ -45,15 +45,23 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
/// <summary>
/// 向前流程
/// </summary>
/// <param name="p_billNum"></param>
/// <param name="state"></param>
/// <returns></returns>
/// <exception cref="BusinessException"></exception>
public virtual async Task<bool> SetForwardState(string p_billNum, SettleBillState state) public virtual async Task<bool> SetForwardState(string p_billNum, SettleBillState state)
{ {
var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList();
if (ls != null && ls.Count > 0)
{
throw new BusinessException("8989", string.Format("不存在编号为{0}",p_billNum));
}
foreach (TEntity p_entiy in ls) foreach (TEntity p_entiy in ls)
{ {
switch (p_entiy.State) switch (p_entiy.State)
{ {
case SettleBillState.: case SettleBillState.:
@ -108,12 +116,86 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
break; break;
} }
await _repository.UpdateAsync(p_entiy); await _repository.UpdateAsync(p_entiy);
return true;
}
return false;
} }
/// <summary>
/// 向后流程
/// </summary>
/// <param name="p_billNum"></param>
/// <param name="state"></param>
/// <returns></returns>
/// <exception cref="BusinessException"></exception>
public virtual async Task<bool> SetBackwardState(string p_billNum, SettleBillState state)
{
var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList();
if (ls != null && ls.Count > 0)
{
throw new BusinessException("8989", string.Format("不存在发票分组号为{0}的可结算单", p_billNum));
}
foreach (TEntity p_entiy in ls)
{
switch (p_entiy.State)
{
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【财务已审核】,无法设置成【商务已审核】状态");
}
break;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【商务已审核】状态,无法设置成【已开票】");
}
break;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【未结状态】");
}
break;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是[财务已审核],无法设置成【财务已审核客户收票】状态");
}
break;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是[客户已收票],无法设置成【财务已审核】状态");
}
break;
}
await _repository.UpdateAsync(p_entiy);
return true; return true;
} }
return false;
}
public virtual async Task<bool> SetNewState(TEntity p_entiy) public virtual async Task<bool> SetNewState(TEntity p_entiy)

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

@ -11,6 +11,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services; using Volo.Abp.Domain.Services;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -55,7 +56,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
_hbpoMng = hbpoMng; _hbpoMng = hbpoMng;
} }
public virtual async Task<bool> SetForwardState(string p_groupBillnum , InvoiceBillState p_State) public virtual async Task<bool> SetForwardState(string p_groupBillnum , SettleBillState p_State)
{ {
var _first=_repository.Where(p => p.InvbillNum == p_groupBillnum).FirstOrDefault(); var _first=_repository.Where(p => p.InvbillNum == p_groupBillnum).FirstOrDefault();
if (_first != null) if (_first != null)
@ -66,14 +67,177 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
private async Task<bool> SetSettleState(INVOICE_GRP p_entiy, SettleBillState p_State,bool IsForward=true)
{
if (p_entiy.BusinessType == EnumBusinessType.BeiJian ||
p_entiy.BusinessType == EnumBusinessType.YingDuJian ||
p_entiy.BusinessType == EnumBusinessType.MaiDanJian ||
p_entiy.BusinessType == EnumBusinessType.ZhiGongJian
)
{
bool isSucc = false;
if (IsForward == true)
{
isSucc = await _pubMng.SetForwardState(p_entiy.InvGroupNum, p_State);
}
else
{
isSucc = await _pubMng.SetBackwardState(p_entiy.InvGroupNum, p_State);
}
return isSucc;
}
else if (p_entiy.BusinessType == EnumBusinessType.BBAC)
{
bool isSucc = false;
if (IsForward == true)
{
isSucc = await _bbacMng.SetForwardState(p_entiy.InvGroupNum, p_State);
}
else
{
isSucc = await _bbacMng.SetBackwardState(p_entiy.InvGroupNum, p_State);
}
//switch ((int)p_State)
//{
// case (int)SettleBillState.财务已审核:
// if (IsForward == true)
// {
// isSucc = await _bbacMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.财务已审核);
// }
// else
// {
// isSucc = await _bbacMng.SetBackwardState(p_entiy.InvGroupNum, SettleBillState.财务已审核);
// }
// break;
// case (int)SettleBillState.商务已审核:
// if (IsForward == true)
// {
// isSucc = await _bbacMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.商务已审核);
// }
// else
// {
// isSucc = await _bbacMng.SetBackwardState(p_entiy.InvGroupNum, SettleBillState.商务已审核);
// }
// break;
// case (int)SettleBillState.已开票:
// if (IsForward == true)
// {
// isSucc = await _bbacMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.已开票);
// }
// else
// {
// isSucc = await _bbacMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.已开票);
// }
// break;
// case (int)SettleBillState.客户已收票:
// if (IsForward == true)
// {
// isSucc = await _bbacMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.客户已收票);
// }
// else
// {
// isSucc = await _bbacMng.SetBackwardState(p_entiy.InvGroupNum, SettleBillState.客户已收票);
// }
// break;
// case (int)SettleBillState.已扣减:
// if (IsForward == true)
// {
// isSucc = await _bbacMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.已扣减);
// }
// else
// {
// isSucc = await _bbacMng.SetBackwardState(p_entiy.InvGroupNum, SettleBillState.已扣减);
// }
// break;
//}
return isSucc;
}
else if (p_entiy.BusinessType == EnumBusinessType.HBPO)
{
bool isSucc = false;
public virtual async Task<bool> SetForwardState(INVOICE_GRP p_entiy, InvoiceBillState p_State) if (IsForward == true)
{
isSucc = await _hbpoMng.SetForwardState(p_entiy.InvGroupNum, p_State);
}
else
{
isSucc = await _hbpoMng.SetBackwardState(p_entiy.InvGroupNum, p_State);
}
//switch ((int)p_State)
//{
// case (int)SettleBillState.财务已审核:
// if (IsForward == true)
// {
// isSucc = await _hbpoMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.财务已审核);
// }
// else
// {
// isSucc = await _hbpoMng.SetBackwardState(p_entiy.InvGroupNum, SettleBillState.财务已审核);
// }
// break;
// case (int)SettleBillState.商务已审核:
// if (IsForward == true)
// {
// isSucc = await _hbpoMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.商务已审核);
// }
// else
// {
// isSucc = await _hbpoMng.SetBackwardState(p_entiy.InvGroupNum, SettleBillState.商务已审核);
// }
// break;
// case (int)SettleBillState.已开票:
// if (IsForward == true)
// {
// isSucc = await _hbpoMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.已开票);
// }
// else
// {
// isSucc = await _hbpoMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.已开票);
// }
// break;
// case (int)SettleBillState.客户已收票:
// if (IsForward == true)
// {
// isSucc = await _hbpoMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.客户已收票);
// }
// else
// {
// isSucc = await _hbpoMng.SetBackwardState(p_entiy.InvGroupNum, SettleBillState.客户已收票);
// }
// break;
// case (int)SettleBillState.已扣减:
// if (IsForward == true)
// {
// isSucc = await _hbpoMng.SetForwardState(p_entiy.InvGroupNum, SettleBillState.已扣减);
// }
// else
// {
// isSucc = await _hbpoMng.SetBackwardState(p_entiy.InvGroupNum, SettleBillState.已扣减);
// }
// break;
//}
return isSucc;
}
return false;
}
/// <summary>
/// 向前流程
/// </summary>
/// <param name="p_entiy"></param>
/// <param name="p_State"></param>
/// <returns></returns>
/// <exception cref="BusinessException"></exception>
public virtual async Task<bool> SetForwardState(INVOICE_GRP p_entiy, SettleBillState p_State)
{ {
var state = p_State; var state = p_State;
switch (p_entiy.State) switch (p_entiy.State)
{ {
case InvoiceBillState.: case SettleBillState.:
if (state == InvoiceBillState.) if (state == SettleBillState.)
{ {
p_entiy.State = state; p_entiy.State = state;
} }
@ -82,8 +246,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态");
} }
break; break;
case InvoiceBillState.: case SettleBillState.:
if (state == InvoiceBillState.) if (state == SettleBillState.)
{ {
p_entiy.State = state; p_entiy.State = state;
} }
@ -92,8 +256,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】"); throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】");
} }
break; break;
case InvoiceBillState.: case SettleBillState.:
if (state == InvoiceBillState.) if (state == SettleBillState.)
{ {
p_entiy.State = state; p_entiy.State = state;
} }
@ -103,12 +267,79 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
break; break;
} }
var flag= await SetSettleState(p_entiy, p_State,true);
if (flag == true)
{
await _repository.UpdateAsync(p_entiy);
return false;
}
return false;
}
/// <summary>
/// 向后流程
/// </summary>
/// <param name="p_entiy"></param>
/// <param name="p_State"></param>
/// <returns></returns>
/// <exception cref="BusinessException"></exception>
public virtual async Task<bool> SetBackwardState(INVOICE_GRP p_entiy, SettleBillState p_State)
{
var state = p_State;
switch (p_entiy.State)
{
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【财务已审核】,无法设置成【商务已审核】状态");
}
break;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【商务已审核】状态,无法设置成【已开票】");
}
break;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【已扣减】状态,无法设置成【客户已收票】状态");
}
break;
}
var flag = await SetSettleState(p_entiy, p_State,false);
if (flag == false)
{
return false;
}
await _repository.UpdateAsync(p_entiy); await _repository.UpdateAsync(p_entiy);
return true; return true;
} }
/// <summary> /// <summary>
/// 获得发票主表 /// 获得发票主表
/// </summary> /// </summary>
@ -304,8 +535,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
foreach (var p_entity in _ls) foreach (var p_entity in _ls)
{ {
if (p_entity.State == InvoiceBillState. if (p_entity.State == SettleBillState.
|| p_entity.State == InvoiceBillState. || p_entity.State == InvoiceBillState.) || p_entity.State == SettleBillState. || p_entity.State == SettleBillState.)
{ {
var entList = _repository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); var entList = _repository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList();
var groupList = _groupRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); var groupList = _groupRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList();
@ -325,7 +556,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
if (p_entity.State == InvoiceBillState.) if (p_entity.State == SettleBillState.)
{ {
} }
@ -349,7 +580,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// </summary> /// </summary>
/// <param name="billNum"></param> /// <param name="billNum"></param>
/// <returns></returns> /// <returns></returns>
public virtual async Task<bool> Back(string billNum) public virtual async Task<bool> BackAsync(string billNum)
{ {
var _ls = await _repository.Where(p => p.InvGroupNum == billNum).ToListAsync(); var _ls = await _repository.Where(p => p.InvGroupNum == billNum).ToListAsync();

44
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PD_MNG.cs

@ -3,8 +3,50 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using SettleAccount.Bases;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Managers; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers;
public class PD_MNG public class PD_MNG<TEntity,TEntityDetail>:DomainService
where TEntity : PD_BASE_MAIN
where TEntityDetail : PD_BASE
{ {
private readonly INormalEfCoreRepository<TEntity, Guid> _repository;
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
protected PD_MNG(
INormalEfCoreRepository<TEntity, Guid> repository,
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_repository = repository;
_detailRepository = detailRepository;
}
public virtual async Task<TEntity> GetMainAsync(string billNum)
{
return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync();
}
public virtual async Task<List<TEntityDetail>> GetDetailAsync(string billNum)
{
return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync();
}
} }

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

@ -1,35 +1,56 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiBalance : Entity<Guid> public class VmiBalance : Entity<Guid>
{ {
/// <summary> [Display(Name = "Erp目标库位", Description = "Key")]
/// LU零件号:BBAC发运单BBAC_SE_DETAIL.LU public string ErpToLoc { get; set; }
/// </summary>
[Display(Name = "LU零件号", Description = "Key")]
public string LU { get; set; } public string LU { get; set; }
/// <summary> [Display(Name = "客户零件号")]
/// 生产码:BBAC发运单BBAC_SE_DETAIL.PN public string PartCode { get; set; }
/// </summary>
public string PN { get; set; } [Display(Name = "生产码", Description = "Key")]
public string VinCode { get; set; }
/// <summary> [Display(Name = "生产码类型")]
/// 生产码类型(01前保、02后保、03门槛等) public string CodeType { get; set; }
/// </summary>
public int PNType { get; set; }
/// <summary> [Display(Name = "发货类型")]
/// 发货类型??? public string ProType { get; set; }
/// </summary>
public string Type { get; set; }
/// <summary> [Display(Name = "数量")]
/// 数量
/// </summary>
public decimal Qty { get; set; } public decimal Qty { get; set; }
[Display(Name = "发运日期")]
public DateTime ShippingDate { get; set; }
[Display(Name = "订单日期")]
public DateTime CreationTime { get; set; }
[Display(Name = "EDI顺序号")]
public string SeqNumber { get; set; }
[Display(Name = "客户订单号")]
public string Tmpe4 { 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 Desc { get; set; }
public List<VmiLog> Logs { get; set; } = new List<VmiLog>(); public List<VmiLog> Logs { get; set; } = new List<VmiLog>();
} }

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

@ -16,6 +16,9 @@ public class VmiLog : Entity<Guid>
/// </summary> /// </summary>
public string SessionId { get; set; } public string SessionId { get; set; }
public string OrderNumber { get; set; }
public DateTime CreatedDate { get; set; } = DateTime.Now;
public string CreatedBy { get; set; }
public VmiOperatorType Type { get; set; } public VmiOperatorType Type { get; set; }
public VmiCategory Category { get; set; } public VmiCategory Category { get; set; }
public VmiBalance Balance { get; set; } public VmiBalance Balance { get; set; }

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

@ -59,6 +59,7 @@ namespace Win.Sfs.SettleAccount
#endregion 基础数据 #endregion 基础数据
#region 北汽结算 #region 北汽结算
builder.ConfigureTaskJob(options); builder.ConfigureTaskJob(options);
builder.ConfigureBBAC_CAN_SA(options); builder.ConfigureBBAC_CAN_SA(options);
builder.ConfigureBBAC_CAN_SA_DETAIL(options); builder.ConfigureBBAC_CAN_SA_DETAIL(options);
@ -1114,7 +1115,7 @@ namespace Win.Sfs.SettleAccount
{ {
b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema); b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasAlternateKey(o => new { o.PN, o.LU }); b.HasAlternateKey(o => new { o.ErpToLoc, o.PartCode, o.LU });
}); });
builder.Entity<VmiLog>(b => builder.Entity<VmiLog>(b =>

4411
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230720012742_vmi2.Designer.cs

File diff suppressed because it is too large

227
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230720012742_vmi2.cs

@ -0,0 +1,227 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropUniqueConstraint(
name: "AK_Set_VmiBalance_PN_LU",
table: "Set_VmiBalance");
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6efe1947-a242-4d20-b633-20b0f716a782"));
migrationBuilder.DropColumn(
name: "PNType",
table: "Set_VmiBalance");
migrationBuilder.RenameColumn(
name: "Type",
table: "Set_VmiBalance",
newName: "VinCode");
migrationBuilder.RenameColumn(
name: "PN",
table: "Set_VmiBalance",
newName: "PartCode");
migrationBuilder.AddColumn<string>(
name: "CreatedBy",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "CreatedDate",
table: "Set_VmiLog",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<string>(
name: "OrderNumber",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CodeType",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "CreationTime",
table: "Set_VmiBalance",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<string>(
name: "Desc",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ErpToLoc",
table: "Set_VmiBalance",
type: "nvarchar(450)",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "MatchNumber",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PjsNum",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ProType",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SeqNumber",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "ShippingDate",
table: "Set_VmiBalance",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<string>(
name: "Tmpe4",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "UniqueCode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddUniqueConstraint(
name: "AK_Set_VmiBalance_ErpToLoc_PartCode_LU",
table: "Set_VmiBalance",
columns: new[] { "ErpToLoc", "PartCode", "LU" });
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("579e2b8d-c9ec-4754-9520-e4475aea2a73"), null, "0 0 8 26 *", false, "库存快照", "Win.Sfs.SettleAccount.Entities.BQ.VmiService" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropUniqueConstraint(
name: "AK_Set_VmiBalance_ErpToLoc_PartCode_LU",
table: "Set_VmiBalance");
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("579e2b8d-c9ec-4754-9520-e4475aea2a73"));
migrationBuilder.DropColumn(
name: "CreatedBy",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CreatedDate",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "OrderNumber",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CodeType",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "CreationTime",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "Desc",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "ErpToLoc",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "MatchNumber",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "PjsNum",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "ProType",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "SeqNumber",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "ShippingDate",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "Tmpe4",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "UniqueCode",
table: "Set_VmiBalance");
migrationBuilder.RenameColumn(
name: "VinCode",
table: "Set_VmiBalance",
newName: "Type");
migrationBuilder.RenameColumn(
name: "PartCode",
table: "Set_VmiBalance",
newName: "PN");
migrationBuilder.AddColumn<int>(
name: "PNType",
table: "Set_VmiBalance",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddUniqueConstraint(
name: "AK_Set_VmiBalance_PN_LU",
table: "Set_VmiBalance",
columns: new[] { "PN", "LU" });
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("6efe1947-a242-4d20-b633-20b0f716a782"), null, "0 0 8 26 *", false, "库存快照", "Win.Sfs.SettleAccount.Entities.BQ.VmiService" });
}
}
}

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

@ -3319,7 +3319,7 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasData( b.HasData(
new new
{ {
Id = new Guid("6efe1947-a242-4d20-b633-20b0f716a782"), Id = new Guid("579e2b8d-c9ec-4754-9520-e4475aea2a73"),
Cron = "0 0 8 26 *", Cron = "0 0 8 26 *",
IsRunning = false, IsRunning = false,
Name = "库存快照", Name = "库存快照",
@ -3361,26 +3361,57 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
b.Property<string>("Desc")
.HasColumnType("nvarchar(max)");
b.Property<string>("ErpToLoc")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("LU") b.Property<string>("LU")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("nvarchar(450)");
b.Property<string>("PN") b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("PartCode")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("nvarchar(450)");
b.Property<int>("PNType") b.Property<string>("PjsNum")
.HasColumnType("int"); .HasColumnType("nvarchar(max)");
b.Property<string>("ProType")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Qty") b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");
b.Property<string>("Type") b.Property<string>("SeqNumber")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("ShippingDate")
.HasColumnType("datetime2");
b.Property<string>("Tmpe4")
.HasColumnType("nvarchar(max)");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("VinCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");
b.HasAlternateKey("PN", "LU"); b.HasAlternateKey("ErpToLoc", "PartCode", "LU");
b.ToTable("Set_VmiBalance"); b.ToTable("Set_VmiBalance");
}); });
@ -3424,6 +3455,15 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<Guid>("CategoryId") b.Property<Guid>("CategoryId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime2");
b.Property<string>("OrderNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("SessionId") b.Property<string>("SessionId")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");

Loading…
Cancel
Save