学 赵 1 year ago
parent
commit
18a6f6cd7f
  1. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js
  2. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/user.js
  3. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js
  4. 183
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  5. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/role.js
  6. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/user.js
  7. 0
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/version.js
  8. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/fa-yun.js
  9. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js
  10. 96
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
  11. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/base-data.js
  12. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  13. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/store/app.js
  14. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/styles/site.css
  15. 41
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/centralized-control.js
  16. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-log.js
  17. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/user.js
  18. 31
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/version.js
  19. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/compare/_compare.js
  20. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/input/fa-yun.js
  21. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/login.js
  22. 75
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
  23. 27
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
  24. 44
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js
  25. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js
  26. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js
  27. 48
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/vmi.js
  28. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  29. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs
  30. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
  31. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  32. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  33. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs
  34. 338
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  35. 14
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
  36. 114
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACEdiSeCompareExportService.cs
  37. 56
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  38. 25
      code/src/Shared/Win.Sfs.Shared/Filter/FilterExtensions.cs

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

@ -1,5 +1,3 @@
import { get, post } from "../request/index.js";
async function getLocalizationAsync() { async function getLocalizationAsync() {
// const url = "abp/application-configuration"; // const url = "abp/application-configuration";
// const data = (await get(url, null, null, true, true)).data; // const data = (await get(url, null, null, true, true)).data;

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

@ -1,9 +1,7 @@
import router from "../router/index.js"; import router from "../router/index.js";
import request, { get, post } from "../request/index.js"; import request from "../request/index.js";
import jwt_decode from "../lib/jwt-decode/jwt-decode.esm.js"; import jwt_decode from "../lib/jwt-decode/jwt-decode.esm.js";
import qs from "../lib/qs/shim.js";
import { useAppStore } from "../store/index.js"; import { useAppStore } from "../store/index.js";
import { refreshRouter } from "../router/index.js";
import Enumerable from "linq"; import Enumerable from "linq";
import { connection } from "../signalr/index.js"; import { connection } from "../signalr/index.js";

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

@ -29,7 +29,6 @@ export default {
<el-tab-pane key="all" label="全部" :value="null" /> <el-tab-pane key="all" label="全部" :value="null" />
<el-tab-pane v-for="item in options" :key="item.key" :label="item.label" :name="item.value" /> <el-tab-pane v-for="item in options" :key="item.key" :label="item.label" :name="item.value" />
</el-tabs> </el-tabs>
<br />
</template> </template>
<template v-else-if="getInput(schema)==='month'||getInput(schema)==='datetime'||getInput(schema)==='datetimerange'"> <template v-else-if="getInput(schema)==='month'||getInput(schema)==='datetime'||getInput(schema)==='datetimerange'">
<el-date-picker v-model="model[prop]" :type="schema.input" :value-format="schema.format??'YYYY-MM-DD HH:mm:ss'" /> <el-date-picker v-model="model[prop]" :type="schema.input" :value-format="schema.format??'YYYY-MM-DD HH:mm:ss'" />

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

@ -1,10 +1,9 @@
import html, { getProp } from "html"; import html, { getProp } from "html";
import request, { get, getUrl, post } from "../../request/index.js"; import request, { getUrl } from "../../request/index.js";
import { defineAsyncComponent, ref, reactive, onMounted, watch } from "vue"; import { defineAsyncComponent, ref, reactive, onMounted, watch, nextTick } 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";
import qs from "../../lib/qs/shim.js";
import { camelCase, capitalize } from "lodash"; import { camelCase, capitalize } from "lodash";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
@ -17,8 +16,10 @@ export default {
AppFormInput: defineAsyncComponent(() => import("../form/form-input.js")), AppFormInput: defineAsyncComponent(() => import("../form/form-input.js")),
}, },
template: html` template: html`
<div v-loading="tableLoading"> <div class="c-list" v-loading="tableLoading" style="height:100%;">
<el-row> <div style="height:calc(100% - 52px);">
<el-scrollbar ref="listScrollbarRef" :always="true" style="height:100%;">
<el-row style="padding-bottom:20px;">
<el-col> <el-col>
<app-form inline mode="query" label-position="left" :schema="config.query.schema" v-model="queryModel" @submit="load" :hideButton="true" :isQueryForm="true"> <app-form inline mode="query" label-position="left" :schema="config.query.schema" v-model="queryModel" @submit="load" :hideButton="true" :isQueryForm="true">
<template v-for="item in filterList.filter(o=>!o.hidden&&o.readOnly)"> <template v-for="item in filterList.filter(o=>!o.hidden&&o.readOnly)">
@ -27,10 +28,6 @@ export default {
</el-form-item> </el-form-item>
</template> </template>
</app-form> </app-form>
</el-col>
</el-row>
<el-row style="padding-bottom:20px;">
<el-col>
<template v-for="item in buttons"> <template v-for="item in buttons">
<el-button <el-button
:class="item.meta.htmlClass??'el-button--primary'" :class="item.meta.htmlClass??'el-button--primary'"
@ -49,9 +46,6 @@ export default {
<slot name="tableButtons" :rows="selectedRows"></slot> <slot name="tableButtons" :rows="selectedRows"></slot>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col>
<el-scrollbar>
<el-table <el-table
:key="tableKey" :key="tableKey"
ref="tableRef" ref="tableRef"
@ -64,8 +58,9 @@ export default {
table-layout="auto" table-layout="auto"
border border
fit fit
style="width:calc(100% - 26px);"
> >
<el-table-column fixed="left" type="selection" :selectable="config.table.selectable" /> <el-table-column v-if="!config.table.schema.disableSelection" fixed="left" type="selection" :selectable="config.table.selectable" />
<el-table-column type="index" :label="$t('rowIndex')"> <el-table-column type="index" :label="$t('rowIndex')">
<template #default="scope"> {{ (pageModel.pageIndex - 1) * pageModel.pageSize + scope.$index + 1 }} </template> <template #default="scope"> {{ (pageModel.pageIndex - 1) * pageModel.pageSize + scope.$index + 1 }} </template>
</el-table-column> </el-table-column>
@ -140,30 +135,27 @@ export default {
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-scrollbar> </el-scrollbar>
</el-col> </div>
</el-row> <div style="height:52px;padding-top:20px;">
<el-row> <el-scrollbar>
<el-col>
<el-pagination <el-pagination
v-model:currentPage="pageModel.pageIndex" v-model:currentPage="pageModel.pageIndex"
v-model:page-size="pageModel.pageSize" v-model:page-size="pageModel.pageSize"
:total="pageModel.total" :total="pageModel.total"
:page-sizes="pageModel.sizeList" :page-sizes="pageModel.sizeList"
class="justify-end"
:background="true" :background="true"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="onPageSizeChange" @size-change="onPageSizeChange"
@current-change="onPageIndexChange" @current-change="onPageIndexChange"
style="margin-top:20px"
/> />
</el-col> </el-scrollbar>
</el-row> </div>
</div> </div>
<el-drawer v-model="filterDrawer" :close-on-click-modal="false" destroy-on-close @close="tableRef.doLayout()"> <el-drawer v-model="filterDrawer" :close-on-click-modal="false" destroy-on-close @close="tableRef.doLayout()">
<template #header> <span class="el-dialog__title"> {{$t('filter')}} </span> </template> <template #header> <span class="el-dialog__title"> {{$t('filter')}} </span> </template>
<el-scrollbar> <el-scrollbar>
<el-row> <el-row>
<el-col style="max-height:calc(100vh - 180px);"> <el-col style="max-height:calc(100% - 180px);">
<el-form inline> <el-form inline>
<el-form-item> <el-form-item>
<el-button type="primary" @click="columns.forEach(o=>o.checked=true)"> {{$t('selectAll')}} </el-button> <el-button type="primary" @click="columns.forEach(o=>o.checked=true)"> {{$t('selectAll')}} </el-button>
@ -194,10 +186,10 @@ export default {
</span> </span>
</template> </template>
</el-drawer> </el-drawer>
<el-dialog v-model="dialogVisible" align-center destroy-on-close :close-on-click-modal="false" style="width:auto;min-width:500px;max-width:1000px;"> <el-dialog v-model="dialogVisible" align-center destroy-on-close :close-on-click-modal="false" style="width:auto;width:700px;">
<template #header> <span class="el-dialog__title"> {{editFormTitle}} </span> </template> <template #header> <span class="el-dialog__title"> {{editFormTitle}} </span> </template>
<el-row v-loading="editFormloading"> <el-row v-loading="editFormloading">
<el-col style="max-height:calc(100vh - 180px );min-height:100%;"> <el-col style="max-height:calc(100% - 180px );min-height:100%;">
<el-scrollbar> <el-scrollbar>
<template v-if="editFormMode==='create'||editFormMode==='update'||editFormMode==='details'"> <template v-if="editFormMode==='create'||editFormMode==='update'||editFormMode==='details'">
<app-form <app-form
@ -326,6 +318,7 @@ export default {
props: ["modelValue", "config", "querySchema", "query", "buttons"], props: ["modelValue", "config", "querySchema", "query", "buttons"],
emits: ["command"], emits: ["command"],
setup(props, context) { setup(props, context) {
const listScrollbarRef = ref(null);
/*变量定义*/ /*变量定义*/
// 配置 // 配置
const config = reactive(props.config); const config = reactive(props.config);
@ -406,6 +399,39 @@ export default {
const defaultImportModel = schemaToModel(config.import.schema); const defaultImportModel = schemaToModel(config.import.schema);
const importModel = ref(null); const importModel = ref(null);
const versions = ref([]); const versions = ref([]);
const onClick = async (method, confirMmessage = "确认操作吗?", reload = true) => {
try {
if (confirMmessage) {
await ElMessageBox.confirm(confirMmessage, "提示", {
type: "warning",
});
}
tableLoading.value = true;
let result = null;
if (method.constructor.name == "AsyncFunction") {
result = await method();
} else {
result = method();
}
if (!result.errors) {
if (!result.data?.code || result.data.code === 200) {
if (reload) {
pageModel.pageIndex = 1;
await load();
}
}
}
} catch (error) {
if (error === "cancel") {
ElMessage({
type: "info",
message: "操作取消",
});
}
} finally {
tableLoading.value = false;
}
};
const getSortModel = (model) => { const getSortModel = (model) => {
(model.sorting ?? "") (model.sorting ?? "")
.split(",") .split(",")
@ -466,30 +492,30 @@ export default {
pageModel.total = listData.totalCount; pageModel.total = listData.totalCount;
//data.value = listData; //data.value = listData;
tableKey.value = !tableKey.value; tableKey.value = !tableKey.value;
nextTick(() => {
tableRef.value.doLayout();
nextTick(() => listScrollbarRef.value.update());
});
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} finally { } finally {
tableLoading.value = false; tableLoading.value = false;
} }
}; };
const onPageIndexChange = async () => await load(); const reload = async () => {
const onPageSizeChange = async () => {
pageModel.pageIndex = 1; pageModel.pageIndex = 1;
await load(); await load();
}; };
const onPageIndexChange = async () => await load();
const onPageSizeChange = async () => {
await reload();
};
const click = async (item, rows) => { const click = async (item, rows) => {
editFormloading.value = true; editFormloading.value = true;
editFormMode.value = item.path ?? item; editFormMode.value = item.path ?? item;
if (item.path === "query") { if (item.path === "query") {
//list //list
await load(); await load();
} else if (item.path === "details") {
//details
const url = `${baseUrl}/${item.path}?${qs.stringify({ id: rows[0].id })}`;
editFormSchema.value = (await get(url)).data;
editFormModel.value = (await post(url)).data;
editFormTitle.value = `${config.edit.schema.title}${t("details")}`;
dialogVisible.value = true;
} else if (item.path === "create" || item.path === "update") { } else if (item.path === "create" || item.path === "update") {
//create //create
if (item.path === "create") { if (item.path === "create") {
@ -514,22 +540,21 @@ export default {
type: "warning", type: "warning",
}); });
tableLoading.value = true; tableLoading.value = true;
const response = await request( const result = await request(
url, url,
rows.map((o) => o.id), rows.map((o) => o.id),
{ method: config.edit.deleteMethod } { method: config.edit.deleteMethod },
true
); );
if (!response.errors) { if (!result.data?.code || result.data.code === 200) {
ElMessage({ pageModel.pageIndex = 1;
type: "info", await reload();
message: "操作完毕",
});
} }
} catch (error) { } catch (error) {
if (error === "cancel") { if (error === "cancel") {
ElMessage({ ElMessage({
type: "info", type: "info",
message: "删除取消", message: "操作取消",
}); });
} }
} finally { } finally {
@ -541,16 +566,13 @@ export default {
await ElMessageBox.confirm(format("确认删除当前行数据吗?", rows[0]), "提示", { await ElMessageBox.confirm(format("确认删除当前行数据吗?", rows[0]), "提示", {
type: "warning", type: "warning",
}); });
await request(url, null, { method: config.edit.deleteMethod }); await request(url, null, { method: config.edit.deleteMethod }, true);
ElMessage({ await reload();
type: "info",
message: "操作完毕",
});
} catch (error) { } catch (error) {
if (error === "cancel") { if (error === "cancel") {
ElMessage({ ElMessage({
type: "info", type: "info",
message: "删除取消", message: "操作取消",
}); });
} }
} }
@ -561,10 +583,12 @@ export default {
const url = config.edit.exportUrl; const url = config.edit.exportUrl;
const method = config.edit.exportMethod; const method = config.edit.exportMethod;
const postData = buildQuery(); const postData = buildQuery();
await onClick(async () => {
const response = await request(url, postData, { method }); const response = await request(url, postData, { method });
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.pattern === "file") { } else if (item.meta.pattern === "file") {
window.open(getUrl(`settleaccount/getblobfile/download/${rows[0]["downFileName"]}`)); window.open(getUrl(`settleaccount/getblobfile/download/${rows[0]["downFileName"]}`));
} else if ((item.meta.pattern = "row")) { } else if ((item.meta.pattern = "row")) {
@ -605,21 +629,23 @@ export default {
try { try {
const valid = await editFormRef.value.validate(); const valid = await editFormRef.value.validate();
if (valid) { if (valid) {
editFormloading.value = true; await onClick(
async () => {
let url = (editFormMode.value === "create" ? config.edit.createUrl : config.edit.updateUrl) ?? config.query.url; let url = (editFormMode.value === "create" ? config.edit.createUrl : config.edit.updateUrl) ?? config.query.url;
if (editFormMode.value === "update") { if (editFormMode.value === "update") {
url = format(url, editFormModel.value.id); url = format(url, editFormModel.value.id);
} }
const method = editFormMode.value === "create" ? config.edit.createMethod : config.edit.updateMethod; const method = editFormMode.value === "create" ? config.edit.createMethod : config.edit.updateMethod;
const response = await request(url, editFormModel.value, { method }); const result = await request(url, editFormModel.value, { method }, true);
if (response.errors) { if (!result.errors) {
ElMessageBox.alert(`错误:${response.errors?.error?.message}`, `代码:${response.errors?.error?.code}`);
//model.errors = response.errors; //??
} else {
await load();
editFormMode.value = null;
dialogVisible.value = false; dialogVisible.value = false;
editFormMode.value = null;
await reload();
} }
},
null,
true
);
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
@ -699,11 +725,6 @@ export default {
link.click(); link.click();
window.URL.revokeObjectURL(downloadUrl); window.URL.revokeObjectURL(downloadUrl);
}; };
const getImportTemplate = async () => {
const url = `${baseUrl}/${editFormMode.value}`;
const response = await get(url);
download(url, response.filename);
};
const getButtonDisabled = async (src, row) => { const getButtonDisabled = async (src, row) => {
if (src) { if (src) {
const method = await importFunction(src); const method = await importFunction(src);
@ -719,10 +740,6 @@ export default {
value: null, value: null,
}); });
}; };
const logic = [
{ value: "and", label: "且" },
{ value: "or", label: "或" },
];
const operators = [ const operators = [
{ {
value: "equal", value: "equal",
@ -812,39 +829,6 @@ export default {
} }
return postData; return postData;
} }
const action = async (method, confirMmessage = "确认操作吗?", successMessage = "操作成功", reload = true) => {
try {
await ElMessageBox.confirm(confirMmessage, "提示", {
type: "warning",
});
tableLoading.value = true;
let result = null;
if (method.constructor.name == "AsyncFunction") {
result = await method();
} else {
result = method();
}
if (!result.errors) {
await ElMessage({
type: "info",
message: successMessage,
});
if (reload) {
pageModel.pageIndex = 1;
await load();
}
}
} catch (error) {
if (error === "cancel") {
ElMessage({
type: "info",
message: "操作取消",
});
}
} finally {
tableLoading.value = false;
}
};
onMounted(async () => { onMounted(async () => {
if (route.meta.children?.length) { if (route.meta.children?.length) {
for (const item of route.meta.children) { for (const item of route.meta.children) {
@ -865,8 +849,10 @@ export default {
} }
}); });
return { return {
listScrollbarRef,
load, load,
action, reload,
onClick,
config, config,
queryModel, queryModel,
buildQuery, buildQuery,
@ -890,7 +876,6 @@ export default {
getClass, getClass,
sortChange, sortChange,
getProp, getProp,
getImportTemplate,
importFormRef, importFormRef,
editFormRef, editFormRef,
editFormloading, editFormloading,

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/role.js

@ -1,6 +1,7 @@
const schema = { const schema = {
title: "角色", title: "角色",
type: "object", type: "object",
disableSelection: true,
properties: { properties: {
name: { name: {
title: "角色名", title: "角色名",

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/user.js

@ -1,6 +1,7 @@
const schema = { const schema = {
title: "用户", title: "用户",
type: "object", type: "object",
disableSelection: true,
properties: { properties: {
userName: { userName: {
title: "用户名", title: "用户名",
@ -59,10 +60,7 @@ const schema = {
title: "邮箱", title: "邮箱",
type: "string", type: "string",
showForList: true, showForList: true,
rules: [ rules: [{ required: true }, { pattern: "^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z]{2,4})+$", message: "%s必须是正确的格式" }],
{ required: true },
{ pattern: "^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z]{2,4})+$", message: "%s必须是正确的格式" },
],
}, },
roleNames: { roleNames: {
title: "角色", title: "角色",

0
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/centralized-control.js → code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/version.js

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/fa-yun.js

@ -313,10 +313,10 @@ export default function (businessType) {
let schema = null; let schema = null;
let service = null; let service = null;
const syncService = "hand-se-sync/sync"; const syncService = "hand-se-sync/sync";
if (businessType === "JisBBAC") { if (businessType === "JisBBAC" || businessType === "MaiDanJianBBAC") {
schema = schema1; schema = schema1;
service = "bbac_se_detail_service"; service = "bbac_se_detail_service";
} else if (businessType === "JisHBPO") { } else if (businessType === "JisHBPO" || businessType === "MaiDanJianHBPO") {
schema = schema1; schema = schema1;
service = "hbpo_se_detail_service"; service = "hbpo_se_detail_service";
} else { } else {

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js

@ -1,6 +1,7 @@
const schema = { const schema = {
title: "通用代码", title: "通用代码",
type: "object", type: "object",
disableSelection: true,
properties: { properties: {
settleBillNum: { settleBillNum: {
title: "关联结算单号", title: "关联结算单号",

96
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js

@ -3,38 +3,29 @@ import { isLogin } from "../api/user.js";
import { useAppStore } from "../store/index.js"; import { useAppStore } from "../store/index.js";
import { getFileName } from "../utils/index.js"; import { getFileName } from "../utils/index.js";
import settings from "../config/settings.js"; import settings from "../config/settings.js";
import { ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
// const requestSettings = { // const requestSettings = {
// baseURL: "/api", // baseURL: "/api",
// }; // };
const addToken = async (options) => { async function addToken(options) {
if (await isLogin()) { if (await isLogin()) {
const appStore = useAppStore(); const appStore = useAppStore();
options.headers ??= {}; options.headers ??= {};
options.headers.Authorization = `Bearer ${appStore.token}`; options.headers.Authorization = `Bearer ${appStore.token}`;
} }
}; }
const getUrl = (url) => { function getUrl(url) {
if (url.startsWith("http")) { if (url.startsWith("http")) {
return url; return url;
} }
let result = settings.baseURL; let result = settings.baseURL;
return (result += `/${url}`); return (result += `/${url}`);
// let result = requestSettings.baseURL; }
// if (withoutCulture) {
// result += `/${url}`;
// } else {
// const appStore = useAppStore();
// result += withoutCulture ? "/" : `/${appStore.localization.locale}/`;
// result += url;
// }
// return result;
};
const getResult = async (response) => { async function getResult(response) {
const messages = new Map([ const messages = new Map([
[200, "操作成功"], [200, "操作成功"],
[201, "已创建"], [201, "已创建"],
@ -63,60 +54,15 @@ const getResult = async (response) => {
try { try {
result.errors = await response.json(); result.errors = await response.json();
} catch (error) { } catch (error) {
result.errors = error;
console.log(error); console.log(error);
} }
ElMessageBox.alert(`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`, `${result.errors?.error?.code ?? "错误"}`); ElMessageBox.alert(`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`, `${result.errors?.error?.code ?? "错误"}`);
} }
return result; return result;
}; }
const get = async (url, data, options, withoutToken = false) => {
url = getUrl(url);
if (data) {
url = `${url}?${qs.stringify(data)}`;
}
const defaultOptions = {
headers: { "Accept-Language": "zh-Hans" },
};
if (options) {
Object.assign(defaultOptions, options);
}
if (!withoutToken) {
await addToken(defaultOptions);
}
const response = await fetch(url, defaultOptions);
return getResult(response);
};
const post = async (url, data, options, withoutToken = false) => {
url = getUrl(url);
let defaultOptions = {
method: "POST",
headers: { "Accept-Language": "zh-Hans" },
};
if (!(data instanceof FormData)) {
defaultOptions.headers["Content-Type"] = "application/json";
}
if (options) {
Object.assign(defaultOptions, options);
}
if (data && !defaultOptions.body) {
if (defaultOptions.headers["Content-Type"]?.startsWith("application/x-www-form-urlencoded")) {
defaultOptions.body = qs.stringify(data);
} else if (defaultOptions.headers["Content-Type"]?.startsWith("application/json")) {
defaultOptions.body = JSON.stringify(data);
} else {
defaultOptions.body = data;
}
}
if (!withoutToken) {
await addToken(defaultOptions);
}
const response = await fetch(url, defaultOptions);
return getResult(response);
};
async function request(url, data, options, withoutToken = false) { async function request(url, data, options, notify = false) {
url = getUrl(url); url = getUrl(url);
let defaultOptions = { let defaultOptions = {
method: "POST", method: "POST",
@ -142,12 +88,28 @@ async function request(url, data, options, withoutToken = false) {
defaultOptions.body = JSON.stringify(data); defaultOptions.body = JSON.stringify(data);
} }
} }
if (!withoutToken) {
await addToken(defaultOptions); await addToken(defaultOptions);
}
const response = await fetch(url, defaultOptions); const response = await fetch(url, defaultOptions);
return getResult(response); const result = await getResult(response);
if (!result.errors && notify && (!result.data?.code || result.data.code === 200)) {
ElMessage({
type: "success",
message: "操作成功",
});
}
if (result.data?.code && result.data.code !== 200) {
result.errors = result.data.message;
}
return result;
}
async function get(url, data, notify = false) {
return await request(url, data, { method: "GET" }, notify);
}
async function post(url, data, notify = false) {
return await request(url, data, { method: "POST" }, notify);
} }
export default request; export default request;
export { get, post, getUrl }; export { getUrl, get, post };

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

@ -23,7 +23,7 @@ export default [
children: [createButton("query", "title=查询&isTop=true"), createButton("export", "title=导出&isTop=true&pattern=paged")], children: [createButton("query", "title=查询&isTop=true"), createButton("export", "title=导出&isTop=true&pattern=paged")],
}, },
{ {
...createPage("centralized-control", "title=期间设置"), ...createPage("version", "title=期间设置"),
children: [ children: [
createButton("query", "title=查询&isTop=true"), createButton("query", "title=查询&isTop=true"),
createButton("create", "title=新建&isTop=true"), createButton("create", "title=新建&isTop=true"),

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

@ -95,7 +95,7 @@ function createCommerceCheckList(path, business, client, title = "商务审批")
function createVmiOutCheckList(path, business, client, title = "寄售库库存扣减审批") { function createVmiOutCheckList(path, business, client, title = "寄售库库存扣减审批") {
return { return {
...createPage(path, `title=${title}&businessType=${business}&client=${client}`), ...createPage(path, `title=${title}&businessType=${business}&client=${client}`),
component: "/settle/finance", component: "/settle/vmi",
children: [ children: [
createButton("query", "title=查询&isTop=true"), createButton("query", "title=查询&isTop=true"),
createButton("compare", "title=扣减审核通过&isTop=true"), createButton("compare", "title=扣减审核通过&isTop=true"),
@ -192,7 +192,7 @@ export default [
}, },
{ {
...createRoute("contrast", "title=数据比对"), ...createRoute("contrast", "title=数据比对"),
children: [createCompareJieSuan("bbac_jit_pub_sa_detail_jobservice", "ZhiGongJianBBAC", "bbac", "直供件-BBAC EDI、发运与结算对比")], children: [createCompareJieSuan("bbac_jit_pub_sa_detail_jobservice", "ZhiGongJianBBAC", "bbac", "直供件-BBAC 发运与结算对比")],
}, },
{ {
...createRoute("settlement", "title=结算开票"), ...createRoute("settlement", "title=结算开票"),
@ -217,7 +217,7 @@ export default [
}, },
{ {
...createRoute("contrast", "title=数据比对"), ...createRoute("contrast", "title=数据比对"),
children: [createCompareJieSuan("bbac_jit_pub_sa_detail_jobservice", "ZhiGongJianHBPO", "hbpo", "直供件-HBPO EDI、发运与结算对比")], children: [createCompareJieSuan("bbac_jit_pub_sa_detail_jobservice", "ZhiGongJianHBPO", "hbpo", "直供件-HBPO 发运与结算对比")],
}, },
{ {
...createRoute("settlement", "title=结算开票"), ...createRoute("settlement", "title=结算开票"),
@ -247,7 +247,7 @@ export default [
}, },
{ {
...createRoute("contrast", "title=数据比对"), ...createRoute("contrast", "title=数据比对"),
children: [createCompareJieSuan("bbac_md_pub_sa_detail_jobservice", "MaiDanJianBBAC", "bbac", "买单件-BBAC EDI、发运与结算对比")], children: [createCompareJieSuan("bbac_md_pub_sa_detail_jobservice", "MaiDanJianBBAC", "bbac", "买单件-BBAC 发运与结算对比")],
}, },
], ],
}, },
@ -263,7 +263,7 @@ export default [
}, },
{ {
...createRoute("contrast", "title=数据比对"), ...createRoute("contrast", "title=数据比对"),
children: [createCompareJieSuan("hbpo_md_pub_sa_detail_jobservice", "MaiDanJianHBPO", "hbpo", "买单件-HBPO EDI、发运与结算对比")], children: [createCompareJieSuan("hbpo_md_pub_sa_detail_jobservice", "MaiDanJianHBPO", "hbpo", "买单件-HBPO 发运与结算对比")],
}, },
{ {
...createRoute("settlement", "title=结算开票"), ...createRoute("settlement", "title=结算开票"),
@ -290,7 +290,7 @@ export default [
}, },
{ {
...createRoute("contrast", "title=数据比对"), ...createRoute("contrast", "title=数据比对"),
children: [createCompareJieSuan("bj_pub_sa_detail_jobservice", "BeiJian", "bbac", "备件-BBAC EDI、发运与结算对比")], children: [createCompareJieSuan("bj_pub_sa_detail_jobservice", "BeiJian", "bbac", "备件-BBAC 发运与结算对比")],
}, },
{ {
...createRoute("settlement", "title=结算开票"), ...createRoute("settlement", "title=结算开票"),
@ -315,7 +315,7 @@ export default [
}, },
{ {
...createRoute("contrast", "title=数据比对"), ...createRoute("contrast", "title=数据比对"),
children: [createCompareJieSuan("in_pub_sa_detail_jobservice", "YinDuJian", "bbac", "印度件-BBAC EDI、发运与结算对比")], children: [createCompareJieSuan("in_pub_sa_detail_jobservice", "YinDuJian", "bbac", "印度件-BBAC 发运与结算对比")],
}, },
{ {
...createRoute("settlement", "title=结算开票"), ...createRoute("settlement", "title=结算开票"),

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

@ -1,7 +1,6 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import settings from "../config/settings.js"; import settings from "../config/settings.js";
import { getAccessToken, getUser, isLogin } from "../api/user.js"; import { getAccessToken, getUser, isLogin } from "../api/user.js";
import { get, post } from "../request/index.js";
import { refreshRouter } from "../router/index.js"; import { refreshRouter } from "../router/index.js";
import { getLocalizationAsync } from "../api/site.js"; import { getLocalizationAsync } from "../api/site.js";

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/styles/site.css

@ -50,7 +50,7 @@ a {
} }
.el-main { .el-main {
min-height: calc(100% - 100px); height: calc(100% - 100px);
overflow: auto; overflow: auto;
} }

41
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/centralized-control.js

@ -1,41 +0,0 @@
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/base-data/centralized-control.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { format } from "../../utils/index.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") {
try {
await ElMessageBox.confirm(format(`确认${item.path === "open-version" ? "启用" : "停用"}选中的%s行数据吗?`, rows.length), "提示", {
type: "warning",
});
const url = `${config.baseUrl}/${item.path}`;
await request(
url,
rows.map((o) => o.id),
{ method: "POST" }
);
console.log(context);
await load();
} catch (error) {
if (error === "cancel") {
ElMessage({
type: "info",
message: "操作取消",
});
}
}
}
};
return { config, onCommand };
},
};

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

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

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/user.js

@ -12,12 +12,10 @@ export default {
const config = useConfig(); const config = useConfig();
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
if (item.path === "reset-password") { if (item.path === "reset-password") {
if (rows.length) {
const url = `base/user/${rows[0].id}/${item.path}`; const url = `base/user/${rows[0].id}/${item.path}`;
await appListRef.value.action( await appListRef.value.onClick(async () => await request(url, null, { method: item.meta.method }, true), `是否重置用户${rows[0].userName}密码?`, false);
async () => await request(url, null, { method: item.meta.method }), }
`是否重置用户${rows[0].userName}密码?`,
`${rows[0].userName}密码已经重置为123456`
);
} }
}; };
return { appListRef, config, onCommand }; return { appListRef, config, onCommand };

31
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/version.js

@ -0,0 +1,31 @@
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/base-data/version.js";
export default {
components: { AppList },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() {
const appListRef = ref(null);
const config = useConfig();
const onCommand = async (item, rows) => {
const url = `${config.baseUrl}/${item.path}`;
if (item.path === "open-version" || item.path === "closed-version") {
await appListRef.value.onClick(
async () =>
await request(
url,
rows.map((o) => o.id),
{ method: "POST" },
true
),
`确认${item.path === "open-version" ? "启用" : "停用"}选中的${rows.length}行数据吗?`,
true
);
}
};
return { appListRef, config, onCommand };
},
};

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/compare/_compare.js

@ -64,7 +64,10 @@ export default function (type) {
delete data["downLineDateTime"]; delete data["downLineDateTime"];
const result = await request(url, data, { method: "POST" }, true); const result = await request(url, data, { method: "POST" }, true);
if (!result.errors) { if (!result.errors) {
if (!result.data?.code || result.data.code === 200) {
dialogVisable.value = false; dialogVisable.value = false;
await load();
}
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/input/fa-yun.js

@ -13,8 +13,7 @@ export default {
const route = useRoute(); const route = useRoute();
const businessType = route.meta.businessType; const businessType = route.meta.businessType;
const config = useConfig(businessType); const config = useConfig(businessType);
const onCommand = async (item, rows) => { const onCommand = async (item) => {
console.log(item.path, item, rows);
if (item.path === "sync") { if (item.path === "sync") {
const url = config.edit.syncUrl; const url = config.edit.syncUrl;
const method = config.edit.syncMethod; const method = config.edit.syncMethod;

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

@ -35,7 +35,7 @@ export default {
try { try {
const url = "base/token"; const url = "base/token";
const appStore = useAppStore(); const appStore = useAppStore();
const result = await request(url, model, { method: "POST" }, true); const result = await request(url, model, { method: "POST" });
if (!result.errors) { if (!result.errors) {
appStore.token = result.data.accessToken; appStore.token = result.data.accessToken;
if (appStore.token) { if (appStore.token) {

75
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js

@ -7,12 +7,13 @@ import AppTable from "../../components/table/index.js";
import extraProperties from "../../models/_extraProperties.js"; import extraProperties from "../../models/_extraProperties.js";
import { getUrl } from "../../request/index.js"; import { getUrl } from "../../request/index.js";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import businessTypes from "../../models/_options.js";
export default { export default {
components: { AppForm, AppTable }, components: { AppForm, AppTable },
template: html`<el-drawer v-if="refreshRef" v-model="show" destroy-on-close size="50%" class="page-drawer" :close-on-click-modal="false"> template: html`<el-drawer v-if="refreshRef" v-model="show" destroy-on-close size="50%" class="page-drawer" :close-on-click-modal="false">
<template #header> <span class="el-dialog__title"> 结算明细 </span> </template> <template #header> <span class="el-dialog__title"> 结算明细 </span> </template>
<el-row style="height:calc(100vh - 160px);" v-loading="loading"> <el-row style="height:calc(100% - 160px);" v-loading="loading">
<el-col> <el-col>
<el-tabs> <el-tabs>
<el-tab-pane :label="columns1.title" v-if="model.invoicE_MAP_GROUP.length"> <el-tab-pane :label="columns1.title" v-if="model.invoicE_MAP_GROUP.length">
@ -51,6 +52,7 @@ export default {
<el-step title="调整明细列表" /> <el-step title="调整明细列表" />
<el-step title="发票明细对比" /> <el-step title="发票明细对比" />
<el-step title="发票预览" /> <el-step title="发票预览" />
<el-step title="重开成功" />
</el-steps> </el-steps>
<div class="setup1" v-show="setupRef===1" style="height:calc(100% - 120px);"> <div class="setup1" v-show="setupRef===1" style="height:calc(100% - 120px);">
<el-row style="padding:14px 0;height:60px;"> <el-row style="padding:14px 0;height:60px;">
@ -82,28 +84,38 @@ export default {
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div class="setup3" v-show="setupRef===3" style="height:calc(100% - 60px);background:#ebeef5;"> <div class="setup3" v-show="setupRef===3" style="height:calc(100% - 60px);">
<el-row style="width:100%;height:100%;padding:10px;"> <el-row style="width:100%;height:100%;padding:10px;">
<el-col style="height:100%;padding:0 5px 0 0;"> <el-col style="height:100%;padding:0 5px 0 0;">
<el-scrollbar> <el-scrollbar>
<h2>发票预览</h2> <el-descriptions>
<div>{{setup3Model}}</div> <el-descriptions-item label="发票号">{{setup3Model.invbillNum}}</el-descriptions-item>
<el-descriptions-item label="业务类型">{{businessTypes.options.find(o=>o.value===setup3Model.businesType)?.label}}</el-descriptions-item>
<el-descriptions-item label="未税金额">{{setup3Model.tax}}</el-descriptions-item>
<el-descriptions-item label="税额">{{setup3Model.businesType}}</el-descriptions-item>
<el-descriptions-item label="税率">{{setup3Model.businesType}}</el-descriptions-item>
</el-descriptions>
<app-table :data="setup3Model.detail" :columns="setup2columns" />
</el-scrollbar> </el-scrollbar>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div class="setup3" v-show="setupRef===3" style="height:calc(100% - 60px);background:#ebeef5;"> <div class="setup4" v-show="setupRef===4" style="height:calc(100% - 60px);">
<el-row style="width:100%;height:100%;padding:10px;"> <el-row style="width:100%;height:100%;padding:10px;">
<el-col style="height:100%;padding:0 5px 0 0;"> <el-col style="height:100%;padding:0 5px 0 0;">
<el-scrollbar> <el-scrollbar>
<h2>完成</h2> <el-result icon="success" title="重开完成">
<template #extra>
<el-button type="primary" @click="next">返回</el-button>
</template>
</el-result>
</el-scrollbar> </el-scrollbar>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<template #footer> <template #footer v-if="setupRef!==4">
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" @click="setupRef-=1" v-if="setupRef>1">上一步</el-button> <el-button type="primary" @click="setupRef-=1" v-if="setupRef>1&&setupRef<4">上一步</el-button>
</span> </span>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" @click="next" v-if="setupRef<3">下一步</el-button> <el-button type="primary" @click="next" v-if="setupRef<3">下一步</el-button>
@ -143,12 +155,12 @@ export default {
styles: html` <style> styles: html` <style>
.page-drawer .el-tab-pane { .page-drawer .el-tab-pane {
width: 100%; width: 100%;
height: calc(100vh - 160px); height: calc(100% - 160px);
} }
.page-drawer .el-tabs__content, .page-drawer .el-tabs__content,
.page-drawer .el-scrollbar { .page-drawer .el-scrollbar {
width: 100%; width: 100%;
height: calc(100vh - 160px - 40px); height: calc(100% - 160px - 40px);
} }
.re-open .el-dialog__footer { .re-open .el-dialog__footer {
display: flex; display: flex;
@ -319,6 +331,35 @@ export default {
}, },
}, },
}; };
const setup3columns = {
properties: {
lu: {
type: "string",
title: "结算系统发票号",
},
lu: {
type: "string",
title: "发票日期",
input: "datetime",
},
lu: {
type: "string",
title: "零件号",
},
qty: {
type: "number",
title: "发票数量",
},
price: {
type: "number",
title: "发票价格",
},
amt: {
type: "number",
title: "发票未税金额",
},
},
};
delete columns5.properties["oldInvBillNum"]; delete columns5.properties["oldInvBillNum"];
delete columns5.properties["invGroupNum"]; delete columns5.properties["invGroupNum"];
//显示重开发票对话框 //显示重开发票对话框
@ -331,7 +372,9 @@ export default {
const importDialogVisible = ref(false); const importDialogVisible = ref(false);
const setup2table1Ref = ref(null); const setup2table1Ref = ref(null);
const setup2table2Ref = ref(null); const setup2table2Ref = ref(null);
const setup3Model = ref(null); const setup3Model = ref({
detail: [],
});
const showSetupDialog = () => { const showSetupDialog = () => {
//重开发票号 //重开发票号
//invBillNum= //invBillNum=
@ -504,7 +547,7 @@ export default {
} else if (result.data?.code === 400) { } else if (result.data?.code === 400) {
ElMessage({ ElMessage({
type: "error", type: "error",
message: "校验失败", message: "操作失败",
}); });
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
} }
@ -516,7 +559,7 @@ export default {
let service = null; let service = null;
if (props.businessType === "JisBBAC") { if (props.businessType === "JisBBAC") {
service = "bbac_ba_service"; service = "bbac_ba_service";
} else if (bprops.usinessType === "JisHBPO") { } else if (props.usinessType === "JisHBPO") {
service = "hbpo_ba_service"; service = "hbpo_ba_service";
} else { } else {
service = "pub_ba_service"; service = "pub_ba_service";
@ -531,7 +574,7 @@ export default {
} else if (result.data?.code === 400 && result.data.fileName) { } else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({ ElMessage({
type: "error", type: "error",
message: "提交失败", message: "操作失败",
}); });
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
} }
@ -545,7 +588,7 @@ export default {
} else if (result.data?.code === 400 && result.data.fileName) { } else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({ ElMessage({
type: "error", type: "error",
message: "提交失败", message: "操作失败",
}); });
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
} }
@ -584,6 +627,7 @@ export default {
columns4, columns4,
columns5, columns5,
setup2columns, setup2columns,
setup3columns,
showSetupDialog, showSetupDialog,
setupRef, setupRef,
setupDialogVisable, setupDialogVisable,
@ -608,6 +652,7 @@ export default {
setup2table2Ref, setup2table2Ref,
refreshRef, refreshRef,
setup3Model, setup3Model,
businessTypes,
}; };
}, },
}; };

27
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js

@ -2,8 +2,7 @@ import AppList from "../../components/list/index.js";
import html from "html"; import html from "html";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { ref } from "vue"; import { ref } from "vue";
import { ElMessage, ElMessageBox } from "element-plus"; import request, { getUrl } from "../../request/index.js";
import request from "../../request/index.js";
import useConfig from "../../models/settle/commerce.js"; import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js"; import AppCheck from "./_check.js";
@ -20,12 +19,7 @@ export default {
const config = useConfig(businessType, "shang-wu"); const config = useConfig(businessType, "shang-wu");
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
if (item.path === "approval" || item.path === "reject" || item.path === "receive") { if (item.path === "approval" || item.path === "reject" || item.path === "receive") {
if (rows.length === 0) { if (rows.length > 0) {
ElMessage({
type: "warning",
message: "没有选中的数据",
});
} else {
const message = const message =
item.path === "approval" item.path === "approval"
? `确认审核通过选中的${rows.length}行数据吗?` ? `确认审核通过选中的${rows.length}行数据吗?`
@ -34,18 +28,7 @@ export default {
: `确认选中的${rows.length}行数据客户已收票吗?`; : `确认选中的${rows.length}行数据客户已收票吗?`;
const data = item.path === "approval" ? rows.map((o) => o.invbillNum) : item.path === "reject" ? rows[0]["invGroupNum"] : rows.map((o) => o.invbillNum); const data = item.path === "approval" ? rows.map((o) => o.invbillNum) : item.path === "reject" ? rows[0]["invGroupNum"] : rows.map((o) => o.invbillNum);
const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl; const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
try { await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
await ElMessageBox.confirm(message, "提示", {
type: "warning",
});
appListRef.value.tableLoading = true;
const result = request(url, data, { method: "POST" });
console.log(result);
} catch (e) {
console.log(e);
} finally {
appListRef.value.tableLoading = false;
}
} }
} else if (item.path === "export-group") { } else if (item.path === "export-group") {
const url = config.edit.exportUrl; const url = config.edit.exportUrl;
@ -60,10 +43,12 @@ export default {
}, },
], ],
}; };
const response = await request(url, postData, { method }); await appListRef.value.onClick(async () => {
const response = await request(url, postData, { method }, true);
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.path === "invbillNum" || item.path === "invGroupNum") { } else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { [item.path]: rows[0][item.path] }; data.value = { [item.path]: rows[0][item.path] };
visable.value = true; visable.value = true;

44
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js

@ -1,44 +0,0 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import { ref } from "vue";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js";
import request, { getUrl } from "../../request/index.js";
export default {
components: { AppList, AppCheck },
template: html`<app-list :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" />`,
setup() {
const visable = ref(false);
const data = ref(null);
const route = useRoute();
const businessType = route.meta.businessType;
const config = useConfig(businessType, "cai-wu");
const onCommand = async (item, rows) => {
if (item.path === "export-group") {
const url = config.edit.exportUrl;
const method = config.edit.exportMethod;
const postData = {
filters: [
{
logic: "and",
column: "invGroupNum",
action: "equal",
value: rows[0]["invGroupNum"],
},
],
};
const response = await request(url, postData, { method });
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
} else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
}
console.log(item.path, item, rows);
};
return { config, onCommand, visable, data };
},
};

15
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js

@ -14,22 +14,11 @@ export default {
const route = useRoute(); const route = useRoute();
const businessType = route.meta.businessType; const businessType = route.meta.businessType;
const config = useConfig(businessType, "unable"); const config = useConfig(businessType, "unable");
const onCommand = async (item, rows) => { const onCommand = async (item) => {
const url = config.edit.addUrl; const url = config.edit.addUrl;
if (item.path === "add") { if (item.path === "add") {
try {
await ElMessageBox.confirm(`确认是否对所有符合查询条件的数据生成可结算单?`, "提示", {
type: "warning",
});
appListRef.value.tableLoading = true;
const data = appListRef.value.buildQuery(); const data = appListRef.value.buildQuery();
const result = request(url, data, { method: "POST" }); await appListRef.value.onClick(() => request(url, data, { method: "POST" }, true), `确认是否对所有符合查询条件的数据生成可结算单?`, true);
console.log(result);
} catch (e) {
console.log(e);
} finally {
appListRef.value.tableLoading = false;
}
} }
}; };
return { appListRef, config, onCommand }; return { appListRef, config, onCommand };

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

@ -18,21 +18,7 @@ export default {
const url = config.edit.addUrl; const url = config.edit.addUrl;
if (item.path === "add") { if (item.path === "add") {
const invbillNum = rows[0].billNum; const invbillNum = rows[0].billNum;
try { await appListRef.value.onClick(async () => await request(url, { invbillNum }, { method: "POST" }, true), `确认为${invbillNum}创建发票?`, true);
await ElMessageBox.confirm(`确认为${invbillNum}创建发票?`, "提示", {
type: "warning",
});
appListRef.value.tableLoading = true;
const result = request(url, { invbillNum }, { method: "POST" });
if (!result.errors) {
await appListRef.value.load();
}
console.log(result);
} catch (e) {
console.log(e);
} finally {
appListRef.value.tableLoading = false;
}
} }
}; };
return { appListRef, config, onCommand }; return { appListRef, config, onCommand };

48
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/vmi.js

@ -0,0 +1,48 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import { ref } from "vue";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js";
import request, { getUrl } from "../../request/index.js";
export default {
components: { AppList, AppCheck },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" />`,
setup() {
const appListRef = ref(null);
const visable = ref(false);
const data = ref(null);
const route = useRoute();
const businessType = route.meta.businessType;
const config = useConfig(businessType, "cai-wu");
const onCommand = async (item, rows) => {
// if (item.path === "export-group") {
// const url = config.edit.exportUrl;
// const method = config.edit.exportMethod;
// const postData = {
// filters: [
// {
// logic: "and",
// column: "invGroupNum",
// action: "equal",
// value: rows[0]["invGroupNum"],
// },
// ],
// };
// const getUrl = getUrl;
// await appListRef.value.onClick(async () => {
// const response = await request(url, postData, { method });
// if (!response.errors) {
// window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
// }
// });
// } else if (item.path === "invbillNum" || item.path === "invGroupNum") {
// data.value = { [item.path]: rows[0][item.path] };
// visable.value = true;
// }
// console.log(item.path, item, rows);
};
return { appListRef, config, onCommand, visable, data };
},
};

16
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -245,7 +245,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
{ {
try try
{ {
var pubSaDelItems = await GetPubSaDelItemsAsync(id); var pubSaDelItems = await GetPubSaDelItemsAsync(id).ConfigureAwait(false);
pubSas.AddRange(pubSaDelItems.pubSas); pubSas.AddRange(pubSaDelItems.pubSas);
pubSaDetails.AddRange(pubSaDelItems.pubSaDetails); pubSaDetails.AddRange(pubSaDelItems.pubSaDetails);
@ -460,6 +460,19 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
//验证客户对应厂内零件号是否存在 //验证客户对应厂内零件号是否存在
//导入的零件号集合 //导入的零件号集合
var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct(); var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct();
importPubSaLUs.ForEach(importPubSaLU =>
{
List<string> lus = importPubSaLU.Split(" ").ToList();
importPubSaLU = lus[0].Replace(" ", "");
if (lus.Count > 1)
{
lus.RemoveAt(0);
var luAssemble = lus.Select(t => t.Replace(" ", ""));
importPubSaLU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
});
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
@ -646,6 +659,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
List<PUB_NOT_SA_DETAIL> pubNotSaDetails = new List<PUB_NOT_SA_DETAIL>(); List<PUB_NOT_SA_DETAIL> pubNotSaDetails = new List<PUB_NOT_SA_DETAIL>();
var pubSaEntity = await _repository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false); var pubSaEntity = await _repository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false);
//var pubSaEntity = await _repository.FindAsync(id).ConfigureAwait(false);
if (pubSaEntity != null) if (pubSaEntity != null)
{ {
//结算单据 //结算单据

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs

@ -39,7 +39,7 @@ public class JisHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService
EnumDeliverSubBillType.HBPO, EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO EnumDeliverSubBillType.HBPO
}, },
BusinessType = EnumBusinessType.MaiDanJianHBPO BusinessType = EnumBusinessType.JisHBPO
}; };
} }

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

@ -8,7 +8,6 @@ using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
@ -88,11 +87,10 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
/// <summary> /// <summary>
/// 同步JitRecord /// 同步JitRecord
/// </summary> /// </summary>
[UnitOfWork]
private async Task SyncJitRecordAsync() private async Task SyncJitRecordAsync()
{ {
//同步表名称 //同步表名称
var syncTableName = "JisBBACSeSync_Jit"; var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jit";
//同步发运主类型 //同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型 //同步发运子类型
@ -152,11 +150,10 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
/// <summary> /// <summary>
/// 同步JisRecord /// 同步JisRecord
/// </summary> /// </summary>
[UnitOfWork]
private async Task SyncJisRecordAsync() private async Task SyncJisRecordAsync()
{ {
//同步表名称 //同步表名称
var syncTableName = "JisBBACSeSync_Jit"; var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jis";
//同步发运主类型 //同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型 //同步发运子类型

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -103,8 +103,8 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
var lus = entityList.Select(p => new { p.LU, p.ContractNo }); var lus = entityList.Select(p => p.LU);
var priceListModelEntitys = _priceListRepository.Where(t => lus.Contains(new { t.LU, t.ContractNo })).ToList(); var priceListModelEntitys = _priceListRepository.Where(t => t.ContractNo == contractNo && lus.Contains(t.ContractNo)).ToList();
if (priceListModelEntitys.Any()) if (priceListModelEntitys.Any())
{ {
await _priceListRepository.DeleteManyAsync(priceListModelEntitys).ConfigureAwait(false); await _priceListRepository.DeleteManyAsync(priceListModelEntitys).ConfigureAwait(false);

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using Shouldly; using Shouldly;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
@ -61,6 +62,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var entityList = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result); var entityList = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result);
entityList = entityList.GroupBy(p => new { p.LU, p.ClientCode, p.BeginDate, p.EndDate }).Select(p => p.FirstOrDefault()).ToList(); entityList = entityList.GroupBy(p => new { p.LU, p.ClientCode, p.BeginDate, p.EndDate }).Select(p => p.FirstOrDefault()).ToList();
var contractNo = entityList.FirstOrDefault().ContractNo;
#region 校验 #region 校验
if (entityList.Any()) if (entityList.Any())
@ -81,8 +83,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
var lus = entityList.Select(p => new { p.LU, p.ContractNo }); var lus = entityList.Select(p => p.LU);
var priceListModelEntitys = _repository.Where(t => lus.Contains(new { t.LU, t.ContractNo })).ToList(); var priceListModelEntitys = _repository.Where(t => t.ContractNo == contractNo && lus.Contains(t.ContractNo)).ToList();
if (priceListModelEntitys.Any()) if (priceListModelEntitys.Any())
{ {
await _repository.DeleteManyAsync(priceListModelEntitys).ConfigureAwait(false); await _repository.DeleteManyAsync(priceListModelEntitys).ConfigureAwait(false);

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs

@ -65,7 +65,7 @@ public class JisBBACEidSeCompareExport
/// </summary> /// </summary>
[Display(Name = "发货日期")] [Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime ShippingDate { get; set; } public DateTime? ShippingDate { get; set; }
/// <summary> /// <summary>
/// 生产码 /// 生产码
/// </summary> /// </summary>
@ -119,13 +119,13 @@ public class JisBBACEidSeCompareExport
/// </summary> /// </summary>
[Display(Name = "客户下线时间")] [Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")] [ExporterHeader(DisplayName = "客户下线时间")]
public DateTime AssemblyDate { get; set; } public DateTime? AssemblyDate { get; set; }
/// <summary> /// <summary>
/// 小总成号 /// 小总成号
/// </summary> /// </summary>
[Display(Name = "小总成号")] [Display(Name = "小总成号")]
[ExporterHeader(DisplayName = "小总成号")] [ExporterHeader(DisplayName = "小总成号")]
public DateTime MatchNumber { get; set; } public string MatchNumber { get; set; }
/// <summary> /// <summary>
/// 注塑码 /// 注塑码
/// </summary> /// </summary>

338
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs

@ -16,109 +16,107 @@ public class PubSaSeCompareDiff
/// </summary> /// </summary>
[Display(Name = "Wms发货单号")] [Display(Name = "Wms发货单号")]
public string WmsBillNum { get; set; } public string WmsBillNum { get; set; }
/// <summary> /// <summary>
/// 发货日期 /// 发货日期
/// </summary> /// </summary>
[Display(Name = "发货日期")] [Display(Name = "发货日期")]
public DateTime ShippingDate { get; set; } public DateTime ShippingDate { get; set; }
/// <summary> /// <summary>
/// 日顺序号 /// 日顺序号
/// </summary> /// </summary>
[Display(Name = "日顺序号")] [Display(Name = "日顺序号")]
public string SeqNumber { get; set; } public string SeqNumber { get; set; }
/// <summary> /// <summary>
/// PJIS日顺序号 /// PJIS日顺序号
/// </summary> /// </summary>
[Display(Name = "PJIS日顺序号")] [Display(Name = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; } public string PJISSeqNumber { get; set; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
public string MaterialNumber { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
public string MaterialDes { get; set; }
/// <summary> /// <summary>
/// 结算数据中的过账日期 /// 结算数据中的过账日期
/// </summary> /// </summary>
[Display(Name = "客户下线时间")] [Display(Name = "客户下线时间")]
public DateTime CustomerOfflineTime { get; set; } public DateTime CustomerOfflineTime { get; set; }
/// <summary> /// <summary>
/// 结算数量 /// 结算数量
/// </summary> /// </summary>
[Display(Name = "结算数量")] [Display(Name = "结算数量")]
public decimal SAQty { get; set; } public decimal SAQty { get; set; }
/// <summary> /// <summary>
/// 发货数量 /// 发货数量
/// </summary> /// </summary>
[Display(Name = "发货数量")] [Display(Name = "发货数量")]
public decimal SEQty { get; set; } public decimal SEQty { get; set; }
/// <summary> /// <summary>
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[Display(Name = "差异数量")] [Display(Name = "差异数量")]
public decimal DiffQty => SAQty - SEQty; public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
/// </summary> /// </summary>
[Display(Name = "匹配类型")] [Display(Name = "匹配类型")]
public string MateType { get; set; } public string MateType { get; set; }
/// <summary> /// <summary>
/// 定价 /// 定价
/// </summary> /// </summary>
[Display(Name = "定价")] [Display(Name = "定价")]
public decimal FixPrice { get; set; } public decimal FixPrice { get; set; }
/// <summary> /// <summary>
/// 原始零件 /// 生产
/// </summary> /// </summary>
[Display(Name = "原始零件号")] [Display(Name = "生产号")]
public string PrimitiveLU { get; set; } public string PN { set; get; }
/// <summary> /// <summary>
/// 替换零件号 /// WMS目标库位
/// </summary> /// </summary>
[Display(Name = "替换零件号")] [Display(Name = "WMS目标库位")]
public string ReplaceLU { get; set; } public string ToLocCode { get; set; }
/// <summary> /// <summary>
/// 零件号 /// ERP目标库位
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "ERP目标库位")]
public string SeLU { set; get; } public string ToErpLocCode { get; set; }
/// <summary> /// <summary>
/// 零件号 /// 类型
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "类型")]
public string SaLU { set; get; } public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary> /// <summary>
/// 生产 /// 发运客户物料
/// </summary> /// </summary>
[Display(Name = "生产号")] public string SeCustomerPartCode { get; set; }
public string PN { set; get; }
/// <summary> /// <summary>
/// 类型 /// 发运厂内物料号
/// </summary> /// </summary>
[Display(Name = "类型")] public string SeFactoryPartCode { get; set; }
public EnumPubSaSeCompareCategory Category { get; set; } /// <summary>
/// 结算客户物料号
/// </summary>
public string SaCustomerPartCode { get; set; }
/// <summary>
/// 结算厂内物料号
/// </summary>
public string SaFactoryPartCode { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内物料号
/// </summary>
[Display(Name = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 是否已经移除 /// 是否已经移除
/// </summary> /// </summary>
@ -172,35 +170,30 @@ public class PubSaSeCompareDetailExport2
[Display(Name = "生产码")] [Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")] [ExporterHeader(DisplayName = "ASN发货单号")]
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 物料 /// 客户零件
/// </summary> /// </summary>
[Display(Name = "物料号")] [Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "厂内物料号")] [ExporterHeader(DisplayName = "客户零件号")]
public string MaterialNumber { get; set; } public string CustomerPartCode { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 零件描述
/// </summary> /// </summary>
[Display(Name = "物料描述")] [Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "零件描述")]
public string MaterialDes { get; set; } public string PartCodeDesc { get; set; }
/// <summary> /// <summary>
/// 原始LU /// 厂内零件号
/// </summary> /// </summary>
[Display(Name = "原始LU")] [Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "原始LU")] [ExporterHeader(DisplayName = "厂内零件号")]
public string PrimitiveLU { get; set; } public string FactoryPartCode { get; set; }
/// <summary> /// <summary>
///替换LU /// 替换厂内零件号
/// </summary> /// </summary>
[Display(Name = "替换LU")] [Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换LU")] [ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceLU { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 结算数据中的过账日期 /// 结算数据中的过账日期
/// </summary> /// </summary>
@ -288,21 +281,18 @@ public interface IPubSaSeCompareDetailExport
[ValueMapping("有结算无发运", 2)] [ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)] [ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; } public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 零件描述
/// </summary> /// </summary>
[Display(Name = "物料描述")] [Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; } public string PartCodeDesc { get; set; }
/// <summary> /// <summary>
///替换LU /// 替换厂内零件号
/// </summary> /// </summary>
[Display(Name = "替换LU")] [Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换LU")] [ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceLU { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 结算数量 /// 结算数量
/// </summary> /// </summary>
@ -325,18 +315,18 @@ public interface IPubSaSeCompareDetailExport
public class PubSaSeCompareSumExport public class PubSaSeCompareSumExport
{ {
/// <summary> /// <summary>
/// LU /// 厂内物料号
/// </summary> /// </summary>
[Display(Name = "LU")] [Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "LU")] [ExporterHeader(DisplayName = "LU")]
public string LU { get; set; } public string FactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 物料描述
/// </summary> /// </summary>
[Display(Name = "物料描述")] [Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; } public string PartCodeDesc { get; set; }
/// <summary> /// <summary>
/// 结算数量 /// 结算数量
@ -398,35 +388,30 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp
[Display(Name = "生产码")] [Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")] [ExporterHeader(DisplayName = "ASN发货单号")]
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 物料 /// 客户零件
/// </summary> /// </summary>
[Display(Name = "物料号")] [Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "厂内物料号")] [ExporterHeader(DisplayName = "客户零件号")]
public string MaterialNumber { get; set; } public string CustomerPartCode { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 零件描述
/// </summary> /// </summary>
[Display(Name = "物料描述")] [Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "零件描述")]
public string MaterialDes { get; set; } public string PartCodeDesc { get; set; }
/// <summary> /// <summary>
/// 原始LU /// 厂内零件号
/// </summary> /// </summary>
[Display(Name = "原始LU")] [Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "原始LU")] [ExporterHeader(DisplayName = "厂内零件号")]
public string PrimitiveLU { get; set; } public string FactoryPartCode { get; set; }
/// <summary> /// <summary>
///替换LU /// 替换厂内零件号
/// </summary> /// </summary>
[Display(Name = "替换LU")] [Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换LU")] [ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceLU { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 结算数据中的过账日期 /// 结算数据中的过账日期
/// </summary> /// </summary>
@ -522,35 +507,30 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp
[Display(Name = "生产码")] [Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")] [ExporterHeader(DisplayName = "ASN发货单号")]
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 物料 /// 客户零件
/// </summary> /// </summary>
[Display(Name = "物料号")] [Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "厂内物料号")] [ExporterHeader(DisplayName = "客户零件号")]
public string MaterialNumber { get; set; } public string CustomerPartCode { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 零件描述
/// </summary> /// </summary>
[Display(Name = "物料描述")] [Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "零件描述")]
public string MaterialDes { get; set; } public string PartCodeDesc { get; set; }
/// <summary> /// <summary>
/// 原始LU /// 厂内零件号
/// </summary> /// </summary>
[Display(Name = "原始LU")] [Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "原始LU")] [ExporterHeader(DisplayName = "厂内零件号")]
public string PrimitiveLU { get; set; } public string FactoryPartCode { get; set; }
/// <summary> /// <summary>
///替换LU /// 替换厂内零件号
/// </summary> /// </summary>
[Display(Name = "替换LU")] [Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换LU")] [ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceLU { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 结算数据中的过账日期 /// 结算数据中的过账日期
/// </summary> /// </summary>
@ -646,35 +626,30 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo
[Display(Name = "生产码")] [Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")] [ExporterHeader(DisplayName = "索引号")]
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 物料 /// 客户零件
/// </summary> /// </summary>
[Display(Name = "物料号")] [Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "厂内物料号")] [ExporterHeader(DisplayName = "客户零件号")]
public string MaterialNumber { get; set; } public string CustomerPartCode { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 零件描述
/// </summary> /// </summary>
[Display(Name = "物料描述")] [Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "零件描述")]
public string MaterialDes { get; set; } public string PartCodeDesc { get; set; }
/// <summary> /// <summary>
/// 原始LU /// 厂内零件号
/// </summary> /// </summary>
[Display(Name = "原始LU")] [Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "原始LU")] [ExporterHeader(DisplayName = "厂内零件号")]
public string PrimitiveLU { get; set; } public string FactoryPartCode { get; set; }
/// <summary> /// <summary>
///替换LU /// 替换厂内零件号
/// </summary> /// </summary>
[Display(Name = "替换LU")] [Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换LU")] [ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceLU { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 结算数据中的过账日期 /// 结算数据中的过账日期
/// </summary> /// </summary>
@ -770,35 +745,30 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPu
[Display(Name = "生产码")] [Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")] [ExporterHeader(DisplayName = "索引号")]
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 物料 /// 客户零件
/// </summary> /// </summary>
[Display(Name = "物料号")] [Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "厂内物料号")] [ExporterHeader(DisplayName = "客户零件号")]
public string MaterialNumber { get; set; } public string CustomerPartCode { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 零件描述
/// </summary> /// </summary>
[Display(Name = "物料描述")] [Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "零件描述")]
public string MaterialDes { get; set; } public string PartCodeDesc { get; set; }
/// <summary> /// <summary>
/// 原始LU /// 厂内零件号
/// </summary> /// </summary>
[Display(Name = "原始LU")] [Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "原始LU")] [ExporterHeader(DisplayName = "厂内零件号")]
public string PrimitiveLU { get; set; } public string FactoryPartCode { get; set; }
/// <summary> /// <summary>
///替换LU /// 替换厂内零件号
/// </summary> /// </summary>
[Display(Name = "替换LU")] [Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换LU")] [ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceLU { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 结算数据中的过账日期 /// 结算数据中的过账日期
/// </summary> /// </summary>
@ -894,83 +864,71 @@ public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, I
[Display(Name = "生产码")] [Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")] [ExporterHeader(DisplayName = "ASN发货单号")]
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 物料号 /// 客户物料号
/// </summary> /// </summary>
[Display(Name = "物料号")] [Display(Name = "客户物料号")]
[ExporterHeader(DisplayName = "厂内物料号")] [ExporterHeader(DisplayName = "客户物料号")]
public string MaterialNumber { get; set; } public string CustomerPartCode { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 物料描述
/// </summary> /// </summary>
[Display(Name = "物料描述")] [Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; } public string PartCodeDesc { get; set; }
/// <summary> /// <summary>
/// 原始LU /// 厂内物料号
/// </summary> /// </summary>
[Display(Name = "原始LU")] [Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "原始LU")] [ExporterHeader(DisplayName = "厂内物料号")]
public string PrimitiveLU { get; set; } public string FactoryPartCode { get; set; }
/// <summary> /// <summary>
///替换LU /// 替换厂内物料号
/// </summary> /// </summary>
[Display(Name = "替换LU")] [Display(Name = "替换厂内物料号")]
[ExporterHeader(DisplayName = "替换LU")] [ExporterHeader(DisplayName = "替换厂内物料号")]
public string ReplaceLU { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 结算数据中的过账日期 /// 结算数据中的过账日期
/// </summary> /// </summary>
[Display(Name = "客户下线时间")] [Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")] [ExporterHeader(DisplayName = "客户下线时间")]
public DateTime CustomerOfflineTime { get; set; } public DateTime CustomerOfflineTime { get; set; }
/// <summary> /// <summary>
/// 结算数量 /// 结算数量
/// </summary> /// </summary>
[Display(Name = "结算数量")] [Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")] [ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; } public decimal SAQty { get; set; }
/// <summary> /// <summary>
/// 发货数量 /// 发货数量
/// </summary> /// </summary>
[Display(Name = "发货数量")] [Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")] [ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; } public decimal SEQty { get; set; }
/// <summary> /// <summary>
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty; public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
/// </summary> /// </summary>
[Display(Name = "匹配类型")] [Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")] [ExporterHeader(DisplayName = "是否完全匹配")]
public string MateType { get; set; } public string MateType { get; set; }
/// <summary> /// <summary>
/// 定价 /// 定价
/// </summary> /// </summary>
[Display(Name = "定价")] [Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")] [ExporterHeader(DisplayName = "定价")]
public decimal FixPrice { get; set; } public decimal FixPrice { get; set; }
/// <summary> /// <summary>
/// WMS目标库位 /// WMS目标库位
/// </summary> /// </summary>
[Display(Name = "WMS目标库位")] [Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")] [ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; } public string ToLocCode { get; set; }
/// <summary> /// <summary>
/// ERP目标库位 /// ERP目标库位
/// </summary> /// </summary>

14
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs

@ -35,15 +35,13 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
} }
string strSqlText = @$" string strSqlText = @$"
SELECT SELECT
A.LU AS SeCustomerPartCode,
A.FactoryPartCode AS SeFactoryPartCode,
B.LU AS SaCustomerPartCode,
B.PartCode AS SaFactoryPartCode,
A.WmsBillNum, A.WmsBillNum,
A.ShippingDate, A.ShippingDate,
A.LU AS MaterialNumber,
A.FactoryPartCode AS PrimitiveLU,
A.FactoryPartCode AS ReplaceLU,
'' MaterialDes,
B.SettleDate CustomerOfflineTime, B.SettleDate CustomerOfflineTime,
A.LU SeLU,
B.LU SaLU,
ISNULL(A.PN,B.PN) PN, ISNULL(A.PN,B.PN) PN,
A.SEQty, A.SEQty,
B.SAQty, B.SAQty,
@ -52,8 +50,8 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
A.ToLocCode, A.ToLocCode,
A.ToErpLocCode A.ToErpLocCode
FROM FROM
(SELECT SUM(QTY) SEQty,LU,PN,FactoryPartCode,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate,MAX(PartCode) PartCode, MAX(ToLocCode) ToLocCode, MAX(ToErpLocCode) ToErpLocCode FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} {strSeWhere} GROUP BY LU,PN,FactoryPartCode) A (SELECT SUM(QTY) SEQty,LU,PN,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate,MAX(FactoryPartCode) FactoryPartCode, MAX(ToLocCode) ToLocCode, MAX(ToErpLocCode) ToErpLocCode FROM Set_PUB_SE_DETAIL WHERE BusinessType={businessType} {strSeWhere} GROUP BY LU,PN) A
FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate FROM Set_PUB_SA_DETAIL WHERE BusinessType = {businessType} AND Version = {version} GROUP BY LU,PN) B ON A.LU= B.LU AND A.PN= B.PN FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate,MAX(PartCode) PartCode FROM Set_PUB_SA_DETAIL WHERE BusinessType={businessType} AND Version={version} GROUP BY LU,PN) B ON A.LU=B.LU AND A.PN=B.PN
ORDER BY B.SettleDate DESC; ORDER BY B.SettleDate DESC;
"; ";
return DbConnection.Query<PubSaSeCompareDiff>(strSqlText, null, null, true, 1200, null).ToList(); return DbConnection.Query<PubSaSeCompareDiff>(strSqlText, null, null, true, 1200, null).ToList();

114
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACEdiSeCompareExportService.cs

@ -68,25 +68,20 @@ namespace SettleAccount.Job.Services.Report
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value; var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value;
var seStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value; var seStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var filename = exportName.FirstOrDefault();
//有EDI的发运数据 //有EDI无发运
// var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => var haveEdiNotHaveSe = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsHaveSeData == false)
//t.First().SetQty(t.Sum(q => q.Qty))).ToList(); .GroupBy(t => new { t.LU, t.PN })
var seDetailGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }).ToList(); .Select(t => new JisBBACEidSeCompareExport()
// var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t =>
//t.FirstOrDefault()).ToList();
var dddd = new JisBBACEidSeCompareExport()
{ {
Category = default, Category = "JIS",
WmsBillNum = default, WmsBillNum = default,
CarModeCode = default, CarModeCode = default,
LineStationcode = default, LineStationcode = default,
SequenceNumber = default, SequenceNumber = default,
ParType = default, ParType = default,
MESConfigCode = default, MESConfigCode = default,
ShippingDate = default, ShippingDate = null,
PN = default, PN = default,
= default, = default,
PJIS日顺序号 = default, PJIS日顺序号 = default,
@ -95,14 +90,16 @@ namespace SettleAccount.Job.Services.Report
SEQty = default, SEQty = default,
EdiQty = default, EdiQty = default,
DiffQty = default, DiffQty = default,
AssemblyDate = default, AssemblyDate = null,
MatchNumber = default, MatchNumber = default,
InjectionCode = default, InjectionCode = default,
MateType = default, MateType = default,
DiffDesc = default DiffDesc = default
}; }).ToList();
//无EDI有发运
var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => new JisBBACEidSeCompareExport() var notHaveEdiHaveSe = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisBBACEidSeCompareExport()
{ {
Category = default, Category = default,
WmsBillNum = default, WmsBillNum = default,
@ -111,7 +108,7 @@ namespace SettleAccount.Job.Services.Report
SequenceNumber = default, SequenceNumber = default,
ParType = default, ParType = default,
MESConfigCode = default, MESConfigCode = default,
ShippingDate = default, ShippingDate = null,
PN = default, PN = default,
= default, = default,
PJIS日顺序号 = default, PJIS日顺序号 = default,
@ -120,15 +117,74 @@ namespace SettleAccount.Job.Services.Report
SEQty = default, SEQty = default,
EdiQty = default, EdiQty = default,
DiffQty = default, DiffQty = default,
AssemblyDate = default, AssemblyDate = null,
MatchNumber = default, MatchNumber = default,
InjectionCode = default, InjectionCode = default,
MateType = default, MateType = default,
DiffDesc = default DiffDesc = default
}).ToList(); }).ToList();
var haveEidSesGroup22 = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true)?.GroupBy(t => new { t.PN, t.LU }).Select(t =>
t.FirstOrDefault()).ToList(); // //有EDI的发运数据
// //var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t =>
// //t.First().SetQty(t.Sum(q => q.Qty))).ToList();
// var seDetailGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }).ToList();
// // var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t =>
// //t.FirstOrDefault()).ToList();
// var dddd = new JisBBACEidSeCompareExport()
// {
// Category = default,
// WmsBillNum = default,
// CarModeCode = default,
// LineStationcode = default,
// SequenceNumber = default,
// ParType = default,
// MESConfigCode = default,
// ShippingDate = default,
// PN = default,
// 序列号 = default,
// PJIS日顺序号 = default,
// MaterialNumber = default,
// MaterialDes = default,
// SEQty = default,
// EdiQty = default,
// DiffQty = default,
// AssemblyDate = default,
// MatchNumber = default,
// InjectionCode = default,
// MateType = default,
// DiffDesc = default
// };
// var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => new JisBBACEidSeCompareExport()
// {
// Category = default,
// WmsBillNum = default,
// CarModeCode = default,
// LineStationcode = default,
// SequenceNumber = default,
// ParType = default,
// MESConfigCode = default,
// ShippingDate = default,
// PN = default,
// 序列号 = default,
// PJIS日顺序号 = default,
// MaterialNumber = default,
// MaterialDes = default,
// SEQty = default,
// EdiQty = default,
// DiffQty = default,
// AssemblyDate = default,
// MatchNumber = default,
// InjectionCode = default,
// MateType = default,
// DiffDesc = default
// }).ToList();
// var haveEidSesGroup22 = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true)?.GroupBy(t => new { t.PN, t.LU }).Select(t =>
//t.FirstOrDefault()).ToList();
//有发运的EDI数据 //有发运的EDI数据
//var haveSeEidsGroup = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => t.First().SetQty(t.Sum(q => q.Qty))).ToList(); //var haveSeEidsGroup = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => t.First().SetQty(t.Sum(q => q.Qty))).ToList();
@ -173,16 +229,16 @@ t.FirstOrDefault()).ToList();
////无EDI有发运 ////无EDI有发运
//var notHaveEdiHaveSeCompareExports = haveEidHaveSes.ToList(); //var notHaveEdiHaveSeCompareExports = haveEidHaveSes.ToList();
//ExcelExporter excelExporter = new ExcelExporter(); ExcelExporter excelExporter = new ExcelExporter();
//excelExporter excelExporter
// .Append(haveEdiNotHaveSeCompareExports, $"BBACEDI数据和发货对比") .Append(haveEdiNotHaveSe.ToList(), $"BBACEDI数据和发货对比")
// .SeparateBySheet() .SeparateBySheet()
// .Append(notHaveEdiHaveSeCompareExports, $"BBAC发货和EDI数据对比") .Append(notHaveEdiHaveSe.ToList(), $"BBAC发货和EDI数据对比")
// .SeparateBySheet(); .SeparateBySheet();
//var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
//result.ShouldNotBeNull(); result.ShouldNotBeNull();
////_fileContainer.SaveAsync(filename, result.Result, true); _fileContainer.SaveAsync(filename, result.Result, true);
//Notify(); //Notify();
return id.ToString(); return id.ToString();

56
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

@ -108,13 +108,41 @@ namespace SettleAccount.Job.Services.Report
pubSaSeCompareDiffs.ForEach(p => pubSaSeCompareDiffs.ForEach(p =>
{ {
p.Category = (string.IsNullOrEmpty(p.SaLU), string.IsNullOrEmpty(p.SeLU)) switch p.Category = (string.IsNullOrEmpty(p.SaCustomerPartCode), string.IsNullOrEmpty(p.SeCustomerPartCode)) switch
{ {
(false, false) => EnumPubSaSeCompareCategory.HaveSaHaveSe, (false, false) => EnumPubSaSeCompareCategory.HaveSaHaveSe,
(false, true) => EnumPubSaSeCompareCategory.HaveSaNotHaveSe, (false, true) => EnumPubSaSeCompareCategory.HaveSaNotHaveSe,
(true, false) => EnumPubSaSeCompareCategory.NotHaveSaHaveSe, (true, false) => EnumPubSaSeCompareCategory.NotHaveSaHaveSe,
_ => EnumPubSaSeCompareCategory.None, _ => EnumPubSaSeCompareCategory.None,
}; };
switch (p.Category)
{
case EnumPubSaSeCompareCategory.None:
break;
case EnumPubSaSeCompareCategory.HaveSaHaveSe:
{
p.CustomerPartCode = p.SaCustomerPartCode;
p.FactoryPartCode = p.SaFactoryPartCode;
p.ReplaceFactoryPartCode = p.SaFactoryPartCode;
}
break;
case EnumPubSaSeCompareCategory.HaveSaNotHaveSe:
{
p.CustomerPartCode = p.SaCustomerPartCode;
p.FactoryPartCode = p.SaFactoryPartCode;
p.ReplaceFactoryPartCode = p.SaFactoryPartCode;
}
break;
case EnumPubSaSeCompareCategory.NotHaveSaHaveSe:
{
p.CustomerPartCode = p.SeCustomerPartCode;
p.FactoryPartCode = p.SeFactoryPartCode;
p.ReplaceFactoryPartCode = p.SeFactoryPartCode;
}
break;
default:
break;
}
}); });
//有结算有发运 //有结算有发运
@ -187,7 +215,7 @@ namespace SettleAccount.Job.Services.Report
if (string.IsNullOrEmpty(lu) == false) if (string.IsNullOrEmpty(lu) == false)
{ {
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.SaLU == lu || p.SeLU == lu); pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.CustomerPartCode == lu);
} }
if (string.IsNullOrEmpty(pn) == false) if (string.IsNullOrEmpty(pn) == false)
{ {
@ -247,10 +275,10 @@ namespace SettleAccount.Job.Services.Report
public ExcelExporter BindExcelExporter<T>(List<T> pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport, new() public ExcelExporter BindExcelExporter<T>(List<T> pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport, new()
{ {
//结算核对汇总 //结算核对汇总
var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport()
{ {
LU = p.Key, FactoryPartCode = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty), SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty) SEQty = p.Sum(t => t.SEQty)
}).ToList(); }).ToList();
@ -258,30 +286,30 @@ namespace SettleAccount.Job.Services.Report
//有结算有发运 //有结算有发运
var haveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe); var haveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
//有结算有发运汇总 //有结算有发运汇总
var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport()
{ {
LU = p.Key, FactoryPartCode = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty), SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty) SEQty = p.Sum(t => t.SEQty)
}).ToList(); }).ToList();
//有结算无发运 //有结算无发运
var haveSaNotHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe); var haveSaNotHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe);
//有结算无发运 //有结算无发运
var haveSaNotHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() var haveSaNotHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport()
{ {
LU = p.Key, FactoryPartCode = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty), SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty) SEQty = p.Sum(t => t.SEQty)
}).ToList(); }).ToList();
//无结算有发运 //无结算有发运
var notHaveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe); var notHaveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe);
//无结算有发运 //无结算有发运
var notHaveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() var notHaveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport()
{ {
LU = p.Key, FactoryPartCode = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty), SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty) SEQty = p.Sum(t => t.SEQty)
}).ToList(); }).ToList();

25
code/src/Shared/Win.Sfs.Shared/Filter/FilterExtensions.cs

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
@ -38,6 +38,10 @@ namespace Win.Sfs.Shared.Filter
foreach (var filterCondition in filterConditionList) foreach (var filterCondition in filterConditionList)
{ {
if (!typeof(T).GetProperties().Any(o => o.Name.ToLowerInvariant() == filterCondition.Column.ToLowerInvariant()))
{
break;
}
var tempCondition = CreateLambda<T>(filterCondition); var tempCondition = CreateLambda<T>(filterCondition);
if (condition == null) if (condition == null)
{ {
@ -59,7 +63,7 @@ namespace Win.Sfs.Shared.Filter
throw new Exception($"获取筛选条件异常:{ex.Message}"); throw new Exception($"获取筛选条件异常:{ex.Message}");
} }
return condition; return condition == null ? p => true : condition;
} }
private static Expression<Func<T, bool>> CreateLambda<T>(FilterCondition filterCondition) private static Expression<Func<T, bool>> CreateLambda<T>(FilterCondition filterCondition)
@ -83,33 +87,43 @@ namespace Win.Sfs.Shared.Filter
case EnumFilterAction.Equal: case EnumFilterAction.Equal:
expression = Expression.Lambda<Func<T, bool>>(Expression.Equal(member, constant), parameter); expression = Expression.Lambda<Func<T, bool>>(Expression.Equal(member, constant), parameter);
break; break;
case EnumFilterAction.NotEqual: case EnumFilterAction.NotEqual:
expression = Expression.Lambda<Func<T, bool>>(Expression.NotEqual(member, constant), parameter); expression = Expression.Lambda<Func<T, bool>>(Expression.NotEqual(member, constant), parameter);
break; break;
case EnumFilterAction.BiggerThan: case EnumFilterAction.BiggerThan:
expression = Expression.Lambda<Func<T, bool>>(Expression.GreaterThan(member, constant), parameter); expression = Expression.Lambda<Func<T, bool>>(Expression.GreaterThan(member, constant), parameter);
break; break;
case EnumFilterAction.SmallThan: case EnumFilterAction.SmallThan:
expression = Expression.Lambda<Func<T, bool>>(Expression.LessThan(member, constant), parameter); expression = Expression.Lambda<Func<T, bool>>(Expression.LessThan(member, constant), parameter);
break; break;
case EnumFilterAction.BiggerThanOrEqual: case EnumFilterAction.BiggerThanOrEqual:
expression = Expression.Lambda<Func<T, bool>>(Expression.GreaterThanOrEqual(member, constant), parameter); expression = Expression.Lambda<Func<T, bool>>(Expression.GreaterThanOrEqual(member, constant), parameter);
break; break;
case EnumFilterAction.SmallThanOrEqual: case EnumFilterAction.SmallThanOrEqual:
expression = Expression.Lambda<Func<T, bool>>(Expression.LessThanOrEqual(member, constant), parameter); expression = Expression.Lambda<Func<T, bool>>(Expression.LessThanOrEqual(member, constant), parameter);
break; break;
case EnumFilterAction.Like: case EnumFilterAction.Like:
expression = GetExpressionLikeMethod<T>("Contains", filterCondition); expression = GetExpressionLikeMethod<T>("Contains", filterCondition);
break; break;
case EnumFilterAction.NotLike: case EnumFilterAction.NotLike:
expression = GetExpressionNotLikeMethod<T>("Contains", filterCondition); expression = GetExpressionNotLikeMethod<T>("Contains", filterCondition);
break; break;
case EnumFilterAction.In: case EnumFilterAction.In:
expression = GetExpressionInMethod<T>("Contains", member.Type, filterCondition); expression = GetExpressionInMethod<T>("Contains", member.Type, filterCondition);
break; break;
case EnumFilterAction.NotIn: case EnumFilterAction.NotIn:
expression = GetExpressionNotInMethod<T>("Contains", member.Type, filterCondition); expression = GetExpressionNotInMethod<T>("Contains", member.Type, filterCondition);
break; break;
default: default:
break; break;
} }
@ -144,7 +158,6 @@ namespace Win.Sfs.Shared.Filter
var enumValue = (Enum)Enum.Parse(propertyType, value, true); var enumValue = (Enum)Enum.Parse(propertyType, value, true);
constant = Expression.Constant(enumValue); constant = Expression.Constant(enumValue);
} }
else else
{ {
constant = propertyType.Name switch constant = propertyType.Name switch
@ -182,7 +195,6 @@ namespace Win.Sfs.Shared.Filter
return Expression.Lambda<Func<T, bool>>(notMethodExpression, parameterExpression); return Expression.Lambda<Func<T, bool>>(notMethodExpression, parameterExpression);
} }
private static object GetPropertyValue(Type propertyType, string value) private static object GetPropertyValue(Type propertyType, string value)
{ {
Type lstType = typeof(List<>).MakeGenericType(propertyType); Type lstType = typeof(List<>).MakeGenericType(propertyType);
@ -211,7 +223,7 @@ namespace Win.Sfs.Shared.Filter
} }
else else
{ {
return p=>false; return p => false;
} }
} }
@ -232,7 +244,6 @@ namespace Win.Sfs.Shared.Filter
} }
} }
private static MethodCallExpression GetListMethodExpression(string methodName, Type propertyType, string propertyName, object propertyValue, ParameterExpression parameterExpression) private static MethodCallExpression GetListMethodExpression(string methodName, Type propertyType, string propertyName, object propertyValue, ParameterExpression parameterExpression)
{ {
var propertyExpression = Expression.Property(parameterExpression, propertyName); //p.GUID var propertyExpression = Expression.Property(parameterExpression, propertyName); //p.GUID
@ -242,7 +253,6 @@ namespace Win.Sfs.Shared.Filter
return Expression.Call(someValue, method, propertyExpression); return Expression.Call(someValue, method, propertyExpression);
} }
/// <summary> /// <summary>
/// 生成类似于p=>p.Code.Contains("xxx");的lambda表达式 /// 生成类似于p=>p.Code.Contains("xxx");的lambda表达式
/// parameterExpression标识p,propertyName表示values,propertyValue表示"Code",methodName表示Contains /// parameterExpression标识p,propertyName表示values,propertyValue表示"Code",methodName表示Contains
@ -309,6 +319,5 @@ namespace Win.Sfs.Shared.Filter
var inv = Expression.Invoke(condition, exp.Parameters); var inv = Expression.Invoke(condition, exp.Parameters);
return Expression.Lambda<Func<T, bool>>(Expression.And(exp.Body, inv), exp.Parameters); return Expression.Lambda<Func<T, bool>>(Expression.And(exp.Body, inv), exp.Parameters);
} }
} }
} }
Loading…
Cancel
Save