mahao 1 year ago
parent
commit
7b8d8efdb1
  1. 39
      code/WebApp/vanilla/components/form/form-input.js
  2. 10
      code/WebApp/vanilla/components/form/index.js
  3. 354
      code/WebApp/vanilla/components/list/index.js
  4. 137
      code/WebApp/vanilla/models/centralized-control.js
  5. 38
      code/WebApp/vanilla/models/code-setting.js
  6. 12
      code/WebApp/vanilla/request/index.js
  7. 112
      code/WebApp/vanilla/router/routes.js
  8. 27
      code/WebApp/vanilla/views/base-data/centralized-control.js
  9. 13
      code/WebApp/vanilla/views/base-data/code-setting.js
  10. 4
      code/WebApp/vanilla/views/login.js
  11. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  12. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  13. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  14. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  15. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs
  16. 155
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  17. 37
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  18. 0
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs
  19. 41
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs
  20. 34
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs
  21. 34
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs
  22. 97
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/CAN_SA_MNG.cs
  23. 42
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/NOT_SA_MNG.cs
  24. 56
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreRepository.cs
  25. 8
      docs/demo/src/WTA.Application/Identity/Data/IdentityDbSeed.cs
  26. 4
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/BBAC_CAN_SA.cs
  27. 4
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/BBAC_SA.cs
  28. 19
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/BBAC_SE_SA_REPORT.cs
  29. 4
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/HBPO_SE_DETAIL.cs
  30. 2
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/HBPO_SE_EDI.cs
  31. 3
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/HBPO_SE_SA_REPORT.cs
  32. 4
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/PUB_CAN_SA.cs
  33. 8
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/PUB_SE_DETAIL.cs
  34. 1
      docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/TB_RePartsRelationship.cs
  35. BIN
      docs/ui.rp

39
code/WebApp/vanilla/components/form/form-input.js

@ -2,14 +2,16 @@ import html from "html";
import { ref, reactive, watch, onMounted } from "vue";
import { dayjs } from "element-plus";
import request, { post } from "../../request/index.js";
import { importFunction } from "../../utils/index.js";
export default {
template: html`
<template v-if="getDisabled()">
<template v-if="model[prop]!==null">
<el-switch disabled v-model="model[prop]" type="checked" v-if="schema.type==='boolean'" />
<template v-else-if="schema.input==='datetime'">{{dayjs(model[prop]).format('YYYY-MM-DD HH:mm:ss')}}</template>
<template v-else-if="schema.input==='year'">{{dayjs(model[prop]).format('YYYY')}}</template>
<template v-else-if="schema.input==='date'">{{dayjs(model[prop]).format('YYYY-MM-DD')}}</template>
<template v-else-if="schema.input==='datetime'">{{dayjs(model[prop]).format('YYYY-MM-DD HH:mm:ss')}}</template>
<template v-else-if="schema.input==='password'">******</template>
<template v-else>{{model[prop]}}</template>
</template>
@ -27,21 +29,24 @@ export default {
<el-option v-for="item in options" :key="item.key" :label="item.label" :value="item.value" />
</el-select>
</template>
<template v-if="getInput(schema)==='month'">
<el-date-picker v-model="model[prop]" :type="schema.input" :value-format="schema.format" />
</template>
<el-input
:disabled="getDisabled()"
:placeholder="schema.title"
v-model="model[prop]"
type="number"
v-else-if="schema.type==='number'"
v-else-if="getInput(schema)==='number'"
/>
<el-input-number
:disabled="getDisabled()"
:placeholder="schema.title"
v-model="model[prop]"
:precision="0"
v-else-if="schema.type==='integer'"
v-else-if="getInput(schema)==='integer'"
/>
<template v-else-if="schema.type==='boolean'">
<template v-else-if="getInput(schema)==='boolean'">
<el-select :disabled="getDisabled()" v-model="model[prop]" :placeholder="schema.title" v-if="schema.nullable">
<el-option prop="select" value="" :label="$t('select')" />
<el-option prop="true" :value="true" :label="$t('true')" />
@ -51,6 +56,7 @@ export default {
</template>
<template v-else>
<el-input
clearable
:disabled="getDisabled()"
:placeholder="schema.title"
v-model="model[prop]"
@ -58,7 +64,14 @@ export default {
show-password
v-if="schema.input==='password'"
/>
<el-input :disabled="getDisabled()" :placeholder="schema.title" v-model="model[prop]" type="text" v-else />
<el-input
clearable
:disabled="getDisabled()"
:placeholder="schema.title"
v-model="model[prop]"
:type="schema.input??'text'"
v-else
/>
</template>
</template>
`,
@ -87,6 +100,22 @@ export default {
const selectProps = ref({});
const selectValues = ref([]);
const options = ref([]);
//watch
watch(
() => model[props.prop],
async (value) => {
if (props.schema.watch) {
console.log(value);
if (props.schema.watch?.constructor === String) {
props.schema.watch = await importFunction(props.schema.watch);
}
if (props.schema.watch?.constructor === Function) {
props.schema.watch(model, value);
}
}
}
);
onMounted(async () => {
if (props.schema.options) {
options.value = props.schema.options;

10
code/WebApp/vanilla/components/form/index.js

@ -5,7 +5,7 @@ export default {
components: { AppFormItem: defineAsyncComponent(() => import("./form-item.js")) },
name: "AppForm",
template: html`<div v-loading="loading">
<el-form ref="formRef" :model="model" label-width="auto">
<el-form ref="formRef" :model="model" label-width="auto" :inline="inline">
<template v-for="(value, prop) in schema.properties">
<app-form-item
:parentSchema="schema"
@ -16,14 +16,16 @@ export default {
:errors="errors"
/>
</template>
<slot name="items"></slot>
<slot></slot>
<el-form-item v-if="!hideButton">
<template #label></template>
<el-button type="primary" @click="submit" :disabled="loading"><slot>$t('confirm')</slot></el-button>
<el-button type="primary" @click="submit" :disabled="loading">
<slot name="submitText">$t('confirm')</slot>
</el-button>
</el-form-item>
</el-form>
</div>`,
props: ["modelValue", "schema", "action", "hideButton", "isQueryForm", "mode"],
props: ["modelValue", "inline", "schema", "action", "hideButton", "isQueryForm", "mode"],
emits: ["update:modelValue", "submit"],
setup(props, context) {
// init

354
code/WebApp/vanilla/components/list/index.js

@ -1,5 +1,5 @@
import html, { getProp } from "html";
import request, { get, post } from "../../request/index.js";
import request, { get, getUrl, post } from "../../request/index.js";
import { defineAsyncComponent, ref, reactive, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
@ -14,6 +14,7 @@ export default {
name: "AppList",
components: {
AppForm: defineAsyncComponent(() => import("../form/index.js")),
AppFormInput: defineAsyncComponent(() => import("../../components/form/form-input.js")),
SvgIcon: defineAsyncComponent(() => import("../../components/icon/index.js")),
AppFormInput: defineAsyncComponent(() => import("../form/form-input.js")),
VueOfficeExcel,
@ -26,13 +27,18 @@ export default {
inline
mode="query"
label-position="left"
:schema="querySchema"
:schema="config.query.schema"
v-model="queryModel"
@submit="load"
:hideButton="true"
:isQueryForm="true"
v-if="querySchema"
/>
>
<template v-for="item in filterList.filter(o=>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>
</app-form>
</el-col>
</el-row>
<el-row style="padding-bottom:20px;">
@ -48,7 +54,7 @@ export default {
<span>{{item.meta.title}}</span>
</el-button>
</template>
<el-button @click="click('filter',selectedRows)">
<el-button @click="click('filter',selectedRows)" v-if="config.query.hasFilter">
<el-icon><ep-filter /></el-icon>
<span>{{$t('筛选')}}</span>
</el-button>
@ -231,23 +237,26 @@ export default {
</el-form>
</template>
<template v-else-if="editFormMode==='import'">
<el-form :model="importModel" inline>
<el-form-item :label="$t('部分成功')">
<el-switch v-model="importModel.partial" />
</el-form-item>
<el-form-item :label="$t('全部替换')">
<el-switch v-model="importModel.replace" />
</el-form-item>
<el-form :model="importModel" style="height:100%;">
<el-form-item :label="$t('导入模板')">
<el-link type="primary" @click="getImportTemplate">{{$t('下载')}}</el-link>
</el-form-item>
<el-form-item :label="$t('文件')">
<el-form-item label="选择工厂" label-width="80px">
<el-select v-model="importModel.version">
<el-option v-for="item in versions" :value="item.value" :label="item.label" />
</el-select>
</el-form-item>
<el-form-item label="选择期间" label-width="80px">
<el-select v-model="importModel.factory">
<el-option v-for="item in versions" :value="item.value" :label="item.label" />
</el-select>
</el-form-item>
<el-form-item :label="$t('文件')" label-width="80px">
<el-upload
ref="uploadRef"
class="upload"
drag
accept=".xlsx"
:disabled="fileList.length===1"
:limit="1"
:auto-upload="false"
:on-change="handleChange"
>
@ -257,37 +266,33 @@ export default {
</el-form>
</template>
<template v-else-if="editFormMode==='filter'">
<el-form :model="queryList" inline class="filter">
<el-row v-for="(item,index) in queryList">
<el-form :model="filterList" inline class="filter">
<el-row v-for="(item,index) in filterList">
<el-col :span="6">
<el-select v-model="item.property" :placeholder="$t('字段')">
<el-option v-for="(value, prop) in querySchema.properties" :value="prop" :label="value.title" />
<el-select clearable :disabled="item.readOnly" v-model="item.column" :placeholder="$t('字段')">
<template v-for="(value, prop) in config.edit.schema.properties">
<el-option
v-if="value.type!=='object'&&value.type!=='array'&&value.input!=='textarea'"
:value="prop"
:label="value.title"
/>
</template>
</el-select>
</el-col>
<el-col :span="6">
<el-select v-model="item.operator" :placeholder="$t('操作符')">
<el-option value="{0}=@0" :label="$t('等于')" />
<el-option value="{0}!=@0" :label="$t('不等于')" />
<el-option value="{0}>@0" :label="$t('大于')" />
<el-option value="{0}>=@0" :label="$t('大于等于')" />
<el-option value="{0}<@0" :label="$t('小于')" />
<el-option value="{0}<=@0" :label="$t('小于等于')" />
<el-option value="{0}.Contains(@0)" :label="$t('包含')" />
<el-option value="{0}.StartsWith(@0)" :label="$t('开始于')" />
<el-option value="{0}.StartsWith(@0)" :label="$t('结束于')" />
<el-col :span="6" v-if="item.column">
<el-select clearable :disabled="item.readOnly" v-model="item.action" :placeholder="$t('操作符')">
<el-option
v-for="item in getOperators(config.edit.schema.properties[item.column])"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-col>
<el-col :span="6">
<el-input v-model="item.value" :placeholder="$t('值')" />
<el-col :span="8" v-if="item.column">
<app-form-input v-model="item" :schema="config.edit.schema.properties[item.column]" prop="value" />
</el-col>
<!-- <el-col :span="4">
<el-select v-model="item.logic" :placeholder="$t('关系')">
<el-option value="and" :label="$t('且')" />
<el-option value="or" :label="$t('或')" />
</el-select>
</el-col> -->
<el-col :span="2">
<el-button circle @click="queryList.splice(index, 1)">
<el-col :span="2" v-if="!item.readOnly&&item.action">
<el-button circle @click="filterList.splice(index, 1)">
<template #icon>
<ep-close />
</template>
@ -296,7 +301,7 @@ export default {
</el-row>
<el-row>
<el-col>
<el-button circle @click="pushQueryList">
<el-button circle @click="pushfilterList">
<template #icon>
<ep-plus />
</template>
@ -322,6 +327,22 @@ export default {
.el-form.filter .el-col {
padding: 5px;
}
dl.upload {
min-height: 100%;
}
dl.upload dt {
font-weight: bold;
line-height: 3em;
}
dl.upload dd {
line-height: 2em;
}
dl.upload .el-form-item {
width: 300px;
}
div.upload {
width: 100%;
}
</style>`,
props: ["modelValue", "config", "querySchema", "controller", "query", "buttons"],
emits: ["command"],
@ -361,7 +382,7 @@ export default {
const queryModel = ref({});
const sortColumns = ref(new Map());
const querySchema = ref(props.querySchema);
const queryList = ref([]);
const filterList = ref([]);
const tableSchema = ref({});
const tableData = ref([]);
const editFormRef = ref(null);
@ -375,12 +396,16 @@ export default {
includeDeleted: false,
});
const importModel = reactive({
partial: true,
replace: false,
// partial: true,
// replace: false,
factory: "",
version: "",
});
const factories = ref([]);
const versions = ref([]);
const fileList = ref([]);
const getSortModel = (model) => {
model.orderBy
(model.sorting ?? "")
.split(",")
.map((o) => o.trim())
.filter((o) => o)
@ -393,7 +418,7 @@ export default {
const getColumns = (schema) => {
Object.keys(schema.properties).forEach((propertyName) => {
const property = schema.properties[propertyName];
if (property.type !== "object" && property.type !== "array" && !property.hidden && property.showForList) {
if (property.showForList || (property.type !== "object" && property.type !== "array" && !property.hidden)) {
columns.value.push({ name: propertyName, title: property.title, checked: true });
}
});
@ -409,39 +434,21 @@ export default {
} else {
sortColumns.value.set(prop, order);
}
queryModel.value.orderBy = Array.from(sortColumns.value)
queryModel.value.sorting = Array.from(sortColumns.value)
.map((o) => capitalize(o[0]) + (o[1] === "ascending" ? "" : ` DESC`))
.join(",");
await load();
};
const showColumn = (item, prop) => {
return (
item.type !== "object" &&
item.type !== "array" &&
!item.hidden &&
columns.value.findIndex((o) => o.name === prop && o.checked) >= 0
);
return columns.value.some((o) => o.name === prop && o.checked);
};
const handleSelectionChange = (rows) => (selectedRows.value = rows);
const load = async () => {
tableLoading.value = true;
try {
const url = config.query.url;
const method = config.query.method;
//
queryModel.value = schemaToModel(config.query.schema);
queryModel.value.maxResultCount = pageModel.pageSize;
queryModel.value.skipCount = (pageModel.pageIndex - 1) * pageModel.pageSize;
//
const postData = JSON.parse(JSON.stringify(queryModel.value));
postData.filters = queryList.value.filter((o) => o.property && o.value);
if (postData.items) {
delete postData["items"];
}
if (postData.query?.id) {
delete postData.query["id"];
}
const postData = buildQuery();
const listData = (await request(url, postData, { method })).data;
const items = listData.items;
if (tableSchema.value.isTree) {
@ -462,8 +469,7 @@ export default {
const click = async (item, rows) => {
editFormloading.value = true;
editFormMode.value = item.path ?? item;
context.emit("command", item, rows);
if (item.path === "index") {
if (item.path === "query") {
//list
await load();
} else if (item.path === "details") {
@ -485,13 +491,39 @@ export default {
editFormTitle.value = `${t(item.path)}${config.edit.schema.title}`;
dialogVisible.value = true;
} else if (item.path === "delete") {
if (!rows.length) {
return;
}
//delete
const url = format(config.edit.deleteUrl, rows[0].id);
if (item.meta.isTop) {
// 批量删除
return;
try {
await ElMessageBox.confirm("删除", "提示", {
type: "warning",
message: format("确认删除选中的%s行数据吗?", rows.length),
});
const response = await request(
url,
rows.map((o) => o.id),
{ method: config.edit.deleteMethod }
);
if (!response.errors) {
ElMessage({
type: "info",
message: "操作完毕",
});
}
} catch (error) {
if (error === "cancel") {
ElMessage({
type: "info",
message: "删除取消",
});
}
}
} else {
// 单个删除
const url = format(config.edit.deleteUrl, rows[0].id);
try {
await ElMessageBox.confirm("删除", "提示", {
type: "warning",
@ -511,7 +543,6 @@ export default {
}
}
}
const url = `${baseUrl}/${item.path}`;
// await post(
// url,
// rows.map((o) => o.id)
@ -519,17 +550,47 @@ export default {
await load();
} else if (item.path === "export") {
//export
editFormTitle.value = `${t(item.path)}${querySchema.value?.title}`;
dialogVisible.value = true;
if ((item.pattern = "paged")) {
const url = config.edit.exportUrl;
const method = config.edit.exportMethod;
const postData = buildQuery();
const response = await request(url, postData, { method });
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
} else {
editFormTitle.value = `${t(item.path)}${querySchema.value?.title}`;
dialogVisible.value = true;
}
} else if (item.path === "import") {
//import
const url = `${baseUrl}/${item.path}`;
editFormTitle.value = `${t(item.path)}${querySchema.value?.title}`;
fileList.value = [];
dialogVisible.value = true;
try {
editFormloading.value = true;
editFormTitle.value = `${t(item.path)}${config.query.schema.title}`;
fileList.value = [];
dialogVisible.value = true;
versions.value = (
await request("settleaccount/centralized-control/get-all", null, { method: "POST" })
).data.items.map((o) => ({
value: o.version,
label: o.version,
}));
factories.value = (
await request("settleaccount/code-setting/get-all", null, { method: "POST" })
).data.items.map((o) => ({
value: o.project,
label: o.project,
}));
} catch (e) {
console.log(e);
} finally {
editFormloading.value = false;
}
} else if (item === "filter") {
editFormTitle.value = t("自定义查询");
dialogVisible.value = true;
} else {
context.emit("command", item, rows, load);
}
editFormloading.value = false;
};
@ -545,10 +606,10 @@ export default {
url = format(url, editFormModel.value.id);
}
const method = editFormMode.value === "create" ? config.edit.createMethod : config.edit.updateMethod;
const result = await request(url, editFormModel.value, { method });
if (result.errors) {
model.errors = result.errors; //??
} else {
const response = await request(url, editFormModel.value, { method });
if (!response.errors) {
ElMessageBox.alert(`错误:${response.errors?.error?.message}`, `代码:${response.errors?.error?.code}`);
//model.errors = response.errors; //??
await load();
editFormMode.value = null;
dialogVisible.value = false;
@ -564,7 +625,7 @@ export default {
editFormMode.value = null;
} else if (editFormMode.value === "export") {
const postData = JSON.parse(JSON.stringify(queryModel.value));
postData.filters = queryList.value.filter((o) => o.property && o.value);
postData.filters = filterList.value.filter((o) => o.property && o.value);
delete postData.query["items"];
delete postData.query["id"];
const url = `${baseUrl}/${editFormMode.value}?${qs.stringify(exportModel)}`;
@ -573,13 +634,14 @@ export default {
dialogVisible.value = false;
} else if (editFormMode.value === "import") {
editFormloading.value = true;
const url = `${baseUrl}/${editFormMode.value}`;
const url = config.edit.importUrl;
const formData = new FormData();
formData.append("partial", importModel.partial);
formData.append("replace", importModel.replace);
formData.append("file", fileList.value[0]?.raw);
console.log(uploadRef.value);
const response = await post(url, formData);
formData.append("version", importModel.version);
formData.append("factory", importModel.factory);
for (let i = 0; i < fileList.value.length; i++) {
formData.append(`files`, fileList.value[i].raw);
}
await post(url, formData);
editFormloading.value = false;
dialogVisible.value = false;
await load();
@ -610,17 +672,8 @@ export default {
subDrawer.value = true;
}
};
const pushQueryList = () => {
queryList.value.push({
property: "",
operator: "{0}=@0",
value: "",
logic: "and",
});
};
const download = (response) => {
const downloadUrl = window.URL.createObjectURL(response.data);
const filename = response.filename;
const download = (url, filename) => {
const downloadUrl = window.URL.createObjectURL(url);
let link = document.createElement("a");
link.href = downloadUrl;
link.download = filename;
@ -630,7 +683,7 @@ export default {
const getImportTemplate = async () => {
const url = `${baseUrl}/${editFormMode.value}`;
const response = await get(url);
download(response);
download(url, response.filename);
};
const handleChange = (uploadFile, uploadFiles) => {
fileList.value = uploadFiles;
@ -642,6 +695,87 @@ export default {
}
return false;
};
const pushfilterList = () => {
filterList.value.push({
logic: "and",
column: "",
action: "equal",
value: null,
});
};
const logic = [
{ value: "and", label: "且" },
{ value: "or", label: "或" },
];
const operators = [
{
value: "equal",
label: "等于",
},
{
value: "notEqual",
label: "不等于",
},
{
value: "biggerThan",
label: "大于",
},
{
value: "smallThan",
label: "小于",
},
{
value: "biggerThanOrEqual",
label: "大于等于",
},
{
value: "smallThanOrEqual",
label: "小于等于",
},
{
value: "like",
label: "类似于",
},
{
value: "notLike",
label: "不类似于",
},
{
value: "in",
label: "包含于",
},
{
value: "notIn",
label: "不包含于",
},
];
const getOperators = (schema) => {
const values = ["equal", "notEqual"];
if (schema.type === "string") {
values.push("like", "notLike");
if (schema.input && ["year", "month", "date", "datetime"].includes(schema.input)) {
values.push("biggerThan", "smallThan", "biggerThanOrEqual", "smallThanOrEqual");
}
} else if (schema.type === "boolean") {
} else {
values.push("biggerThan", "smallThan", "biggerThanOrEqual", "smallThanOrEqual");
}
return operators.filter((o) => values.includes(o.value));
};
function buildQuery() {
queryModel.value.maxResultCount = pageModel.pageSize;
queryModel.value.skipCount = (pageModel.pageIndex - 1) * pageModel.pageSize;
//
const postData = JSON.parse(JSON.stringify(queryModel.value));
postData.filters = filterList.value.filter((o) => o.column && o.action && (o.value || o.value === false));
if (postData.items) {
delete postData["items"];
}
if (postData.query?.id) {
delete postData.query["id"];
}
return postData;
}
onMounted(async () => {
if (route.meta.children?.length) {
for (const item of route.meta.children) {
@ -650,7 +784,11 @@ export default {
}
}
}
pushQueryList();
//
queryModel.value = schemaToModel(config.query.schema);
getSortModel(queryModel.value);
filterList.value = queryModel.value?.filters ?? [];
//pushfilterList();
// if (!querySchema.value) {
// const vm = (await get(indexUrl)).data;
// querySchema.value = vm.schema.properties.query;
@ -662,9 +800,6 @@ export default {
// getSortModel(data.value);
// getColumns(vm.schema.properties.query);
// }
if (!config) {
//
}
getColumns(config.table.schema);
if (props.query) {
Object.assign(queryModel.value.query, props.query);
@ -673,7 +808,9 @@ export default {
// getColumns(vm.schema.properties.query);
await load();
});
context.expose({ load });
return {
load,
config,
queryModel,
pageModel,
@ -689,7 +826,7 @@ export default {
dialogVisible,
selectedRows,
querySchema,
queryList,
filterList,
tableSchema,
buttons,
tableData,
@ -713,10 +850,13 @@ export default {
submit,
showList,
subListQuery,
pushQueryList,
fileList,
handleChange,
getButtonDisabled,
factories,
versions,
pushfilterList,
getOperators,
};
},
};

137
code/WebApp/vanilla/models/centralized-control.js

@ -0,0 +1,137 @@
const schema = {
title: "期间设置",
type: "object",
properties: {
year: {
title: "年度",
type: "string",
hidden: true,
showForList: true,
rules: [
{
required: true,
},
],
},
period: {
title: "期间",
type: "string",
hidden: true,
showForList: true,
rules: [
{
required: true,
},
],
},
version: {
title: "版本",
type: "string",
input: "month",
format: "YYYYMM",
showForList: true,
watch: "(model,value)=>{model.year=value.substr(0,4);model.period=value.substr(4,2);}",
rules: [
{
required: true,
trigger: "blur",
},
],
},
state: {
title: "状态",
type: "boolean",
showForList: true,
default: true,
rules: [
{
required: true,
},
],
},
},
};
const baseUrl = "settleaccount/centralized-control";
const queryUrl = `${baseUrl}/get-list`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`;
const queryMethod = "POST";
const detailsMethod = "POST";
const createMethod = "POST";
const updateMethod = "POST";
const deleteMethod = "POST";
export default function () {
return {
baseUrl,
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "通用代码",
type: "object",
properties: {
filters: {
type: "array",
hidden: true,
items: {
type: "object",
properties: {
logic: {
type: "int",
},
column: {
type: "string",
},
action: {
type: "int",
},
value: {
type: "string",
},
},
},
default: [
{
logic: "and",
column: "year",
action: "like",
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,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
schema: schema,
},
};
}

38
code/WebApp/vanilla/models/code-setting.js

@ -27,11 +27,13 @@ const schema = {
description: {
title: "描述",
type: "string",
input: "textarea",
showForList: true,
rules: [
{
required: true,
},
{ max: 60 },
],
},
},
@ -39,37 +41,34 @@ const schema = {
const baseUrl = "settleaccount/code-setting";
const queryUrl = `${baseUrl}/get-list`;
const detailsUrl = `${baseUrl}/GET/%s`;
const createUrl = `${baseUrl}/Create`;
const updateUrl = `${baseUrl}/Update/%s`;
const deleteUrl = `${baseUrl}/DeleteList`;
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}/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: {
project: {
type: "string",
},
value: {
type: "string",
},
description: {
type: "string",
},
filters: {
title: "项目",
type: "array",
hidden: true,
items: {
type: "object",
properties: {
@ -87,6 +86,15 @@ export default function () {
},
},
},
default: [
{
logic: "and",
column: "project",
action: "like",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
@ -110,10 +118,14 @@ export default function () {
createUrl,
updateUrl,
deleteUrl,
importUrl,
exportUrl,
detailsMethod,
createMethod,
updateMethod,
deleteMethod,
importMethod,
exportMethod,
schema: schema,
},
};

12
code/WebApp/vanilla/request/index.js

@ -3,6 +3,7 @@ import { isLogin } from "../api/user.js";
import { useAppStore } from "../store/index.js";
import { getFileName } from "../utils/index.js";
import settings from "../config/settings.js";
import { ElMessageBox } from "element-plus";
// const requestSettings = {
// baseURL: "/api",
@ -47,16 +48,21 @@ const getResult = async (response) => {
status: response.status,
message: messages.get(response.status),
};
if (response.status == 200) {
if (response.status === 200 || response.status === 204) {
const contentType = response.headers.get("Content-Type");
if (contentType.indexOf("application/json") > -1) {
result.data = await response.json();
} else if (contentType.indexOf("text/plain") > -1) {
result.data = await response.text();
} else if (contentType === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") {
result.data = await response.blob();
result.filename = getFileName(response.headers.get("Content-Disposition"));
}
} else if (response.status === 400 || response.status === 500) {
} /*if (response.status === 400 || response.status === 500) */ else {
result.errors = await response.json();
if (result.errors) {
ElMessageBox.alert(`错误:${result.errors?.error?.message}`, `代码:${result.errors?.error?.code}`);
}
}
return result;
};
@ -141,4 +147,4 @@ async function request(url, data, options, withoutToken = false) {
}
export default request;
export { get, post };
export { get, post, getUrl };

112
code/WebApp/vanilla/router/routes.js

@ -25,6 +25,15 @@ export default [
permission: "AbpIdentity.Users",
},
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "create",
meta: {
@ -109,12 +118,115 @@ export default [
// },
// ],
// },
{
path: "centralized-control",
meta: {
type: "page",
title: "期间设置",
icon: "file",
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "create",
meta: {
type: "button",
title: "新建",
icon: "file",
isTop: true,
},
},
{
path: "open-version",
meta: {
type: "button",
title: "启用",
icon: "file",
isTop: true,
},
},
{
path: "closed-version",
meta: {
type: "button",
title: "停用",
icon: "file",
isTop: true,
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
],
},
},
{
path: "code-setting",
meta: {
type: "page",
title: "通用代码",
icon: "file",
children: [
{
path: "query",
meta: {
type: "button",
title: "查询",
icon: "file",
isTop: true,
},
},
{
path: "create",
meta: {
type: "button",
title: "新建",
icon: "file",
isTop: true,
},
},
{
path: "delete",
meta: {
type: "button",
title: "删除",
icon: "file",
isTop: true,
},
},
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
{
path: "export",
meta: {
type: "button",
title: "导出",
icon: "file",
isTop: true,
pattern: "paged",
},
},
],
},
},
],

27
code/WebApp/vanilla/views/base-data/centralized-control.js

@ -0,0 +1,27 @@
import html from "html";
import { ref } from "vue";
import request from "../../request/index.js";
import AppList from "../../components/list/index.js";
import useConfig from "../../models/centralized-control.js";
export default {
components: { AppList },
template: html`<app-list ref="listRef" :config="config" @command="onCommand" />`,
setup(props, context) {
const listRef = ref(null);
const config = useConfig();
const onCommand = async (item, rows, load) => {
if (item.path === "open-version" || item.path === "closed-version") {
const url = `${config.baseUrl}/${item.path}`;
await request(
url,
rows.map((o) => o.id),
{ method: "POST" }
);
console.log(context);
await load();
}
};
return { config, onCommand };
},
};

13
code/WebApp/vanilla/views/base-data/code-setting.js

@ -1,27 +1,14 @@
import AppList from "../../components/list/index.js";
import html from "html";
import useConfig from "../../models/code-setting.js";
import request from "../../request/index.js";
import { format } from "../../utils/index.js";
import { ElMessage } from "element-plus";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
// 变量定义
const config = useConfig();
// 函数定义
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
if (item.path === "%s/reset-password") {
const url = format(item.path, rows[0].id);
await request(`base/user/${url}`, null, { method: item.meta.method });
ElMessage({
type: "info",
message: format("用户%s的密码已经成功重置为123456", rows[0].userName),
});
}
};
return { config, onCommand };
},

4
code/WebApp/vanilla/views/login.js

@ -20,7 +20,9 @@ export default {
<layout-locale />
</div>
<el-card class="box-card" style="width:400px;">
<app-form :schema="schema" v-model="model" :action="action" @submit="submit">{{$t('login')}}</app-form>
<app-form :schema="schema" v-model="model" :action="action" @submit="submit">
<template #submitText>{{$t('login')}}</template>
</app-form>
</el-card>
<layout-footer />
</div>

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

@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public class INVOICE_GRP_EXPORT_DTO
public class INVOICE_GRP_EXP_DTO
{
@ -133,7 +133,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal TaxAmt { get; set; }
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
[Display(Name = "发票号")]
public string InvbillNum { get; set; }
}

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

@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Bases
IExporter _excel = new ExcelExporter();
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXPORT_DTO>>(entities);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities);
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";

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

@ -115,6 +115,10 @@ namespace Win.Sfs.SettleAccount.Bases
return new PagedResultDto<TEntityDto>(totalCount, dtos);
}

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

@ -88,7 +88,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
IExporter _excel = new ExcelExporter();
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXPORT_DTO>>(entities);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities);
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs

@ -63,6 +63,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
private readonly ISettleAccountBranchEfCoreRepository<Prebatches.Prebatch, Guid> _preBatchRepository;
private readonly ISettleAccountBranchEfCoreRepository<SettleAccount, Guid> _repository;
private readonly ISettleAccountBranchEfCoreRepository<SettleAccountVersion, Guid> _versionRepository;
private readonly ISettleAccountBranchEfCoreRepository<FIS, Guid> _fisRepository;
@ -575,4 +577,4 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
}
}

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

@ -145,10 +145,163 @@ namespace Win.Sfs.SettleAccount
CreateMapPUB_SE_DETAIL();
CreateMapPUB_SA();
CreateMapBBAC_CAN_SA();
CreateMapBBAC_CAN_SA_DETAIL();
CreateMapBBAC_NOT_SA_DETAIL();
CreateMapHBPO_CAN_SA();
CreateMapHBPO_CAN_SA_DETAIL();
CreateMapHBPO_NOT_SA_DETAIL();
CreateMapINVOICE_GRP();
CreateMapINVOICE_MAP_GROUP();
CreateMapINVOICE_NOT_SETTLE();
CreateMapINVOICE_WAIT_DETAIL();
CreateMapPUB_CAN_SA();
CreateMapPUB_CAN_SA_DETAIL();
CreateMapPUB_NOT_SA_DETAIL();
}
#region BQ
/// <summary>
/// BBAC可结算
/// </summary>
private void CreateMapBBAC_CAN_SA()
{
CreateMap<BBAC_CAN_SA, BBAC_CAN_SA_DTO>().ReverseMap();
CreateMap<BBAC_CAN_SA, BBAC_CAN_SA_REQ_DTO>().ReverseMap();
}
private void CreateMapBBAC_CAN_SA_DETAIL()
{
CreateMap<BBAC_CAN_SA_DETAIL, BBAC_CAN_SA_DETAIL_DTO>().ReverseMap();
CreateMap<BBAC_CAN_SA_DETAIL, BBAC_CAN_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<BBAC_CAN_SA_DETAIL, BBAC_CAN_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapBBAC_NOT_SA_DETAIL()
{
CreateMap<BBAC_NOT_SA_DETAIL, BBAC_NOT_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<BBAC_NOT_SA_DETAIL, BBAC_NOT_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapHBPO_CAN_SA()
{
CreateMap<HBPO_CAN_SA, HBPO_CAN_SA_DTO>().ReverseMap();
CreateMap<HBPO_CAN_SA, HBPO_CAN_SA_REQ_DTO>().ReverseMap();
}
private void CreateMapHBPO_CAN_SA_DETAIL()
{
CreateMap<HBPO_CAN_SA_DETAIL, HBPO_CAN_SA_DETAIL_DTO>().ReverseMap();
CreateMap<HBPO_CAN_SA_DETAIL, HBPO_CAN_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<HBPO_CAN_SA_DETAIL, HBPO_CAN_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapHBPO_NOT_SA_DETAIL()
{
CreateMap<HBPO_NOT_SA_DETAIL, HBPO_NOT_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<HBPO_NOT_SA_DETAIL, HBPO_NOT_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapINVOICE_GRP()
{
CreateMap<INVOICE_GRP, INVOICE_GRP_DTO>().ReverseMap();
CreateMap<INVOICE_GRP, INVOICE_GRP_REQ_DTO>().ReverseMap();
CreateMap<INVOICE_GRP, INVOICE_GRP_IMP_DTO>().ReverseMap();
CreateMap<INVOICE_GRP, INVOICE_GRP_EXP_DTO>().ReverseMap();
}
private void CreateMapINVOICE_MAP_GROUP()
{
CreateMap<INVOICE_MAP_GROUP, INVOICE_MAP_GROUP_DTO>().ReverseMap();
CreateMap<INVOICE_MAP_GROUP, INVOICE_MAP_GROUP_EXP_DTO>().ReverseMap();
}
private void CreateMapINVOICE_NOT_SETTLE()
{
CreateMap<INVOICE_NOT_SETTLE, INVOICE_NOT_SETTLE_DTO>().ReverseMap();
CreateMap<INVOICE_NOT_SETTLE, INVOICE_NOT_SETTLE_REQ_DTO>().ReverseMap();
}
private void CreateMapINVOICE_WAIT_DETAIL()
{
CreateMap<INVOICE_WAIT_DETAIL, INVOICE_WAIT_DETAIL_DTO>().ReverseMap();
CreateMap<INVOICE_WAIT_DETAIL, INVOICE_WAIT_DETAIL_REQ_DTO>().ReverseMap();
}
private void CreateMapPUB_CAN_SA()
{
CreateMap<PUB_CAN_SA, PUB_CAN_SA_DTO>().ReverseMap();
CreateMap<PUB_CAN_SA, PUB_CAN_SA_REQ_DTO>().ReverseMap();
}
private void CreateMapPUB_CAN_SA_DETAIL()
{
CreateMap<PUB_CAN_SA_DETAIL, PUB_CAN_SA_DETAIL_DTO>().ReverseMap();
CreateMap<PUB_CAN_SA_DETAIL, PUB_CAN_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<PUB_CAN_SA_DETAIL, PUB_CAN_SA_DETAIL_EXP_DTO>().ReverseMap();
}
private void CreateMapPUB_NOT_SA_DETAIL()
{
CreateMap<PUB_NOT_SA_DETAIL, PUB_NOT_SA_DETAIL_DTO>().ReverseMap();
CreateMap<PUB_NOT_SA_DETAIL, PUB_NOT_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<PUB_NOT_SA_DETAIL, PUB_NOT_SA_DETAIL_EXP_DTO>().ReverseMap();
}

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

@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities.Auditing;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.SettleAccountDomain;
using static System.Runtime.CompilerServices.RuntimeHelpers;
@ -33,7 +36,36 @@ namespace SettleAccount.Bases
public decimal Qty { set; get; }
}
public interface ISA_BASE : ISBASE
public class SA_CAN_BASE_MAIN : FullAuditedAggregateRoot<Guid>
{
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "结算单据")]
public string BillNum { get; set; } = null!;
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
/// <summary>
/// 1、新建 2、已有出库3、已有扣减寄售库
/// </summary>
[Display(Name = "状态")]
public SettleBillState State { get; set; }
/// <summary>
/// 明细记录行数
/// </summary>
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; } = null!;
}
public interface ISA_BASE : ISBASE
{
/// <summary>
/// 期间
@ -238,6 +270,9 @@ namespace SettleAccount.Bases
}
}
public class SA_BASE : FullAuditedAggregateRoot<Guid>, ISA_BASE
{
/// <summary>

0
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs → code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs

41
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs

@ -6,35 +6,28 @@ using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "BBAC可结算导入")]
public class BBAC_CAN_SA:FullAuditedAggregateRoot<Guid>
public class BBAC_CAN_SA : SA_CAN_BASE_MAIN
{
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "结算单据")]
public string BillNum { get; set; } = null!;
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
/// <summary>
/// 1、新建 2、已有出库3、已有扣减寄售库
/// </summary>
[Display(Name = "状态")]
public SettleBillState State { get; set; }
//[Display(Name = "期间")]
//public int Version { get; set; }
/// <summary>
/// 明细记录行数
/// </summary>
[Display(Name = "明细记录行数")]
public string InvGroupNum { get; set; } = null!;
//[Display(Name = "结算单据")]
//public string BillNum { get; set; } = null!;
//[Display(Name = "关联结算单号")]
//public string SettleBillNum { get; set; } = null!;
/// <summary>
/// 工厂地点
/// </summary>
[Display(Name = "工厂地点")]
public string Site { get; set; } = null!;
///// <summary>
///// 1、新建 2、已有出库3、已有扣减寄售库
///// </summary>
//[Display(Name = "状态")]
//public SettleBillState State { get; set; }
///// <summary>
///// 明细记录行数
///// </summary>
//[Display(Name = "发票分组号")]
//public string InvGroupNum { get; set; } = null!;
public BBAC_CAN_SA()
{

34
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs

@ -6,27 +6,27 @@ using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "HBPO可结算导入")]
public class HBPO_CAN_SA :FullAuditedAggregateRoot<Guid>
public class HBPO_CAN_SA : SA_CAN_BASE_MAIN
{
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
[Display(Name = "结算单据")]
//[Display(Name = "期间")]
//public int Version { get; set; }
//[Display(Name = "关联结算单号")]
//public string SettleBillNum { get; set; } = null!;
//[Display(Name = "结算单据")]
public string BillNum { get; set; } = null!;
//public string BillNum { get; set; } = null!;
/// <summary>
/// 1、新建 2、已有出库3、已有扣减寄售库
/// </summary>
[Display(Name = "状态")]
public SettleBillState State { get; set; }
///// <summary>
///// 1、新建 2、已有出库3、已有扣减寄售库
///// </summary>
//[Display(Name = "状态")]
//public SettleBillState State { get; set; }
/// <summary>
/// 明细记录行数
/// </summary>
[Display(Name = "明细记录行数")]
public string InvGroupNum { get; set; } = null!;
///// <summary>
///// 明细记录行数
///// </summary>
//[Display(Name = "明细记录行数")]
//public string InvGroupNum { get; set; } = null!;
/// <summary>
/// 工厂地点

34
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs

@ -6,30 +6,30 @@ using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "PUB可结算导入")]
public class PUB_CAN_SA :FullAuditedAggregateRoot<Guid>
public class PUB_CAN_SA : SA_CAN_BASE_MAIN
{
[Display(Name = "期间")]
public int Version { get; set; }
//[Display(Name = "期间")]
//public int Version { get; set; }
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
//[Display(Name = "关联结算单号")]
//public string SettleBillNum { get; set; } = null!;
[Display(Name = "结算单据")]
public string BillNum { get; set; } = null!;
//[Display(Name = "结算单据")]
//public string BillNum { get; set; } = null!;
/// <summary>
/// 1、新建 2、已有出库3、已有扣减寄售库
/// </summary>
[Display(Name = "状态")]
public SettleBillState State { get; set; }
/// <summary>
/// 1、JIT 2、买单件 3、备件 3、印度件
/// </summary>
///// <summary>
///// 1、新建 2、已有出库3、已有扣减寄售库
///// </summary>
//[Display(Name = "状态")]
//public SettleBillState State { get; set; }
///// <summary>
///// 1、JIT 2、买单件 3、备件 3、印度件
///// </summary>
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "明细记录行数")]
public string InvGroupNum { get; set; } = null!;
//[Display(Name = "明细记录行数")]
//public string InvGroupNum { get; set; } = null!;
public PUB_CAN_SA(int version, string settleBillNum, string billNum, SettleBillState state, EnumBusinessType businessType, string invGroupNum)
{

97
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/CAN_SA_MNG.cs

@ -0,0 +1,97 @@
using Hangfire.Annotations;
using SettleAccount.Bases;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Services;
using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping;
using Win.Sfs.SettleAccount.Bases.DomainServices;
using Win.Sfs.SettleAccount.Boms;
using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.Managers
{
public class CAN_SA_MNG<TEntity,TEntityDetail> : DomainService
where TEntity : SA_CAN_BASE_MAIN
where TEntityDetail : SA_CAN_BASE
{
private readonly INormalEfCoreRepository<TEntity, Guid> _repository;
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
public CAN_SA_MNG
(
INormalEfCoreRepository<TEntity, Guid> repository,
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_repository= repository;
_detailRepository= detailRepository;
}
public virtual async Task<bool> SetState(TEntity p_entiy,SettleBillState 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;
case SettleBillState.:
if (state == SettleBillState.)
{
p_entiy.State = state;
}
else
{
throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态");
}
break;
}
await _repository.UpdateAsync(p_entiy);
return true;
}
}
}

42
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Managers/NOT_SA_MNG.cs

@ -0,0 +1,42 @@
using SettleAccount.Bases;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Services;
using Volo.Abp;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.Managers
{
/// <summary>
/// 不能結算管理
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TEntityDetail"></typeparam>
/// <typeparam name="TNOTDetail"></typeparam>
public class NOT_SA_MNG<TEntity,TEntityDetail, TNOTDetail> : DomainService
where TEntity : SA_CAN_BASE_MAIN
where TEntityDetail : SA_CAN_BASE
where TNOTDetail:SA_NOT_BASE
{
private readonly INormalEfCoreRepository<TEntity, Guid> _repository;
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
public NOT_SA_MNG
(
INormalEfCoreRepository<TEntity, Guid> repository,
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_repository = repository;
_detailRepository = detailRepository;
}
public virtual async Task<bool> GenerateSettlementOrder(List<TNOTDetail> p_list)
{
return true;
}
}
}

56
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreRepository.cs

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Linq.Expressions;
using System.Text;
using System.Threading;
@ -92,45 +93,46 @@ namespace Win.Sfs.SettleAccount.Repository
protected static IQueryable<TEntity> GetSortingQueryable(IQueryable<TEntity> entities, string sorting)
{
if (string.IsNullOrEmpty(sorting))
{
entities = entities.OrderByDescending("Id");
}
else
{
return string.IsNullOrEmpty(sorting)?entities:DynamicQueryableExtensions.OrderBy(entities, sorting);
//if (string.IsNullOrEmpty(sorting))
//{
// entities = entities.OrderByDescending("Id");
//}
//else
//{
var sortParams = sorting?.Split(' ');
var sortName = sortParams[0];
// var sortParams = sorting?.Split(' ');
// var sortName = sortParams[0];
Type t = typeof(TEntity);
var _first=t.GetProperties().Where(p => p.Name.ToUpper() == sortName.ToUpper()).FirstOrDefault();
if (_first != null)
{
sortName = _first.Name;
}
// Type t = typeof(TEntity);
// var _first=t.GetProperties().Where(p => p.Name.ToUpper() == sortName.ToUpper()).FirstOrDefault();
// if (_first != null)
// {
// sortName = _first.Name;
// }
bool isDesc;
if (sortParams.Length > 1)
{
var sortDirection = sortParams[1];
isDesc = sortDirection.ToUpper().Contains("DESC")?true:false;
}
else
{
isDesc = true;
}
// bool isDesc;
// if (sortParams.Length > 1)
// {
// var sortDirection = sortParams[1];
// isDesc = sortDirection.ToUpper().Contains("DESC")?true:false;
// }
// else
// {
// isDesc = true;
// }
entities = isDesc ? entities.OrderByDescending(sortName) : entities.OrderBy(sortName);
}
// entities = isDesc ? entities.OrderByDescending(sortName) : entities.OrderBy(sortName);
//}
return entities;
//return entities;
}

8
docs/demo/src/WTA.Application/Identity/Data/IdentityDbSeed.cs

@ -151,8 +151,8 @@ public class IdentityDbSeed : IDbSeed<IdentityDbContext>
context.Set<HBPO_SA>().Add(new HBPO_SA { Version = "测试数据", BillNum = "456", DNBillNum = "测试数据", State = "测试数据", RecordCount = "测试数据" });
context.Set<HBPO_SA_DETAIL>().Add(new HBPO_SA_DETAIL { InvGroupNum = "测试数据", KeyCode = "测试数据", Version = "测试数据", BillNum = "123", LU = "测试数据", PN = "测试数据", Site = "测试数据", SettleDate = new DateTime(), GroupNum = "测试数据" });
context.Set<HBPO_SA_DETAIL>().Add(new HBPO_SA_DETAIL { InvGroupNum = "测试数据", KeyCode = "测试数据", Version = "测试数据", BillNum = "456", LU = "测试数据", PN = "测试数据", Site = "测试数据", SettleDate = new DateTime(), GroupNum = "测试数据" });
context.Set<BBAC_SA>().Add(new BBAC_SA { Version = "测试数据", BillNum = "123", DNBillNum = "测试数据", State = "测试数据", RecordCount = "测试数据" });
context.Set<BBAC_SA>().Add(new BBAC_SA { Version = "测试数据", BillNum = "456", DNBillNum = "测试数据", State = "测试数据", RecordCount = "测试数据" });
context.Set<BBAC_SA>().Add(new BBAC_SA { Version = "测试数据", BillNum = "123", State = "测试数据", RecordCount = "测试数据" });
context.Set<BBAC_SA>().Add(new BBAC_SA { Version = "测试数据", BillNum = "456", State = "测试数据", RecordCount = "测试数据" });
context.Set<BBAC_SA_DETAIL>().Add(new BBAC_SA_DETAIL { InvGroupNum = "测试数据", KeyCode = "测试数据", Version = "测试数据", BillNum = "123", LU = "测试数据", PN = "测试数据", Site = "测试数据", SettleDate = new DateTime(), GroupNum = "测试数据", Category = "测试数据", IsReturn = "测试数据" });
context.Set<BBAC_SA_DETAIL>().Add(new BBAC_SA_DETAIL { InvGroupNum = "测试数据", KeyCode = "测试数据", Version = "测试数据", BillNum = "456", LU = "测试数据", PN = "测试数据", Site = "测试数据", SettleDate = new DateTime(), GroupNum = "测试数据", Category = "测试数据", IsReturn = "测试数据" });
context.Set<HBPO_CAN_SA>().Add(new HBPO_CAN_SA { SettleBillNum = "测试数据", Version = "测试数据", BillNum = "123", State = "测试数据", InvGroupNum = "测试数据" });
@ -161,8 +161,8 @@ public class IdentityDbSeed : IDbSeed<IdentityDbContext>
context.Set<HBPO_CAN_SA_DETAIL>().Add(new HBPO_CAN_SA_DETAIL { SettleBillNum = "测试数据", InvGroupNum = "测试数据", KeyCode = "测试数据", Version = "测试数据", BillNum = "456", LU = "测试数据", PN = "测试数据", Site = "测试数据", SettleDate = new DateTime(), GroupNum = "测试数据" });
context.Set<BBAC_CAN_SA>().Add(new BBAC_CAN_SA { SettleBillNum = "测试数据", Version = "测试数据", BillNum = "123", State = "测试数据", InvGroupNum = "测试数据" });
context.Set<BBAC_CAN_SA>().Add(new BBAC_CAN_SA { SettleBillNum = "测试数据", Version = "测试数据", BillNum = "456", State = "测试数据", InvGroupNum = "测试数据" });
context.Set<BBAC_CAN_SA_DETAIL>().Add(new BBAC_CAN_SA_DETAIL { SettleBillNum = "测试数据", InvGroupNum = "测试数据", KeyCode = "测试数据", Version = "测试数据", BillNum = "123", LU = "测试数据", PN = "测试数据", Site = "测试数据", SettleDate = new DateTime(), GroupNum = "测试数据", Category = "测试数据", IsReturn = "测试数据" });
context.Set<BBAC_CAN_SA_DETAIL>().Add(new BBAC_CAN_SA_DETAIL { SettleBillNum = "测试数据", InvGroupNum = "测试数据", KeyCode = "测试数据", Version = "测试数据", BillNum = "456", LU = "测试数据", PN = "测试数据", Site = "测试数据", SettleDate = new DateTime(), GroupNum = "测试数据", Category = "测试数据", IsReturn = "测试数据" });
context.Set<BBAC_CAN_SA_DETAIL>().Add(new BBAC_CAN_SA_DETAIL { InvGroupNum = "测试数据", KeyCode = "测试数据", Version = "测试数据", BillNum = "123", LU = "测试数据", PN = "测试数据", Site = "测试数据", SettleDate = new DateTime(), GroupNum = "测试数据", Category = "测试数据", IsReturn = "测试数据" });
context.Set<BBAC_CAN_SA_DETAIL>().Add(new BBAC_CAN_SA_DETAIL { InvGroupNum = "测试数据", KeyCode = "测试数据", Version = "测试数据", BillNum = "456", LU = "测试数据", PN = "测试数据", Site = "测试数据", SettleDate = new DateTime(), GroupNum = "测试数据", Category = "测试数据", IsReturn = "测试数据" });
context.Set<INVOICE_GRP>().Add(new INVOICE_GRP { Version = "测试数据", RealnvBillNum = "测试数据", InvbillNum = "123", InvGroupNum = "分组号测试数据一", FileName = "测试数据", BusinessType = "测试数据" });
context.Set<INVOICE_GRP>().Add(new INVOICE_GRP { Version = "测试数据", RealnvBillNum = "测试数据", InvbillNum = "456", InvGroupNum = "分组号测试数据二", FileName = "测试数据", BusinessType = "测试数据" });
context.Set<INVOICE_WAIT_DETAIL>().Add(new INVOICE_WAIT_DETAIL { InvbillNum = "待开票明细123", InvGroupNum = "待开票明细分组号测试数据一", Version = "测试数据", LU = "测试数据", BussiessType = "测试数据", Extend1 = "测试数据", Extend2 = "测试数据", Extend3 = "测试数据", Extend4 = "测试数据" });

4
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/BBAC_CAN_SA.cs

@ -53,8 +53,8 @@ public class BBAC_CAN_SA_DETAIL : BaseEntity
/// </summary>
[Display(Name = "结算单号")]
public string BillNum { get; set; } = null!;
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
//[Display(Name = "关联结算单号")]
//public string SettleBillNum { get; set; } = null!;
/// <summary>
/// 对应字段Material
/// </summary>

4
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/BBAC_SA.cs

@ -18,8 +18,8 @@ public class BBAC_SA : BaseEntity
[OneToMany<BBAC_SA_DETAIL>]
public string BillNum { get; set; } = null!;
[Display(Name = "出库单号")]
public string DNBillNum { get; set; } = null!;
//[Display(Name = "出库单号")]
//public string DNBillNum { get; set; } = null!;
/// <summary>
/// 1、新建 2、已有出库3、已有扣减寄售库

19
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/BBAC_SE_SA_REPORT.cs

@ -1,15 +1,16 @@
using System.ComponentModel.DataAnnotations;
using WTA.Application.Identity.Entities.SystemManagement.Attribute;
using WTA.Shared.Attributes;
using WTA.Shared.Domain;
namespace WTA.Application.Identity.Entities.SystemManagement;
[Hidden]
[Display(Name = "BBAC发运数据与结算数据对比实体")]
public class BBAC_SE_SA_REPORT : BaseEntity
{
[Display(Name = "LU+ASN单号")]
public string KeyCode { get; set; } = null!;
/// <summary>
/// 有结算无发货(无EDI数据)
///有结算无发货(有EDI数据)
@ -26,39 +27,55 @@ public class BBAC_SE_SA_REPORT : BaseEntity
[Display(Name = "Wms发货单号")]
public string WmsBillNum { get; set; } = null!;
[Display(Name = "发货时间")]
public DateTime ShippingDate { get; set; }
[Display(Name = "生产码")]
public string PN { get; set; } = null!;
[Display(Name = "日顺序号")]
public string SeqNumber { get; set; } = null!;
[Display(Name = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; } = null!;
[Display(Name = "物料号")]
public string MaterialNumber { get; set; } = null!;
[Display(Name = "物料描述")]
public string MaterialDes { get; set; } = null!;
[Display(Name = "零件号")]
public string LU { get; set; } = null!;
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
public DateTime CustomerOfflineTime { get; set; }
[Display(Name = "小总成号")]
public string AssemblyCode { get; set; } = null!;
[Display(Name = "注塑码")]
public string InjectionCode { get; set; } = null!;
[Display(Name = "结算数量")]
public decimal SEQty { get; set; }
[Display(Name = "发货数量")]
public decimal WMSQty { get; set; }
[Display(Name = "EDI数量")]
public decimal EDIQty { get; set; }
[Display(Name = "匹配类型")]
public string MateType { get; set; } = null!;
[Display(Name = "定价")]
public decimal FixPrice { get; set; }
[Display(Name = "期间")]
public string Version { get; set; } = null!;
}

4
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/HBPO_SE_DETAIL.cs

@ -34,8 +34,8 @@ public class HBPO_SE_DETAIL : BaseEntity
[Display(Name = "发货数量")]
public decimal Qty { get; set; }
[Display(Name = "订单时间")]
public DateTime BeginDate { get; set; }
//[Display(Name = "订单时间")]
//public DateTime BeginDate { get; set; }
[Display(Name = "发货时间")]
public DateTime ShippingDate { get; set; }

2
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/HBPO_SE_EDI.cs

@ -10,7 +10,7 @@ namespace WTA.Application.Identity.Entities.SystemManagement;
//HBPO的EDI数据
public class HBPO_SE_EDI : BaseEntity
{
[Display(Name = "LU+生产码")]
[Display(Name = "LU+PN")]
public string KeyCode { get; set; } = null!;
[Display(Name = "期间")]

3
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/HBPO_SE_SA_REPORT.cs

@ -1,12 +1,11 @@
using System.ComponentModel.DataAnnotations;
using WTA.Application.Identity.Entities.SystemManagement.Group;
using WTA.Shared.Attributes;
using WTA.Shared.Domain;
namespace WTA.Application.Identity.Entities.SystemManagement;
[Hidden]
[Display(Name = "HBPO发运数据与结算数据对比实体")]
public class HBPO_SE_SA_REPORT : BaseEntity
{
[Display(Name = "LU+ASN单号")]

4
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/PUB_CAN_SA.cs

@ -52,8 +52,8 @@ public class PUB_CAN_SA_DETAIL : BaseEntity
[Display(Name = "结算单号")]
public string BillNum { get; set; } = null!;
[Display(Name = "关联结算单号")]
public string SettleBillNum { get; set; } = null!;
//[Display(Name = "关联结算单号")]
//public string SettleBillNum { get; set; } = null!;
/// <summary>
/// 对应字段PartNumber

8
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/PUB_SE_DETAIL.cs

@ -1,14 +1,14 @@
using System.ComponentModel.DataAnnotations;
using WTA.Application.Identity.Entities.SystemManagement.Group;
using WTA.Shared.Attributes;
using WTA.Shared.Domain;
namespace WTA.Application.Identity.Entities.SystemManagement;
[Hidden]
[Display(Name = "PUB发运数据")]
public class PUB_SE_DETAIL : BaseEntity
{
[Display(Name = "LU+生产码")]
[Display(Name = "LU+(交付单号、ASN单号等)")]
public string KeyCode { get; set; } = null!;
[Display(Name = "期间")]
@ -17,7 +17,7 @@ public class PUB_SE_DETAIL : BaseEntity
[Display(Name = "零件号")]
public string LU { get; set; } = null!;
[Display(Name = "ASN单号")]
[Display(Name = "交付单号、ASN单号")]
public string PN { get; set; } = null!;
[Display(Name = "发货数量")]
@ -33,7 +33,7 @@ public class PUB_SE_DETAIL : BaseEntity
public string Extend3 { get; set; } = null!;
/// <summary>
/// 1、JIT 2、买单件 3、备件 3、印度件
/// 1、JIT 2、买单件 3、备件 4、印度件
/// </summary>
[Display(Name = "业务分类")]
public string BusinessType { get; set; } = null!;

1
docs/demo/src/WTA.Application/Identity/Entities/SystemManagement/TB_RePartsRelationship.cs

@ -20,6 +20,7 @@ public class TB_RePartsRelationship : BaseEntity
/// </summary>
[Display(Name = "替换零件号")]
public string RepLU { set; get; } = null!;
//取值字段【客户编码】
[Display(Name = "客户编码")]
public string ClientCode { set; get; } = null!;

BIN
docs/ui.rp

Binary file not shown.
Loading…
Cancel
Save