学 赵 1 year ago
parent
commit
b16897c44f
  1. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js
  2. 32
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
  3. 8
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
  4. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  5. 73
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
  6. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  7. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  8. 30
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  9. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs
  10. 62
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  11. 67
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  12. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  13. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Consts/AppConst.cs
  14. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs
  15. 824
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  16. 116
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReport.cs
  17. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs
  18. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs
  19. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs
  20. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs
  21. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs
  22. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs
  23. 153
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs
  24. 46
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs
  25. 176
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs
  26. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisBBAC.cs
  27. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisHBPO.cs
  28. 436
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs
  29. 53
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareSumReport.cs
  30. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs
  31. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs
  32. 4
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
  33. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs
  34. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs
  35. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs
  36. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs
  37. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs
  38. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs
  39. 152
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  40. 32
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs
  41. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs
  42. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js

@ -159,4 +159,12 @@ const getRules = (parentSchema, property, data) => {
//Object.assign(Schema.messages, messages); //Object.assign(Schema.messages, messages);
//Object.assign(Schema.validators, validators); //Object.assign(Schema.validators, validators);
export { getRules }; function required() {
return { required: true };
}
function trim(message) {
return { pattern: "^(?!\\s).*(?<!\\s)$", message: message ?? "无效的空格字符", trigger: "blur" };
}
export { getRules, required, trim };

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

@ -6,12 +6,12 @@ import AppForm from "../../components/form/index.js";
import AppTable from "../../components/table/index.js"; import AppTable from "../../components/table/index.js";
import extraProperties from "../../models/_extraProperties.js"; import extraProperties from "../../models/_extraProperties.js";
import { getUrl } from "../../request/index.js"; import { getUrl } from "../../request/index.js";
import { ElMessage } from "element-plus";
import businessTypes from "../../models/_options.js"; import businessTypes from "../../models/_options.js";
import { required, trim } from "../../utils/validation.js";
export default { export default {
components: { AppForm, AppTable }, components: { AppForm, AppTable },
template: html`<el-drawer v-if="refreshRef" v-model="show" destroy-on-close size="50%" class="page-drawer" :close-on-click-modal="false"> template: html`<el-drawer v-if="refreshRef" v-model="show" destroy-on-close size="50%" class="page-drawer" :close-on-click-modal="false" @closed="drawerClosed">
<template #header> <span class="el-dialog__title"> 结算明细 </span> </template> <template #header> <span class="el-dialog__title"> 结算明细 </span> </template>
<el-tabs style="height:100%;"> <el-tabs style="height:100%;">
<el-tab-pane :label="columns1.title" v-if="model.invoicE_MAP_GROUP?.length"> <el-tab-pane :label="columns1.title" v-if="model.invoicE_MAP_GROUP?.length">
@ -121,7 +121,7 @@ export default {
<el-scrollbar> <el-scrollbar>
<el-result icon="success" title="重开完成"> <el-result icon="success" title="重开完成">
<template #extra> <template #extra>
<el-button type="primary" @click="next">返回</el-button> <el-button type="primary" @click="drawerClosed">返回</el-button>
</template> </template>
</el-result> </el-result>
</el-scrollbar> </el-scrollbar>
@ -137,7 +137,7 @@ export default {
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog v-model="addDialogVisible" align-center destroy-on-close :close-on-click-modal="false" style="width:380px;height:480px;"> <el-dialog v-model="addDialogVisible" align-center destroy-on-close :close-on-click-modal="false" style="width:360px;height:440px;">
<template #header>添加调整明细</template> <template #header>添加调整明细</template>
<el-scrollbar> <el-scrollbar>
<el-row> <el-row>
@ -193,7 +193,7 @@ export default {
} }
</style>`, </style>`,
props: ["modelValue", "row", "data", "isBusiness", "businessType"], props: ["modelValue", "row", "data", "isBusiness", "businessType"],
emit: ["update:modelValue"], emits: ["update:modelValue", "complete"],
setup(props, context) { setup(props, context) {
const show = ref(props.modelValue); const show = ref(props.modelValue);
watch(show, (value) => context.emit("update:modelValue", value)); watch(show, (value) => context.emit("update:modelValue", value));
@ -266,13 +266,13 @@ export default {
}, },
}; };
const columns22 = Object.assign({}, columns2); const columns22 = JSON.parse(JSON.stringify(columns2));
columns22.properties.extend1 = { columns22.properties.extend1 = {
type: "number", type: "number",
title: "SA号", title: "SA号",
}; };
const columns23 = Object.assign({}, columns2); const columns23 = JSON.parse(JSON.stringify(columns2));
columns23.properties.extend1 = { columns23.properties.extend1 = {
type: "number", type: "number",
title: "凭证号", title: "凭证号",
@ -452,35 +452,35 @@ export default {
invBillNum: { invBillNum: {
type: "string", type: "string",
title: "发票号", title: "发票号",
rules: [{ required: true }], rules: [required(), trim()],
default: props.data.invbillNum, default: props.data.invbillNum,
}, },
settleDate: { settleDate: {
type: "string", type: "string",
title: "下线日期", title: "下线日期",
input: "datetime", input: "datetime",
rules: [{ required: true }], rules: [required()],
}, },
lu: { lu: {
type: "string", type: "string",
title: "零件号", title: "零件号",
rules: [{ required: true }], rules: [required(), trim()],
}, },
pn: { pn: {
type: "string", type: "string",
title: "标识号", title: "标识号",
rules: [{ required: true }], rules: [required(), trim()],
}, },
qty: { qty: {
type: "string", type: "string",
title: "数量", title: "数量",
input: "number", input: "number",
rules: [{ required: true }], rules: [required()],
}, },
groupNum: { groupNum: {
type: "string", type: "string",
title: "结算分组", title: "结算分组",
rules: [{ required: true }], rules: [required(), trim()],
}, },
}, },
}; };
@ -631,7 +631,7 @@ export default {
} 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}`));
} }
} else { } else if (setupRef.value === 4) {
setupDialogVisable.value = false; setupDialogVisable.value = false;
refreshRef.value = false; refreshRef.value = false;
nextTick(() => { nextTick(() => {
@ -639,6 +639,9 @@ export default {
}); });
} }
}; };
const drawerClosed = () => {
context.emit("complete");
};
// //
onMounted(async () => { onMounted(async () => {
loading.value = true; loading.value = true;
@ -694,6 +697,7 @@ export default {
refreshRef, refreshRef,
setup3Model, setup3Model,
businessTypes, businessTypes,
drawerClosed,
}; };
}, },
}; };

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

@ -9,7 +9,7 @@ import AppCheck from "./_check.js";
export default { export default {
components: { AppList, AppCheck }, components: { AppList, AppCheck },
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" /> template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
<app-check v-if="visable" v-model="visable" :businessType="businessType" :row="row" :data="data" :isBusiness="true" />`, <app-check v-if="visable" v-model="visable" :businessType="businessType" :row="row" :data="data" :isBusiness="true" @complete="complete" />`,
setup() { setup() {
const appListRef = ref(null); const appListRef = ref(null);
const visable = ref(false); const visable = ref(false);
@ -57,6 +57,10 @@ export default {
} }
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { appListRef, config, onCommand, visable, row, data, businessType }; const complete = async () => {
visable.value = false;
await appListRef.value.reload();
};
return { appListRef, config, onCommand, visable, row, data, businessType, complete };
}, },
}; };

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

@ -66,6 +66,11 @@ public class PUB_SAImportRequestDto
/// </summary> /// </summary>
[Display(Name = "期间")] [Display(Name = "期间")]
public int Version { get; set; } public int Version { get; set; }
/// <summary>
/// 地点
/// </summary>
[Display(Name = "地点")]
public string Site { get; set; }
} }
/// <summary> /// <summary>

73
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs

@ -65,42 +65,36 @@ public class PriceListExportDto
[Display(Name = "零件号")] [Display(Name = "零件号")]
[ExporterHeader(DisplayName = "客户零件号")] [ExporterHeader(DisplayName = "客户零件号")]
public string LU { get; set; } public string LU { get; set; }
/// <summary> /// <summary>
/// 价格 /// 价格
/// </summary> /// </summary>
[Display(Name = "价格")] [Display(Name = "价格")]
[ExporterHeader(DisplayName = "价格")] [ExporterHeader(DisplayName = "价格")]
public Decimal Price { set; get; } public Decimal Price { set; get; }
/// <summary> /// <summary>
/// 开始时间 /// 开始时间
/// </summary> /// </summary>
[Display(Name = "开始时间")] [Display(Name = "开始时间")]
[ExporterHeader(DisplayName = "开始时间")] [ExporterHeader(DisplayName = "开始时间")]
public DateTime BeginTime { set; get; } public DateTime BeginTime { set; get; }
/// <summary> /// <summary>
/// 结束时间 /// 结束时间
/// </summary> /// </summary>
[Display(Name = "结束时间")] [Display(Name = "结束时间")]
[ExporterHeader(DisplayName = "结束时间")] [ExporterHeader(DisplayName = "结束时间")]
public DateTime EndTime { set; get; } public DateTime EndTime { set; get; }
/// <summary> /// <summary>
/// 客户编码 /// 客户编码
/// </summary> /// </summary>
[Display(Name = "客户编码")] [Display(Name = "客户编码")]
[ExporterHeader(DisplayName = "客户编码")] [ExporterHeader(DisplayName = "客户编码")]
public string ClientCode { get; set; } public string ClientCode { get; set; }
/// <summary> /// <summary>
/// 合同签订时间 /// 合同签订时间
/// </summary> /// </summary>
[Display(Name = "合同签订时间")] [Display(Name = "合同签订时间")]
[ExporterHeader(DisplayName = "合同签订时间")] [ExporterHeader(DisplayName = "合同签订时间")]
public DateTime Date { get; set; } public DateTime Date { get; set; }
/// <summary> /// <summary>
/// 合同号 /// 合同号
/// </summary> /// </summary>
@ -112,8 +106,7 @@ public class PriceListExportDto
/// <summary> /// <summary>
/// 销售价格导入 /// 销售价格导入
/// </summary> /// </summary>
[ImportProject(Name = SettleAccountModuleName.PriceList)] [Importer(HeaderRowIndex = 22)]
[Importer(HeaderRowIndex = 21)]
public class PriceListImportDto public class PriceListImportDto
{ {
/// <summary> /// <summary>
@ -138,7 +131,7 @@ public class PriceListImportDto
/// <summary> /// <summary>
/// 价格 /// 价格
/// </summary> /// </summary>
[ImporterHeader(Name = "Total Price (Old)")] [ImporterHeader(Name = "Total Price")]
public decimal TotalPrice { get; set; } public decimal TotalPrice { get; set; }
/// <summary> /// <summary>
/// 开始时间 /// 开始时间
@ -297,56 +290,58 @@ public class PriceListBJExportDto
/// <summary> /// <summary>
/// 客户备件价格导入 /// 客户备件价格导入
/// </summary> /// </summary>
[Importer(HeaderRowIndex = 22)]
public class PriceListBJImportDto public class PriceListBJImportDto
{ {
/// <summary> /// <summary>
/// 客户零件号 /// 合同签订时间
/// </summary> /// </summary>
[Display(Name = "客户零件号")] [ImporterHeader(IsIgnore = true)]
[ImporterHeader(Name = "客户零件号")] [ExcelImporterHeadDesc(Row = 1, Cell = 1)]
public string LU { get; set; } public string Date { get; set; }
/// <summary>
/// 合同号
/// </summary>
[ImporterHeader(IsIgnore = true)]
[ExcelImporterHeadDesc(Row = 2, Cell = 1)]
public string ContractNo { get; set; }
/// <summary>
/// 零件号
/// </summary>
[Display(Name = "零件号")]
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "Part No.")]
public string PartNo { get; set; }
/// <summary> /// <summary>
/// 价格 /// 价格
/// </summary> /// </summary>
[Display(Name = "价格")] [ImporterHeader(Name = "Total Price")]
[ImporterHeader(Name = "价格")] public decimal TotalPrice { get; set; }
public decimal Price { get; set; }
/// <summary> /// <summary>
/// 开始时间 /// 开始时间
/// </summary> /// </summary>
[Display(Name = "开始时间")] [ImporterHeader(Name = "Valid From")]
[ImporterHeader(Name = "开始时间")] public DateTime ValidFrom { get; set; }
public DateTime BeginDate { set; get; }
/// <summary> /// <summary>
/// 结束时间 /// 结束时间
/// </summary> /// </summary>
[Display(Name = "结束时间")] [ImporterHeader(Name = "Valid To")]
[ImporterHeader(Name = "结束时间")] public DateTime ValidTo { get; set; }
public DateTime EndDate { set; get; }
/// <summary> /// <summary>
/// 客户编码 /// 客户编码
/// </summary> /// </summary>
[Display(Name = "客户编码")] [ImporterHeader(Name = "Plant")]
[ImporterHeader(Name = "客户编码")] public string Plant { get; set; }
public string ClientCode { get; set; }
/// <summary> /// <summary>
/// 合同签订时间 /// ES1
/// </summary> /// </summary>
[Display(Name = "合同签订时间")] [ImporterHeader(Name = "ES1")]
[ImporterHeader(Name = "合同签订时间")] public string ES1 { get; set; }
public DateTime Date { get; set; }
/// <summary> /// <summary>
/// 合同号 /// ES2
/// </summary> /// </summary>
[Display(Name = "合同号")] [ImporterHeader(Name = "ES2")]
[ImporterHeader(Name = "合同号")] public string ES2 { get; set; }
public string ContractNo { get; set; }
} }
public class PriceListBJRequestDto : RequestInputBase public class PriceListBJRequestDto : RequestInputBase

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

@ -31,6 +31,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ;
[Route("api/settleaccount/[controller]/[action]")] [Route("api/settleaccount/[controller]/[action]")]
public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA> public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
{ {
/// <summary>
/// DbContext
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary> /// <summary>
/// BBAC结算仓储 /// BBAC结算仓储
/// </summary> /// </summary>
@ -79,7 +83,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
/// <summary> /// <summary>
/// 构造 /// 构造
/// </summary> /// </summary>
public BBAC_SA_SERVICE(INormalEfCoreRepository<BBAC_SA, Guid> bbacSaRepository, public BBAC_SA_SERVICE(SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<BBAC_SA, Guid> bbacSaRepository,
INormalEfCoreRepository<BBAC_SA_DETAIL, Guid> bbacSaDetailRepository, INormalEfCoreRepository<BBAC_SA_DETAIL, Guid> bbacSaDetailRepository,
INormalEfCoreRepository<BBAC_CAN_SA, Guid> bbacCanSaRepository, INormalEfCoreRepository<BBAC_CAN_SA, Guid> bbacCanSaRepository,
INormalEfCoreRepository<BBAC_CAN_SA_DETAIL, Guid> bbacCanSaDetailRepository, INormalEfCoreRepository<BBAC_CAN_SA_DETAIL, Guid> bbacCanSaDetailRepository,
@ -93,6 +98,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
ICommonManager commonManager ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{ {
_settleAccountDbContext = settleAccountDbContext;
_bbacSaRepository = bbacSaRepository; _bbacSaRepository = bbacSaRepository;
_bbacSaDetailRepository = bbacSaDetailRepository; _bbacSaDetailRepository = bbacSaDetailRepository;
_bbacCanSaRepository = bbacCanSaRepository; _bbacCanSaRepository = bbacCanSaRepository;
@ -400,7 +406,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
//导入的零件号集合 //导入的零件号集合
var importPubSaLUs = bbacSaDetails.Select(t => t.LU).Distinct(); var importPubSaLUs = bbacSaDetails.Select(t => t.LU).Distinct();
//销售价格 //销售价格
var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false).Where(t => importPubSaLUs.Contains(t.LU)).ToList();
var priceListEntitys = GetPriceListEntitys(importPubSaLUs);
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
bbacSaDetails.ForEach(bbacSaDetail => bbacSaDetails.ForEach(bbacSaDetail =>
{ {
@ -507,5 +514,18 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
return (bbacSas, bbacSaDetails, bbacCanSas, bbacCanSaDetails, bbacNotSaDetails); return (bbacSas, bbacSaDetails, bbacCanSas, bbacCanSaDetails, bbacNotSaDetails);
} }
/// <summary>
/// 获取价格
/// </summary>
private List<PriceList> GetPriceListEntitys(IEnumerable<string> importSaLus)
{
var clientCode = Site;
return _settleAccountDbContext.Set<PriceList>()
.Where(t => t.IsCancel == false)
.Where(t => t.ClientCode == clientCode)
.Where(t => importSaLus.Contains(t.LU))
.ToList();
}
#endregion #endregion
} }

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

@ -370,7 +370,9 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
//导入的零件号集合 //导入的零件号集合
var importPubSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct(); var importPubSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct();
//销售价格 //销售价格
var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false).Where(t => importPubSaLUs.Contains(t.LU)).ToList(); var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false)
.Where(t => t.ClientCode == "104T")
.Where(t => importPubSaLUs.Contains(t.LU)).ToList();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
hbpoSaDetails.ForEach(hbpoSaDetail => hbpoSaDetails.ForEach(hbpoSaDetail =>
{ {

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

@ -39,42 +39,34 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// PUB结算仓储 /// PUB结算仓储
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PUB_SA, Guid> _repository; private readonly INormalEfCoreRepository<PUB_SA, Guid> _repository;
/// <summary> /// <summary>
/// PUB结算明细仓储 /// PUB结算明细仓储
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PUB_SA_DETAIL, Guid> _pubSaDetailRepository; private readonly INormalEfCoreRepository<PUB_SA_DETAIL, Guid> _pubSaDetailRepository;
/// <summary> /// <summary>
/// PUB可结算仓储 /// PUB可结算仓储
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PUB_CAN_SA, Guid> _pubCanSaRepository; private readonly INormalEfCoreRepository<PUB_CAN_SA, Guid> _pubCanSaRepository;
/// <summary> /// <summary>
/// PUB可结算明细仓储 /// PUB可结算明细仓储
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> _pubCanSaDetailRepository; private readonly INormalEfCoreRepository<PUB_CAN_SA_DETAIL, Guid> _pubCanSaDetailRepository;
/// <summary> /// <summary>
/// PUB不可结算明细仓储 /// PUB不可结算明细仓储
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _pubNotSaDetailRepository; private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _pubNotSaDetailRepository;
/// <summary> /// <summary>
/// 销售价格仓储 /// 销售价格仓储
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PriceList, Guid> _priceListRepository; private readonly INormalEfCoreRepository<PriceList, Guid> _priceListRepository;
/// <summary> /// <summary>
/// 备件价格仓储 /// 备件价格仓储
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _priceBjListRepository; private readonly INormalEfCoreRepository<PriceListBJ, Guid> _priceBjListRepository;
/// <summary> /// <summary>
/// 客户零件关系仓储 /// 客户零件关系仓储
/// </summary> /// </summary>
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _materialRelationshipRepository; private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _materialRelationshipRepository;
/// <summary> /// <summary>
/// 替换件关系仓储 /// 替换件关系仓储
/// </summary> /// </summary>
@ -113,6 +105,14 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// 期间 /// 期间
/// </summary> /// </summary>
private int _version; private int _version;
/// <summary>
/// 业务类别
/// </summary>
private EnumBusinessType businessType;
/// <summary>
/// 地点
/// </summary>
private string site;
#region 导入、导出 #region 导入、导出
/// <summary> /// <summary>
@ -123,6 +123,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
{ {
IActionResult result = new JsonResult(new { Code = 400 }); IActionResult result = new JsonResult(new { Code = 400 });
_version = pubSaImportRequestDto.Version; _version = pubSaImportRequestDto.Version;
businessType = pubSaImportRequestDto.BusinessType;
site = pubSaImportRequestDto.Site;
switch (pubSaImportRequestDto.BusinessType) switch (pubSaImportRequestDto.BusinessType)
{ {
case EnumBusinessType.ZhiGongJianBBAC: case EnumBusinessType.ZhiGongJianBBAC:
@ -440,10 +442,21 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
importPubSaDetail.BusinessType = businessType; importPubSaDetail.BusinessType = businessType;
}); });
var lus = pubSaDetails.Select(t => t.LU).Distinct().ToList(); var lus = pubSaDetails.Select(t => t.LU).Distinct().ToList();
var clientCode = businessType switch
{
EnumBusinessType.ZhiGongJianBBAC => site,
EnumBusinessType.ZhiGongJianHBPO => "104T",
EnumBusinessType.BeiJian => "1040",
EnumBusinessType.YinDuJian => "1040",
_ => throw new UserFriendlyException($"业务编码错误", "400")
};
if (businessType == EnumBusinessType.BeiJian) if (businessType == EnumBusinessType.BeiJian)
{ {
//备件销售价格 //备件销售价格
var priceListEntitys = _priceBjListRepository.Where(t => t.IsCancel == false) var priceListEntitys = _priceBjListRepository.Where(t => t.IsCancel == false)
.Where(t => t.ClientCode == clientCode)
.Where(t => lus.Contains(t.LU)).ToList(); .Where(t => lus.Contains(t.LU)).ToList();
pubSaDetails.ForEach(importPubSaDetail => pubSaDetails.ForEach(importPubSaDetail =>
{ {
@ -461,6 +474,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
{ {
//销售价格 //销售价格
var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false) var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false)
.Where(t => t.ClientCode == clientCode)
.Where(t => lus.Contains(t.LU)).ToList(); .Where(t => lus.Contains(t.LU)).ToList();
pubSaDetails.ForEach(importPubSaDetail => pubSaDetails.ForEach(importPubSaDetail =>
{ {

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

@ -90,11 +90,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public async Task<string> TextExportAsync() public async Task<string> TextExportAsync()
{ {
var fileName = $"发运数据_{Guid.NewGuid()}.xlsx"; var fileName = $"发运数据_{Guid.NewGuid()}.xlsx";
var haveEdiHaveSeList = new List<JisBBACSeEidCompareReport>(); var haveEdiHaveSeList = new List<SeEidCompareReportJisBBAC>();
for (int i = 0; i < 2_000_000; i++) for (int i = 0; i < 2_000_000; i++)
{ {
haveEdiHaveSeList.Add(new JisBBACSeEidCompareReport() haveEdiHaveSeList.Add(new SeEidCompareReportJisBBAC()
{ {
Category = "JIS", Category = "JIS",
WmsBillNum = i.ToString(), WmsBillNum = i.ToString(),
@ -119,7 +119,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}); });
} }
var jisBBACEidSeCompareEexcelExporterAttribute = typeof(JisBBACSeEidCompareReport).GetAttribute<ExcelExporterAttribute>(); var jisBBACEidSeCompareEexcelExporterAttribute = typeof(SeEidCompareReportJisBBAC).GetAttribute<ExcelExporterAttribute>();
var jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = 9_000_000; var jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = 9_000_000;
if (jisBBACEidSeCompareEexcelExporterAttribute != null) if (jisBBACEidSeCompareEexcelExporterAttribute != null)
{ {

62
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -14,6 +14,7 @@ using Volo.Abp.Caching;
using Win.Abp.Snowflakes; using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.ExportReports;
@ -29,7 +30,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices;
public class PriceListAppService : SettleAccountApplicationBase<PriceList> public class PriceListAppService : SettleAccountApplicationBase<PriceList>
{ {
/// <summary> /// <summary>
/// 数据上下文 /// DbContext
/// </summary> /// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext; private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary> /// <summary>
@ -78,8 +79,34 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
}; };
result = result.FindAll(p => filter.Contains(p.Plant)).ToList(); result = result.FindAll(p => filter.Contains(p.Plant)).ToList();
result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2); result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2);
var entityList = ObjectMapper.Map<List<PriceListImportDto>, List<PriceList>>(result); var newPrice = ObjectMapper.Map<List<PriceListImportDto>, List<PriceList>>(result);
var newPrice = entityList.GroupBy(p => p.LU).Select(p => p.FirstOrDefault()).ToList(); newPrice = newPrice.GroupBy(p => new { p.LU, p.ClientCode, p.BeginTime, p.EndTime }).Select(p => p.FirstOrDefault()).ToList();
#region 校验
if (newPrice.Any())
{
var query = from item1 in newPrice
join item2 in newPrice
on new { item1.LU, item1.ClientCode } equals new { item2.LU, item2.ClientCode }
where (item1.BeginTime > item2.BeginTime && item1.EndTime < item2.EndTime) || (item2.BeginTime > item1.BeginTime && item2.EndTime < item1.EndTime) || (item1.BeginTime == item2.BeginTime && item1.EndTime != item2.EndTime) || (item1.BeginTime != item2.BeginTime && item1.EndTime == item2.EndTime)
select item1.LU;
var repeat = query.Distinct().ToList();
foreach (var item in repeat)
{
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item},时间区间存在交集", string.Empty));
}
foreach (var item in CheckPriceListContinuity(newPrice))
{
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item.LU},时间区间【{item.BeginTime}至{item.EndTime}】不连续", string.Empty));
}
}
if (checkList.Count > 0)
{
var fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false);
return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName });
}
#endregion
var importLus = newPrice.Select(t => t.LU).Distinct().ToList(); var importLus = newPrice.Select(t => t.LU).Distinct().ToList();
var oldPrices = _settleAccountDbContext.Set<PriceList>() var oldPrices = _settleAccountDbContext.Set<PriceList>()
@ -87,14 +114,14 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
.Where(t => importLus.Contains(t.LU)) .Where(t => importLus.Contains(t.LU))
.ToList(); .ToList();
//系统中合同日期比导入文件中的合同日期晚 //系统中合同日期比导入文件中的合同日期晚
var oldpriceNewDate = from oldprice in oldPrices var oldPriceNewDate = from oldprice in oldPrices
from newprice in newPrice from newprice in newPrice
where oldprice.LU == newprice.LU && oldprice.Date > newprice.Date where oldprice.LU == newprice.LU && oldprice.Date > newprice.Date
select oldprice; select oldprice;
oldPrices.ForEach(t => t.IsCancel = true); oldPrices.ForEach(t => t.IsCancel = true);
if (oldpriceNewDate.Any()) if (oldPriceNewDate.Any())
{ {
oldPrices.FindAll(t => oldpriceNewDate.Contains(t)).ForEach(t => t.IsCancel = false); oldPrices.FindAll(t => oldPriceNewDate.Contains(t)).ForEach(t => t.IsCancel = false);
var importCancelLus = oldPrices.Select(t => t.LU).Distinct(); var importCancelLus = oldPrices.Select(t => t.LU).Distinct();
newPrice.FindAll(t => importCancelLus.Contains(t.LU)).ForEach(t => t.IsCancel = true); newPrice.FindAll(t => importCancelLus.Contains(t.LU)).ForEach(t => t.IsCancel = true);
} }
@ -117,6 +144,29 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
return new JsonResult(new { Code = 200, Message = "导入成功" }); return new JsonResult(new { Code = 200, Message = "导入成功" });
} }
/// <summary>
/// 价格表时间是否连续
/// </summary>
private List<PriceList> CheckPriceListContinuity(List<PriceList> priceList)
{
var pricelist = new List<PriceList>();
if (priceList.Count <= 1)
{
return priceList; // 只有一个或零个价格条目
}
var sortedList = priceList.OrderBy(t => t.LU).ThenBy(t => t.BeginTime).ToList();
for (var i = 1; i < sortedList.Count; i++)
{
if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1))
{
priceList.Add(sortedList[i]);
}
}
return priceList; // 所有价格时间都连续
}
/// <summary> /// <summary>
/// 导出 /// 导出
/// </summary> /// </summary>

67
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -12,6 +12,7 @@ using Volo.Abp.Caching;
using Win.Abp.Snowflakes; using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.ExportReports;
@ -57,13 +58,38 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
var result = await _exportImporter.UploadExcelImportByHeadDesc<PriceListBJImportDto>(files, _excelImportService).ConfigureAwait(false); var result = await _exportImporter.UploadExcelImportByHeadDesc<PriceListBJImportDto>(files, _excelImportService).ConfigureAwait(false);
var filter = new List<string> var filter = new List<string>
{ {
"1040", "1040"
"1046",
"104T"
}; };
result = result.Where(p => filter.Contains(p.ClientCode)).ToList(); result = result.Where(p => filter.Contains(p.Plant)).ToList();
var entityList = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result); result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2);
var newPrice = entityList.GroupBy(p => p.LU).Select(p => p.FirstOrDefault()).ToList(); var newPrice = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result);
newPrice = newPrice.GroupBy(p => new { p.LU, p.BeginDate, p.EndDate }).Select(p => p.FirstOrDefault()).ToList();
#region 校验
if (newPrice.Any())
{
var query = from item1 in newPrice
join item2 in newPrice
on item1.LU equals item2.LU
where (item1.BeginDate > item2.BeginDate && item1.EndDate < item2.EndDate) || (item2.BeginDate > item1.BeginDate && item2.EndDate < item1.EndDate) || (item1.BeginDate == item2.BeginDate && item1.EndDate != item2.EndDate) || (item1.BeginDate != item2.BeginDate && item1.EndDate == item2.EndDate)
select item1.LU;
var repeat = query.Distinct().ToList();
foreach (var item in repeat)
{
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item},时间区间存在交集", string.Empty));
}
foreach (var item in CheckPriceListContinuity(newPrice))
{
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item.LU},时间区间【{item.BeginDate}至{item.EndDate}】不连续", string.Empty));
}
}
if (checkList.Count > 0)
{
var fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false);
return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName });
}
#endregion
var importLus = newPrice.Select(t => t.LU).Distinct().ToList(); var importLus = newPrice.Select(t => t.LU).Distinct().ToList();
var oldPrices = _settleAccountDbContext.Set<PriceListBJ>() var oldPrices = _settleAccountDbContext.Set<PriceListBJ>()
@ -71,14 +97,14 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
.Where(t => importLus.Contains(t.LU)) .Where(t => importLus.Contains(t.LU))
.ToList(); .ToList();
//系统中合同日期比导入文件中的合同日期晚 //系统中合同日期比导入文件中的合同日期晚
var oldpriceNewDate = from oldprice in oldPrices var oldPriceNewDate = from oldprice in oldPrices
from newprice in newPrice from newprice in newPrice
where oldprice.LU == newprice.LU && oldprice.Date > newprice.Date where oldprice.LU == newprice.LU && oldprice.Date > newprice.Date
select oldprice; select oldprice;
oldPrices.ForEach(t => t.IsCancel = true); oldPrices.ForEach(t => t.IsCancel = true);
if (oldpriceNewDate.Any()) if (oldPriceNewDate.Any())
{ {
oldPrices.FindAll(t => oldpriceNewDate.Contains(t)).ForEach(t => t.IsCancel = false); oldPrices.FindAll(t => oldPriceNewDate.Contains(t)).ForEach(t => t.IsCancel = false);
var importCancelLus = oldPrices.Select(t => t.LU).Distinct(); var importCancelLus = oldPrices.Select(t => t.LU).Distinct();
newPrice.FindAll(t => importCancelLus.Contains(t.LU)).ForEach(t => t.IsCancel = true); newPrice.FindAll(t => importCancelLus.Contains(t.LU)).ForEach(t => t.IsCancel = true);
} }
@ -102,6 +128,29 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
} }
/// <summary>
/// 价格表时间是否连续
/// </summary>
private List<PriceListBJ> CheckPriceListContinuity(List<PriceListBJ> priceList)
{
var pricelist = new List<PriceListBJ>();
if (priceList.Count <= 1)
{
return priceList; // 只有一个或零个价格条目
}
var sortedList = priceList.OrderBy(t => t.LU).ThenBy(t => t.BeginDate).ToList();
for (var i = 1; i < sortedList.Count; i++)
{
if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginDate != sortedList[i - 1].EndDate.AddDays(1))
{
priceList.Add(sortedList[i]);
}
}
return priceList; // 所有价格时间都连续
}
/// <summary> /// <summary>
/// 导出 /// 导出
/// </summary> /// </summary>

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

@ -577,7 +577,13 @@ namespace Win.Sfs.SettleAccount
/// </summary> /// </summary>
private void CreateMapPriceListBJ() private void CreateMapPriceListBJ()
{ {
CreateMap<PriceListBJImportDto, PriceListBJ>(); CreateMap<PriceListBJImportDto, PriceListBJ>()
.ForMember(x => x.LU, y => y.MapFrom(y => y.PartNo))
.ForMember(x => x.Price, y => y.MapFrom(y => y.TotalPrice))
.ForMember(x => x.BeginDate, y => y.MapFrom(y => y.ValidFrom))
.ForMember(x => x.EndDate, y => y.MapFrom(y => y.ValidTo))
.ForMember(x => x.ClientCode, y => y.MapFrom(y => y.Plant))
.ForMember(x => x.Date, y => y.MapFrom(y => DateTime.ParseExact(y.Date, "dd.MM.yyyy", System.Globalization.CultureInfo.CurrentCulture))); ;
CreateMap<PriceListBJ, PriceListBJDto>().ReverseMap(); CreateMap<PriceListBJ, PriceListBJDto>().ReverseMap();
CreateMap<PriceListBJ, PriceListBJRequestDto>().ReverseMap(); CreateMap<PriceListBJ, PriceListBJRequestDto>().ReverseMap();

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Consts/AppConst.cs

@ -9,4 +9,8 @@ public static class AppConst
/// 单页Sheet默认行数 /// 单页Sheet默认行数
/// </summary> /// </summary>
public const int DefaultRowNumberOnASheet = 500_000; public const int DefaultRowNumberOnASheet = 500_000;
/// <summary>
/// Db最大获取数量
/// </summary>
public const int DefaultPageSizeOnDb = 10_000;
} }

7
code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs

@ -16,5 +16,10 @@ public enum EnumMappingType
/// 完全匹配 /// 完全匹配
/// </summary> /// </summary>
[Display(Name = "完全匹配")] [Display(Name = "完全匹配")]
PerfectMatch = 1 PerfectMatch = 1,
/// <summary>
/// 部分匹配
/// </summary>
[Display(Name = "部分匹配")]
PartialMatch = 2
} }

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

@ -1,824 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Win.Sfs.SettleAccount.Enums;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// PUB结算与发运对比
/// </summary>
public class PubSaSeCompareDiff
{
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 日顺序号
/// </summary>
[Display(Name = "日顺序号")]
public string SeqNumber { get; set; }
/// <summary>
/// PJIS日顺序号
/// </summary>
[Display(Name = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
public DateTime? CustomerOfflineTime { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
public decimal? SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
public decimal? SEQty { get; set; }
/// <summary>
/// 生产号
/// </summary>
[Display(Name = "生产号")]
public string PN { set; get; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
public string LU { set; get; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
public string ToErpLocCode { get; set; }
/// <summary>
/// 类型
/// </summary>
[Display(Name = "类型")]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// 发运客户物料号
/// </summary>
public string SeCustomerPartCode { get; set; }
/// <summary>
/// 发运厂内物料号
/// </summary>
public string SeFactoryPartCode { get; set; }
/// <summary>
/// 结算客户物料号
/// </summary>
public string SaCustomerPartCode { get; set; }
/// <summary>
/// 结算厂内物料号
/// </summary>
public string SaFactoryPartCode { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内物料号
/// </summary>
[Display(Name = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 是否已经移除
/// </summary>
public bool IsRemove { get; set; }
}
/// <summary>
/// PUB结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExport
{
}
/// <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 PartCodeDesc { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { 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>
/// PUB结算与发运对比汇总
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareSumExport
{
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "LU")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { 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>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
}
/// <summary>
/// 直供件BBAC结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")]
public string PN { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "客户零件号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "零件描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
[Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "厂内零件号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? CustomerOfflineTime { 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>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 直供件HBPO结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")]
public string PN { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "客户零件号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "零件描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
[Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "厂内零件号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? CustomerOfflineTime { 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>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 买单件BBAC结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportMaiDanJianBBAC : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")]
public string PN { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "客户零件号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "零件描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
[Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "厂内零件号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? CustomerOfflineTime { 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>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 买单件HBPO结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")]
public string PN { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "客户零件号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "零件描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
[Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "厂内零件号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? CustomerOfflineTime { 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>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 备件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")]
public string PN { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "客户零件号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "零件描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
[Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "厂内零件号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? CustomerOfflineTime { 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>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 印度件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")]
public string PN { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
[ExporterHeader(DisplayName = "客户物料号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "厂内物料号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内物料号
/// </summary>
[Display(Name = "替换厂内物料号")]
[ExporterHeader(DisplayName = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? CustomerOfflineTime { 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>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}

116
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReport.cs

@ -0,0 +1,116 @@
using System;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Win.Sfs.SettleAccount.Enums;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 结算、发运明细对比报告
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeCompareDetailReport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "生产码")]
public virtual string PN { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "客户零件号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "零件描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
[Display(Name = "厂内零件号")]
[ExporterHeader(DisplayName = "厂内零件号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")]
public DateTime? CustomerOfflineTime { 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>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
/// <summary>
/// 是否是当期
/// </summary>
[Display(Name = "当期")]
[ValueMapping("当期数据", true)]
[ValueMapping("", false)]
public bool IsCurrent { get; set; }
}

19
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 备件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeCompareDetailReportBeiJian : SaSeCompareDetailReport
{
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")]
public override string PN { get; set; }
}

19
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 买单件BBAC结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeCompareDetailReportMaiDanJianBBAC : SaSeCompareDetailReport
{
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")]
public override string PN { get; set; }
}

19
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 买单件HBPO结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeCompareDetailReportMaiDanJianHBPO : SaSeCompareDetailReport
{
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")]
public override string PN { get; set; }
}

19
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 印度件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeCompareDetailReportYinDuJian : SaSeCompareDetailReport
{
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")]
public override string PN { get; set; }
}

19
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 直供件BBAC结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeCompareDetailReportZhiGongJianBBAC : SaSeCompareDetailReport
{
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")]
public override string PN { get; set; }
}

19
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 直供件HBPO结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeCompareDetailReportZhiGongJianHBPO : SaSeCompareDetailReport
{
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")]
public override string PN { get; set; }
}

153
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs

@ -0,0 +1,153 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win.Sfs.SettleAccount.Enums;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 结算、发运对比
/// </summary>
public class SaSeCompareDiff
{
/// <summary>
/// 期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 日顺序号
/// </summary>
[Display(Name = "日顺序号")]
public string SeqNumber { get; set; }
/// <summary>
/// PJIS日顺序号
/// </summary>
[Display(Name = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
public DateTime? CustomerOfflineTime { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
public decimal? SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
public decimal? SEQty { get; set; }
/// <summary>
/// 生产号
/// </summary>
[Display(Name = "生产号")]
public string PN { set; get; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
public string LU { set; get; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
public string ToErpLocCode { get; set; }
/// <summary>
/// 类型
/// </summary>
[Display(Name = "类型")]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// 发运客户物料号
/// </summary>
public string SeCustomerPartCode { get; set; }
/// <summary>
/// 发运厂内物料号
/// </summary>
public string SeFactoryPartCode { get; set; }
/// <summary>
/// 结算客户物料号
/// </summary>
public string SaCustomerPartCode { get; set; }
/// <summary>
/// 结算厂内物料号
/// </summary>
public string SaFactoryPartCode { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内物料号
/// </summary>
[Display(Name = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 是否已经移除
/// </summary>
public bool IsRemove { get; set; }
/// <summary>
/// 是否是当期
/// </summary>
public bool IsCurrent { get; set; }
}
/// <summary>
/// PUB结算与发运对比明细
/// </summary>
public interface IPubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// 零件描述
/// </summary>
[Display(Name = "零件描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 替换厂内零件号
/// </summary>
[Display(Name = "替换厂内零件号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
public decimal SEQty { get; set; }
}

46
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs

@ -0,0 +1,46 @@
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 结算、发运汇总对比报告
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeCompareSumReport
{
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "LU")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { 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>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
}

176
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs

@ -0,0 +1,176 @@
using System;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Win.Sfs.SettleAccount.Enums;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 结算、发运、Eid对比明细报告
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeEdiCompareDetailReport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运(有EDI数据)", 1)]
[ValueMapping("有结算有发运(无EDI数据)", 2)]
[ValueMapping("有结算无发运(有EDI数据)", 3)]
[ValueMapping("有结算无发运(无EDI数据)", 4)]
[ValueMapping("无结算有发运(有EDI数据)", 5)]
[ValueMapping("无结算有发运(无EDI数据)", 6)]
public EnumSaSeEdiCompareCategory Category { get; set; }
[Display(Name = "WMS多发")]
[ExporterHeader(DisplayName = "WMS多发")]
[ValueMapping("", 0)]
[ValueMapping("WMS多发", 1)]
public EnumWMSSend WMSSend
{
get
{
return (Category, SaSeQty < 0) switch
{
(EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, true) => EnumWMSSend.WMSRepeat,
(EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi, true) => EnumWMSSend.WMSRepeat,
_ => EnumWMSSend.None
};
}
}
[Display(Name = "价格信息")]
[ExporterHeader(DisplayName = "价格信息", IsIgnore = true)]
[ValueMapping("有价格信息", true)]
[ValueMapping("无价格信息", false)]
public bool IsHavePrice => FixPrice != null && FixPrice != 0;
/// <summary>
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "订单生产码")]
public string PN { get; set; }
/// <summary>
/// 日顺序号
/// </summary>
[Display(Name = "日顺序号")]
[ExporterHeader(DisplayName = "日顺序号")]
public string SeqNumber { get; set; }
/// <summary>
/// PJIS日顺序号
/// </summary>
[Display(Name = "PJIS日顺序号")]
[ExporterHeader(DisplayName = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
[ExporterHeader(DisplayName = "客户物料号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "厂内物料号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内物料号
/// </summary>
[Display(Name = "替换厂内物料号")]
[ExporterHeader(DisplayName = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 客户下线时间
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? CustomerOfflineTime { get; set; }
/// <summary>
/// 小总成号
/// </summary>
[Display(Name = "小总成号")]
[ExporterHeader(DisplayName = "小总成号")]
public string AssemblyCode { get; set; }
/// <summary>
/// 注塑码
/// </summary>
[Display(Name = "注塑码")]
[ExporterHeader(DisplayName = "注塑码")]
public string InjectionCode { 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>
/// Edi数量
/// </summary>
[Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; }
/// <summary>
/// 结算与WMS发货量差
/// </summary>
[ExporterHeader(DisplayName = "结算与WMS发货量差")]
public decimal SaSeQty => SAQty - SEQty;
/// <summary>
/// 结算与EDI量差
/// </summary>
[ExporterHeader(DisplayName = "结算与EDI量差")]
public decimal SaEdiQty => SAQty - EdiQty;
/// <summary>
/// WMS发货与EDI数量差
/// </summary>
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal SeEdiQty => SEQty - EdiQty;
[Display(Name = "是否完全匹配")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => SaSeQty == 0 && SaEdiQty == 0 && SeEdiQty == 0;
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价", IsIgnore = true)]
public decimal? FixPrice { get; set; }
/// <summary>
/// ERP销售库位
/// </summary>
[Display(Name = "ERP销售库位")]
[ExporterHeader(DisplayName = "ERP销售库位")]
public string ToErpLocCode { get; set; }
/// <summary>
/// WMS发货库位
/// </summary>
[Display(Name = "WMS发货库位")]
[ExporterHeader(DisplayName = "WMS发货库位")]
public string ToLocCode { get; set; }
}

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisBBAC.cs

@ -0,0 +1,8 @@
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// JisBBAC结算、发运、Eid明细对比报告
/// </summary>
public class SaSeEdiCompareDetailReportJisBBAC : SaSeEdiCompareDetailReport
{
}

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisHBPO.cs

@ -0,0 +1,8 @@
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// JisHBPO结算、发运、Eid明细对比报告
/// </summary>
public class SaSeEdiCompareDetailReportJisHBPO : SaSeEdiCompareDetailReport
{
}

436
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs

@ -1,7 +1,5 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Win.Sfs.SettleAccount.Enums; using Win.Sfs.SettleAccount.Enums;
namespace Win.Sfs.SettleAccount.Reports; namespace Win.Sfs.SettleAccount.Reports;
@ -121,18 +119,6 @@ public class SaSeEdiCompareDiff
/// </summary> /// </summary>
[Display(Name = "替换厂内物料号")] [Display(Name = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 是否替换了厂内零件号
/// </summary>
public bool IsReplace { get; set; }
}
/// <summary>
/// 结算、发运、Eid对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeEdiCompareDetailExport
{
} }
/// <summary> /// <summary>
@ -144,452 +130,30 @@ public interface ISaSeEdiCompareDetailExport
/// 类别 /// 类别
/// </summary> /// </summary>
[Display(Name = "类别")] [Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运(有EDI数据)", 1)]
[ValueMapping("有结算有发运(无EDI数据)", 2)]
[ValueMapping("有结算无发运(有EDI数据)", 3)]
[ValueMapping("有结算无发运(无EDI数据)", 4)]
[ValueMapping("无结算有发运(有EDI数据)", 5)]
[ValueMapping("无结算有发运(无EDI数据)", 6)]
public EnumSaSeEdiCompareCategory Category { get; set; } public EnumSaSeEdiCompareCategory Category { get; set; }
/// <summary> /// <summary>
/// 零件描述 /// 零件描述
/// </summary> /// </summary>
[Display(Name = "零件描述")] [Display(Name = "零件描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { get; set; } public string PartCodeDesc { get; set; }
/// <summary> /// <summary>
/// 替换厂内零件号 /// 替换厂内零件号
/// </summary> /// </summary>
[Display(Name = "替换厂内零件号")] [Display(Name = "替换厂内零件号")]
[ExporterHeader(DisplayName = "替换厂内零件号")]
public string ReplaceFactoryPartCode { 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>
/// Edi数量
/// </summary>
[Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; }
}
/// <summary>
/// JisBBAC结算、发运、Eid对比明细
/// </summary>
public class SaSeEdiCompareDetailExportJisBBAC : SaSeEdiCompareDetailExport, ISaSeEdiCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运(有EDI数据)", 1)]
[ValueMapping("有结算有发运(无EDI数据)", 2)]
[ValueMapping("有结算无发运(有EDI数据)", 3)]
[ValueMapping("有结算无发运(无EDI数据)", 4)]
[ValueMapping("无结算有发运(有EDI数据)", 5)]
[ValueMapping("无结算有发运(无EDI数据)", 6)]
public EnumSaSeEdiCompareCategory Category { get; set; }
[Display(Name = "WMS多发")]
[ExporterHeader(DisplayName = "WMS多发")]
[ValueMapping("", 0)]
[ValueMapping("WMS多发", 1)]
public EnumWMSSend WMSSend
{
get
{
return (Category, SaSeQty < 0) switch
{
(EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, true) => EnumWMSSend.WMSRepeat,
(EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi, true) => EnumWMSSend.WMSRepeat,
_ => EnumWMSSend.None
};
}
}
[Display(Name = "价格信息")]
[ExporterHeader(DisplayName = "价格信息")]
[ValueMapping("有价格信息", true)]
[ValueMapping("无价格信息", false)]
public bool IsHavePrice => FixPrice != null && FixPrice != 0;
/// <summary>
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "订单生产码")]
public string PN { get; set; }
/// <summary>
/// 日顺序号
/// </summary>
[Display(Name = "日顺序号")]
[ExporterHeader(DisplayName = "日顺序号")]
public string SeqNumber { get; set; }
/// <summary>
/// PJIS日顺序号
/// </summary>
[Display(Name = "PJIS日顺序号")]
[ExporterHeader(DisplayName = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
[ExporterHeader(DisplayName = "客户物料号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "厂内物料号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内物料号
/// </summary>
[Display(Name = "替换厂内物料号")]
[ExporterHeader(DisplayName = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 客户下线时间
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? CustomerOfflineTime { get; set; }
/// <summary>
/// 小总成号
/// </summary>
[Display(Name = "小总成号")]
[ExporterHeader(DisplayName = "小总成号")]
public string AssemblyCode { get; set; }
/// <summary>
/// 注塑码
/// </summary>
[Display(Name = "注塑码")]
[ExporterHeader(DisplayName = "注塑码")]
public string InjectionCode { 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>
/// Edi数量
/// </summary>
[Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; }
/// <summary>
/// 结算与WMS发货量差
/// </summary>
[ExporterHeader(DisplayName = "结算与WMS发货量差")]
public decimal SaSeQty => SAQty - SEQty;
/// <summary>
/// 结算与EDI量差
/// </summary>
[ExporterHeader(DisplayName = "结算与EDI量差")]
public decimal SaEdiQty => SAQty - EdiQty;
/// <summary>
/// WMS发货与EDI数量差
/// </summary>
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal SeEdiQty => SEQty - EdiQty;
[Display(Name = "是否完全匹配")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => SaSeQty == 0 && SaEdiQty == 0 && SeEdiQty == 0;
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public virtual decimal? FixPrice { get; set; }
/// <summary>
/// ERP销售库位
/// </summary>
[Display(Name = "ERP销售库位")]
[ExporterHeader(DisplayName = "ERP销售库位")]
public string ToErpLocCode { get; set; }
/// <summary>
/// WMS发货库位
/// </summary>
[Display(Name = "WMS发货库位")]
[ExporterHeader(DisplayName = "WMS发货库位")]
public string ToLocCode { get; set; }
}
/// <summary>
/// JisBBAC结算、发运、Eid对比明细物流
/// </summary>
public class SaSeEdiCompareDetailExportJisBBACWuLiu : SaSeEdiCompareDetailExportJisBBAC
{
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(IsIgnore = true)]
public override decimal? FixPrice { get; set; }
}
/// <summary>
/// JisHBPO结算、发运、Eid对比明细
/// </summary>
public class SaSeEdiCompareDetailExportJisHBPO : SaSeEdiCompareDetailExport, ISaSeEdiCompareDetailExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运(有EDI数据)", 1)]
[ValueMapping("有结算有发运(无EDI数据)", 2)]
[ValueMapping("有结算无发运(有EDI数据)", 3)]
[ValueMapping("有结算无发运(无EDI数据)", 4)]
[ValueMapping("无结算有发运(有EDI数据)", 5)]
[ValueMapping("无结算有发运(无EDI数据)", 6)]
public EnumSaSeEdiCompareCategory Category { get; set; }
[Display(Name = "WMS多发")]
[ExporterHeader(DisplayName = "WMS多发")]
[ValueMapping("", 0)]
[ValueMapping("WMS多发", 1)]
public EnumWMSSend WMSSend
{
get
{
return (Category, SaSeQty < 0) switch
{
(EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, true) => EnumWMSSend.WMSRepeat,
(EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi, true) => EnumWMSSend.WMSRepeat,
_ => EnumWMSSend.None
};
}
}
[Display(Name = "价格信息")]
[ExporterHeader(DisplayName = "价格信息")]
[ValueMapping("有价格信息", true)]
[ValueMapping("无价格信息", false)]
public bool IsHavePrice => FixPrice != null && FixPrice != 0;
/// <summary>
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "订单生产码")]
public string PN { get; set; }
/// <summary>
/// 日顺序号
/// </summary>
[Display(Name = "日顺序号")]
[ExporterHeader(DisplayName = "日顺序号")]
public string SeqNumber { get; set; }
/// <summary>
/// PJIS日顺序号
/// </summary>
[Display(Name = "PJIS日顺序号")]
[ExporterHeader(DisplayName = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; }
/// <summary>
/// 客户物料号
/// </summary>
[Display(Name = "客户物料号")]
[ExporterHeader(DisplayName = "客户物料号")]
public string CustomerPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { get; set; }
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "厂内物料号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 替换厂内物料号
/// </summary>
[Display(Name = "替换厂内物料号")]
[ExporterHeader(DisplayName = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary> /// <summary>
/// 客户下线时间
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? CustomerOfflineTime { get; set; }
/// <summary>
/// 小总成号
/// </summary>
[Display(Name = "小总成号")]
[ExporterHeader(DisplayName = "小总成号")]
public string AssemblyCode { get; set; }
/// <summary>
/// 注塑码
/// </summary>
[Display(Name = "注塑码")]
[ExporterHeader(DisplayName = "注塑码")]
public string InjectionCode { get; set; }
/// <summary>
/// 结算数量 /// 结算数量
/// </summary> /// </summary>
[Display(Name = "结算数量")] [Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; } public decimal SAQty { get; set; }
/// <summary> /// <summary>
/// 发货数量 /// 发货数量
/// </summary> /// </summary>
[Display(Name = "发货数量")] [Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; } public decimal SEQty { get; set; }
/// <summary> /// <summary>
/// Edi数量 /// Edi数量
/// </summary> /// </summary>
[Display(Name = "Edi数量")] [Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; } public decimal EdiQty { get; set; }
/// <summary>
/// 结算与EDI量差
/// </summary>
[ExporterHeader(DisplayName = "结算与WMS发货量差")]
public decimal SaSeQty => SAQty - SEQty;
/// <summary>
/// 结算与EDI量差
/// </summary>
[ExporterHeader(DisplayName = "结算与EDI量差")]
public decimal SaEdiQty => SAQty - EdiQty;
/// <summary>
/// WMS发货与EDI数量差
/// </summary>
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal SeEdiQty => SEQty - EdiQty;
[Display(Name = "是否完全匹配")]
[ExporterHeader(DisplayName = "是否完全匹配")]
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => SaSeQty == 0 && SaEdiQty == 0 && SeEdiQty == 0;
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public virtual decimal? FixPrice { get; set; }
/// <summary>
/// ERP销售库位
/// </summary>
[Display(Name = "ERP销售库位")]
[ExporterHeader(DisplayName = "ERP销售库位")]
public string ToErpLocCode { get; set; }
/// <summary>
/// WMS发货库位
/// </summary>
[Display(Name = "WMS发货库位")]
[ExporterHeader(DisplayName = "WMS发货库位")]
public string ToLocCode { get; set; }
}
/// <summary>
/// JisHBPO结算、发运、Eid对比明细物流
/// </summary>
public class SaSeEdiCompareDetailExportJisHBPOWuLiu : SaSeEdiCompareDetailExportJisHBPO
{
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(IsIgnore = true)]
public override decimal? FixPrice { get; set; }
}
/// <summary>
/// PUB结算与发运对比汇总
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeEdiCompareSumExport
{
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "LU")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { 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>
/// Edi数量
/// </summary>
[Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; }
/// <summary>
/// 结算与EDI量差
/// </summary>
[ExporterHeader(DisplayName = "结算与EDI量差")]
public decimal SaEdiQty => SAQty - EdiQty;
/// <summary>
/// WMS发货与EDI数量差
/// </summary>
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal SeEdiQty => SEQty - EdiQty;
} }

53
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareSumReport.cs

@ -0,0 +1,53 @@
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// 结算、发运、Edi汇总对比报告
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class SaSeEdiCompareSumReport
{
/// <summary>
/// 厂内物料号
/// </summary>
[Display(Name = "厂内物料号")]
[ExporterHeader(DisplayName = "LU")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string PartCodeDesc { 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>
/// Edi数量
/// </summary>
[Display(Name = "Edi数量")]
[ExporterHeader(DisplayName = "Edi数量")]
public decimal EdiQty { get; set; }
/// <summary>
/// 结算与EDI量差
/// </summary>
[ExporterHeader(DisplayName = "结算与EDI量差")]
public decimal SaEdiQty => SAQty - EdiQty;
/// <summary>
/// WMS发货与EDI数量差
/// </summary>
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal SeEdiQty => SEQty - EdiQty;
}

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACSeEidCompareReport.cs → code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs

@ -3,9 +3,9 @@ using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports; namespace Win.Sfs.SettleAccount.Reports;
/// <summary> /// <summary>
/// JisBBAC 发运、Edi与对比导出 /// JisBBAC 发运、Edi与对比报告
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)] [ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class JisBBACSeEidCompareReport : SeEidCompareReport public class SeEidCompareReportJisBBAC : SeEidCompareReport
{ {
} }

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOSeEidCompareReport.cs → code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs

@ -6,6 +6,6 @@ namespace Win.Sfs.SettleAccount.Reports;
/// JisHBPO 发运、Edi与对比报告 /// JisHBPO 发运、Edi与对比报告
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)] [ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class JisHBPOSeEidCompareReport : SeEidCompareReport public class SeEidCompareReportJisHBPO : SeEidCompareReport
{ {
} }

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

@ -22,7 +22,7 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
/// <summary> /// <summary>
/// 获取差异 /// 获取差异
/// </summary> /// </summary>
public virtual List<PubSaSeCompareDiff> GetDetailDiffReportList(string businessType, string version, string seStartDateTime, string seEndDateTime) public virtual List<SaSeCompareDiff> GetDetailDiffReportList(string businessType, string version, string seStartDateTime, string seEndDateTime)
{ {
string strSeWhere = string.Empty; string strSeWhere = string.Empty;
if (!string.IsNullOrWhiteSpace(seStartDateTime)) if (!string.IsNullOrWhiteSpace(seStartDateTime))
@ -53,7 +53,7 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate,MAX(PartCode) PartCode 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,MAX(PartCode) PartCode 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;
"; ";
return DbConnection.Query<PubSaSeCompareDiff>(strSqlText, null, null, true, 1200, null).ToList(); return DbConnection.Query<SaSeCompareDiff>(strSqlText, null, null, true, 1200, null).ToList();
} }
public virtual List<InvoiceSettledDetailDiff> GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string cp7begin, string cp7end, string kennCode, string chassisNumber, string materialGroup) public virtual List<InvoiceSettledDetailDiff> GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string cp7begin, string cp7end, string kennCode, string chassisNumber, string materialGroup)

13
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs

@ -72,7 +72,6 @@ namespace SettleAccount.Job.Services.Report
var seStartDateTime = DateTime.Parse(strSeStartDateTime); var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault(); var filename = exportName.FirstOrDefault();
var isWuLiu = filename.StartsWith("物流");
var saSeEdiCompareDiffs = GetEdiSeSaCompareData(version, seStartDateTime, seEndDateTime); var saSeEdiCompareDiffs = GetEdiSeSaCompareData(version, seStartDateTime, seEndDateTime);
HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs); HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs);
@ -107,16 +106,8 @@ namespace SettleAccount.Job.Services.Report
saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
if (isWuLiu) var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailReportJisBBAC>>(saSeEdiCompareDiffs);
{ excelExporter = BindExcelExporter<SaSeEdiCompareDetailReportJisBBAC>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBACWuLiu>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisBBACWuLiu>(items, businessTypeDisplayName);
}
else
{
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBAC>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisBBAC>(items, businessTypeDisplayName);
}
var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();

2
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs

@ -60,7 +60,7 @@ namespace SettleAccount.Job.Services.Report
var seEndDateTime = DateTime.Parse(strSeEndDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault(); var filename = exportName.FirstOrDefault();
var excelExporter = GetSeEdiCompareData<BBAC_SE_DETAIL, BBAC_SE_EDI, JisBBACSeEidCompareReport>(seStartDateTime, seEndDateTime, businessTypeDisplayName); var excelExporter = GetSeEdiCompareData<BBAC_SE_DETAIL, BBAC_SE_EDI, SeEidCompareReportJisBBAC>(seStartDateTime, seEndDateTime, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true); _fileContainer.SaveAsync(filename, result.Result, true);

13
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs

@ -71,7 +71,6 @@ namespace SettleAccount.Job.Services.Report
var seStartDateTime = DateTime.Parse(strSeStartDateTime); var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault(); var filename = exportName.FirstOrDefault();
var isWuLiu = filename.StartsWith("物流");
var saSeEdiCompareDiffs = GetSaSeEdiCompareData(version, seStartDateTime, seEndDateTime); var saSeEdiCompareDiffs = GetSaSeEdiCompareData(version, seStartDateTime, seEndDateTime);
HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs); HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs);
@ -106,16 +105,8 @@ namespace SettleAccount.Job.Services.Report
saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
if (isWuLiu) var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailReportJisHBPO>>(saSeEdiCompareDiffs);
{ excelExporter = BindExcelExporter<SaSeEdiCompareDetailReportJisHBPO>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisHBPOWuLiu>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisHBPOWuLiu>(items, businessTypeDisplayName);
}
else
{
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisHBPO>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisHBPO>(items, businessTypeDisplayName);
}
var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();

2
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs

@ -54,7 +54,7 @@ namespace SettleAccount.Job.Services.Report
var seEndDateTime = DateTime.Parse(strSeEndDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault(); var filename = exportName.FirstOrDefault();
var excelExporter = GetSeEdiCompareData<HBPO_SE_DETAIL, HBPO_SE_EDI, JisHBPOSeEidCompareReport>(seStartDateTime, seEndDateTime, businessTypeDisplayName); var excelExporter = GetSeEdiCompareData<HBPO_SE_DETAIL, HBPO_SE_EDI, SeEidCompareReportJisHBPO>(seStartDateTime, seEndDateTime, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true); _fileContainer.SaveAsync(filename, result.Result, true);

14
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs

@ -83,10 +83,10 @@ namespace SettleAccount.Job.Services.Report
{ {
//二次匹配 匹配上的厂内零件号、PN //二次匹配 匹配上的厂内零件号、PN
var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN });
pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); pubSaSeCompareDiffs.RemoveAll<SaSeCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN }));
pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes);
//二次对比比对上的数据入库 //二次对比比对上的数据入库
var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes); var pubSeCDetailEntitys = _objectMapper.Map<List<SaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
_settleAccountDbContext.Set<PUB_SEC_DETAIL>().AddRange(pubSeCDetailEntitys); _settleAccountDbContext.Set<PUB_SEC_DETAIL>().AddRange(pubSeCDetailEntitys);
} }
#endregion #endregion
@ -105,8 +105,8 @@ namespace SettleAccount.Job.Services.Report
} }
pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianBBAC>>(pubSaSeCompareDiffs); var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportMaiDanJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianBBAC>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<SaSeCompareDetailReportMaiDanJianBBAC>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
@ -120,7 +120,7 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 获取结算与发运比对数据 /// 获取结算与发运比对数据
/// </summary> /// </summary>
public List<PubSaSeCompareDiff> GetSaSeCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime) public List<SaSeCompareDiff> GetSaSeCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime)
{ {
//结算 //结算
var saGroup = from sa in _settleAccountDbContext.Set<BBAC_SA_DETAIL>() var saGroup = from sa in _settleAccountDbContext.Set<BBAC_SA_DETAIL>()
@ -156,7 +156,7 @@ namespace SettleAccount.Job.Services.Report
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp into temp
from se in temp.DefaultIfEmpty() from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff() select new SaSeCompareDiff()
{ {
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
@ -177,7 +177,7 @@ namespace SettleAccount.Job.Services.Report
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace } on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace }
into temp into temp
from sa in temp.DefaultIfEmpty() from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff() select new SaSeCompareDiff()
{ {
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,

14
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs

@ -83,10 +83,10 @@ namespace SettleAccount.Job.Services.Report
{ {
//二次匹配 匹配上的厂内零件号、PN //二次匹配 匹配上的厂内零件号、PN
var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN });
pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); pubSaSeCompareDiffs.RemoveAll<SaSeCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN }));
pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes);
//二次对比比对上的数据入库 //二次对比比对上的数据入库
var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes); var pubSeCDetailEntitys = _objectMapper.Map<List<SaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
_settleAccountDbContext.Set<PUB_SEC_DETAIL>().AddRange(pubSeCDetailEntitys); _settleAccountDbContext.Set<PUB_SEC_DETAIL>().AddRange(pubSeCDetailEntitys);
} }
#endregion #endregion
@ -105,8 +105,8 @@ namespace SettleAccount.Job.Services.Report
} }
pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDiffs); var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportMaiDanJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<SaSeCompareDetailReportMaiDanJianHBPO>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
@ -120,7 +120,7 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 获取结算与发运比对数据 /// 获取结算与发运比对数据
/// </summary> /// </summary>
public List<PubSaSeCompareDiff> GetSaSeCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime) public List<SaSeCompareDiff> GetSaSeCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime)
{ {
//结算 //结算
var saGroup = from sa in _settleAccountDbContext.Set<HBPO_SA_DETAIL>() var saGroup = from sa in _settleAccountDbContext.Set<HBPO_SA_DETAIL>()
@ -156,7 +156,7 @@ namespace SettleAccount.Job.Services.Report
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp into temp
from se in temp.DefaultIfEmpty() from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff() select new SaSeCompareDiff()
{ {
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
@ -177,7 +177,7 @@ namespace SettleAccount.Job.Services.Report
on new { se.PN, se.LU } equals new { sa.PN, sa.LU } on new { se.PN, se.LU } equals new { sa.PN, sa.LU }
into temp into temp
from sa in temp.DefaultIfEmpty() from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff() select new SaSeCompareDiff()
{ {
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,

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

@ -1,12 +1,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Drawing;
using System.Linq; using System.Linq;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions; using Microsoft.OpenApi.Extensions;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
using ShardingCore.Extensions;
using Shouldly; using Shouldly;
using TaskJob.EventArgs; using TaskJob.EventArgs;
using TaskJob.Interfaces; using TaskJob.Interfaces;
@ -111,16 +113,18 @@ namespace SettleAccount.Job.Services.Report
{ {
//二次匹配 匹配上的厂内零件号、PN //二次匹配 匹配上的厂内零件号、PN
var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN });
pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); pubSaSeCompareDiffs.RemoveAll<SaSeCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN }));
pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes);
//二次对比比对上的数据入库 //二次对比比对上的数据入库
var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes); var pubSeCDetailEntitys = _objectMapper.Map<List<SaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
_settleAccountDbContext.Set<PUB_SEC_DETAIL>().AddRange(pubSeCDetailEntitys); _settleAccountDbContext.Set<PUB_SEC_DETAIL>().AddRange(pubSeCDetailEntitys);
} }
#endregion #endregion
#region 结算数据处理 #region 结算数据处理
HandleSaDetails<PUB_CAN_SA_DETAIL, PUB_NOT_SA_DETAIL>(pubSaSeCompareDiffs, businessType, version); HandleSaDetails<PUB_CAN_SA_DETAIL, PUB_NOT_SA_DETAIL>(pubSaSeCompareDiffs, businessType, version);
HandleSaDetailsMain<PUB_SA_DETAIL>(pubSaSeCompareDiffs, businessType, version);
#endregion #endregion
if (string.IsNullOrEmpty(lu) == false) if (string.IsNullOrEmpty(lu) == false)
@ -131,6 +135,7 @@ namespace SettleAccount.Job.Services.Report
{ {
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn); pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn);
} }
pubSaSeCompareDiffs.FindAll(t => t.Version == version).ForEach(t => t.IsCurrent = true);
pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
@ -139,26 +144,26 @@ namespace SettleAccount.Job.Services.Report
{ {
case EnumBusinessType.ZhiGongJianBBAC: case EnumBusinessType.ZhiGongJianBBAC:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianBBAC>>(pubSaSeCompareDiffs); var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportZhiGongJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBAC>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<SaSeCompareDetailReportZhiGongJianBBAC>(items, businessTypeDisplayName);
} }
break; break;
case EnumBusinessType.ZhiGongJianHBPO: case EnumBusinessType.ZhiGongJianHBPO:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianHBPO>>(pubSaSeCompareDiffs); var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportZhiGongJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPO>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<SaSeCompareDetailReportZhiGongJianHBPO>(items, businessTypeDisplayName);
} }
break; break;
case EnumBusinessType.BeiJian: case EnumBusinessType.BeiJian:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportBeiJian>>(pubSaSeCompareDiffs); var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportBeiJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJian>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<SaSeCompareDetailReportBeiJian>(items, businessTypeDisplayName);
} }
break; break;
case EnumBusinessType.YinDuJian: case EnumBusinessType.YinDuJian:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportYinDuJian>>(pubSaSeCompareDiffs); var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportYinDuJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJian>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<SaSeCompareDetailReportYinDuJian>(items, businessTypeDisplayName);
} }
break; break;
default: default:
@ -178,7 +183,8 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 获取比对数据 /// 获取比对数据
/// </summary> /// </summary>
public List<PubSaSeCompareDiff> GetSaSeCompareData(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime) [Obsolete]
private List<SaSeCompareDiff> GetSaSeCompareDataOld(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime)
{ {
//印度件LU对比 //印度件LU对比
if (businessType == EnumBusinessType.YinDuJian) if (businessType == EnumBusinessType.YinDuJian)
@ -219,7 +225,7 @@ namespace SettleAccount.Job.Services.Report
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp into temp
from se in temp.DefaultIfEmpty() from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff() select new SaSeCompareDiff()
{ {
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
@ -240,7 +246,7 @@ namespace SettleAccount.Job.Services.Report
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace } on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace }
into temp into temp
from sa in temp.DefaultIfEmpty() from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff() select new SaSeCompareDiff()
{ {
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
@ -264,7 +270,121 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 获取比对数据 /// 获取比对数据
/// </summary> /// </summary>
public List<PubSaSeCompareDiff> GetSaSeCompareDataYinDu(int version, DateTime seStartDateTime, DateTime seEndDateTime) private List<SaSeCompareDiff> GetSaSeCompareData(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime)
{
//印度件LU对比
if (businessType == EnumBusinessType.YinDuJian)
{
return GetSaSeCompareDataYinDu(version, seStartDateTime, seEndDateTime);
}
//结算
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == businessType
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
Version = groupItem.Max(t => t.Version),
LU = groupItem.Max(t => t.LU),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
var saGroupByVersion = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == businessType && sa.Version == version
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
Version = groupItem.Max(t => t.Version),
LU = groupItem.Max(t => t.LU),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
//发运
var seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>()
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
WmsBillNum = groupItem.Max(t => t.WmsBillNum),
ShippingDate = groupItem.Max(t => t.ShippingDate),
FactoryPartCode = groupItem.Max(t => t.FactoryPartCode),
ToLocCode = groupItem.Max(t => t.ToLocCode),
ToErpLocCode = groupItem.Max(t => t.ToErpLocCode)
};
//有结算无发运
var haveSaNotHaveSeList = (from sa in saGroup
join se in seGroup
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp
from se in temp.DefaultIfEmpty()
where se.PN == null
select new SaSeCompareDiff()
{
Version = sa.Version,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
SAQty = sa.Qty,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU
}).ToList();
//无结算有发运
var notHaveSaHaveSeList = (from se in seGroup
join sa in saGroup
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace }
into temp
from sa in temp.DefaultIfEmpty()
where sa.PN == null
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
PN = se.PN,
SEQty = se.Qty,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
CustomerPartCode = se.LU
}).ToList();
//有结算有发运
var haveSaHaveSeList = (from sa in saGroupByVersion
from se in seGroup
where sa.PN == se.PN && sa.CustomerPartCodeNoSpace == se.CustomerPartCodeNoSpace
select new SaSeCompareDiff()
{
Version = sa.Version,
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
CustomerOfflineTime = sa.SettleDate,
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
SeFactoryPartCode = se.FactoryPartCode,
SaCustomerPartCode = sa.CustomerPartCodeNoSpace,
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU
}).ToList();
return haveSaHaveSeList.Union(haveSaNotHaveSeList).Union(notHaveSaHaveSeList).ToList();
}
/// <summary>
/// 获取比对数据
/// </summary>
private List<SaSeCompareDiff> GetSaSeCompareDataYinDu(int version, DateTime seStartDateTime, DateTime seEndDateTime)
{ {
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>() var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == EnumBusinessType.YinDuJian && sa.Version == version where sa.BusinessType == EnumBusinessType.YinDuJian && sa.Version == version
@ -297,7 +417,7 @@ namespace SettleAccount.Job.Services.Report
on sa.CustomerPartCodeNoSpace equals se.CustomerPartCodeNoSpace on sa.CustomerPartCodeNoSpace equals se.CustomerPartCodeNoSpace
into temp into temp
from se in temp.DefaultIfEmpty() from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff() select new SaSeCompareDiff()
{ {
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,
@ -317,7 +437,7 @@ namespace SettleAccount.Job.Services.Report
on se.CustomerPartCodeNoSpace equals sa.CustomerPartCodeNoSpace on se.CustomerPartCodeNoSpace equals sa.CustomerPartCodeNoSpace
into temp into temp
from sa in temp.DefaultIfEmpty() from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff() select new SaSeCompareDiff()
{ {
WmsBillNum = se.WmsBillNum, WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate, ShippingDate = se.ShippingDate,

32
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

@ -35,7 +35,7 @@ namespace SettleAccount.Job.Services.Report
_settleAccountDbContext = settleAccountDbContext; _settleAccountDbContext = settleAccountDbContext;
} }
public virtual void HandlePubSaSeCompareDiffList(List<PubSaSeCompareDiff> pubSaSeCompareDiffs) public virtual void HandlePubSaSeCompareDiffList(List<SaSeCompareDiff> pubSaSeCompareDiffs)
{ {
pubSaSeCompareDiffs.ForEach(p => pubSaSeCompareDiffs.ForEach(p =>
{ {
@ -77,10 +77,10 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 二次比对 /// 二次比对
/// </summary> /// </summary>
public virtual List<PubSaSeCompareDiff> HandleSecondCompare(List<PubSaSeCompareDiff> pubSaSeCompareDiffs, EnumBusinessType businessType) public virtual List<SaSeCompareDiff> HandleSecondCompare(List<SaSeCompareDiff> pubSaSeCompareDiffs, EnumBusinessType businessType)
{ {
//二次匹配上的记录 //二次匹配上的记录
var secondMatchHaveSaHaveSes = new List<PubSaSeCompareDiff>(); var secondMatchHaveSaHaveSes = new List<SaSeCompareDiff>();
//有结算无发运 和 无结算有发运 //有结算无发运 和 无结算有发运
var haveSaNotHaveSeUnionNotHaveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe || t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe); var haveSaNotHaveSeUnionNotHaveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe || t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe);
//有结算无发运 //有结算无发运
@ -104,7 +104,7 @@ namespace SettleAccount.Job.Services.Report
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes
join haveSaNotHaveSe in haveSaNotHaveSes join haveSaNotHaveSe in haveSaNotHaveSes
on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode } on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode }
select new PubSaSeCompareDiff() select new SaSeCompareDiff()
{ {
WmsBillNum = notHaveSaHaveSe.WmsBillNum, WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate, ShippingDate = notHaveSaHaveSe.ShippingDate,
@ -133,7 +133,7 @@ namespace SettleAccount.Job.Services.Report
/// 结算数据处理 /// 结算数据处理
/// 写入库位、替换零件号 /// 写入库位、替换零件号
/// </summary> /// </summary>
public virtual void HandleSaDetails<TCanSa, TNotSa>(List<PubSaSeCompareDiff> pubSaSeCompareDiffs, EnumBusinessType businessType, int version) public virtual void HandleSaDetails<TCanSa, TNotSa>(List<SaSeCompareDiff> pubSaSeCompareDiffs, EnumBusinessType businessType, int version)
where TCanSa : SA_CAN_BASE where TCanSa : SA_CAN_BASE
where TNotSa : SA_NOT_BASE where TNotSa : SA_NOT_BASE
{ {
@ -177,7 +177,7 @@ namespace SettleAccount.Job.Services.Report
/// 处理发运数据 /// 处理发运数据
/// 结算、发运对比上的数据修改结算数据状态 /// 结算、发运对比上的数据修改结算数据状态
/// </summary> /// </summary>
public virtual void HandLeSaDetailsMain<T>(List<PubSaSeCompareDiff> pubSaSeCompareDiffs, EnumBusinessType businessType, int version) where T : SA_BASE public virtual void HandleSaDetailsMain<T>(List<SaSeCompareDiff> pubSaSeCompareDiffs, EnumBusinessType businessType, int version) where T : SA_BASE
{ {
var haveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe); var haveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
if (haveSaHaveSes.Any()) if (haveSaHaveSes.Any())
@ -185,6 +185,7 @@ namespace SettleAccount.Job.Services.Report
//结算详情 //结算详情
var saDetails = _settleAccountDbContext.Set<T>() var saDetails = _settleAccountDbContext.Set<T>()
.Where(t => t.BusinessType == businessType) .Where(t => t.BusinessType == businessType)
.Where(t => t.MappingType == EnumMappingType.None)
.Where(t => t.Version == version) .Where(t => t.Version == version)
.ToList(); .ToList();
if (saDetails.Any()) if (saDetails.Any())
@ -193,17 +194,14 @@ namespace SettleAccount.Job.Services.Report
{ {
var mappingType = (i.SAQty - i.SEQty) switch var mappingType = (i.SAQty - i.SEQty) switch
{ {
> 0 => EnumMappingType.None,
0 => EnumMappingType.PerfectMatch, 0 => EnumMappingType.PerfectMatch,
< 0 => EnumMappingType.None, > 0 or < 0 => EnumMappingType.PartialMatch,
_ => default, _ => default,
}; };
o.ExtraProperties.Add("MappingType", mappingType); o.MappingType = mappingType;
return o; return o;
}).ToList(); }).ToList();
_settleAccountDbContext.BulkUpdate(saDetailsUpdate); _settleAccountDbContext.BulkUpdate(saDetailsUpdate);
_settleAccountDbContext.Set<BBAC_SA_DETAIL>().FromSqlInterpolated($"SELECT * FROM dbo.Blogs");
_settleAccountDbContext.Database.ExecuteSqlInterpolated($"SELECT * FROM dbo.Blogs");
} }
} }
} }
@ -211,7 +209,7 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 创建导出文件结构 /// 创建导出文件结构
/// </summary> /// </summary>
public ExcelExporter BindExcelExporter<T>(List<T> saSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport, new() public ExcelExporter BindExcelExporter<T>(List<T> saSeCompareDetailExports, string businessTypeDisplayName) where T : SaSeCompareDetailReport, new()
{ {
//详情Sheet行数 //详情Sheet行数
var detailMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; var detailMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
@ -223,14 +221,14 @@ namespace SettleAccount.Job.Services.Report
//汇总Sheet行数 //汇总Sheet行数
var sumMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; var sumMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
var sumExportExporterAttribute = typeof(PubSaSeCompareSumExport).GetAttribute<ExcelExporterAttribute>(inherit: true); var sumExportExporterAttribute = typeof(SaSeCompareSumReport).GetAttribute<ExcelExporterAttribute>(inherit: true);
if (sumExportExporterAttribute != null) if (sumExportExporterAttribute != null)
{ {
sumMaxRowNumberOnASheet = sumExportExporterAttribute.MaxRowNumberOnASheet > 0 ? sumExportExporterAttribute.MaxRowNumberOnASheet : sumMaxRowNumberOnASheet; sumMaxRowNumberOnASheet = sumExportExporterAttribute.MaxRowNumberOnASheet > 0 ? sumExportExporterAttribute.MaxRowNumberOnASheet : sumMaxRowNumberOnASheet;
} }
//结算核对汇总 //结算核对汇总
var saSeCompareSumExports = saSeCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() var saSeCompareSumExports = saSeCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeCompareSumReport()
{ {
FactoryPartCode = p.Key, FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
@ -241,7 +239,7 @@ namespace SettleAccount.Job.Services.Report
//有结算有发运 //有结算有发运
var haveSaHaveSeExports = saSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe); var haveSaHaveSeExports = saSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
//有结算有发运汇总 //有结算有发运汇总
var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeCompareSumReport()
{ {
FactoryPartCode = p.Key, FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
@ -251,7 +249,7 @@ namespace SettleAccount.Job.Services.Report
//有结算无发运 //有结算无发运
var haveSaNotHaveSeExports = saSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe); var haveSaNotHaveSeExports = saSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe);
//有结算无发运 //有结算无发运
var haveSaNotHaveSeSumExports = haveSaNotHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() var haveSaNotHaveSeSumExports = haveSaNotHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeCompareSumReport()
{ {
FactoryPartCode = p.Key, FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
@ -261,7 +259,7 @@ namespace SettleAccount.Job.Services.Report
//无结算有发运 //无结算有发运
var notHaveSaHaveSeExports = saSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe); var notHaveSaHaveSeExports = saSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe);
//无结算有发运 //无结算有发运
var notHaveSaHaveSeSumExports = notHaveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() var notHaveSaHaveSeSumExports = notHaveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeCompareSumReport()
{ {
FactoryPartCode = p.Key, FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,

12
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs

@ -179,7 +179,7 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 创建导出文件结构 /// 创建导出文件结构
/// </summary> /// </summary>
public ExcelExporter BindExcelExporter<T>(List<T> saSeEdiCompareDetailExports, string businessTypeDisplayName) where T : SaSeEdiCompareDetailExport, ISaSeEdiCompareDetailExport, new() public ExcelExporter BindExcelExporter<T>(List<T> saSeEdiCompareDetailExports, string businessTypeDisplayName) where T : SaSeEdiCompareDetailReport, new()
{ {
//详情Sheet行数 //详情Sheet行数
var detailMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; var detailMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
@ -191,14 +191,14 @@ namespace SettleAccount.Job.Services.Report
//汇总Sheet行数 //汇总Sheet行数
var sumMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; var sumMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
var sumExportExporterAttribute = typeof(SaSeEdiCompareSumExport).GetAttribute<ExcelExporterAttribute>(inherit: true); var sumExportExporterAttribute = typeof(SaSeEdiCompareSumReport).GetAttribute<ExcelExporterAttribute>(inherit: true);
if (sumExportExporterAttribute != null) if (sumExportExporterAttribute != null)
{ {
sumMaxRowNumberOnASheet = sumExportExporterAttribute.MaxRowNumberOnASheet > 0 ? sumExportExporterAttribute.MaxRowNumberOnASheet : sumMaxRowNumberOnASheet; sumMaxRowNumberOnASheet = sumExportExporterAttribute.MaxRowNumberOnASheet > 0 ? sumExportExporterAttribute.MaxRowNumberOnASheet : sumMaxRowNumberOnASheet;
} }
//汇总 //汇总
var saSeEdiCompareSumExports = saSeEdiCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumExport() var saSeEdiCompareSumExports = saSeEdiCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumReport()
{ {
FactoryPartCode = p.Key, FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
@ -210,7 +210,7 @@ namespace SettleAccount.Job.Services.Report
//有结算有发运 //有结算有发运
var haveSaHaveSeExports = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi }.Contains(t.Category)); var haveSaHaveSeExports = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi }.Contains(t.Category));
//有结算有发运汇总 //有结算有发运汇总
var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumExport() var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumReport()
{ {
FactoryPartCode = p.Key, FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
@ -221,7 +221,7 @@ namespace SettleAccount.Job.Services.Report
//有结算无发运 //有结算无发运
var haveSaNotHaveSeExports = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaNotHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaNotHaveSeNotHaveEdi }.Contains(t.Category)); var haveSaNotHaveSeExports = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.HaveSaNotHaveSeHaveEdi, EnumSaSeEdiCompareCategory.HaveSaNotHaveSeNotHaveEdi }.Contains(t.Category));
//有结算无发运 //有结算无发运
var haveSaNotHaveSeSumExports = haveSaNotHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumExport() var haveSaNotHaveSeSumExports = haveSaNotHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumReport()
{ {
FactoryPartCode = p.Key, FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
@ -232,7 +232,7 @@ namespace SettleAccount.Job.Services.Report
//无结算有发运 //无结算有发运
var notHaveSaHaveSeExports = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.NotHaveSaHaveSeHaveEdi, EnumSaSeEdiCompareCategory.NotHaveSaHaveSeNotHaveEdi }.Contains(t.Category)); var notHaveSaHaveSeExports = saSeEdiCompareDetailExports.FindAll(t => new EnumSaSeEdiCompareCategory[] { EnumSaSeEdiCompareCategory.NotHaveSaHaveSeHaveEdi, EnumSaSeEdiCompareCategory.NotHaveSaHaveSeNotHaveEdi }.Contains(t.Category));
//无结算有发运 //无结算有发运
var notHaveSaHaveSeSumExports = notHaveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumExport() var notHaveSaHaveSeSumExports = notHaveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeEdiCompareSumReport()
{ {
FactoryPartCode = p.Key, FactoryPartCode = p.Key,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc, PartCodeDesc = p.FirstOrDefault().PartCodeDesc,

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

@ -28,8 +28,8 @@ namespace SettleAccount.Job
/// </summary> /// </summary>
public void CreateMapSaSeEdiCompare() public void CreateMapSaSeEdiCompare()
{ {
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailExportJisBBAC>(); CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailReportJisBBAC>();
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailExportJisHBPO>(); CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailReportJisHBPO>();
CreateMap<SaSeEdiCompareDiff, BBAC_SEC_DETAIL>(); CreateMap<SaSeEdiCompareDiff, BBAC_SEC_DETAIL>();
CreateMap<SaSeEdiCompareDiff, HBPO_SEC_DETAIL>(); CreateMap<SaSeEdiCompareDiff, HBPO_SEC_DETAIL>();
} }
@ -39,13 +39,13 @@ namespace SettleAccount.Job
/// </summary> /// </summary>
private void CreateMapSaSeCompare() private void CreateMapSaSeCompare()
{ {
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianBBAC>(); CreateMap<SaSeCompareDiff, SaSeCompareDetailReportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianHBPO>(); CreateMap<SaSeCompareDiff, SaSeCompareDetailReportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianBBAC>(); CreateMap<SaSeCompareDiff, SaSeCompareDetailReportMaiDanJianBBAC>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianHBPO>(); CreateMap<SaSeCompareDiff, SaSeCompareDetailReportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportBeiJian>(); CreateMap<SaSeCompareDiff, SaSeCompareDetailReportBeiJian>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportYinDuJian>(); CreateMap<SaSeCompareDiff, SaSeCompareDetailReportYinDuJian>();
CreateMap<PubSaSeCompareDiff, PUB_SEC_DETAIL>(); CreateMap<SaSeCompareDiff, PUB_SEC_DETAIL>();
} }
} }
} }

Loading…
Cancel
Save