mahao 1 year ago
parent
commit
882323d739
  1. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js
  2. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/fa-yun.js
  3. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
  4. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  5. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/user.js
  6. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/input/fa-yun.js
  7. 139
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
  8. 22
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
  9. 152
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  10. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs
  11. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs
  12. 73
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs
  13. 37
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  14. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  15. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  16. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  17. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs
  18. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs
  19. 23
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  20. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs
  21. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs
  22. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs
  23. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_NOT_SA_DETAIL.cs

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

@ -3,40 +3,40 @@ import { reactive, ref } from "vue";
export default { export default {
template: html`<div class="app-table el-table" ref="tableRef"> template: html`<div class="app-table el-table" ref="tableRef">
<div class="row"> <div class="row header">
<template v-for="(item,key) in columns.properties"> <template v-for="(item,key) in columns.properties">
<div class="cell el-table__cell" v-if="item.input==='selection'"> <div class="cell el-table__cell selection" v-if="item.input==='selection'">
<div class="cell" style="text-align:center;"> <div class="cell" style="text-align:center;">
<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>
</div> </div>
<template v-else-if="item.type==='object'"> <template v-else-if="item.type==='object'">
<template v-for="(item2,key2) in item.properties"> <template v-for="(item2,key2) in item.properties">
<div class="cell el-table__cell" v-if="!item2.hidden"> <div class="cell el-table__cell" :class="key+'.'+key2" v-if="!item2.hidden">
<div class="cell">{{item2.title}}</div> <div class="cell">{{item2.title}}</div>
</div> </div>
</template> </template>
</template> </template>
<div class="cell el-table__cell" v-else-if="!item.hidden"> <div class="cell el-table__cell" :class="key" v-else-if="!item.hidden">
<div class="cell">{{item.title}}</div> <div class="cell">{{item.title}}</div>
</div> </div>
</template> </template>
</div> </div>
<div v-for="(row,index) in data" class="row"> <div v-for="(row,index) in data" class="row data">
<template v-for="(item,key) in columns.properties"> <template v-for="(item,key) in columns.properties">
<div class="cell el-table__cell" v-if="item.input==='selection'"> <div class="cell el-table__cell selection" v-if="item.input==='selection'">
<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 class="el-checkbox__input row" type="checkbox" :value="index" @click="checkClick" /> <input class="el-checkbox__input row" type="checkbox" :value="index" @click="checkClick" />
</div> </div>
</div> </div>
<template v-else-if="item.type==='object'"> <template v-else-if="item.type==='object'">
<template v-for="(item2,key2) in item.properties"> <template v-for="(item2,key2) in item.properties">
<div class="cell el-table__cell" v-if="!item2.hidden"> <div class="cell el-table__cell" :class="key+'.'+key2" v-if="!item2.hidden">
<div class="cell" v-if="row[key]&&!item.hidden">{{row[key][key2]}}</div> <div class="cell" v-if="row[key]&&!item.hidden">{{row[key][key2]}}</div>
</div> </div>
</template> </template>
</template> </template>
<div class="cell el-table__cell" v-else-if="!item.hidden"> <div class="cell el-table__cell" :class="key" v-else-if="!item.hidden">
<div class="cell">{{row[key]}}</div> <div class="cell">{{row[key]}}</div>
</div> </div>
</template> </template>

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

@ -312,19 +312,16 @@ const schema2 = {
export default function (businessType) { export default function (businessType) {
let schema = null; let schema = null;
let service = null; let service = null;
let syncService = null; const syncService = "hand-se-sync/sync";
if (businessType === "JisBBAC") { if (businessType === "JisBBAC") {
schema = schema1; schema = schema1;
service = "bbac_se_detail_service"; service = "bbac_se_detail_service";
syncService = "bbacse-sync/invoke";
} else if (businessType === "JisHBPO") { } else if (businessType === "JisHBPO") {
schema = schema1; schema = schema1;
service = "hbpo_se_detail_service"; service = "hbpo_se_detail_service";
syncService = "hbpose-sync/invoke";
} else { } else {
schema = schema2; schema = schema2;
service = "pub_se_detail_service"; service = "pub_se_detail_service";
syncService = "hand-se-sync/sync";
} }
const queryUrl = `settleaccount/${service}/get-list`; const queryUrl = `settleaccount/${service}/get-list`;
const exportUrl = `settleaccount/${service}/export`; const exportUrl = `settleaccount/${service}/export`;

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js

@ -65,7 +65,7 @@ export default function (businessType, type) {
service = "invoice_service"; service = "invoice_service";
} }
const queryUrl = `settleaccount/${service}/main-query`; const queryUrl = `settleaccount/${service}/main-query`;
const exportUrl = `settleaccount/${service}/export`; const exportUrl = `settleaccount/invoice_service/export-detail`;
const invoiceUrl = `settleaccount/${service}/generate-invoice`; const invoiceUrl = `settleaccount/${service}/generate-invoice`;
const receivedUrl = `settleaccount/${service}/received`; const receivedUrl = `settleaccount/${service}/received`;
const rejectUrl = `settleaccount/${service}/reject`; const rejectUrl = `settleaccount/${service}/reject`;

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

@ -87,7 +87,7 @@ function createCommerceCheckList(path, business, client, title = "商务审批")
createButton("query", "title=查询&isTop=true"), createButton("query", "title=查询&isTop=true"),
createButton("approval", "title=商务审核通过&isTop=true"), createButton("approval", "title=商务审核通过&isTop=true"),
createButton("reject", "title=退回"), createButton("reject", "title=退回"),
createButton("export", "title=导出&isTop=true&pattern=paged"), createButton("export-group", "title=导出发票分组&pattern=paged"),
createButton("receive", "title=客户已收票&isTop=true"), createButton("receive", "title=客户已收票&isTop=true"),
], ],
}; };

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

@ -15,7 +15,7 @@ export default {
const url = `base/user/${rows[0].id}/${item.path}`; const url = `base/user/${rows[0].id}/${item.path}`;
await appListRef.value.action( await appListRef.value.action(
async () => await request(url, null, { method: item.meta.method }), async () => await request(url, null, { method: item.meta.method }),
`是否重置用户${rows[0].userName}密码`, `是否重置用户${rows[0].userName}密码?`,
`${rows[0].userName}密码已经重置为123456` `${rows[0].userName}密码已经重置为123456`
); );
} }

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

@ -1,13 +1,15 @@
import AppList from "../../components/list/index.js"; import AppList from "../../components/list/index.js";
import html from "html"; import html from "html";
import { ref } from "vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import useConfig from "../../models/input/fa-yun.js"; import useConfig from "../../models/input/fa-yun.js";
import request from "../../request/index.js"; import request from "../../request/index.js";
export default { export default {
components: { AppList }, components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`,
setup() { setup() {
const appListRef = ref(null);
const route = useRoute(); const route = useRoute();
const businessType = route.meta.businessType; const businessType = route.meta.businessType;
const config = useConfig(businessType); const config = useConfig(businessType);
@ -16,9 +18,9 @@ export default {
if (item.path === "sync") { if (item.path === "sync") {
const url = config.edit.syncUrl; const url = config.edit.syncUrl;
const method = config.edit.syncMethod; const method = config.edit.syncMethod;
await request(url, route.meta.businessType, { method }); await appListRef.value.action(async () => await request(url, route.meta.businessType, { method }), `确认手动同步吗?`);
} }
}; };
return { config, onCommand }; return { appListRef, config, onCommand };
}, },
}; };

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

@ -5,10 +5,12 @@ import request from "../../request/index.js";
import AppForm from "../../components/form/index.js"; import AppForm from "../../components/form/index.js";
import AppTable from "../../components/table/index.js"; import AppTable from "../../components/table/index.js";
import extraProperties from "../../models/_extraProperties.js"; import extraProperties from "../../models/_extraProperties.js";
import { getUrl } from "../../request/index.js";
import { ElMessage } from "element-plus";
export default { export default {
components: { AppForm, AppTable }, components: { AppForm, AppTable },
template: html`<el-drawer v-model="show" destroy-on-close size="50%" class="page-drawer" :close-on-click-modal="false"> template: html`<el-drawer v-if="refreshRef" v-model="show" destroy-on-close size="50%" class="page-drawer" :close-on-click-modal="false">
<template #header> <span class="el-dialog__title"> 结算明细 </span> </template> <template #header> <span class="el-dialog__title"> 结算明细 </span> </template>
<el-row style="height:calc(100vh - 160px);" v-loading="loading"> <el-row style="height:calc(100vh - 160px);" v-loading="loading">
<el-col> <el-col>
@ -70,12 +72,31 @@ export default {
<el-row style="width:100%;height:100%;padding:10px;"> <el-row style="width:100%;height:100%;padding:10px;">
<el-col :span="12" style="height:100%;padding:0 5px 0 0;"> <el-col :span="12" style="height:100%;padding:0 5px 0 0;">
<el-scrollbar> <el-scrollbar>
<app-table ref="setup2table1Ref" :data="model.invoicE_WAIT_DETAIL" :columns="columns2" /> <app-table ref="setup2table1Ref" :data="model.invoicE_WAIT_DETAIL" :columns="setup2columns" />
</el-scrollbar> </el-scrollbar>
</el-col> </el-col>
<el-col :span="12" style="height:100%;padding:0 0 0 5px;"> <el-col :span="12" style="height:100%;padding:0 0 0 5px;">
<el-scrollbar> <el-scrollbar>
<app-table ref="setup2table2Ref" :data="adjList" :columns="columns5" /> <app-table ref="setup2table2Ref" :data="adjList" :columns="setup2columns" />
</el-scrollbar>
</el-col>
</el-row>
</div>
<div class="setup3" v-show="setupRef===3" style="height:calc(100% - 60px);background:#ebeef5;">
<el-row style="width:100%;height:100%;padding:10px;">
<el-col style="height:100%;padding:0 5px 0 0;">
<el-scrollbar>
<h2>发票预览</h2>
<div>{{setup3Model}}</div>
</el-scrollbar>
</el-col>
</el-row>
</div>
<div class="setup3" v-show="setupRef===3" style="height:calc(100% - 60px);background:#ebeef5;">
<el-row style="width:100%;height:100%;padding:10px;">
<el-col style="height:100%;padding:0 5px 0 0;">
<el-scrollbar>
<h2>完成</h2>
</el-scrollbar> </el-scrollbar>
</el-col> </el-col>
</el-row> </el-row>
@ -86,7 +107,6 @@ export default {
</span> </span>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" @click="next" v-if="setupRef<3">下一步</el-button> <el-button type="primary" @click="next" v-if="setupRef<3">下一步</el-button>
<el-button type="primary" @click="submitReOpen" v-if="setupRef===3">确定</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -137,13 +157,11 @@ export default {
.el-dialog__body { .el-dialog__body {
height: calc(100% - 120px); height: calc(100% - 120px);
} }
/* .cell.diff {
.re-open .el-scrollbar, background: yellow;
.re-open .el-scrollbar__view { }
height: calc(100% - 120px);
} */
</style>`, </style>`,
props: ["modelValue", "data", "isBusiness"], props: ["modelValue", "data", "isBusiness", "businessType"],
emit: ["update:modelValue"], emit: ["update:modelValue"],
setup(props, context) { setup(props, context) {
const show = ref(props.modelValue); const show = ref(props.modelValue);
@ -156,6 +174,7 @@ export default {
adJ_DETAIL: [], adJ_DETAIL: [],
}); });
// //
const refreshRef = ref(true);
const columns1 = { const columns1 = {
type: "object", type: "object",
title: "发票和结算分组对应关系", title: "发票和结算分组对应关系",
@ -281,6 +300,7 @@ export default {
}, },
}; };
const setup2columns = { const setup2columns = {
properties: {
lu: { lu: {
type: "string", type: "string",
title: "零件号", title: "零件号",
@ -297,6 +317,7 @@ export default {
type: "number", type: "number",
title: "金额", title: "金额",
}, },
},
}; };
delete columns5.properties["oldInvBillNum"]; delete columns5.properties["oldInvBillNum"];
delete columns5.properties["invGroupNum"]; delete columns5.properties["invGroupNum"];
@ -310,6 +331,7 @@ export default {
const importDialogVisible = ref(false); const importDialogVisible = ref(false);
const setup2table1Ref = ref(null); const setup2table1Ref = ref(null);
const setup2table2Ref = ref(null); const setup2table2Ref = ref(null);
const setup3Model = ref(null);
const showSetupDialog = () => { const showSetupDialog = () => {
//重开发票号 //重开发票号
//invBillNum= //invBillNum=
@ -439,34 +461,103 @@ export default {
loading.value = false; loading.value = false;
} }
}; };
const addDiff = (o, list2, nodeClass, diffClass = "diff") => {
const key = o.querySelector(".lu")?.innerText;
var node = o.querySelector(nodeClass);
var nodeValue = node?.innerText;
var node2 = Array.from(list2)
.find((o) => o.querySelector(".lu").innerText === key)
?.querySelector(nodeClass);
var nodeValue2 = node2?.innerText;
if (nodeValue !== nodeValue2) {
node?.classList.add(diffClass);
node2?.classList.add(diffClass);
} else {
node?.classList.remove(diffClass);
node2?.classList.remove(diffClass);
}
};
const next = async () => { const next = async () => {
if (setupRef.value === 1) { if (setupRef.value === 1) {
try { try {
// setupRef.value += 1;
// return; //临时
//发到服务的校验
const result = await request(`settleaccount/adj_service/check-import`, adjList.value, { method: "POST" });
if (!result.errors) {
if (result.data?.code === 200) {
adjList.value = result.data.data;
setupRef.value += 1; setupRef.value += 1;
//处理高亮 //处理高亮
nextTick(() => { nextTick(() => {
console.log(setup2table1Ref.value); const list1 = setup2table1Ref.value.tableRef.querySelectorAll(".row.data");
console.log(setup2table2Ref.value); const list2 = setup2table2Ref.value.tableRef.querySelectorAll(".row.data");
list1.forEach((o) => {
addDiff(o, list2, ".qty");
addDiff(o, list2, ".amt");
}); });
list2.forEach((o) => {
addDiff(o, list1, ".qty");
addDiff(o, list1, ".amt");
});
});
} else if (result.data?.code === 400) {
ElMessage({
type: "error",
message: "校验失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
}
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
} else if (setupRef.value === 2) { } else if (setupRef.value === 2) {
// const url = "settleaccount/adj_service/check-import"; let service = null;
// const result = await request(url, adjList.value, { method: "POST" }); if (props.businessType === "JisBBAC") {
// if (!result.errors) { service = "bbac_ba_service";
// if (result.data?.code === 200) { } else if (bprops.usinessType === "JisHBPO") {
// setupRef.value += 1; service = "hbpo_ba_service";
// } else if (result.data?.code === 400 && result.data.fileName) {
// window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
// }
// }
setupRef.value += 1;
} else { } else {
service = "pub_ba_service";
}
const url = `settleaccount/${service}}/reissue-invoice-list`;
const result = await request(url, adjList.value, { method: "POST" });
if (!result.errors) {
if (result.data?.code === 200) {
//setup3的数据来源
setup3Model.value = result.data.data;
setupRef.value += 1;
} else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({
type: "error",
message: "提交失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
}
} else if (setupRef.value === 3) {
const url = `settleaccount/${service}}/reissue-invoice-extend`;
const result = await request(url, adjList.value, { method: "POST" });
if (!result.errors) {
if (result.data?.code === 200) {
setupRef.value += 1; setupRef.value += 1;
} else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({
type: "error",
message: "提交失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
}
} else {
setupDialogVisable.value = false;
refreshRef.value = false;
nextTick(() => {
refreshRef.value = true;
});
} }
}; };
const submitReOpen = async () => {};
// //
onMounted(async () => { onMounted(async () => {
loading.value = true; loading.value = true;
@ -515,6 +606,8 @@ export default {
next, next,
setup2table1Ref, setup2table1Ref,
setup2table2Ref, setup2table2Ref,
refreshRef,
setup3Model,
}; };
}, },
}; };

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

@ -9,7 +9,8 @@ import AppCheck from "./_check.js";
export default { export default {
components: { AppList, AppCheck }, components: { AppList, AppCheck },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`, template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :businessType="businessType" :data="data" :isBusiness="true" />`,
setup() { setup() {
const appListRef = ref(null); const appListRef = ref(null);
const visable = ref(false); const visable = ref(false);
@ -46,12 +47,29 @@ export default {
appListRef.value.tableLoading = false; appListRef.value.tableLoading = false;
} }
} }
} else if (item.path === "export-group") {
const url = config.edit.exportUrl;
const method = config.edit.exportMethod;
const postData = {
filters: [
{
logic: "and",
column: "invGroupNum",
action: "equal",
value: rows[0]["invGroupNum"],
},
],
};
const response = await request(url, postData, { method });
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
} else if (item.path === "invbillNum" || item.path === "invGroupNum") { } else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { [item.path]: rows[0][item.path] }; data.value = { [item.path]: rows[0][item.path] };
visable.value = true; visable.value = true;
} }
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { appListRef, config, onCommand, visable, data }; return { appListRef, config, onCommand, visable, data, businessType };
}, },
}; };

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

@ -38,7 +38,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary> /// </summary>
[Display(Name = "税后金额")] [Display(Name = "税后金额")]
public decimal TaxAmt { get; set; } public decimal TaxAmt { get; set; }
[Display(Name = "金税发票金额")] [Display(Name = "金税发票金额")]
public decimal RealAmt { get; set; } public decimal RealAmt { get; set; }
/// <summary> /// <summary>
@ -46,7 +45,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary> /// </summary>
[Display(Name = "发票分组号")] [Display(Name = "发票分组号")]
public string InvGroupNum { get; set; } public string InvGroupNum { get; set; }
/// <summary> /// <summary>
///业务类别 ///业务类别
/// </summary> /// </summary>
@ -63,11 +61,62 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal TaxDiff { get; set; } public decimal TaxDiff { get; set; }
[Display(Name = "客户代码")] [Display(Name = "客户代码")]
public string ClientCode { get; set; } public string ClientCode { get; set; }
}
[Display(Name = "发票")]
public class INVOICE_REPEAT_DTO : EntityDto<Guid>
{
/// <summary>
///系统生成发票号
/// </summary>
[Display(Name = "系统发票号")]
public string InvbillNum { get; set; }
/// <summary>
///未税金额
/// </summary>
[Display(Name = "未税金额")]
public decimal Amt { get; set; }
/// <summary>
///未税金额
/// </summary>
[Display(Name = "未税金额")]
public decimal Tax { get; set; }
/// <summary>
///税后金额
/// </summary>
[Display(Name = "税后金额")]
public decimal TaxAmt { get; set; }
[Display(Name = "金税发票金额")]
public decimal RealAmt { get; set; }
/// <summary>
///发票分组号
/// </summary>
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///业务类别
/// </summary>
[Display(Name = "业务类别")]
public EnumBusinessType BusinessType { get; set; }
public List<INVOICE_WAIT_DETAIL_DTO> DETIAL { set; get; }
} }
public class INVOICE_GRP_EXP_DTO public class INVOICE_GRP_EXP_DTO
{ {
/// <summary> /// <summary>
@ -109,20 +158,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
//[ExporterHeader(DisplayName ="发票税后尾差")] //[ExporterHeader(DisplayName ="发票税后尾差")]
//public decimal TaxDiff { get; set; } //public decimal TaxDiff { get; set; }
[Display(Name = "客户代码")] [ExporterHeader(DisplayName = "客户编码")]
public string ClientCode { get; set; } public string ClientCode { get; set; }
}
}
public class INVOICE_GRP_IMP_DTO public class INVOICE_GRP_IMP_DTO
{ {
/// <summary> /// <summary>
///实际纸质发票号 ///实际纸质发票号
/// </summary> /// </summary>
[ImporterHeader(Name = "实际纸质发票号", FixAllSpace = true)] [ImporterHeader(Name = "金税发票号", FixAllSpace = true)]
[Required(ErrorMessage = "{0}是必填项")] [Required(ErrorMessage = "{0}是必填项")]
[MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RealnvBillNum { get; set; } public string RealnvBillNum { get; set; }
@ -130,7 +179,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// <summary> /// <summary>
///实际纸质发票号 ///实际纸质发票号
/// </summary> /// </summary>
[ImporterHeader(Name = "系统生成发票号", FixAllSpace = true)] [ImporterHeader(Name = "系统发票号", FixAllSpace = true)]
[Required(ErrorMessage = "{0}是必填项")] [Required(ErrorMessage = "{0}是必填项")]
[MaxLength(200, ErrorMessage = "{0}最多输入{1}个字符")] [MaxLength(200, ErrorMessage = "{0}最多输入{1}个字符")]
public string InvbillNum { get; set; } public string InvbillNum { get; set; }
@ -142,6 +191,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public decimal Tax { get; set; } public decimal Tax { get; set; }
[ImporterHeader(Name = "客户号", FixAllSpace = true)]
[Required(ErrorMessage = "{0}是必填项")]
public string ClientCode { get; set; }
[ImporterHeader(Name = "金税发票金额", FixAllSpace = true)]
[Required(ErrorMessage = "{0}是必填项")]
public decimal RealAmt { get; set; }
} }
public class INVOICE_GRP_REQ_DTO : RequestInputBase public class INVOICE_GRP_REQ_DTO : RequestInputBase
@ -324,11 +385,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public class INVOICE_MAP_GROUP_EXP_DTO public class INVOICE_MAP_GROUP_EXP_DTO
{ {
/// <summary> ///// <summary>
///期间 /////期间
/// </summary> ///// </summary>
[ExporterHeader(DisplayName = "期间")] //[ExporterHeader(DisplayName = "期间")]
public int Version { get; set; } //public int Version { get; set; }
/// <summary> /// <summary>
///发票号 ///发票号
/// </summary> /// </summary>
@ -345,20 +406,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ExporterHeader(DisplayName = "结算分组号")] [ExporterHeader(DisplayName = "结算分组号")]
public string SettleGroupNum { get; set; } public string SettleGroupNum { get; set; }
/// <summary> /// <summary>
///金额 /////金额
/// </summary> ///// </summary>
[ExporterHeader(DisplayName = "金额")] //[ExporterHeader(DisplayName = "金额")]
public decimal Amt { get; set; } //public decimal Amt { get; set; }
/// <summary> ///// <summary>
///扩展字段1 /////扩展字段1
/// </summary> ///// </summary>
[ExporterHeader(DisplayName = "扩展字段1")] //[ExporterHeader(DisplayName = "扩展字段1")]
public string Extend1 { get; set; } //public string Extend1 { get; set; }
/// <summary> ///// <summary>
///扩展字段2 /////扩展字段2
/// </summary> ///// </summary>
[ExporterHeader(DisplayName = "扩展字段2")] //[ExporterHeader(DisplayName = "扩展字段2")]
public string Extend2 { get; set; } //public string Extend2 { get; set; }
} }
@ -375,11 +436,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public class INVOICE_NOT_SETTLE_DTO : EntityDto<Guid> public class INVOICE_NOT_SETTLE_DTO : EntityDto<Guid>
{ {
/// <summary> ///// <summary>
///期间 /////期间
/// </summary> ///// </summary>
[Display(Name = "期间")] //[Display(Name = "期间")]
public int Version { get; set; } //public int Version { get; set; }
/// <summary> /// <summary>
///发票分组号 ///发票分组号
/// </summary> /// </summary>
@ -400,16 +461,27 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary> /// </summary>
[Display(Name = "不可结算零件号")] [Display(Name = "不可结算零件号")]
public string LU1 { get; set; } public string LU1 { get; set; }
/// <summary>
///扩展字段1
/// </summary> [Display(Name = "不可结算零件号")]
[Display(Name = "扩展字段1")] public string InvBillNum { get; set; }
public string Extend1 { get; set; }
/// <summary>
///扩展字段2 //[Display(Name = "不可结算零件号")]
/// </summary> //public string LU1 { get; set; }
[Display(Name = "扩展字段2")]
public string Extend2 { get; set; }
///// <summary>
/////扩展字段1
///// </summary>
//[Display(Name = "扩展字段1")]
//public string Extend1 { get; set; }
///// <summary>
/////扩展字段2
///// </summary>
//[Display(Name = "扩展字段2")]
//public string Extend2 { get; set; }
public Dictionary<string, object> ExtraProperties { get; set; } public Dictionary<string, object> ExtraProperties { get; set; }

4
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs

@ -1,4 +1,5 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
@ -42,6 +43,9 @@ public class PUB_ADJ_DETAIL_DTO : EntityDto<Guid>
[Display(Name = "键值")] [Display(Name = "键值")]
public string KeyCode { get; set; } public string KeyCode { get; set; }
[Display(Name = "价格")]
public string Price { get; set; }
} }

5
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs

@ -110,6 +110,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "客户零件号")] [Display(Name = "客户零件号")]
public string PartCode { get; set; } public string PartCode { get; set; }
[Display(Name = "订单号")]
public string Extend4 { get; set; }
} }

73
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs

@ -1,15 +1,18 @@
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 System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using DocumentFormat.OpenXml.Bibliography; using DocumentFormat.OpenXml.Bibliography;
using DocumentFormat.OpenXml.Office2010.Excel; using DocumentFormat.OpenXml.Office2010.Excel;
using DocumentFormat.OpenXml.Wordprocessing;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore.Query.SqlExpressions;
using SettleAccount.Bases; using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp; using Volo.Abp;
@ -22,10 +25,12 @@ using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.BQ.Temp;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
using static System.Runtime.CompilerServices.RuntimeHelpers;
namespace Win.Sfs.SettleAccount.Bases; namespace Win.Sfs.SettleAccount.Bases;
/// <summary> /// <summary>
@ -42,6 +47,8 @@ public class ADJ_SERVICE : BASE_SERVICE
protected readonly INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> _bbacRepository; protected readonly INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> _bbacRepository;
protected readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _pubRepository; protected readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _pubRepository;
protected readonly INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> _hbpoRepository; protected readonly INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> _hbpoRepository;
protected readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
protected readonly INormalEfCoreRepository<PriceListBJ, Guid> _pricebjRepository;
public ADJ_SERVICE( public ADJ_SERVICE(
@ -54,7 +61,9 @@ public class ADJ_SERVICE : BASE_SERVICE
INormalEfCoreRepository<MaterialRelationship, Guid> relRepository, INormalEfCoreRepository<MaterialRelationship, Guid> relRepository,
INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> bbacRepository, INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> bbacRepository,
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> pubRepository, INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> pubRepository,
INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> hbpoRepository INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> hbpoRepository,
INormalEfCoreRepository<PriceList, Guid> priceRepository,
INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository
) )
: base(excelImportService, snowflakeIdGenerator, commonManager) : base(excelImportService, snowflakeIdGenerator, commonManager)
@ -66,6 +75,8 @@ public class ADJ_SERVICE : BASE_SERVICE
_bbacRepository = bbacRepository; _bbacRepository = bbacRepository;
_pubRepository = pubRepository; _pubRepository = pubRepository;
_hbpoRepository = hbpoRepository; _hbpoRepository = hbpoRepository;
_priceRepository = priceRepository;
_pricebjRepository = pricebjRepository;
} }
/// <summary> /// <summary>
///查询明细 ///查询明细
@ -194,7 +205,7 @@ public class ADJ_SERVICE : BASE_SERVICE
itm.KeyCode = itm.PN + itm.LU.Replace(" ", "").Trim(); itm.KeyCode = itm.PN + itm.LU.Replace(" ", "").Trim();
} }
var pnlist = p_list.Select(p => p.PN).Distinct(); var pnlist = p_list.Select(p => p.PN).Distinct();
int flag = 0;
var keylist = p_list.Select(p => p.KeyCode).Distinct(); var keylist = p_list.Select(p => p.KeyCode).Distinct();
List<ERR_EXP_DTO> errorList = new List<ERR_EXP_DTO>(); List<ERR_EXP_DTO> errorList = new List<ERR_EXP_DTO>();
var first = p_list.FirstOrDefault(); var first = p_list.FirstOrDefault();
@ -228,6 +239,7 @@ public class ADJ_SERVICE : BASE_SERVICE
} }
break; break;
case EnumBusinessType.BeiJian: case EnumBusinessType.BeiJian:
flag = 1;
var errors3 = _pubRepository.Where(p => pnlist.Contains(p.PN)); var errors3 = _pubRepository.Where(p => pnlist.Contains(p.PN));
foreach (var p in errors3) foreach (var p in errors3)
{ {
@ -281,8 +293,63 @@ public class ADJ_SERVICE : BASE_SERVICE
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) });
} }
List<PUB_ADJ_DETAIL_DTO> ls = new List<PUB_ADJ_DETAIL_DTO>();
if (flag == 1)
{
var pricebjlist = _pricebjRepository.ToList();
var inner = from d in p_list
join p in pricebjlist on d.LU equals p.LU
where
d.SettleDate >= p.BeginDate && d.SettleDate <= p.EndDate
select
new PUB_ADJ_DETAIL_DTO()
{
InvBillNum = d.InvBillNum,
SettleDate = d.SettleDate,
LU = d.LU,
PN = d.PN,
Qty = d.Qty,
GroupNum = d.GroupNum,
KeyCode = d.KeyCode,
Price = d.Price,
};
ls = inner.ToList();
}
else
{
var pricelist = _priceRepository.ToList();
var inner = from d in p_list
join p in pricelist on d.LU equals p.LU
where
d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new PUB_ADJ_DETAIL_DTO()
{
InvBillNum = d.InvBillNum,
SettleDate = d.SettleDate,
LU = d.LU,
PN = d.PN,
Qty = d.Qty,
GroupNum = d.GroupNum,
KeyCode = d.KeyCode,
Price = d.Price,
};
ls = inner.ToList();
}
return new JsonResult(new { Code = 200, Message = "校验成功" }); ; return new JsonResult(new { Code = 200, Message =ls }); ;
} }
} }

37
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -122,8 +122,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
partcode: itm.PartCode partcode: itm.PartCode
); );
entity.IsMaiDan = itm.IsMaiDan; entity.IsMaiDan = itm.IsMaiDan;
bbaclist.Add(entity); bbaclist.Add(entity);
} }
} }
@ -324,10 +322,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
public virtual async Task<List<INVOICE_WAIT_DETAIL_DTO>> ReissueInvoiceList(List<PUB_ADJ_DETAIL_DTO> p_list) public virtual async Task<INVOICE_REPEAT_DTO> ReissueInvoiceList(List<PUB_ADJ_DETAIL_DTO> p_list)
{ {
List<INVOICE_WAIT_DETAIL_DTO> ls = new List<INVOICE_WAIT_DETAIL_DTO>();
var invBill = new INVOICE_REPEAT_DTO();
var adjlist=ObjectMapper.Map<List<PUB_ADJ_DETAIL_DTO>, List<PUB_ADJ_DETAIL>>(p_list); var adjlist=ObjectMapper.Map<List<PUB_ADJ_DETAIL_DTO>, List<PUB_ADJ_DETAIL>>(p_list);
if (adjlist == null && adjlist.Count==0) if (adjlist == null && adjlist.Count==0)
{ {
@ -428,13 +426,38 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 if (invbillnum.Substring(0, 3) == "INV")//一次开票重开
{ {
var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum);
ls= ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities);
var ls = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities);
var tax = inv.Tax;
var amt = entities.Sum(p => p.Amt);
var taxamt =amt+ Math.Round(amt * tax, 2);
var billnum = string.Empty;
invBill.Amt = amt;
invBill.TaxAmt = taxamt;
invBill.Tax = tax;
invBill.BusinessType=inv.BusinessType;
invBill.DETIAL = ls;
} }
else//二次开票 else//二次开票
{ {
var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum);
ls=ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities); var ls = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities);
var tax = inv.Tax;
var amt = entities.Sum(p => p.Amt);
var taxamt = amt + Math.Round(amt * tax, 2);
var billnum = string.Empty;
invBill.Amt = amt;
invBill.TaxAmt = taxamt;
invBill.Tax = tax;
invBill.BusinessType = inv.BusinessType;
invBill.DETIAL = ls;
} }
} }
} }
@ -447,7 +470,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//{ //{
// throw new UserFriendlyException($"不存发票号:{p_invbillnum}对应的结算分组号"); // throw new UserFriendlyException($"不存发票号:{p_invbillnum}对应的结算分组号");
//} //}
return ls; return invBill;
} }

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

@ -263,9 +263,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<INVOICE_GRP_IMP_DTO>(files, _excelImportService); var result = await _exportImporter.UploadExcelImport<INVOICE_GRP_IMP_DTO>(files, _excelImportService);
var ls = ObjectMapper.Map<List<INVOICE_GRP_IMP_DTO>, List<INVOICE_GRP>>(result); var ls = ObjectMapper.Map<List<INVOICE_GRP_IMP_DTO>, List<INVOICE_GRP>>(result);
var namelist = ls.Select(p => p.InvbillNum).Distinct(); var namelist = ls.Select(p => p.InvbillNum).Distinct();
var invlist = _repository.Where(p => namelist.Contains(p.InvbillNum)).ToList(); var invlist = _repository.Where(p => namelist.Contains(p.InvbillNum)).ToList();

9
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -109,7 +109,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
invbillnum: string.Empty, invbillnum: string.Empty,
partcode: itm.PartCode partcode: itm.PartCode,
pobillnum:string.Empty
)); ));
@ -234,7 +235,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
invbillnum: string.Empty, invbillnum: string.Empty,
partcode:itm.PartCode partcode:itm.PartCode,
pobillnum:string.Empty
)); ));
@ -367,7 +369,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
invbillnum: string.Empty, invbillnum: string.Empty,
partcode: itm.PartCode partcode: itm.PartCode,
pobillnum:string.Empty
)); ));
} }
} }

9
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs

@ -22,9 +22,11 @@ using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
using static Win.Sfs.SettleAccount.SettleAccountPermissions; using static Win.Sfs.SettleAccount.SettleAccountPermissions;
namespace Win.Sfs.SettleAccount.Entities.BQ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
/// <summary> /// <summary>
/// 通用业务可结算单 /// 通用业务可结算单
/// </summary> /// </summary>
@ -62,8 +64,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_priceRepository = priceRepository; _priceRepository = priceRepository;
_pricebjRepository = pricebjRepository; _pricebjRepository = pricebjRepository;
} }
[HttpPost] [HttpPost]
public async override Task<IActionResult> GenerateInvoice(string billnum) public async override Task<IActionResult> GenerateInvoice(string billnum)
{ {
@ -116,9 +116,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime, EndDate = p.EndTime,
PartCode=d.PartCode,//客户零件号 PartCode=d.PartCode,//客户零件号
PoNum=""
}; };
var dtos = q.ToList(); var dtos = q.ToList();
if (dtos != null && dtos.Count > 0) if (dtos != null && dtos.Count > 0)

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs

@ -10,7 +10,7 @@ public class INVOICE_GRP : FullAuditedAggregateRoot<Guid>
[Display(Name = "金税发票号")] [Display(Name = "金税发票号")]
public string RealnvBillNum { get; set; } = null!; public string RealnvBillNum { get; set; } = null!;
[Display(Name = "系统生成发票号")] [Display(Name = "系统发票号")]
public string InvbillNum { get; set; } = null!; public string InvbillNum { get; set; } = null!;
[Display(Name = "未税金额")] [Display(Name = "未税金额")]
@ -52,12 +52,13 @@ public class INVOICE_GRP : FullAuditedAggregateRoot<Guid>
public decimal TaxDiff { get; set; } public decimal TaxDiff { get; set; }
[Display(Name = "客户代码")] [Display(Name = "客户代码")]
public string ClientCode { get; set; } public string ClientCode { get; set; }
[Display(Name = "实际发票金额")] [Display(Name = "金税发票金额")]
public decimal RealAmt { get; set; } public decimal RealAmt { get; set; }
public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt,
string invGroupNum, string invGroupNum,
string fileName, string fileName,

1
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs

@ -5,6 +5,7 @@ using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ; namespace SettleAccount.Domain.BQ;
[Display(Name = "待开票明细")] [Display(Name = "待开票明细")]
public class INVOICE_WAIT_DETAIL :FullAuditedAggregateRoot<Guid> public class INVOICE_WAIT_DETAIL :FullAuditedAggregateRoot<Guid>
{ {

23
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -380,7 +380,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <returns></returns> /// <returns></returns>
public virtual async Task<bool> ReceivedAsync(List<string> p_invs) public virtual async Task<bool> ReceivedAsync(List<string> p_invs)
{ {
var invList = _repository.Where(p => p_invs.Contains(p.InvbillNum)).ToList();//所有提交发票信息 var invList = _repository.Where(p => p_invs.Contains(p.InvbillNum)).ToList();//所有提交发票信息
int count = invList.Select(p => p.InvGroupNum).Distinct().Count(); int count = invList.Select(p => p.InvGroupNum).Distinct().Count();
if (count > 1) if (count > 1)
@ -594,8 +593,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum, invbillnum: itm.InvBillNum,
partcode:itm.PartCode partcode:itm.PartCode
)); ));
} }
} }
@ -626,7 +623,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum, invbillnum: itm.InvBillNum,
partcode: itm.PartCode partcode: itm.PartCode
)); ));
} }
} }
@ -645,7 +641,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
site: string.Empty site: string.Empty
); );
bbacmainlist.Add(bbac); bbacmainlist.Add(bbac);
} }
var bbacDetail = new List<HBPO_PD_DETAIL>(); var bbacDetail = new List<HBPO_PD_DETAIL>();
foreach (var itm in entityList) foreach (var itm in entityList)
@ -678,7 +673,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
itm.State = SettleBillState.; itm.State = SettleBillState.;
}; };
await _repository.DbContext.BulkUpdateAsync(invList); await _repository.DbContext.BulkUpdateAsync(invList);
return true; return true;
} }
@ -705,7 +699,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
oldlist = pdoldlist.Select(p => p.BillNum).ToList();//已经存在扣减记录,的发票号 oldlist = pdoldlist.Select(p => p.BillNum).ToList();//已经存在扣减记录,的发票号
} }
newlist = p_invs.Where(p => !oldlist.Contains(p)).ToList();//不存在扣减记录的发票号 newlist = p_invs.Where(p => !oldlist.Contains(p)).ToList();//不存在扣减记录的发票号
List<PUB_CAN_SA_DETAIL> entityList = new List<PUB_CAN_SA_DETAIL>();//结算明细 List<PUB_CAN_SA_DETAIL> entityList = new List<PUB_CAN_SA_DETAIL>();//结算明细
var namelist = invList.Select(p => p.InvbillNum).ToList(); var namelist = invList.Select(p => p.InvbillNum).ToList();
if (oldlist.Count > 0) if (oldlist.Count > 0)
@ -734,7 +727,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum, invbillnum: itm.InvBillNum,
partcode:itm.PartCode partcode:itm.PartCode,
pobillnum:string.Empty
)); ));
@ -766,7 +762,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
invbillnum: itm.InvBillNum, invbillnum: itm.InvBillNum,
partcode: itm.PartCode partcode: itm.PartCode,
pobillnum: string.Empty
)); ));
} }
} }
@ -1071,7 +1068,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
if (invoiceMap.Count > 0) if (invoiceMap.Count > 0)
{ {
var groupList = new List<INVOICE_MAP_GROUP>(); var groupList = new List<INVOICE_MAP_GROUP>();
var notDetialList = new List<INVOICE_NOT_SETTLE>(); var notDetialList = new List<INVOICE_NOT_SETTLE>();
var detailList = new List<INVOICE_WAIT_DETAIL>(); var detailList = new List<INVOICE_WAIT_DETAIL>();
@ -1082,7 +1078,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
var key = group.Key;//发票票号 var key = group.Key;//发票票号
var ls = group.Value;//发票明细 var ls = group.Value;//发票明细
//反向查找结算数据 //反向查找结算数据
var query = from itm in dtos var query = from itm in dtos
join itm1 in ls join itm1 in ls
@ -1102,15 +1097,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
on new { itm.LU, itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.PartCode, itm1.BeginDate, itm1.EndDate } on new { itm.LU, itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.PartCode, itm1.BeginDate, itm1.EndDate }
join itm2 in p_ajdlist on new { itm.PartCode, itm.PN, itm.SettleDate } equals new { itm2.PartCode, itm2.PN, itm2.SettleDate } join itm2 in p_ajdlist on new { itm.PartCode, itm.PN, itm.SettleDate } equals new { itm2.PartCode, itm2.PN, itm2.SettleDate }
select itm2; select itm2;
foreach (var itm in query1) foreach (var itm in query1)
{ {
itm.InvBillNum = key; itm.InvBillNum = key;
adjlist.Add(itm); adjlist.Add(itm);
} }
} }
List<INVOICE_WAIT_DETAIL> _entityDetailList = new List<INVOICE_WAIT_DETAIL>(); List<INVOICE_WAIT_DETAIL> _entityDetailList = new List<INVOICE_WAIT_DETAIL>();
foreach (var detail in ls) foreach (var detail in ls)
{ {
@ -1184,8 +1176,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
); );
invlist.Add(invbill); invlist.Add(invbill);
} }
await _repository.DbContext.BulkInsertAsync(invlist); await _repository.DbContext.BulkInsertAsync(invlist);
await _repository.DbContext.BulkInsertAsync(groupList); await _repository.DbContext.BulkInsertAsync(groupList);
await _repository.DbContext.BulkInsertAsync(detailList); await _repository.DbContext.BulkInsertAsync(detailList);
@ -1197,7 +1187,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
await _repository.DbContext.BulkUpdateAsync(adjlist); await _repository.DbContext.BulkUpdateAsync(adjlist);
} }
//await _repository.DbContext.BulkInsertAsync(notDetialList); //await _repository.DbContext.BulkInsertAsync(notDetialList);
_invls = invlist.Select(p => p.InvbillNum).ToList(); _invls = invlist.Select(p => p.InvbillNum).ToList();
} }

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs

@ -640,8 +640,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
decimal amt = detailList.Sum(k => k.Amt); decimal amt = detailList.Sum(k => k.Amt);
decimal txtAmt = Math.Round(detailList.Sum(k => k.Amt), 2); decimal txtAmt = Math.Round(detailList.Sum(k => k.Amt), 2);
var invbill = new INVOICE_GRP var invbill = new INVOICE_GRP
(guid: GuidGenerator.Create(), (guid: GuidGenerator.Create(),
realnvBillNum: string.Empty, realnvBillNum: string.Empty,
@ -931,7 +929,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
throw new UserFriendlyException($"选择要重开发票号{p_OldInvBillNum}已经作废不能重开"); throw new UserFriendlyException($"选择要重开发票号{p_OldInvBillNum}已经作废不能重开");
} }
inv.InvoiceState = InvoiceBillState.; //inv.InvoiceState = InvoiceBillState.报废;

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs

@ -107,7 +107,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: billNumber, invGroupNum: billNumber,
invbillnum: string.Empty, invbillnum: string.Empty,
partcode: itm.PartCode partcode: itm.PartCode,
pobillnum:string.Empty
); );
_entityList.Add(_detailEntity); _entityList.Add(_detailEntity);
@ -145,7 +146,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
groupNum: itm.GroupNum, groupNum: itm.GroupNum,
invGroupNum: billNumber, invGroupNum: billNumber,
invbillnum: string.Empty, invbillnum: string.Empty,
partcode: itm.PartCode partcode: itm.PartCode,
pobillnum: string.Empty
); );
_entityList.Add(_detailEntity); _entityList.Add(_detailEntity);

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

@ -112,6 +112,9 @@ public class PUB_CAN_SA_DETAIL : SA_CAN_BASE
[Display(Name = "业务类别")] [Display(Name = "业务类别")]
public EnumBusinessType BusinessType { get; set; } public EnumBusinessType BusinessType { get; set; }
[Display(Name = "订单号")]
public string PoBillNum { get; set; }
/// <summary> /// <summary>
/// 对应字段DeliveryNode /// 对应字段DeliveryNode
/// </summary> /// </summary>
@ -120,7 +123,8 @@ public class PUB_CAN_SA_DETAIL : SA_CAN_BASE
public PUB_CAN_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType,string partcode, public PUB_CAN_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType,string partcode,
string groupNum, string groupNum,
string invbillnum string invbillnum,
string pobillnum
) )
{ {
InvbillNum=invbillnum; InvbillNum=invbillnum;
@ -139,6 +143,7 @@ public class PUB_CAN_SA_DETAIL : SA_CAN_BASE
BusinessType = businessType; BusinessType = businessType;
GroupNum = groupNum; GroupNum = groupNum;
PartCode = partcode; PartCode = partcode;
PoBillNum = pobillnum;
} }
public PUB_CAN_SA_DETAIL() public PUB_CAN_SA_DETAIL()

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

@ -69,8 +69,11 @@ public class PUB_NOT_SA_DETAIL : SA_NOT_BASE
public EnumBusinessType BusinessType { get; set; } public EnumBusinessType BusinessType { get; set; }
//[Display(Name = "结算分组")] //[Display(Name = "结算分组")]
//public string GroupNum { get; set; } = null!; //public string GroupNum { get; set; } = null!;
[Display(Name ="订单号")]
public string PoBillNum { get; set; }
public PUB_NOT_SA_DETAIL(string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, string extend1, string extend2, string extend3, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string groupNum,string partcode)
public PUB_NOT_SA_DETAIL(string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, string extend1, string extend2, string extend3, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string groupNum,string partcode,string pobillnum)
{ {
KeyCode = keyCode; KeyCode = keyCode;
Version = version; Version = version;
@ -88,6 +91,7 @@ public class PUB_NOT_SA_DETAIL : SA_NOT_BASE
BusinessType = businessType; BusinessType = businessType;
GroupNum = groupNum; GroupNum = groupNum;
PartCode = partcode; PartCode = partcode;
PoBillNum = pobillnum;
} }
public PUB_NOT_SA_DETAIL() public PUB_NOT_SA_DETAIL()

Loading…
Cancel
Save