wanggang 1 year ago
parent
commit
6db3d5dcd2
  1. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs
  2. 28
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  3. 28
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  4. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Consts/AppConst.cs
  5. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs
  6. 829
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  7. 116
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReport.cs
  8. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs
  9. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs
  10. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs
  11. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs
  12. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs
  13. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs
  14. 153
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs
  15. 46
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs
  16. 26
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs
  17. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs
  18. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs
  19. 4
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
  20. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs
  21. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs
  22. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs
  23. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs
  24. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs
  25. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs
  26. 46
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  27. 28
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs
  28. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

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()
{
var fileName = $"发运数据_{Guid.NewGuid()}.xlsx";
var haveEdiHaveSeList = new List<JisBBACSeEidCompareReport>();
var haveEdiHaveSeList = new List<SeEidCompareReportJisBBAC>();
for (int i = 0; i < 2_000_000; i++)
{
haveEdiHaveSeList.Add(new JisBBACSeEidCompareReport()
haveEdiHaveSeList.Add(new SeEidCompareReportJisBBAC()
{
Category = "JIS",
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;
if (jisBBACEidSeCompareEexcelExporterAttribute != null)
{

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

@ -95,6 +95,11 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
{
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)
{
@ -139,6 +144,29 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
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>

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

@ -78,6 +78,11 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
{
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)
{
@ -123,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>

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

@ -9,4 +9,8 @@ public static class AppConst
/// 单页Sheet默认行数
/// </summary>
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>
[Display(Name = "完全匹配")]
PerfectMatch = 1
PerfectMatch = 1,
/// <summary>
/// 部分匹配
/// </summary>
[Display(Name = "部分匹配")]
PartialMatch = 2
}

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

@ -1,829 +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>
/// 期间
/// </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>
/// 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;
}

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

@ -352,19 +352,6 @@ public class SaSeEdiCompareDetailExportJisBBAC : SaSeEdiCompareDetailExport, ISa
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>
@ -533,19 +520,6 @@ public class SaSeEdiCompareDetailExportJisHBPO : SaSeEdiCompareDetailExport, ISa
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>

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

@ -6,6 +6,6 @@ namespace Win.Sfs.SettleAccount.Reports;
/// JisBBAC 发运、Edi与对比导出
/// </summary>
[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与对比报告
/// </summary>
[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>
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;
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
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)

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 seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
var isWuLiu = filename.StartsWith("物流");
var saSeEdiCompareDiffs = GetEdiSeSaCompareData(version, seStartDateTime, seEndDateTime);
HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs);
@ -107,16 +106,8 @@ namespace SettleAccount.Job.Services.Report
saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter();
if (isWuLiu)
{
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 items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBAC>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisBBAC>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
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 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();
result.ShouldNotBeNull();
_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 seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
var isWuLiu = filename.StartsWith("物流");
var saSeEdiCompareDiffs = GetSaSeEdiCompareData(version, seStartDateTime, seEndDateTime);
HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs);
@ -106,16 +105,8 @@ namespace SettleAccount.Job.Services.Report
saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter();
if (isWuLiu)
{
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 items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisHBPO>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisHBPO>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
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 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();
result.ShouldNotBeNull();
_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
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);
//二次对比比对上的数据入库
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);
}
#endregion
@ -105,8 +105,8 @@ namespace SettleAccount.Job.Services.Report
}
pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter();
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianBBAC>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportMaiDanJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<SaSeCompareDetailReportMaiDanJianBBAC>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
@ -120,7 +120,7 @@ namespace SettleAccount.Job.Services.Report
/// <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>()
@ -156,7 +156,7 @@ namespace SettleAccount.Job.Services.Report
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp
from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
@ -177,7 +177,7 @@ namespace SettleAccount.Job.Services.Report
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace }
into temp
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
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
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);
//二次对比比对上的数据入库
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);
}
#endregion
@ -105,8 +105,8 @@ namespace SettleAccount.Job.Services.Report
}
pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter();
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportMaiDanJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<SaSeCompareDetailReportMaiDanJianHBPO>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
@ -120,7 +120,7 @@ namespace SettleAccount.Job.Services.Report
/// <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>()
@ -156,7 +156,7 @@ namespace SettleAccount.Job.Services.Report
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp
from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
@ -177,7 +177,7 @@ namespace SettleAccount.Job.Services.Report
on new { se.PN, se.LU } equals new { sa.PN, sa.LU }
into temp
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,

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

@ -113,16 +113,18 @@ namespace SettleAccount.Job.Services.Report
{
//二次匹配 匹配上的厂内零件号、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);
//二次对比比对上的数据入库
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);
}
#endregion
#region 结算数据处理
HandleSaDetails<PUB_CAN_SA_DETAIL, PUB_NOT_SA_DETAIL>(pubSaSeCompareDiffs, businessType, version);
HandleSaDetailsMain<PUB_SA_DETAIL>(pubSaSeCompareDiffs, businessType, version);
#endregion
if (string.IsNullOrEmpty(lu) == false)
@ -133,6 +135,7 @@ namespace SettleAccount.Job.Services.Report
{
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();
var excelExporter = new ExcelExporter();
@ -141,26 +144,26 @@ namespace SettleAccount.Job.Services.Report
{
case EnumBusinessType.ZhiGongJianBBAC:
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBAC>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportZhiGongJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<SaSeCompareDetailReportZhiGongJianBBAC>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.ZhiGongJianHBPO:
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPO>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportZhiGongJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<SaSeCompareDetailReportZhiGongJianHBPO>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.BeiJian:
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportBeiJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJian>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportBeiJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<SaSeCompareDetailReportBeiJian>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.YinDuJian:
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportYinDuJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJian>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportYinDuJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<SaSeCompareDetailReportYinDuJian>(items, businessTypeDisplayName);
}
break;
default:
@ -181,7 +184,7 @@ namespace SettleAccount.Job.Services.Report
/// 获取比对数据
/// </summary>
[Obsolete]
private List<PubSaSeCompareDiff> GetSaSeCompareData(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime)
private List<SaSeCompareDiff> GetSaSeCompareDataOld(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime)
{
//印度件LU对比
if (businessType == EnumBusinessType.YinDuJian)
@ -222,7 +225,7 @@ namespace SettleAccount.Job.Services.Report
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
into temp
from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
@ -243,7 +246,7 @@ namespace SettleAccount.Job.Services.Report
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace }
into temp
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
@ -267,7 +270,7 @@ namespace SettleAccount.Job.Services.Report
/// <summary>
/// 获取比对数据
/// </summary>
private List<PubSaSeCompareDiff> GetSaSeCompareDataOld(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime)
private List<SaSeCompareDiff> GetSaSeCompareData(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime)
{
//印度件LU对比
if (businessType == EnumBusinessType.YinDuJian)
@ -282,7 +285,6 @@ namespace SettleAccount.Job.Services.Report
{
groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace,
Id = groupItem.Max(t => t.Id),
Qty = groupItem.Sum(t => t.Qty),
Version = groupItem.Max(t => t.Version),
LU = groupItem.Max(t => t.LU),
@ -325,7 +327,7 @@ namespace SettleAccount.Job.Services.Report
into temp
from se in temp.DefaultIfEmpty()
where se.PN == null
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
Version = sa.Version,
CustomerOfflineTime = sa.SettleDate,
@ -342,7 +344,7 @@ namespace SettleAccount.Job.Services.Report
into temp
from sa in temp.DefaultIfEmpty()
where sa.PN == null
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
@ -359,7 +361,7 @@ namespace SettleAccount.Job.Services.Report
var haveSaHaveSeList = (from sa in saGroupByVersion
from se in seGroup
where sa.PN == se.PN && sa.CustomerPartCodeNoSpace == se.CustomerPartCodeNoSpace
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
Version = sa.Version,
WmsBillNum = se.WmsBillNum,
@ -376,13 +378,13 @@ namespace SettleAccount.Job.Services.Report
SaFactoryPartCode = sa.PartCode,
CustomerPartCode = sa.LU
}).ToList();
return haveSaHaveSeList.Union(haveSaHaveSeList).Union(notHaveSaHaveSeList).ToList();
return haveSaHaveSeList.Union(haveSaNotHaveSeList).Union(notHaveSaHaveSeList).ToList();
}
/// <summary>
/// 获取比对数据
/// </summary>
private List<PubSaSeCompareDiff> GetSaSeCompareDataYinDu(int version, DateTime seStartDateTime, DateTime seEndDateTime)
private List<SaSeCompareDiff> GetSaSeCompareDataYinDu(int version, DateTime seStartDateTime, DateTime seEndDateTime)
{
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == EnumBusinessType.YinDuJian && sa.Version == version
@ -415,7 +417,7 @@ namespace SettleAccount.Job.Services.Report
on sa.CustomerPartCodeNoSpace equals se.CustomerPartCodeNoSpace
into temp
from se in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,
@ -435,7 +437,7 @@ namespace SettleAccount.Job.Services.Report
on se.CustomerPartCodeNoSpace equals sa.CustomerPartCodeNoSpace
into temp
from sa in temp.DefaultIfEmpty()
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = se.WmsBillNum,
ShippingDate = se.ShippingDate,

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

@ -35,7 +35,7 @@ namespace SettleAccount.Job.Services.Report
_settleAccountDbContext = settleAccountDbContext;
}
public virtual void HandlePubSaSeCompareDiffList(List<PubSaSeCompareDiff> pubSaSeCompareDiffs)
public virtual void HandlePubSaSeCompareDiffList(List<SaSeCompareDiff> pubSaSeCompareDiffs)
{
pubSaSeCompareDiffs.ForEach(p =>
{
@ -77,10 +77,10 @@ namespace SettleAccount.Job.Services.Report
/// <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);
//有结算无发运
@ -104,7 +104,7 @@ namespace SettleAccount.Job.Services.Report
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes
join haveSaNotHaveSe in haveSaNotHaveSes
on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode }
select new PubSaSeCompareDiff()
select new SaSeCompareDiff()
{
WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate,
@ -133,7 +133,7 @@ namespace SettleAccount.Job.Services.Report
/// 结算数据处理
/// 写入库位、替换零件号
/// </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 TNotSa : SA_NOT_BASE
{
@ -177,7 +177,7 @@ namespace SettleAccount.Job.Services.Report
/// 处理发运数据
/// 结算、发运对比上的数据修改结算数据状态
/// </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);
if (haveSaHaveSes.Any())
@ -185,6 +185,7 @@ namespace SettleAccount.Job.Services.Report
//结算详情
var saDetails = _settleAccountDbContext.Set<T>()
.Where(t => t.BusinessType == businessType)
.Where(t => t.MappingType == EnumMappingType.None)
.Where(t => t.Version == version)
.ToList();
if (saDetails.Any())
@ -193,9 +194,8 @@ namespace SettleAccount.Job.Services.Report
{
var mappingType = (i.SAQty - i.SEQty) switch
{
> 0 => EnumMappingType.None,
0 => EnumMappingType.PerfectMatch,
< 0 => EnumMappingType.None,
> 0 or < 0 => EnumMappingType.PartialMatch,
_ => default,
};
o.MappingType = mappingType;
@ -209,7 +209,7 @@ namespace SettleAccount.Job.Services.Report
/// <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行数
var detailMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
@ -221,14 +221,14 @@ namespace SettleAccount.Job.Services.Report
//汇总Sheet行数
var sumMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
var sumExportExporterAttribute = typeof(PubSaSeCompareSumExport).GetAttribute<ExcelExporterAttribute>(inherit: true);
var sumExportExporterAttribute = typeof(SaSeCompareSumReport).GetAttribute<ExcelExporterAttribute>(inherit: true);
if (sumExportExporterAttribute != null)
{
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,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
@ -239,7 +239,7 @@ namespace SettleAccount.Job.Services.Report
//有结算有发运
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,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
@ -249,7 +249,7 @@ namespace SettleAccount.Job.Services.Report
//有结算无发运
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,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,
@ -259,7 +259,7 @@ namespace SettleAccount.Job.Services.Report
//无结算有发运
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,
PartCodeDesc = p.FirstOrDefault().PartCodeDesc,

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

@ -39,13 +39,13 @@ namespace SettleAccount.Job
/// </summary>
private void CreateMapSaSeCompare()
{
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianBBAC>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportBeiJian>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportYinDuJian>();
CreateMap<PubSaSeCompareDiff, PUB_SEC_DETAIL>();
CreateMap<SaSeCompareDiff, SaSeCompareDetailReportZhiGongJianBBAC>();
CreateMap<SaSeCompareDiff, SaSeCompareDetailReportZhiGongJianHBPO>();
CreateMap<SaSeCompareDiff, SaSeCompareDetailReportMaiDanJianBBAC>();
CreateMap<SaSeCompareDiff, SaSeCompareDetailReportMaiDanJianHBPO>();
CreateMap<SaSeCompareDiff, SaSeCompareDetailReportBeiJian>();
CreateMap<SaSeCompareDiff, SaSeCompareDetailReportYinDuJian>();
CreateMap<SaSeCompareDiff, PUB_SEC_DETAIL>();
}
}
}

Loading…
Cancel
Save