学 赵 1 year ago
parent
commit
95a7880e13
  1. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/.prettierrc.json
  2. 40
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js
  3. 9
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/index.js
  4. 64
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  5. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js
  6. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js
  7. 169
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js
  8. 105
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/unable.js
  9. 105
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/usable.js
  10. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/state.js
  11. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/tb_re-parts-relationship_service.js
  12. 887
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  13. 17
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/_check.js
  14. 15
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/detail.js
  15. 26
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js
  16. 26
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js
  17. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
  18. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs
  19. 207
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  20. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  21. 42
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  22. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs
  23. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs
  24. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs
  25. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs
  26. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs
  27. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIS_RECORD.cs
  28. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIT_RECORD.cs
  29. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs
  30. 134
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACEdiSeCompareExportService.cs
  31. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/.prettierrc.json

@ -1,5 +1,5 @@
{
"printWidth": 120,
"printWidth": 180,
"tabWidth": 2,
"useTabs": false,
"semi": true,

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

@ -14,18 +14,13 @@ export default {
<template v-else-if="schema.input==='date'">{{dayjs(model[prop]).format('YYYY-MM-DD')}}</template>
<template v-else-if="schema.input==='datetime'">{{dayjs(model[prop]).format('YYYY-MM-DD HH:mm:ss')}}</template>
<template v-else-if="schema.input==='password'">******</template>
<template v-else-if="schema.input==='select'||schema.input==='tabs'">{{options[model[prop]]?.label}}</template>
<template v-else-if="schema.input==='select'||schema.input==='tabs'">{{options.find(o=>o.value===model[prop])?.label}}</template>
<template v-else>{{model[prop]}}</template>
</template>
</template>
<template v-else>
<template v-if="getInput(schema)==='select'">
<el-select
v-model="model[prop]"
:placeholder="schema.placeholder??schema.title"
:multiple="!!schema.multiple"
:clearable="!!schema.clearable"
>
<el-select v-model="model[prop]" :placeholder="schema.placeholder??schema.title" :multiple="!!schema.multiple" :clearable="!!schema.clearable">
<el-option v-for="item in options" :key="item.key" :label="item.label" :value="item.value" />
</el-select>
</template>
@ -36,38 +31,17 @@ export default {
</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'"
/>
<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'" />
</template>
<template v-else-if="getInput(schema)==='number'">
<el-input
:disabled="getDisabled()"
:placeholder="schema.placeholder??schema.title"
v-model="model[prop]"
type="number"
/>
<el-input :disabled="getDisabled()" :placeholder="schema.placeholder??schema.title" v-model="model[prop]" type="number" />
</template>
<template v-else-if="getInput(schema)==='integer'">
<el-input-number
:disabled="getDisabled()"
:placeholder="schema.placeholder??schema.title"
v-model="model[prop]"
:precision="0"
/>
<el-input-number :disabled="getDisabled()" :placeholder="schema.placeholder??schema.title" v-model="model[prop]" :precision="0" />
</template>
<template v-else-if="getInput(schema)==='boolean'">
<el-select
:disabled="getDisabled()"
v-model="model[prop]"
:placeholder="schema.placeholder??schema.title"
v-if="schema.nullable"
>
<el-select :disabled="getDisabled()" v-model="model[prop]" :placeholder="schema.placeholder??schema.title" v-if="schema.nullable">
<el-option prop="select" value="" :label="$t('select')" />
<el-option prop="true" :value="true" :label="$t('true')" />
<el-option prop="false" :value="false" :label="$t('false')" />

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

@ -10,14 +10,7 @@ export default {
<el-form ref="formRef" :model="model" label-width="auto" :inline="inline">
<template v-if="schema && schema.properties">
<template v-for="(value, prop) in getProperties(schema.properties)">
<app-form-item
:parentSchema="schema"
:schema="value"
v-model="model"
:prop="prop"
:mode="mode"
:errors="errors"
/>
<app-form-item :parentSchema="schema" :schema="value" v-model="model" :prop="prop" :mode="mode" :errors="errors" />
</template>
</template>
<slot></slot>

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

@ -20,16 +20,7 @@ export default {
<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"
>
<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" />
@ -76,9 +67,7 @@ export default {
>
<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>
<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">
@ -104,12 +93,7 @@ export default {
</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)"
>
<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" />
@ -185,9 +169,7 @@ export default {
<el-button type="primary" @click="columns.forEach(o=>o.checked=true)"> {{$t('selectAll')}} </el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="columns.forEach(o=>o.checked=!o.checked)">
{{$t('selectInverse')}}
</el-button>
<el-button type="primary" @click="columns.forEach(o=>o.checked=!o.checked)"> {{$t('selectInverse')}} </el-button>
</el-form-item>
<el-form-item v-for="item in columns">
<el-checkbox v-model="item.checked" :label="item.title" size="large" />
@ -204,12 +186,7 @@ export default {
</el-drawer>
<el-drawer v-model="subDrawer" destroy-on-close size="50%">
<el-scrollbar>
<app-list
v-if="subDrawer"
:query="subListQuery"
:buttons="subListQuery.buttons"
:config="subListQuery.config"
/>
<app-list v-if="subDrawer" :query="subListQuery" :buttons="subListQuery.buttons" :config="subListQuery.config" />
</el-scrollbar>
<template #footer>
<span class="dialog-footer">
@ -217,12 +194,7 @@ export default {
</span>
</template>
</el-drawer>
<el-dialog
v-model="dialogVisible"
align-center
destroy-on-close
style="width:auto;min-width:500px;max-width:1000px;"
>
<el-dialog v-model="dialogVisible" align-center destroy-on-close style="width:auto;min-width:500px;max-width:1000px;">
<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%;">
@ -286,21 +258,13 @@ export default {
<el-col :span="6">
<el-select clearable :disabled="item.readOnly" v-model="item.column" :placeholder="$t('字段')">
<template v-for="(value, prop) in config.edit.schema.properties">
<el-option
v-if="value.type!=='object'&&value.type!=='array'&&value.input!=='textarea'"
:value="prop"
:label="value.title"
/>
<el-option v-if="value.type!=='object'&&value.type!=='array'&&value.input!=='textarea'" :value="prop" :label="value.title" />
</template>
</el-select>
</el-col>
<el-col :span="6" v-if="item.column">
<el-select clearable :disabled="item.readOnly" v-model="item.action" :placeholder="$t('操作符')">
<el-option
v-for="item in getOperators(config.edit.schema.properties[item.column])"
:value="item.value"
:label="item.label"
/>
<el-option v-for="item in getOperators(config.edit.schema.properties[item.column])" :value="item.value" :label="item.label" />
</el-select>
</el-col>
<el-col :span="8" v-if="item.column">
@ -672,8 +636,7 @@ export default {
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;
let url = (editFormMode.value === "create" ? config.edit.createUrl : config.edit.updateUrl) ?? config.query.url;
if (editFormMode.value === "update") {
url = format(url, editFormModel.value.id);
}
@ -748,7 +711,7 @@ export default {
const targetRoute = router.getRoutes().find((o) => o.path === nav);
if (config.constructor === String) {
const value = (await import(config)).default;
config = value.constructor === Function ? value() : value;
config = value.constructor === Function ? value(route.meta.businessType) : value;
}
subListQuery.value = {
query: value,
@ -883,12 +846,7 @@ export default {
return postData;
}
function isNotJit() {
return (
route.meta.businessType !== 3 ||
route.meta.businessType !== 4 ||
route.meta.businessType !== 7 ||
route.meta.businessType !== 8
);
return route.meta.businessType !== 3 || route.meta.businessType !== 4 || route.meta.businessType !== 7 || route.meta.businessType !== 8;
}
onMounted(async () => {
if (route.meta.children?.length) {

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js

@ -6,13 +6,7 @@ export default {
<div class="row">
<div class="cell el-table__cell" v-for="item in columns">
<div class="cell" style="text-align:center;" v-if="item.input==='selection'">
<input
class="el-checkbox__input"
type="checkbox"
v-model="checkAll"
:indeterminate="checkAllIndeterminate"
@click="checkAllClick($event)"
/>
<input class="el-checkbox__input" type="checkbox" v-model="checkAll" :indeterminate="checkAllIndeterminate" @click="checkAllClick($event)" />
</div>
<div class="cell" v-else-if="!item.hidden">{{item.title}}</div>
</div>

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

@ -21,7 +21,7 @@ const schema = {
export default function (service, detailService) {
const queryUrl = `settleaccount/${service}/get-list`;
const deleteUrl = `settleaccount/${service}/delete-list`;
const importUrl = `settleaccount/pub_sa_service/import-by-business-type`;
const importUrl = `settleaccount/${service}/import`;
const exportUrl = `settleaccount/${detailService}/export`;
const queryMethod = "POST";
const deleteMethod = "POST";

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

@ -0,0 +1,169 @@
import version from "../version.js";
const schema = {
title: "通用代码",
type: "object",
properties: {
settleBillNum: {
title: "关联结算单号",
type: "string",
},
billNum: {
title: "发票分组号",
type: "string",
},
settleDate: {
title: "下线日期",
type: "string",
input: "datetime",
},
invBillNum: {
title: "发票号",
type: "string",
},
lu: {
title: "厂内零件号",
type: "string",
},
partCode: {
title: "客户零件号",
type: "string",
},
materialDesc: {
title: "零件描述",
type: "decimal",
},
pn: {
title: "标识号",
type: "string",
},
qty: {
title: "结算数量",
type: "number",
},
price: {
title: "单价",
type: "number",
},
groupNum: {
title: "结算分组号",
type: "decimal",
},
site: {
title: "工厂地点",
type: "string",
},
isReturn: {
title: "是否退货",
type: "boolean",
},
isMaidan: {
title: "是否买单",
type: "boolean",
},
contractDocID: {
title: "合同号",
type: "string",
},
},
};
export default function (businessType) {
let service;
if (businessType === "JisBBAC") {
service = "bbac_can_sa_service";
} else if (businessType === "JisHBPO") {
service = "hbpo_can_sa_service";
} else {
service = "pub_can_sa_service";
}
if (businessType === "JisBBAC" || businessType === "JisHBPO") {
schema.properties.pn.title = "生产码";
}
if (businessType !== "JisBBAC") {
delete schema.properties["isReturn"];
delete schema.properties["isMaidan"];
delete schema.properties["contractDocID"];
}
if (businessType !== "JisHBPO") {
delete schema.properties["site"];
}
const queryUrl = `settleaccount/${service}/detail-query`;
const queryMethod = "POST";
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "通用代码",
type: "object",
properties: {
filters: {
title: "筛选",
type: "array",
hidden: true,
items: {
type: "object",
properties: {
logic: {
type: "int",
},
column: {
type: "string",
},
action: {
type: "int",
},
value: {
type: "string",
},
},
},
default: [
{
logic: "and",
action: "like",
column: "partCode",
value: null,
readOnly: true,
},
{
logic: "and",
action: "like",
column: "pn",
value: null,
readOnly: true,
},
{
logic: "and",
action: "like",
column: "groupNum",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
},
},
},
table: {
schema: schema,
},
edit: {
schema: schema,
},
};
}

105
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/unable.js

@ -0,0 +1,105 @@
import version from "../version.js";
import state from "../state.js";
const schema = {
title: "不可结算明细",
type: "object",
properties: {
version,
state,
billNum: {
title: "结算单据",
type: "string",
},
settleBillNum: {
title: "关联结算单号",
type: "string",
},
invGroupNum: {
title: "发票分组号",
type: "string",
oneToMany: "/settle/detail",
config: "/models/settle/detail.js",
},
},
};
export default function (service) {
const queryUrl = `settleaccount/${service}/detail-query`;
const exportUrl = `settleaccount/${service}/export`;
const addUrl = `settleaccount/${service}/generate-settlement-order`;
const queryMethod = "POST";
const exportMethod = "POST";
const addMethod = "POST";
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "发票分组号",
type: "object",
properties: {
filters: {
title: "项目",
type: "array",
hidden: true,
items: {
type: "object",
properties: {
logic: {
type: "int",
},
column: {
type: "string",
},
action: {
type: "int",
},
value: {
type: "string",
},
},
},
default: [
{
logic: "and",
column: "version",
action: "equal",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
businessType: {
hidden: true,
default: 0,
},
},
},
},
table: {
schema: schema,
},
edit: {
exportUrl,
addUrl,
exportMethod,
addMethod,
schema: schema,
},
};
}

105
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/usable.js

@ -0,0 +1,105 @@
import version from "../version.js";
import state from "../state.js";
const schema = {
title: "可结算单",
type: "object",
properties: {
version,
state,
billNum: {
title: "结算单据",
type: "string",
oneToMany: "/settle/detail",
config: "/models/settle/detail.js",
},
settleBillNum: {
title: "关联结算单号",
type: "string",
},
invGroupNum: {
title: "发票分组号",
type: "string",
},
},
};
export default function (service) {
const queryUrl = `settleaccount/${service}/main-query`;
const exportUrl = `settleaccount/${service}/export`;
const addUrl = `settleaccount/${service}/generate-invoice`;
const queryMethod = "POST";
const exportMethod = "POST";
const addMethod = "POST";
return {
query: {
url: queryUrl,
method: queryMethod,
hasFilter: true,
schema: {
title: "发票分组号",
type: "object",
properties: {
filters: {
title: "项目",
type: "array",
hidden: true,
items: {
type: "object",
properties: {
logic: {
type: "int",
},
column: {
type: "string",
},
action: {
type: "int",
},
value: {
type: "string",
},
},
},
default: [
{
logic: "and",
column: "version",
action: "equal",
value: null,
readOnly: true,
},
],
},
skipCount: {
hidden: true,
default: 0,
},
maxResultCount: {
hidden: true,
default: 10,
},
sorting: {
hidden: true,
},
businessType: {
hidden: true,
default: 0,
},
},
},
},
table: {
schema: schema,
},
edit: {
exportUrl,
addUrl,
exportMethod,
addMethod,
schema: schema,
},
};
}

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/state.js

@ -1,14 +1,14 @@
const options = [
{ value: 0, label: "未结状态" },
{ value: 1, label: "已开票" },
{ value: 2, label: "商务已审核" },
{ value: 3, label: "财务已审核" },
{ value: 4, label: "客户已收票" },
{ value: 5, label: "已扣减" },
{ value: "0", label: "未结状态" },
{ value: "1", label: "已开票" },
{ value: "2", label: "商务已审核" },
{ value: "3", label: "财务已审核" },
{ value: "4", label: "客户已收票" },
{ value: "5", label: "已扣减" },
];
const state = { title: "状态", type: "string", input: "select", options };
const state2 = Object.assign(Object.assign({}, state), { options: options.filter((a) => a.value > 0) });
const state3 = Object.assign(Object.assign({}, state), { options: options.filter((a) => a.value > 3) });
const state2 = Object.assign(Object.assign({}, state), { options: options.filter((a) => parseInt(a.value) > 0) });
const state3 = Object.assign(Object.assign({}, state), { options: options.filter((a) => parseInt(a.value) > 3) });
export default state;
export { state2, state3 };

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/tb_re-parts-relationship_service.js

@ -1,4 +1,4 @@
import options from "./business-type.js";
import businessType from "./business-type.js";
const schema = {
title: "客户替换件关系",
@ -12,7 +12,7 @@ const schema = {
title: "替换厂内物料号",
type: "string",
},
options,
businessType,
},
};

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

File diff suppressed because it is too large

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

@ -20,12 +20,12 @@ export default {
<el-tabs>
<el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_MAP_GROUP.length">
<el-scrollbar>
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns2" />
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns1" />
</el-scrollbar>
</el-tab-pane>
<el-tab-pane label="发票明细" v-if="model.invoicE_WAIT_DETAIL.length">
<el-scrollbar>
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns1" />
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns2" />
</el-scrollbar>
</el-tab-pane>
<el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_NOT_SETTLE.length">
@ -187,10 +187,6 @@ export default {
});
//
const columns1 = [
{
dataKey: "version",
title: "期间",
},
{
dataKey: "invbillNum",
title: "发票号",
@ -209,11 +205,6 @@ export default {
},
];
const columns2 = [
{
key: "version",
dataKey: "version",
title: "期间",
},
{
dataKey: "invbillNum",
title: "发票号",
@ -244,10 +235,6 @@ export default {
},
];
const columns3 = [
{
dataKey: "version",
title: "期间",
},
{
dataKey: "invGroupNum",
title: "发票分组号",

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

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

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

@ -0,0 +1,26 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import useConfig from "../../models/settle/unable.js";
import request from "../../request/index.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const route = useRoute();
const businessType = route.meta.businessType;
let config = null;
if (businessType === "JisBBAC") {
config = useConfig("bbac_not_sa_service");
} else if (businessType === "JisHBPO") {
config = useConfig("hbpo_not_sa_service");
} else {
config = useConfig("pub_not_sa_service");
}
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

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

@ -0,0 +1,26 @@
import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import useConfig from "../../models/settle/usable.js";
import request from "../../request/index.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const route = useRoute();
const businessType = route.meta.businessType;
let config = null;
if (businessType === "JisBBAC") {
config = useConfig("bbac_can_sa_service");
} else if (businessType === "JisHBPO") {
config = useConfig("hbpo_can_sa_service");
} else {
config = useConfig("pub_can_sa_service");
}
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

11
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs

@ -128,7 +128,7 @@ public class BBAC_SA_DETAIL_IMPORT_DTO
/// 数量
/// </summary>
[Display(Name = "结算数量")]
[ImporterHeader(IsIgnore = true)]
[ImporterHeader(Name = "GR Quantity")]
public decimal Qty { get; set; }
/// <summary>
@ -138,6 +138,15 @@ public class BBAC_SA_DETAIL_IMPORT_DTO
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "External Call Number")]
public string PN { get; set; }
/// <summary>
/// Movement Type
/// MovementType = 967,代表退货需要标记为负数
/// MovementType = 966,代表正常发货标记正数
/// </summary>
[Display(Name = "Movement Type")]
[ImporterHeader(Name = "Movement Type")]
public string MovementType { get; set; }
}
/// <summary>

2
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs

@ -130,7 +130,7 @@ public class HBPO_SA_DETAIL_IMPORT_DTO
[Display(Name = "PartNumber")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "PartNumber")]
public string PartCode { get; set; }
public string LU { get; set; }
/// <summary>
/// 数量

207
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs

@ -1,22 +1,22 @@
using Magicodes.ExporterAndImporter.Core;
using Microsoft.AspNetCore.Http;
using System;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Microsoft.AspNetCore.Http;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities.Auditing;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
/// <summary>
/// PUB结算
/// </summary>
public class PUB_SA_DTO : EntityDto<Guid>
{
/// <summary>
/// PUB结算
/// </summary>
public class PUB_SA_DTO : EntityDto<Guid>
{
/// <summary>
/// 期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
public string Version { get; set; }
/// <summary>
/// 结算单据
@ -29,24 +29,30 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary>
[Display(Name = "状态")]
public string State { get; set; }
}
/// <summary>
/// 查询
/// 业务类型
/// </summary>
public class PUB_SARequestDto : RequestDto
{
[Display(Name = "业务类型")]
public BusinessType BusinessType { get; set; }
}
/// <summary>
/// 查询
/// </summary>
public class PUB_SARequestDto : RequestDto
{
/// <summary>
/// 业务类别
/// </summary>
public EnumBusinessType BusinessType { get; set; }
}
}
/// <summary>
/// 导入请求
/// </summary>
public class PUB_SAImportRequestDto
{
/// <summary>
/// 导入请求
/// </summary>
public class PUB_SAImportRequestDto
{
/// <summary>
/// 文件
/// </summary>
@ -62,19 +68,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
}
}
/// <summary>
/// 直供件BBAC导入
/// </summary>
public class ZhiGongJianBBACImportDto
{
/// <summary>
/// 直供件BBAC导入
/// </summary>
public class ZhiGongJianBBACImportDto
{
/// <summary>
/// 结算日期
/// </summary>
[Display(Name = "Pstng Date")]
[ImporterHeader(Name = "Pstng Date")]
public DateTime SettleDate { set; get; }
public string SettleDate { set; get; }
/// <summary>
/// 客户零件号
@ -82,7 +88,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "Material")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "Material")]
public string PartCode { get; set; }
public string LU { get; set; }
/// <summary>
/// 生产号
@ -106,13 +112,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ImporterHeader(Name = "Delivery")]
[Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; }
}
}
/// <summary>
/// 直供件HBPO导入
/// </summary>
public class ZhiGongJianHBPOImportDto
{
/// <summary>
/// 直供件HBPO导入
/// </summary>
public class ZhiGongJianHBPOImportDto
{
/// <summary>
/// 结算日期
/// </summary>
@ -126,7 +132,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "零件号")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "零件号")]
public string PartCode { get; set; }
public string LU { get; set; }
/// <summary>
/// 生产号
@ -150,13 +156,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ImporterHeader(Name = "订单编号")]
[Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; }
}
}
/// <summary>
/// 买单件HBPO导入
/// </summary>
public class MaiDanJianHBPOImportDto
{
/// <summary>
/// 买单件HBPO导入
/// </summary>
public class MaiDanJianHBPOImportDto
{
/// <summary>
/// 结算日期
/// </summary>
@ -170,7 +176,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "零件号")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "零件号")]
public string PartCode { get; set; }
public string LU { get; set; }
/// <summary>
/// 生产号
@ -194,19 +200,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ImporterHeader(Name = "五联单号")]
[Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; }
}
}
/// <summary>
/// 备件导入
/// </summary>
public class BeiJianImportDto : BeiJianExtraImportDto
{
/// <summary>
/// 备件导入
/// </summary>
public class BeiJianImportDto : BeiJianExtraImportDto
{
/// <summary>
/// 结算日期
/// </summary>
[Display(Name = "结算日期")]
[ImporterHeader(Name = "开票日期")]
public DateTime SettleDate { set; get; }
[ImporterHeader(Name = "零件时间")]
public string SettleDate { set; get; }
/// <summary>
/// 客户零件号
@ -214,7 +220,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "零件号")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "零件号")]
public string PartCode { get; set; }
public string LU { get; set; }
/// <summary>
/// 生产号
@ -238,19 +244,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ImporterHeader(Name = "凭证号")]
[Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; }
}
///// <summary>
///// 备件扩展
///// </summary>
//[Display(Name = "备件扩展")]
//public BeiJianExtraImportDto beiJianExtraImportDto { get; set; }
}
/// <summary>
/// 备件扩展
/// </summary>
public class BeiJianExtraImportDto
{
/// <summary>
/// 备件扩展
/// </summary>
public class BeiJianExtraImportDto
{
/// <summary>
/// 交货号
/// </summary>
@ -265,6 +265,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ImporterHeader(Name = "发票号")]
public string InvoiceNumber { set; get; }
/// <summary>
/// 开票日期
/// </summary>
[Display(Name = "开票日期")]
[ImporterHeader(Name = "开票日期")]
public DateTime? MakeDate { set; get; }
/// <summary>
/// 供应商代码
/// </summary>
@ -305,28 +312,28 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary>
[Display(Name = "价格")]
[ImporterHeader(Name = "价格")]
public decimal Price { set; get; }
public decimal? Price { set; get; }
/// <summary>
/// 金额
/// </summary>
[Display(Name = "金额")]
[ImporterHeader(Name = "金额")]
public decimal Amount { set; get; }
public decimal? Amount { set; get; }
/// <summary>
/// 税额
/// </summary>
[Display(Name = "税额")]
[ImporterHeader(Name = "税额")]
public decimal Tallage { set; get; }
public decimal? Tallage { set; get; }
/// <summary>
/// 价税合计
/// </summary>
[Display(Name = "价税合计")]
[ImporterHeader(Name = "价税合计")]
public decimal Total { set; get; }
public decimal? Total { set; get; }
/// <summary>
/// 协议编号
@ -348,19 +355,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "商品组")]
[ImporterHeader(Name = "商品组")]
public string CommodityGroup { set; get; }
}
}
/// <summary>
/// 印度件导入
/// </summary>
public class YinDuJianImportDto
{
/// <summary>
/// 印度件导入
/// </summary>
public class YinDuJianImportDto
{
/// <summary>
/// 结算日期
/// </summary>
[Display(Name = "Delivery Date")]
[ImporterHeader(Name = "Delivery Date")]
public DateTime SettleDate { set; get; }
public string SettleDate { set; get; }
/// <summary>
/// 客户零件号
@ -368,7 +375,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "Material")]
[Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "Material")]
public string PartCode { get; set; }
public string LU { get; set; }
/// <summary>
/// 生产号
@ -392,13 +399,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ImporterHeader(Name = "External Delivery ID")]
[Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; }
}
/// <summary>
/// PUB结算明细
/// Supplier
/// </summary>
public class PUB_SA_DETAIL_DTO : AuditedAggregateRoot<Guid>
{
[Display(Name = "Supplier")]
[ImporterHeader(Name = "Supplier")]
public string Supplier { get; set; }
}
/// <summary>
/// PUB结算明细
/// </summary>
public class PUB_SA_DETAIL_DTO : AuditedAggregateRoot<Guid>
{
/// <summary>
/// 结算单
/// </summary>
@ -435,26 +449,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 厂内物料号
/// </summary>
public string PartCode { get; set; }
}
}
/// <summary>
/// 结算明细导出请求
/// </summary>
public class PUB_SA_DETAIL_EXPORT_REQUEST_DTO
{
/// <summary>
/// 结算明细导出请求
/// </summary>
public class PUB_SA_DETAIL_EXPORT_REQUEST_DTO
{
/// <summary>
/// 结算单号
/// </summary>
[Display(Name = "结算单号")]
[Required(ErrorMessage = "{0}不能为空")]
public string BillNum { set; get; }
}
}
/// <summary>
/// 结算明细导出
/// </summary>
public class PUB_SA_DETAIL_EXPORT_DTO
{
/// <summary>
/// 结算明细导出
/// </summary>
public class PUB_SA_DETAIL_EXPORT_DTO
{
/// <summary>
/// 结算单号
/// </summary>
@ -496,13 +510,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "结算分组")]
[ExporterHeader(DisplayName = "Delivery")]
public string GroupNum { get; set; }
}
}
/// <summary>
/// Pub结算与发运对比请求
/// </summary>
public class PubSaSeCompareRequestDto
{
/// <summary>
/// Pub结算与发运对比请求
/// </summary>
public class PubSaSeCompareRequestDto
{
/// <summary>
/// 期间
/// </summary>
@ -536,5 +550,4 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 发运结束时间
/// </summary>
public DateTime? SeEndDateTime { get; set; }
}
}

11
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -114,7 +114,16 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
{
#region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter();
var importDtos = await _exportImporter.UploadExcelImport<BBAC_SA_DETAIL_IMPORT_DTO>(files, _excelImportService);
var importDtos = await _exportImporter.UploadExcelImport<BBAC_SA_DETAIL_IMPORT_DTO>(files, _excelImportService).ConfigureAwait(false);
importDtos.ForEach(importDto =>
{
if (importDto.MovementType == "967")
{
importDto.Qty = -importDto.Qty;
}
});
var importBBACSaDetails = ObjectMapper.Map<List<BBAC_SA_DETAIL_IMPORT_DTO>, List<BBAC_SA_DETAIL>>(importDtos);
//数据校验

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

@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using OfficeOpenXml;
using SettleAccount.Domain.BQ;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
@ -112,9 +113,9 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// 导入
/// </summary>
[HttpPost]
public async Task<IActionResult> ImportByBusinessTypeAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto)
public async Task<IActionResult> ImportAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto)
{
IActionResult result = new JsonResult(null);
IActionResult result = new JsonResult(new { Code = 400 });
_version = pubSaImportRequestDto.Version;
switch (pubSaImportRequestDto.BusinessType)
{
@ -288,11 +289,16 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var importPubSaDetails = ObjectMapper.Map<List<ZhiGongJianBBACImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验
var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0)
{
string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); ;
string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -318,6 +324,11 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var importPubSaDetails = ObjectMapper.Map<List<ZhiGongJianHBPOImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验
var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0)
@ -339,14 +350,14 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
ExportImporter _exportImporter = new ExportImporter();
var importResults = await _exportImporter.UploadExcelImport<MaiDanJianHBPOImportDto>(files, _excelImportService).ConfigureAwait(false);
importResults.ForEach(importResult =>
{
importResult.SettleDate = DateTime.Now;
});
var importPubSaDetails = ObjectMapper.Map<List<MaiDanJianHBPOImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验
var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0)
@ -370,6 +381,11 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var importPubSaDetails = ObjectMapper.Map<List<BeiJianImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验
var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0)
@ -390,9 +406,15 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
#region 导入数据转换
ExportImporter _exportImporter = new ExportImporter();
var importResults = await _exportImporter.UploadExcelImport<YinDuJianImportDto>(files, _excelImportService);
importResults = importResults.FindAll(t => t.Supplier == "15663496");
var importPubSaDetails = ObjectMapper.Map<List<YinDuJianImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验
var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0)
@ -463,7 +485,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
//导入的零件号集合
var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct();
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();
/*
@ -510,7 +532,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var pubSa = new PUB_SA()
{
BillNum = pubSaBillNum,
State = "1",
State = "0",
BusinessType = pubSaFirstDetail.BusinessType,
Version = pubSaFirstDetail.Version
};

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs

@ -74,11 +74,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// 获取列表
/// </summary>
[HttpPost]
public async Task<PagedResultDto<PUB_SE_DETAIL_DTO>> GetListAsync(PUB_SE_DETAIL_RequestDto input)
public async Task<PagedResultDto<PUB_SE_DETAIL_DTO>> GetListAsync(RequestDto input)
{
input.Filters.Add(new FilterCondition("BusinessType", input.BusinessType.ToString(), EnumFilterAction.Equal, EnumFilterLogic.And));
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<PUB_SE_DETAIL>, List<PUB_SE_DETAIL_DTO>>(entities);
return new PagedResultDto<PUB_SE_DETAIL_DTO>(totalCount, dtos);
}

12
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs

@ -67,17 +67,17 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
[ApiExplorerSettings(IgnoreApi = true)]
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke();
await this.Invoke().ConfigureAwait(false);
}
[HttpPost]
public async Task Invoke()
{
await SyncJitRecordAsync();
await SyncJisRecordAsync();
await SyncJitRecordAsync().ConfigureAwait(false);
await SyncJisRecordAsync().ConfigureAwait(false);
if (_addMaterialRelationships.Any())
{
_addMaterialRelationships = _addMaterialRelationships.GroupBy(t => new { t.ErpMaterialCode }).Select(t => t.First()).ToList();
_addMaterialRelationships = _addMaterialRelationships.Where(t => !string.IsNullOrEmpty(t.ErpMaterialCode)).GroupBy(t => new { t.ErpMaterialCode }).Select(t => t.First()).ToList();
await _materialRelationshipManager.AddNewMaterialRelationships(_addMaterialRelationships).ConfigureAwait(false);
}
}
@ -100,7 +100,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
}
//WMS发运记录
var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD.Where(predicate).OrderBy(b => b.UID).ToList();
var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD.Where(predicate).OrderBy(b => b.UID).Take(100000).ToList();
var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<BBAC_SE_DETAIL>>(wmsSeRecords);
if (bbacSeDetails.Any())
@ -150,7 +150,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
}
//WMS发运数据
var wmsRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).ToList();
var wmsRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).Take(100000).ToList();
var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<BBAC_SE_DETAIL>>(wmsRecords);
if (bbacSeDetails.Any())

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

@ -88,7 +88,7 @@ public class HBPOSeSyncAppService : ApplicationService, IInvocable, IJobService
await SyncJisRecordAsync().ConfigureAwait(false);
if (_addMaterialRelationships.Any())
{
_addMaterialRelationships = _addMaterialRelationships.GroupBy(t => new { t.ErpMaterialCode }).Select(t => t.First()).ToList();
_addMaterialRelationships = _addMaterialRelationships.Where(t => !string.IsNullOrEmpty(t.ErpMaterialCode)).GroupBy(t => new { t.ErpMaterialCode }).Select(t => t.First()).ToList();
await _materialRelationshipManager.AddNewMaterialRelationships(_addMaterialRelationships).ConfigureAwait(false);
}
}

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs

@ -263,4 +263,10 @@ public class BBAC_SE_DETAIL:SE_BASE
{
}
public BBAC_SE_DETAIL SetQty(decimal qty)
{
this.Qty = qty;
return this;
}
}

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs

@ -74,5 +74,9 @@ public class BBAC_SE_EDI:FullAuditedAggregateRoot<Guid>
Extend4 = extend4;
}
public BBAC_SE_EDI SetQty(decimal qty)
{
this.Qty = qty;
return this;
}
}

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIS_RECORD.cs

@ -72,16 +72,16 @@ public class TM_BJBMPT_JIS_RECORD
public string RefVinCode { get; set; }
[DisplayName("单据类型")]
public EnumBillType BillType { get; set; }
public int? BillType { get; set; }
[DisplayName("子单据类型")]
public EnumSubBillType SubBillType { get; set; }
public int? SubBillType { get; set; }
[DisplayName("单据性质")]
public string BillCharacter { get; set; }
[DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; }
public int? TransType { get; set; }
[DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
@ -111,7 +111,7 @@ public class TM_BJBMPT_JIS_RECORD
public string MatchNumber { get; set; }
[DisplayName("业务类型")]
public EnumProTpe ProType { get; set; }
public int? ProType { get; set; }
[DisplayName("发货条码")]
public string DeliverCode { get; set; }

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIT_RECORD.cs

@ -69,13 +69,13 @@ public class TM_BJBMPT_JIT_RECORD
public string ToLoc { get; set; }
[DisplayName("单据类型")]
public EnumBillType BillType { get; set; }
public int? BillType { get; set; }
[DisplayName("子单据类型")]
public EnumSubBillType SubBillType { get; set; }
public int? SubBillType { get; set; }
[DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; }
public int? TransType { get; set; }
[DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
@ -93,7 +93,7 @@ public class TM_BJBMPT_JIT_RECORD
public string Remark { get; set; }
[DisplayName("业务类型")]
public EnumProTpe ProType { get; set; }
public int? ProType { get; set; }
[DisplayName("JIS排序单号")]
public string OrderNum { get; set; }

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs

@ -81,16 +81,16 @@ public class TM_BJBMPT_OTHER_RECORD
public string Remark { get; set; }
[DisplayName("单据类型")]
public EnumBillType BillType { get; set; }
public int? BillType { get; set; }
[DisplayName("子单据类型")]
public EnumSubBillType SubBillType { get; set; }
public int? SubBillType { get; set; }
[DisplayName("业务类型")]
public EnumProTpe ProType { get; set; }
public int? ProType { get; set; }
[DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; }
public int? TransType { get; set; }
[DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; }

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

@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Dynamic.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Shouldly;
@ -16,8 +14,6 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Enums;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
@ -74,22 +70,122 @@ namespace SettleAccount.Job.Services.Report
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
//有EDI的发运数据
var haveEidSes = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true);
// 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 haveSeEids = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true && haveEidSes.Select(t => new { t.PN, t.LU }).Contains(new { t.PN, t.LU }));
var haveSeEids = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true).Join(haveEidSes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (edi, se) => edi);
//无EDI的发运数据
var notHaveEidSes = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false);
//无发运的EDI数据
var notHaveSeEids = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == false);
//有EDI有发运
var haveEdiHaveSes = haveEidSes.ToList();
var dsdddd = haveSeEids.ToList();
//有EDI无发运
var haveEdiNotHaveSes = notHaveEidSes.ToList();
//无EDI有发运
var notHaveEdiHaveSes = notHaveSeEids.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();
//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()).ToList();
//var haveEidHaveSes = from se in haveEidSesGroup
// join edi in haveSeEidsGroup
// on new { se.PN, se.LU } equals new { edi.PN, edi.LU }
// select 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
// };
////无EDI的发运数据
//var notHaveEidSes = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false);
////无发运的EDI数据
//var notHaveSeEids = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == false);
//var jisBBACEidSeCompareExports = new List<JisBBACEidSeCompareExport>();
////有EDI无发运
//var haveEdiNotHaveSeCompareExports = haveEidHaveSes.ToList();
////无EDI有发运
//var notHaveEdiHaveSeCompareExports = haveEidHaveSes.ToList();
//ExcelExporter excelExporter = new ExcelExporter();
//excelExporter
// .Append(haveEdiNotHaveSeCompareExports, $"BBACEDI数据和发货对比")
// .SeparateBySheet()
// .Append(notHaveEdiHaveSeCompareExports, $"BBAC发货和EDI数据对比")
// .SeparateBySheet();
//var result = excelExporter.ExportAppendDataAsByteArray();
//result.ShouldNotBeNull();
////_fileContainer.SaveAsync(filename, result.Result, true);
//Notify();
return id.ToString();
var ids = id.ToString();

11
code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

@ -8,9 +8,20 @@ namespace SettleAccount.Job
{
public SettleAccountJobAutoMapperProfile()
{
CreateMapBBACEdiSeCompare();
CreateMapPubSaSeCompare();
}
/// <summary>
/// BBAC EDI与发运对比
/// </summary>
public void CreateMapBBACEdiSeCompare()
{
//CreateMap<PubSaSeCompareDiff, JisBBACEidSeCompareExport>()
// .ForMember(x => x.ReplaceLU, y => y.MapFrom(y => y.ReplaceLU));
}
/// <summary>
/// Pub结算与发运对比
/// </summary>

Loading…
Cancel
Save