diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs
index e862b2ea..734e7d56 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs
@@ -1,4 +1,4 @@
-using Magicodes.ExporterAndImporter.Core;
+using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
index a4534840..07693f0c 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
@@ -179,14 +179,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 零件号
///
[Display(Name = "零件号")]
- [Required(ErrorMessage = "{0}不能为空")]
public string LU { get; set; }
///
/// 通用码
///
[Display(Name = "通用码")]
- [Required(ErrorMessage = "{0}不能为空")]
public string PN { get; set; }
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs
index 21e7396d..9cd66ac4 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs
@@ -17,7 +17,7 @@ public class HBPO_SA_DETAIL_SERVICE
/// HBPO结算与发运比对
///
[HttpPost]
- public async Task BBACSaSeCompare(JisSaSeCompareRequestDto jisSaSeCompareRequestDto)
+ public async Task HBPOSaSeCompare(JisSaSeCompareRequestDto jisSaSeCompareRequestDto)
{
await Task.CompletedTask;
throw new NotImplementedException();
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
index 1e21d8f3..329a6a43 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
@@ -120,6 +120,8 @@ public class PUB_SA_DETAIL_SERVICE : SettleAccountApplicationBase
List customConditionList = new List();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = pubSaSeCompareRequestDto.Version });
customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)pubSaSeCompareRequestDto.BusinessType).ToString() });
+ customConditionList.Add(new CustomCondition() { Name = "LU", Value = pubSaSeCompareRequestDto.LU });
+ customConditionList.Add(new CustomCondition() { Name = "PN", Value = pubSaSeCompareRequestDto.PN });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName });
var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, pubSaSeCompareRequestDto.Version, string.Empty, CurrentUser, typeof(PubSaSeCompareExportService), customConditionList, (rs) =>
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumPubSaSeCompareCategory.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumPubSaSeCompareCategory.cs
new file mode 100644
index 00000000..617c4727
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumPubSaSeCompareCategory.cs
@@ -0,0 +1,33 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Win.Sfs.SettleAccount.Enums;
+
+///
+/// Pub结算与发运比对类型
+///
+public enum EnumPubSaSeCompareCategory
+{
+ ///
+ /// 未定义
+ ///
+ [Display(Name = "未定义")]
+ None = 0,
+
+ ///
+ /// 有结算有发运
+ ///
+ [Display(Name = "有结算有发运")]
+ HaveSaHaveSe = 1,
+
+ ///
+ /// 有结算无发运
+ ///
+ [Display(Name = "有结算无发运")]
+ HaveSaNotHaveSe = 2,
+
+ ///
+ /// 无结算有发运
+ ///
+ [Display(Name = "无结算有发运")]
+ NotHaveSaHaveSe = 3
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccount.Domain.Shared.csproj b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccount.Domain.Shared.csproj
index 9084e5c7..113ed56d 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccount.Domain.Shared.csproj
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccount.Domain.Shared.csproj
@@ -34,8 +34,4 @@
-
-
-
-
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 4baeb2ea..8dcb049b 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
@@ -2,15 +2,294 @@ using System.ComponentModel.DataAnnotations;
using System;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
+using Win.Sfs.SettleAccount.Enums;
namespace Win.Sfs.SettleAccount.Reports;
-[ExcelExporter(MaxRowNumberOnASheet = 900000)]
+///
+/// PUB结算与发运对比
+///
public class PubSaSeCompareDiff
{
- //[Display(Name = "LU+ASN单号")]
- //public string KeyCode { get; set; } = null!;
+ ///
+ /// Wms发货单号
+ ///
+ [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; }
+ ///
+ /// 差异数量
+ ///
+ [ExporterHeader(DisplayName = "差异数量")]
+ public decimal DiffQty { set; get; }
+
+ [Display(Name = "匹配类型")]
+ public string MateType { get; set; }
+
+ ///
+ /// 定价
+ ///
+ [Display(Name = "定价")]
+ public decimal FixPrice { get; set; }
+
+ ///
+ /// 替换零件号
+ ///
+ [Display(Name = "替换零件号")]
+ public string RepLU { get; set; }
+
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ public string SeLU { set; get; }
+
+ ///
+ /// 生产号
+ ///
+ [Display(Name = "生产号")]
+ public string SePN { set; get; }
+
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ public string SaLU { set; get; }
+
+ ///
+ /// 生产号
+ ///
+ [Display(Name = "生产号")]
+ public string SaPN { set; get; }
+
+ ///
+ /// 类型
+ ///
+ [Display(Name = "类型")]
+ public EnumPubSaSeCompareCategory Category { get; set; }
+
+ ///
+ /// 是否已经移除
+ ///
+ public bool IsRemove { get; set; }
+}
+
+///
+/// PUB结算与发运对比明细
+///
+[ExcelExporter(MaxRowNumberOnASheet = 900000)]
+public class PubSaSeCompareDetailExport
+{
+ ///
+ /// 类别
+ /// 有结算有发运
+ /// 有结算无发运
+ /// 无结算有发运
+ ///
+ [Display(Name = "类别")]
+ [ExporterHeader(DisplayName = "类别")]
+ [ValueMapping("有结算有发运", 1)]
+ [ValueMapping("有结算无发运", 2)]
+ [ValueMapping("无结算有发运", 3)]
+ public EnumPubSaSeCompareCategory Category { get; set; }
+
+ ///
+ /// Wms发货单号
+ ///
+ [Display(Name = "Wms发货单号")]
+ [ExporterHeader(DisplayName = "交货单号")]
+ public string WmsBillNum { get; set; }
+
+ ///
+ ///
+ ///
+ [Display(Name = "发货日期")]
+ [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
+ public DateTime ShippingDate { get; set; }
+
+ ///
+ /// 生产码
+ ///
+ [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 MaterialDes { get; set; }
+
+ ///
+ /// 原始LU
+ ///
+ [Display(Name = "原始LU")]
+ [ExporterHeader(DisplayName = "原始LU")]
+ public string PrimitiveLU { get; set; }
+
+ ///
+ ///替换LU
+ ///
+ [Display(Name = "替换LU")]
+ [ExporterHeader(DisplayName = "替换LU")]
+ public string ReplaceLU { 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 { set; get; }
+
+ ///
+ /// 匹配类型
+ ///
+ [Display(Name = "匹配类型")]
+ [ExporterHeader(DisplayName = "是否完全匹配")]
+ public string MateType { get; set; }
+
+ ///
+ /// 定价
+ ///
+ [Display(Name = "定价")]
+ [ExporterHeader(DisplayName = "定价")]
+ public decimal FixPrice { get; set; }
+
+ ///
+ /// 日顺序号
+ ///
+ [Display(Name = "日顺序号")]
+ [ExporterHeader(DisplayName = "日顺序号")]
+ public string SeqNumber { get; set; }
+
+ ///
+ /// PJIS日顺序号
+ ///
+ [Display(Name = "PJIS日顺序号")]
+ [ExporterHeader(DisplayName = "PJIS日顺序号")]
+ public string PJISSeqNumber { get; set; }
+}
+
+///
+/// PUB结算与发运对比汇总
+///
+[ExcelExporter(MaxRowNumberOnASheet = 900000)]
+public class PubSaSeCompareSumExport
+{
+ ///
+ /// LU
+ ///
+ [Display(Name = "LU")]
+ [ExporterHeader(DisplayName = "LU")]
+ public string LU { get; set; }
+
+ ///
+ /// 物料描述
+ ///
+ [Display(Name = "物料描述")]
+ [ExporterHeader(DisplayName = "物料描述")]
+ public string MaterialDes { 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 { set; get; }
+}
+
+[ExcelExporter(MaxRowNumberOnASheet = 900000)]
+public class PubSaSeCompareDiffExport222
+{
///
/// 有结算无发货(无EDI数据)
///有结算无发货(有EDI数据)
@@ -23,31 +302,28 @@ public class PubSaSeCompareDiff
///有结算有发货(WMS多发)
///
[Display(Name = "类别")]
- public string Category { get; set; } = null!;
-
- //[Display(Name = "Wms发货单号")]
- //public string WmsBillNum { get; set; } = null!;
+ public string Category { get; set; }
- //[Display(Name = "发货时间")]
- //public DateTime ShippingDate { get; set; }
+ [Display(Name = "Wms发货单号")]
+ public string WmsBillNum { get; set; }
- //[Display(Name = "生产码")]
- //public string PN { get; set; } = null!;
+ [Display(Name = "发货日期")]
+ public DateTime ShippingDate { get; set; }
- [Display(Name = "日顺序号")]
- public string SeqNumber { get; set; } = null!;
-
- [Display(Name = "PJIS日顺序号")]
- public string PJISSeqNumber { get; set; } = null!;
+ [Display(Name = "生产码")]
+ public string PN { get; set; }
[Display(Name = "物料号")]
- public string MaterialNumber { get; set; } = null!;
+ public string MaterialNumber { get; set; }
[Display(Name = "物料描述")]
- public string MaterialDes { get; set; } = null!;
+ public string MaterialDes { get; set; }
- //[Display(Name = "零件号")]
- //public string LU { get; set; } = null!;
+ [Display(Name = "原始LU")]
+ public string PrimitiveLU { get; set; }
+
+ [Display(Name = "替换LU")]
+ public string ReplaceLU { get; set; }
///
/// 结算数据中的过账日期
@@ -55,24 +331,59 @@ public class PubSaSeCompareDiff
[Display(Name = "客户下线时间")]
public DateTime CustomerOfflineTime { get; set; }
- [Display(Name = "小总成号")]
- public string AssemblyCode { get; set; }
-
- [Display(Name = "注塑码")]
- public string InjectionCode { get; set; }
-
[Display(Name = "结算数量")]
public decimal SAQty { get; set; }
[Display(Name = "发货数量")]
public decimal SEQty { get; set; }
+ ///
+ /// 差异数量
+ ///
+ [ExporterHeader(DisplayName = "差异数量")]
+ public decimal DiffQty { set; get; }
+
[Display(Name = "匹配类型")]
public string MateType { get; set; }
[Display(Name = "定价")]
public decimal FixPrice { get; set; }
+ [Display(Name = "PJIS日顺序号")]
+ public string PJISSeqNumber { get; set; }
+
+
+
+
+
+
+ [Display(Name = "日顺序号")]
+ public string SeqNumber { get; set; }
+
+
+
+
+
+
+
+
+
+ //[Display(Name = "零件号")]
+ //public string LU { get; set; } = null!;
+
+
+
+ [Display(Name = "小总成号")]
+ public string AssemblyCode { get; set; }
+
+ [Display(Name = "注塑码")]
+ public string InjectionCode { get; set; }
+
+
+
+
+
+
[Display(Name = "期间")]
public int Version { get; set; }
@@ -116,9 +427,5 @@ public class PubSaSeCompareDiff
[ExporterHeader(DisplayName = "发运数量")]
public decimal SeQty { set; get; }
- ///
- /// 差异数量
- ///
- [ExporterHeader(DisplayName = "差异数量")]
- public decimal DiffQty { set; get; }
+
}
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 434e09b5..a80e96f6 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
@@ -1,20 +1,24 @@
using System;
using System.Collections.Generic;
-using Magicodes.ExporterAndImporter.Excel;
+using System.ComponentModel.DataAnnotations;
using System.Linq;
+using Magicodes.ExporterAndImporter.Excel;
+using Microsoft.OpenApi.Extensions;
+using NetTopologySuite.Operation.Buffer;
+using SettleAccount.Domain.BQ;
+using Shouldly;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
+using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
+using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
-using Win.Sfs.Shared.RepositoryBase;
-using SettleAccount.Domain.BQ;
-using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
-using Shouldly;
-using Volo.Abp.BlobStoring;
-using Win.Sfs.SettleAccount.Reports;
-using Newtonsoft.Json.Schema;
using Win.Sfs.SettleAccount;
-using Win.Sfs.SettleAccount.Entities.Prices;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+using Win.Sfs.SettleAccount.Enums;
+using Win.Sfs.SettleAccount.Reports;
+using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
+using Win.Sfs.Shared.RepositoryBase;
namespace SettleAccount.Job.Services.Report
{
@@ -42,6 +46,8 @@ namespace SettleAccount.Job.Services.Report
private readonly IBlobContainer _fileContainer;
+ private readonly IObjectMapper _objectMapper;
+
///
/// 构造
///
@@ -49,25 +55,54 @@ namespace SettleAccount.Job.Services.Report
INormalEfCoreRepository pubSeDetailRepository,
INormalEfCoreRepository tbRePartsRelationshipRepository,
PubSaSeCompareDapperRepository pubSaSeCompareDapperRepository,
- IBlobContainer fileContainer)
+ IBlobContainer fileContainer,
+ IObjectMapper objectMapper)
{
_pubSaDetailRepository = pubSaDetailRepository;
_pubSeDetailRepository = pubSeDetailRepository;
_tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
_pubSaSeCompareDapperRepository = pubSaSeCompareDapperRepository;
_fileContainer = fileContainer;
+ _objectMapper = objectMapper;
}
///
/// 导出
+ /// 输出报表
+ /// 结算核对明细输出
+ /// 结算核对汇总输出
+ /// 有结算有发货明细输出
+ /// 有结算有发货汇总输出
+ /// 有结算无发货明细输出
+ /// 有结算无发货汇总输出
///
public string ExportFile(Guid id, List exportName, List property)
{
var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
var businessType = property.Where(t => t.Name == "BusinessType").FirstOrDefault().Value;
+ var lu = property.Where(p => p.Name == "LU").FirstOrDefault().Value;
+ var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value;
+
+ var businessTypeDisplayName = businessType.ToString();
+ DisplayAttribute attributeOfType = ((EnumBusinessType)Enum.Parse(typeof(EnumBusinessType), businessType)).GetAttributeOfType();
+ if (attributeOfType != null)
+ {
+ businessTypeDisplayName = attributeOfType.Name;
+ }
var filename = exportName.FirstOrDefault();
var pubSaSeCompareDiffs = _pubSaSeCompareDapperRepository.GetDetailDiffReportList(businessType);
+ pubSaSeCompareDiffs.ForEach(p =>
+ {
+ p.Category = (string.IsNullOrEmpty(p.SaLU), string.IsNullOrEmpty(p.SeLU)) switch
+ {
+ (false, false) => EnumPubSaSeCompareCategory.HaveSaHaveSe,
+ (false, true) => EnumPubSaSeCompareCategory.HaveSaNotHaveSe,
+ (true, false) => EnumPubSaSeCompareCategory.NotHaveSaHaveSe,
+ _ => EnumPubSaSeCompareCategory.None,
+ };
+ });
+
//有结算有发运
var haveSaHaveSe = new List();
//有结算无发运
@@ -79,9 +114,10 @@ namespace SettleAccount.Job.Services.Report
haveSaNotHaveSe = pubSaSeCompareDiffs.FindAll(t => !string.IsNullOrEmpty(t.SaLU) && string.IsNullOrEmpty(t.SeLU));
notHaveSaHaveSe = pubSaSeCompareDiffs.FindAll(t => string.IsNullOrEmpty(t.SaLU) && !string.IsNullOrEmpty(t.SeLU));
+ #region 二次对比
//二次对比(替换零件号)
var repLUs = notHaveSaHaveSe.Select(t => t.SeLU).Distinct().ToList();
- var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && ((int)t.BusinessType).ToString() == businessType).Result;
+ var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && ((int)t.BusinessType).ToString() == businessType).Result;
tbRePartsRelationships.ForEach(tbRePartsRelationship =>
{
@@ -91,9 +127,48 @@ namespace SettleAccount.Job.Services.Report
t.SeLU = tbRePartsRelationship.LU;
});
});
+ #endregion
+
+ if (string.IsNullOrEmpty(lu) == false)
+ {
+ pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.SaLU == lu || p.SeLU == lu);
+ }
+ if (string.IsNullOrEmpty(pn) == false)
+ {
+ pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.SaPN == pn || p.SePN == pn);
+ }
+
+ var pubSaSeCompareDiffExports = _objectMapper.Map, List>(pubSaSeCompareDiffs);
+
+ //有结算有发运
+ var haveSaHaveSeExports = pubSaSeCompareDiffExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
+ ////有结算有发运汇总
+ //var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
+ //{
+ // LU= p.Key,
+ // MaterialDes = p.FirstOrDefault().MaterialDes,
+ // SAQty =
+ //});
+ //有结算无发运
+ var haveSaNotHaveSeExports = pubSaSeCompareDiffExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe);
+ //无结算有发运
+ var notHaveSaHaveSeExports = pubSaSeCompareDiffExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe);
+ #region MyRegion
+ #endregion
+
+
+
+ //var add = from item1 in pubSaSeCompareDiffs
+ // join item2 in pubSaSeCompareDiffs
+ // on new { item1.SaLU, item1.SaPN }
+ // equals new { item2.SeLU, item2.SePN }
+ // into temp
+ // from itm3 in temp.DefaultIfEmpty()
+ // where itm3 == null
+ // select item1;
@@ -115,18 +190,19 @@ namespace SettleAccount.Job.Services.Report
//var query = BlobProviderSelectorExtensions
+
ExcelExporter excelExporter = new ExcelExporter();
var result = excelExporter
- .Append(pubSaSeCompareDiffs, "汇总表")
+ .Append(pubSaSeCompareDiffExports, $"{businessTypeDisplayName}汇总表")
.SeparateBySheet()
- .Append(haveSaHaveSe, "有结算有发运")
+ .Append(haveSaHaveSeExports, $"{businessTypeDisplayName}有结算有发运")
.SeparateBySheet()
- .Append(haveSaNotHaveSe, "有结算无发运")
+ .Append(haveSaNotHaveSeExports, $"{businessTypeDisplayName}有结算无发运")
.SeparateBySheet()
- .Append(notHaveSaHaveSe, "无结算有发运")
+ .Append(notHaveSaHaveSeExports, $"{businessTypeDisplayName}无结算有发运")
.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
- //_fileContainer.SaveAsync(filename, result.Result, true);
+ _fileContainer.SaveAsync(filename, result.Result, true);
return id.ToString();
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs
new file mode 100644
index 00000000..15bb71bf
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs
@@ -0,0 +1,21 @@
+using AutoMapper;
+using Win.Sfs.SettleAccount.Reports;
+
+namespace SettleAccount.Job
+{
+ public class SettleAccountJobAutoMapperProfile : Profile
+ {
+ public SettleAccountJobAutoMapperProfile()
+ {
+ CreateMapPubSaSeCompare();
+ }
+
+ ///
+ /// Pub结算与发运对比
+ ///
+ private void CreateMapPubSaSeCompare()
+ {
+ CreateMap().ReverseMap();
+ }
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs
index bcdd9f6f..14bdd971 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs
@@ -36,6 +36,7 @@ namespace Win.Sfs.SettleAccount
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
+ ConfigureAutoMapper();
GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute{ Attempts = 0});
context.Services.AddTransient();
@@ -263,5 +264,13 @@ namespace Win.Sfs.SettleAccount
});
}
+
+ ///
+ /// AutoMapper
+ ///
+ private void ConfigureAutoMapper()
+ {
+ Configure(options => { options.AddMaps(); });
+ }
}
}