学 赵 1 year ago
parent
commit
4799d3df5c
  1. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Controllers/HomeController.cs
  2. 7
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs
  3. 55
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  4. 32
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js
  5. 62
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/_extraProperties.js
  6. 14
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/_options.js
  7. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/compare/compare.js
  8. 66
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan-detail.js
  9. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  10. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/compare/_compare.js
  11. 199
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
  12. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
  13. 20
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js
  14. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js
  15. 16
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/log.js
  16. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
  17. 238
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs
  18. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs
  19. 238
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs
  20. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  21. 275
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs
  22. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs
  23. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  24. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  25. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  26. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs
  27. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs
  28. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs
  29. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs
  30. 49
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
  31. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs
  32. 51
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
  33. 51
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
  34. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs
  35. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs
  36. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs
  37. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs
  38. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs
  39. 569
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/FISes/FISAppService.cs
  40. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
  41. 580
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs
  42. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  43. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs
  44. 80
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs
  45. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs
  46. 245
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  47. 6
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  48. 5521
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.Designer.cs
  49. 191
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.cs
  50. 46
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
  51. 10
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
  52. 126
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  53. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

8
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Controllers/HomeController.cs

@ -1,3 +1,5 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
@ -20,10 +22,10 @@ namespace Win.Sfs.SettleAccount.Controllers
return File("~/index.html", "text/html"); return File("~/index.html", "text/html");
} }
public IActionResult Test() public async Task<string> Test(int seconds)
{ {
this._hubContext.Clients.All.ServerToClient("test", "hello", ""); await Task.Delay(seconds*1000).ConfigureAwait(false);
return Json("ok"); return "ok";
} }
} }
} }

7
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs

@ -55,9 +55,10 @@ public class Program
webBuilder.ConfigureKestrel((context, options) => webBuilder.ConfigureKestrel((context, options) =>
{ {
//设置应用服务器Kestrel请求体最大为50MB //设置应用服务器Kestrel请求体最大为50MB
options.Limits.MaxRequestBodySize = 5242880000; options.Limits.MaxRequestBodySize = long.MaxValue;
options.Limits.MaxRequestBufferSize = 302768; options.Limits.MaxRequestBufferSize = long.MaxValue;
options.Limits.MaxRequestLineSize = 302768; options.Limits.MaxRequestLineSize = int.MaxValue;
options.Limits.KeepAliveTimeout= TimeSpan.MaxValue;
}); });
webBuilder.UseStartup<Startup>(); webBuilder.UseStartup<Startup>();
}) })

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

@ -159,7 +159,7 @@ export default {
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<el-drawer v-model="filterDrawer" destroy-on-close @close="tableRef.doLayout()"> <el-drawer v-model="filterDrawer" :close-on-click-modal="false" destroy-on-close @close="tableRef.doLayout()">
<template #header> <span class="el-dialog__title"> {{$t('filter')}} </span> </template> <template #header> <span class="el-dialog__title"> {{$t('filter')}} </span> </template>
<el-scrollbar> <el-scrollbar>
<el-row> <el-row>
@ -184,7 +184,7 @@ export default {
</span> </span>
</template> </template>
</el-drawer> </el-drawer>
<el-drawer v-model="subDrawer" destroy-on-close size="50%"> <el-drawer :close-on-click-modal="false" v-model="subDrawer" destroy-on-close size="50%">
<el-scrollbar> <el-scrollbar>
<app-list v-if="subDrawer" :query="subListQuery" :buttons="subListQuery.buttons" :config="subListQuery.config" /> <app-list v-if="subDrawer" :query="subListQuery" :buttons="subListQuery.buttons" :config="subListQuery.config" />
</el-scrollbar> </el-scrollbar>
@ -556,40 +556,7 @@ 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
if (item.meta.pattern === "paged") { if (item.meta.pattern === "paged") {
const url = config.edit.exportUrl; const url = config.edit.exportUrl;
const method = config.edit.exportMethod; const method = config.edit.exportMethod;
@ -845,23 +812,6 @@ export default {
} }
return postData; return postData;
} }
function buildImport() {
importModel.value.maxResultCount = pageModel.pageSize;
importModel.value.skipCount = (pageModel.pageIndex - 1) * pageModel.pageSize;
//
const postData = JSON.parse(JSON.stringify(importModel.value));
postData.filters = filterList.value.filter((o) => o.column && o.action && (o.value || o.value === false));
if (postData.items) {
delete postData["items"];
}
if (postData.import?.id) {
delete postData.import["id"];
}
return postData;
}
function isNotJit() {
return route.meta.businessType !== 3 || route.meta.businessType !== 4 || route.meta.businessType !== 7 || route.meta.businessType !== 8;
}
onMounted(async () => { onMounted(async () => {
if (route.meta.children?.length) { if (route.meta.children?.length) {
for (const item of route.meta.children) { for (const item of route.meta.children) {
@ -928,7 +878,6 @@ export default {
versions, versions,
pushfilterList, pushfilterList,
getOperators, getOperators,
isNotJit,
getFilters, getFilters,
}; };
}, },

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

@ -4,20 +4,42 @@ import { reactive, ref } from "vue";
export default { export default {
template: html`<div class="app-table el-table" ref="tableRef"> template: html`<div class="app-table el-table" ref="tableRef">
<div class="row"> <div class="row">
<div class="cell el-table__cell" v-for="item in columns"> <template v-for="(item,key) in columns.properties">
<div class="cell" style="text-align:center;" v-if="item.input==='selection'"> <div class="cell el-table__cell" v-if="item.input==='selection'">
<div class="cell" style="text-align:center;">
<input class="el-checkbox__input" type="checkbox" v-model="checkAll" :indeterminate="checkAllIndeterminate" @click="checkAllClick($event)" /> <input class="el-checkbox__input" type="checkbox" v-model="checkAll" :indeterminate="checkAllIndeterminate" @click="checkAllClick($event)" />
</div> </div>
<div class="cell" v-else-if="!item.hidden">{{item.title}}</div>
</div> </div>
<template v-else-if="item.type==='object'">
<template v-for="(item2,key2) in item.properties">
<div class="cell el-table__cell" v-if="!item2.hidden">
<div class="cell">{{item2.title}}</div>
</div>
</template>
</template>
<div class="cell el-table__cell" v-else-if="!item.hidden">
<div class="cell">{{item.title}}</div>
</div>
</template>
</div> </div>
<div v-for="(row,index) in data" class="row"> <div v-for="(row,index) in data" class="row">
<div class="cell el-table__cell" v-for="item in columns"> <template v-for="(item,key) in columns.properties">
<div class="cell el-table__cell" v-if="item.input==='selection'">
<div class="cell" style="text-align:center;" v-if="item.input==='selection'"> <div class="cell" style="text-align:center;" v-if="item.input==='selection'">
<input class="el-checkbox__input row" type="checkbox" :value="index" @click="checkClick" /> <input class="el-checkbox__input row" type="checkbox" :value="index" @click="checkClick" />
</div> </div>
<div class="cell" v-else-if="!item.hidden">{{row[item.dataKey]}}</div>
</div> </div>
<template v-else-if="item.type==='object'">
<template v-for="(item2,key2) in item.properties">
<div class="cell el-table__cell" v-if="!item2.hidden">
<div class="cell" v-if="row[key]&&!item.hidden">{{row[key][key2]}}</div>
</div>
</template>
</template>
<div class="cell el-table__cell" v-else-if="!item.hidden">
<div class="cell">{{row[key]}}</div>
</div>
</template>
</div> </div>
</div>`, </div>`,
styles: html`<style> styles: html`<style>

62
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/_extraProperties.js

@ -0,0 +1,62 @@
export default {
title: "扩展属性",
type: "object",
properties: {
DeliveryNumber: {
type: "string",
title: "交货号",
},
InvoiceNumber: {
type: "string",
title: "发票号",
},
VendorCode: {
type: "string",
title: "供应商代码",
},
VendorName: {
type: "string",
title: "供应商名称",
},
PurchaseOrderNumber: {
type: "string",
title: "采购订单号",
},
DeliveryIndexNumber: {
type: "string",
title: "交付索引号",
},
PartName: {
type: "string",
title: "零件名称",
},
Price: {
type: "number",
title: "价格",
},
Amount: {
title: "金额",
type: "number",
},
Tallage: {
type: "number",
title: "税额",
},
Total: {
type: "number",
title: "价税合计",
},
ProtocolNumber: {
type: "string",
title: "协议编号",
},
Remark: {
type: "string",
title: "备注",
},
CommodityGroup: {
type: "string",
title: "商品组",
},
},
};

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

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

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/compare/compare.js

@ -2,7 +2,7 @@ import { version } from "../_options.js";
const version2 = Object.assign({}, version); const version2 = Object.assign({}, version);
const compareSchema = { const defaultCompareSchema = {
title: "数据比对", title: "数据比对",
properties: { properties: {
version: Object.assign(version2, { rules: [{ required: true }] }), version: Object.assign(version2, { rules: [{ required: true }] }),
@ -88,7 +88,9 @@ export default function (businessType, type) {
let compareService = null; let compareService = null;
let title = null; let title = null;
let name = null; let name = null;
const compareSchema = Object.assign({}, defaultCompareSchema);
if (type === "fa-yun") { if (type === "fa-yun") {
delete compareSchema.properties["downLineDateTime"];
if (businessType === "JisBBAC") { if (businessType === "JisBBAC") {
compareService = "edi-se-compare/bbacedi-se-compare"; compareService = "edi-se-compare/bbacedi-se-compare";
name = "JisBBACEDI与发运数据对比"; name = "JisBBACEDI与发运数据对比";
@ -106,13 +108,12 @@ export default function (businessType, type) {
} }
name = nameList[businessType]; name = nameList[businessType];
} }
const queryUrl = "settleaccount/Job/list"; const queryUrl = "settleaccount/Job/list";
const deleteUrl = "settleaccount/Job/delete"; const deleteUrl = "settleaccount/Job/delete";
const exportUrl = "settleaccount/pub_sa_detail_service/export";
const compareUrl = `settleaccount/${compareService}`; const compareUrl = `settleaccount/${compareService}`;
const queryMethod = "POST"; const queryMethod = "POST";
const deleteMethod = "POST"; const deleteMethod = "POST";
const exportMethod = "POST";
const compareMethod = "POST"; const compareMethod = "POST";
return { return {
@ -131,6 +132,7 @@ export default function (businessType, type) {
name: { name: {
type: "string", type: "string",
hidden: true, hidden: true,
default: name,
}, },
stateName, stateName,
businessType: { businessType: {
@ -178,10 +180,8 @@ export default function (businessType, type) {
}, },
edit: { edit: {
deleteUrl, deleteUrl,
exportUrl,
compareUrl, compareUrl,
deleteMethod, deleteMethod,
exportMethod,
compareMethod, compareMethod,
schema: schema, schema: schema,
}, },

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

@ -1,4 +1,5 @@
import { version, state } from "../_options.js"; import { version, state } from "../_options.js";
import extraProperties from "../_extraProperties.js";
const schema = { const schema = {
title: "结算数据", title: "结算数据",
@ -32,65 +33,22 @@ const schema = {
title: "生产号", title: "生产号",
type: "string", type: "string",
}, },
extraProperties: { extraProperties,
title: "扩展属性",
type: "object",
properties: {
DeliveryNumber: {
title: "交货号",
},
InvoiceNumber: {
title: "发票号",
},
VendorCode: {
title: "供应商代码",
},
VendorName: {
title: "供应商名称",
},
PurchaseOrderNumber: {
title: "采购订单号",
},
DeliveryIndexNumber: {
title: "交付索引号",
},
PartName: {
title: "零件名称",
},
Price: {
title: "价格",
type: "number",
},
Amount: {
title: "金额",
type: "number",
},
Tallage: {
title: "税额",
type: "number",
},
Total: {
title: "价税合计",
type: "number",
},
ProtocolNumber: {
title: "协议编号",
},
Remark: {
title: "备注",
},
CommodityGroup: {
title: "商品组",
},
},
},
}, },
}; };
const queryUrl = "settleaccount/pub_sa_detail_service/get-list"; export default function (businessType) {
let service = null;
if (businessType === "JisBBAC") {
service = "bbac_sa_detail_service";
} else if (businessType === "JisHBPO") {
service = "hbpo_sa_detail_service";
} else {
service = "pub_sa_detail_service";
}
const queryUrl = `settleaccount/${service}/get-list`;
const queryMethod = "POST"; const queryMethod = "POST";
export default function () {
return { return {
query: { query: {
url: queryUrl, url: queryUrl,

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

@ -338,7 +338,7 @@ export default [
createButton("query", "title=查询&isTop=true"), createButton("query", "title=查询&isTop=true"),
createButton("import", "title=导入开票文件&isTop=true"), createButton("import", "title=导入开票文件&isTop=true"),
createButton("compare", "title=财务审核通过&isTop=true"), createButton("compare", "title=财务审核通过&isTop=true"),
createButton("export", "title=导出&pattern=paged"), createButton("export-group", "title=导出发票分组&pattern=paged"),
createButton("reject", "title=退回&isTop=true"), createButton("reject", "title=退回&isTop=true"),
createButton("sync", "title=同步到QAD&isTop=true"), createButton("sync", "title=同步到QAD&isTop=true"),
], ],

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

@ -11,7 +11,7 @@ export default function (type) {
return { return {
components: { AppList, AppForm }, components: { AppList, AppForm },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" /> template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
<el-dialog v-model="dialogVisable" align-center destroy-on-close style="width:40%;height:50%;"> <el-dialog v-model="dialogVisable" align-center :close-on-click-modal="false" destroy-on-close style="width:40%;height:50%;">
<template #header> <span class="el-dialog__title"> EDI与发运对比 </span> </template> <template #header> <span class="el-dialog__title"> EDI与发运对比 </span> </template>
<el-scrollbar> <el-scrollbar>
<app-form ref="formRef" :mode="create" label-position="left" :schema="schema" v-model="model" :hideButton="true" @submit="submit" /> <app-form ref="formRef" :mode="create" label-position="left" :schema="schema" v-model="model" :hideButton="true" @submit="submit" />

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

@ -4,6 +4,7 @@ import { ref, nextTick, onMounted, watch } from "vue";
import request from "../../request/index.js"; import request from "../../request/index.js";
import AppForm from "../../components/form/index.js"; import AppForm from "../../components/form/index.js";
import AppTable from "../../components/table/index.js"; import AppTable from "../../components/table/index.js";
import extraProperties from "../../models/_extraProperties.js";
export default { export default {
components: { AppForm, AppTable }, components: { AppForm, AppTable },
@ -12,22 +13,22 @@ export default {
<el-row style="height:calc(100vh - 160px);" v-loading="loading"> <el-row style="height:calc(100vh - 160px);" v-loading="loading">
<el-col> <el-col>
<el-tabs> <el-tabs>
<el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_MAP_GROUP.length"> <el-tab-pane :label="columns1.title" v-if="model.invoicE_MAP_GROUP.length">
<el-scrollbar> <el-scrollbar>
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns1" /> <app-table :data="model.invoicE_MAP_GROUP" :columns="columns1" />
</el-scrollbar> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="发票明细" v-if="model.invoicE_WAIT_DETAIL.length"> <el-tab-pane :label="columns2.title" v-if="model.invoicE_WAIT_DETAIL.length">
<el-scrollbar> <el-scrollbar>
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns2" /> <app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns2" />
</el-scrollbar> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_NOT_SETTLE.length"> <el-tab-pane :label="columns3.title" v-if="model.invoicE_NOT_SETTLE.length">
<el-scrollbar> <el-scrollbar>
<app-table :data="model.invoicE_NOT_SETTLE" :columns="columns3" /> <app-table :data="model.invoicE_NOT_SETTLE" :columns="columns3" />
</el-scrollbar> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="发票调整明细" v-if="model.adJ_DETAIL.length"> <el-tab-pane :label="columns4.title" v-if="model.adJ_DETAIL.length">
<el-scrollbar> <el-scrollbar>
<app-table :data="model.adJ_DETAIL" :columns="columns4" /> <app-table :data="model.adJ_DETAIL" :columns="columns4" />
</el-scrollbar> </el-scrollbar>
@ -38,11 +39,11 @@ export default {
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" @click="show=false"> 返回 </el-button> <el-button type="primary" @click="show=false"> 返回 </el-button>
<el-button type="primary" @click="showSetupDialog" v-if="isBusiness&&model.adJ_DETAIL.length===0"> 重开发票 </el-button> <el-button type="primary" @click="showSetupDialog" v-if="isBusiness&&data.invbillNum&&model.adJ_DETAIL.length===0"> 重开发票 </el-button>
</span> </span>
</template> </template>
</el-drawer> </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%"> <el-dialog class="re-open" v-model="setupDialogVisable" :close-on-click-modal="false" align-center destroy-on-close style="width:100%;height:100%">
<template #header>发票重开</template> <template #header>发票重开</template>
<el-steps :active="setupRef" align-center style="height:60px;"> <el-steps :active="setupRef" align-center style="height:60px;">
<el-step title="调整明细列表" /> <el-step title="调整明细列表" />
@ -65,6 +66,22 @@ export default {
</el-row> </el-row>
</el-scrollbar> </el-scrollbar>
</div> </div>
<div v-show="setupRef===2" 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> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" @click="setupRef-=1" v-if="setupRef>1">上一步</el-button> <el-button type="primary" @click="setupRef-=1" v-if="setupRef>1">上一步</el-button>
@ -140,110 +157,132 @@ export default {
adJ_DETAIL: [], adJ_DETAIL: [],
}); });
// //
const columns1 = [ const columns1 = {
{ type: "object",
dataKey: "invbillNum", title: "发票和结算分组对应关系",
properties: {
invbillNum: {
type: "string",
title: "发票号", title: "发票号",
}, },
{ invGroupNum: {
dataKey: "invGroupNum", type: "string",
title: "发票分组号", title: "发票分组号",
}, },
{ settleGroupNum: {
dataKey: "settleGroupNum", type: "string",
title: "结算分组号", title: "结算分组号",
}, },
{
dataKey: "amt",
title: "金额",
}, },
]; };
const columns2 = [ const columns2 = {
{ type: "object",
dataKey: "invbillNum", title: "发票明细",
properties: {
invbillNum: {
type: "string",
title: "发票号", title: "发票号",
}, },
{ invGroupNum: {
dataKey: "invGroupNum", type: "string",
title: "发票分组号", title: "发票分组号",
}, },
{ lu: {
dataKey: "lu", type: "string",
title: "零件号", title: "零件号",
}, },
{ price: {
dataKey: "price", type: "number",
title: "单价", title: "单价",
}, },
{ qty: {
dataKey: "qty", type: "number",
title: "数量", title: "数量",
}, },
{ amt: {
dataKey: "amt", type: "number",
title: "金额", title: "金额",
}, },
{ bussiessType: {
dataKey: "bussiessType", type: "number",
title: "业务分类", title: "业务分类",
}, },
]; extraProperties,
const columns3 = [ },
{ };
dataKey: "invGroupNum", const columns3 = {
type: "object",
title: "已结分组包含不可结算零件",
properties: {
invGroupNum: {
type: "string",
title: "发票分组号", title: "发票分组号",
}, },
{ settleGroupNum: {
dataKey: "settleGroupNum", type: "string",
title: "结算分组号", title: "结算分组号",
}, },
{ lu: {
dataKey: "lu", type: "string",
title: "可结算分组号", title: "可结算分组号",
}, },
{ lu1: {
dataKey: "lu1", type: "string",
title: "不可结算分组号", title: "不可结算分组号",
}, },
]; },
const columns4 = [ };
{ const columns4 = {
dataKey: "oldInvBillNum", type: "object",
title: "发票调整明细",
properties: {
oldInvBillNum: {
type: "string",
title: "作废发票号", title: "作废发票号",
}, },
{ invBillNum: {
dataKey: "invBillNum", type: "string",
title: "发票号", title: "发票号",
}, },
{ settleDate: {
dataKey: "settleDate", type: "string",
title: "下线日期", title: "下线日期",
input: "datetime",
}, },
{ invGroupNum: {
dataKey: "invGroupNum", type: "string",
title: "发票分组号", title: "发票分组号",
}, },
{ lu: {
dataKey: "lu", type: "string",
title: "零件号", title: "零件号",
}, },
{ pn: {
dataKey: "pn", type: "string",
title: "标识号", title: "标识号",
}, },
{ qty: {
dataKey: "qty", type: "number",
title: "数量", title: "数量",
}, },
{ groupNum: {
dataKey: "groupNum", type: "number",
title: "结算分组", title: "结算分组",
}, },
]; },
const columns5 = columns4.filter((o) => o.dataKey !== "oldInvBillNum" && o.dataKey !== "invGroupNum"); };
columns5.unshift({ const columns5 = {
type: "object",
title: "",
properties: {
selection: {
input: "selection", input: "selection",
}); },
...columns4.properties,
},
};
delete columns5.properties["oldInvBillNum"];
delete columns5.properties["invGroupNum"];
//显示重开发票对话框 //显示重开发票对话框
const setupDialogVisable = ref(false); const setupDialogVisable = ref(false);
const setupRef = ref(1); const setupRef = ref(1);
@ -378,16 +417,16 @@ export default {
const next = async () => { const next = async () => {
if (setupRef.value === 1) { if (setupRef.value === 1) {
try { try {
const url = "settleaccount/adj_service/check-import"; // const url = "settleaccount/adj_service/check-import";
const result = await request(url, adjList.value, { method: "POST" }); // const result = await request(url, adjList.value, { method: "POST" });
if (!result.errors) { // if (!result.errors) {
if (result.data?.code === 200) { // if (result.data?.code === 200) {
//明细对比逻辑处理 // setupRef.value += 1;
setupRef += 1; // } else if (result.data?.code === 400 && result.data.fileName) {
} else if (result.data?.code === 400 && result.data.fileName) { // window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); // }
} // }
} setupRef.value += 1;
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
@ -399,7 +438,16 @@ export default {
// //
onMounted(async () => { onMounted(async () => {
loading.value = true; loading.value = true;
const response = await request("settleaccount/invoice_service/detail-query", props.data, { method: "POST" }); const data = { filters: [] };
Object.keys(props.data).forEach((o) => {
data.filters.push({
logic: "and",
column: o,
action: "equal",
value: props.data[o],
});
});
const response = await request("settleaccount/invoice_service/detail-query", data, { method: "POST" });
model.value = response.data; model.value = response.data;
loading.value = false; loading.value = false;
}); });
@ -411,7 +459,6 @@ export default {
columns2, columns2,
columns3, columns3,
columns4, columns4,
columns4,
columns5, columns5,
showSetupDialog, showSetupDialog,
setupRef, setupRef,

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

@ -47,10 +47,10 @@ export default {
} }
} }
} else if (item.path === "invbillNum" || item.path === "invGroupNum") { } else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { invbillNum: rows[0]["invbillNum"], invGroupNum: rows[0]["invGroupNum"] }; data.value = { [item.path]: rows[0][item.path] };
visable.value = true; visable.value = true;
console.log(item.path, item, rows);
} }
console.log(item.path, item, rows);
}; };
return { appListRef, config, onCommand, visable, data }; return { appListRef, config, onCommand, visable, data };
}, },

20
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js

@ -4,6 +4,7 @@ import { useRoute } from "vue-router";
import { ref } from "vue"; import { ref } from "vue";
import useConfig from "../../models/settle/commerce.js"; import useConfig from "../../models/settle/commerce.js";
import AppCheck from "./_check.js"; import AppCheck from "./_check.js";
import request, { getUrl } from "../../request/index.js";
export default { export default {
components: { AppList, AppCheck }, components: { AppList, AppCheck },
@ -15,8 +16,27 @@ export default {
const businessType = route.meta.businessType; const businessType = route.meta.businessType;
const config = useConfig(businessType, "cai-wu"); const config = useConfig(businessType, "cai-wu");
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
if (item.path === "export-group") {
const url = config.edit.exportUrl;
const method = config.edit.exportMethod;
const postData = {
filters: [
{
logic: "and",
column: "invGroupNum",
action: "equal",
value: rows[0]["invGroupNum"],
},
],
};
const response = await request(url, postData, { method });
if (!response.errors) {
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
}
} else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { [item.path]: rows[0][item.path] }; data.value = { [item.path]: rows[0][item.path] };
visable.value = true; visable.value = true;
}
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { config, onCommand, visable, data }; return { config, onCommand, visable, data };

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

@ -24,6 +24,9 @@ export default {
}); });
appListRef.value.tableLoading = true; appListRef.value.tableLoading = true;
const result = request(url, { invbillNum }, { method: "POST" }); const result = request(url, { invbillNum }, { method: "POST" });
if (!result.errors) {
await appListRef.value.load();
}
console.log(result); console.log(result);
} catch (e) { } catch (e) {
console.log(e); console.log(e);

16
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/vmi/log.js

@ -1,30 +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/inventory/log.js"; import useConfig from "../../../models/inventory/log.js";
import { reactive, ref } from "vue"; import { ref } from "vue";
import { schemaToModel } from "../../utils/index.js"; import { schemaToModel } from "../../utils/index.js";
import AppForm from "../../../components/form/index.js"; import AppForm from "../../../components/form/index.js";
import AppTable from "../../components/table/index.js"; import AppTable from "../../components/table/index.js";
import request, { get, getUrl, post } from "../../request/index.js"; import request, { getUrl } from "../../request/index.js";
export default { export default {
components: { AppList, AppTable, AppForm }, components: { AppList, AppTable, AppForm },
template: html` template: html`
<app-list :config="config" @command="onCommand" /> <app-list :config="config" @command="onCommand" />
<el-dialog v-model="addDialogVisible" align-center destroy-on-close style="width:380px;height:480px;"> <el-dialog v-model="addDialogVisible" align-center :close-on-click-modal="false" destroy-on-close style="width:380px;height:480px;">
<template #header>补货数据导出</template> <template #header>补货数据导出</template>
<el-scrollbar> <el-scrollbar>
<el-row> <el-row>
<el-col> <el-col>
<app-form <app-form ref="addAdjFormRef" v-if="addDialogVisible && adjModel" :schema="adjSchema" v-model="adjModel" :hideButton="true" inline @submit="submitAdj" />
ref="addAdjFormRef"
v-if="addDialogVisible && adjModel"
:schema="adjSchema"
v-model="adjModel"
:hideButton="true"
inline
@submit="submitAdj"
/>
</el-col> </el-col>
</el-row> </el-row>
</el-scrollbar> </el-scrollbar>

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

@ -1,6 +1,7 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Microsoft.AspNetCore.Http;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -96,6 +97,23 @@ public class BBAC_SA_DETAIL_DTO : EntityDto<Guid>
public string PartCode { get; set; } public string PartCode { get; set; }
} }
/// <summary>
/// BBAC结算导入请求
/// </summary>
public class BBACSaImportRequestDto
{
/// <summary>
/// 文件
/// </summary>
public IFormFileCollection Files { get; set; }
/// <summary>
/// 期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
}
/// <summary> /// <summary>
/// BBAC结算明细导入 /// BBAC结算明细导入
/// </summary> /// </summary>

238
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs

@ -1,7 +1,9 @@
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using System; using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -11,160 +13,238 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
public class BBAC_SE_DETAIL_DTO : EntityDto<Guid> public class BBAC_SE_DETAIL_DTO : EntityDto<Guid>
{ {
/// <summary> /// <summary>
/// 发货单号 /// 期间
/// </summary> /// </summary>
[Display(Name = "发货单号")] public int Version { set; get; }
public string WmsBillNum { get; set; }
/// <summary> /// <summary>
/// 单据编号 /// 发货时间
/// </summary> /// </summary>
[Display(Name = "单据编号")] public DateTime ShippingDate { set; get; }
public string Num { get; set; }
/// <summary> /// <summary>
/// 发货时间 /// 发运单号
/// </summary> /// </summary>
[Display(Name = "发货时间")] public string WmsBillNum { set; get; }
public DateTime BillTime { get; set; }
/// <summary> /// <summary>
/// 发货人 /// 客户零件号
/// </summary> /// </summary>
[Display(Name = "发货人")] public string LU { get; set; }
public string Oper { get; set; }
/// <summary> /// <summary>
/// 排序单 /// 厂内零件号
/// </summary> /// </summary>
[Display(Name = "排序单号")] public string FactoryPartCode { get; set; }
public string OrderNum { get; set; }
/// <summary> /// <summary>
/// 订单序 /// 生产号
/// </summary> /// </summary>
[Display(Name = "订单序号")] public string PN { get; set; }
public string Seq { get; set; }
/// <summary> /// <summary>
/// 实际生产码 /// 组合键值(PN+LU)
/// </summary> /// </summary>
[Display(Name = "实际生产码")] public string KeyCode { get; set; }
public string RealCode { get; set; }
/// <summary> /// <summary>
/// 订单生产码 /// 数量
/// </summary> /// </summary>
[Display(Name = "订单生产码")] public decimal Qty { get; set; }
/// <summary>
/// UID
/// </summary>
[Display(Name = "UID")]
[DisplayName("UID")]
public long UID { get; set; }
/// <summary>
/// JIT订单号
/// </summary>
[Display(Name = "JIT订单号")]
[DisplayName("JIT订单号")]
public string JISNum { get; set; }
/// <summary>
/// JIT排序生产码
/// </summary>
[Display(Name = "JIT排序生产码")]
public string VinCode { get; set; } public string VinCode { get; set; }
/// <summary> /// <summary>
/// 生产码类型 /// JIT排序生产码类型
/// </summary> /// </summary>
[Display(Name = "生产码类型")] [Display(Name = "JIT排序生产码类型")]
public string CodeType { get; set; } public string CodeType { get; set; }
/// <summary> /// <summary>
/// 实际零件号 /// 订单零件号
/// </summary> /// </summary>
[Display(Name = "实际零件号")] [Display(Name = "订单零件号")]
public string RealPartCode { get; set; } public string PartCode { get; set; }
/// <summary> /// <summary>
/// 零件号 /// 订单零件号
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "订单零件号")]
public string PartCode { get; set; } public string RealPartCode { get; set; }
/// <summary> /// <summary>
/// 批次 /// 批次
/// </summary> /// </summary>
[Display(Name = "批次")] [Display(Name = "批次")]
public string Batch { get; set; } public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary>
/// 订单序号
/// </summary>
[Display(Name = "订单序号")]
public string Seq { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary>
/// 发货条码
/// </summary>
[Display(Name = "发货条码")]
public string DeliverCode { get; set; }
/// <summary>
/// 发货单号
/// </summary>
[Display(Name = "发货单号")]
public string BillNum { get; set; }
/// <summary>
/// 发货时间
/// </summary>
[Display(Name = "发货时间")]
public DateTime? BillTime { get; set; }
/// <summary>
/// 发货人
/// </summary>
[Display(Name = "发货人")]
public string Oper { get; set; }
/// <summary>
/// 客户位置
/// </summary>
[Display(Name = "客户位置")]
public string Position { get; set; }
/// <summary>
/// 工厂
/// </summary>
[Display(Name = "工厂")]
public string Factory { get; set; }
/// <summary> /// <summary>
/// MES配置码 /// MES配置码
/// </summary> /// </summary>
[Display(Name = "MES配置码")] [Display(Name = "MES配置码")]
public string MESConfigCode { get; set; } public string MESConfigCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary> /// <summary>
/// 目标库位 /// 目标库位
/// </summary> /// </summary>
[Display(Name = "目标库位")] [Display(Name = "目标库位")]
public string ToLoc { get; set; } public string ToLoc { get; set; }
/// <summary> /// <summary>
/// 参照订单生产码 /// 单据类型
/// </summary> /// </summary>
[Display(Name = "参照订单生产码")] public EnumBillType BillType { get; set; }
public string RefVinCode { get; set; }
/// <summary> /// <summary>
/// 单据性质 /// 子单据类型
/// </summary> /// </summary>
[Display(Name = "单据性质")] [Display(Name = "子单据类型")]
public string BillCharacter { get; set; } public EnumSubBillType SubBillType { get; set; }
/// <summary> /// <summary>
/// 发货关联单号 /// 事务类型
/// </summary> /// </summary>
[Display(Name = "发货关联单号")] [Display(Name = "事务类型")]
public string RefBillNum { get; set; } public EnumDelTransType TransType { get; set; }
/// <summary> /// <summary>
/// Erp目标库位 /// 发运主类型
/// </summary> /// </summary>
[Display(Name = "Erp目标库位")] [Display(Name = "发运主类型")]
public string ErpToLoc { get; set; } public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
/// <summary>
/// 发运子类型
/// </summary>
[Display(Name = "发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
/// <summary>
/// 单据性质
/// </summary>
[Display(Name = "单据性质")]
public string BillCharacter { get; set; }
/// <summary> /// <summary>
/// 原生产码 /// 原生产码
/// </summary> /// </summary>
[Display(Name = "原生产码")] [Display(Name = "原生产码")]
public string OrigiCode { get; set; } public string OrigiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
[Display(Name = "描述")]
public string PartDesc { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
[Display(Name = "备注")] [Display(Name = "备注")]
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[Display(Name = "业务类型")]
public EnumProTpe ProType { get; set; }
/// <summary>
/// JIS排序单号
/// </summary>
[Display(Name = "JIS排序单号")]
public string OrderNum { get; set; }
/// <summary>
/// JIS实际生产码
/// </summary>
[Display(Name = "JIS实际生产码")]
public string RealCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary>
/// 参照订单生产码
/// </summary>
[Display(Name = "参照订单生产码")]
public string RefVinCode { get; set; }
/// <summary>
/// 发货关联单号
/// </summary>
[Display(Name = "发货关联单号")]
public string RefBillNum { get; set; }
/// <summary>
/// Erp目标库位
/// </summary>
[Display(Name = "Erp目标库位")]
public string ErpToLoc { get; set; }
/// <summary> /// <summary>
/// 塑件唯一码 /// 塑件唯一码
/// </summary> /// </summary>
[Display(Name = "塑件唯一码")] [Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; } public string UniqueCode { get; set; }
/// <summary> /// <summary>
/// PJS顺序号 /// PJS顺序号
/// </summary> /// </summary>
[Display(Name = "PJS顺序号")] [Display(Name = "PJS顺序号")]
public string PjsNum { get; set; } public string PjsNum { get; set; }
/// <summary> /// <summary>
/// 虚拟小总成 /// 虚拟小总成
/// </summary> /// </summary>
[Display(Name = "虚拟小总成")] [Display(Name = "虚拟小总成")]
public string MatchNumber { get; set; } public string MatchNumber { get; set; }
/// <summary> /// <summary>
/// 发货条码 /// 状态
/// </summary> /// </summary>
[Display(Name = "发货条码")] [Display(Name = "状态")]
public string DeliverCode { get; set; } public EnumBillState State { get; set; }
/// <summary> /// <summary>
/// 客户位置 /// 创建时间
/// </summary> /// </summary>
[Display(Name = "客户位置")] [Display(Name = "创建时间")]
public string Position { get; set; } public DateTime CreateTime { get; set; }
/// <summary>
/// 是否有EDI数据
/// </summary>
[Display(Name = "是否有EDI数据")]
public bool IsHaveEdiData { get; set; }
} }
/// <summary> /// <summary>

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

@ -1,6 +1,7 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Microsoft.AspNetCore.Http;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -96,6 +97,23 @@ public class HBPO_SA_DETAIL_DTO : EntityDto<Guid>
public string PartCode { get; set; } public string PartCode { get; set; }
} }
/// <summary>
/// HBPO结算导入请求
/// </summary>
public class HBPOSaImportRequestDto
{
/// <summary>
/// 文件
/// </summary>
public IFormFileCollection Files { get; set; }
/// <summary>
/// 期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
}
/// <summary> /// <summary>
/// HBPO结算明细导入 /// HBPO结算明细导入
/// </summary> /// </summary>

238
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs

@ -1,7 +1,9 @@
using System; using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -11,160 +13,238 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
public class HBPO_SE_DETAIL_DTO : EntityDto<Guid> public class HBPO_SE_DETAIL_DTO : EntityDto<Guid>
{ {
/// <summary> /// <summary>
/// 发货单号 /// 期间
/// </summary> /// </summary>
[Display(Name = "发货单号")] public int Version { set; get; }
public string WmsBillNum { get; set; }
/// <summary> /// <summary>
/// 单据编号 /// 发货时间
/// </summary> /// </summary>
[Display(Name = "单据编号")] public DateTime ShippingDate { set; get; }
public string Num { get; set; }
/// <summary> /// <summary>
/// 发货时间 /// 发运单号
/// </summary> /// </summary>
[Display(Name = "发货时间")] public string WmsBillNum { set; get; }
public DateTime BillTime { get; set; }
/// <summary> /// <summary>
/// 发货人 /// 客户零件号
/// </summary> /// </summary>
[Display(Name = "发货人")] public string LU { get; set; }
public string Oper { get; set; }
/// <summary> /// <summary>
/// 排序单 /// 厂内零件号
/// </summary> /// </summary>
[Display(Name = "排序单号")] public string FactoryPartCode { get; set; }
public string OrderNum { get; set; }
/// <summary> /// <summary>
/// 订单序 /// 生产号
/// </summary> /// </summary>
[Display(Name = "订单序号")] public string PN { get; set; }
public string Seq { get; set; }
/// <summary> /// <summary>
/// 实际生产码 /// 组合键值(PN+LU)
/// </summary> /// </summary>
[Display(Name = "实际生产码")] public string KeyCode { get; set; }
public string RealCode { get; set; }
/// <summary> /// <summary>
/// 订单生产码 /// 数量
/// </summary> /// </summary>
[Display(Name = "订单生产码")] public decimal Qty { get; set; }
/// <summary>
/// UID
/// </summary>
[Display(Name = "UID")]
[DisplayName("UID")]
public long UID { get; set; }
/// <summary>
/// JIT订单号
/// </summary>
[Display(Name = "JIT订单号")]
[DisplayName("JIT订单号")]
public string JISNum { get; set; }
/// <summary>
/// JIT排序生产码
/// </summary>
[Display(Name = "JIT排序生产码")]
public string VinCode { get; set; } public string VinCode { get; set; }
/// <summary> /// <summary>
/// 生产码类型 /// JIT排序生产码类型
/// </summary> /// </summary>
[Display(Name = "生产码类型")] [Display(Name = "JIT排序生产码类型")]
public string CodeType { get; set; } public string CodeType { get; set; }
/// <summary> /// <summary>
/// 实际零件号 /// 订单零件号
/// </summary> /// </summary>
[Display(Name = "实际零件号")] [Display(Name = "订单零件号")]
public string RealPartCode { get; set; } public string PartCode { get; set; }
/// <summary> /// <summary>
/// 零件号 /// 订单零件号
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "订单零件号")]
public string PartCode { get; set; } public string RealPartCode { get; set; }
/// <summary> /// <summary>
/// 批次 /// 批次
/// </summary> /// </summary>
[Display(Name = "批次")] [Display(Name = "批次")]
public string Batch { get; set; } public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary>
/// 订单序号
/// </summary>
[Display(Name = "订单序号")]
public string Seq { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary>
/// 发货条码
/// </summary>
[Display(Name = "发货条码")]
public string DeliverCode { get; set; }
/// <summary>
/// 发货单号
/// </summary>
[Display(Name = "发货单号")]
public string BillNum { get; set; }
/// <summary>
/// 发货时间
/// </summary>
[Display(Name = "发货时间")]
public DateTime? BillTime { get; set; }
/// <summary>
/// 发货人
/// </summary>
[Display(Name = "发货人")]
public string Oper { get; set; }
/// <summary>
/// 客户位置
/// </summary>
[Display(Name = "客户位置")]
public string Position { get; set; }
/// <summary>
/// 工厂
/// </summary>
[Display(Name = "工厂")]
public string Factory { get; set; }
/// <summary> /// <summary>
/// MES配置码 /// MES配置码
/// </summary> /// </summary>
[Display(Name = "MES配置码")] [Display(Name = "MES配置码")]
public string MESConfigCode { get; set; } public string MESConfigCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary> /// <summary>
/// 目标库位 /// 目标库位
/// </summary> /// </summary>
[Display(Name = "目标库位")] [Display(Name = "目标库位")]
public string ToLoc { get; set; } public string ToLoc { get; set; }
/// <summary> /// <summary>
/// 参照订单生产码 /// 单据类型
/// </summary> /// </summary>
[Display(Name = "参照订单生产码")] public EnumBillType BillType { get; set; }
public string RefVinCode { get; set; }
/// <summary> /// <summary>
/// 单据性质 /// 子单据类型
/// </summary> /// </summary>
[Display(Name = "单据性质")] [Display(Name = "子单据类型")]
public string BillCharacter { get; set; } public EnumSubBillType SubBillType { get; set; }
/// <summary> /// <summary>
/// 发货关联单号 /// 事务类型
/// </summary> /// </summary>
[Display(Name = "发货关联单号")] [Display(Name = "事务类型")]
public string RefBillNum { get; set; } public EnumDelTransType TransType { get; set; }
/// <summary> /// <summary>
/// Erp目标库位 /// 发运主类型
/// </summary> /// </summary>
[Display(Name = "Erp目标库位")] [Display(Name = "发运主类型")]
public string ErpToLoc { get; set; } public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
/// <summary>
/// 发运子类型
/// </summary>
[Display(Name = "发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
/// <summary>
/// 单据性质
/// </summary>
[Display(Name = "单据性质")]
public string BillCharacter { get; set; }
/// <summary> /// <summary>
/// 原生产码 /// 原生产码
/// </summary> /// </summary>
[Display(Name = "原生产码")] [Display(Name = "原生产码")]
public string OrigiCode { get; set; } public string OrigiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
[Display(Name = "描述")]
public string PartDesc { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
[Display(Name = "备注")] [Display(Name = "备注")]
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[Display(Name = "业务类型")]
public EnumProTpe ProType { get; set; }
/// <summary>
/// JIS排序单号
/// </summary>
[Display(Name = "JIS排序单号")]
public string OrderNum { get; set; }
/// <summary>
/// JIS实际生产码
/// </summary>
[Display(Name = "JIS实际生产码")]
public string RealCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary>
/// 参照订单生产码
/// </summary>
[Display(Name = "参照订单生产码")]
public string RefVinCode { get; set; }
/// <summary>
/// 发货关联单号
/// </summary>
[Display(Name = "发货关联单号")]
public string RefBillNum { get; set; }
/// <summary>
/// Erp目标库位
/// </summary>
[Display(Name = "Erp目标库位")]
public string ErpToLoc { get; set; }
/// <summary> /// <summary>
/// 塑件唯一码 /// 塑件唯一码
/// </summary> /// </summary>
[Display(Name = "塑件唯一码")] [Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; } public string UniqueCode { get; set; }
/// <summary> /// <summary>
/// PJS顺序号 /// PJS顺序号
/// </summary> /// </summary>
[Display(Name = "PJS顺序号")] [Display(Name = "PJS顺序号")]
public string PjsNum { get; set; } public string PjsNum { get; set; }
/// <summary> /// <summary>
/// 虚拟小总成 /// 虚拟小总成
/// </summary> /// </summary>
[Display(Name = "虚拟小总成")] [Display(Name = "虚拟小总成")]
public string MatchNumber { get; set; } public string MatchNumber { get; set; }
/// <summary> /// <summary>
/// 发货条码 /// 状态
/// </summary> /// </summary>
[Display(Name = "发货条码")] [Display(Name = "状态")]
public string DeliverCode { get; set; } public EnumBillState State { get; set; }
/// <summary> /// <summary>
/// 客户位置 /// 创建时间
/// </summary> /// </summary>
[Display(Name = "客户位置")] [Display(Name = "创建时间")]
public string Position { get; set; } public DateTime CreateTime { get; set; }
/// <summary>
/// 是否有EDI数据
/// </summary>
[Display(Name = "是否有EDI数据")]
public bool IsHaveEdiData { get; set; }
} }
/// <summary> /// <summary>

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

@ -244,6 +244,13 @@ public class BeiJianImportDto : BeiJianExtraImportDto
[ImporterHeader(Name = "凭证号")] [ImporterHeader(Name = "凭证号")]
[Required(ErrorMessage = "{0}不能为空")] [Required(ErrorMessage = "{0}不能为空")]
public string GroupNum { get; set; } public string GroupNum { get; set; }
/// <summary>
/// 采购订单号
/// </summary>
[Display(Name = "采购订单号")]
[ImporterHeader(Name = "采购订单号")]
public string Extend3 { get; set; }
} }
/// <summary> /// <summary>
@ -286,13 +293,6 @@ public class BeiJianExtraImportDto
[ImporterHeader(Name = "供应商名称")] [ImporterHeader(Name = "供应商名称")]
public string VendorName { set; get; } public string VendorName { set; get; }
/// <summary>
/// 采购订单号
/// </summary>
[Display(Name = "采购订单号")]
[ImporterHeader(Name = "采购订单号")]
public string PurchaseOrderNumber { set; get; }
/// <summary> /// <summary>
/// 交付索引号 /// 交付索引号
/// </summary> /// </summary>

275
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs

@ -3,6 +3,7 @@ using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -11,113 +12,184 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
/// </summary> /// </summary>
public class PUB_SE_DETAIL_DTO : EntityDto<Guid> public class PUB_SE_DETAIL_DTO : EntityDto<Guid>
{ {
/// <summary>
/// 期间
/// </summary>
public int Version { set; get; }
/// <summary>
/// 发货时间
/// </summary>
public DateTime ShippingDate { set; get; }
/// <summary>
/// 发运单号
/// </summary>
public string WmsBillNum { set; get; }
/// <summary>
/// 客户零件号
/// </summary>
public string LU { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
public string FactoryPartCode { get; set; }
/// <summary>
/// 生产号
/// </summary>
public string PN { get; set; }
/// <summary>
/// 组合键值(PN+LU)
/// </summary>
public string KeyCode { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { get; set; }
/// <summary>
/// UID
/// </summary>
[Display(Name = "UID")]
[DisplayName("UID")]
public long UID { get; set; }
/// <summary> /// <summary>
/// 发货单号 /// 发货单号
/// </summary> /// </summary>
[Display(Name = "发货单号")] [Display(Name = "发货单号")]
public string WmsBillNum { get; set; } public string BillNum { get; set; }
/// <summary> /// <summary>
/// 发货时间 /// 发货时间
/// </summary> /// </summary>
[DisplayName("发货时间")] [Display(Name = "发货时间")]
public DateTime BillTime { get; set; } public DateTime BillTime { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary> /// <summary>
/// 零件号 /// 零件号
/// </summary> /// </summary>
[DisplayName("零件号")] [Display(Name = "零件号")]
public string PartCode { get; set; } public string PartCode { get; set; }
/// <summary> /// <summary>
/// 批次 /// 批次
/// </summary> /// </summary>
[DisplayName("批次")] [Display(Name = "批次")]
public string Batch { get; set; } public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary> /// <summary>
/// 发货人 /// 发货人
/// </summary> /// </summary>
[DisplayName("发货人")] [Display(Name = "发货人")]
public string Oper { get; set; } public string Oper { get; set; }
/// <summary> /// <summary>
/// DN单据号 /// DN单据号
/// </summary> /// </summary>
[DisplayName("DN单据号")] [Display(Name = "DN单据号")]
public string DnBillNum { get; set; } public string DnBillNum { get; set; }
/// <summary> /// <summary>
/// DN单据时间 /// DN单据时间
/// </summary> /// </summary>
[DisplayName("DN单据时间")] [Display(Name = "DN单据时间")]
public DateTime DnBillTime { get; set; } public DateTime DnBillTime { get; set; }
/// <summary> /// <summary>
/// DN单添加人 /// DN单添加人
/// </summary> /// </summary>
[DisplayName("DN单添加人")] [Display(Name = "DN单添加人")]
public string DnOper { get; set; } public string DnOper { get; set; }
/// <summary> /// <summary>
/// 交付索引 /// 交付索引
/// </summary> /// </summary>
[DisplayName("交付索引")] [Display(Name = "交付索引")]
public string DeliveryIndex { get; set; } public string DeliveryIndex { get; set; }
/// <summary> /// <summary>
/// 客户 /// 客户
/// </summary> /// </summary>
[DisplayName("客户")] [Display(Name = "客户")]
public string CustId { get; set; } public string CustId { get; set; }
/// <summary> /// <summary>
/// 发货仓库 /// 发货仓库
/// </summary> /// </summary>
[DisplayName("发货仓库")] [Display(Name = "发货仓库")]
public string DeliveryHose { get; set; } public string DeliveryHose { get; set; }
/// <summary> /// <summary>
/// 来源库位 /// 来源库位
/// </summary> /// </summary>
[DisplayName("来源库位")] [Display(Name = "来源库位")]
public string FromLocCode { get; set; } public string FromLocCode { get; set; }
/// <summary> /// <summary>
/// 来源仓库 /// 来源仓库
/// </summary> /// </summary>
[DisplayName("来源仓库")] [Display(Name = "来源仓库")]
public string FromHose { get; set; } public string FromHose { get; set; }
/// <summary> /// <summary>
/// 来源ERP库存 /// 来源ERP库存
/// </summary> /// </summary>
[DisplayName("来源ERP库存")] [Display(Name = "来源ERP库存")]
public string FromErpLocCode { get; set; } public string FromErpLocCode { get; set; }
/// <summary> /// <summary>
/// 目标库位 /// 目标库位
/// </summary> /// </summary>
[DisplayName("目标库位")] [Display(Name = "目标库位")]
public string ToLocCode { get; set; } public string ToLocCode { get; set; }
/// <summary>
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
public string ToHose { get; set; }
/// <summary> /// <summary>
/// 目标Erp库位 /// 目标Erp库位
/// </summary> /// </summary>
[DisplayName("目标Erp库位")] [Display(Name = "目标Erp库位")]
public string ToErpLocCode { get; set; } public string ToErpLocCode { get; set; }
/// <summary> /// <summary>
/// 目标仓库 /// 状态
/// </summary> /// </summary>
[DisplayName("目标仓库")] [Display(Name = "状态")]
public string ToHose { get; set; } public EnumBillState State { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
[DisplayName("备注")] [Display(Name = "备注")]
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 单据类型
/// </summary>
[Display(Name = "单据类型")]
public EnumBillType BillType { get; set; }
/// <summary>
/// 子单据类型
/// </summary>
[Display(Name = "子单据类型")]
public EnumSubBillType SubBillType { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[Display(Name = "业务类型")]
public EnumProTpe ProType { get; set; }
/// <summary>
/// 事务类型
/// </summary>
[Display(Name = "事务类型")]
public EnumDelTransType TransType { get; set; }
/// <summary>
/// 发运主类型
/// </summary>
[Display(Name = "发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
/// <summary>
/// 发运子类型
/// </summary>
[Display(Name = "发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Display(Name = "创建时间")]
public DateTime CreateTime { get; set; }
} }
/// <summary> /// <summary>
@ -136,129 +208,182 @@ public class PUB_SE_DETAIL_RequestDto : RequestDto
/// </summary> /// </summary>
public class PUB_SE_DETAIL_EXPORT_DTO public class PUB_SE_DETAIL_EXPORT_DTO
{ {
/// <summary>
/// 期间
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public int Version { set; get; }
/// <summary>
/// 发货时间
/// </summary>
[ExporterHeader(DisplayName = "发货时间")]
public DateTime ShippingDate { set; get; }
/// <summary>
/// 发运单号
/// </summary>
[ExporterHeader(DisplayName = "发运单号")]
public string WmsBillNum { set; get; }
/// <summary>
/// 客户零件号
/// </summary>
[ExporterHeader(DisplayName = "客户零件号")]
public string LU { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
[ExporterHeader(DisplayName = "厂内零件号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 生产号
/// </summary>
[ExporterHeader(DisplayName = "生产号")]
public string PN { get; set; }
/// <summary>
/// 组合键值(PN+LU)
/// </summary>
[ExporterHeader(DisplayName = "组合键值")]
public string KeyCode { get; set; }
/// <summary>
/// 数量
/// </summary>
[ExporterHeader(DisplayName = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// UID
/// </summary>
[Display(Name = "UID")]
[ExporterHeader(DisplayName = "UID")]
public long UID { get; set; }
/// <summary> /// <summary>
/// 发货单号 /// 发货单号
/// </summary> /// </summary>
[Display(Name = "发货单号")] [Display(Name = "发货单号")]
[ExporterHeader(DisplayName = "发货单号")] [ExporterHeader(DisplayName = "发货单号")]
public string WmsBillNum { get; set; } public string BillNum { get; set; }
/// <summary> /// <summary>
/// 发货时间 /// 发货时间
/// </summary> /// </summary>
[DisplayName("发货时间")] [Display(Name = "发货时间")]
[ExporterHeader(DisplayName = "发货时间")] [ExporterHeader(DisplayName = "发货时间")]
public DateTime BillTime { get; set; } public DateTime BillTime { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
[ExporterHeader(DisplayName = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary> /// <summary>
/// 零件号 /// 零件号
/// </summary> /// </summary>
[DisplayName("零件号")] [Display(Name = "零件号")]
[ExporterHeader(DisplayName = "零件号")] [ExporterHeader(DisplayName = "零件号")]
public string PartCode { get; set; } public string PartCode { get; set; }
/// <summary> /// <summary>
/// 批次 /// 批次
/// </summary> /// </summary>
[DisplayName("批次")] [Display(Name = "批次")]
[ExporterHeader(DisplayName = "批次")] [ExporterHeader(DisplayName = "批次")]
public string Batch { get; set; } public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary> /// <summary>
/// 发货人 /// 发货人
/// </summary> /// </summary>
[DisplayName("发货人")] [Display(Name = "发货人")]
[ExporterHeader(DisplayName = "发货人")] [ExporterHeader(DisplayName = "发货人")]
public string Oper { get; set; } public string Oper { get; set; }
/// <summary> /// <summary>
/// DN单据号 /// DN单据号
/// </summary> /// </summary>
[DisplayName("DN单据号")] [Display(Name = "DN单据号")]
[ExporterHeader(DisplayName = "DN单据号")] [ExporterHeader(DisplayName = "DN单据号")]
public string DnBillNum { get; set; } public string DnBillNum { get; set; }
/// <summary> /// <summary>
/// DN单据时间 /// DN单据时间
/// </summary> /// </summary>
[DisplayName("DN单据时间")] [Display(Name = "DN单据时间")]
[ExporterHeader(DisplayName = "DN单据时间")] [ExporterHeader(DisplayName = "DN单据时间")]
public DateTime DnBillTime { get; set; } public DateTime DnBillTime { get; set; }
/// <summary> /// <summary>
/// DN单添加人 /// DN单添加人
/// </summary> /// </summary>
[DisplayName("DN单添加人")] [Display(Name = "DN单添加人")]
[ExporterHeader(DisplayName = "DN单添加人")] [ExporterHeader(DisplayName = "DN单添加人")]
public string DnOper { get; set; } public string DnOper { get; set; }
/// <summary> /// <summary>
/// 交付索引 /// 交付索引
/// </summary> /// </summary>
[DisplayName("交付索引")] [Display(Name = "交付索引")]
[ExporterHeader(DisplayName = "交付索引")] [ExporterHeader(DisplayName = "交付索引")]
public string DeliveryIndex { get; set; } public string DeliveryIndex { get; set; }
/// <summary> /// <summary>
/// 客户 /// 客户
/// </summary> /// </summary>
[DisplayName("客户")] [Display(Name = "客户")]
[ExporterHeader(DisplayName = "客户")] [ExporterHeader(DisplayName = "客户")]
public string CustId { get; set; } public string CustId { get; set; }
/// <summary> /// <summary>
/// 发货仓库 /// 发货仓库
/// </summary> /// </summary>
[DisplayName("发货仓库")] [Display(Name = "发货仓库")]
[ExporterHeader(DisplayName = "发货仓库")] [ExporterHeader(DisplayName = "发货仓库")]
public string DeliveryHose { get; set; } public string DeliveryHose { get; set; }
/// <summary> /// <summary>
/// 来源库位 /// 来源库位
/// </summary> /// </summary>
[DisplayName("来源库位")] [Display(Name = "来源库位")]
[ExporterHeader(DisplayName = "来源库位")] [ExporterHeader(DisplayName = "来源库位")]
public string FromLocCode { get; set; } public string FromLocCode { get; set; }
/// <summary> /// <summary>
/// 来源仓库 /// 来源仓库
/// </summary> /// </summary>
[DisplayName("来源仓库")] [Display(Name = "来源仓库")]
[ExporterHeader(DisplayName = "来源仓库")] [ExporterHeader(DisplayName = "来源仓库")]
public string FromHose { get; set; } public string FromHose { get; set; }
/// <summary> /// <summary>
/// 来源ERP库存 /// 来源ERP库存
/// </summary> /// </summary>
[DisplayName("来源ERP库存")] [Display(Name = "来源ERP库存")]
[ExporterHeader(DisplayName = "来源ERP库存")] [ExporterHeader(DisplayName = "来源ERP库存")]
public string FromErpLocCode { get; set; } public string FromErpLocCode { get; set; }
/// <summary> /// <summary>
/// 目标库位 /// 目标库位
/// </summary> /// </summary>
[DisplayName("目标库位")] [Display(Name = "目标库位")]
[ExporterHeader(DisplayName = "目标库位")] [ExporterHeader(DisplayName = "目标库位")]
public string ToLocCode { get; set; } public string ToLocCode { get; set; }
/// <summary>
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
[ExporterHeader(DisplayName = "目标仓库")]
public string ToHose { get; set; }
/// <summary> /// <summary>
/// 目标Erp库位 /// 目标Erp库位
/// </summary> /// </summary>
[DisplayName("目标Erp库位")] [Display(Name = "目标Erp库位")]
[ExporterHeader(DisplayName = "目标Erp库位")] [ExporterHeader(DisplayName = "目标Erp库位")]
public string ToErpLocCode { get; set; } public string ToErpLocCode { get; set; }
/// <summary> /// <summary>
/// 目标仓库 /// 状态
/// </summary> /// </summary>
[DisplayName("目标仓库")] [Display(Name = "状态")]
[ExporterHeader(DisplayName = "目标仓库")] [ExporterHeader(DisplayName = "状态")]
public string ToHose { get; set; } public EnumBillState State { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
[DisplayName("备注")] [Display(Name = "备注")]
[ExporterHeader(DisplayName = "备注")] [ExporterHeader(DisplayName = "备注")]
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Display(Name = "创建时间")]
[ExporterHeader(DisplayName = "创建时间")]
public DateTime CreateTime { get; set; }
} }

5
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs

@ -126,11 +126,6 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships
/// 文件 /// 文件
/// </summary> /// </summary>
public IFormFileCollection Files { get; set; } public IFormFileCollection Files { get; set; }
/// <summary>
/// 是否是备件
/// </summary>
public bool IsBj { get; set; }
} }
/// <summary> /// <summary>

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

@ -111,11 +111,11 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files) public async Task<IActionResult> ImportAsync([FromForm] BBACSaImportRequestDto bbacSaImportRequestDto)
{ {
#region 导入数据转换、数据校验 #region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var importDtos = await _exportImporter.UploadExcelImport<BBAC_SA_DETAIL_IMPORT_DTO>(files, _excelImportService).ConfigureAwait(false); var importDtos = await _exportImporter.UploadExcelImport<BBAC_SA_DETAIL_IMPORT_DTO>(bbacSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false);
importDtos.ForEach(importDto => importDtos.ForEach(importDto =>
{ {
@ -127,6 +127,11 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
var importBBACSaDetails = ObjectMapper.Map<List<BBAC_SA_DETAIL_IMPORT_DTO>, List<BBAC_SA_DETAIL>>(importDtos); var importBBACSaDetails = ObjectMapper.Map<List<BBAC_SA_DETAIL_IMPORT_DTO>, List<BBAC_SA_DETAIL>>(importDtos);
importBBACSaDetails.ForEach(importBBACSaDetail =>
{
importBBACSaDetail.Version = bbacSaImportRequestDto.Version;
});
//数据校验 //数据校验
var checkList = new List<ErrorExportDto>(); var checkList = new List<ErrorExportDto>();
//结算分组号 //结算分组号
@ -269,7 +274,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
} }
if (bbacSaDetails.Any()) if (bbacSaDetails.Any())
{ {
await _bbacSaDetailRepository.DeleteManyAsync(bbacSaDetails); await _bbacSaDetailRepository.DbContext.BulkDeleteAsync(bbacSaDetails);
} }
if (bbacCanSas.Any()) if (bbacCanSas.Any())
{ {
@ -277,11 +282,11 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
} }
if (bbacCanSaDetails.Any()) if (bbacCanSaDetails.Any())
{ {
await _bbacCanSaDetailRepository.DeleteManyAsync(bbacCanSaDetails); await _bbacCanSaDetailRepository.DbContext.BulkDeleteAsync(bbacCanSaDetails);
} }
if (bbacNotSaDetails.Any()) if (bbacNotSaDetails.Any())
{ {
await _bbacNotSaDetailRepository.DeleteManyAsync(bbacNotSaDetails); await _bbacNotSaDetailRepository.DbContext.BulkDeleteAsync(bbacNotSaDetails);
} }
} }
#endregion #endregion
@ -358,7 +363,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
noExistSettleMaterialCodes.ForEach(t => noExistSettleMaterialCodes.ForEach(t =>
{ {
var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType.ToString()); var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType);
materialRelationships.Add(materialRelationship); materialRelationships.Add(materialRelationship);
}); });

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

@ -109,13 +109,18 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files) public async Task<IActionResult> ImportAsync([FromForm] HBPOSaImportRequestDto hbpoSaImportRequestDto)
{ {
#region 导入数据转换、数据校验 #region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<HBPO_SA_DETAIL_IMPORT_DTO>(files, _excelImportService); var result = await _exportImporter.UploadExcelImport<HBPO_SA_DETAIL_IMPORT_DTO>(hbpoSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false);
var importHBOPSaDetails = ObjectMapper.Map<List<HBPO_SA_DETAIL_IMPORT_DTO>, List<HBPO_SA_DETAIL>>(result); var importHBOPSaDetails = ObjectMapper.Map<List<HBPO_SA_DETAIL_IMPORT_DTO>, List<HBPO_SA_DETAIL>>(result);
importHBOPSaDetails.ForEach(importHBOPSaDetail =>
{
importHBOPSaDetail.Version = hbpoSaImportRequestDto.Version;
});
//Site包含CN1 亦庄 //Site包含CN1 亦庄
//Site包含CN5 顺义 //Site包含CN5 顺义
var importCN1HBOPSaDetails = importHBOPSaDetails.FindAll(t => t.Site.Contains("CN1")); var importCN1HBOPSaDetails = importHBOPSaDetails.FindAll(t => t.Site.Contains("CN1"));
@ -267,7 +272,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
} }
if (hbpoSaDetails.Any()) if (hbpoSaDetails.Any())
{ {
await _hbpoSaDetailRepository.DeleteManyAsync(hbpoSaDetails); await _hbpoSaDetailRepository.DbContext.BulkDeleteAsync(hbpoSaDetails);
} }
if (hbpoCanSas.Any()) if (hbpoCanSas.Any())
{ {
@ -275,11 +280,11 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
} }
if (hbpoCanSaDetails.Any()) if (hbpoCanSaDetails.Any())
{ {
await _hbpoCanSaDetailRepository.DeleteManyAsync(hbpoCanSaDetails); await _hbpoCanSaDetailRepository.DbContext.BulkDeleteAsync(hbpoCanSaDetails);
} }
if (hbpoNotSaDetails.Any()) if (hbpoNotSaDetails.Any())
{ {
await _hbpoNotSaDetailRepository.DeleteManyAsync(hbpoNotSaDetails); await _hbpoNotSaDetailRepository.DbContext.BulkDeleteAsync(hbpoNotSaDetails);
} }
} }
#endregion #endregion
@ -358,14 +363,14 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
noExistSettleMaterialCodes.ForEach(t => noExistSettleMaterialCodes.ForEach(t =>
{ {
var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType.ToString()); var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType);
materialRelationships.Add(materialRelationship); materialRelationships.Add(materialRelationship);
}); });
var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships); var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships);
hbpoSaDetails.ForEach(hbpoSaDetail => hbpoSaDetails.ForEach(hbpoSaDetail =>
{ {
hbpoSaDetail.PartCode = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.LU)?.ErpMaterialCode ?? hbpoSaDetail.LU.Replace(" ", "-"); hbpoSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.LU)?.ErpMaterialCode ?? hbpoSaDetail.LU.Replace(" ", "-");
}); });
#endregion #endregion

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

@ -522,7 +522,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
noExistSettleMaterialCodes.ForEach(t => noExistSettleMaterialCodes.ForEach(t =>
{ {
var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, businessType.ToString()); var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, businessType);
materialRelationships.Add(materialRelationship); materialRelationships.Add(materialRelationship);
}); });

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs

@ -24,11 +24,12 @@ public class BeiSeSyncAppService : JitSeSyncAppService, IJobService
/// </summary> /// </summary>
public BeiSeSyncAppService( public BeiSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs

@ -36,10 +36,10 @@ public class HandSeSyncAppService : ApplicationService
EnumBusinessType.JisHBPO => scope.ServiceProvider.GetRequiredService<JisHBPOSeSyncAppService>(), EnumBusinessType.JisHBPO => scope.ServiceProvider.GetRequiredService<JisHBPOSeSyncAppService>(),
EnumBusinessType.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService<MaiDanBBACSeSyncAppService>(), EnumBusinessType.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService<MaiDanBBACSeSyncAppService>(),
EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService<MaiDanHBPOSeSyncAppService>(), EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService<MaiDanHBPOSeSyncAppService>(),
EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(), //EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(),
EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(), EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService<ZhiGongHBPOSeSyncAppService>(),
EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService<BeiSeSyncAppService>(), //EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService<BeiSeSyncAppService>(),
EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService<YinDuSeSyncAppService>(), //EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService<YinDuSeSyncAppService>(),
_ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"), _ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"),
}; };
await jitSeSyncAppService.Invoke().ConfigureAwait(false); await jitSeSyncAppService.Invoke().ConfigureAwait(false);

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

@ -5,7 +5,6 @@ using System.Threading.Tasks;
using Coravel.Invocable; using Coravel.Invocable;
using LinqToDB; using LinqToDB;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs

@ -23,11 +23,12 @@ public class JisBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService
/// </summary> /// </summary>
public JisBBACSeSyncAppService( public JisBBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> jisSeDetailRepository, INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

49
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs

@ -26,6 +26,11 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 数据上下文
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary> /// <summary>
/// 同步位置标记 /// 同步位置标记
/// </summary> /// </summary>
@ -48,12 +53,14 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
public JisBBACSeSyncBaseAppService( public JisBBACSeSyncBaseAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> jisSeDetailRepository, INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService) VmiAppService vmiService)
{ {
_wmsBJBMPTContext = wmsBJBMPTContext; _wmsBJBMPTContext = wmsBJBMPTContext;
_settleAccountDbContext = settleAccountDbContext;
_syncPositionFlagRepository = syncPositionFlagRepository; _syncPositionFlagRepository = syncPositionFlagRepository;
_jisSeDetailRepository = jisSeDetailRepository; _jisSeDetailRepository = jisSeDetailRepository;
_materialRelationshipManager = materialRelationshipManager; _materialRelationshipManager = materialRelationshipManager;
@ -73,7 +80,7 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
return; return;
} }
await SyncJitRecordAsync().ConfigureAwait(false); await SyncJitRecordAsync().ConfigureAwait(false);
await CurrentUnitOfWork.SaveChangesAsync().ConfigureAwait(false); await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false);
await SyncJisRecordAsync().ConfigureAwait(false); await SyncJisRecordAsync().ConfigureAwait(false);
} }
@ -107,8 +114,8 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any()) if (luRePartCodes.Any())
{ {
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
} }
jisSeDetails.ForEach(t => jisSeDetails.ForEach(t =>
@ -116,8 +123,12 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
t.SetId(GuidGenerator.Create()); t.SetId(GuidGenerator.Create());
t.BusinessType = businessType; t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU; t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{
t.Version = int.Parse(t.BillTime?.ToString("yyyyMM"));
}
}); });
await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); await _settleAccountDbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
@ -166,8 +177,8 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any()) if (luRePartCodes.Any())
{ {
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
} }
jisSeDetails.ForEach(t => jisSeDetails.ForEach(t =>
@ -175,8 +186,12 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
t.SetId(GuidGenerator.Create()); t.SetId(GuidGenerator.Create());
t.BusinessType = businessType; t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU; t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{
t.Version = int.Parse(t.BillTime?.ToString("yyyyMM"));
}
}); });
await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); await _settleAccountDbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
@ -194,4 +209,24 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
} }
} }
} }
/// <summary>
/// 添加零件关系
/// </summary>
public async Task AddNewMaterialRelationships(IEnumerable<MaterialRelationship> materialRelationships)
{
//新客户零件号和厂内零件号
var noHaveLuRePartCodes = from item1 in materialRelationships
join item2 in _settleAccountDbContext.Set<MaterialRelationship>()
on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode }
into temp
from item3 in temp.DefaultIfEmpty()
where item3 == null
select item1;
if (noHaveLuRePartCodes.Any())
{
await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false);
}
}
} }

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs

@ -23,11 +23,12 @@ public class JisHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService
/// </summary> /// </summary>
public JisHBPOSeSyncAppService( public JisHBPOSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> jisSeDetailRepository, INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

51
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs

@ -27,6 +27,11 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 数据上下文
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary> /// <summary>
/// 同步位置标记 /// 同步位置标记
/// </summary> /// </summary>
@ -49,12 +54,14 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
public JisHBPOSeSyncBaseAppService( public JisHBPOSeSyncBaseAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> jisSeDetailRepository, INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService) VmiAppService vmiService)
{ {
_wmsBJBMPTContext = wmsBJBMPTContext; _wmsBJBMPTContext = wmsBJBMPTContext;
_settleAccountDbContext = settleAccountDbContext;
_syncPositionFlagRepository = syncPositionFlagRepository; _syncPositionFlagRepository = syncPositionFlagRepository;
_jisSeDetailRepository = jisSeDetailRepository; _jisSeDetailRepository = jisSeDetailRepository;
_materialRelationshipManager = materialRelationshipManager; _materialRelationshipManager = materialRelationshipManager;
@ -74,7 +81,7 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
return; return;
} }
await SyncJitRecordAsync().ConfigureAwait(false); await SyncJitRecordAsync().ConfigureAwait(false);
await CurrentUnitOfWork.SaveChangesAsync().ConfigureAwait(false); await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false);
await SyncJisRecordAsync().ConfigureAwait(false); await SyncJisRecordAsync().ConfigureAwait(false);
} }
@ -109,8 +116,8 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any()) if (luRePartCodes.Any())
{ {
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
} }
jisSeDetails.ForEach(t => jisSeDetails.ForEach(t =>
@ -118,8 +125,12 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
t.SetId(GuidGenerator.Create()); t.SetId(GuidGenerator.Create());
t.BusinessType = businessType; t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU; t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{
t.Version = int.Parse(t.BillTime?.ToString("YYYYMM"));
}
}); });
await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); await _settleAccountDbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
@ -169,8 +180,8 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any()) if (luRePartCodes.Any())
{ {
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
} }
jisSeDetails.ForEach(t => jisSeDetails.ForEach(t =>
@ -178,8 +189,12 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
t.SetId(GuidGenerator.Create()); t.SetId(GuidGenerator.Create());
t.BusinessType = businessType; t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU; t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{
t.Version = int.Parse(t.BillTime?.ToString("yyyyMM"));
}
}); });
await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); await _settleAccountDbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
@ -193,8 +208,28 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
TableName = syncTableName, TableName = syncTableName,
Position = wmsRecords.Last().UID.ToString() Position = wmsRecords.Last().UID.ToString()
}; };
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false); ; await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false);
} }
} }
} }
/// <summary>
/// 添加零件关系
/// </summary>
public async Task AddNewMaterialRelationships(IEnumerable<MaterialRelationship> materialRelationships)
{
//新客户零件号和厂内零件号
var noHaveLuRePartCodes = from item1 in materialRelationships
join item2 in _settleAccountDbContext.Set<MaterialRelationship>()
on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode }
into temp
from item3 in temp.DefaultIfEmpty()
where item3 == null
select item1;
if (noHaveLuRePartCodes.Any())
{
await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false);
}
}
} }

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

@ -5,14 +5,16 @@ using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Coravel.Invocable; using Coravel.Invocable;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using LinqToDB;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.CurrentBranch;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
@ -28,6 +30,11 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 数据上下文
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary> /// <summary>
/// 同步位置标记 /// 同步位置标记
/// </summary> /// </summary>
@ -50,12 +57,14 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
public JitSeSyncAppService( public JitSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService) VmiAppService vmiService)
{ {
_wmsBJBMPTContext = wmsBJBMPTContext; _wmsBJBMPTContext = wmsBJBMPTContext;
_settleAccountDbContext = settleAccountDbContext;
_syncPositionFlagRepository = syncPositionFlagRepository; _syncPositionFlagRepository = syncPositionFlagRepository;
_pubSeDetailRepository = pubSeDetailRepository; _pubSeDetailRepository = pubSeDetailRepository;
_materialRelationshipManager = materialRelationshipManager; _materialRelationshipManager = materialRelationshipManager;
@ -94,12 +103,17 @@ 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())
{ {
if (businessType != EnumBusinessType.BeiJian)
{
//备件以外其他业务添加客户零件号与厂内零件号关系
//客户零件号和厂内零件号 //客户零件号和厂内零件号
var luRePartCodes = pubSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); var luRePartCodes = pubSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any()) if (luRePartCodes.Any())
{ {
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
//await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
} }
pubSeDetails.ForEach(t => pubSeDetails.ForEach(t =>
@ -107,8 +121,12 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
t.SetId(GuidGenerator.Create()); t.SetId(GuidGenerator.Create());
t.BusinessType = businessType; t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU; t.KeyCode = t.PN + t.LU;
if (t.BillTime != null)
{
t.Version = int.Parse(t.BillTime?.ToString("yyyyMM"));
}
}); });
await _pubSeDetailRepository.DbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false); await _settleAccountDbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
@ -137,7 +155,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
CodeType = default, CodeType = default,
BillType = pubSeDetail.DeliverBillType, BillType = pubSeDetail.DeliverBillType,
Qty = pubSeDetail.Qty, Qty = pubSeDetail.Qty,
BillTime = pubSeDetail.BillTime, BillTime = pubSeDetail.BillTime ?? new DateTime(),
DeliverTime = pubSeDetail.AssembleData, DeliverTime = pubSeDetail.AssembleData,
ErpToLoc = pubSeDetail.ToErpLocCode, ErpToLoc = pubSeDetail.ToErpLocCode,
Seq = default, Seq = default,
@ -163,7 +181,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
CodeType = default, CodeType = default,
BillType = pubSeDetail.DeliverBillType, BillType = pubSeDetail.DeliverBillType,
Qty = pubSeDetail.Qty, Qty = pubSeDetail.Qty,
BillTime = pubSeDetail.BillTime, BillTime = pubSeDetail.BillTime ?? new DateTime(),
DeliverTime = pubSeDetail.DnBillTime, DeliverTime = pubSeDetail.DnBillTime,
ErpToLoc = pubSeDetail.ToErpLocCode, ErpToLoc = pubSeDetail.ToErpLocCode,
Seq = default, Seq = default,
@ -182,4 +200,25 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
} }
} }
} }
/// <summary>
/// 添加零件关系
/// </summary>
public async Task AddNewMaterialRelationships(IEnumerable<MaterialRelationship> materialRelationships)
{
//新客户零件号和厂内零件号
var noHaveLuRePartCodes = from item1 in materialRelationships
join item2 in _settleAccountDbContext.Set<MaterialRelationship>()
on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode }
into temp
from item3 in temp.DefaultIfEmpty()
where item3 == null
select item1;
if (noHaveLuRePartCodes.Any())
{
await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false);
//await _materialRelationshipRepository.InsertManyAsync(noHaveLuRePartCodes).ConfigureAwait(false);
}
}
} }

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs

@ -23,11 +23,12 @@ public class MaiDanBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobServi
/// </summary> /// </summary>
public MaiDanBBACSeSyncAppService( public MaiDanBBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> jisSeDetailRepository, INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs

@ -23,11 +23,12 @@ public class MaiDanHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobServi
/// </summary> /// </summary>
public MaiDanHBPOSeSyncAppService( public MaiDanHBPOSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> jisSeDetailRepository, INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs

@ -24,11 +24,12 @@ public class YinDuSeSyncAppService : JitSeSyncAppService, IJobService
/// </summary> /// </summary>
public YinDuSeSyncAppService( public YinDuSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs

@ -24,11 +24,12 @@ public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService, IJobService
/// </summary> /// </summary>
public ZhiGongBBACSeSyncAppService( public ZhiGongBBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs

@ -1,11 +1,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
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 Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -23,12 +27,14 @@ public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService
/// 构造 /// 构造
/// </summary> /// </summary>
public ZhiGongHBPOSeSyncAppService( public ZhiGongHBPOSeSyncAppService(
IHost host,
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {
@ -44,6 +50,6 @@ public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService
public async Task Invoke(IServiceProvider serviceProvider) public async Task Invoke(IServiceProvider serviceProvider)
{ {
await this.Invoke(); await base.Invoke().ConfigureAwait(false);
} }
} }

569
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/FISes/FISAppService.cs

@ -1,569 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Distributed;
using Shouldly;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.CodeSettings;
using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.CacheBase;
using Win.Sfs.Shared.Enums.SettleAccount;
using Win.Sfs.Shared.Filter;
using Win.Utils;
namespace Win.Sfs.SettleAccount.FISes
{
/// <summary>
/// 区域相关应用服务
/// </summary>
//[Authorize(SettleAccountPermissions.FISs.Default)]
//[AllowAnonymous]
[ApiExplorerSettings(IgnoreApi = true)]
[Route("api/settleaccount/fis")]
public class FISAppService : SettleAccountApplicationBase<FIS>, IFISAppService
{
private readonly IExcelImportAppService _excelImportService;
private readonly ISettleAccountBranchEfCoreRepository<FIS, Guid> _repository;
private readonly ISettleAccountBranchEfCoreRepository<Prebatches.Prebatch, Guid> _preBatchRepository;
private readonly ISettleAccountBranchEfCoreRepository<FISExtend, Guid> _extendRepository;
private readonly ISettleAccountBranchEfCoreRepository<FISVersion, Guid> _versionRepository;
private readonly ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> _relrepository;
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _importRepository;
/// <summary>
///
/// </summary>
/// <param name="guidGenerator"></param>
/// <param name="objectMapper"></param>
/// <param name="repository"></param>
/// <param name="versionRepository"></param>
/// <param name="extendRepository"></param>
/// <param name="preBatchRepository"></param>
/// <param name="cache"></param>
/// <param name="excelImportService"></param>
/// <param name="snowflakeIdGenerator"></param>
/// <param name="commonManager"></param>
/// <param name="relrepository"></param>
public FISAppService(IGuidGenerator guidGenerator,
IObjectMapper objectMapper,
ISettleAccountBranchEfCoreRepository<FIS, Guid> repository,
ISettleAccountBranchEfCoreRepository<FISVersion, Guid> versionRepository,
ISettleAccountBranchEfCoreRepository<FISExtend, Guid> extendRepository,
ISettleAccountBranchEfCoreRepository<Prebatches.Prebatch, Guid> preBatchRepository,
IDistributedCache<FIS> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> relrepository,
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> importRepository
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager)
{
_versionRepository = versionRepository;
_repository = repository;
_excelImportService = excelImportService;
_extendRepository = extendRepository;
_preBatchRepository = preBatchRepository;
_relrepository = relrepository;
_importRepository = importRepository;
}
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
public async Task<string> FISUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory, string model, DateTime? beginDate, DateTime? endDate)
{
// List<string> _errorList = new List<string>();
if (string.IsNullOrEmpty(model) || beginDate == null || endDate == null)
{
throw new BusinessException("8989", "产线、开始时间和结束时间、不能为空!");
}
List<FIS> _setls = new List<FIS>();
List<FISExtend> _extendls = new List<FISExtend>();
var _id = GuidGenerator.Create();
var _prelist = await _preBatchRepository.GetAllAsync(GuidGenerator.Create());
var _chList= await _relrepository.GetAllAsync(GuidGenerator.Create(), true);
var _chls= _chList.Select(p => p.ShipMaterailCode).Distinct();
var checkList = new List<ErrorExportDto>();
foreach (var file in files)
{
using (TextReader textReader = new StreamReader(file.OpenReadStream()))
{
int i = 0;
while (true)
{
string str = await textReader.ReadLineAsync();
if (string.IsNullOrEmpty(str))
{
break;
}
else
{
try
{
var _lst = str.Split(new char[] { ';' }).ToList();
var orderBillNum = _lst[0];
var materialCode = _lst[1];
var qty = decimal.Parse(_lst[2]);
var cp5 = DateTime.Parse(_lst[3]);
var fisYear = cp5.Year.ToString();
var extend1 = model;
var sequenceNumber = _lst[6];
var chassisNumber = _lst[7];
var kenncode = string.Empty;
var chassisNumber2 = string.Empty;
EnumSettleStatus state = EnumSettleStatus.;
if (orderBillNum.Length == 10)
{
kenncode = orderBillNum.Substring(2 , 7);
}
if (chassisNumber.Length != 18)
{
chassisNumber2 = chassisNumber.Substring(9, 8);
}
var kenn = _prelist.Where(p => p.KENNCode == kenncode).FirstOrDefault();
if (kenn != null)
{
if ((int)EnumSettleStatus. == kenn.State)
{
state = EnumSettleStatus.;
}
}
if (beginDate.Value < cp5 && cp5 < endDate.Value)
{
var _fisId = GuidGenerator.Create();
var fis = new FIS(
_fisId,
branchId,
year,
period,
extend1,
chassisNumber,
qty,
cp5,
sequenceNumber,
orderBillNum,
materialCode,
fisYear,
_id,
kenncode,
chassisNumber2,
state,
DateTime.Now,
0,
version,
DateTime.Now,
GuidGenerator.Create(),
beginDate == null ? DateTime.Now : beginDate.Value,
endDate == null ? DateTime.Now : endDate.Value,
string.Empty
);
fis.SetModel(model);
_setls.Add(fis);
}
}
catch
{
}
}
i++;
}
textReader.Close();
}
}
var _copyls= _setls.GroupBy(x =>new { x.ChassisNumber2, x.Version, x.Model, x.ItemCode }).Select(y => y.First()).ToList();
var _l = _copyls.Select(p => p.ItemCode).Distinct();
var _notls= _l.Where(p=>!_chls.Contains(p)).ToList();
foreach (var itm in _notls)
{
checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm, string.Empty, string.Format("关系表中不存在发运物料号{0}!", itm), string.Empty));
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
if (_copyls != null && _copyls.Count > 0)
{
foreach (var itm in _copyls)
{
var fisextend = new FISExtend(
itm.Id,
branchId,
year,
period,
itm.Extend1,
itm.ChassisNumber,
itm.Qty,
itm.CP5Time,
itm.SequenceNumber,
itm.OrderBillNum,
itm.ItemCode,
itm.FISYear,
itm.ParentId,
itm.KENNCode,
itm.ChassisNumber2,
itm.State,
DateTime.Now,
0,
version,
DateTime.Now,
GuidGenerator.Create(),
beginDate == null ? DateTime.Now : beginDate.Value,
endDate == null ? DateTime.Now : endDate.Value,
string.Empty
);
fisextend.SetModel(model);
_extendls.Add(fisextend);
}
}
var _versionQuery = _versionRepository.Where(p => p.Version == version && p.Model == model);
await _versionQuery.BatchDeleteAsync();
var _query = _repository.Where(p => p.Version == version && p.Model == model);
await _query.BatchDeleteAsync();
var _extendQuery = _extendRepository.Where(p => p.Version == version && p.Model == model);
await _extendQuery.BatchDeleteAsync();
await _repository.GetDbContext().BulkInsertAsync(_copyls);
await _extendRepository.GetDbContext().BulkInsertAsync(_extendls);
FISVersion _version = new FISVersion(_id, branchId, year, period, version, customerCode, factory, model, beginDate.Value, endDate.Value);
var _ls = new List<FISVersion>();
_ls.Add(_version);
await _versionRepository.GetDbContext().BulkInsertAsync(_ls);
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 按ID获取唯一实体
/// </summary>
/// <remarks>
/// 返回实体全部属性
/// </remarks>
/// <param name="id">ID</param>
/// <returns>实体DTO</returns>
[HttpGet]
[Route("{id}")]
virtual public async Task<FISDto> GetAsync(Guid id)
{
var result = await GetFromCacheAsync(id);
var dto = ObjectMapper.Map<FIS, FISDto>(result);
return dto;
}
private async Task<FIS> GetFromCacheAsync(Guid id)
{
var result = await _repository.GetAsync(id);
return result;
}
private async Task<long> GetCountAsync(FISRequestDto input)
{
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
}
private async Task<long> GetCountAsync(FISVersionRequestDto input)
{
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters);
}
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("list")]
// [Authorize(SettleAccountPermissions.FISs.Default)]
virtual public async Task<PagedResultDto<FISDto>> GetListAsync(Guid parendid,FISRequestDto input)
{
//if (input.ParentId != Guid.Empty)
//{
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version.ToString() });
//}
//else
//{
// return new PagedResultDto<FISDto>(0, new List<FISDto>());
//}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var dtos = ObjectMapper.Map<List<FIS>, List<FISDto>>(entities);
return new PagedResultDto<FISDto>(totalCount, dtos);
}
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("list_th")]
// [Authorize(SettleAccountPermissions.FISs.Default)]
virtual public async Task<PagedResultDto<FISDto>> GetListTHAsync(Guid parendid, FISRequestDto input)
{
//if (input.ParentId != Guid.Empty)
//{
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
//}
//else
//{
// return new PagedResultDto<FISDto>(0, new List<FISDto>());
//}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var dtos = ObjectMapper.Map<List<FIS>, List<FISDto>>(entities);
return new PagedResultDto<FISDto>(totalCount, dtos);
}
/// <summary>
/// 获取实体总数
/// </summary>
/// <returns>实体总数</returns>
[HttpGet]
[Route("count")]
virtual public async Task<long> GetTotalCountAsync(Guid branchId)
{
return await _repository.GetCountAsync(branchId);
}
/// <summary>
/// 获取全部实体列表
/// </summary>
/// <returns>实体DTO列表</returns>
[HttpGet]
[Route("all")]
virtual public async Task<ListResultDto<FISDto>> GetAllAsync(Guid branchId)
{
var entities = await _repository.GetAllAsync(branchId, true);
var dtos = ObjectMapper.Map<List<FIS>, List<FISDto>>(entities);
return new ListResultDto<FISDto>(dtos);
}
/// <summary>
/// 删除实体
/// </summary>
/// <param name="id">ID</param>
/// <returns>无</returns>
[HttpDelete]
[Route("{id}")]
virtual public async Task DeleteAsync(Guid id)
{
var entity = await GetFromCacheAsync(id);
await Cache.DeleteAsync<FIS>(id.ToString());
await _repository.DeleteAsync(id);
}
/// <summary>
/// 按IDs删除实体列表
/// </summary>
/// <param name="ids">IDs</param>
/// <returns>是否执行成功</returns>
[HttpPost]
[Route("delete")]
virtual public async Task<bool> DeleteListAsync(List<Guid> ids)
{
foreach (var id in ids)
{
var entity = await GetFromCacheAsync(id);
await Cache.DeleteAsync<FIS>(id.ToString());
}
return await _repository.DeleteListAsync(ids);
}
/// <summary>
/// 版本列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("listversion")]
public async Task<PagedResultDto<FISVersionDto>> GetVersionListAsync(FISVersionRequestDto input)
{
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var dtos = ObjectMapper.Map<List<FISVersion>, List<FISVersionDto>>(entities);
foreach (var itm in dtos)
{
itm.Version = itm.Version + string.Format("({0})", itm.Model);
}
return new PagedResultDto<FISVersionDto>(totalCount, dtos);
}
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("duplicate")]
[UnitOfWork(isTransactional: false)]
public async Task<bool> UPdateFisAsync()
{
await _repository.GetDbContext().Database.ExecuteSqlRawAsync(
"EXEC sp_fis_remove_duplicate"
);
return true;
}
/// <summary>
/// 导出文件
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("Export")]
virtual public async Task<string> ExportAsync(FISRequestDto input)
{
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
if (input.ParentId != Guid.Empty)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<FIS>, List<FISExportDto>>(entities);
string _fileName = string.Empty;
//声明导出容器
byte[] result = null;
switch (input.FileType)
{
case 0:
_fileName = string.Format("大众FIS_{0}.csv", input.UserId.ToString());
result = await _csv.ExportAsByteArray(dtoDetails);
break;
case 1:
_fileName = string.Format("大众FIS_{0}.xlsx", input.UserId.ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
break;
}
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
//[HttpPost]
//[Route("ExportJob")]
//[Authorize(SettleAccountPermissions.FISs.Default)]
//public Task ExportFile(string taskid,string fileName)
//{
// return Task.CompletedTask;
//}
//[HttpPost]
//[Route("NotifyJob")]
//[Authorize(SettleAccountPermissions.FISs.Default)]
//public async Task<string> SendNotify(string taskid,string fileName, string realFileName)
//{
// return "str";
//}
//[HttpPost]
//[Route("ImportJob")]
//[Authorize(SettleAccountPermissions.Materials.Default)]
//public async Task<string> ImportFile(string taskid,string fileName,string realFileName)
//{
// IExcelImporter _importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();
// //await _importer.Import<MaterialDto>(path);
// return string.Empty;
//}
}
}

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs

@ -79,16 +79,15 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
} }
foreach (var itm in _ls) foreach (var itm in _ls)
{ {
var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode); var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian);
if (_first != null) if (_first != null)
{ {
_first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode); _first.Update(itm.MaterialDesc, itm.SettleMaterialCode);
_first.Remark = materialRelationshipImportRequestDto.IsBj ? "BJ" : "";
await _repository.UpdateAsync(_first); await _repository.UpdateAsync(_first);
} }
else else
{ {
itm.Remark = materialRelationshipImportRequestDto.IsBj ? "BJ" : ""; itm.BusinessType = EnumBusinessType.BeiJian;
await _repository.InsertAsync(itm); await _repository.InsertAsync(itm);
} }
} }

580
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs

@ -1,580 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using AutoMapper;
using System.Linq;
using System.Text;
using Volo.Abp.Guids;
using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
using Volo.Abp.ObjectMapping;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.CacheBase;
using Win.Utils;
using Volo.Abp.Application.Dtos;
using Win.Sfs.BaseData.ImportExcelCommon;
using Volo.Abp.Domain.Repositories;
using EFCore.BulkExtensions;
using System.IO;
using Microsoft.EntityFrameworkCore;
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion;
using Win.Sfs.SettleAccount.FISes;
using Win.Sfs.Shared.Enums.SettleAccount;
using Win.Sfs.Shared.Filter;
using Shouldly;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.Data.Common;
using Volo.Abp.Uow;
using Volo.Abp;
using Win.Abp.Snowflakes;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Magicodes.ExporterAndImporter.Core.Models;
using TaskJob.Services;
using TaskJob.EventArgs;
using Win.Sfs.SettleAccount.Entities.Wms;
using Win.Sfs.SettleAccount.Repository;
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
/// <summary>
/// 大众准时化结算明细导入-R3已结
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/SettleAccount")]
public class SettleAccountAppService : SettleAccountApplicationBase<SettleAccount>, ISettleAccountAppService
{
private readonly IGuidGenerator _guidGenerator;
private readonly IExcelImportAppService _excelImportService;
private readonly ISettleAccountBranchEfCoreRepository<Prebatches.Prebatch, Guid> _preBatchRepository;
private readonly ISettleAccountBranchEfCoreRepository<SettleAccount, Guid> _repository;
private readonly ISettleAccountBranchEfCoreRepository<SettleAccountVersion, Guid> _versionRepository;
private readonly ISettleAccountBranchEfCoreRepository<FIS, Guid> _fisRepository;
private readonly ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> _relrepository;
private readonly TaskJobService _service;
/// <summary>
/// 构建方法
/// </summary>
/// <param name="guidGenerator">构建UID</param>
/// <param name="repository">仓储接口</param>
/// <param name="cache">缓存</param>
public SettleAccountAppService(IGuidGenerator guidGenerator,
ISettleAccountBranchEfCoreRepository<SettleAccountVersion, Guid> versionRepository,
ISettleAccountBranchEfCoreRepository<SettleAccount, Guid> repository,
IDistributedCache<SettleAccount> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
TaskJobService service,
ISettleAccountBranchEfCoreRepository<FIS, Guid> fisRepository,
ISettleAccountBranchEfCoreRepository<Prebatches.Prebatch, Guid> preBatchRepository,
ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> relrepository
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_service = service;
_fisRepository = fisRepository;
_versionRepository = versionRepository;
_guidGenerator = guidGenerator;
_excelImportService = excelImportService;
_repository = repository;
_preBatchRepository = preBatchRepository;
_relrepository = relrepository;
}
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files"></param>
/// <param name="branchId"></param>
/// <param name="year"></param>
/// <param name="period"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <param name="factory"></param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport-PG")]
[DisableRequestSizeLimit]
[Authorize(SettleAccountPermissions.SettleAccounts.Create)]
[UnitOfWork(false)]
public async Task<string> SettleAccountUploadExcelImportTH([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version??string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Period", Value = period ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Factory", Value = factory ?? string.Empty });
var _versionQuery = _versionRepository.Where(p => p.Version == version);
if (_versionQuery.Count() > 0)
{
_versionQuery.BatchDelete();
}
var _query = _repository.Where(p => p.Version == version);
if (_query.Count() > 0)
{
await _query.BatchDeleteAsync();
}
var _taskid = await _service.ImportEnqueueAsync<ImportTaskArgs>(files, "结算数据", CurrentUser, typeof(SettleAccountImportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
[Authorize(SettleAccountPermissions.SettleAccounts.Create)]
public async Task<string> SettleAccountUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory)
{
List<SettleAccount> _setls = new List<SettleAccount>();
List<string> _errorList = new List<string>();
var _id = GuidGenerator.Create();
var checkList = new List<ErrorExportDto>();
var _chList = await _relrepository.GetAllAsync(GuidGenerator.Create(), true);
var _chls = _chList.Select(p => p.SettleMaterialCode).Distinct();
List<string> _precodeList = new List<string>();//
using (TextReader textReader = new StreamReader(files[0].OpenReadStream()))
{
var _preList = _preBatchRepository.Where(p => p.State == 3).ToList();
var _versionQuery = _versionRepository.Where(p => p.Version == version);
await _versionQuery.BatchDeleteAsync();
var _query = _repository.Where(p => p.Version == version);
await _query.BatchDeleteAsync();
int i = 0;
//var _userId = CurrentUser.Id.Value;
while (true)
{
string str = await textReader.ReadLineAsync();
if (string.IsNullOrEmpty(str))
{
break;
}
else
{
//if (i > headerNumber)
//{
try
{
var _lst = str.Split(new char[] { '|' }).ToList();
string _settleyear = _lst[1].Trim();
string _kENNCode = _lst[2].Trim();
string _chassisNumber = _lst[3].Trim();
string _model = _lst[4].Trim();
DateTime _cP5A = DateTime.Parse(_lst[5].Trim());
DateTime _cP7 = DateTime.Parse(_lst[6].Trim());
string _materialCode = _lst[7].Trim();
decimal _qty = decimal.Parse(_lst[8].Trim());
string _settlementID = _lst[9].Trim();
string _settlementSupplier = _lst[10].Trim();
if (_preList.Any(p => p.KENNCode == _kENNCode))
{
_precodeList.Add(_kENNCode);
}
_setls.Add(new SettleAccount(
GuidGenerator.Create(),
branchId,
_settleyear,
_kENNCode,
_chassisNumber,
_model,
_cP5A,
_cP7,
_materialCode,
_qty,
_settlementID,
_settlementSupplier,
period,
year,
_id,
version,
DateTime.Now,
GuidGenerator.Create()
// _userId
));
}
catch
{
}
//}
}
i++;
}
textReader.Close();
}
var _ls = _setls;
var query = from arc in _ls
group arc by new { arc.ChassisNumber, arc.MaterialCode }
into g
where g.Count() > 1
select g;
var _l = _setls.Select(p => p.MaterialCode).Distinct();
var _notls = _l.Where(p => !_chls.Contains(p)).ToList();
foreach (var itm in _notls)
{
checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm, string.Empty, string.Format("关系表中不存在结算物料号{0}!", itm), string.Empty));
}
foreach (var itm in query)
{
checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}底盘号 {1}有重复", itm.Key.MaterialCode, itm.Key.ChassisNumber), string.Empty));
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var _existls = _preBatchRepository.Where(p => _precodeList.Contains(p.KENNCode)).ToList();
if (_existls.Count > 0)
{
foreach (var itm in _existls)
{
itm.Update(string.Format("结算修改预批量{0}", DateTime.Now.ToString("yyyyMMdd")), 0,string.Empty,string.Empty,string.Empty);
}
}
await _preBatchRepository.GetDbContext().BulkUpdateAsync(_existls);
await _repository.GetDbContext().BulkInsertAsync(_setls);
await _versionRepository.InsertAsync(new SettleAccountVersion(_id, branchId, year, period, version, customerCode, factory));
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 按ID获取唯一实体
/// </summary>
/// <remarks>
/// 返回实体全部属性
/// </remarks>
/// <param name="id">ID</param>
/// <returns>实体DTO</returns>
[HttpGet]
[Route("{id}")]
[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<SettleAccountDto> GetAsync(Guid id)
{
var result = await GetFromCacheAsync(id);
var dto = ObjectMapper.Map<SettleAccount, SettleAccountDto>(result);
return dto;
}
private async Task<SettleAccount> GetFromCacheAsync(Guid id)
{
var result = await _repository.GetAsync(id);
return result;
}
private async Task<long> GetCountAsync(SettleAccountRequestDto input)
{
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
}
private async Task<long> GetCountAsync(SettleAccountVersionRequestDto input)
{
return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters);
}
/// <summary>
/// 导出预批量
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[Route("ExportPreBatch")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> ExportPreBatchAsync(string version)
{
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
var _query = from itm1 in _preBatchRepository join itm2 in _repository on new { itm1.KENNCode, itm1.Year } equals new { itm2.KENNCode, itm2.Year } where itm2.Version == version select itm2;
var _ls=await _query.ToListAsync();
foreach (var itm in _ls)
{
itm.state = 3;
}
var dtoDetails = ObjectMapper.Map<List<SettleAccount>, List<SettleAccountExportDto>>(_ls);
string _fileName = string.Empty;
//声明导出容器
byte[] result = null;
//switch (input.FileType)
//{
// case 0:
// _fileName = string.Format("结算数据(预批量)_{0}.csv", Guid.NewGuid().ToString());
// result = await _csv.ExportAsByteArray(dtoDetails);
// break;
// case 1:
// _fileName = string.Format("结算数据_{0}.xlsx", Guid.NewGuid().ToString());
// result = await _excel.ExportAsByteArray(dtoDetails);
// break;
//}
_fileName = string.Format("结算数据(预批量)_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
/// <summary>
/// 导出文件
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("Export")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> ExportAsync(SettleAccountRequestDto input)
{
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
if (input.ParentId != Guid.Empty)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<SettleAccount>, List<SettleAccountExportDto>>(entities);
string _fileName = string.Empty;
//声明导出容器
byte[] result = null;
switch (input.FileType)
{
case 0:
_fileName = string.Format("结算数据_{0}.csv", input.UserId.ToString());
result = await _csv.ExportAsByteArray(dtoDetails);
break;
case 1:
_fileName = string.Format("结算数据_{0}.xlsx", input.UserId.ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
break;
}
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("list")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<SettleAccountDto>> GetListAsync(Guid id, SettleAccountRequestDto input)
{
if (input.ParentId != Guid.Empty)
{
// var _entity = await _versionRepository.GetAsync(input.ParentId);
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = _entity.Version });
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
}
else
{
return new PagedResultDto<SettleAccountDto>(0, new List<SettleAccountDto>());
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var dtos = ObjectMapper.Map<List<SettleAccount>, List<SettleAccountDto>>(entities);
return new PagedResultDto<SettleAccountDto>(totalCount, dtos);
}
/// <summary>
/// 获取实体总数
/// </summary>
/// <returns>实体总数</returns>
[HttpGet]
[Route("count")]
[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<long> GetTotalCountAsync(Guid branchId)
{
return await _repository.GetCountAsync(branchId);
}
/// <summary>
/// 获取全部实体列表
/// </summary>
/// <returns>实体DTO列表</returns>
[HttpGet]
[Route("all")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<ListResultDto<SettleAccountDto>> GetAllAsync(Guid branchId)
{
var entities = await _repository.GetAllAsync(branchId, true);
var dtos = ObjectMapper.Map<List<SettleAccount>, List<SettleAccountDto>>(entities);
return new ListResultDto<SettleAccountDto>(dtos);
}
/// <summary>
/// 删除实体
/// </summary>
/// <param name="id">ID</param>
/// <returns>无</returns>
[HttpDelete]
[Route("{id}")]
/// [Authorize(SettleAccountPermissions.SettleAccounts.Delete)]
virtual public async Task DeleteAsync(Guid id)
{
var entity = await GetFromCacheAsync(id);
await Cache.DeleteAsync<SettleAccount>(id.ToString());
await _repository.DeleteAsync(id);
}
/// <summary>
/// 按IDs删除实体列表
/// </summary>
/// <param name="ids">IDs</param>
/// <returns>是否执行成功</returns>
[HttpPost]
[Route("delete")]
// [Authorize(SettleAccountPermissions.SettleAccounts.Delete)]
virtual public async Task<bool> DeleteListAsync(List<Guid> ids)
{
foreach (var id in ids)
{
var entity = await GetFromCacheAsync(id);
//await Cache.DeleteAsync<SettleAccount>(id.ToString());
}
return await _repository.DeleteListAsync(ids);
}
/// <summary>
///调用存储
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("listversion")]
public async Task<PagedResultDto<SettleAccountVersionDto>> GetVersionListAsync(SettleAccountVersionRequestDto input)
{
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
var dtos = ObjectMapper.Map<List<SettleAccountVersion>, List<SettleAccountVersionDto>>(entities);
return new PagedResultDto<SettleAccountVersionDto>(totalCount, dtos);
}
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("updateFis")]
[UnitOfWork(isTransactional: false)]
public async Task<bool> UPdateFisAsync()
{
_repository.GetDbContext().Database.SetCommandTimeout(300000);
await _repository.GetDbContext().Database.ExecuteSqlRawAsync(
"EXEC sp_settle_fis_update"
);
return true;
}
}
}

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

@ -1108,7 +1108,6 @@ namespace Win.Sfs.SettleAccount
{ "InvoiceNumber", d.InvoiceNumber}, { "InvoiceNumber", d.InvoiceNumber},
{ "VendorCode", d.VendorCode}, { "VendorCode", d.VendorCode},
{ "VendorName", d.VendorName}, { "VendorName", d.VendorName},
{ "PurchaseOrderNumber", d.PurchaseOrderNumber},
{ "DeliveryIndexNumber", d.DeliveryIndexNumber}, { "DeliveryIndexNumber", d.DeliveryIndexNumber},
{ "PartName", d.PartName}, { "PartName", d.PartName},
{ "Price", d.Price}, { "Price", d.Price},

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs

@ -41,7 +41,7 @@ public class PUB_SE_DETAIL :SE_BASE
/// 发货时间 /// 发货时间
/// </summary> /// </summary>
[Display(Name = "发货时间")] [Display(Name = "发货时间")]
public DateTime BillTime { get; set; } public DateTime? BillTime { get; set; }
/// <summary> /// <summary>
/// 订单时间 /// 订单时间
/// </summary> /// </summary>

80
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs

@ -1,108 +1,56 @@
using System; using System;
using Win.Sfs.Shared.DomainBase; using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace Win.Sfs.SettleAccount.MaterialRelationships;
namespace Win.Sfs.SettleAccount.MaterialRelationships
{
/// <summary> /// <summary>
/// 客户零件关系 /// 客户零件关系
/// </summary> /// </summary>
public class MaterialRelationship : FullAuditedAggregateRootBase<Guid> public class MaterialRelationship : AuditedAggregateRoot<Guid>
{ {
/// <summary> /// <summary>
/// 厂内物料号 /// 厂内物料号
/// </summary> /// </summary>
public string ErpMaterialCode { get; set; } public string ErpMaterialCode { get; set; }
/// <summary> /// <summary>
/// 厂内物料描述 /// 厂内物料描述
/// </summary> /// </summary>
public string MaterialDesc { get; set; } public string MaterialDesc { get; set; }
/// <summary> /// <summary>
/// 客户物料号 /// 客户物料号
/// </summary> /// </summary>
public string SettleMaterialCode { get; set; } public string SettleMaterialCode { get; set; }
/// <summary> /// <summary>
/// 物料属性 /// 业务分类
/// </summary> /// </summary>
public string MaterialProperty { get; set; } [Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
///// <summary>
///// 结算物料号
///// </summary>
//public string SettleMaterialCode { get; set; }
/// <summary>
/// 发货看板物料号
/// </summary>
public string ShipMaterailCode { get; set; }
/// <summary>
/// 估价类
/// </summary>
public string AppraisalCategory { get; set; }
public void SetId(Guid id, Guid branchId) public void SetId(Guid id, Guid branchId)
{ {
Id = id; Id = id;
BranchId = branchId;
} }
protected MaterialRelationship() protected MaterialRelationship()
{ {
} }
public void Update( string materialDesc, string materialProperty, string settlMaterialCode, string shipMaterailCode) public void Update(string materialDesc, string settlMaterialCode)
{ {
MaterialDesc = materialDesc; MaterialDesc = materialDesc;
MaterialProperty = materialProperty;
SettleMaterialCode = settlMaterialCode; SettleMaterialCode = settlMaterialCode;
ShipMaterailCode = shipMaterailCode;
//AppraisalCategory = appraisalCategory;
} }
public MaterialRelationship( public MaterialRelationship(Guid id) : base(id)
Guid id,
Guid branchId,
string erpMaterialCode, string materialDesc, string materialProperty, string settlMaterialCode, string shipMaterailCode, string appraisalCategory) :base(id)
{ {
BranchId = branchId;
ErpMaterialCode = erpMaterialCode;
MaterialDesc = materialDesc;
MaterialProperty = materialProperty;
SettleMaterialCode = settlMaterialCode;
ShipMaterailCode = shipMaterailCode;
AppraisalCategory = appraisalCategory;
} }
public MaterialRelationship(Guid id, string erpMaterialCode, string materialDesc, string settlMaterialCode, string appraisalCategory) : base(id) public MaterialRelationship(Guid id, string erpMaterialCode, string materialDesc, string settlMaterialCode, EnumBusinessType businessType) : base(id)
{ {
ErpMaterialCode = erpMaterialCode; ErpMaterialCode = erpMaterialCode;
MaterialDesc = materialDesc; MaterialDesc = materialDesc;
SettleMaterialCode = settlMaterialCode; SettleMaterialCode = settlMaterialCode;
AppraisalCategory = appraisalCategory; BusinessType = businessType;
}
} }
} }

7
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -15,6 +15,7 @@ using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.DtoBase.SettleAccount; using Win.Sfs.Shared.DtoBase.SettleAccount;
using Win.Sfs.Shared.Enums.SettleAccount; using Win.Sfs.Shared.Enums.SettleAccount;
using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.CommonManagers namespace Win.Sfs.SettleAccount.CommonManagers
{ {
@ -25,7 +26,7 @@ namespace Win.Sfs.SettleAccount.CommonManagers
private readonly ISettleAccountBranchEfCoreRepository<CustomerStorageLocation, Guid> _customerStorageLocationRepository; private readonly ISettleAccountBranchEfCoreRepository<CustomerStorageLocation, Guid> _customerStorageLocationRepository;
private readonly ISettleAccountBranchEfCoreRepository<InventoryDetail, Guid> _inventoryDetailRepository; private readonly ISettleAccountBranchEfCoreRepository<InventoryDetail, Guid> _inventoryDetailRepository;
private readonly ISettleAccountBranchEfCoreRepository<Entities.SettleAccounts.SettleAccount, Guid> _settleAccountRepository; private readonly ISettleAccountBranchEfCoreRepository<Entities.SettleAccounts.SettleAccount, Guid> _settleAccountRepository;
private readonly ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> _materialRelationshipRepository; private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _materialRelationshipRepository;
private readonly ISettleAccountBranchEfCoreRepository<CentralizedControl, Guid> _centralizedControlRepository; private readonly ISettleAccountBranchEfCoreRepository<CentralizedControl, Guid> _centralizedControlRepository;
@ -42,7 +43,7 @@ namespace Win.Sfs.SettleAccount.CommonManagers
ISettleAccountBranchEfCoreRepository<Entities.SettleAccounts.SettleAccount, Guid> settleAccountRepository, ISettleAccountBranchEfCoreRepository<Entities.SettleAccounts.SettleAccount, Guid> settleAccountRepository,
ISettleAccountBranchEfCoreRepository<CentralizedControl, Guid> centralizedControlRepository, ISettleAccountBranchEfCoreRepository<CentralizedControl, Guid> centralizedControlRepository,
ISettleAccountBranchEfCoreRepository<Material, Guid> itemRepository, ISettleAccountBranchEfCoreRepository<Material, Guid> itemRepository,
ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> materialRelationshipRepository INormalEfCoreRepository<MaterialRelationship, Guid> materialRelationshipRepository
) )
{ {
_inventoryDetailRepository = inventoryDetailRepository; _inventoryDetailRepository = inventoryDetailRepository;

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

@ -130,6 +130,14 @@ public class PubSaSeCompareDiff
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExport public class PubSaSeCompareDetailExport
{
}
/// <summary>
/// PUB结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExport2
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -144,33 +152,33 @@ public class PubSaSeCompareDetailExport
[ValueMapping("无结算有发运", 3)] [ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; } public EnumPubSaSeCompareCategory Category { get; set; }
///// <summary> /// <summary>
///// Wms发货单号 /// Wms发货单号
///// </summary> /// </summary>
//[Display(Name = "Wms发货单号")] [Display(Name = "Wms发货单号")]
//[ExporterHeader(DisplayName = "交货单号")] [ExporterHeader(DisplayName = "交货单号")]
//public string WmsBillNum { get; set; } public string WmsBillNum { get; set; }
///// <summary> /// <summary>
///// 发货日期 /// 发货日期
///// </summary> /// </summary>
//[Display(Name = "发货日期")] [Display(Name = "发货日期")]
//[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
//public DateTime ShippingDate { get; set; } public DateTime ShippingDate { get; set; }
///// <summary> /// <summary>
///// 生产码 /// 生产码
///// </summary> /// </summary>
//[Display(Name = "生产码")] [Display(Name = "生产码")]
//[ExporterHeader(DisplayName = "ASN发货单号")] [ExporterHeader(DisplayName = "ASN发货单号")]
//public string PN { get; set; } public string PN { get; set; }
///// <summary> /// <summary>
///// 物料号 /// 物料号
///// </summary> /// </summary>
//[Display(Name = "物料号")] [Display(Name = "物料号")]
//[ExporterHeader(DisplayName = "厂内物料号")] [ExporterHeader(DisplayName = "厂内物料号")]
//public string MaterialNumber { get; set; } public string MaterialNumber { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 物料描述
@ -179,12 +187,12 @@ public class PubSaSeCompareDetailExport
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; } public string MaterialDes { get; set; }
///// <summary> /// <summary>
///// 原始LU /// 原始LU
///// </summary> /// </summary>
//[Display(Name = "原始LU")] [Display(Name = "原始LU")]
//[ExporterHeader(DisplayName = "原始LU")] [ExporterHeader(DisplayName = "原始LU")]
//public string PrimitiveLU { get; set; } public string PrimitiveLU { get; set; }
/// <summary> /// <summary>
///替换LU ///替换LU
@ -193,12 +201,12 @@ public class PubSaSeCompareDetailExport
[ExporterHeader(DisplayName = "替换LU")] [ExporterHeader(DisplayName = "替换LU")]
public string ReplaceLU { get; set; } public string ReplaceLU { get; set; }
///// <summary> /// <summary>
///// 结算数据中的过账日期 /// 结算数据中的过账日期
///// </summary> /// </summary>
//[Display(Name = "客户下线时间")] [Display(Name = "客户下线时间")]
//[ExporterHeader(DisplayName = "客户下线时间")] [ExporterHeader(DisplayName = "客户下线时间")]
//public DateTime CustomerOfflineTime { get; set; } public DateTime CustomerOfflineTime { get; set; }
/// <summary> /// <summary>
/// 结算数量 /// 结算数量
@ -214,53 +222,100 @@ public class PubSaSeCompareDetailExport
[ExporterHeader(DisplayName = "WMS发货数量")] [ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; } public decimal SEQty { get; set; }
///// <summary> /// <summary>
///// 差异数量 /// 差异数量
///// </summary> /// </summary>
//[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
//public decimal DiffQty { set; get; } public decimal DiffQty { set; get; }
///// <summary> /// <summary>
///// 匹配类型 /// 匹配类型
///// </summary> /// </summary>
//[Display(Name = "匹配类型")] [Display(Name = "匹配类型")]
//[ExporterHeader(DisplayName = "是否完全匹配")] [ExporterHeader(DisplayName = "是否完全匹配")]
//public string MateType { get; set; } public string MateType { get; set; }
///// <summary> /// <summary>
///// 定价 /// 定价
///// </summary> /// </summary>
//[Display(Name = "定价")] [Display(Name = "定价")]
//[ExporterHeader(DisplayName = "定价")] [ExporterHeader(DisplayName = "定价")]
//public decimal FixPrice { get; set; } public decimal FixPrice { get; set; }
///// <summary> /// <summary>
///// 日顺序号 /// 日顺序号
///// </summary> /// </summary>
//[Display(Name = "日顺序号")] [Display(Name = "日顺序号")]
//[ExporterHeader(DisplayName = "日顺序号")] [ExporterHeader(DisplayName = "日顺序号")]
//public string SeqNumber { get; set; } public string SeqNumber { get; set; }
///// <summary> /// <summary>
///// PJIS日顺序号 /// PJIS日顺序号
///// </summary> /// </summary>
//[Display(Name = "PJIS日顺序号")] [Display(Name = "PJIS日顺序号")]
//[ExporterHeader(DisplayName = "PJIS日顺序号")] [ExporterHeader(DisplayName = "PJIS日顺序号")]
//public string PJISSeqNumber { get; set; } public string PJISSeqNumber { get; set; }
///// <summary> /// <summary>
///// WMS目标库位 /// WMS目标库位
///// </summary> /// </summary>
//[Display(Name = "WMS目标库位")] [Display(Name = "WMS目标库位")]
//[ExporterHeader(DisplayName = "WMS目标库位")] [ExporterHeader(DisplayName = "WMS目标库位")]
//public string ToLocCode { get; set; } public string ToLocCode { get; set; }
///// <summary> /// <summary>
///// ERP目标库位 /// ERP目标库位
///// </summary> /// </summary>
//[Display(Name = "ERP目标库位")] [Display(Name = "ERP目标库位")]
//[ExporterHeader(DisplayName = "ERP目标库位")] [ExporterHeader(DisplayName = "ERP目标库位")]
//public string ToErpLocCode { get; set; } public string ToErpLocCode { get; set; }
}
/// <summary>
/// PUB结算与发运对比明细
/// </summary>
public interface IPubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// 有结算有发运
/// 有结算无发运
/// 无结算有发运
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
/// <summary>
///替换LU
/// </summary>
[Display(Name = "替换LU")]
[ExporterHeader(DisplayName = "替换LU")]
public string ReplaceLU { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
} }
/// <summary> /// <summary>
@ -308,7 +363,7 @@ public class PubSaSeCompareSumExport
/// 直供件BBAC结算与发运对比明细 /// 直供件BBAC结算与发运对比明细
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -397,7 +452,7 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
@ -432,7 +487,7 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp
/// 直供件HBPO结算与发运对比明细 /// 直供件HBPO结算与发运对比明细
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -521,7 +576,7 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
@ -645,7 +700,7 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
@ -680,7 +735,7 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo
/// 备件结算与发运对比明细 /// 备件结算与发运对比明细
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -769,7 +824,7 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
@ -804,7 +859,7 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport
/// 印度件结算与发运对比明细 /// 印度件结算与发运对比明细
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -893,7 +948,7 @@ public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型

6
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -238,9 +238,7 @@ namespace Win.Sfs.SettleAccount
b.ToTable($"{options.TablePrefix}_relationship", options.Schema); b.ToTable($"{options.TablePrefix}_relationship", options.Schema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.Property(x => x.ErpMaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); b.Property(x => x.ErpMaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.ErpMaterialCode }); b.HasIndex(x => new { x.ErpMaterialCode, x.BusinessType }).IsUnique();
b.HasIndex(x => new { x.ErpMaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
}); });
} }
@ -1345,7 +1343,7 @@ namespace Win.Sfs.SettleAccount
builder.Entity<JobItem>().HasData(new JobItem("JisBBACSeSync".ToGuid()) { Name = "JisBBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("JisBBACSeSync".ToGuid()) { Name = "JisBBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("JisHBPOSeSync".ToGuid()) { Name = "JisHBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("JisHBPOSeSync".ToGuid()) { Name = "JisHBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("MaiDanBBACSeSync".ToGuid()) { Name = "买单件BBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("MaiDanBBACSeSync".ToGuid()) { Name = "买单件BBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("MaiDanHBPOSeSync".ToGuid()) { Name = "买单件HBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("MaiDanHBPOSeSync".ToGuid()) { Name = "买单件HBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("ZhiGongBBACSeSync".ToGuid()) { Name = "直供件BBAC发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("ZhiGongBBACSeSync".ToGuid()) { Name = "直供件BBAC发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" });

5521
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.Designer.cs

File diff suppressed because it is too large

191
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.cs

@ -0,0 +1,191 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202308181 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Set_relationship_ErpMaterialCode",
table: "Set_relationship");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("42240e52-f4f4-4e40-b321-2bc395fde07c"));
migrationBuilder.DropColumn(
name: "AppraisalCategory",
table: "Set_relationship");
migrationBuilder.DropColumn(
name: "BranchId",
table: "Set_relationship");
migrationBuilder.DropColumn(
name: "DeleterId",
table: "Set_relationship");
migrationBuilder.DropColumn(
name: "DeletionTime",
table: "Set_relationship");
migrationBuilder.DropColumn(
name: "Enabled",
table: "Set_relationship");
migrationBuilder.DropColumn(
name: "IsDeleted",
table: "Set_relationship");
migrationBuilder.DropColumn(
name: "MaterialProperty",
table: "Set_relationship");
migrationBuilder.DropColumn(
name: "Remark",
table: "Set_relationship");
migrationBuilder.DropColumn(
name: "ShipMaterailCode",
table: "Set_relationship");
migrationBuilder.AddColumn<int>(
name: "BusinessType",
table: "Set_relationship",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AlterColumn<DateTime>(
name: "BillTime",
table: "Set_PUB_SE_DETAIL",
type: "datetime2",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "Service",
value: "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanHBPOSeSyncAppService");
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("ab6a3a74-bb4e-442c-84b5-d148f2cd99f6"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "6947bb1f686043fcb95d9db67c0ca6c8", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
migrationBuilder.CreateIndex(
name: "IX_Set_relationship_ErpMaterialCode_BusinessType",
table: "Set_relationship",
columns: new[] { "ErpMaterialCode", "BusinessType" },
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Set_relationship_ErpMaterialCode_BusinessType",
table: "Set_relationship");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ab6a3a74-bb4e-442c-84b5-d148f2cd99f6"));
migrationBuilder.DropColumn(
name: "BusinessType",
table: "Set_relationship");
migrationBuilder.AddColumn<string>(
name: "AppraisalCategory",
table: "Set_relationship",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "BranchId",
table: "Set_relationship",
type: "uniqueidentifier",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.AddColumn<Guid>(
name: "DeleterId",
table: "Set_relationship",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "DeletionTime",
table: "Set_relationship",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "Enabled",
table: "Set_relationship",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsDeleted",
table: "Set_relationship",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "MaterialProperty",
table: "Set_relationship",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Remark",
table: "Set_relationship",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ShipMaterailCode",
table: "Set_relationship",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "BillTime",
table: "Set_PUB_SE_DETAIL",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "datetime2",
oldNullable: true);
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "Service",
value: "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService");
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("42240e52-f4f4-4e40-b321-2bc395fde07c"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "3a0fa479f64a4e84949961ac4a8aed89", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
migrationBuilder.CreateIndex(
name: "IX_Set_relationship_ErpMaterialCode",
table: "Set_relationship",
column: "ErpMaterialCode",
unique: true,
filter: "IsDeleted=0");
}
}
}

46
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -3516,7 +3516,7 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("BillNum") b.Property<string>("BillNum")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("BillTime") b.Property<DateTime?>("BillTime")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<int>("BillType") b.Property<int>("BillType")
@ -4386,7 +4386,7 @@ namespace Win.Sfs.SettleAccount.Migrations
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "买单件HBPO发运数据同步", Name = "买单件HBPO发运数据同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanHBPOSeSyncAppService"
}, },
new new
{ {
@ -4540,10 +4540,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasData( b.HasData(
new new
{ {
Id = new Guid("42240e52-f4f4-4e40-b321-2bc395fde07c"), Id = new Guid("ab6a3a74-bb4e-442c-84b5-d148f2cd99f6"),
BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
BillType = 1, BillType = 1,
ConcurrencyStamp = "3a0fa479f64a4e84949961ac4a8aed89", ConcurrencyStamp = "6947bb1f686043fcb95d9db67c0ca6c8",
DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ErpToLoc = "ErpToLoc", ErpToLoc = "ErpToLoc",
OrderNum = "OrderNum", OrderNum = "OrderNum",
@ -5455,11 +5455,8 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("AppraisalCategory") b.Property<int>("BusinessType")
.HasColumnType("nvarchar(max)"); .HasColumnType("int");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
@ -5475,17 +5472,6 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ErpMaterialCode") b.Property<string>("ErpMaterialCode")
.IsRequired() .IsRequired()
.HasMaxLength(36) .HasMaxLength(36)
@ -5495,12 +5481,6 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(max)") .HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("LastModificationTime"); .HasColumnName("LastModificationTime");
@ -5512,23 +5492,13 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("MaterialDesc") b.Property<string>("MaterialDesc")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("MaterialProperty")
.HasColumnType("nvarchar(max)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("SettleMaterialCode") b.Property<string>("SettleMaterialCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("ShipMaterailCode")
.HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ErpMaterialCode") b.HasIndex("ErpMaterialCode", "BusinessType")
.IsUnique() .IsUnique();
.HasFilter("IsDeleted=0");
b.ToTable("Set_relationship"); b.ToTable("Set_relationship");
}); });

10
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs

@ -27,17 +27,19 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
string strSeWhere = string.Empty; string strSeWhere = string.Empty;
if (!string.IsNullOrWhiteSpace(seStartDateTime)) if (!string.IsNullOrWhiteSpace(seStartDateTime))
{ {
strSeWhere = $" AND BillTime >= {seStartDateTime} "; strSeWhere = $" AND BillTime >= '{seStartDateTime}' ";
} }
if (!string.IsNullOrWhiteSpace(seEndDateTime)) if (!string.IsNullOrWhiteSpace(seEndDateTime))
{ {
strSeWhere = $" AND BillTime <= {seEndDateTime} "; strSeWhere = $" AND BillTime <= '{seEndDateTime}' ";
} }
string strSqlText = @$" string strSqlText = @$"
SELECT SELECT
A.WmsBillNum, A.WmsBillNum,
A.ShippingDate, A.ShippingDate,
A.PartCode AS MaterialNumber, A.LU AS MaterialNumber,
A.FactoryPartCode AS PrimitiveLU,
A.FactoryPartCode AS ReplaceLU,
'' MaterialDes, '' MaterialDes,
B.SettleDate CustomerOfflineTime, B.SettleDate CustomerOfflineTime,
A.LU SeLU, A.LU SeLU,
@ -50,7 +52,7 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
A.ToLocCode, A.ToLocCode,
A.ToErpLocCode A.ToErpLocCode
FROM FROM
(SELECT SUM(QTY) SEQty,LU,PN,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate,MAX(PartCode) PartCode, MAX(ToLocCode) ToLocCode, MAX(ToErpLocCode) ToErpLocCode FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} {strSeWhere} GROUP BY LU,PN) A (SELECT SUM(QTY) SEQty,LU,PN,FactoryPartCode,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate,MAX(PartCode) PartCode, MAX(ToLocCode) ToLocCode, MAX(ToErpLocCode) ToErpLocCode FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} {strSeWhere} GROUP BY LU,PN,FactoryPartCode) A
FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate FROM Set_PUB_SA_DETAIL WHERE BusinessType = {businessType} AND Version = {version} GROUP BY LU,PN) B ON A.LU= B.LU AND A.PN= B.PN FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate FROM Set_PUB_SA_DETAIL WHERE BusinessType = {businessType} AND Version = {version} GROUP BY LU,PN) B ON A.LU= B.LU AND A.PN= B.PN
ORDER BY B.SettleDate DESC; ORDER BY B.SettleDate DESC;
"; ";

126
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

@ -126,67 +126,63 @@ namespace SettleAccount.Job.Services.Report
//二次匹配上的记录 //二次匹配上的记录
var secondMatchHaveSaHaveSes = new List<PubSaSeCompareDiff>(); var secondMatchHaveSaHaveSes = new List<PubSaSeCompareDiff>();
haveSaHaveSes.ForEach(t => t.PrimitiveLU = t.ReplaceLU = t.SaLU);
haveSaNotHaveSes.ForEach(t => t.PrimitiveLU = t.ReplaceLU = t.SaLU);
notHaveSaHaveSes.ForEach(t => t.PrimitiveLU = t.ReplaceLU = t.SeLU);
#region 二次对比 #region 二次对比
//二次对比(替换零件号) ////二次对比(替换零件号)
var repLUs = notHaveSaHaveSes.Select(t => t.SeLU).Distinct().ToList(); //var repLUs = notHaveSaHaveSes.Select(t => t.SeLU).Distinct().ToList();
var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && t.BusinessType == businessType).Result; //var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && t.BusinessType == businessType).Result;
tbRePartsRelationships.ForEach(tbRePartsRelationship => //tbRePartsRelationships.ForEach(tbRePartsRelationship =>
{ //{
notHaveSaHaveSes.FindAll(t => t.SeLU == tbRePartsRelationship.RepLU).ForEach(t => // notHaveSaHaveSes.FindAll(t => t.SeLU == tbRePartsRelationship.RepLU).ForEach(t =>
{ // {
t.ReplaceLU = tbRePartsRelationship.LU; // t.ReplaceLU = tbRePartsRelationship.LU;
}); // });
}); //});
var haveSaNotHaveSeLUPNs = haveSaNotHaveSes.Select(t => new { t.ReplaceLU, t.PN }); //var haveSaNotHaveSeLUPNs = haveSaNotHaveSes.Select(t => new { t.ReplaceLU, t.PN });
var notHaveSaHaveSeLUPNs = notHaveSaHaveSes.Select(t => new { t.ReplaceLU, t.PN }); //var notHaveSaHaveSeLUPNs = notHaveSaHaveSes.Select(t => new { t.ReplaceLU, t.PN });
//二次匹配 匹配上的零件号 ////二次匹配 匹配上的零件号
var secondMatchLUPNs = haveSaNotHaveSeLUPNs.Intersect(notHaveSaHaveSeLUPNs); //var secondMatchLUPNs = haveSaNotHaveSeLUPNs.Intersect(notHaveSaHaveSeLUPNs);
if (secondMatchLUPNs.Any() == true) //if (secondMatchLUPNs.Any() == true)
{ //{
pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchLUPNs.Contains(new { t.ReplaceLU, t.PN })); // pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchLUPNs.Contains(new { t.ReplaceLU, t.PN }));
foreach (var secondMatchLUPN in secondMatchLUPNs) // foreach (var secondMatchLUPN in secondMatchLUPNs)
{ // {
var haveSaNotHaveSe = haveSaNotHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN); // var haveSaNotHaveSe = haveSaNotHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN);
var notHaveSaHaveSe = notHaveSaHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN); // var notHaveSaHaveSe = notHaveSaHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN);
secondMatchHaveSaHaveSes.Add(new PubSaSeCompareDiff() // secondMatchHaveSaHaveSes.Add(new PubSaSeCompareDiff()
{ // {
WmsBillNum = notHaveSaHaveSe.WmsBillNum, // WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate, // ShippingDate = notHaveSaHaveSe.ShippingDate,
SeqNumber = notHaveSaHaveSe.SeqNumber, // SeqNumber = notHaveSaHaveSe.SeqNumber,
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, // PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber,
MaterialNumber = haveSaNotHaveSe.MaterialNumber, // MaterialNumber = haveSaNotHaveSe.MaterialNumber,
MaterialDes = haveSaNotHaveSe.MaterialDes, // MaterialDes = haveSaNotHaveSe.MaterialDes,
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, // CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
SAQty = haveSaNotHaveSe.SAQty, // SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty, // SEQty = notHaveSaHaveSe.SEQty,
MateType = haveSaNotHaveSe.MateType, // MateType = haveSaNotHaveSe.MateType,
FixPrice = haveSaNotHaveSe.FixPrice, // FixPrice = haveSaNotHaveSe.FixPrice,
PrimitiveLU = haveSaNotHaveSe.PrimitiveLU, // PrimitiveLU = haveSaNotHaveSe.PrimitiveLU,
ReplaceLU = haveSaNotHaveSe.ReplaceLU, // ReplaceLU = haveSaNotHaveSe.ReplaceLU,
SeLU = notHaveSaHaveSe.SeLU, // SeLU = notHaveSaHaveSe.SeLU,
SaLU = haveSaNotHaveSe.SaLU, // SaLU = haveSaNotHaveSe.SaLU,
PN = haveSaNotHaveSe.PN, // PN = haveSaNotHaveSe.PN,
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, // Category = EnumPubSaSeCompareCategory.HaveSaHaveSe,
IsRemove = false // IsRemove = false
}); // });
} // }
} //}
//二次对比比对上的数据入库 ////二次对比比对上的数据入库
if (secondMatchHaveSaHaveSes.Count > 0) //if (secondMatchHaveSaHaveSes.Count > 0)
{ //{
pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); // pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes);
var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes); // var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
_pubSeCDetailRepository.InsertManyAsync(pubSeCDetailEntitys); // _pubSeCDetailRepository.InsertManyAsync(pubSeCDetailEntitys);
} //}
#endregion #endregion
if (string.IsNullOrEmpty(lu) == false) if (string.IsNullOrEmpty(lu) == false)
@ -197,8 +193,6 @@ namespace SettleAccount.Job.Services.Report
{ {
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn); pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn);
} }
var pubSaSeCompareDetailExports = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExport>>(pubSaSeCompareDiffs);
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
#region 根据业务分类转换不同导出Dto #region 根据业务分类转换不同导出Dto
@ -206,33 +200,33 @@ namespace SettleAccount.Job.Services.Report
{ {
case EnumBusinessType.ZhiGongJianBBAC: case EnumBusinessType.ZhiGongJianBBAC:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportZhiGongJianBBAC>>(pubSaSeCompareDetailExports); var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBAC>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBAC>(items, businessTypeDisplayName);
} }
break; break;
case EnumBusinessType.ZhiGongJianHBPO: case EnumBusinessType.ZhiGongJianHBPO:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportZhiGongJianHBPO>>(pubSaSeCompareDetailExports); var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPO>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPO>(items, businessTypeDisplayName);
} }
break; break;
case EnumBusinessType.MaiDanJianBBAC: case EnumBusinessType.MaiDanJianBBAC:
break; break;
case EnumBusinessType.MaiDanJianHBPO: case EnumBusinessType.MaiDanJianHBPO:
{ //{
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDetailExports); // var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName); // excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName);
} //}
break; break;
case EnumBusinessType.BeiJian: case EnumBusinessType.BeiJian:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportBeiJian>>(pubSaSeCompareDetailExports); var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportBeiJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJian>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJian>(items, businessTypeDisplayName);
} }
break; break;
case EnumBusinessType.YinDuJian: case EnumBusinessType.YinDuJian:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportYinDuJian>>(pubSaSeCompareDetailExports); var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportYinDuJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJian>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJian>(items, businessTypeDisplayName);
} }
break; break;
@ -250,7 +244,7 @@ namespace SettleAccount.Job.Services.Report
} }
#region 私有方法 #region 私有方法
public ExcelExporter BindExcelExporter<T>(List<T> pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, new() public ExcelExporter BindExcelExporter<T>(List<T> pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport, new()
{ {
//结算核对汇总 //结算核对汇总
var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()

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

@ -27,16 +27,12 @@ namespace SettleAccount.Job
/// </summary> /// </summary>
private void CreateMapPubSaSeCompare() private void CreateMapPubSaSeCompare()
{ {
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExport>() CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianBBAC>();
.ForMember(x => x.ReplaceLU, y => y.MapFrom(y => y.ReplaceLU)); CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportBeiJian>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportYinDuJian>();
CreateMap<PubSaSeCompareDiff, PUB_SEC_DETAIL>(); CreateMap<PubSaSeCompareDiff, PUB_SEC_DETAIL>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportBeiJian>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportYinDuJian>();
} }
} }
} }

Loading…
Cancel
Save