mahao 1 year ago
parent
commit
7dd053ba98
  1. 176
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs
  2. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisBBAC.cs
  3. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisHBPO.cs
  4. 410
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs
  5. 53
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareSumReport.cs
  6. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs
  7. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs
  8. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs
  9. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs
  10. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -106,8 +106,8 @@ namespace SettleAccount.Job.Services.Report
saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter();
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBAC>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisBBAC>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailReportJisBBAC>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailReportJisBBAC>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();

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

@ -105,8 +105,8 @@ namespace SettleAccount.Job.Services.Report
saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter();
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisHBPO>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisHBPO>(items, businessTypeDisplayName);
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailReportJisHBPO>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailReportJisHBPO>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();

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

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

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

@ -28,8 +28,8 @@ namespace SettleAccount.Job
/// </summary>
public void CreateMapSaSeEdiCompare()
{
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailExportJisBBAC>();
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailExportJisHBPO>();
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailReportJisBBAC>();
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailReportJisHBPO>();
CreateMap<SaSeEdiCompareDiff, BBAC_SEC_DETAIL>();
CreateMap<SaSeEdiCompareDiff, HBPO_SEC_DETAIL>();
}

Loading…
Cancel
Save