学 赵 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. 409
      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. 98
      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. 10
      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. 5
      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. 33
      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. 17
      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. 196
      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. 29
      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() {
// const url = "abp/application-configuration";
// 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 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 qs from "../lib/qs/shim.js";
import { useAppStore } from "../store/index.js";
import { refreshRouter } from "../router/index.js";
import Enumerable from "linq";
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 v-for="item in options" :key="item.key" :label="item.label" :name="item.value" />
</el-tabs>
<br />
</template>
<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'" />

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

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

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

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

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

@ -1,6 +1,7 @@
const schema = {
title: "用户",
type: "object",
disableSelection: true,
properties: {
userName: {
title: "用户名",
@ -59,10 +60,7 @@ const schema = {
title: "邮箱",
type: "string",
showForList: true,
rules: [
{ required: true },
{ pattern: "^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z]{2,4})+$", message: "%s必须是正确的格式" },
],
rules: [{ required: true }, { pattern: "^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z]{2,4})+$", message: "%s必须是正确的格式" }],
},
roleNames: {
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 service = null;
const syncService = "hand-se-sync/sync";
if (businessType === "JisBBAC") {
if (businessType === "JisBBAC" || businessType === "MaiDanJianBBAC") {
schema = schema1;
service = "bbac_se_detail_service";
} else if (businessType === "JisHBPO") {
} else if (businessType === "JisHBPO" || businessType === "MaiDanJianHBPO") {
schema = schema1;
service = "hbpo_se_detail_service";
} else {

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

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

98
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 { getFileName } from "../utils/index.js";
import settings from "../config/settings.js";
import { ElMessageBox } from "element-plus";
import { ElMessage, ElMessageBox } from "element-plus";
// const requestSettings = {
// baseURL: "/api",
// };
const addToken = async (options) => {
async function addToken(options) {
if (await isLogin()) {
const appStore = useAppStore();
options.headers ??= {};
options.headers.Authorization = `Bearer ${appStore.token}`;
}
};
}
const getUrl = (url) => {
function getUrl(url) {
if (url.startsWith("http")) {
return url;
}
let result = settings.baseURL;
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([
[200, "操作成功"],
[201, "已创建"],
@ -63,60 +54,15 @@ const getResult = async (response) => {
try {
result.errors = await response.json();
} catch (error) {
result.errors = error;
console.log(error);
}
ElMessageBox.alert(`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`, `${result.errors?.error?.code ?? "错误"}`);
}
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);
let defaultOptions = {
method: "POST",
@ -142,12 +88,28 @@ async function request(url, data, options, withoutToken = false) {
defaultOptions.body = JSON.stringify(data);
}
}
if (!withoutToken) {
await addToken(defaultOptions);
}
await addToken(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 { 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")],
},
{
...createPage("centralized-control", "title=期间设置"),
...createPage("version", "title=期间设置"),
children: [
createButton("query", "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 = "寄售库库存扣减审批") {
return {
...createPage(path, `title=${title}&businessType=${business}&client=${client}`),
component: "/settle/finance",
component: "/settle/vmi",
children: [
createButton("query", "title=查询&isTop=true"),
createButton("compare", "title=扣减审核通过&isTop=true"),
@ -192,7 +192,7 @@ export default [
},
{
...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=结算开票"),
@ -217,7 +217,7 @@ export default [
},
{
...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=结算开票"),
@ -247,7 +247,7 @@ export default [
},
{
...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=数据比对"),
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=结算开票"),
@ -290,7 +290,7 @@ export default [
},
{
...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=结算开票"),
@ -315,7 +315,7 @@ export default [
},
{
...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=结算开票"),

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

@ -1,7 +1,6 @@
import { defineStore } from "pinia";
import settings from "../config/settings.js";
import { getAccessToken, getUser, isLogin } from "../api/user.js";
import { get, post } from "../request/index.js";
import { refreshRouter } from "../router/index.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 {
min-height: calc(100% - 100px);
height: calc(100% - 100px);
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 };
},
};

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

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

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

@ -64,7 +64,10 @@ export default function (type) {
delete data["downLineDateTime"];
const result = await request(url, data, { method: "POST" }, true);
if (!result.errors) {
dialogVisable.value = false;
if (!result.data?.code || result.data.code === 200) {
dialogVisable.value = false;
await load();
}
}
} catch (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 businessType = route.meta.businessType;
const config = useConfig(businessType);
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
const onCommand = async (item) => {
if (item.path === "sync") {
const url = config.edit.syncUrl;
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 {
const url = "base/token";
const appStore = useAppStore();
const result = await request(url, model, { method: "POST" }, true);
const result = await request(url, model, { method: "POST" });
if (!result.errors) {
appStore.token = result.data.accessToken;
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 { getUrl } from "../../request/index.js";
import { ElMessage } from "element-plus";
import businessTypes from "../../models/_options.js";
export default {
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 #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-tabs>
<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-steps>
<div class="setup1" v-show="setupRef===1" style="height:calc(100% - 120px);">
<el-row style="padding:14px 0;height:60px;">
@ -82,28 +84,38 @@ export default {
</el-col>
</el-row>
</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-col style="height:100%;padding:0 5px 0 0;">
<el-scrollbar>
<h2>发票预览</h2>
<div>{{setup3Model}}</div>
<el-descriptions>
<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-col>
</el-row>
</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-col style="height:100%;padding:0 5px 0 0;">
<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-col>
</el-row>
</div>
<template #footer>
<template #footer v-if="setupRef!==4">
<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 class="dialog-footer">
<el-button type="primary" @click="next" v-if="setupRef<3">下一步</el-button>
@ -143,12 +155,12 @@ export default {
styles: html` <style>
.page-drawer .el-tab-pane {
width: 100%;
height: calc(100vh - 160px);
height: calc(100% - 160px);
}
.page-drawer .el-tabs__content,
.page-drawer .el-scrollbar {
width: 100%;
height: calc(100vh - 160px - 40px);
height: calc(100% - 160px - 40px);
}
.re-open .el-dialog__footer {
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["invGroupNum"];
//显示重开发票对话框
@ -331,7 +372,9 @@ export default {
const importDialogVisible = ref(false);
const setup2table1Ref = ref(null);
const setup2table2Ref = ref(null);
const setup3Model = ref(null);
const setup3Model = ref({
detail: [],
});
const showSetupDialog = () => {
//重开发票号
//invBillNum=
@ -504,7 +547,7 @@ export default {
} else if (result.data?.code === 400) {
ElMessage({
type: "error",
message: "校验失败",
message: "操作失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
@ -516,7 +559,7 @@ export default {
let service = null;
if (props.businessType === "JisBBAC") {
service = "bbac_ba_service";
} else if (bprops.usinessType === "JisHBPO") {
} else if (props.usinessType === "JisHBPO") {
service = "hbpo_ba_service";
} else {
service = "pub_ba_service";
@ -531,7 +574,7 @@ export default {
} else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({
type: "error",
message: "提交失败",
message: "操作失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
@ -545,7 +588,7 @@ export default {
} else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({
type: "error",
message: "提交失败",
message: "操作失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
@ -584,6 +627,7 @@ export default {
columns4,
columns5,
setup2columns,
setup3columns,
showSetupDialog,
setupRef,
setupDialogVisable,
@ -608,6 +652,7 @@ export default {
setup2table2Ref,
refreshRef,
setup3Model,
businessTypes,
};
},
};

33
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 { useRoute } from "vue-router";
import { ref } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import request from "../../request/index.js";
import request, { getUrl } from "../../request/index.js";
import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js";
@ -20,12 +19,7 @@ export default {
const config = useConfig(businessType, "shang-wu");
const onCommand = async (item, rows) => {
if (item.path === "approval" || item.path === "reject" || item.path === "receive") {
if (rows.length === 0) {
ElMessage({
type: "warning",
message: "没有选中的数据",
});
} else {
if (rows.length > 0) {
const message =
item.path === "approval"
? `确认审核通过选中的${rows.length}行数据吗?`
@ -34,18 +28,7 @@ export default {
: `确认选中的${rows.length}行数据客户已收票吗?`;
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;
try {
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;
}
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
}
} else if (item.path === "export-group") {
const url = config.edit.exportUrl;
@ -60,10 +43,12 @@ export default {
},
],
};
const response = await request(url, postData, { method });
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
await appListRef.value.onClick(async () => {
const response = await request(url, postData, { method }, true);
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;

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 };
},
};

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

@ -14,22 +14,11 @@ export default {
const route = useRoute();
const businessType = route.meta.businessType;
const config = useConfig(businessType, "unable");
const onCommand = async (item, rows) => {
const onCommand = async (item) => {
const url = config.edit.addUrl;
if (item.path === "add") {
try {
await ElMessageBox.confirm(`确认是否对所有符合查询条件的数据生成可结算单?`, "提示", {
type: "warning",
});
appListRef.value.tableLoading = true;
const data = appListRef.value.buildQuery();
const result = request(url, data, { method: "POST" });
console.log(result);
} catch (e) {
console.log(e);
} finally {
appListRef.value.tableLoading = false;
}
const data = appListRef.value.buildQuery();
await appListRef.value.onClick(() => request(url, data, { method: "POST" }, true), `确认是否对所有符合查询条件的数据生成可结算单?`, true);
}
};
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;
if (item.path === "add") {
const invbillNum = rows[0].billNum;
try {
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;
}
await appListRef.value.onClick(async () => await request(url, { invbillNum }, { method: "POST" }, true), `确认为${invbillNum}创建发票?`, true);
}
};
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
{
var pubSaDelItems = await GetPubSaDelItemsAsync(id);
var pubSaDelItems = await GetPubSaDelItemsAsync(id).ConfigureAwait(false);
pubSas.AddRange(pubSaDelItems.pubSas);
pubSaDetails.AddRange(pubSaDelItems.pubSaDetails);
@ -460,6 +460,19 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
//验证客户对应厂内零件号是否存在
//导入的零件号集合
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 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>();
var pubSaEntity = await _repository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false);
//var pubSaEntity = await _repository.FindAsync(id).ConfigureAwait(false);
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
},
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 SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships;
@ -88,11 +87,10 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
/// <summary>
/// 同步JitRecord
/// </summary>
[UnitOfWork]
private async Task SyncJitRecordAsync()
{
//同步表名称
var syncTableName = "JisBBACSeSync_Jit";
var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jit";
//同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型
@ -152,11 +150,10 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
/// <summary>
/// 同步JisRecord
/// </summary>
[UnitOfWork]
private async Task SyncJisRecordAsync()
{
//同步表名称
var syncTableName = "JisBBACSeSync_Jit";
var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jis";
//同步发运主类型
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 });
}
#endregion
var lus = entityList.Select(p => new { p.LU, p.ContractNo });
var priceListModelEntitys = _priceListRepository.Where(t => lus.Contains(new { t.LU, t.ContractNo })).ToList();
var lus = entityList.Select(p => p.LU);
var priceListModelEntitys = _priceListRepository.Where(t => t.ContractNo == contractNo && lus.Contains(t.ContractNo)).ToList();
if (priceListModelEntitys.Any())
{
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 System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
@ -61,6 +62,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
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();
var contractNo = entityList.FirstOrDefault().ContractNo;
#region 校验
if (entityList.Any())
@ -81,8 +83,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
var lus = entityList.Select(p => new { p.LU, p.ContractNo });
var priceListModelEntitys = _repository.Where(t => lus.Contains(new { t.LU, t.ContractNo })).ToList();
var lus = entityList.Select(p => p.LU);
var priceListModelEntitys = _repository.Where(t => t.ContractNo == contractNo && lus.Contains(t.ContractNo)).ToList();
if (priceListModelEntitys.Any())
{
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>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime ShippingDate { get; set; }
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
@ -119,13 +119,13 @@ public class JisBBACEidSeCompareExport
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime AssemblyDate { get; set; }
public DateTime? AssemblyDate { get; set; }
/// <summary>
/// 小总成号
/// </summary>
[Display(Name = "小总成号")]
[ExporterHeader(DisplayName = "小总成号")]
public DateTime MatchNumber { get; set; }
public string MatchNumber { get; set; }
/// <summary>
/// 注塑码
/// </summary>

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

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

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

@ -68,67 +68,123 @@ namespace SettleAccount.Job.Services.Report
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value;
var seStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
//有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();
var filename = exportName.FirstOrDefault();
//有EDI无发运
var haveEdiNotHaveSe = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsHaveSeData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisBBACEidSeCompareExport()
{
Category = "JIS",
WmsBillNum = default,
CarModeCode = default,
LineStationcode = default,
SequenceNumber = default,
ParType = default,
MESConfigCode = default,
ShippingDate = null,
PN = default,
= default,
PJIS日顺序号 = default,
MaterialNumber = default,
MaterialDes = default,
SEQty = default,
EdiQty = default,
DiffQty = default,
AssemblyDate = null,
MatchNumber = default,
InjectionCode = default,
MateType = default,
DiffDesc = default
}).ToList();
//无EDI有发运
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,
WmsBillNum = default,
CarModeCode = default,
LineStationcode = default,
SequenceNumber = default,
ParType = default,
MESConfigCode = default,
ShippingDate = null,
PN = default,
= default,
PJIS日顺序号 = default,
MaterialNumber = default,
MaterialDes = default,
SEQty = default,
EdiQty = default,
DiffQty = default,
AssemblyDate = null,
MatchNumber = default,
InjectionCode = default,
MateType = 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 =>
// //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数据
//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有发运
//var notHaveEdiHaveSeCompareExports = haveEidHaveSes.ToList();
//ExcelExporter excelExporter = new ExcelExporter();
//excelExporter
// .Append(haveEdiNotHaveSeCompareExports, $"BBACEDI数据和发货对比")
// .SeparateBySheet()
// .Append(notHaveEdiHaveSeCompareExports, $"BBAC发货和EDI数据对比")
// .SeparateBySheet();
ExcelExporter excelExporter = new ExcelExporter();
excelExporter
.Append(haveEdiNotHaveSe.ToList(), $"BBACEDI数据和发货对比")
.SeparateBySheet()
.Append(notHaveEdiHaveSe.ToList(), $"BBAC发货和EDI数据对比")
.SeparateBySheet();
//var result = excelExporter.ExportAppendDataAsByteArray();
//result.ShouldNotBeNull();
////_fileContainer.SaveAsync(filename, result.Result, true);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);
//Notify();
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 =>
{
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, true) => EnumPubSaSeCompareCategory.HaveSaNotHaveSe,
(true, false) => EnumPubSaSeCompareCategory.NotHaveSaHaveSe,
_ => 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)
{
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.SaLU == lu || p.SeLU == lu);
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.CustomerPartCode == lu);
}
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()
{
//结算核对汇总
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,
MaterialDes = p.FirstOrDefault().MaterialDes,
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
@ -258,30 +286,30 @@ namespace SettleAccount.Job.Services.Report
//有结算有发运
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,
MaterialDes = p.FirstOrDefault().MaterialDes,
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//有结算无发运
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,
MaterialDes = p.FirstOrDefault().MaterialDes,
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//无结算有发运
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,
MaterialDes = p.FirstOrDefault().MaterialDes,
FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();

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

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

Loading…
Cancel
Save