From 88de8897fd27232f63c8fb675031a870b0fc8691 Mon Sep 17 00:00:00 2001 From: mahao Date: Sat, 19 Aug 2023 15:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E4=BE=9B=E4=BB=B6=E6=AF=94=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/PUB_SA_SERVICE.cs | 16 +- .../Entities/Prices/PriceListAppService.cs | 4 +- .../Entities/Prices/PriceListAppServiceBJ.cs | 6 +- .../Reports/PubSaSeCompareDiff.cs | 338 ++++++++---------- .../Report/PubSaSeCompareDapperRepository.cs | 14 +- .../Report/PubSaSeCompareExportService.cs | 56 ++- 6 files changed, 217 insertions(+), 217 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs index 5efff9cf..83c56586 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs @@ -245,7 +245,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase { try { - var pubSaDelItems = await GetPubSaDelItemsAsync(id); + var pubSaDelItems = await GetPubSaDelItemsAsync(id).ConfigureAwait(false); pubSas.AddRange(pubSaDelItems.pubSas); pubSaDetails.AddRange(pubSaDelItems.pubSaDetails); @@ -460,6 +460,19 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase //验证客户对应厂内零件号是否存在 //导入的零件号集合 var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct(); + + importPubSaLUs.ForEach(importPubSaLU => + { + List lus = importPubSaLU.Split(" ").ToList(); + importPubSaLU = lus[0].Replace(" ", ""); + if (lus.Count > 1) + { + lus.RemoveAt(0); + var luAssemble = lus.Select(t => t.Replace(" ", "")); + importPubSaLU += luAssemble.Aggregate(" ", (current, index) => current + index); + } + }); + var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); @@ -646,6 +659,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase List pubNotSaDetails = new List(); var pubSaEntity = await _repository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false); + //var pubSaEntity = await _repository.FindAsync(id).ConfigureAwait(false); if (pubSaEntity != null) { //结算单据 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index 421b32ec..bd9933d4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -103,8 +103,8 @@ public class PriceListAppService : SettleAccountApplicationBase return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); } #endregion - var lus = entityList.Select(p => new { p.LU, p.ContractNo }); - var priceListModelEntitys = _priceListRepository.Where(t => lus.Contains(new { t.LU, t.ContractNo })).ToList(); + var lus = entityList.Select(p => p.LU); + var priceListModelEntitys = _priceListRepository.Where(t => t.ContractNo == contractNo && lus.Contains(t.ContractNo)).ToList(); if (priceListModelEntitys.Any()) { await _priceListRepository.DeleteManyAsync(priceListModelEntitys).ConfigureAwait(false); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index 0820aa74..8aebcf64 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc; using Shouldly; using System; using System.Collections.Generic; +using System.Diagnostics.Contracts; using System.Linq; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; @@ -61,6 +62,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var entityList = ObjectMapper.Map, List>(result); entityList = entityList.GroupBy(p => new { p.LU, p.ClientCode, p.BeginDate, p.EndDate }).Select(p => p.FirstOrDefault()).ToList(); + var contractNo = entityList.FirstOrDefault().ContractNo; #region 校验 if (entityList.Any()) @@ -81,8 +83,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName }); } #endregion - var lus = entityList.Select(p => new { p.LU, p.ContractNo }); - var priceListModelEntitys = _repository.Where(t => lus.Contains(new { t.LU, t.ContractNo })).ToList(); + var lus = entityList.Select(p => p.LU); + var priceListModelEntitys = _repository.Where(t => t.ContractNo == contractNo && lus.Contains(t.ContractNo)).ToList(); if (priceListModelEntitys.Any()) { await _repository.DeleteManyAsync(priceListModelEntitys).ConfigureAwait(false); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs index ed591c3f..46a65036 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs @@ -16,109 +16,107 @@ public class PubSaSeCompareDiff /// [Display(Name = "Wms发货单号")] public string WmsBillNum { get; set; } - /// /// 发货日期 /// [Display(Name = "发货日期")] public DateTime ShippingDate { get; set; } - /// /// 日顺序号 /// [Display(Name = "日顺序号")] public string SeqNumber { get; set; } - /// /// PJIS日顺序号 /// [Display(Name = "PJIS日顺序号")] public string PJISSeqNumber { get; set; } - - /// - /// 物料号 - /// - [Display(Name = "物料号")] - public string MaterialNumber { get; set; } - - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - public string MaterialDes { get; set; } - /// /// 结算数据中的过账日期 /// [Display(Name = "客户下线时间")] public DateTime CustomerOfflineTime { get; set; } - /// /// 结算数量 /// [Display(Name = "结算数量")] public decimal SAQty { get; set; } - /// /// 发货数量 /// [Display(Name = "发货数量")] public decimal SEQty { get; set; } - /// /// 差异数量 /// [Display(Name = "差异数量")] public decimal DiffQty => SAQty - SEQty; - /// /// 匹配类型 /// [Display(Name = "匹配类型")] public string MateType { get; set; } - /// /// 定价 /// [Display(Name = "定价")] public decimal FixPrice { get; set; } - /// - /// 原始零件号 + /// 生产号 /// - [Display(Name = "原始零件号")] - public string PrimitiveLU { get; set; } - + [Display(Name = "生产号")] + public string PN { set; get; } /// - /// 替换零件号 + /// WMS目标库位 /// - [Display(Name = "替换零件号")] - public string ReplaceLU { get; set; } - + [Display(Name = "WMS目标库位")] + public string ToLocCode { get; set; } /// - /// 零件号 + /// ERP目标库位 /// - [Display(Name = "零件号")] - public string SeLU { set; get; } - + [Display(Name = "ERP目标库位")] + public string ToErpLocCode { get; set; } /// - /// 零件号 + /// 类型 /// - [Display(Name = "零件号")] - public string SaLU { set; get; } - + [Display(Name = "类型")] + public EnumPubSaSeCompareCategory Category { get; set; } /// - /// 生产号 + /// 发运客户物料号 /// - [Display(Name = "生产号")] - public string PN { set; get; } - + public string SeCustomerPartCode { get; set; } /// - /// 类型 + /// 发运厂内物料号 /// - [Display(Name = "类型")] - public EnumPubSaSeCompareCategory Category { get; set; } - + public string SeFactoryPartCode { get; set; } + /// + /// 结算客户物料号 + /// + public string SaCustomerPartCode { get; set; } + /// + /// 结算厂内物料号 + /// + public string SaFactoryPartCode { get; set; } + /// + /// 客户物料号 + /// + [Display(Name = "客户物料号")] + public string CustomerPartCode { get; set; } + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + public string PartCodeDesc { get; set; } + /// + /// 厂内物料号 + /// + [Display(Name = "厂内物料号")] + public string FactoryPartCode { get; set; } + /// + /// 替换厂内物料号 + /// + [Display(Name = "替换厂内物料号")] + public string ReplaceFactoryPartCode { get; set; } /// /// 是否已经移除 /// @@ -172,35 +170,30 @@ public class PubSaSeCompareDetailExport2 [Display(Name = "生产码")] [ExporterHeader(DisplayName = "ASN发货单号")] public string PN { get; set; } - /// - /// 物料号 + /// 客户零件号 /// - [Display(Name = "物料号")] - [ExporterHeader(DisplayName = "厂内物料号")] - public string MaterialNumber { get; set; } - + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string CustomerPartCode { get; set; } /// - /// 物料描述 + /// 零件描述 /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - + [Display(Name = "零件描述")] + [ExporterHeader(DisplayName = "零件描述")] + public string PartCodeDesc { get; set; } /// - /// 原始LU + /// 厂内零件号 /// - [Display(Name = "原始LU")] - [ExporterHeader(DisplayName = "原始LU")] - public string PrimitiveLU { get; set; } - + [Display(Name = "厂内零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] + public string FactoryPartCode { get; set; } /// - ///替换LU + /// 替换厂内零件号 /// - [Display(Name = "替换LU")] - [ExporterHeader(DisplayName = "替换LU")] - public string ReplaceLU { get; set; } - + [Display(Name = "替换厂内零件号")] + [ExporterHeader(DisplayName = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } /// /// 结算数据中的过账日期 /// @@ -288,21 +281,18 @@ public interface IPubSaSeCompareDetailExport [ValueMapping("有结算无发运", 2)] [ValueMapping("无结算有发运", 3)] public EnumPubSaSeCompareCategory Category { get; set; } - /// - /// 物料描述 + /// 零件描述 /// - [Display(Name = "物料描述")] + [Display(Name = "零件描述")] [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - + public string PartCodeDesc { get; set; } /// - ///替换LU + /// 替换厂内零件号 /// - [Display(Name = "替换LU")] - [ExporterHeader(DisplayName = "替换LU")] - public string ReplaceLU { get; set; } - + [Display(Name = "替换厂内零件号")] + [ExporterHeader(DisplayName = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } /// /// 结算数量 /// @@ -325,18 +315,18 @@ public interface IPubSaSeCompareDetailExport public class PubSaSeCompareSumExport { /// - /// LU + /// 厂内物料号 /// - [Display(Name = "LU")] + [Display(Name = "厂内物料号")] [ExporterHeader(DisplayName = "LU")] - public string LU { get; set; } + public string FactoryPartCode { get; set; } /// /// 物料描述 /// [Display(Name = "物料描述")] [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } + public string PartCodeDesc { get; set; } /// /// 结算数量 @@ -398,35 +388,30 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp [Display(Name = "生产码")] [ExporterHeader(DisplayName = "ASN发货单号")] public string PN { get; set; } - /// - /// 物料号 + /// 客户零件号 /// - [Display(Name = "物料号")] - [ExporterHeader(DisplayName = "厂内物料号")] - public string MaterialNumber { get; set; } - + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string CustomerPartCode { get; set; } /// - /// 物料描述 + /// 零件描述 /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - + [Display(Name = "零件描述")] + [ExporterHeader(DisplayName = "零件描述")] + public string PartCodeDesc { get; set; } /// - /// 原始LU + /// 厂内零件号 /// - [Display(Name = "原始LU")] - [ExporterHeader(DisplayName = "原始LU")] - public string PrimitiveLU { get; set; } - + [Display(Name = "厂内零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] + public string FactoryPartCode { get; set; } /// - ///替换LU + /// 替换厂内零件号 /// - [Display(Name = "替换LU")] - [ExporterHeader(DisplayName = "替换LU")] - public string ReplaceLU { get; set; } - + [Display(Name = "替换厂内零件号")] + [ExporterHeader(DisplayName = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } /// /// 结算数据中的过账日期 /// @@ -522,35 +507,30 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp [Display(Name = "生产码")] [ExporterHeader(DisplayName = "ASN发货单号")] public string PN { get; set; } - /// - /// 物料号 + /// 客户零件号 /// - [Display(Name = "物料号")] - [ExporterHeader(DisplayName = "厂内物料号")] - public string MaterialNumber { get; set; } - + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string CustomerPartCode { get; set; } /// - /// 物料描述 + /// 零件描述 /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - + [Display(Name = "零件描述")] + [ExporterHeader(DisplayName = "零件描述")] + public string PartCodeDesc { get; set; } /// - /// 原始LU + /// 厂内零件号 /// - [Display(Name = "原始LU")] - [ExporterHeader(DisplayName = "原始LU")] - public string PrimitiveLU { get; set; } - + [Display(Name = "厂内零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] + public string FactoryPartCode { get; set; } /// - ///替换LU + /// 替换厂内零件号 /// - [Display(Name = "替换LU")] - [ExporterHeader(DisplayName = "替换LU")] - public string ReplaceLU { get; set; } - + [Display(Name = "替换厂内零件号")] + [ExporterHeader(DisplayName = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } /// /// 结算数据中的过账日期 /// @@ -646,35 +626,30 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo [Display(Name = "生产码")] [ExporterHeader(DisplayName = "索引号")] public string PN { get; set; } - /// - /// 物料号 + /// 客户零件号 /// - [Display(Name = "物料号")] - [ExporterHeader(DisplayName = "厂内物料号")] - public string MaterialNumber { get; set; } - + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string CustomerPartCode { get; set; } /// - /// 物料描述 + /// 零件描述 /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - + [Display(Name = "零件描述")] + [ExporterHeader(DisplayName = "零件描述")] + public string PartCodeDesc { get; set; } /// - /// 原始LU + /// 厂内零件号 /// - [Display(Name = "原始LU")] - [ExporterHeader(DisplayName = "原始LU")] - public string PrimitiveLU { get; set; } - + [Display(Name = "厂内零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] + public string FactoryPartCode { get; set; } /// - ///替换LU + /// 替换厂内零件号 /// - [Display(Name = "替换LU")] - [ExporterHeader(DisplayName = "替换LU")] - public string ReplaceLU { get; set; } - + [Display(Name = "替换厂内零件号")] + [ExporterHeader(DisplayName = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } /// /// 结算数据中的过账日期 /// @@ -770,35 +745,30 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPu [Display(Name = "生产码")] [ExporterHeader(DisplayName = "索引号")] public string PN { get; set; } - /// - /// 物料号 + /// 客户零件号 /// - [Display(Name = "物料号")] - [ExporterHeader(DisplayName = "厂内物料号")] - public string MaterialNumber { get; set; } - + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string CustomerPartCode { get; set; } /// - /// 物料描述 + /// 零件描述 /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - + [Display(Name = "零件描述")] + [ExporterHeader(DisplayName = "零件描述")] + public string PartCodeDesc { get; set; } /// - /// 原始LU + /// 厂内零件号 /// - [Display(Name = "原始LU")] - [ExporterHeader(DisplayName = "原始LU")] - public string PrimitiveLU { get; set; } - + [Display(Name = "厂内零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] + public string FactoryPartCode { get; set; } /// - ///替换LU + /// 替换厂内零件号 /// - [Display(Name = "替换LU")] - [ExporterHeader(DisplayName = "替换LU")] - public string ReplaceLU { get; set; } - + [Display(Name = "替换厂内零件号")] + [ExporterHeader(DisplayName = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } /// /// 结算数据中的过账日期 /// @@ -894,83 +864,71 @@ public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, I [Display(Name = "生产码")] [ExporterHeader(DisplayName = "ASN发货单号")] public string PN { get; set; } - /// - /// 物料号 + /// 客户物料号 /// - [Display(Name = "物料号")] - [ExporterHeader(DisplayName = "厂内物料号")] - public string MaterialNumber { get; set; } - + [Display(Name = "客户物料号")] + [ExporterHeader(DisplayName = "客户物料号")] + public string CustomerPartCode { get; set; } /// /// 物料描述 /// [Display(Name = "物料描述")] [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - + public string PartCodeDesc { get; set; } /// - /// 原始LU + /// 厂内物料号 /// - [Display(Name = "原始LU")] - [ExporterHeader(DisplayName = "原始LU")] - public string PrimitiveLU { get; set; } - + [Display(Name = "厂内物料号")] + [ExporterHeader(DisplayName = "厂内物料号")] + public string FactoryPartCode { get; set; } /// - ///替换LU + /// 替换厂内物料号 /// - [Display(Name = "替换LU")] - [ExporterHeader(DisplayName = "替换LU")] - public string ReplaceLU { get; set; } - + [Display(Name = "替换厂内物料号")] + [ExporterHeader(DisplayName = "替换厂内物料号")] + public string ReplaceFactoryPartCode { get; set; } /// /// 结算数据中的过账日期 /// [Display(Name = "客户下线时间")] [ExporterHeader(DisplayName = "客户下线时间")] public DateTime CustomerOfflineTime { get; set; } - /// /// 结算数量 /// [Display(Name = "结算数量")] [ExporterHeader(DisplayName = "结算数量")] public decimal SAQty { get; set; } - /// /// 发货数量 /// [Display(Name = "发货数量")] [ExporterHeader(DisplayName = "WMS发货数量")] public decimal SEQty { get; set; } - /// /// 差异数量 /// [ExporterHeader(DisplayName = "差异数量")] public decimal DiffQty => SAQty - SEQty; - /// /// 匹配类型 /// [Display(Name = "匹配类型")] [ExporterHeader(DisplayName = "是否完全匹配")] public string MateType { get; set; } - /// /// 定价 /// [Display(Name = "定价")] [ExporterHeader(DisplayName = "定价")] public decimal FixPrice { get; set; } - /// /// WMS目标库位 /// [Display(Name = "WMS目标库位")] [ExporterHeader(DisplayName = "WMS目标库位")] public string ToLocCode { get; set; } - /// /// ERP目标库位 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs index f1f50c37..f337e0c0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs @@ -35,15 +35,13 @@ public class PubSaSeCompareDapperRepository : DapperRepository(strSqlText, null, null, true, 1200, null).ToList(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs index efe27c63..b4e93ea4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs @@ -108,13 +108,41 @@ namespace SettleAccount.Job.Services.Report pubSaSeCompareDiffs.ForEach(p => { - p.Category = (string.IsNullOrEmpty(p.SaLU), string.IsNullOrEmpty(p.SeLU)) switch + p.Category = (string.IsNullOrEmpty(p.SaCustomerPartCode), string.IsNullOrEmpty(p.SeCustomerPartCode)) switch { (false, false) => EnumPubSaSeCompareCategory.HaveSaHaveSe, (false, true) => EnumPubSaSeCompareCategory.HaveSaNotHaveSe, (true, false) => EnumPubSaSeCompareCategory.NotHaveSaHaveSe, _ => EnumPubSaSeCompareCategory.None, }; + switch (p.Category) + { + case EnumPubSaSeCompareCategory.None: + break; + case EnumPubSaSeCompareCategory.HaveSaHaveSe: + { + p.CustomerPartCode = p.SaCustomerPartCode; + p.FactoryPartCode = p.SaFactoryPartCode; + p.ReplaceFactoryPartCode = p.SaFactoryPartCode; + } + break; + case EnumPubSaSeCompareCategory.HaveSaNotHaveSe: + { + p.CustomerPartCode = p.SaCustomerPartCode; + p.FactoryPartCode = p.SaFactoryPartCode; + p.ReplaceFactoryPartCode = p.SaFactoryPartCode; + } + break; + case EnumPubSaSeCompareCategory.NotHaveSaHaveSe: + { + p.CustomerPartCode = p.SeCustomerPartCode; + p.FactoryPartCode = p.SeFactoryPartCode; + p.ReplaceFactoryPartCode = p.SeFactoryPartCode; + } + break; + default: + break; + } }); //有结算有发运 @@ -187,7 +215,7 @@ namespace SettleAccount.Job.Services.Report if (string.IsNullOrEmpty(lu) == false) { - pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.SaLU == lu || p.SeLU == lu); + pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.CustomerPartCode == lu); } if (string.IsNullOrEmpty(pn) == false) { @@ -247,10 +275,10 @@ namespace SettleAccount.Job.Services.Report public ExcelExporter BindExcelExporter(List pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport, new() { //结算核对汇总 - var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() + var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() { - LU = p.Key, - MaterialDes = p.FirstOrDefault().MaterialDes, + FactoryPartCode = p.Key, + PartCodeDesc = p.FirstOrDefault().PartCodeDesc, SAQty = p.Sum(t => t.SAQty), SEQty = p.Sum(t => t.SEQty) }).ToList(); @@ -258,30 +286,30 @@ namespace SettleAccount.Job.Services.Report //有结算有发运 var haveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe); //有结算有发运汇总 - var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() + var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() { - LU = p.Key, - MaterialDes = p.FirstOrDefault().MaterialDes, + FactoryPartCode = p.Key, + PartCodeDesc = p.FirstOrDefault().PartCodeDesc, SAQty = p.Sum(t => t.SAQty), SEQty = p.Sum(t => t.SEQty) }).ToList(); //有结算无发运 var haveSaNotHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe); //有结算无发运 - var haveSaNotHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() + var haveSaNotHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() { - LU = p.Key, - MaterialDes = p.FirstOrDefault().MaterialDes, + FactoryPartCode = p.Key, + PartCodeDesc = p.FirstOrDefault().PartCodeDesc, SAQty = p.Sum(t => t.SAQty), SEQty = p.Sum(t => t.SEQty) }).ToList(); //无结算有发运 var notHaveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe); //无结算有发运 - var notHaveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() + var notHaveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() { - LU = p.Key, - MaterialDes = p.FirstOrDefault().MaterialDes, + FactoryPartCode = p.Key, + PartCodeDesc = p.FirstOrDefault().PartCodeDesc, SAQty = p.Sum(t => t.SAQty), SEQty = p.Sum(t => t.SEQty) }).ToList();