学 赵 1 year ago
parent
commit
8bd6aa56b9
  1. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs
  2. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/form/form-input.js
  3. 37
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  4. 68
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js
  5. 7
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js
  6. 44
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js
  7. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_map_group.js
  8. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_ba_detail_service.js
  9. 130
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_ba_service.js
  10. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_can_sa_detail_service.js
  11. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_can_sa_service.js
  12. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_not_sa_service.js
  13. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_pd_detail_service.js
  14. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_pd_service.js
  15. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_ba_detail_service.js
  16. 130
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_ba_service.js
  17. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_can_sa_detail_service.js
  18. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_can_sa_service.js
  19. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_not_sa_service.js
  20. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_pd_detail_service.js
  21. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_pd_service.js
  22. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_ba_detail_service.js
  23. 31
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_ba_service.js
  24. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_can_sa_detail_service.js
  25. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_can_sa_service.js
  26. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_not_sa_service.js
  27. 34
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_pd_detail_service.js
  28. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_pd_service.js
  29. 172
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  30. 473
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/_check.js
  31. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/contrast/bj_second_pub_sa_detail_jobservice.js
  32. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_ba_detail_service.js
  33. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_ba_service.js
  34. 122
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/home.js
  35. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/settlement/in_pub_ba_detail_service.js
  36. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/settlement/in_pub_ba_service.js
  37. 115
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/inventory/log.js
  38. 315
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js
  39. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/bbac_sa_detail_jobservice.js
  40. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/first_bbac_sa_detail_jobservice.js
  41. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/second_bbac_sa_detail_jobservice.js
  42. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/third_bbac_sa_detail_jobservice.js
  43. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/settlement/bbac_ba_detail_service.js
  44. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/settlement/bbac_ba_service.js
  45. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/first_hbpo_sa_detail_jobservice.js
  46. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/hbpo_sa_detail_jobservice.js
  47. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/second_hbpo_sa_detail_jobservice.js
  48. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/settlement/hbpo_ba_detail_service.js
  49. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/settlement/hbpo_ba_service.js
  50. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-bbac/settlement/bbac_jit_pub_ba_detail_service.js
  51. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-bbac/settlement/bbac_jit_pub_ba_service.js
  52. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-hbpo/settlement/hbpo_jit_pub_ba_detail_service.js
  53. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-hbpo/settlement/hbpo_jit_pub_ba_service.js
  54. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/md-hbpo/settlement/hbpo_md_pub_ba_detail_service.js
  55. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/md-hbpo/settlement/hbpo_md_pub_ba_service.js
  56. 106
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
  57. 104
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs
  58. 158
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  59. 79
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_DETAIL_SERVICE.cs
  60. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  61. 79
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs
  62. 34
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  63. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
  64. 86
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  65. 36
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BBACSeSyncAppService.cs
  66. 117
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HBPOSeSyncAppService.cs
  67. 50
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs
  68. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs
  69. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
  70. 154
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  71. 152
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  72. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs
  73. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs
  74. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs

@ -29,6 +29,7 @@ public class Startup
options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[] { "image/svg+xml" }); options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[] { "image/svg+xml" });
}); });
services.AddScheduler(); services.AddScheduler();
services.AddSingleton<JisBBACSeEdiCompareAppService>();
services.AddSingleton<JisHBPOSeEdiCompareAppService>(); services.AddSingleton<JisHBPOSeEdiCompareAppService>();
services.AddSignalR(o => o.EnableDetailedErrors = true); services.AddSignalR(o => o.EnableDetailedErrors = true);
JobHostdService.AddService(services); JobHostdService.AddService(services);
@ -57,7 +58,8 @@ public class Startup
app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub")); app.UseEndpoints(endpoints => endpoints.MapHub<PageHub>("/api/hub"));
app.ApplicationServices.UseScheduler(scheduler => app.ApplicationServices.UseScheduler(scheduler =>
{ {
scheduler.Schedule<JisHBPOSeEdiCompareAppService>().EverySeconds(10); scheduler.Schedule<JisBBACSeEdiCompareAppService>().EverySeconds(10);
//scheduler.Schedule<JisHBPOSeEdiCompareAppService>().EverySeconds(10);
}); });
var contentTypeProvider = new FileExtensionContentTypeProvider(); var contentTypeProvider = new FileExtensionContentTypeProvider();
contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); contentTypeProvider.Mappings.Add(".mjs", "text/javascript");

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

@ -31,7 +31,11 @@ export default {
</el-select> </el-select>
</template> </template>
<template v-else-if="getInput(schema)==='month'||getInput(schema)==='datetime'"> <template v-else-if="getInput(schema)==='month'||getInput(schema)==='datetime'">
<el-date-picker v-model="model[prop]" :type="schema.input" :value-format="schema.format" /> <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 :disabled="getDisabled()" :placeholder="schema.title" v-model="model[prop]" type="number" /> <el-input :disabled="getDisabled()" :placeholder="schema.title" v-model="model[prop]" type="number" />

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

@ -583,6 +583,38 @@ export default {
} }
} }
await load(); await load();
} else if (item.path === "check") {
const urls = new Map();
urls.set("JisBBAC", "settleaccount/bbac_ba_service/generate-invoice");
urls.set("JisHBPO", "settleaccount/hbpo_ba_service/generate-invoice");
urls.set("ZhiGongJianBBAC", "settleaccount/pub_ba_service/generate-invoice");
urls.set("ZhiGongJianHBPO", "settleaccount/pub_ba_service/generate-invoice");
urls.set("MaiDanJianHBPO", "settleaccount/pub_ba_service/generate-invoice");
urls.set("BeiJian", "settleaccount/pub_ba_service/generate-invoice");
urls.set("YinDuJian", "settleaccount/pub_ba_service/generate-invoice");
try {
await ElMessageBox.confirm(format("确认审核通过选中的%s行数据吗?", rows.length), "提示", {
type: "warning",
});
const response = await request(
urls.get(config.query.schema.properties.businessType?.default),
rows.map((o) => o.id),
{ method: "POST" }
);
if (!response.errors) {
ElMessage({
type: "info",
message: "操作完毕",
});
}
} catch (error) {
if (error === "cancel") {
ElMessage({
type: "info",
message: "操作取消",
});
}
}
} else if (item.path === "export") { } else if (item.path === "export") {
//export //export
if (item.meta.pattern === "paged") { if (item.meta.pattern === "paged") {
@ -593,6 +625,8 @@ export default {
if (!response.errors) { if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`)); window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
} }
} else if (item.meta.pattern === "file") {
window.open(getUrl(`settleaccount/getblobfile/download/${rows[0]["downFileName"]}`));
} else { } else {
console.log(item); console.log(item);
} }
@ -675,6 +709,9 @@ export default {
if (config.query.schema.properties.businessType?.default) { if (config.query.schema.properties.businessType?.default) {
formData.append("businessType", config.query.schema.properties.businessType.default); formData.append("businessType", config.query.schema.properties.businessType.default);
} }
if (!router.currentRoute.value.path.startsWith("/base-data")) {
formData.append("version", queryModel.value.version);
}
Object.keys(importModel.value).forEach((propertyName) => { Object.keys(importModel.value).forEach((propertyName) => {
if (importModel.value[propertyName]) { if (importModel.value[propertyName]) {
const schema = config.import.schema.properties[propertyName]; const schema = config.import.schema.properties[propertyName];

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

@ -1,30 +1,41 @@
import html from "html"; import html from "html";
import { reactive, ref } from "vue";
export default { export default {
template: html`<div class="app-table el-table"> template: html`<div class="app-table el-table" ref="tableRef">
<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">{{item.title}}</div> <div class="cell" style="text-align:center;" v-if="item.input==='selection'">
<input
class="el-checkbox__input"
type="checkbox"
v-model="checkAll"
:indeterminate="checkAllIndeterminate"
@click="checkAllClick($event)"
/>
</div>
<div class="cell" v-else-if="!item.hidden">{{item.title}}</div>
</div> </div>
</div> </div>
<div v-for="row in data" class="row"> <div v-for="(row,index) in data" class="row">
<template v-for="(val,key) in row"> <div class="cell el-table__cell" v-for="item in columns">
<div class="cell el-table__cell" v-if="columns.find(o=>o.dataKey===key)"> <div class="cell" style="text-align:center;" v-if="item.input==='selection'">
<div class="cell">{{val}}</div> <input class="el-checkbox__input row" type="checkbox" :value="index" @click="checkClick" />
</div> </div>
</template> <div class="cell" v-else-if="!item.hidden">{{row[item.dataKey]}}</div>
</div>
</div> </div>
</div>`, </div>`,
styles: html`<style> styles: html`<style>
.app-table { .app-table {
display: table; display: table;
content-visibility: visible; content-visibility: visible;
border-top: var(--el-table-border);
border-left: var(--el-table-border);
} }
.app-table .row { .app-table .row {
display: table-row; display: table-row;
background-color: var(--el-table-tr-bg-color); background-color: var(--el-table-tr-bg-color);
border-top: var(--el-table-border);
border-left: var(--el-table-border);
} }
.app-table .cell.el-table__cell { .app-table .cell.el-table__cell {
display: table-cell; display: table-cell;
@ -34,6 +45,41 @@ export default {
} }
</style>`, </style>`,
props: ["modelValue", "columns", "data"], props: ["modelValue", "columns", "data"],
emit: ["update:modelValue"], setup(props) {
setup(props, context) {}, const model = reactive(props.data);
const tableRef = ref(null);
const getSelection = () => {
return Array.from(tableRef.value.querySelectorAll("input.row:checked")).map((o) => parseInt(o.value));
};
const clearSelection = () => {
Array.from(tableRef.value.querySelectorAll("input:checked")).forEach((o) => (o.checked = false));
};
const checkAll = ref(false);
const checkAllIndeterminate = ref(false);
const checkAllClick = (e) => {
checkAll.value = !checkAll.value;
if (checkAll.value) {
Array.from(tableRef.value.querySelectorAll("input.row:not(:checked)")).forEach((o) => (o.checked = true));
} else {
Array.from(tableRef.value.querySelectorAll("input.row:checked")).forEach((o) => (o.checked = false));
}
const checkdCount = Array.from(tableRef.value.querySelectorAll("input.row:checked")).length;
checkAllIndeterminate.value = checkdCount > 0 && checkdCount < props.data.length;
};
const checkClick = () => {
const checkdCount = Array.from(tableRef.value.querySelectorAll("input.row:checked")).length;
checkAllIndeterminate.value = checkdCount > 0 && checkdCount < props.data.length;
checkAll.value = checkdCount == props.data.length;
};
return {
model,
tableRef,
checkAll,
checkClick,
checkAllIndeterminate,
checkAllClick,
getSelection,
clearSelection,
};
},
}; };

7
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/adjust.js

@ -40,11 +40,6 @@ const schema = {
title: "数量", title: "数量",
type: "number", type: "number",
input: "number", input: "number",
rules: [
{
required: true,
},
],
}, },
billTime: { billTime: {
title: "发运日期", title: "发运日期",
@ -130,7 +125,7 @@ const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = "settleaccount/vmi/edit-balance"; const createUrl = "settleaccount/vmi/edit-balance";
const updateUrl = `${baseUrl}/update/%s`; const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`; const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/code-setting-upload-excel-import`; const importUrl = `${baseUrl}/import`;
const exportUrl = `${baseUrl}/export`; const exportUrl = `${baseUrl}/export`;
const queryMethod = "POST"; const queryMethod = "POST";
const detailsMethod = "POST"; const detailsMethod = "POST";

44
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/log.js

@ -3,6 +3,11 @@ import { billType, codeType, subBillType } from "./inventory.js";
//变动单据号、发生时间、生产码类型、、订单号、库位、变动数、EDI顺序号、备注、变动类型(In、Out标识)、发货类型(JIS\JIT\买单件\备件等)、 //变动单据号、发生时间、生产码类型、、订单号、库位、变动数、EDI顺序号、备注、变动类型(In、Out标识)、发货类型(JIS\JIT\买单件\备件等)、
//实扣LU零件号、实扣客户零件号、结算LU零件号、结算客户零件号、实扣生产码、结算生产码 //实扣LU零件号、实扣客户零件号、结算LU零件号、结算客户零件号、实扣生产码、结算生产码
//库位、开始结束时间段、发货类型、生产码、生产码类型、LU零件号、订单号 //库位、开始结束时间段、发货类型、生产码、生产码类型、LU零件号、订单号
const options = [
{ value: null, label: "" },
{ value: true, label: "是" },
{ value: false, label: "否" },
];
const schema = { const schema = {
title: "库存事务日志", title: "库存事务日志",
type: "object", type: "object",
@ -88,6 +93,8 @@ const schema = {
isReplenished: { isReplenished: {
title: "是否补货", title: "是否补货",
type: "boolean", type: "boolean",
input: "select",
options,
}, },
configcode: { configcode: {
title: "配置码", title: "配置码",
@ -102,8 +109,8 @@ const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`; const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`; const updateUrl = `${baseUrl}/update/%s`;
const deleteUrl = `${baseUrl}/delete-list`; const deleteUrl = `${baseUrl}/delete-list`;
const importUrl = `${baseUrl}/code-setting-upload-excel-import`; const importUrl = `${baseUrl}/log-import`;
const exportUrl = `${baseUrl}/export`; const exportUrl = `${baseUrl}/log-export`;
const queryMethod = "POST"; const queryMethod = "POST";
const detailsMethod = "POST"; const detailsMethod = "POST";
const createMethod = "POST"; const createMethod = "POST";
@ -154,59 +161,54 @@ export default function () {
}, },
{ {
logic: "and", logic: "and",
column: "billTime", column: "billType",
action: "BiggerThanOrEqual", action: "equal",
value: null, value: null,
readOnly: true, readOnly: true,
}, },
{ {
logic: "and", logic: "and",
column: "billTime", column: "vinCode",
action: "SmallThanOrEqual", action: "like",
value: null, value: null,
readOnly: true, readOnly: true,
}, },
{ {
logic: "and", logic: "and",
column: "isReplenished", column: "codeType",
action: "equal",
value: true,
readOnly: true,
},
{
logic: "and",
column: "billType",
action: "equal", action: "equal",
value: null, value: null,
readOnly: true, readOnly: true,
}, },
{ {
logic: "and", logic: "and",
column: "vinCode", column: "partCode",
action: "like", action: "like",
value: null, value: null,
readOnly: true, readOnly: true,
}, },
{ {
logic: "and", logic: "and",
column: "codeType", column: "orderNum",
action: "equal", action: "like",
value: null, value: null,
readOnly: true, readOnly: true,
}, },
{ {
logic: "and", logic: "and",
column: "partCode", column: "billTime",
action: "like", action: "biggerThanOrEqual",
value: null, value: null,
readOnly: true, readOnly: true,
hidden: true,
}, },
{ {
logic: "and", logic: "and",
column: "orderNum", column: "billTime",
action: "like", action: "smallThanOrEqual",
value: null, value: null,
readOnly: true, readOnly: true,
hidden: true,
}, },
], ],
}, },

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_map_group.js

@ -1,5 +1,6 @@
import version from "../version.js"; import version from "../version.js";
import { state2 as state, state3 } from "../state.js"; import { state2, state3 } from "../state.js";
import invoiceState from "../invoiceState.js";
const schema = { const schema = {
title: "通用代码", title: "通用代码",
@ -16,23 +17,16 @@ const schema = {
type: "string", type: "string",
link: true, link: true,
}, },
// settleGroupNum: {
// title: "结算分组号",
// type: "string",
// },
amt: { amt: {
title: "金额", title: "金额",
type: "decimal", type: "decimal",
}, },
state, state: state2,
invoiceState,
taxAmt: { taxAmt: {
title: "税额", title: "税额",
type: "decimal", type: "decimal",
}, },
Extend2: {
title: "扩展字段2",
type: "string",
},
}, },
}; };
const queryUrl = "settleaccount/invoice_service/main-query"; const queryUrl = "settleaccount/invoice_service/main-query";

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_ba_detail_service.js

@ -106,6 +106,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

130
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_ba_service.js

@ -1,130 +0,0 @@
import version from "../../version.js";
import { state2 as state, state3 } from "../../state.js";
import businessType from "../../businessType.js";
import invoiceState from "../../invoiceState.js";
const schema = {
title: "商务审批",
type: "object",
properties: {
version,
realnvBillNum: {
title: "金税发票号",
type: "string",
},
invbillNum: {
title: "系统发票号",
type: "string",
},
amt: {
title: "未税金额",
type: "number",
},
taxAmt: {
title: "税后金额",
type: "number",
},
invGroupNum: {
title: "发票分组号",
type: "number",
},
businessType,
state,
invoiceState,
taxDiff: {
title: "发票税后尾差",
type: "number",
},
clientCode: {
title: "客户代码",
type: "string",
},
},
};
const queryUrl = "settleaccount/bbac_ba_service/main-query";
const exportUrl = "settleaccount/bbac_ba_service/export";
const invoiceUrl = "settleaccount/bbac_ba_service/generate-invoice";
const receivedUrl = "settleaccount/bbac_ba_service/received";
const rejectUrl = "settleaccount/bbac_ba_service/reject";
const reissueUrl = "settleaccount/bbac_ba_service/reissue-invoice";
const queryMethod = "POST";
const exportMethod = "POST";
const invoiceMethod = "POST";
const receivedMethod = "POST";
const rejectMethod = "POST";
const reissueMethod = "POST";
export default function () {
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,
},
},
},
},
table: {
schema: schema,
},
edit: {
exportUrl,
invoiceUrl,
receivedUrl,
rejectUrl,
reissueUrl,
exportMethod,
invoiceMethod,
receivedMethod,
rejectMethod,
reissueMethod,
schema: schema,
},
};
}

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_can_sa_detail_service.js

@ -108,6 +108,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_can_sa_service.js

@ -81,6 +81,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_not_sa_service.js

@ -108,6 +108,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_pd_detail_service.js

@ -82,6 +82,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-bbac/settlement/bbac_pd_service.js

@ -87,6 +87,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

5
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_ba_detail_service.js

@ -56,7 +56,6 @@ const queryUrl = `${baseUrl}/detail-query`;
const queryMethod = "POST"; const queryMethod = "POST";
export default function () { export default function () {
return { return {
query: { query: {
@ -109,6 +108,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

130
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_ba_service.js

@ -1,130 +0,0 @@
import version from "../../version.js";
import { state2 as state, state3 } from "../../state.js";
import businessType from "../../businessType.js";
import invoiceState from "../../invoiceState.js";
const schema = {
title: "不可结算单",
type: "object",
properties: {
version,
realnvBillNum: {
title: "金税发票号",
type: "string",
},
invbillNum: {
title: "系统发票号",
type: "string",
},
amt: {
title: "未税金额",
type: "number",
},
taxAmt: {
title: "税后金额",
type: "number",
},
invGroupNum: {
title: "发票分组号",
type: "number",
},
businessType,
state,
invoiceState,
taxDiff: {
title: "发票税后尾差",
type: "number",
},
clientCode: {
title: "客户代码",
type: "string",
},
},
};
const queryUrl = "settleaccount/hbpo_ba_service/main-query";
const exportUrl = "settleaccount/hbpo_ba_service/export";
const invoiceUrl = "settleaccount/hbpo_ba_service/generate-invoice";
const receivedUrl = "settleaccount/hbpo_ba_service/received";
const rejectUrl = "settleaccount/hbpo_ba_service/reject";
const reissueUrl = "settleaccount/hbpo_ba_service/reissue-invoice";
const queryMethod = "POST";
const exportMethod = "POST";
const invoiceMethod = "POST";
const receivedMethod = "POST";
const rejectMethod = "POST";
const reissueMethod = "POST";
export default function () {
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,
},
},
},
},
table: {
schema: schema,
},
edit: {
exportUrl,
invoiceUrl,
receivedUrl,
rejectUrl,
reissueUrl,
exportMethod,
invoiceMethod,
receivedMethod,
rejectMethod,
reissueMethod,
schema: schema,
},
};
}

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_can_sa_detail_service.js

@ -109,6 +109,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_can_sa_service.js

@ -25,11 +25,11 @@ const schema = {
const baseUrl = "settleaccount/hbpo_can_sa_service"; const baseUrl = "settleaccount/hbpo_can_sa_service";
const queryUrl = `${baseUrl}/main-query`; const queryUrl = `${baseUrl}/main-query`;
const exportUrl = `${baseUrl}/export`; const exportUrl = `${baseUrl}/export`;
const invoiceUrl="settleaccount/hbpo_can_sa_service/generate-invoice"; const invoiceUrl = "settleaccount/hbpo_can_sa_service/generate-invoice";
const queryMethod = "POST"; const queryMethod = "POST";
const exportMethod = "POST"; const exportMethod = "POST";
const invoiceMethod="POST"; const invoiceMethod = "POST";
export default function () { export default function () {
return { return {
@ -83,6 +83,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_not_sa_service.js

@ -108,6 +108,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_pd_detail_service.js

@ -82,6 +82,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/jis-hbpo/settlement/hbpo_pd_service.js

@ -87,6 +87,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_ba_detail_service.js

@ -125,6 +125,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

31
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_ba_service.js

@ -4,7 +4,7 @@ import businessType from "./businessType.js";
import invoiceState from "./invoiceState.js"; import invoiceState from "./invoiceState.js";
const schema = { const schema = {
title: "不可结算单", title: "商务审批",
type: "object", type: "object",
properties: { properties: {
version, version,
@ -15,6 +15,7 @@ const schema = {
invbillNum: { invbillNum: {
title: "系统发票号", title: "系统发票号",
type: "string", type: "string",
link: true,
}, },
amt: { amt: {
title: "未税金额", title: "未税金额",
@ -27,6 +28,7 @@ const schema = {
invGroupNum: { invGroupNum: {
title: "发票分组号", title: "发票分组号",
type: "number", type: "number",
link: true,
}, },
businessType, businessType,
state, state,
@ -41,16 +43,19 @@ const schema = {
}, },
}, },
}; };
const queryUrl = "settleaccount/pub_ba_service/main-query";
const exportUrl = "settleaccount/pub_ba_service/export"; const queryUrl = "settleaccount/bbac_ba_service/main-query";
const invoiceUrl = "settleaccount/pub_ba_service/generate-invoice"; const exportUrl = "settleaccount/bbac_ba_service/export";
const rejectUrl = "settleaccount/pub_ba_service/reject"; const invoiceUrl = "settleaccount/bbac_ba_service/generate-invoice";
const receivedUrl = "settleaccount/pub_ba_service/received"; const receivedUrl = "settleaccount/bbac_ba_service/received";
const rejectUrl = "settleaccount/bbac_ba_service/reject";
const reissueUrl = "settleaccount/bbac_ba_service/reissue-invoice";
const queryMethod = "POST"; const queryMethod = "POST";
const exportMethod = "POST"; const exportMethod = "POST";
const invoiceMethod = "POST"; const invoiceMethod = "POST";
const rejectMethod = "POST";
const receivedMethod = "POST"; const receivedMethod = "POST";
const rejectMethod = "POST";
const reissueMethod = "POST";
export default function () { export default function () {
return { return {
@ -59,7 +64,7 @@ export default function () {
method: queryMethod, method: queryMethod,
hasFilter: true, hasFilter: true,
schema: { schema: {
title: "结算数据", title: "商务审批",
type: "object", type: "object",
properties: { properties: {
filters: { filters: {
@ -104,6 +109,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },
@ -113,12 +122,14 @@ export default function () {
edit: { edit: {
exportUrl, exportUrl,
invoiceUrl, invoiceUrl,
rejectUrl,
receivedUrl, receivedUrl,
rejectUrl,
reissueUrl,
exportMethod, exportMethod,
invoiceMethod, invoiceMethod,
rejectMethod,
receivedMethod, receivedMethod,
rejectMethod,
reissueMethod,
schema: schema, schema: schema,
}, },
}; };

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_can_sa_detail_service.js

@ -113,6 +113,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_can_sa_service.js

@ -85,6 +85,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_not_sa_service.js

@ -127,6 +127,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

34
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_pd_detail_service.js

@ -6,34 +6,32 @@ const schema = {
type: "object", type: "object",
properties: { properties: {
site: { site: {
title: "工厂地点", title: "工厂地点",
type: "string", type: "string",
}, },
version, version,
billNum: { billNum: {
title: "结算单号", title: "结算单号",
type: "string", type: "string",
}, },
qty: { qty: {
title: "结算单号", title: "结算单号",
type: "decimal", type: "decimal",
}, },
price: { price: {
title: "结算单号", title: "结算单号",
type: "decimal", type: "decimal",
}, },
invGroupNum: { invGroupNum: {
title: "结算单号", title: "结算单号",
type: "string", type: "string",
}, },
}, },
}; };
const queryUrl = "settleaccount/p-uB_PD_SERVICE/detail-query"; const queryUrl = "settleaccount/p-uB_PD_SERVICE/detail-query";
const queryMethod = "POST"; const queryMethod = "POST";
export default function () { export default function () {
return { return {
query: { query: {
@ -86,6 +84,10 @@ export default function () {
sorting: { sorting: {
hidden: true, hidden: true,
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}, },
}, },

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_pd_service.js

@ -27,6 +27,10 @@ const schema = {
title: "业务类型", title: "业务类型",
type: "EnumBusinessType", type: "EnumBusinessType",
}, },
businessType: {
hidden: true,
default: 0,
},
}, },
}; };

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

@ -209,7 +209,8 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
disabled: "o=>o.stateName!='Succeeded'",
}, },
}, },
], ],
@ -264,7 +265,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
}, },
}, },
], ],
@ -423,6 +424,22 @@ export default [
pattern: "paged", pattern: "paged",
}, },
}, },
{
path: "check",
meta: {
type: "button",
title: "审核通过",
icon: "file",
},
},
{
path: "reopen",
meta: {
type: "button",
title: "重开",
icon: "file",
},
},
], ],
}, },
{ {
@ -482,13 +499,12 @@ export default [
}, },
}, },
{ {
path: "passed ", path: "check",
meta: { meta: {
type: "button", type: "button",
title: "审核通过", title: "审核通过",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged",
}, },
}, },
], ],
@ -727,7 +743,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
}, },
}, },
], ],
@ -782,7 +798,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
}, },
}, },
], ],
@ -941,6 +957,23 @@ export default [
pattern: "paged", pattern: "paged",
}, },
}, },
{
path: "check",
meta: {
type: "button",
title: "审核通过",
icon: "file",
isTop: true,
},
},
{
path: "reopen",
meta: {
type: "button",
title: "重开",
icon: "file",
},
},
], ],
}, },
{ {
@ -1000,13 +1033,12 @@ export default [
}, },
}, },
{ {
path: "passed ", path: "check ",
meta: { meta: {
type: "button", type: "button",
title: "审核通过", title: "审核通过",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged",
}, },
}, },
], ],
@ -1224,7 +1256,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
}, },
}, },
], ],
@ -1393,6 +1425,23 @@ export default [
pattern: "paged", pattern: "paged",
}, },
}, },
{
path: "check",
meta: {
type: "button",
title: "审核通过",
icon: "file",
isTop: true,
},
},
{
path: "reopen",
meta: {
type: "button",
title: "重开",
icon: "file",
},
},
], ],
}, },
{ {
@ -1452,13 +1501,12 @@ export default [
}, },
}, },
{ {
path: "approvalPassed ", path: "check ",
meta: { meta: {
type: "button", type: "button",
title: "审核通过", title: "审核通过",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged",
}, },
}, },
], ],
@ -1668,7 +1716,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
}, },
}, },
], ],
@ -1837,6 +1885,23 @@ export default [
pattern: "paged", pattern: "paged",
}, },
}, },
{
path: "check",
meta: {
type: "button",
title: "审核通过",
icon: "file",
isTop: true,
},
},
{
path: "reopen",
meta: {
type: "button",
title: "重开",
icon: "file",
},
},
], ],
}, },
{ {
@ -1896,13 +1961,12 @@ export default [
}, },
}, },
{ {
path: "approvalPassed ", path: "check ",
meta: { meta: {
type: "button", type: "button",
title: "审核通过", title: "审核通过",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged",
}, },
}, },
], ],
@ -2132,7 +2196,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
}, },
}, },
], ],
@ -2332,7 +2396,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
}, },
}, },
], ],
@ -2501,6 +2565,23 @@ export default [
pattern: "paged", pattern: "paged",
}, },
}, },
{
path: "check",
meta: {
type: "button",
title: "审核通过",
icon: "file",
isTop: true,
},
},
{
path: "reopen",
meta: {
type: "button",
title: "重开",
icon: "file",
},
},
], ],
}, },
{ {
@ -2560,13 +2641,12 @@ export default [
}, },
}, },
{ {
path: "approvalPassed ", path: "check ",
meta: { meta: {
type: "button", type: "button",
title: "审核通过", title: "审核通过",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged",
}, },
}, },
], ],
@ -2779,7 +2859,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
}, },
}, },
], ],
@ -2918,6 +2998,23 @@ export default [
pattern: "paged", pattern: "paged",
}, },
}, },
{
path: "check",
meta: {
type: "button",
title: "审核通过",
icon: "file",
isTop: true,
},
},
{
path: "reopen",
meta: {
type: "button",
title: "重开",
icon: "file",
},
},
], ],
}, },
{ {
@ -2977,13 +3074,12 @@ export default [
}, },
}, },
{ {
path: "approvalPassed ", path: "check ",
meta: { meta: {
type: "button", type: "button",
title: "审核通过", title: "审核通过",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged",
}, },
}, },
], ],
@ -3193,7 +3289,7 @@ export default [
type: "button", type: "button",
title: "下载", title: "下载",
icon: "file", icon: "file",
pattern: "paged", pattern: "file",
}, },
}, },
], ],
@ -3332,6 +3428,23 @@ export default [
pattern: "paged", pattern: "paged",
}, },
}, },
{
path: "check",
meta: {
type: "button",
title: "审核通过",
icon: "file",
isTop: true,
},
},
{
path: "reopen",
meta: {
type: "button",
title: "重开",
icon: "file",
},
},
], ],
}, },
{ {
@ -3391,13 +3504,12 @@ export default [
}, },
}, },
{ {
path: "approvalPassed ", path: "check ",
meta: { meta: {
type: "button", type: "button",
title: "审核通过", title: "审核通过",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged",
}, },
}, },
], ],
@ -3471,13 +3583,12 @@ export default [
}, },
}, },
{ {
path: "passed ", path: "check ",
meta: { meta: {
type: "button", type: "button",
title: "审核通过", title: "审核通过",
icon: "file", icon: "file",
isTop: true, isTop: true,
pattern: "paged",
}, },
}, },
{ {
@ -3746,6 +3857,15 @@ export default [
isTop: true, isTop: true,
}, },
}, },
{
path: "import",
meta: {
type: "button",
title: "导入",
icon: "file",
isTop: true,
},
},
], ],
}, },
], ],

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

@ -0,0 +1,473 @@
import html from "html";
import { schemaToModel } from "html";
import { ref, defineModel, nextTick, onMounted, watch } from "vue";
import request from "../request/index.js";
import AppForm from "../components/form/index.js";
import AppTable from "../components/table/index.js";
export default {
components: { AppForm, AppTable },
template: html`<el-drawer
v-model="show"
destroy-on-close
size="50%"
class="page-drawer"
:close-on-click-modal="false"
>
<template #header> <span class="el-dialog__title"> 结算明细 </span> </template>
<el-row style="height:calc(100vh - 160px);" v-loading="loading">
<el-col>
<el-tabs>
<el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_MAP_GROUP.length">
<el-scrollbar>
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns2" />
</el-scrollbar>
</el-tab-pane>
<el-tab-pane label="发票明细" v-if="model.invoicE_WAIT_DETAIL.length">
<el-scrollbar>
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns1" />
</el-scrollbar>
</el-tab-pane>
<el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_NOT_SETTLE.length">
<el-scrollbar>
<app-table :data="model.invoicE_NOT_SETTLE" :columns="columns3" />
</el-scrollbar>
</el-tab-pane>
<el-tab-pane label="发票调整明细" v-if="model.adJ_DETAIL.length">
<el-scrollbar>
<app-table :data="model.adJ_DETAIL" :columns="columns4" />
</el-scrollbar>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="show=false"> 返回 </el-button>
<el-button
type="primary"
@click="showSetupDialog"
v-if="isBusiness&&data.invbillNum&&model.adJ_DETAIL.length===0"
>
重开发票
</el-button>
</span>
</template>
</el-drawer>
<el-dialog
class="re-open"
v-model="setupDialogVisable"
:close-on-click-modal="false"
align-center
destroy-on-close
style="width:50%;height:80%"
>
<template #header>发票重开</template>
<el-steps :active="setupRef" align-center style="height:60px;">
<el-step title="调整明细列表" />
<el-step title="发票明细对比" />
<el-step title="发票预览" />
</el-steps>
<div v-show="setupRef===1" style="height:100%;">
<el-row style="padding:14px 0;height:60px;">
<el-col>
<el-button type="primary" @click="showAddAdjDialog">新建</el-button>
<el-button type="primary" @click="showImportAdjDialog">导入</el-button>
<el-button type="primary" @click="deleteAdj">删除</el-button>
</el-col>
</el-row>
<el-scrollbar ref="scrollRef">
<el-row style="height:100%;">
<el-col style="height:calc(100% - 180px);">
<app-table ref="adjListRef" :data="adjList" :columns="columns5" />
</el-col>
</el-row>
</el-scrollbar>
</div>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="setupRef-=1" v-if="setupRef>1">上一步</el-button>
</span>
<span class="dialog-footer">
<el-button type="primary" @click="setupRef+=1" v-if="setupRef<3">下一步</el-button>
<el-button type="primary" @click="submitReOpen" v-if="setupRef===3">确定</el-button>
</span>
</template>
</el-dialog>
<el-dialog
v-model="addDialogVisible"
align-center
destroy-on-close
:close-on-click-modal="false"
style="width:380px;height:480px;"
>
<template #header>添加调整明细</template>
<el-scrollbar>
<el-row>
<el-col>
<app-form
ref="addAdjFormRef"
v-if="addDialogVisible&&adjModel"
:schema="adjSchema"
v-model="adjModel"
:hideButton="true"
:close-on-click-modal="false"
inline
/>
</el-col>
</el-row>
</el-scrollbar>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="addAdj">确定</el-button>
</span>
</template>
</el-dialog>
<el-dialog
style="width:380px;height:480px;"
align-center
destroy-on-close
:close-on-click-modal="false"
v-model="importDialogVisible"
>
<template #header>导入调整明细</template>
<el-scrollbar>
<el-row v-loading="loading">
<el-col>
<app-form
ref="importAdjFromRef"
v-if="importDialogVisible&&importAdjModel"
:schema="importAdjSchema"
v-model="importAdjModel"
:hideButton="true"
inline
/>
</el-col>
</el-row>
</el-scrollbar>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" :disabled="loading" @click="importAdj">确定</el-button>
</span>
</template>
</el-dialog>`,
styles: html` <style>
.page-drawer .el-tab-pane {
width: 100%;
height: calc(100vh - 160px);
}
.page-drawer .el-tabs__content,
.page-drawer .el-scrollbar {
width: 100%;
height: calc(100vh - 160px - 40px);
}
.re-open .el-dialog__footer {
display: flex;
justify-content: space-between;
}
.el-dialog__body {
height: calc(100% - 120px);
}
.re-open .el-scrollbar,
.re-open .el-scrollbar__view {
height: calc(100% - 120px);
}
</style>`,
props: ["modelValue", "data", "isBusiness"],
emit: ["update:modelValue"],
setup(props, context) {
const show = ref(props.modelValue);
watch(show, (value) => context.emit("update:modelValue", value));
const loading = ref(false);
const model = ref({
invoicE_WAIT_DETAIL: [],
invoicE_MAP_GROUP: [],
invoicE_NOT_SETTLE: [],
adJ_DETAIL: [],
});
//
const columns1 = [
{
dataKey: "version",
title: "期间",
},
{
dataKey: "invbillNum",
title: "发票号",
},
{
dataKey: "invGroupNum",
title: "发票分组号",
},
{
dataKey: "settleGroupNum",
title: "结算分组号",
},
{
dataKey: "amt",
title: "金额",
},
];
const columns2 = [
{
key: "version",
dataKey: "version",
title: "期间",
},
{
dataKey: "invbillNum",
title: "发票号",
},
{
dataKey: "invGroupNum",
title: "发票分组号",
},
{
dataKey: "lu",
title: "零件号",
},
{
dataKey: "price",
title: "单价",
},
{
dataKey: "qty",
title: "数量",
},
{
dataKey: "amt",
title: "金额",
},
{
dataKey: "bussiessType",
title: "业务分类",
},
];
const columns3 = [
{
dataKey: "version",
title: "期间",
},
{
dataKey: "invGroupNum",
title: "发票分组号",
},
{
dataKey: "settleGroupNum",
title: "结算分组号",
},
{
dataKey: "lu",
title: "可结算分组号",
},
{
dataKey: "lu1",
title: "不可结算分组号",
},
];
const columns4 = [
{
dataKey: "oldInvBillNum",
title: "作废发票号",
},
{
dataKey: "invBillNum",
title: "发票号",
},
{
dataKey: "settleDate",
title: "下线日期",
},
{
dataKey: "invGroupNum",
title: "发票分组号",
},
{
dataKey: "lu",
title: "零件号",
},
{
dataKey: "pn",
title: "标识号",
},
{
dataKey: "qty",
title: "数量",
},
{
dataKey: "groupNum",
title: "结算分组",
},
];
const columns5 = columns4.filter((o) => o.dataKey !== "oldInvBillNum" && o.dataKey !== "invGroupNum");
columns5.unshift({
input: "selection",
});
//显示重开发票对话框
const setupDialogVisable = ref(false);
const setupRef = ref(1);
const adjList = ref([]);
const scrollRef = ref(null);
const adjListRef = ref(null);
const addDialogVisible = ref(false);
const importDialogVisible = ref(false);
const showSetupDialog = () => {
adjList.value = [];
setupRef.value = 1;
setupDialogVisable.value = true;
};
const deleteAdj = () => {
const list = adjListRef.value.getSelection();
if (list.length > 0) {
for (let i = 0; i < list.length; i++) {
adjList.value.splice(list[i] - i, 1);
}
nextTick(() => {
adjListRef.value.clearSelection();
scrollRef.value.update();
});
}
};
const adjSchema = {
type: "object",
properties: {
invBillNum: {
type: "string",
title: "发票号",
rules: [{ required: true }],
},
settleDate: {
type: "string",
title: "下线日期",
input: "datetime",
rules: [{ required: true }],
},
lu: {
type: "string",
title: "零件号",
rules: [{ required: true }],
},
pn: {
type: "string",
title: "标识号",
rules: [{ required: true }],
},
qty: {
type: "string",
title: "数量",
input: "number",
rules: [{ required: true }],
},
groupNum: {
type: "string",
title: "结算分组",
rules: [{ required: true }],
},
},
};
const defaultAdjModel = schemaToModel(adjSchema);
const adjModel = ref(Object.assign({}, defaultAdjModel));
const addAdjFormRef = ref(null);
const showAddAdjDialog = () => {
adjModel.value = Object.assign({}, defaultAdjModel);
addDialogVisible.value = true;
};
const addAdj = async () => {
try {
const valid = await addAdjFormRef.value.validate();
if (valid) {
adjList.value.unshift(adjModel.value);
addDialogVisible.value = false;
}
} catch (error) {
console.log(error);
}
};
const importAdjFromRef = ref(null);
const importAdjSchema = {
type: "object",
properties: {
files: {
title: "文件",
type: "array",
multiple: true,
input: "file",
accept: ".xlsx",
default: [],
limit: 1,
size: 100 * 1024 * 1024,
rules: [
{
required: true,
trigger: "change",
},
],
},
},
};
const defaultImportAdjModel = schemaToModel(importAdjSchema);
const importAdjModel = ref(defaultImportAdjModel);
const showImportAdjDialog = async () => {
importAdjModel.value = Object.assign({}, defaultImportAdjModel);
importDialogVisible.value = true;
};
const importAdj = async () => {
try {
const valid = await importAdjFromRef.value.validate();
if (valid) {
loading.value = true;
const url = "settleaccount/vmi/excel-to-json";
const formData = new FormData();
formData.append("files", importAdjModel.value.files[0].raw);
const result = await request(url, formData);
if (!result.errors) {
adjList.value = result.data;
importDialogVisible.value = false;
}
}
} catch (error) {
console.log(error);
} finally {
loading.value = false;
}
};
const submitReOpen = async () => {};
//
onMounted(async () => {
loading.value = true;
const response = await request("settleaccount/invoice_service/detail-query", props.data, { method: "POST" });
model.value = response.data;
loading.value = false;
});
return {
show,
loading,
model,
columns1,
columns2,
columns3,
columns4,
columns4,
columns5,
showSetupDialog,
setupRef,
setupDialogVisable,
adjList,
adjListRef,
deleteAdj,
showAddAdjDialog,
addDialogVisible,
addAdj,
addAdjFormRef,
importAdjFromRef,
adjSchema,
adjModel,
showImportAdjDialog,
importDialogVisible,
importAdjModel,
importAdjSchema,
importAdj,
scrollRef,
};
},
};

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/contrast/bj_second_pub_sa_detail_jobservice.js

@ -1,16 +0,0 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/job-service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算二次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_ba_detail_service.js

@ -10,6 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = "BeiJian";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/bj/settlement/bj_pub_ba_service.js

@ -1,15 +1,23 @@
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 useConfig from "../../../models/pub_ba_service.js"; import useConfig from "../../../models/pub_ba_service.js";
import AppCheck from "../../_check.js";
export default { export default {
components: { AppList }, components: { AppList, AppCheck },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
const visable = ref(false);
const data = ref(null);
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; config.query.schema.properties.businessType.default = "BeiJian";
return { config, onCommand, visable, data };
}, },
}; };

122
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/home.js

@ -1,5 +1,125 @@
import html from "html"; import html from "html";
export default { export default {
template: html`<a href="../assets/导入模版.zip" target="blank">导入模板下载</a>`, template: html`<a href="../assets/导入模版.zip" target="blank">导入模板下载</a>
<br />
<el-tree v-if="0" default-expand-all :data="list" :props="props" @node-click="handleNodeClick" /> `,
setup() {
const page = "page";
const createRoute = (path, title, type = "group") => {
return {
path,
title,
meta: {
title,
type,
},
};
};
const createGroup = (input = 1, compare = 1, settle = 1) => {
const result = [];
if (input) {
result.push({
...createRoute("input", "数据输入"),
children: [
{ ...createRoute("jie-suan", "结算数据", page) },
{ ...createRoute("fa-yun", "发运数据", page) },
{ ...createRoute("edi", "EDI数据", page) },
],
});
}
if (compare) {
result.push({
...createRoute("compare", "数据比对"),
children: [
{ ...createRoute("fa-yun", "EDI与发运数据", page) },
{ ...createRoute("jie-suan", "EDI、发运与计算数据比对", page) },
],
});
}
if (settle) {
result.push({
...createRoute("settle", "结算开票"),
children: [
{ ...createRoute("ke-jie-suan", "可结算单", page) },
{ ...createRoute("bu-ke-jie-suan", "不可结算单", page) },
{ ...createRoute("shang-wu", "商务审批", page) },
{ ...createRoute("ku-cun", "寄售库库存扣减审批", page) },
],
});
}
return result;
};
const list = [
{
...createRoute("bbac", "BBAC"),
children: [
{
...createRoute("jis", "JIS"),
children: createGroup(),
},
{
...createRoute("zhi-gong", "直供件"),
children: createGroup(),
},
{
...createRoute("yin-du", "印度件"),
children: createGroup(),
},
{
...createRoute("bei-jian", "备件"),
children: createGroup(),
},
{
...createRoute("mai-dan", "买单件"),
children: createGroup(1, 1, 0),
},
],
},
{
...createRoute("hbpo", "HBPO"),
children: [
{
...createRoute("jis", "JIS"),
children: createGroup(),
},
{
...createRoute("zhi-gong", "直供件"),
children: createGroup(),
},
// {
// ...createRoute("yin-du", "印度件"),
// children: createGroup(0, 0, 0),
// },
// {
// ...createRoute("bei-jian", "备件"),
// children: createGroup(0, 0, 0),
// },
{
...createRoute("mai-dan", "买单件"),
children: createGroup(),
},
],
},
];
const props = {
label: (data) => {
return data.meta?.title;
},
};
const handleNodeClick = (a, b, c, d) => {
console.log(a);
console.log(b);
console.log(c);
console.log(d);
if (a.meta?.type === "page") {
console.log(a.path);
}
};
return {
list,
props,
handleNodeClick,
};
},
}; };

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/settlement/in_pub_ba_detail_service.js

@ -10,6 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = "YinDuJian";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/in/settlement/in_pub_ba_service.js

@ -1,15 +1,23 @@
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 useConfig from "../../../models/pub_ba_service.js"; import useConfig from "../../../models/pub_ba_service.js";
import AppCheck from "../../_check.js";
export default { export default {
components: { AppList }, components: { AppList, AppCheck },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
const visable = ref(false);
const data = ref(null);
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; config.query.schema.properties.businessType.default = "YinDuJian";
return { config, onCommand, visable, data };
}, },
}; };

115
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/inventory/log.js

@ -2,51 +2,92 @@ import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/inventory/log.js"; import useConfig from "../../../models/inventory/log.js";
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import request from "../../request/index.js";
import { schemaToModel } from "../../utils/index.js"; import { schemaToModel } from "../../utils/index.js";
import AppForm from "../../../components/form/index.js";
import AppTable from "../../components/table/index.js";
import request, { get, getUrl, post } from "../../request/index.js";
export default { export default {
components: { AppList }, components: { AppList, AppTable, AppForm },
template: html`<app-list :config="config" @command="onCommand" /> template: html`
<el-dialog v-model="dialog" width="45%" title="补货数据导出"> <app-list :config="config" @command="onCommand" />
<el-form :model="exportModel" style="height:100%;"> <el-dialog v-model="addDialogVisible" align-center destroy-on-close style="width:380px;height:480px;">
<el-form-item label="" label-width="100px"> <template #header>补货数据导出</template>
开始时间<el-date-picker v-model="exportModel.startDatetime" value-format="YYYY-MM-DD" /> <el-scrollbar>
<span style="margin:0 .5em;">-</span> <el-row>
结束时间<el-date-picker v-model="exportModel.endDatetime" value-format="YYYY-MM-DD" /> <el-col>
</el-form-item> <app-form
<el-button type="primary" @click="openDialog" style="margin-left: 10px;">确定</el-button> ref="addAdjFormRef"
</el-form> v-if="addDialogVisible && adjModel"
</el-dialog> `, :schema="adjSchema"
v-model="adjModel"
:hideButton="true"
inline
@submit="submitAdj"
/>
</el-col>
</el-row>
</el-scrollbar>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="submitAdj">确定</el-button>
</span>
</template>
</el-dialog>
`,
setup() { setup() {
const defaultExportModel = { const addDialogVisible = ref(false);
startDatetime: "", const addAdjFormRef = ref(null);
endDatetime: "", const submitAdj = async () => {
}; try {
const exportModel = ref(defaultExportModel); const url = "settleaccount/vmi/replenished-export";
const config = useConfig(); const method = "POST";
const dialog = ref(false); const response = await request(url, null, { method });
const prop = ref(""); if (!response.errors) {
const queryModel = ref(schemaToModel(config.query.schema)); window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
function buildQuery() { }
const postData = JSON.parse(JSON.stringify(queryModel.value)); } catch (error) {
return postData; console.log(error);
}
const openDialog = async () => {
// const url =
// const method =
// const postData = buildQuery();
const response = await request(url, postData, { method });
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
} }
dialog.value = false;
}; };
const adjSchema = {
type: "object",
properties: {
startBillTime: {
type: "string",
title: "发运开始日期",
input: "datetime",
rules: [{ required: true }],
},
endBillTime: {
type: "string",
title: "发运结束日期",
input: "datetime",
rules: [{ required: true }],
},
},
};
const defaultAdjModel = schemaToModel(adjSchema);
const addAdj = () => {
adjModel.value = Object.assign({}, defaultAdjModel);
addDialogVisible.value = true;
};
const adjModel = ref(defaultAdjModel);
const config = useConfig();
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
prop.value = item.path; addDialogVisible.value = true;
dialog.value = true;
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand, dialog, prop, exportModel, openDialog }; return {
config,
onCommand,
submitAdj,
addDialogVisible,
adjSchema,
addAdjFormRef,
defaultAdjModel,
adjModel,
addAdj,
};
}, },
}; };

315
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js

@ -1,316 +1,23 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import AppForm from "../../../components/form/index.js";
import html from "html"; import html from "html";
import { reactive, ref } from "vue"; import { ref } from "vue";
import useConfig from "../../../models/invoice/invoice_map_group.js"; import useConfig from "../../../models/invoice/invoice_map_group.js";
import request from "../../../request/index.js"; import AppCheck from "../_check.js";
import AppTable from "../../components/table/index.js";
import { ElMessageBox } from "element-plus";
import { post } from "../../../request/index.js";
export default { export default {
components: { AppList, AppTable }, components: { AppList, AppForm, AppCheck },
template: html`<app-list :config="config" @command="onCommand" /> template: html`<app-list :config="config" @command="onCommand" />
<el-drawer v-model="drawer" destroy-on-close size="50%" class="page-drawer"> <app-check v-if="visable" v-model="visable" :data="data" />`,
<template #header> <span class="el-dialog__title"> 结算明细 </span> </template>
<el-row style="height:calc(100vh - 160px);" v-loading="loading">
<el-col>
<el-tabs>
<el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_WAIT_DETAIL.length">
<el-scrollbar>
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns1" />
</el-scrollbar>
</el-tab-pane>
<el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_MAP_GROUP.length">
<el-scrollbar>
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns2" />
</el-scrollbar>
</el-tab-pane>
<el-tab-pane label="invoicE_NOT_SETTLE" v-if="model.invoicE_NOT_SETTLE.length">
<el-scrollbar>
<app-table :data="model.invoicE_NOT_SETTLE" :columns="columns3" />
</el-scrollbar>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="drawer=false"> 返回 </el-button>
<el-button
type="primary"
@click="dialogVisible = true"
v-if="model.adJ_DETAIL.length===0&&prop==='invbillNum'"
>
重开
</el-button>
<el-dialog v-model="dialogVisible" title="发票调整明细" width="50%" :before-close="handleClose">
<template #title>
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>发票调整明细</span>
<span>
<el-button type="primary" @click="innerVisible = true" style="margin-left: auto;">新建</el-button>
<el-button type="primary" @click="openImport = true" style="margin-left: 10px;">导入 </el-button>
<el-button type="primary" @click="deleteRow" style="margin-left: 10px;">删除</el-button>
<el-button type="primary" @click="dialogVisible = false" style="margin-left: 10px;">关闭</el-button>
</span>
</div>
</template>
<el-table :data="invoiceValue" @selection-change="handleSelectionChange">
<el-table-column width="50" type="selection">
<!-- <el-checkbox v-model="selectedRows" /> -->
</el-table-column>
<el-table-column property="oldInvBillNum" label="作废发票号" />
<el-table-column property="invBillNum" label="发票号" />
<el-table-column property="settleDate" label="下线日期" />
<el-table-column property="invGroupNum" label="发票分组号" />
<el-table-column property="lu" label="零件号" />
<el-table-column property="pn" label="标识号" />
<el-table-column property="qty" label="数量" />
<el-table-column property="groupNum" label="结算分组" />
</el-table>
<el-dialog v-model="innerVisible" width="45%" title="新建数据">
<el-form :inline="true" :model="formInline" label-width="100px">
<span>
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button type="primary" @click="">下一页</el-button>
</span>
<el-form-item label="作废发票号">
<el-input v-model="formInline.oldInvBillNum"></el-input>
</el-form-item>
<el-form-item label="发票号">
<el-input v-model.number="formInline.invBillNum " type="string"></el-input>
</el-form-item>
<el-form-item label="下线日期">
<el-input v-model.number="formInline.settleDate " type="string"></el-input>
</el-form-item>
<el-form-item label="发票分组号">
<el-input v-model.number="formInline.invGroupNum " type="string"></el-input>
</el-form-item>
<el-form-item label="零件号">
<el-input v-model.number="formInline.lu" type="string"></el-input>
</el-form-item>
<el-form-item label="标识号">
<el-input v-model.number="formInline.pn" type="string"></el-input>
</el-form-item>
<el-form-item label="数量">
<el-input v-model.number="formInline.qty" type="number"></el-input>
</el-form-item>
<el-form-item label="结算分组">
<el-input v-model.number="formInline.groupNum " type="string"></el-input>
</el-form-item>
</el-form>
</el-dialog>
<el-dialog v-model="openImport" width="30%">
<app-form>
<div>
<el-form-item :label="$t('文件')" label-width="80px">
<el-upload
ref="uploadRef"
class="upload"
drag
accept=".xlsx"
:auto-upload="false"
:on-change="handleChange"
>
<el-icon class="el-icon--upload"><ep-upload-filled /></el-icon>
</el-upload>
</el-form-item>
</div>
<el-button type="primary" @click="openImportHandler" style="margin-left: 10px;">确定</el-button>
</app-form>
</el-dialog>
<el-button type="primary" @click="dialogVisible = false" style="margin-left: 10px;">下一页</el-button>
</el-dialog>
</span>
</template>
</el-drawer>`,
styles: html` <style>
.page-drawer .el-tab-pane {
width: 100%;
height: calc(100vh - 160px);
}
.page-drawer .el-tabs__content,
.page-drawer .el-scrollbar {
width: 100%;
height: calc(100vh - 160px - 40px);
}
</style>`,
setup() { setup() {
const fileList = ref([]);
// const load = async () => {};
// const editFormModel = ref(null);
// const editFormMode = ref(null);
// const defaultImportModel = config.import?.schema ? schemaToModel(config.import.schema) : {};
// const importModel = ref(defaultImportModel);
const openImportHandler = async () => {
const url = "settleaccount/vmi/excel-to-json";
const method = "POST";
const formData = new FormData();
if (config.query.schema.properties.businessType?.default) {
formData.append("businessType", config.query.schema.properties.businessType.default);
}
for (let i = 0; i < fileList.value.length; i++) {
formData.append(`files`, fileList.value[i].raw);
}
await post(url, formData, method);
};
const formInline = reactive({
oldInvBillNum: "",
invBillNum: "",
settleDate: "",
invGroupNum: "",
lu: "",
pn: "",
qty: null,
groupNum: "",
});
//create
const invoiceValue = ref([]);
const submitForm = () => {
const newFormInline = { ...formInline };
invoiceValue.value.push(newFormInline);
Object.keys(formInline).forEach((key) => {
delete formInline[key];
});
innerVisible.value = false;
};
//delete
const selectedRows = ref([]);
const deleteRow = async () => {
const indexes = selectedRows.value.map((row) => invoiceValue.value.indexOf(row));
indexes.forEach((index) => {
invoiceValue.value.splice(index, 10000000000);
});
selectedRows.value = [];
};
const innerVisible = ref(false);
const openImport = ref(false);
const dialogVisible = ref(false);
const handleClose = (done) => {
ElMessageBox.confirm("确认关闭")
.then(() => {
done();
})
.catch(() => {});
};
const config = useConfig(); const config = useConfig();
const drawer = ref(false); const visable = ref(false);
const loading = ref(false); const data = ref(null);
const model = ref({
invoicE_WAIT_DETAIL: [],
invoicE_MAP_GROUP: [],
invoicE_NOT_SETTLE: [],
adJ_DETAIL: [],
});
const prop = ref("");
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
prop.value = item.path; data.value = { [item.path]: rows[0][item.path] };
drawer.value = true; visable.value = true;
loading.value = true; console.log(item.path, item, rows);
const data = { [item.path]: rows[0][item.path] };
const response = await request("settleaccount/invoice_service/detail-query", data, { method: "POST" });
model.value = response.data;
loading.value = false;
};
const columns1 = [
{
key: "version",
dataKey: "version",
title: "期间",
},
{
dataKey: "invbillNum",
title: "发票号",
},
{
dataKey: "invGroupNum",
title: "发票分组号",
},
{
dataKey: "lu",
title: "零件号",
},
{
dataKey: "price",
title: "单价",
},
{
dataKey: "qty",
title: "数量",
},
{
dataKey: "amt",
title: "金额",
},
{
dataKey: "bussiessType",
title: "业务分类",
},
];
const columns2 = [
{
dataKey: "version",
title: "期间",
},
{
dataKey: "invbillNum",
title: "发票号",
},
{
dataKey: "invGroupNum",
title: "发票分组号",
},
{
dataKey: "settleGroupNum",
title: "结算分组号",
},
{
dataKey: "amt",
title: "金额",
},
];
const columns3 = [
{
dataKey: "version",
title: "期间",
},
{
dataKey: "invGroupNum",
title: "发票分组号",
},
{
dataKey: "settleGroupNum",
title: "结算分组号",
},
{
dataKey: "lu",
title: "可结算分组号",
},
{
dataKey: "lu1",
title: "不可结算分组号",
},
];
return {
config,
onCommand,
drawer,
loading,
model,
columns1,
columns2,
columns3,
innerVisible,
dialogVisible,
handleClose,
prop,
formInline,
submitForm,
invoiceValue,
deleteRow,
selectedRows,
openImport,
openImportHandler,
}; };
return { config, onCommand, visable, data };
}, },
}; };

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/bbac_sa_detail_jobservice.js

@ -1,16 +1,22 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/bbac-edi-se-compare.js"; import useConfig from "../../../models/bbac-edi-se-compare.js";
import { ref, onMounted, onUnmounted } from "vue";
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 config = useConfig(); const config = useConfig();
config.query.schema.title = "EDI与发运数据"; config.query.schema.title = "EDI与发运数据";
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; //
const appListRef = ref(null);
const event = "SaSeCompare";
onMounted(() => PubSub.subscribe(event, async () => await appListRef.value.load()));
onUnmounted(() => PubSub.unsubscribe(event));
return { config, onCommand, appListRef };
}, },
}; };

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/first_bbac_sa_detail_jobservice.js

@ -1,16 +1,22 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/job-service.js"; import useConfig from "../../../models/job-service.js";
import { ref, onMounted, onUnmounted } from "vue";
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 config = useConfig(); const config = useConfig();
config.query.schema.title = "EDI、发运与结算"; config.query.schema.title = "EDI、发运与结算";
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; //
const appListRef = ref(null);
const event = "SaSeCompare";
onMounted(() => PubSub.subscribe(event, async () => await appListRef.value.load()));
onUnmounted(() => PubSub.unsubscribe(event));
return { config, onCommand, appListRef };
}, },
}; };

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/second_bbac_sa_detail_jobservice.js

@ -1,16 +0,0 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/job-service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算数据二次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/contrast/third_bbac_sa_detail_jobservice.js

@ -1,16 +0,0 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/job-service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "买单件发运与结算数据三次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/settlement/bbac_ba_detail_service.js

@ -10,6 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = "JisBBAC";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-bbac/settlement/bbac_ba_service.js

@ -1,15 +1,23 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/jis-bbac/settlement/bbac_ba_service.js"; import { ref } from "vue";
import useConfig from "../../../models/pub_ba_service.js";
import AppCheck from "../../_check.js";
export default { export default {
components: { AppList }, components: { AppList, AppCheck },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
const visable = ref(false);
const data = ref(null);
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; config.query.schema.properties.businessType.default = "JisBBAC";
return { config, onCommand, visable, data };
}, },
}; };

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/first_hbpo_sa_detail_jobservice.js

@ -1,16 +1,22 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/job-service.js"; import useConfig from "../../../models/job-service.js";
import { ref, onMounted, onUnmounted } from "vue";
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 config = useConfig(); const config = useConfig();
config.query.schema.title = "EDI、发运与结算"; config.query.schema.title = "EDI、发运与结算";
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; //
const appListRef = ref(null);
const event = "SaSeCompare";
onMounted(() => PubSub.subscribe(event, async () => await appListRef.value.load()));
onUnmounted(() => PubSub.unsubscribe(event));
return { config, onCommand, appListRef };
}, },
}; };

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/hbpo_sa_detail_jobservice.js

@ -1,16 +1,22 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/hbpo-edi-se-compare.js"; import useConfig from "../../../models/hbpo-edi-se-compare.js";
import { ref, onMounted, onUnmounted } from "vue";
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 config = useConfig(); const config = useConfig();
config.query.schema.title = "EDI与发运数据"; config.query.schema.title = "EDI与发运数据";
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; //
const appListRef = ref(null);
const event = "SaSeCompare";
onMounted(() => PubSub.subscribe(event, async () => await appListRef.value.load()));
onUnmounted(() => PubSub.unsubscribe(event));
return { config, onCommand, appListRef };
}, },
}; };

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/contrast/second_hbpo_sa_detail_jobservice.js

@ -1,16 +0,0 @@
import AppList from "../../../components/list/index.js";
import html from "html";
import useConfig from "../../../models/job-service.js";
export default {
components: { AppList },
template: html`<app-list :config="config" @command="onCommand" />`,
setup() {
const config = useConfig();
config.query.schema.title = "发运与结算数据二次";
const onCommand = async (item, rows) => {
console.log(item.path, item, rows);
};
return { config, onCommand };
},
};

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/settlement/hbpo_ba_detail_service.js

@ -10,6 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = "JisHBPO";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jis-hbpo/settlement/hbpo_ba_service.js

@ -1,15 +1,23 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import useConfig from "../../../models/jis-hbpo/settlement/hbpo_ba_service.js"; import { ref } from "vue";
import useConfig from "../../../models/pub_ba_service.js";
import AppCheck from "../../_check.js";
export default { export default {
components: { AppList }, components: { AppList, AppCheck },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
const visable = ref(false);
const data = ref(null);
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; config.query.schema.properties.businessType.default = "JisHBPO";
return { config, onCommand, visable, data };
}, },
}; };

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-bbac/settlement/bbac_jit_pub_ba_detail_service.js

@ -10,6 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = "ZhiGongJianBBAC";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-bbac/settlement/bbac_jit_pub_ba_service.js

@ -1,15 +1,23 @@
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 useConfig from "../../../../models/pub_ba_service.js"; import useConfig from "../../../../models/pub_ba_service.js";
import AppCheck from "../../../_check.js";
export default { export default {
components: { AppList }, components: { AppList, AppCheck },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
const visable = ref(false);
const data = ref(null);
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; config.query.schema.properties.businessType.default = "ZhiGongJianBBAC";
return { config, onCommand, visable, data };
}, },
}; };

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-hbpo/settlement/hbpo_jit_pub_ba_detail_service.js

@ -10,6 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = "ZhiGongJianHBPO";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/jit/jit-hbpo/settlement/hbpo_jit_pub_ba_service.js

@ -1,15 +1,23 @@
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 useConfig from "../../../../models/pub_ba_service.js"; import useConfig from "../../../../models/pub_ba_service.js";
import AppCheck from "../../../_check.js";
export default { export default {
components: { AppList }, components: { AppList, AppCheck },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
const visable = ref(false);
const data = ref(null);
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; config.query.schema.properties.businessType.default = "ZhiGongJianHBPO";
return { config, onCommand, visable, data };
}, },
}; };

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/md-hbpo/settlement/hbpo_md_pub_ba_detail_service.js

@ -10,6 +10,7 @@ export default {
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
config.query.schema.properties.businessType.default = "MaiDanJianHBPO";
return { config, onCommand }; return { config, onCommand };
}, },
}; };

14
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/md/md-hbpo/settlement/hbpo_md_pub_ba_service.js

@ -1,15 +1,23 @@
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 useConfig from "../../../../models/pub_ba_service.js"; import useConfig from "../../../../models/pub_ba_service.js";
import AppCheck from "../../../_check.js";
export default { export default {
components: { AppList }, components: { AppList, AppCheck },
template: html`<app-list :config="config" @command="onCommand" />`, template: html`<app-list :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`,
setup() { setup() {
const config = useConfig(); const config = useConfig();
const visable = ref(false);
const data = ref(null);
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand }; config.query.schema.properties.businessType.default = "MaiDanJianHBPO";
return { config, onCommand, visable, data };
}, },
}; };

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

@ -53,6 +53,49 @@ public class BBAC_SA_DTO : EntityDto<Guid>
public EnumBusinessType BusinessType { get; set; } public EnumBusinessType BusinessType { get; set; }
} }
/// <summary>
/// BBAC结算明细
/// </summary>
public class BBAC_SA_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
/// 结算单
/// </summary>
public string BillNum { set; get; }
/// <summary>
/// 期间
/// </summary>
public int Version { set; get; }
/// <summary>
/// 结算分组号
/// </summary>
public string GroupNum { get; set; }
/// <summary>
/// 生产号
/// </summary>
public string PN { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
public string LU { get; set; }
/// <summary>
/// 数量
/// </summary>
public string Qty { get; set; }
/// <summary>
/// 结算日期
/// </summary>
public DateTime SettleDate { set; get; }
/// <summary>
/// 单价
/// </summary>
public decimal Price { set; get; }
/// <summary>
/// 厂内物料号
/// </summary>
public string PartCode { get; set; }
}
/// <summary> /// <summary>
/// BBAC结算明细导入 /// BBAC结算明细导入
/// </summary> /// </summary>
@ -79,7 +122,7 @@ public class BBAC_SA_DETAIL_IMPORT_DTO
[Display(Name = "Material")] [Display(Name = "Material")]
[Required(ErrorMessage = "{0}不能为空")] [Required(ErrorMessage = "{0}不能为空")]
[ImporterHeader(Name = "Material")] [ImporterHeader(Name = "Material")]
public string PartCode { get; set; } public string LU { get; set; }
/// <summary> /// <summary>
/// 数量 /// 数量
@ -96,3 +139,64 @@ public class BBAC_SA_DETAIL_IMPORT_DTO
[ImporterHeader(Name = "External Call Number")] [ImporterHeader(Name = "External Call Number")]
public string PN { get; set; } public string PN { get; set; }
} }
/// <summary>
/// 结算明细导出请求
/// </summary>
public class BBAC_SA_DETAIL_EXPORT_REQUEST_DTO
{
/// <summary>
/// 结算单号
/// </summary>
[Display(Name = "结算单号")]
[Required(ErrorMessage = "{0}不能为空")]
public string BillNum { set; get; }
}
/// <summary>
/// 结算明细导出
/// </summary>
public class BBAC_SA_DETAIL_EXPORT_DTO
{
/// <summary>
/// 结算单号
/// </summary>
[Display(Name = "结算单号")]
[ExporterHeader(DisplayName = "结算单号")]
public string BillNum { set; get; }
/// <summary>
/// 结算日期
/// </summary>
[Display(Name = "结算日期")]
[ExporterHeader(DisplayName = "结算日期")]
public DateTime SettleDate { set; get; }
/// <summary>
/// 发货单号
/// </summary>
[Display(Name = "发货单号")]
[ExporterHeader(DisplayName = "发货单号")]
public string PN { get; set; }
/// <summary>
/// 零件号
/// </summary>
[Display(Name = "零件号")]
[ExporterHeader(DisplayName = "零件号")]
public string LU { get; set; }
/// <summary>
/// 数量
/// </summary>
[Display(Name = "数量")]
[ExporterHeader(DisplayName = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 结算分组
/// </summary>
[Display(Name = "结算分组")]
[ExporterHeader(DisplayName = "结算分组")]
public string GroupNum { get; set; }
}

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

@ -53,6 +53,49 @@ public class HBPO_SA_DTO : EntityDto<Guid>
public EnumBusinessType BusinessType { get; set; } public EnumBusinessType BusinessType { get; set; }
} }
/// <summary>
/// HBPO结算明细
/// </summary>
public class HBPO_SA_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
/// 结算单
/// </summary>
public string BillNum { set; get; }
/// <summary>
/// 期间
/// </summary>
public int Version { set; get; }
/// <summary>
/// 结算分组号
/// </summary>
public string GroupNum { get; set; }
/// <summary>
/// 生产号
/// </summary>
public string PN { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
public string LU { get; set; }
/// <summary>
/// 数量
/// </summary>
public string Qty { get; set; }
/// <summary>
/// 结算日期
/// </summary>
public DateTime SettleDate { set; get; }
/// <summary>
/// 单价
/// </summary>
public decimal Price { set; get; }
/// <summary>
/// 厂内物料号
/// </summary>
public string PartCode { get; set; }
}
/// <summary> /// <summary>
/// HBPO结算明细导入 /// HBPO结算明细导入
/// </summary> /// </summary>
@ -112,3 +155,64 @@ public class HBPO_SA_DETAIL_IMPORT_DTO
[ImporterHeader(Name = "productionNumber")] [ImporterHeader(Name = "productionNumber")]
public string PN { get; set; } public string PN { get; set; }
} }
/// <summary>
/// 结算明细导出请求
/// </summary>
public class HBPO_SA_DETAIL_EXPORT_REQUEST_DTO
{
/// <summary>
/// 结算单号
/// </summary>
[Display(Name = "结算单号")]
[Required(ErrorMessage = "{0}不能为空")]
public string BillNum { set; get; }
}
/// <summary>
/// 结算明细导出
/// </summary>
public class HBPO_SA_DETAIL_EXPORT_DTO
{
/// <summary>
/// 结算单号
/// </summary>
[Display(Name = "结算单号")]
[ExporterHeader(DisplayName = "结算单号")]
public string BillNum { set; get; }
/// <summary>
/// 结算日期
/// </summary>
[Display(Name = "结算日期")]
[ExporterHeader(DisplayName = "结算日期")]
public DateTime SettleDate { set; get; }
/// <summary>
/// 发货单号
/// </summary>
[Display(Name = "发货单号")]
[ExporterHeader(DisplayName = "发货单号")]
public string PN { get; set; }
/// <summary>
/// 零件号
/// </summary>
[Display(Name = "零件号")]
[ExporterHeader(DisplayName = "零件号")]
public string LU { get; set; }
/// <summary>
/// 数量
/// </summary>
[Display(Name = "数量")]
[ExporterHeader(DisplayName = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 结算分组
/// </summary>
[Display(Name = "结算分组")]
[ExporterHeader(DisplayName = "结算分组")]
public string GroupNum { get; set; }
}

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

@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Http;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities.Auditing;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{ {
@ -198,13 +199,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// <summary> /// <summary>
/// 备件导入 /// 备件导入
/// </summary> /// </summary>
public class BeiJianImportDto public class BeiJianImportDto : BeiJianExtraImportDto
{ {
/// <summary> /// <summary>
/// 结算日期 /// 结算日期
/// </summary> /// </summary>
[Display(Name = "结算日期")] [Display(Name = "结算日期")]
[ImporterHeader(IsIgnore = true)] [ImporterHeader(Name = "开票日期")]
public DateTime SettleDate { set; get; } public DateTime SettleDate { set; get; }
/// <summary> /// <summary>
@ -237,6 +238,116 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[ImporterHeader(Name = "凭证号")] [ImporterHeader(Name = "凭证号")]
[Required(ErrorMessage = "{0}不能为空")] [Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; } public string GroupNum { get; set; }
///// <summary>
///// 备件扩展
///// </summary>
//[Display(Name = "备件扩展")]
//public BeiJianExtraImportDto beiJianExtraImportDto { get; set; }
}
/// <summary>
/// 备件扩展
/// </summary>
public class BeiJianExtraImportDto
{
/// <summary>
/// 交货号
/// </summary>
[Display(Name = "交货号")]
[ImporterHeader(Name = "交货号")]
public string DeliveryNumber { set; get; }
/// <summary>
/// 发票号
/// </summary>
[Display(Name = "发票号")]
[ImporterHeader(Name = "发票号")]
public string InvoiceNumber { set; get; }
/// <summary>
/// 供应商代码
/// </summary>
[Display(Name = "供应商代码")]
[ImporterHeader(Name = "供应商代码")]
public string VendorCode { set; get; }
/// <summary>
/// 供应商名称
/// </summary>
[Display(Name = "供应商名称")]
[ImporterHeader(Name = "供应商名称")]
public string VendorName { set; get; }
/// <summary>
/// 采购订单号
/// </summary>
[Display(Name = "采购订单号")]
[ImporterHeader(Name = "采购订单号")]
public string PurchaseOrderNumber { set; get; }
/// <summary>
/// 交付索引号
/// </summary>
[Display(Name = "交付索引号")]
[ImporterHeader(Name = "交付索引号")]
public string DeliveryIndexNumber { set; get; }
/// <summary>
/// 零件名称
/// </summary>
[Display(Name = "零件名称")]
[ImporterHeader(Name = "零件名称")]
public string PartName { set; get; }
/// <summary>
/// 价格
/// </summary>
[Display(Name = "价格")]
[ImporterHeader(Name = "价格")]
public decimal Price { set; get; }
/// <summary>
/// 金额
/// </summary>
[Display(Name = "金额")]
[ImporterHeader(Name = "金额")]
public decimal Amount { set; get; }
/// <summary>
/// 税额
/// </summary>
[Display(Name = "税额")]
[ImporterHeader(Name = "税额")]
public decimal Tallage { set; get; }
/// <summary>
/// 价税合计
/// </summary>
[Display(Name = "价税合计")]
[ImporterHeader(Name = "价税合计")]
public decimal Total { set; get; }
/// <summary>
/// 协议编号
/// </summary>
[Display(Name = "协议编号")]
[ImporterHeader(Name = "协议编号")]
public string ProtocolNumber { set; get; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "备注")]
[ImporterHeader(Name = "备注")]
public string Remark { set; get; }
/// <summary>
/// 商品组
/// </summary>
[Display(Name = "商品组")]
[ImporterHeader(Name = "商品组")]
public string CommodityGroup { set; get; }
} }
/// <summary> /// <summary>
@ -283,6 +394,49 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public string GroupNum { get; set; } public string GroupNum { get; set; }
} }
/// <summary>
/// PUB结算明细
/// </summary>
public class PUB_SA_DETAIL_DTO : AuditedAggregateRoot<Guid>
{
/// <summary>
/// 结算单
/// </summary>
public string BillNum { set; get; }
/// <summary>
/// 期间
/// </summary>
public int Version { set; get; }
/// <summary>
/// 结算分组号
/// </summary>
public string GroupNum { get; set; }
/// <summary>
/// 生产号
/// </summary>
public string PN { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
public string LU { get; set; }
/// <summary>
/// 数量
/// </summary>
public string Qty { get; set; }
/// <summary>
/// 结算日期
/// </summary>
public DateTime SettleDate { set; get; }
/// <summary>
/// 单价
/// </summary>
public decimal Price { set; get; }
/// <summary>
/// 厂内物料号
/// </summary>
public string PartCode { get; set; }
}
/// <summary> /// <summary>
/// 结算明细导出请求 /// 结算明细导出请求
/// </summary> /// </summary>

79
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_DETAIL_SERVICE.cs

@ -1,7 +1,22 @@
using System; using System;
using System.Collections.Generic;
using System.LinqAsync;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Shouldly;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ; namespace Win.Sfs.SettleAccount.Entities.BQ;
@ -10,8 +25,70 @@ namespace Win.Sfs.SettleAccount.Entities.BQ;
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class BBAC_SA_DETAIL_SERVICE public class BBAC_SA_DETAIL_SERVICE : SettleAccountApplicationBase<BBAC_SA_DETAIL>
{ {
/// <summary>
/// BBAC结算明细仓储
/// </summary>
private readonly INormalEfCoreRepository<BBAC_SA_DETAIL, Guid> _bbacSaDetailRepository;
/// <summary>
/// 任务服务
/// </summary>
private readonly TaskJobService _taskJobService;
/// <summary>
/// 构造
/// </summary>
public BBAC_SA_DETAIL_SERVICE(INormalEfCoreRepository<BBAC_SA_DETAIL, Guid> bbacSaDetailRepository,
TaskJobService taskJobService,
IDistributedCache<BBAC_SA_DETAIL> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_bbacSaDetailRepository = bbacSaDetailRepository;
_taskJobService = taskJobService;
}
#region 导出
/// <summary>
/// 导出
/// </summary>
[HttpPost]
public async Task<string> ExportAsync(BBAC_SA_DETAIL_EXPORT_REQUEST_DTO input)
{
string fileName = $"JisBBAC的结算数据_{Guid.NewGuid()}.xlsx";
List<FilterCondition> filters = new List<FilterCondition>();
filters.Add(new FilterCondition("BillNum", input.BillNum, EnumFilterAction.Equal, EnumFilterLogic.And));
var entities = await _bbacSaDetailRepository.GetListByFilterAsync(filters).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<BBAC_SA_DETAIL>, List<BBAC_SA_DETAIL_EXPORT_DTO>>(entities);
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false);
result.ShouldNotBeNull();
await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false);
return fileName;
}
#endregion
#region CURD
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
public async Task<PagedResultDto<BBAC_SA_DETAIL_DTO>> GetListAsync(RequestDto input)
{
var entities = await _bbacSaDetailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _bbacSaDetailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<BBAC_SA_DETAIL>, List<BBAC_SA_DETAIL_DTO>>(entities);
return new PagedResultDto<BBAC_SA_DETAIL_DTO>(totalCount, dtos);
}
#endregion
#region 对比 #region 对比
/// <summary> /// <summary>
/// BBAC结算与发运比对 /// BBAC结算与发运比对

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

@ -312,13 +312,13 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
bbacSaDetails.ForEach(bbacSaDetail => bbacSaDetails.ForEach(bbacSaDetail =>
{ {
List<string> partCodes = bbacSaDetail.PartCode.Split(" ").ToList(); List<string> lus = bbacSaDetail.LU.Split(" ").ToList();
bbacSaDetail.PartCode = partCodes[0].Replace(" ", ""); bbacSaDetail.LU = lus[0].Replace(" ", "");
if (partCodes.Count > 1) if (lus.Count > 1)
{ {
partCodes.RemoveAt(0); lus.RemoveAt(0);
var partCodeAssemble = partCodes.Select(t => t.Replace(" ", "")); var luAssemble = lus.Select(t => t.Replace(" ", ""));
bbacSaDetail.PartCode += partCodeAssemble.Aggregate(" ", (current, index) => current + index); bbacSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
} }
bbacSaDetail.BillNum = bbacSaBillNum; bbacSaDetail.BillNum = bbacSaBillNum;
@ -351,8 +351,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships); var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships);
bbacSaDetails.ForEach(bbacSaDetail => bbacSaDetails.ForEach(bbacSaDetail =>
{ {
bbacSaDetail.LU = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == bbacSaDetail.PartCode)?.ErpMaterialCode ?? bbacSaDetail.PartCode.Replace(" ", "-"); bbacSaDetail.PartCode = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == bbacSaDetail.LU)?.ErpMaterialCode ?? bbacSaDetail.LU.Replace(" ", "-");
bbacSaDetail.KeyCode = bbacSaDetail.PN + bbacSaDetail.LU;
}); });
#endregion #endregion

79
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs

@ -1,7 +1,22 @@
using System; using System;
using System.Collections.Generic;
using System.LinqAsync;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Shouldly;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ; namespace Win.Sfs.SettleAccount.Entities.BQ;
@ -10,8 +25,70 @@ namespace Win.Sfs.SettleAccount.Entities.BQ;
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class HBPO_SA_DETAIL_SERVICE public class HBPO_SA_DETAIL_SERVICE : SettleAccountApplicationBase<HBPO_SA_DETAIL>
{ {
/// <summary>
/// HBPO结算明细仓储
/// </summary>
private readonly INormalEfCoreRepository<HBPO_SA_DETAIL, Guid> _hbpoSaDetailRepository;
/// <summary>
/// 任务服务
/// </summary>
private readonly TaskJobService _taskJobService;
/// <summary>
/// 构造
/// </summary>
public HBPO_SA_DETAIL_SERVICE(INormalEfCoreRepository<HBPO_SA_DETAIL, Guid> hbpoSaDetailRepository,
TaskJobService taskJobService,
IDistributedCache<HBPO_SA_DETAIL> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_hbpoSaDetailRepository = hbpoSaDetailRepository;
_taskJobService = taskJobService;
}
#region 导出
/// <summary>
/// 导出
/// </summary>
[HttpPost]
public async Task<string> ExportAsync(HBPO_SA_DETAIL_EXPORT_REQUEST_DTO input)
{
string fileName = $"JisHBPO的结算数据_{Guid.NewGuid()}.xlsx";
List<FilterCondition> filters = new List<FilterCondition>();
filters.Add(new FilterCondition("BillNum", input.BillNum, EnumFilterAction.Equal, EnumFilterLogic.And));
var entities = await _hbpoSaDetailRepository.GetListByFilterAsync(filters).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<HBPO_SA_DETAIL>, List<HBPO_SA_DETAIL_EXPORT_DTO>>(entities);
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false);
result.ShouldNotBeNull();
await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false);
return fileName;
}
#endregion
#region CURD
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
public async Task<PagedResultDto<HBPO_SA_DETAIL_DTO>> GetListAsync(RequestDto input)
{
var entities = await _hbpoSaDetailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _hbpoSaDetailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<HBPO_SA_DETAIL>, List<HBPO_SA_DETAIL_DTO>>(entities);
return new PagedResultDto<HBPO_SA_DETAIL_DTO>(totalCount, dtos);
}
#endregion
#region 对比 #region 对比
/// <summary> /// <summary>
/// HBPO结算与发运比对 /// HBPO结算与发运比对

34
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -319,30 +319,31 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
#region 处理结算数据 #region 处理结算数据
//销售价格 //销售价格
var priceListEntitys = await _priceListRepository.GetAllAsync(); var priceListEntitys = await _priceListRepository.GetAllAsync().ConfigureAwait(false);
hbpoSaDetails.ForEach(hbpoSaDetail => hbpoSaDetails.ForEach(hbpoSaDetail =>
{ {
List<string> partCodes = hbpoSaDetail.PartCode.Split(" ").ToList(); List<string> lus = hbpoSaDetail.LU.Split(" ").ToList();
hbpoSaDetail.PartCode = partCodes[0].Replace(" ", ""); hbpoSaDetail.LU = lus[0].Replace(" ", "");
if (partCodes.Count > 1) if (lus.Count > 1)
{ {
partCodes.RemoveAt(0); lus.RemoveAt(0);
var partCodeAssemble = partCodes.Select(t => t.Replace(" ", "")); var luAssemble = lus.Select(t => t.Replace(" ", ""));
hbpoSaDetail.PartCode += partCodeAssemble.Aggregate(" ", (current, index) => current + index); hbpoSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
} }
hbpoSaDetail.BillNum = hbpoSaBillNum; hbpoSaDetail.BillNum = hbpoSaBillNum;
hbpoSaDetail.KeyCode = hbpoSaDetail.PN + hbpoSaDetail.LU;
//根据物料号、结算日期获取价格 //根据物料号、结算日期获取价格
var priceListEntity = priceListEntitys.Find(t => t.LU == hbpoSaDetail.PartCode && hbpoSaDetail.SettleDate > t.BeginTime && hbpoSaDetail.SettleDate < t.EndTime); var priceListEntity = priceListEntitys.Find(t => t.LU == hbpoSaDetail.LU && hbpoSaDetail.SettleDate > t.BeginTime && hbpoSaDetail.SettleDate < t.EndTime);
hbpoSaDetail.Price = priceListEntity?.Price ?? default; hbpoSaDetail.Price = priceListEntity?.Price ?? default;
hbpoSaDetail.BusinessType = _businessType; hbpoSaDetail.BusinessType = _businessType;
}); });
//导入的零件号集合 //导入的零件号集合
var importPubSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct(); var importPubSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)); 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();
/* /*
@ -361,8 +362,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships); var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships);
hbpoSaDetails.ForEach(hbpoSaDetail => hbpoSaDetails.ForEach(hbpoSaDetail =>
{ {
hbpoSaDetail.LU = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.PartCode)?.ErpMaterialCode ?? hbpoSaDetail.PartCode.Replace(" ", "-"); hbpoSaDetail.PartCode = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.LU)?.ErpMaterialCode ?? hbpoSaDetail.LU.Replace(" ", "-");
hbpoSaDetail.KeyCode = hbpoSaDetail.PN + hbpoSaDetail.LU;
}); });
#endregion #endregion
@ -378,8 +378,8 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
#endregion #endregion
#region 添加入库 #region 添加入库
await _hbpoSaRepository.InsertAsync(hbpoSa); await _hbpoSaRepository.InsertAsync(hbpoSa).ConfigureAwait(false);
await _hbpoSaDetailRepository.InsertManyAsync(hbpoSaDetails); await _hbpoSaDetailRepository.InsertManyAsync(hbpoSaDetails).ConfigureAwait(false);
if (hbpoCanSaDetails.Count > 0) if (hbpoCanSaDetails.Count > 0)
{ {
hbpoCanSa.InvGroupNum = hbpoCanSaDetails.Count.ToString(); hbpoCanSa.InvGroupNum = hbpoCanSaDetails.Count.ToString();
@ -389,8 +389,8 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
hbpoCanSaDetail.BusinessType = _businessType; hbpoCanSaDetail.BusinessType = _businessType;
}); });
await _hbpoCanSaRepository.InsertAsync(hbpoCanSa); await _hbpoCanSaRepository.InsertAsync(hbpoCanSa).ConfigureAwait(false);
await _hbpoCanSaDetailRepository.InsertManyAsync(hbpoCanSaDetails); await _hbpoCanSaDetailRepository.InsertManyAsync(hbpoCanSaDetails).ConfigureAwait(false);
} }
if (hbpoNotSaDetails.Count > 0) if (hbpoNotSaDetails.Count > 0)
{ {
@ -399,11 +399,11 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
hbpoNotSaDetail.BusinessType = _businessType; hbpoNotSaDetail.BusinessType = _businessType;
}); });
await _hbpoNotSaDetailRepository.InsertManyAsync(hbpoNotSaDetails); await _hbpoNotSaDetailRepository.InsertManyAsync(hbpoNotSaDetails).ConfigureAwait(false);
} }
if (materialRelationships.Count > 0) if (materialRelationships.Count > 0)
{ {
await _materialRelationshipRepository.InsertManyAsync(materialRelationships); await _materialRelationshipRepository.InsertManyAsync(materialRelationships).ConfigureAwait(false);
} }
#endregion #endregion
} }

15
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs

@ -11,6 +11,7 @@ using SettleAccount.Job.Services.Report;
using Shouldly; using Shouldly;
using TaskJob.EventArgs; using TaskJob.EventArgs;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Win.Abp.Snowflakes; using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
@ -99,6 +100,20 @@ public class PUB_SA_DETAIL_SERVICE : SettleAccountApplicationBase<PUB_SA_DETAIL>
} }
#endregion #endregion
#region CURD
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
public async Task<PagedResultDto<PUB_SA_DETAIL_DTO>> GetListAsync(RequestDto input)
{
var entities = await _pubSaDetailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _pubSaDetailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<PUB_SA_DETAIL>, List<PUB_SA_DETAIL_DTO>>(entities);
return new PagedResultDto<PUB_SA_DETAIL_DTO>(totalCount, dtos);
}
#endregion
#region 对比 #region 对比
/// <summary> /// <summary>
/// Pub结算与发运比对 /// Pub结算与发运比对

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

@ -125,21 +125,21 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
case EnumBusinessType.JisHBPO: case EnumBusinessType.JisHBPO:
break; break;
case EnumBusinessType.ZhiGongJianBBAC: case EnumBusinessType.ZhiGongJianBBAC:
result = await ImportZhiGongJianBBACAsync(pubSaImportRequestDto.Files); result = await ImportZhiGongJianBBACAsync(pubSaImportRequestDto.Files).ConfigureAwait(false);
break; break;
case EnumBusinessType.ZhiGongJianHBPO: case EnumBusinessType.ZhiGongJianHBPO:
result = await ImportZhiGongJianHBPOAsync(pubSaImportRequestDto.Files); result = await ImportZhiGongJianHBPOAsync(pubSaImportRequestDto.Files).ConfigureAwait(false);
break; break;
case EnumBusinessType.MaiDanJianBBAC: case EnumBusinessType.MaiDanJianBBAC:
break; break;
case EnumBusinessType.MaiDanJianHBPO: case EnumBusinessType.MaiDanJianHBPO:
result = await ImportMaiDanJianHBPOAsync(pubSaImportRequestDto.Files); result = await ImportMaiDanJianHBPOAsync(pubSaImportRequestDto.Files).ConfigureAwait(false);
break; break;
case EnumBusinessType.BeiJian: case EnumBusinessType.BeiJian:
result = await ImportBeiJianAsync(pubSaImportRequestDto.Files); result = await ImportBeiJianAsync(pubSaImportRequestDto.Files).ConfigureAwait(false);
break; break;
case EnumBusinessType.YinDuJian: case EnumBusinessType.YinDuJian:
result = await ImportYinDuJianAsync(pubSaImportRequestDto.Files); result = await ImportYinDuJianAsync(pubSaImportRequestDto.Files).ConfigureAwait(false);
break; break;
default: default:
break; break;
@ -285,20 +285,20 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
{ {
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var importResults = await _exportImporter.UploadExcelImport<ZhiGongJianBBACImportDto>(files, _excelImportService); var importResults = await _exportImporter.UploadExcelImport<ZhiGongJianBBACImportDto>(files, _excelImportService).ConfigureAwait(false);
var importPubSaDetails = ObjectMapper.Map<List<ZhiGongJianBBACImportDto>, List<PUB_SA_DETAIL>>(importResults); var importPubSaDetails = ObjectMapper.Map<List<ZhiGongJianBBACImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion #endregion
#region 数据校验 #region 数据校验
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
string fileName = await ExportErrorReportAsync(checkList); 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
return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.ZhiGongJianBBAC); return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.ZhiGongJianBBAC).ConfigureAwait(false);
} }
/// <summary> /// <summary>
@ -308,7 +308,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
{ {
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var importResults = await _exportImporter.UploadExcelImport<ZhiGongJianHBPOImportDto>(files, _excelImportService); var importResults = await _exportImporter.UploadExcelImport<ZhiGongJianHBPOImportDto>(files, _excelImportService).ConfigureAwait(false);
//截取结算分组前8位为结算日期 //截取结算分组前8位为结算日期
importResults.ForEach(importResult => importResults.ForEach(importResult =>
@ -328,7 +328,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
} }
#endregion #endregion
return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.ZhiGongJianHBPO); return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.ZhiGongJianHBPO).ConfigureAwait(false);
} }
/// <summary> /// <summary>
@ -338,7 +338,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
{ {
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var importResults = await _exportImporter.UploadExcelImport<MaiDanJianHBPOImportDto>(files, _excelImportService); var importResults = await _exportImporter.UploadExcelImport<MaiDanJianHBPOImportDto>(files, _excelImportService).ConfigureAwait(false);
importResults.ForEach(importResult => importResults.ForEach(importResult =>
{ {
@ -357,7 +357,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
} }
#endregion #endregion
return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.BeiJian); return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.BeiJian).ConfigureAwait(false);
} }
/// <summary> /// <summary>
@ -367,26 +367,20 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
{ {
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var importResults = await _exportImporter.UploadExcelImport<BeiJianImportDto>(files, _excelImportService); var importResults = await _exportImporter.UploadExcelImport<BeiJianImportDto>(files, _excelImportService).ConfigureAwait(false);
importResults.ForEach(importResult =>
{
importResult.SettleDate = DateTime.Now;
});
var importPubSaDetails = ObjectMapper.Map<List<BeiJianImportDto>, List<PUB_SA_DETAIL>>(importResults); var importPubSaDetails = ObjectMapper.Map<List<BeiJianImportDto>, List<PUB_SA_DETAIL>>(importResults);
#endregion #endregion
#region 数据校验 #region 数据校验
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
string fileName = await ExportErrorReportAsync(checkList); 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
return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.BeiJian); return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.BeiJian).ConfigureAwait(false);
} }
/// <summary> /// <summary>
@ -401,15 +395,15 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
#endregion #endregion
#region 数据校验 #region 数据校验
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false);
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
string fileName = await ExportErrorReportAsync(checkList); 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
return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.YinDuJian); return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.YinDuJian).ConfigureAwait(false);
} }
/// <summary> /// <summary>
@ -445,31 +439,32 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
#region 处理结算数据 #region 处理结算数据
//销售价格 //销售价格
var priceListEntitys = await _priceListRepository.GetAllAsync(); var priceListEntitys = await _priceListRepository.GetAllAsync().ConfigureAwait(false);
pubSaDetails.ForEach(importPubSaDetail => pubSaDetails.ForEach(importPubSaDetail =>
{ {
List<string> partCodes = importPubSaDetail.PartCode.Split(" ").ToList(); List<string> lus = importPubSaDetail.LU.Split(" ").ToList();
importPubSaDetail.PartCode = partCodes[0].Replace(" ", ""); importPubSaDetail.LU = lus[0].Replace(" ", "");
if (partCodes.Count > 1) if (lus.Count > 1)
{ {
partCodes.RemoveAt(0); lus.RemoveAt(0);
var luAssemble = partCodes.Select(t => t.Replace(" ", "")); var luAssemble = lus.Select(t => t.Replace(" ", ""));
importPubSaDetail.PartCode += luAssemble.Aggregate(" ", (current, index) => current + index); importPubSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
} }
importPubSaDetail.KeyCode = importPubSaDetail.PN + importPubSaDetail.LU;
importPubSaDetail.Version = _version; importPubSaDetail.Version = _version;
importPubSaDetail.BusinessType = businessType; importPubSaDetail.BusinessType = businessType;
importPubSaDetail.Site = "XX工厂"; importPubSaDetail.Site = "XX工厂";
//根据物料号、结算日期获取价格 //根据物料号、结算日期获取价格
var priceListEntity = priceListEntitys.Find(t => t.LU == importPubSaDetail.PartCode && importPubSaDetail.SettleDate > t.BeginTime && importPubSaDetail.SettleDate < t.EndTime); var priceListEntity = priceListEntitys.Find(t => t.LU == importPubSaDetail.LU && importPubSaDetail.SettleDate > t.BeginTime && importPubSaDetail.SettleDate < t.EndTime);
importPubSaDetail.Price = priceListEntity?.Price ?? 0; importPubSaDetail.Price = priceListEntity?.Price ?? 0;
}); });
//导入的零件号集合 //导入的零件号集合
var importPubSaPartCodes = pubSaDetails.Select(t => t.PartCode).Distinct(); var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaPartCodes.Contains(t.SettleMaterialCode)); 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();
/* /*
@ -477,7 +472,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
* *
* 6- * 6-
*/ */
var noExistSettleMaterialCodes = importPubSaPartCodes.Except(materialRelationshipEntitySettleMaterialCodes); var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes);
noExistSettleMaterialCodes.ForEach(t => noExistSettleMaterialCodes.ForEach(t =>
{ {
@ -488,16 +483,15 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships); var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships);
pubSaDetails.ForEach(pubSaDetail => pubSaDetails.ForEach(pubSaDetail =>
{ {
pubSaDetail.LU = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == pubSaDetail.PartCode)?.ErpMaterialCode ?? pubSaDetail.PartCode.Replace(" ", "-"); pubSaDetail.PartCode = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == pubSaDetail.LU)?.ErpMaterialCode ?? pubSaDetail.LU.Replace(" ", "-");
pubSaDetail.KeyCode = pubSaDetail.PN + pubSaDetail.LU;
}); });
#endregion #endregion
#region 添加入库 #region 添加入库
await SeDataEntryAsync(pubSaDetails); await SeDataEntryAsync(pubSaDetails).ConfigureAwait(false);
if (materialRelationships.Count > 0) if (materialRelationships.Count > 0)
{ {
await _materialRelationshipRepository.InsertManyAsync(materialRelationships); await _materialRelationshipRepository.InsertManyAsync(materialRelationships).ConfigureAwait(false);
} }
#endregion #endregion
@ -586,13 +580,13 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
//不可结算 //不可结算
List<PUB_NOT_SA_DETAIL> pubNotSaDetails = new List<PUB_NOT_SA_DETAIL>(); List<PUB_NOT_SA_DETAIL> pubNotSaDetails = new List<PUB_NOT_SA_DETAIL>();
var pubSaEntity = await _repository.FirstOrDefaultAsync(t => t.Id.Equals(id)); var pubSaEntity = await _repository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false);
if (pubSaEntity != null) if (pubSaEntity != null)
{ {
//结算单据 //结算单据
string pubSaBillNum = pubSaEntity.BillNum; string pubSaBillNum = pubSaEntity.BillNum;
pubCanSas = await _pubCanSaRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum); pubCanSas = await _pubCanSaRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum).ConfigureAwait(false);
//验证可结算主表状态 //验证可结算主表状态
if (pubCanSas.Any() && pubCanSas.Any(t => t.State != SettleBillState.)) if (pubCanSas.Any() && pubCanSas.Any(t => t.State != SettleBillState.))
{ {
@ -600,9 +594,9 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
} }
pubSas.Add(pubSaEntity); pubSas.Add(pubSaEntity);
pubSaDetails = await _pubSaDetailRepository.GetListAsync(t => t.BillNum == pubSaBillNum); pubSaDetails = await _pubSaDetailRepository.GetListAsync(t => t.BillNum == pubSaBillNum).ConfigureAwait(false);
pubCanSaDetails = await _pubCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum); pubCanSaDetails = await _pubCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum).ConfigureAwait(false);
pubNotSaDetails = await _pubNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum); pubNotSaDetails = await _pubNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum).ConfigureAwait(false);
} }
return (pubSas, pubSaDetails, pubCanSas, pubCanSaDetails, pubNotSaDetails); return (pubSas, pubSaDetails, pubCanSas, pubCanSaDetails, pubNotSaDetails);

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

@ -70,13 +70,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
//同步表名称 //同步表名称
var syncTableName = "JisBBACSeSync_Jit"; var syncTableName = "JisBBACSeSync_Jit";
//BBAC类型集合 //BBAC类型集合
var EnumDeliverSubBillTypes = new List<EnumDeliverSubBillType> var EnumDeliverSubBillTypes = GetDeliverSubBillTypes();
{
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC
};
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType); Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName); var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName);
@ -91,7 +85,11 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
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())
{ {
bbacSeDetails.ForEach(bbacSeDetail => bbacSeDetail.KeyCode = bbacSeDetail.PN + bbacSeDetail.LU); bbacSeDetails.ForEach(bbacSeDetail =>
{
bbacSeDetail.KeyCode = bbacSeDetail.PN + bbacSeDetail.LU;
bbacSeDetail.BusinessType = EnumBusinessType.JisBBAC;
});
await _bbacSeDetailRepository.InsertManyAsync(bbacSeDetails); await _bbacSeDetailRepository.InsertManyAsync(bbacSeDetails);
if (syncPositionFlag != null) if (syncPositionFlag != null)
@ -119,13 +117,7 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
//同步表名称 //同步表名称
var syncTableName = "JisBBACSeSync_Jis"; var syncTableName = "JisBBACSeSync_Jis";
//BBAC类型集合 //BBAC类型集合
var EnumDeliverSubBillTypes = new List<EnumDeliverSubBillType> var EnumDeliverSubBillTypes = GetDeliverSubBillTypes();
{
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC
};
Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType); Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName); var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName);
if (syncPositionFlag != null) if (syncPositionFlag != null)
@ -158,4 +150,18 @@ public class BBACSeSyncAppService : ApplicationService, IInvocable, IJobService
} }
} }
} }
/// <summary>
/// 获取BBAC类型集合
/// </summary>
private List<EnumDeliverSubBillType> GetDeliverSubBillTypes()
{
return new List<EnumDeliverSubBillType>
{
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC
};
}
} }

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

@ -37,30 +37,40 @@ public class HBPOSeSyncAppService : ApplicationService, IInvocable, IJobService
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> _hbpoSeDetailRepository; private readonly INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> _hbpoSeDetailRepository;
/// <summary>
/// PUB发运数据仓储
/// </summary>
private readonly INormalEfCoreRepository<PUB_SE_DETAIL, Guid> _pubSeDetailRepository;
/// <summary> /// <summary>
/// 构造 /// 构造
/// </summary> /// </summary>
public HBPOSeSyncAppService( public HBPOSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> hbpoSeDetailRepository) INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> hbpoSeDetailRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository)
{ {
_wmsBJBMPTContext = wmsBJBMPTContext; _wmsBJBMPTContext = wmsBJBMPTContext;
_syncPositionFlagRepository = syncPositionFlagRepository; _syncPositionFlagRepository = syncPositionFlagRepository;
_hbpoSeDetailRepository = hbpoSeDetailRepository; _hbpoSeDetailRepository = hbpoSeDetailRepository;
_pubSeDetailRepository = pubSeDetailRepository;
} }
[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);
} }
/// <summary>
/// 执行
/// </summary>
[HttpPost] [HttpPost]
public async Task Invoke() public async Task Invoke()
{ {
await SyncJitRecordAsync(); await SyncJitRecordAsync().ConfigureAwait(false);
await SyncJisRecordAsync(); await SyncJisRecordAsync().ConfigureAwait(false);
} }
/// <summary> /// <summary>
@ -71,42 +81,41 @@ public class HBPOSeSyncAppService : ApplicationService, IInvocable, IJobService
//同步表名称 //同步表名称
var syncTableName = "JisHBPOSeSync_Jit"; var syncTableName = "JisHBPOSeSync_Jit";
//HBPO类型集合 //HBPO类型集合
var EnumDeliverSubBillTypes = new List<EnumDeliverSubBillType> var EnumDeliverSubBillTypes = GetDeliverSubBillTypes();
{
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO
};
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType); Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName); var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position) && t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType); predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position) && t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType);
} }
//WMS发运数据 //WMS发运数据
var wmsRecords = _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).ToList();
if (wmsSeRecords.Any())
var hbpoSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<HBPO_SE_DETAIL>>(wmsRecords);
if (hbpoSeDetails.Any())
{ {
hbpoSeDetails.ForEach(hbpoSeDetail => hbpoSeDetail.KeyCode = hbpoSeDetail.PN + hbpoSeDetail.LU); //JisHBPO发运
await _hbpoSeDetailRepository.InsertManyAsync(hbpoSeDetails); var hbpoWmsSeRecords = wmsSeRecords.FindAll(t => t.DeliverSubBillType == EnumDeliverSubBillType.HBPO || t.DeliverSubBillType == EnumDeliverSubBillType.HBPO);
//买单件HBPO发运
var maiDanHBPOWmsSeRecords = wmsSeRecords.FindAll(t => t.DeliverSubBillType == EnumDeliverSubBillType.HBPO || t.DeliverSubBillType == EnumDeliverSubBillType.HBPO);
var hbpoSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<HBPO_SE_DETAIL>>(hbpoWmsSeRecords);
var maiDanHBPOSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<PUB_SE_DETAIL>>(maiDanHBPOWmsSeRecords);
await SaveSeDataAsync(hbpoSeDetails, maiDanHBPOSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
syncPositionFlag.Position = wmsRecords.Last().UID.ToString(); syncPositionFlag.Position = wmsSeRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag); await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag).ConfigureAwait(false);
} }
else else
{ {
syncPositionFlag = new SyncPositionFlag() syncPositionFlag = new SyncPositionFlag()
{ {
TableName = syncTableName, TableName = syncTableName,
Position = wmsRecords.Last().UID.ToString() Position = wmsSeRecords.Last().UID.ToString()
}; };
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false); ;
} }
} }
} }
@ -119,43 +128,71 @@ public class HBPOSeSyncAppService : ApplicationService, IInvocable, IJobService
//同步表名称 //同步表名称
var syncTableName = "JisHBPOSeSync_Jis"; var syncTableName = "JisHBPOSeSync_Jis";
//BBAC类型集合 //BBAC类型集合
var EnumDeliverSubBillTypes = new List<EnumDeliverSubBillType> var EnumDeliverSubBillTypes = GetDeliverSubBillTypes();
{
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC
};
Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType); Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName); var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position) && t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType); predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position) && t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType);
} }
//WMS发运数据 //WMS发运数据
var wmsRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).ToList();
if (wmsSeRecords.Any())
var hbpoSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<HBPO_SE_DETAIL>>(wmsRecords);
if (hbpoSeDetails.Any())
{ {
hbpoSeDetails.ForEach(hbpoSeDetail => hbpoSeDetail.KeyCode = hbpoSeDetail.PN + hbpoSeDetail.LU); //JisHBPO发运
await _hbpoSeDetailRepository.InsertManyAsync(hbpoSeDetails); var hbpoWmsSeRecords = wmsSeRecords.FindAll(t => t.DeliverSubBillType == EnumDeliverSubBillType.HBPO || t.DeliverSubBillType == EnumDeliverSubBillType.HBPO);
//买单件HBPO发运
var maiDanHBPOWmsSeRecords = wmsSeRecords.FindAll(t => t.DeliverSubBillType == EnumDeliverSubBillType.HBPO || t.DeliverSubBillType == EnumDeliverSubBillType.HBPO);
var hbpoSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<HBPO_SE_DETAIL>>(hbpoWmsSeRecords);
var maiDanHBPOSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<PUB_SE_DETAIL>>(maiDanHBPOWmsSeRecords);
await SaveSeDataAsync(hbpoSeDetails, maiDanHBPOSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
syncPositionFlag.Position = wmsRecords.Last().UID.ToString(); syncPositionFlag.Position = wmsSeRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag); await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag).ConfigureAwait(false);
} }
else else
{ {
syncPositionFlag = new SyncPositionFlag() syncPositionFlag = new SyncPositionFlag()
{ {
TableName = syncTableName, TableName = syncTableName,
Position = wmsRecords.Last().UID.ToString() Position = wmsSeRecords.Last().UID.ToString()
}; };
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false);
} }
} }
} }
/// <summary>
/// 获取HBPO类型集合
/// </summary>
private List<EnumDeliverSubBillType> GetDeliverSubBillTypes()
{
return new List<EnumDeliverSubBillType>
{
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO
};
}
/// <summary>
/// 保存发运树
/// </summary>
private async Task SaveSeDataAsync(List<HBPO_SE_DETAIL> hbpoSeDetails, List<PUB_SE_DETAIL> maiDanHBPOSeDetails)
{
hbpoSeDetails.ForEach(hbpoSeDetail => hbpoSeDetail.KeyCode = hbpoSeDetail.PN + hbpoSeDetail.LU);
maiDanHBPOSeDetails.ForEach(maiDanHBPOSeDetail =>
{
maiDanHBPOSeDetail.KeyCode = maiDanHBPOSeDetail.PN + maiDanHBPOSeDetail.LU;
maiDanHBPOSeDetail.BusinessType = EnumBusinessType.MaiDanJianHBPO;
});
await _hbpoSeDetailRepository.InsertManyAsync(hbpoSeDetails).ConfigureAwait(false);
await _pubSeDetailRepository.InsertManyAsync(maiDanHBPOSeDetails).ConfigureAwait(false);
}
} }

50
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs

@ -28,17 +28,49 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
public async Task Invoke() public async Task Invoke()
{ {
await HandDelEdiDataAsync().ConfigureAwait(false);
//using var serviceScope = _serviceProvider.CreateScope();
//var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
//var query = db.Set<BBAC_SE_DETAIL>().Join(db.Set<BBAC_SE_EDI>(), a => new { a.PN, a.LU, a.Qty }, b => new { b.PN, b.LU, b.Qty }, (se, edi) => new { se, edi }).Where(t => t.se.IsHaveEdiData == false && t.edi.IsHaveSeData == false && t.edi.IsDeleted == false);
//query.ForEach(t =>
//{
// t.edi.SeId = t.se.Id;
// t.edi.IsHaveSeData = true;
// t.se.IsHaveEdiData = true;
//});
//var ses = query.Select(t => t.se);
//var edis = query.Select(t => t.edi);
//db.Set<BBAC_SE_DETAIL>().UpdateRange(ses);
//db.Set<BBAC_SE_EDI>().UpdateRange(edis);
//await db.SaveChangesAsync().ConfigureAwait(false);
}
/// <summary>
/// 处理删除的EDI数据
/// </summary>
private async Task HandDelEdiDataAsync()
{
/*
*
*
* EDI数据
* EDI数据状态为无发运数据
*/
using var serviceScope = _serviceProvider.CreateScope(); using var serviceScope = _serviceProvider.CreateScope();
var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>(); var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var query = db.Set<BBAC_SE_DETAIL>().Join(db.Set<BBAC_SE_EDI>(), a => new { a.PN, a.LU, a.Qty }, b => new { b.PN, b.LU, b.Qty }, (se, edi) => new { se, edi }).Where(t => t.se.IsHaveEdiData == false && t.edi.IsHaveSeData == false); var query = db.Set<BBAC_SE_EDI>().Join(db.Set<BBAC_SE_DETAIL>(), a => a.SeId, b => b.Id, (edi, se) => new { se, edi }).Where(t => t.edi.IsDeleted == true && t.edi.IsHaveSeData == true);
var ses = query.Select(t => t.se); //query.ForEach(t =>
var edis = query.Select(t => t.edi); //{
// t.edi.SeId = default;
ses.ForEach(t => t.IsHaveEdiData = true); // t.edi.IsHaveSeData = false;
edis.ForEach(t => t.IsHaveSeData = true); // t.se.IsHaveEdiData = false;
//});
//var ses = query.Select(t => t.se);
//var edis = query.Select(t => t.edi);
db.Set<BBAC_SE_DETAIL>().UpdateRange(ses); //db.Set<BBAC_SE_DETAIL>().UpdateRange(ses);
db.Set<BBAC_SE_EDI>().UpdateRange(edis); //db.Set<BBAC_SE_EDI>().UpdateRange(edis);
await db.SaveChangesAsync().ConfigureAwait(false); //await db.SaveChangesAsync().ConfigureAwait(false);
} }
} }

24
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs

@ -66,7 +66,7 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
// se, // se,
// edi // edi
// }; // };
var query = db.Set<HBPO_SE_DETAIL>().Join(db.Set<HBPO_SE_EDI>(), a => new { a.PN, a.LU, a.Qty }, b => new { b.PN, b.LU, b.Qty }, (se, edi) => new { se, edi }).Where(t => t.se.IsHaveEdiData == false && t.edi.IsHaveSeData == false); var query = db.Set<HBPO_SE_DETAIL>().Join(db.Set<HBPO_SE_EDI>(), a => new { a.PN, a.LU, a.Qty }, b => new { b.PN, b.LU, b.Qty }, (se, edi) => new { se, edi }).Where(t => t.se.IsHaveEdiData == false && t.edi.IsHaveSeData == false && t.edi.IsDeleted == false);
var ses = query.Select(t => t.se); var ses = query.Select(t => t.se);
var edis = query.Select(t => t.edi); var edis = query.Select(t => t.edi);
@ -79,4 +79,26 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
Debug.WriteLine($"处理数量:{query.Count()}"); Debug.WriteLine($"处理数量:{query.Count()}");
} }
/// <summary>
/// 处理删除的EDI数据
/// </summary>
private async Task HandDelEdiDataAsync()
{
using var serviceScope = _serviceProvider.CreateScope();
var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
var query = db.Set<HBPO_SE_EDI>().Join(db.Set<HBPO_SE_DETAIL>(), a => a.SeId, b => b.Id, (edi, se) => new { se, edi }).Where(t => t.edi.IsDeleted == true && t.edi.IsHaveSeData == true);
query.ForEach(t =>
{
t.edi.SeId = default;
t.edi.IsHaveSeData = false;
t.se.IsHaveEdiData = false;
});
var ses = query.Select(t => t.se);
var edis = query.Select(t => t.edi);
db.Set<HBPO_SE_DETAIL>().UpdateRange(ses);
db.Set<HBPO_SE_EDI>().UpdateRange(edis);
await db.SaveChangesAsync().ConfigureAwait(false);
}
} }

19
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs

@ -9,6 +9,7 @@ using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
@ -34,6 +35,11 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PUB_SE_DETAIL, Guid> _pubSeDetailRepository; private readonly INormalEfCoreRepository<PUB_SE_DETAIL, Guid> _pubSeDetailRepository;
/// <summary>
/// 客户零件关系仓储
/// </summary>
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _materialRelationshipRepository;
private readonly IVmiService _vmiService; private readonly IVmiService _vmiService;
/// <summary> /// <summary>
@ -84,6 +90,19 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
var pubSeDetails = ObjectMapper.Map<List<TM_BJBMPT_OTHER_RECORD>, List<PUB_SE_DETAIL>>(wmsSeRecords); var pubSeDetails = ObjectMapper.Map<List<TM_BJBMPT_OTHER_RECORD>, List<PUB_SE_DETAIL>>(wmsSeRecords);
if (pubSeDetails.Any()) if (pubSeDetails.Any())
{ {
//客户零件号和厂内零件号
var luRePartCodes = pubSeDetails.Select(t => new { t.LU, t.PartCode });
var haveLuRePartCodes = (await _materialRelationshipRepository.GetListAsync(t => luRePartCodes.Contains(new { LU = t.ErpMaterialCode, PartCode = t.SettleMaterialCode })).ConfigureAwait(false)).Select(t => new { LU = t.ErpMaterialCode, PartCode = t.SettleMaterialCode });
var noHaveLuRePartCodes = luRePartCodes.Except(haveLuRePartCodes);
if (noHaveLuRePartCodes.Any())
{
var materialRelationships = noHaveLuRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.PartCode, ""));
await _materialRelationshipRepository.InsertManyAsync(materialRelationships).ConfigureAwait(false);
}
pubSeDetails.ForEach(t => pubSeDetails.ForEach(t =>
{ {
t.BusinessType = businessType; t.BusinessType = businessType;

154
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -229,7 +229,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
o.factory == data.factory && o.factory == data.factory &&
o.Configcode == data.Configcode); o.Configcode == data.Configcode);
var log = new VmiLog var log = new VmiLog(GuidGenerator.Create())
{ {
LogType = logType, LogType = logType,
ChangedType = VmiType.In, ChangedType = VmiType.In,
@ -308,7 +308,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
o.OrderNum == data.OrderNum && o.OrderNum == data.OrderNum &&
o.factory == data.factory && o.factory == data.factory &&
o.Configcode == data.Configcode); o.Configcode == data.Configcode);
var log = new VmiLog var log = new VmiLog(GuidGenerator.Create())
{ {
LogType = logType, LogType = logType,
ChangedType = VmiType.Out, ChangedType = VmiType.Out,
@ -360,42 +360,6 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
}).ConfigureAwait(false); }).ConfigureAwait(false);
} }
///// <summary>
///// 库存事务回滚
///// </summary>
//[NonAction]
//[UnitOfWork]
//public async Task UnDo(string groupId)
//{
// var logList = this._logRepository.Where(o => o.GroupId == groupId).AsNoTracking().OrderBy(o => o.ChangedTime);
// foreach (var item in logList)
// {
// var balance = this._balanceRepository.FirstOrDefault(o => o.BillType == item.BillType &&
// o.PartCode == item.PartCode &&
// o.VinCode == item.VinCode &&
// o.ErpToLoc == item.ErpToLoc &&
// o.OrderNum == item.OrderNum);
// if (balance == null)
// {
// balance = new VmiBalance(GuidGenerator.Create());
// balance.InjectFrom(item);
// await _balanceRepository.InsertAsync(balance).ConfigureAwait(false);
// }
// else
// {
// balance.Qty += item.ChangedQty;
// this._balanceRepository.UpdateAsync(balance).Wait();
// }
// var log = new VmiLog();
// log.InjectFrom(item);
// log.LogType = VmiLogType.Type300;
// log.ChangedType = VmiType.In;
// log.ChangedTime = DateTime.Now;
// log.ChangedBy = _currentUser.UserName;
// await _logRepository.InsertAsync(log).ConfigureAwait(false);
// }
//}
/// <summary> /// <summary>
/// 库存余额查询 /// 库存余额查询
/// </summary> /// </summary>
@ -415,8 +379,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
[HttpPost] [HttpPost]
public async Task<string> BalanceExport(RequestDto input) public async Task<string> BalanceExport(RequestDto input)
{ {
var entities = await _balanceRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiBalance>()) var entities = await _balanceRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false);
.ToListAsync().ConfigureAwait(false);
var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx"; var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx";
var content = this.GetContent(entities, "库存备份"); var content = this.GetContent(entities, "库存备份");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
@ -424,34 +387,45 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
} }
/// <summary> /// <summary>
/// 补货数据导出 /// 库存事务查询
/// </summary> /// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost] [HttpPost]
public async Task<string> ReplenishedExportAsync(RequestDto input) public async Task<PagedResultDto<VmiLog>> Log(LogRequestDto input)
{ {
var entities = await _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>()) var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
.ToListAsync().ConfigureAwait(false); var totalCount = await _logRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx"; return new PagedResultDto<VmiLog>(totalCount, entities);
var content = this.GetContent(entities, "补货数据_"); //return QueryLogFromTSDb(input);
}
/// <summary>
/// 库存事务导出
/// </summary>
[HttpPost]
public async Task<string> LogExport(RequestDto input)
{
var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false);
var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx";
var content = this.GetContent(entities, "库存事务_");
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
return fileName; return fileName;
} }
/// <summary> /// <summary>
/// 库存事务查询 /// 补货数据导出
/// </summary> /// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost] [HttpPost]
public async Task<PagedResultDto<VmiLog>> Log(LogRequestDto input) public async Task<string> ReplenishedExportAsync(RequestDto input)
{ {
var query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>()) //input.Filters.Add(new FilterCondition { Logic = EnumFilterLogic.And, Action = EnumFilterAction.NotEqual, Column = "IsReplenished", Value = "null" });
.WhereIf(input.LogTypes?.Count != 0, o => input.LogTypes.Contains(o.LogType)); var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false);
var totalCount = await query.CountAsync().ConfigureAwait(false); //IQueryable<VmiLog> query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>());
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx";
var entities = query.Skip(input.SkipCount).Take(input.MaxResultCount).ToList(); var content = this.GetContent(entities, "补货数据_");
return new PagedResultDto<VmiLog>(totalCount, entities); await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
//return QueryLogFromTSDb(input); return fileName;
} }
private PagedResultDto<VmiLog> QueryLogFromTSDb(RequestDto input) private PagedResultDto<VmiLog> QueryLogFromTSDb(RequestDto input)
@ -481,6 +455,47 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
return new PagedResultDto<VmiLog>(count, entities); return new PagedResultDto<VmiLog>(count, entities);
} }
/// <summary>
/// 人工调整
/// </summary>
/// <param name="log"></param>
/// <returns></returns>
[HttpPost]
public async Task EditBalance(VmiLog log)
{
if (log.Qty >= decimal.Zero)
{
log.LogType = VmiLogType.Type500;
log.ChangedType = VmiType.In;
var data = new VmiBalance();
data.InjectFrom(log);
await In(VmiLogType.Type500, null, data).ConfigureAwait(false);
}
else
{
log.LogType = VmiLogType.Type600;
log.ChangedType = VmiType.Out;
log.Qty = -log.Qty;
await this.Out(VmiLogType.Type600, null, log).ConfigureAwait(false);
}
}
/// <summary>
/// 库存调整导入
/// </summary>
/// <param name="files"></param>
[HttpPost]
public async Task Import(List<IFormFile> files)
{
using var ms = new MemoryStream();
await files.FirstOrDefault().OpenReadStream().CopyToAsync(ms).ConfigureAwait(false);
var list = this.ImportInternal<VmiLog>(ms.ToArray());
foreach (var file in list)
{
await EditBalance(file).ConfigureAwait(false);
}
}
/// <summary> /// <summary>
/// 快照列表 /// 快照列表
/// </summary> /// </summary>
@ -527,31 +542,6 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
return fileName; return fileName;
} }
/// <summary>
/// 人工调整
/// </summary>
/// <param name="log"></param>
/// <returns></returns>
[HttpPost]
public async Task EditBalance(VmiLog log)
{
if (log.Qty >= decimal.Zero)
{
log.LogType = VmiLogType.Type500;
log.ChangedType = VmiType.In;
var data = new VmiBalance();
data.InjectFrom(log);
await In(VmiLogType.Type500, null, data).ConfigureAwait(false);
}
else
{
log.LogType = VmiLogType.Type600;
log.ChangedType = VmiType.Out;
log.Qty=-log.Qty;
await this.Out(VmiLogType.Type600, null, log).ConfigureAwait(false);
}
}
private byte[] GetContent<TExport>(List<TExport> entities, string name = "sheet1") private byte[] GetContent<TExport>(List<TExport> entities, string name = "sheet1")
{ {
using var workbook = new XLWorkbook(); using var workbook = new XLWorkbook();

152
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -1,65 +1,57 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Reflection;
using AutoMapper; using AutoMapper;
using Win.Sfs.SettleAccount.EstimatedStockDiffReports; using Newtonsoft.Json;
using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Boms; using Win.Sfs.SettleAccount.Boms;
using Win.Sfs.SettleAccount.BTNotConsignReports;
using Win.Sfs.SettleAccount.BTSeqKBDiffReports;
using Win.Sfs.SettleAccount.Entities;
using Win.Sfs.SettleAccount.Entities.Boms; using Win.Sfs.SettleAccount.Entities.Boms;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.SettleAccount.Entities.CodeSettings;
using Win.Sfs.SettleAccount.FISes;
using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.SettleAccount.Entities.SettleAccounts;
using Win.Sfs.SettleAccount.Inventories;
using Win.Sfs.SettleAccount.Items;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion;
using Win.Sfs.SettleAccount.Prebatches;
using Win.Sfs.SettleAccount.Entities.Controls; using Win.Sfs.SettleAccount.Entities.Controls;
using Win.Sfs.SettleAccount.SendUnsettledDiffReports; using Win.Sfs.SettleAccount.Entities.Errors;
using Win.Sfs.SettleAccount.StockSettledDiffReports;
using Win.Sfs.SettleAccount.StockUnsettledDiffReports;
using Win.Sfs.SettleAccount.StockFisDiffReports;
using Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports;
using Win.Sfs.SettleAccount.SecondaryActuralDiffReports;
using Win.Sfs.SettleAccount.Entities.StorageLocations;
using Win.Sfs.SettleAccount.Entities.Inventories;
using Win.Sfs.SettleAccount.Entities.InventoryDetialVersion;
using Win.Sfs.SettleAccount.Entities.Factories; using Win.Sfs.SettleAccount.Entities.Factories;
using Win.Sfs.SettleAccount.SecondaryExportReports;
using System;
using Win.Sfs.SettleAccount.SupplierItemSetUps;
using Win.Sfs.SettleAccount.BTSeqKBDiffReports;
using Win.Sfs.SettleAccount.BTNotConsignReports;
using Win.Sfs.SettleAccount.HQNotConsignReports;
using Win.Sfs.SettleAccount.HQSPNotConsignReports;
using Win.Sfs.SettleAccount.Reports.SendUnsettledDiffReports;
using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.Entities.ImportColumnMaps; using Win.Sfs.SettleAccount.Entities.ImportColumnMaps;
using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.Entities.Inventories;
using Win.Sfs.SettleAccount.Entities.InventoryDetialVersion;
using Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Entities.Invoices;
using Win.Sfs.SettleAccount.Entities.Invoices.Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Entities.Invoices.Win.Sfs.SettleAccount.Entities.Invoices;
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.Entities.MaterialRelationships;
using Win.Sfs.SettleAccount.Entities.SettlementParts;
using Win.Sfs.SettleAccount.Entities.ItemInvoicePrices; using Win.Sfs.SettleAccount.Entities.ItemInvoicePrices;
using Win.Sfs.SettleAccount.Entities.SettlementPartss; using Win.Sfs.SettleAccount.Entities.MaterialRelationships;
using Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss; using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.Entities.SecMatch; using Win.Sfs.SettleAccount.Entities.SecMatch;
using Win.Sfs.SettleAccount.Entities.VWKanBan; using Win.Sfs.SettleAccount.Entities.SettleAccounts;
using Win.Sfs.SettleAccount.Entities.VWKanBanVersion; using Win.Sfs.SettleAccount.Entities.SettleAccountVersion;
using Win.Sfs.SettleAccount.Entities; using Win.Sfs.SettleAccount.Entities.SettlementParts;
using Win.Sfs.SettleAccount.Entities.StorageLocations;
using Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts; using Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts;
using Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput; using Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput;
using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Errors;
using Win.Sfs.SettleAccount.Entities.Errors; using Win.Sfs.SettleAccount.EstimatedStockDiffReports;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.FISes;
using SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.HQNotConsignReports;
using System.ComponentModel.DataAnnotations; using Win.Sfs.SettleAccount.HQSPNotConsignReports;
using System.Reflection; using Win.Sfs.SettleAccount.Inventories;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Prebatches;
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs;
using Win.Sfs.SettleAccount.Reports.SendUnsettledDiffReports;
using Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports;
using Win.Sfs.SettleAccount.SecondaryActuralDiffReports;
using Win.Sfs.SettleAccount.SecondaryExportReports;
using Win.Sfs.SettleAccount.SendUnsettledDiffReports;
using Win.Sfs.SettleAccount.StockFisDiffReports;
using Win.Sfs.SettleAccount.StockSettledDiffReports;
using Win.Sfs.SettleAccount.StockUnsettledDiffReports;
using Win.Sfs.SettleAccount.SupplierItemSetUps;
namespace Win.Sfs.SettleAccount namespace Win.Sfs.SettleAccount
{ {
@ -1025,13 +1017,14 @@ namespace Win.Sfs.SettleAccount
/// </summary> /// </summary>
private void CreateMapBBAC_SA_DETAIL() private void CreateMapBBAC_SA_DETAIL()
{ {
CreateMap<BBAC_SA_DETAIL, BBAC_SA_DETAIL_DTO>();
CreateMap<BBAC_SA_DETAIL, BBAC_CAN_SA_DETAIL>() CreateMap<BBAC_SA_DETAIL, BBAC_CAN_SA_DETAIL>()
.ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum)); .ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum));
CreateMap<BBAC_SA_DETAIL, BBAC_NOT_SA_DETAIL>() CreateMap<BBAC_SA_DETAIL, BBAC_NOT_SA_DETAIL>()
.ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum)); .ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum));
CreateMap<BBAC_SA_DETAIL, BBAC_SA_DETAIL_EXPORT_DTO>();
CreateMap<BBAC_SA_DETAIL_IMPORT_DTO, BBAC_SA_DETAIL>(); CreateMap<BBAC_SA_DETAIL_IMPORT_DTO, BBAC_SA_DETAIL>();
CreateMap<BBAC_SA_DETAIL_IMPORT_DTO, PUB_SA_DETAIL>();
} }
/// <summary> /// <summary>
@ -1065,11 +1058,12 @@ namespace Win.Sfs.SettleAccount
/// </summary> /// </summary>
private void CreateMapHBPO_SA_DETAIL() private void CreateMapHBPO_SA_DETAIL()
{ {
CreateMap<HBPO_SA_DETAIL, HBPO_SA_DETAIL_DTO>();
CreateMap<HBPO_SA_DETAIL, HBPO_CAN_SA_DETAIL>() CreateMap<HBPO_SA_DETAIL, HBPO_CAN_SA_DETAIL>()
.ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum)); .ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum));
CreateMap<HBPO_SA_DETAIL, HBPO_NOT_SA_DETAIL>() CreateMap<HBPO_SA_DETAIL, HBPO_NOT_SA_DETAIL>()
.ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum)); .ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum));
//CreateMap<HBPO_SA_DETAIL, HBPO_SA_DETAIL_EXPORT_DTO>(); CreateMap<HBPO_SA_DETAIL, HBPO_SA_DETAIL_EXPORT_DTO>();
CreateMap<HBPO_SA_DETAIL_IMPORT_DTO, HBPO_SA_DETAIL>(); CreateMap<HBPO_SA_DETAIL_IMPORT_DTO, HBPO_SA_DETAIL>();
} }
@ -1096,6 +1090,8 @@ namespace Win.Sfs.SettleAccount
/// </summary> /// </summary>
private void CreateMapPUB_SA_DETAIL() private void CreateMapPUB_SA_DETAIL()
{ {
CreateMap<PUB_SA_DETAIL, PUB_SA_DETAIL_DTO>();
CreateMap<PUB_SA_DETAIL, PUB_CAN_SA_DETAIL>() CreateMap<PUB_SA_DETAIL, PUB_CAN_SA_DETAIL>()
.ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum)); .ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum));
CreateMap<PUB_SA_DETAIL, PUB_NOT_SA_DETAIL>() CreateMap<PUB_SA_DETAIL, PUB_NOT_SA_DETAIL>()
@ -1105,7 +1101,25 @@ namespace Win.Sfs.SettleAccount
CreateMap<ZhiGongJianBBACImportDto, PUB_SA_DETAIL>(); CreateMap<ZhiGongJianBBACImportDto, PUB_SA_DETAIL>();
CreateMap<ZhiGongJianHBPOImportDto, PUB_SA_DETAIL>(); CreateMap<ZhiGongJianHBPOImportDto, PUB_SA_DETAIL>();
CreateMap<MaiDanJianHBPOImportDto, PUB_SA_DETAIL>(); CreateMap<MaiDanJianHBPOImportDto, PUB_SA_DETAIL>();
CreateMap<BeiJianImportDto, PUB_SA_DETAIL>(); CreateMap<BeiJianImportDto, PUB_SA_DETAIL>()
.ForMember(x => x.ExtraProperties, y => y.MapFrom(d =>
new Dictionary<string, object>()
{
{ "DeliveryNumber", d.DeliveryNumber},
{ "InvoiceNumber", d.InvoiceNumber},
{ "VendorCode", d.VendorCode},
{ "VendorName", d.VendorName},
{ "PurchaseOrderNumber", d.PurchaseOrderNumber},
{ "DeliveryIndexNumber", d.DeliveryIndexNumber},
{ "PartName", d.PartName},
{ "Price", d.Price},
{ "Amount", d.Amount},
{ "Tallage", d.Tallage},
{ "Total", d.Total},
{ "ProtocolNumber", d.ProtocolNumber},
{ "Remark", d.Remark},
{ "CommodityGroup", d.CommodityGroup}
}));
CreateMap<YinDuJianImportDto, PUB_SA_DETAIL>(); CreateMap<YinDuJianImportDto, PUB_SA_DETAIL>();
} }
@ -1114,6 +1128,16 @@ namespace Win.Sfs.SettleAccount
/// </summary> /// </summary>
private void CreateMapSeSync() private void CreateMapSeSync()
{ {
CreateMap<TM_BJBMPT_JIT_RECORD, BBAC_SE_DETAIL>()
.ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.JISNum))
.ForMember(x => x.AssemblyCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.InjectionCode, y => y.MapFrom(d => d.DeliverCode))
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIT_RECORD, HBPO_SE_DETAIL>() CreateMap<TM_BJBMPT_JIT_RECORD, HBPO_SE_DETAIL>()
.ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.JISNum)) .ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.JISNum))
.ForMember(x => x.AssemblyCode, y => y.MapFrom(d => d.RealPartCode)) .ForMember(x => x.AssemblyCode, y => y.MapFrom(d => d.RealPartCode))
@ -1124,7 +1148,24 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode)) .ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode)) .ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty)); .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIT_RECORD, PUB_SE_DETAIL>()
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIS_RECORD, BBAC_SE_DETAIL>()
.ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.JISNum))
.ForMember(x => x.AssemblyCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.InjectionCode, y => y.MapFrom(d => d.DeliverCode))
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIS_RECORD, HBPO_SE_DETAIL>() CreateMap<TM_BJBMPT_JIS_RECORD, HBPO_SE_DETAIL>()
.ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.JISNum)) .ForMember(x => x.SeqNumber, y => y.MapFrom(d => d.JISNum))
.ForMember(x => x.AssemblyCode, y => y.MapFrom(d => d.RealPartCode)) .ForMember(x => x.AssemblyCode, y => y.MapFrom(d => d.RealPartCode))
@ -1135,6 +1176,13 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode)) .ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode)) .ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty)); .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIS_RECORD, PUB_SE_DETAIL>()
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_OTHER_RECORD, PUB_SE_DETAIL>() CreateMap<TM_BJBMPT_OTHER_RECORD, PUB_SE_DETAIL>()
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.DnBillTime)) .ForMember(x => x.BeginDate, y => y.MapFrom(d => d.DnBillTime))

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

@ -1,16 +1,19 @@
using SettleAccount.Bases;
using System; using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using SettleAccount.Bases;
using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ; namespace SettleAccount.Domain.BQ;
[Display(Name = "BBAC发运单")] [Display(Name = "BBAC发运单")]
public class BBAC_SE_DETAIL:SE_BASE public class BBAC_SE_DETAIL:SE_BASE
{ {
/// <summary>
/// 业务分类
/// </summary>
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
//[Display(Name = "LU+生产码")] //[Display(Name = "LU+生产码")]
//public string KeyCode { get; set; } = null!; //public string KeyCode { get; set; } = null!;

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

@ -50,6 +50,12 @@ public class BBAC_SE_EDI:FullAuditedAggregateRoot<Guid>
[Display(Name = "是否有发运数据")] [Display(Name = "是否有发运数据")]
public bool IsHaveSeData { get; set; } public bool IsHaveSeData { get; set; }
/// <summary>
/// 发运Id
/// </summary>
[Display(Name = "是否有发运数据")]
public Guid SeId { get; set; }
public BBAC_SE_EDI() public BBAC_SE_EDI()
{ } { }
public BBAC_SE_EDI(Guid guid, string keyCode, string version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate public BBAC_SE_EDI(Guid guid, string keyCode, string version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate

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

@ -53,6 +53,12 @@ public class HBPO_SE_EDI :FullAuditedAggregateRoot<Guid>
[Display(Name = "是否有发运数据")] [Display(Name = "是否有发运数据")]
public bool IsHaveSeData { get; set; } public bool IsHaveSeData { get; set; }
/// <summary>
/// 发运Id
/// </summary>
[Display(Name = "是否有发运数据")]
public Guid SeId { get; set; }
public HBPO_SE_EDI(Guid guid ,string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, string site, string extend1, string extend2, string extend3, string extend4) public HBPO_SE_EDI(Guid guid ,string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, string site, string extend1, string extend2, string extend3, string extend4)
{ {
Id = guid; Id = guid;

Loading…
Cancel
Save