学 赵 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. 18
      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. 889
      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. 1077
      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. 44
      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, "tabWidth": 2,
"useTabs": false, "useTabs": false,
"semi": true, "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==='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==='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==='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 v-else>{{model[prop]}}</template>
</template> </template>
</template> </template>
<template v-else> <template v-else>
<template v-if="getInput(schema)==='select'"> <template v-if="getInput(schema)==='select'">
<el-select <el-select v-model="model[prop]" :placeholder="schema.placeholder??schema.title" :multiple="!!schema.multiple" :clearable="!!schema.clearable">
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-option v-for="item in options" :key="item.key" :label="item.label" :value="item.value" />
</el-select> </el-select>
</template> </template>
@ -36,38 +31,17 @@ export default {
</el-tabs> </el-tabs>
<br /> <br />
</template> </template>
<template <template v-else-if="getInput(schema)==='month'||getInput(schema)==='datetime'||getInput(schema)==='datetimerange'">
v-else-if="getInput(schema)==='month'||getInput(schema)==='datetime'||getInput(schema)==='datetimerange'" <el-date-picker v-model="model[prop]" :type="schema.input" :value-format="schema.format??'YYYY-MM-DD HH:mm:ss'" />
>
<el-date-picker
v-model="model[prop]"
:type="schema.input"
:value-format="schema.format??'YYYY-MM-DD HH:mm:ss'"
/>
</template> </template>
<template v-else-if="getInput(schema)==='number'"> <template v-else-if="getInput(schema)==='number'">
<el-input <el-input :disabled="getDisabled()" :placeholder="schema.placeholder??schema.title" v-model="model[prop]" type="number" />
:disabled="getDisabled()"
:placeholder="schema.placeholder??schema.title"
v-model="model[prop]"
type="number"
/>
</template> </template>
<template v-else-if="getInput(schema)==='integer'"> <template v-else-if="getInput(schema)==='integer'">
<el-input-number <el-input-number :disabled="getDisabled()" :placeholder="schema.placeholder??schema.title" v-model="model[prop]" :precision="0" />
:disabled="getDisabled()"
:placeholder="schema.placeholder??schema.title"
v-model="model[prop]"
:precision="0"
/>
</template> </template>
<template v-else-if="getInput(schema)==='boolean'"> <template v-else-if="getInput(schema)==='boolean'">
<el-select <el-select :disabled="getDisabled()" v-model="model[prop]" :placeholder="schema.placeholder??schema.title" v-if="schema.nullable">
: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="select" value="" :label="$t('select')" />
<el-option prop="true" :value="true" :label="$t('true')" /> <el-option prop="true" :value="true" :label="$t('true')" />
<el-option prop="false" :value="false" :label="$t('false')" /> <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"> <el-form ref="formRef" :model="model" label-width="auto" :inline="inline">
<template v-if="schema && schema.properties"> <template v-if="schema && schema.properties">
<template v-for="(value, prop) in getProperties(schema.properties)"> <template v-for="(value, prop) in getProperties(schema.properties)">
<app-form-item <app-form-item :parentSchema="schema" :schema="value" v-model="model" :prop="prop" :mode="mode" :errors="errors" />
:parentSchema="schema"
:schema="value"
v-model="model"
:prop="prop"
:mode="mode"
:errors="errors"
/>
</template> </template>
</template> </template>
<slot></slot> <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"> <div v-loading="tableLoading">
<el-row> <el-row>
<el-col> <el-col>
<app-form <app-form inline mode="query" label-position="left" :schema="config.query.schema" v-model="queryModel" @submit="load" :hideButton="true" :isQueryForm="true">
inline
mode="query"
label-position="left"
:schema="config.query.schema"
v-model="queryModel"
@submit="load"
:hideButton="true"
:isQueryForm="true"
>
<template v-for="item in filterList.filter(o=>!o.hidden&&o.readOnly)"> <template v-for="item in filterList.filter(o=>!o.hidden&&o.readOnly)">
<el-form-item :label="config.edit.schema.properties[item.column].title"> <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" /> <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 fixed="left" type="selection" :selectable="config.table.selectable" />
<el-table-column type="index" :label="$t('rowIndex')"> <el-table-column type="index" :label="$t('rowIndex')">
<template #default="scope"> <template #default="scope"> {{ (pageModel.pageIndex - 1) * pageModel.pageSize + scope.$index + 1 }} </template>
{{ (pageModel.pageIndex - 1) * pageModel.pageSize + scope.$index + 1 }}
</template>
</el-table-column> </el-table-column>
<template v-for="(item,key) in config.table.schema.properties"> <template v-for="(item,key) in config.table.schema.properties">
<template v-if="item.navigation"> <template v-if="item.navigation">
@ -104,12 +93,7 @@ export default {
</template> </template>
<template v-else> <template v-else>
<template v-if="showColumn(item,key)"> <template v-if="showColumn(item,key)">
<el-table-column <el-table-column :prop="key" sortable="custom" :sort-orders="['descending', 'ascending', null]" :filters="getFilters(item,key)">
:prop="key"
sortable="custom"
:sort-orders="['descending', 'ascending', null]"
:filters="getFilters(item,key)"
>
<template #header="scope">{{item.title}}</template> <template #header="scope">{{item.title}}</template>
<template #default="scope"> <template #default="scope">
<app-form-input mode="details" :schema="item" :prop="key" v-model="scope.row" /> <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-button type="primary" @click="columns.forEach(o=>o.checked=true)"> {{$t('selectAll')}} </el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="columns.forEach(o=>o.checked=!o.checked)"> <el-button type="primary" @click="columns.forEach(o=>o.checked=!o.checked)"> {{$t('selectInverse')}} </el-button>
{{$t('selectInverse')}}
</el-button>
</el-form-item> </el-form-item>
<el-form-item v-for="item in columns"> <el-form-item v-for="item in columns">
<el-checkbox v-model="item.checked" :label="item.title" size="large" /> <el-checkbox v-model="item.checked" :label="item.title" size="large" />
@ -204,12 +186,7 @@ export default {
</el-drawer> </el-drawer>
<el-drawer v-model="subDrawer" destroy-on-close size="50%"> <el-drawer v-model="subDrawer" destroy-on-close size="50%">
<el-scrollbar> <el-scrollbar>
<app-list <app-list v-if="subDrawer" :query="subListQuery" :buttons="subListQuery.buttons" :config="subListQuery.config" />
v-if="subDrawer"
:query="subListQuery"
:buttons="subListQuery.buttons"
:config="subListQuery.config"
/>
</el-scrollbar> </el-scrollbar>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
@ -217,12 +194,7 @@ export default {
</span> </span>
</template> </template>
</el-drawer> </el-drawer>
<el-dialog <el-dialog v-model="dialogVisible" align-center destroy-on-close style="width:auto;min-width:500px;max-width:1000px;">
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> <template #header> <span class="el-dialog__title"> {{editFormTitle}} </span> </template>
<el-row v-loading="editFormloading"> <el-row v-loading="editFormloading">
<el-col style="max-height:calc(100vh - 180px );min-height:100%;"> <el-col style="max-height:calc(100vh - 180px );min-height:100%;">
@ -286,21 +258,13 @@ export default {
<el-col :span="6"> <el-col :span="6">
<el-select clearable :disabled="item.readOnly" v-model="item.column" :placeholder="$t('字段')"> <el-select clearable :disabled="item.readOnly" v-model="item.column" :placeholder="$t('字段')">
<template v-for="(value, prop) in config.edit.schema.properties"> <template v-for="(value, prop) in config.edit.schema.properties">
<el-option <el-option v-if="value.type!=='object'&&value.type!=='array'&&value.input!=='textarea'" :value="prop" :label="value.title" />
v-if="value.type!=='object'&&value.type!=='array'&&value.input!=='textarea'"
:value="prop"
:label="value.title"
/>
</template> </template>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="6" v-if="item.column"> <el-col :span="6" v-if="item.column">
<el-select clearable :disabled="item.readOnly" v-model="item.action" :placeholder="$t('操作符')"> <el-select clearable :disabled="item.readOnly" v-model="item.action" :placeholder="$t('操作符')">
<el-option <el-option v-for="item in getOperators(config.edit.schema.properties[item.column])" :value="item.value" :label="item.label" />
v-for="item in getOperators(config.edit.schema.properties[item.column])"
:value="item.value"
:label="item.label"
/>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="8" v-if="item.column"> <el-col :span="8" v-if="item.column">
@ -672,8 +636,7 @@ export default {
const valid = await editFormRef.value.validate(); const valid = await editFormRef.value.validate();
if (valid) { if (valid) {
editFormloading.value = true; editFormloading.value = true;
let url = let url = (editFormMode.value === "create" ? config.edit.createUrl : config.edit.updateUrl) ?? config.query.url;
(editFormMode.value === "create" ? config.edit.createUrl : config.edit.updateUrl) ?? config.query.url;
if (editFormMode.value === "update") { if (editFormMode.value === "update") {
url = format(url, editFormModel.value.id); url = format(url, editFormModel.value.id);
} }
@ -748,7 +711,7 @@ export default {
const targetRoute = router.getRoutes().find((o) => o.path === nav); const targetRoute = router.getRoutes().find((o) => o.path === nav);
if (config.constructor === String) { if (config.constructor === String) {
const value = (await import(config)).default; const value = (await import(config)).default;
config = value.constructor === Function ? value() : value; config = value.constructor === Function ? value(route.meta.businessType) : value;
} }
subListQuery.value = { subListQuery.value = {
query: value, query: value,
@ -883,12 +846,7 @@ export default {
return postData; return postData;
} }
function isNotJit() { function isNotJit() {
return ( return route.meta.businessType !== 3 || route.meta.businessType !== 4 || route.meta.businessType !== 7 || route.meta.businessType !== 8;
route.meta.businessType !== 3 ||
route.meta.businessType !== 4 ||
route.meta.businessType !== 7 ||
route.meta.businessType !== 8
);
} }
onMounted(async () => { onMounted(async () => {
if (route.meta.children?.length) { 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="row">
<div class="cell el-table__cell" v-for="item in columns"> <div class="cell el-table__cell" v-for="item in columns">
<div class="cell" style="text-align:center;" v-if="item.input==='selection'"> <div class="cell" style="text-align:center;" v-if="item.input==='selection'">
<input <input class="el-checkbox__input" type="checkbox" v-model="checkAll" :indeterminate="checkAllIndeterminate" @click="checkAllClick($event)" />
class="el-checkbox__input"
type="checkbox"
v-model="checkAll"
:indeterminate="checkAllIndeterminate"
@click="checkAllClick($event)"
/>
</div> </div>
<div class="cell" v-else-if="!item.hidden">{{item.title}}</div> <div class="cell" v-else-if="!item.hidden">{{item.title}}</div>
</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) { export default function (service, detailService) {
const queryUrl = `settleaccount/${service}/get-list`; const queryUrl = `settleaccount/${service}/get-list`;
const deleteUrl = `settleaccount/${service}/delete-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 exportUrl = `settleaccount/${detailService}/export`;
const queryMethod = "POST"; const queryMethod = "POST";
const deleteMethod = "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,
},
};
}

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

@ -1,14 +1,14 @@
const options = [ const options = [
{ value: 0, label: "未结状态" }, { value: "0", label: "未结状态" },
{ value: 1, label: "已开票" }, { value: "1", label: "已开票" },
{ value: 2, label: "商务已审核" }, { value: "2", label: "商务已审核" },
{ value: 3, label: "财务已审核" }, { value: "3", label: "财务已审核" },
{ value: 4, label: "客户已收票" }, { value: "4", label: "客户已收票" },
{ value: 5, label: "已扣减" }, { value: "5", label: "已扣减" },
]; ];
const state = { title: "状态", type: "string", input: "select", options }; const state = { title: "状态", type: "string", input: "select", options };
const state2 = Object.assign(Object.assign({}, state), { options: options.filter((a) => a.value > 0) }); 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) => a.value > 3) }); const state3 = Object.assign(Object.assign({}, state), { options: options.filter((a) => parseInt(a.value) > 3) });
export default state; export default state;
export { state2, state3 }; 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 = { const schema = {
title: "客户替换件关系", title: "客户替换件关系",
@ -12,7 +12,7 @@ const schema = {
title: "替换厂内物料号", title: "替换厂内物料号",
type: "string", type: "string",
}, },
options, businessType,
}, },
}; };

889
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-tabs>
<el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_MAP_GROUP.length"> <el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_MAP_GROUP.length">
<el-scrollbar> <el-scrollbar>
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns2" /> <app-table :data="model.invoicE_MAP_GROUP" :columns="columns1" />
</el-scrollbar> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="发票明细" v-if="model.invoicE_WAIT_DETAIL.length"> <el-tab-pane label="发票明细" v-if="model.invoicE_WAIT_DETAIL.length">
<el-scrollbar> <el-scrollbar>
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns1" /> <app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns2" />
</el-scrollbar> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_NOT_SETTLE.length"> <el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_NOT_SETTLE.length">
@ -187,10 +187,6 @@ export default {
}); });
// //
const columns1 = [ const columns1 = [
{
dataKey: "version",
title: "期间",
},
{ {
dataKey: "invbillNum", dataKey: "invbillNum",
title: "发票号", title: "发票号",
@ -209,11 +205,6 @@ export default {
}, },
]; ];
const columns2 = [ const columns2 = [
{
key: "version",
dataKey: "version",
title: "期间",
},
{ {
dataKey: "invbillNum", dataKey: "invbillNum",
title: "发票号", title: "发票号",
@ -244,10 +235,6 @@ export default {
}, },
]; ];
const columns3 = [ const columns3 = [
{
dataKey: "version",
title: "期间",
},
{ {
dataKey: "invGroupNum", dataKey: "invGroupNum",
title: "发票分组号", 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> /// </summary>
[Display(Name = "结算数量")] [Display(Name = "结算数量")]
[ImporterHeader(IsIgnore = true)] [ImporterHeader(Name = "GR Quantity")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
/// <summary> /// <summary>
@ -138,6 +138,15 @@ public class BBAC_SA_DETAIL_IMPORT_DTO
[Required(ErrorMessage = "{0}不能为空")] [Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "External Call Number")] [ImporterHeader(Name = "External Call Number")]
public string PN { get; set; } 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> /// <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")] [Display(Name = "PartNumber")]
[Required(ErrorMessage = "{0}不能为空")] [Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "PartNumber")] [ImporterHeader(Name = "PartNumber")]
public string PartCode { get; set; } public string LU { get; set; }
/// <summary> /// <summary>
/// 数量 /// 数量

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

File diff suppressed because it is too large

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 导入数据转换、数据校验 #region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter(); 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); var importBBACSaDetails = ObjectMapper.Map<List<BBAC_SA_DETAIL_IMPORT_DTO>, List<BBAC_SA_DETAIL>>(importDtos);
//数据校验 //数据校验

44
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.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using OfficeOpenXml;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
@ -112,9 +113,9 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [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; _version = pubSaImportRequestDto.Version;
switch (pubSaImportRequestDto.BusinessType) 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); var importPubSaDetails = ObjectMapper.Map<List<ZhiGongJianBBACImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion #endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验 #region 数据校验
var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0) 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 }); return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -318,6 +324,11 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var importPubSaDetails = ObjectMapper.Map<List<ZhiGongJianHBPOImportDto>, List<PUB_SA_DETAIL>>(importResults); var importPubSaDetails = ObjectMapper.Map<List<ZhiGongJianHBPOImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion #endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验 #region 数据校验
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0) if (checkList.Count > 0)
@ -339,14 +350,14 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var importResults = await _exportImporter.UploadExcelImport<MaiDanJianHBPOImportDto>(files, _excelImportService).ConfigureAwait(false); 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); var importPubSaDetails = ObjectMapper.Map<List<MaiDanJianHBPOImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion #endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验 #region 数据校验
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0) 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); var importPubSaDetails = ObjectMapper.Map<List<BeiJianImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion #endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验 #region 数据校验
var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0) if (checkList.Count > 0)
@ -390,11 +406,17 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var importResults = await _exportImporter.UploadExcelImport<YinDuJianImportDto>(files, _excelImportService); 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); var importPubSaDetails = ObjectMapper.Map<List<YinDuJianImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion #endregion
if (!importPubSaDetails.Any())
{
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#region 数据校验 #region 数据校验
var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false);
@ -463,7 +485,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
//导入的零件号集合 //导入的零件号集合
var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct(); 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(); 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() var pubSa = new PUB_SA()
{ {
BillNum = pubSaBillNum, BillNum = pubSaBillNum,
State = "1", State = "0",
BusinessType = pubSaFirstDetail.BusinessType, BusinessType = pubSaFirstDetail.BusinessType,
Version = pubSaFirstDetail.Version 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> /// </summary>
[HttpPost] [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).ConfigureAwait(false);
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
var dtos = ObjectMapper.Map<List<PUB_SE_DETAIL>, List<PUB_SE_DETAIL_DTO>>(entities); var dtos = ObjectMapper.Map<List<PUB_SE_DETAIL>, List<PUB_SE_DETAIL_DTO>>(entities);
return new PagedResultDto<PUB_SE_DETAIL_DTO>(totalCount, dtos); 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)] [ApiExplorerSettings(IgnoreApi = true)]
public async Task Invoke(IServiceProvider serviceProvider) public async Task Invoke(IServiceProvider serviceProvider)
{ {
await this.Invoke(); await this.Invoke().ConfigureAwait(false);
} }
[HttpPost] [HttpPost]
public async Task Invoke() public async Task Invoke()
{ {
await SyncJitRecordAsync(); await SyncJitRecordAsync().ConfigureAwait(false);
await SyncJisRecordAsync(); await SyncJisRecordAsync().ConfigureAwait(false);
if (_addMaterialRelationships.Any()) 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); await _materialRelationshipManager.AddNewMaterialRelationships(_addMaterialRelationships).ConfigureAwait(false);
} }
} }
@ -100,7 +100,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
} }
//WMS发运记录 //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); var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<BBAC_SE_DETAIL>>(wmsSeRecords);
if (bbacSeDetails.Any()) if (bbacSeDetails.Any())
@ -150,7 +150,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
} }
//WMS发运数据 //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); var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<BBAC_SE_DETAIL>>(wmsRecords);
if (bbacSeDetails.Any()) 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); await SyncJisRecordAsync().ConfigureAwait(false);
if (_addMaterialRelationships.Any()) 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); 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; 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; } public string RefVinCode { get; set; }
[DisplayName("单据类型")] [DisplayName("单据类型")]
public EnumBillType BillType { get; set; } public int? BillType { get; set; }
[DisplayName("子单据类型")] [DisplayName("子单据类型")]
public EnumSubBillType SubBillType { get; set; } public int? SubBillType { get; set; }
[DisplayName("单据性质")] [DisplayName("单据性质")]
public string BillCharacter { get; set; } public string BillCharacter { get; set; }
[DisplayName("事务类型")] [DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; } public int? TransType { get; set; }
[DisplayName("发运主类型")] [DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
@ -111,7 +111,7 @@ public class TM_BJBMPT_JIS_RECORD
public string MatchNumber { get; set; } public string MatchNumber { get; set; }
[DisplayName("业务类型")] [DisplayName("业务类型")]
public EnumProTpe ProType { get; set; } public int? ProType { get; set; }
[DisplayName("发货条码")] [DisplayName("发货条码")]
public string DeliverCode { get; set; } 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; } public string ToLoc { get; set; }
[DisplayName("单据类型")] [DisplayName("单据类型")]
public EnumBillType BillType { get; set; } public int? BillType { get; set; }
[DisplayName("子单据类型")] [DisplayName("子单据类型")]
public EnumSubBillType SubBillType { get; set; } public int? SubBillType { get; set; }
[DisplayName("事务类型")] [DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; } public int? TransType { get; set; }
[DisplayName("发运主类型")] [DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
@ -93,7 +93,7 @@ public class TM_BJBMPT_JIT_RECORD
public string Remark { get; set; } public string Remark { get; set; }
[DisplayName("业务类型")] [DisplayName("业务类型")]
public EnumProTpe ProType { get; set; } public int? ProType { get; set; }
[DisplayName("JIS排序单号")] [DisplayName("JIS排序单号")]
public string OrderNum { get; set; } 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; } public string Remark { get; set; }
[DisplayName("单据类型")] [DisplayName("单据类型")]
public EnumBillType BillType { get; set; } public int? BillType { get; set; }
[DisplayName("子单据类型")] [DisplayName("子单据类型")]
public EnumSubBillType SubBillType { get; set; } public int? SubBillType { get; set; }
[DisplayName("业务类型")] [DisplayName("业务类型")]
public EnumProTpe ProType { get; set; } public int? ProType { get; set; }
[DisplayName("事务类型")] [DisplayName("事务类型")]
public EnumDelTransType TransType { get; set; } public int? TransType { get; set; }
[DisplayName("发运主类型")] [DisplayName("发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core; using System.Linq.Dynamic.Core;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
using Shouldly; using Shouldly;
@ -16,8 +14,6 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Enums;
using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report namespace SettleAccount.Job.Services.Report
@ -74,22 +70,122 @@ namespace SettleAccount.Job.Services.Report
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
//有EDI的发运数据 //有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数据 //有发运的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 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 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); //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();
//无EDI的发运数据
var notHaveEidSes = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false); //var haveEidHaveSes = from se in haveEidSesGroup
//无发运的EDI数据 // join edi in haveSeEidsGroup
var notHaveSeEids = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == false); // on new { se.PN, se.LU } equals new { edi.PN, edi.LU }
// select new JisBBACEidSeCompareExport()
//有EDI有发运 // {
var haveEdiHaveSes = haveEidSes.ToList(); // Category = default,
var dsdddd = haveSeEids.ToList(); // WmsBillNum = default,
//有EDI无发运 // CarModeCode = default,
var haveEdiNotHaveSes = notHaveEidSes.ToList(); // LineStationcode = default,
//无EDI有发运 // SequenceNumber = default,
var notHaveEdiHaveSes = notHaveSeEids.ToList(); // 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(); var ids = id.ToString();

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

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

Loading…
Cancel
Save