From ae6f23c404d058b64e6dbde0137fddeca31981e8 Mon Sep 17 00:00:00 2001 From: mahao Date: Fri, 18 Aug 2023 11:43:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E8=BF=90=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs | 238 ++++++++++----- .../Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs | 238 ++++++++++----- .../Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs | 275 +++++++++++++----- .../Entities/BQ/Syncs/BeiSeSyncAppService.cs | 3 +- .../Entities/BQ/Syncs/HandSeSyncAppService.cs | 8 +- .../Entities/BQ/Syncs/JitSeSyncAppService.cs | 37 ++- .../BQ/Syncs/YinDuSeSyncAppService.cs | 3 +- .../BQ/Syncs/ZhiGongBBACSeSyncAppService.cs | 3 +- .../BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs | 10 +- .../Reports/PubSaSeCompareDiff.cs | 245 ++++++++++------ .../Report/PubSaSeCompareDapperRepository.cs | 6 +- .../Report/PubSaSeCompareExportService.cs | 126 ++++---- .../SettleAccountJobAutoMapperProfile.cs | 12 +- 13 files changed, 789 insertions(+), 415 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs index f5c5c1aa..89f9ae0d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs @@ -1,7 +1,9 @@ using Magicodes.ExporterAndImporter.Core; using System; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; +using Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; @@ -11,160 +13,238 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; public class BBAC_SE_DETAIL_DTO : EntityDto { /// - /// 发货单号 + /// 期间 /// - [Display(Name = "发货单号")] - public string WmsBillNum { get; set; } - + public int Version { set; get; } /// - /// 单据编号 + /// 发货时间 /// - [Display(Name = "单据编号")] - public string Num { get; set; } - + public DateTime ShippingDate { set; get; } /// - /// 发货时间 + /// 发运单号 /// - [Display(Name = "发货时间")] - public DateTime BillTime { get; set; } - + public string WmsBillNum { set; get; } /// - /// 发货人 + /// 客户零件号 /// - [Display(Name = "发货人")] - public string Oper { get; set; } - + public string LU { get; set; } /// - /// 排序单号 + /// 厂内零件号 /// - [Display(Name = "排序单号")] - public string OrderNum { get; set; } - + public string FactoryPartCode { get; set; } /// - /// 订单序号 + /// 生产号 /// - [Display(Name = "订单序号")] - public string Seq { get; set; } - + public string PN { get; set; } /// - /// 实际生产码 + /// 组合键值(PN+LU) /// - [Display(Name = "实际生产码")] - public string RealCode { get; set; } - + public string KeyCode { get; set; } /// - /// 订单生产码 + /// 数量 /// - [Display(Name = "订单生产码")] + public decimal Qty { get; set; } + /// + /// UID + /// + [Display(Name = "UID")] + [DisplayName("UID")] + public long UID { get; set; } + /// + /// JIT订单号 + /// + [Display(Name = "JIT订单号")] + [DisplayName("JIT订单号")] + public string JISNum { get; set; } + /// + /// JIT排序生产码 + /// + [Display(Name = "JIT排序生产码")] public string VinCode { get; set; } - /// - /// 生产码类型 + /// JIT排序生产码类型 /// - [Display(Name = "生产码类型")] + [Display(Name = "JIT排序生产码类型")] public string CodeType { get; set; } - /// - /// 实际零件号 + /// 订单零件号 /// - [Display(Name = "实际零件号")] - public string RealPartCode { get; set; } - + [Display(Name = "订单零件号")] + public string PartCode { get; set; } /// - /// 零件号 + /// 订单零件号 /// - [Display(Name = "零件号")] - public string PartCode { get; set; } - + [Display(Name = "订单零件号")] + public string RealPartCode { get; set; } /// /// 批次 /// [Display(Name = "批次")] public string Batch { get; set; } - + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + public string CustPartCode { get; set; } + /// + /// 订单序号 + /// + [Display(Name = "订单序号")] + public string Seq { get; set; } + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + public DateTime AssembleData { get; set; } + /// + /// 发货条码 + /// + [Display(Name = "发货条码")] + public string DeliverCode { get; set; } + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + public string BillNum { get; set; } + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + public DateTime? BillTime { get; set; } + /// + /// 发货人 + /// + [Display(Name = "发货人")] + public string Oper { get; set; } + /// + /// 客户位置 + /// + [Display(Name = "客户位置")] + public string Position { get; set; } + /// + /// 工厂 + /// + [Display(Name = "工厂")] + public string Factory { get; set; } /// /// MES配置码 /// [Display(Name = "MES配置码")] public string MESConfigCode { get; set; } - - /// - /// 来源库位 - /// - [Display(Name = "来源库位")] - public string FromLoc { get; set; } - /// /// 目标库位 /// [Display(Name = "目标库位")] public string ToLoc { get; set; } - /// - /// 参照订单生产码 + /// 单据类型 /// - [Display(Name = "参照订单生产码")] - public string RefVinCode { get; set; } - + public EnumBillType BillType { get; set; } /// - /// 单据性质 + /// 子单据类型 /// - [Display(Name = "单据性质")] - public string BillCharacter { get; set; } - + [Display(Name = "子单据类型")] + public EnumSubBillType SubBillType { get; set; } /// - /// 发货关联单号 + /// 事务类型 /// - [Display(Name = "发货关联单号")] - public string RefBillNum { get; set; } - + [Display(Name = "事务类型")] + public EnumDelTransType TransType { get; set; } /// - /// Erp目标库位 + /// 发运主类型 /// - [Display(Name = "Erp目标库位")] - public string ErpToLoc { get; set; } - + [Display(Name = "发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + /// + /// 发运子类型 + /// + [Display(Name = "发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } + /// + /// 单据性质 + /// + [Display(Name = "单据性质")] + public string BillCharacter { get; set; } /// /// 原生产码 /// [Display(Name = "原生产码")] public string OrigiCode { get; set; } - + /// + /// 描述 + /// + [Display(Name = "描述")] + public string PartDesc { get; set; } /// /// 备注 /// [Display(Name = "备注")] public string Remark { get; set; } - + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumProTpe ProType { get; set; } + /// + /// JIS排序单号 + /// + [Display(Name = "JIS排序单号")] + public string OrderNum { get; set; } + /// + /// JIS实际生产码 + /// + [Display(Name = "JIS实际生产码")] + public string RealCode { get; set; } + /// + /// 来源库位 + /// + [Display(Name = "来源库位")] + public string FromLoc { get; set; } + /// + /// 参照订单生产码 + /// + [Display(Name = "参照订单生产码")] + public string RefVinCode { get; set; } + /// + /// 发货关联单号 + /// + [Display(Name = "发货关联单号")] + public string RefBillNum { get; set; } + /// + /// Erp目标库位 + /// + [Display(Name = "Erp目标库位")] + public string ErpToLoc { get; set; } /// /// 塑件唯一码 /// [Display(Name = "塑件唯一码")] public string UniqueCode { get; set; } - /// /// PJS顺序号 /// [Display(Name = "PJS顺序号")] public string PjsNum { get; set; } - /// /// 虚拟小总成 /// [Display(Name = "虚拟小总成")] public string MatchNumber { get; set; } - /// - /// 发货条码 + /// 状态 /// - [Display(Name = "发货条码")] - public string DeliverCode { get; set; } - + [Display(Name = "状态")] + public EnumBillState State { get; set; } /// - /// 客户位置 + /// 创建时间 /// - [Display(Name = "客户位置")] - public string Position { get; set; } + [Display(Name = "创建时间")] + public DateTime CreateTime { get; set; } + /// + /// 是否有EDI数据 + /// + [Display(Name = "是否有EDI数据")] + public bool IsHaveEdiData { get; set; } } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs index 2319ec16..5762e9fa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs @@ -1,7 +1,9 @@ using System; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; +using Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; @@ -11,160 +13,238 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; public class HBPO_SE_DETAIL_DTO : EntityDto { /// - /// 发货单号 + /// 期间 /// - [Display(Name = "发货单号")] - public string WmsBillNum { get; set; } - + public int Version { set; get; } /// - /// 单据编号 + /// 发货时间 /// - [Display(Name = "单据编号")] - public string Num { get; set; } - + public DateTime ShippingDate { set; get; } /// - /// 发货时间 + /// 发运单号 /// - [Display(Name = "发货时间")] - public DateTime BillTime { get; set; } - + public string WmsBillNum { set; get; } /// - /// 发货人 + /// 客户零件号 /// - [Display(Name = "发货人")] - public string Oper { get; set; } - + public string LU { get; set; } /// - /// 排序单号 + /// 厂内零件号 /// - [Display(Name = "排序单号")] - public string OrderNum { get; set; } - + public string FactoryPartCode { get; set; } /// - /// 订单序号 + /// 生产号 /// - [Display(Name = "订单序号")] - public string Seq { get; set; } - + public string PN { get; set; } /// - /// 实际生产码 + /// 组合键值(PN+LU) /// - [Display(Name = "实际生产码")] - public string RealCode { get; set; } - + public string KeyCode { get; set; } /// - /// 订单生产码 + /// 数量 /// - [Display(Name = "订单生产码")] + public decimal Qty { get; set; } + /// + /// UID + /// + [Display(Name = "UID")] + [DisplayName("UID")] + public long UID { get; set; } + /// + /// JIT订单号 + /// + [Display(Name = "JIT订单号")] + [DisplayName("JIT订单号")] + public string JISNum { get; set; } + /// + /// JIT排序生产码 + /// + [Display(Name = "JIT排序生产码")] public string VinCode { get; set; } - /// - /// 生产码类型 + /// JIT排序生产码类型 /// - [Display(Name = "生产码类型")] + [Display(Name = "JIT排序生产码类型")] public string CodeType { get; set; } - /// - /// 实际零件号 + /// 订单零件号 /// - [Display(Name = "实际零件号")] - public string RealPartCode { get; set; } - + [Display(Name = "订单零件号")] + public string PartCode { get; set; } /// - /// 零件号 + /// 订单零件号 /// - [Display(Name = "零件号")] - public string PartCode { get; set; } - + [Display(Name = "订单零件号")] + public string RealPartCode { get; set; } /// /// 批次 /// [Display(Name = "批次")] public string Batch { get; set; } - + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + public string CustPartCode { get; set; } + /// + /// 订单序号 + /// + [Display(Name = "订单序号")] + public string Seq { get; set; } + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + public DateTime AssembleData { get; set; } + /// + /// 发货条码 + /// + [Display(Name = "发货条码")] + public string DeliverCode { get; set; } + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + public string BillNum { get; set; } + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + public DateTime? BillTime { get; set; } + /// + /// 发货人 + /// + [Display(Name = "发货人")] + public string Oper { get; set; } + /// + /// 客户位置 + /// + [Display(Name = "客户位置")] + public string Position { get; set; } + /// + /// 工厂 + /// + [Display(Name = "工厂")] + public string Factory { get; set; } /// /// MES配置码 /// [Display(Name = "MES配置码")] public string MESConfigCode { get; set; } - - /// - /// 来源库位 - /// - [Display(Name = "来源库位")] - public string FromLoc { get; set; } - /// /// 目标库位 /// [Display(Name = "目标库位")] public string ToLoc { get; set; } - /// - /// 参照订单生产码 + /// 单据类型 /// - [Display(Name = "参照订单生产码")] - public string RefVinCode { get; set; } - + public EnumBillType BillType { get; set; } /// - /// 单据性质 + /// 子单据类型 /// - [Display(Name = "单据性质")] - public string BillCharacter { get; set; } - + [Display(Name = "子单据类型")] + public EnumSubBillType SubBillType { get; set; } /// - /// 发货关联单号 + /// 事务类型 /// - [Display(Name = "发货关联单号")] - public string RefBillNum { get; set; } - + [Display(Name = "事务类型")] + public EnumDelTransType TransType { get; set; } /// - /// Erp目标库位 + /// 发运主类型 /// - [Display(Name = "Erp目标库位")] - public string ErpToLoc { get; set; } - + [Display(Name = "发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + /// + /// 发运子类型 + /// + [Display(Name = "发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } + /// + /// 单据性质 + /// + [Display(Name = "单据性质")] + public string BillCharacter { get; set; } /// /// 原生产码 /// [Display(Name = "原生产码")] public string OrigiCode { get; set; } - + /// + /// 描述 + /// + [Display(Name = "描述")] + public string PartDesc { get; set; } /// /// 备注 /// [Display(Name = "备注")] public string Remark { get; set; } - + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumProTpe ProType { get; set; } + /// + /// JIS排序单号 + /// + [Display(Name = "JIS排序单号")] + public string OrderNum { get; set; } + /// + /// JIS实际生产码 + /// + [Display(Name = "JIS实际生产码")] + public string RealCode { get; set; } + /// + /// 来源库位 + /// + [Display(Name = "来源库位")] + public string FromLoc { get; set; } + /// + /// 参照订单生产码 + /// + [Display(Name = "参照订单生产码")] + public string RefVinCode { get; set; } + /// + /// 发货关联单号 + /// + [Display(Name = "发货关联单号")] + public string RefBillNum { get; set; } + /// + /// Erp目标库位 + /// + [Display(Name = "Erp目标库位")] + public string ErpToLoc { get; set; } /// /// 塑件唯一码 /// [Display(Name = "塑件唯一码")] public string UniqueCode { get; set; } - /// /// PJS顺序号 /// [Display(Name = "PJS顺序号")] public string PjsNum { get; set; } - /// /// 虚拟小总成 /// [Display(Name = "虚拟小总成")] public string MatchNumber { get; set; } - /// - /// 发货条码 + /// 状态 /// - [Display(Name = "发货条码")] - public string DeliverCode { get; set; } - + [Display(Name = "状态")] + public EnumBillState State { get; set; } /// - /// 客户位置 + /// 创建时间 /// - [Display(Name = "客户位置")] - public string Position { get; set; } + [Display(Name = "创建时间")] + public DateTime CreateTime { get; set; } + /// + /// 是否有EDI数据 + /// + [Display(Name = "是否有EDI数据")] + public bool IsHaveEdiData { get; set; } } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs index f753449d..c2313e59 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; +using Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; @@ -11,113 +12,184 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; /// public class PUB_SE_DETAIL_DTO : EntityDto { + /// + /// 期间 + /// + public int Version { set; get; } + /// + /// 发货时间 + /// + public DateTime ShippingDate { set; get; } + /// + /// 发运单号 + /// + public string WmsBillNum { set; get; } + /// + /// 客户零件号 + /// + public string LU { get; set; } + /// + /// 厂内零件号 + /// + public string FactoryPartCode { get; set; } + /// + /// 生产号 + /// + public string PN { get; set; } + /// + /// 组合键值(PN+LU) + /// + public string KeyCode { get; set; } + /// + /// 数量 + /// + public decimal Qty { get; set; } + /// + /// UID + /// + [Display(Name = "UID")] + [DisplayName("UID")] + public long UID { get; set; } /// /// 发货单号 /// [Display(Name = "发货单号")] - public string WmsBillNum { get; set; } - + public string BillNum { get; set; } /// /// 发货时间 /// - [DisplayName("发货时间")] + [Display(Name = "发货时间")] public DateTime BillTime { get; set; } - + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + public DateTime AssembleData { get; set; } /// /// 零件号 /// - [DisplayName("零件号")] + [Display(Name = "零件号")] public string PartCode { get; set; } - /// /// 批次 /// - [DisplayName("批次")] + [Display(Name = "批次")] public string Batch { get; set; } - + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + public string CustPartCode { get; set; } /// /// 发货人 /// - [DisplayName("发货人")] + [Display(Name = "发货人")] public string Oper { get; set; } - /// /// DN单据号 /// - [DisplayName("DN单据号")] + [Display(Name = "DN单据号")] public string DnBillNum { get; set; } - /// /// DN单据时间 /// - [DisplayName("DN单据时间")] + [Display(Name = "DN单据时间")] public DateTime DnBillTime { get; set; } - /// /// DN单添加人 /// - [DisplayName("DN单添加人")] + [Display(Name = "DN单添加人")] public string DnOper { get; set; } - /// /// 交付索引 /// - [DisplayName("交付索引")] + [Display(Name = "交付索引")] public string DeliveryIndex { get; set; } - /// /// 客户 /// - [DisplayName("客户")] + [Display(Name = "客户")] public string CustId { get; set; } - /// /// 发货仓库 /// - [DisplayName("发货仓库")] + [Display(Name = "发货仓库")] public string DeliveryHose { get; set; } - /// /// 来源库位 /// - [DisplayName("来源库位")] + [Display(Name = "来源库位")] public string FromLocCode { get; set; } - /// /// 来源仓库 /// - [DisplayName("来源仓库")] + [Display(Name = "来源仓库")] public string FromHose { get; set; } - /// /// 来源ERP库存 /// - [DisplayName("来源ERP库存")] + [Display(Name = "来源ERP库存")] public string FromErpLocCode { get; set; } - /// /// 目标库位 /// - [DisplayName("目标库位")] + [Display(Name = "目标库位")] public string ToLocCode { get; set; } - + /// + /// 目标仓库 + /// + [Display(Name = "目标仓库")] + public string ToHose { get; set; } /// /// 目标Erp库位 /// - [DisplayName("目标Erp库位")] + [Display(Name = "目标Erp库位")] public string ToErpLocCode { get; set; } - /// - /// 目标仓库 + /// 状态 /// - [DisplayName("目标仓库")] - public string ToHose { get; set; } - + [Display(Name = "状态")] + public EnumBillState State { get; set; } /// /// 备注 /// - [DisplayName("备注")] + [Display(Name = "备注")] public string Remark { get; set; } + /// + /// 单据类型 + /// + [Display(Name = "单据类型")] + public EnumBillType BillType { get; set; } + /// + /// 子单据类型 + /// + [Display(Name = "子单据类型")] + public EnumSubBillType SubBillType { get; set; } + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumProTpe ProType { get; set; } + /// + /// 事务类型 + /// + [Display(Name = "事务类型")] + public EnumDelTransType TransType { get; set; } + /// + /// 发运主类型 + /// + [Display(Name = "发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + /// + /// 发运子类型 + /// + [Display(Name = "发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + public DateTime CreateTime { get; set; } } /// @@ -136,129 +208,182 @@ public class PUB_SE_DETAIL_RequestDto : RequestDto /// public class PUB_SE_DETAIL_EXPORT_DTO { + /// + /// 期间 + /// + [ExporterHeader(DisplayName = "期间")] + public int Version { set; get; } + /// + /// 发货时间 + /// + [ExporterHeader(DisplayName = "发货时间")] + public DateTime ShippingDate { set; get; } + /// + /// 发运单号 + /// + [ExporterHeader(DisplayName = "发运单号")] + public string WmsBillNum { set; get; } + /// + /// 客户零件号 + /// + [ExporterHeader(DisplayName = "客户零件号")] + public string LU { get; set; } + /// + /// 厂内零件号 + /// + [ExporterHeader(DisplayName = "厂内零件号")] + public string FactoryPartCode { get; set; } + /// + /// 生产号 + /// + [ExporterHeader(DisplayName = "生产号")] + public string PN { get; set; } + /// + /// 组合键值(PN+LU) + /// + [ExporterHeader(DisplayName = "组合键值")] + public string KeyCode { get; set; } + /// + /// 数量 + /// + [ExporterHeader(DisplayName = "数量")] + public decimal Qty { get; set; } + /// + /// UID + /// + [Display(Name = "UID")] + [ExporterHeader(DisplayName = "UID")] + public long UID { get; set; } /// /// 发货单号 /// [Display(Name = "发货单号")] [ExporterHeader(DisplayName = "发货单号")] - public string WmsBillNum { get; set; } - + public string BillNum { get; set; } /// /// 发货时间 /// - [DisplayName("发货时间")] + [Display(Name = "发货时间")] [ExporterHeader(DisplayName = "发货时间")] public DateTime BillTime { get; set; } - + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + [ExporterHeader(DisplayName = "订单时间")] + public DateTime AssembleData { get; set; } /// /// 零件号 /// - [DisplayName("零件号")] + [Display(Name = "零件号")] [ExporterHeader(DisplayName = "零件号")] public string PartCode { get; set; } - /// /// 批次 /// - [DisplayName("批次")] + [Display(Name = "批次")] [ExporterHeader(DisplayName = "批次")] public string Batch { get; set; } - + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string CustPartCode { get; set; } /// /// 发货人 /// - [DisplayName("发货人")] + [Display(Name = "发货人")] [ExporterHeader(DisplayName = "发货人")] public string Oper { get; set; } - /// /// DN单据号 /// - [DisplayName("DN单据号")] + [Display(Name = "DN单据号")] [ExporterHeader(DisplayName = "DN单据号")] public string DnBillNum { get; set; } - /// /// DN单据时间 /// - [DisplayName("DN单据时间")] + [Display(Name = "DN单据时间")] [ExporterHeader(DisplayName = "DN单据时间")] public DateTime DnBillTime { get; set; } - /// /// DN单添加人 /// - [DisplayName("DN单添加人")] + [Display(Name = "DN单添加人")] [ExporterHeader(DisplayName = "DN单添加人")] public string DnOper { get; set; } - /// /// 交付索引 /// - [DisplayName("交付索引")] + [Display(Name = "交付索引")] [ExporterHeader(DisplayName = "交付索引")] public string DeliveryIndex { get; set; } - /// /// 客户 /// - [DisplayName("客户")] + [Display(Name = "客户")] [ExporterHeader(DisplayName = "客户")] public string CustId { get; set; } - /// /// 发货仓库 /// - [DisplayName("发货仓库")] + [Display(Name = "发货仓库")] [ExporterHeader(DisplayName = "发货仓库")] public string DeliveryHose { get; set; } - /// /// 来源库位 /// - [DisplayName("来源库位")] + [Display(Name = "来源库位")] [ExporterHeader(DisplayName = "来源库位")] public string FromLocCode { get; set; } - /// /// 来源仓库 /// - [DisplayName("来源仓库")] + [Display(Name = "来源仓库")] [ExporterHeader(DisplayName = "来源仓库")] public string FromHose { get; set; } - /// /// 来源ERP库存 /// - [DisplayName("来源ERP库存")] + [Display(Name = "来源ERP库存")] [ExporterHeader(DisplayName = "来源ERP库存")] public string FromErpLocCode { get; set; } - /// /// 目标库位 /// - [DisplayName("目标库位")] + [Display(Name = "目标库位")] [ExporterHeader(DisplayName = "目标库位")] public string ToLocCode { get; set; } - + /// + /// 目标仓库 + /// + [Display(Name = "目标仓库")] + [ExporterHeader(DisplayName = "目标仓库")] + public string ToHose { get; set; } /// /// 目标Erp库位 /// - [DisplayName("目标Erp库位")] + [Display(Name = "目标Erp库位")] [ExporterHeader(DisplayName = "目标Erp库位")] public string ToErpLocCode { get; set; } - /// - /// 目标仓库 + /// 状态 /// - [DisplayName("目标仓库")] - [ExporterHeader(DisplayName = "目标仓库")] - public string ToHose { get; set; } - + [Display(Name = "状态")] + [ExporterHeader(DisplayName = "状态")] + public EnumBillState State { get; set; } /// /// 备注 /// - [DisplayName("备注")] + [Display(Name = "备注")] [ExporterHeader(DisplayName = "备注")] public string Remark { get; set; } + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + [ExporterHeader(DisplayName = "创建时间")] + public DateTime CreateTime { get; set; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs index feec51ae..b19c31b3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs @@ -24,11 +24,12 @@ public class BeiSeSyncAppService : JitSeSyncAppService, IJobService /// public BeiSeSyncAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository pubSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService - ) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) { base.SeSyncConfigInfo = new SeSyncConfig() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs index 3f7a997c..6ff75cf8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs @@ -36,10 +36,10 @@ public class HandSeSyncAppService : ApplicationService EnumBusinessType.JisHBPO => scope.ServiceProvider.GetRequiredService(), EnumBusinessType.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService(), EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService(), + //EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService(), + EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService(), + //EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService(), + //EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService(), _ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"), }; await jitSeSyncAppService.Invoke().ConfigureAwait(false); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs index 9393640d..f22b31bd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs @@ -5,14 +5,16 @@ using System.Linq.Expressions; using System.Threading.Tasks; using Coravel.Invocable; using EFCore.BulkExtensions; +using LinqToDB; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ; using Volo.Abp.Application.Services; +using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; +using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.MaterialRelationships; -using Win.Sfs.Shared.CurrentBranch; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; @@ -28,6 +30,11 @@ public class JitSeSyncAppService : ApplicationService, IInvocable /// private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; + /// + /// 数据上下文 + /// + private readonly SettleAccountDbContext _settleAccountDbContext; + /// /// 同步位置标记 /// @@ -50,12 +57,14 @@ public class JitSeSyncAppService : ApplicationService, IInvocable /// public JitSeSyncAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository pubSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService) { _wmsBJBMPTContext = wmsBJBMPTContext; + _settleAccountDbContext = settleAccountDbContext; _syncPositionFlagRepository = syncPositionFlagRepository; _pubSeDetailRepository = pubSeDetailRepository; _materialRelationshipManager = materialRelationshipManager; @@ -99,7 +108,8 @@ public class JitSeSyncAppService : ApplicationService, IInvocable if (luRePartCodes.Any()) { var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); - await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + //await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); } pubSeDetails.ForEach(t => @@ -108,7 +118,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable t.BusinessType = businessType; t.KeyCode = t.PN + t.LU; }); - await _pubSeDetailRepository.DbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false); + await _settleAccountDbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false); if (syncPositionFlag != null) { @@ -182,4 +192,25 @@ public class JitSeSyncAppService : ApplicationService, IInvocable } } } + + /// + /// 添加零件关系 + /// + public async Task AddNewMaterialRelationships(IEnumerable materialRelationships) + { + //新客户零件号和厂内零件号 + var noHaveLuRePartCodes = from item1 in materialRelationships + join item2 in _settleAccountDbContext.Set() + on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode } + into temp + from item3 in temp.DefaultIfEmpty() + where item3 == null + select item1; + + if (noHaveLuRePartCodes.Any()) + { + await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false); + //await _materialRelationshipRepository.InsertManyAsync(noHaveLuRePartCodes).ConfigureAwait(false); + } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs index 0a81b555..119bb41d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs @@ -24,11 +24,12 @@ public class YinDuSeSyncAppService : JitSeSyncAppService, IJobService /// public YinDuSeSyncAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository pubSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService - ) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) { base.SeSyncConfigInfo = new SeSyncConfig() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs index 819983f7..fb846ff9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs @@ -24,11 +24,12 @@ public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService, IJobService /// public ZhiGongBBACSeSyncAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository pubSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService - ) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) { base.SeSyncConfigInfo = new SeSyncConfig() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs index 4b520b64..970d031b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs @@ -1,11 +1,15 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; +using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; @@ -23,12 +27,14 @@ public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService /// 构造 /// public ZhiGongHBPOSeSyncAppService( + IHost host, WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository pubSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService - ) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) { base.SeSyncConfigInfo = new SeSyncConfig() { @@ -44,6 +50,6 @@ public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService public async Task Invoke(IServiceProvider serviceProvider) { - await this.Invoke(); + await base.Invoke().ConfigureAwait(false); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs index 73130c46..ed591c3f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs @@ -130,6 +130,14 @@ public class PubSaSeCompareDiff /// [ExcelExporter(MaxRowNumberOnASheet = 900000)] public class PubSaSeCompareDetailExport +{ +} + +/// +/// PUB结算与发运对比明细 +/// +[ExcelExporter(MaxRowNumberOnASheet = 900000)] +public class PubSaSeCompareDetailExport2 { /// /// 类别 @@ -144,33 +152,33 @@ public class PubSaSeCompareDetailExport [ValueMapping("无结算有发运", 3)] public EnumPubSaSeCompareCategory Category { get; set; } - ///// - ///// Wms发货单号 - ///// - //[Display(Name = "Wms发货单号")] - //[ExporterHeader(DisplayName = "交货单号")] - //public string WmsBillNum { get; set; } - - ///// - ///// 发货日期 - ///// - //[Display(Name = "发货日期")] - //[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] - //public DateTime ShippingDate { get; set; } - - ///// - ///// 生产码 - ///// - //[Display(Name = "生产码")] - //[ExporterHeader(DisplayName = "ASN发货单号")] - //public string PN { get; set; } - - ///// - ///// 物料号 - ///// - //[Display(Name = "物料号")] - //[ExporterHeader(DisplayName = "厂内物料号")] - //public string MaterialNumber { get; set; } + /// + /// Wms发货单号 + /// + [Display(Name = "Wms发货单号")] + [ExporterHeader(DisplayName = "交货单号")] + public string WmsBillNum { get; set; } + + /// + /// 发货日期 + /// + [Display(Name = "发货日期")] + [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] + public DateTime ShippingDate { get; set; } + + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "ASN发货单号")] + public string PN { get; set; } + + /// + /// 物料号 + /// + [Display(Name = "物料号")] + [ExporterHeader(DisplayName = "厂内物料号")] + public string MaterialNumber { get; set; } /// /// 物料描述 @@ -179,12 +187,12 @@ public class PubSaSeCompareDetailExport [ExporterHeader(DisplayName = "物料描述")] public string MaterialDes { get; set; } - ///// - ///// 原始LU - ///// - //[Display(Name = "原始LU")] - //[ExporterHeader(DisplayName = "原始LU")] - //public string PrimitiveLU { get; set; } + /// + /// 原始LU + /// + [Display(Name = "原始LU")] + [ExporterHeader(DisplayName = "原始LU")] + public string PrimitiveLU { get; set; } /// ///替换LU @@ -193,12 +201,12 @@ public class PubSaSeCompareDetailExport [ExporterHeader(DisplayName = "替换LU")] public string ReplaceLU { get; set; } - ///// - ///// 结算数据中的过账日期 - ///// - //[Display(Name = "客户下线时间")] - //[ExporterHeader(DisplayName = "客户下线时间")] - //public DateTime CustomerOfflineTime { get; set; } + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + [ExporterHeader(DisplayName = "客户下线时间")] + public DateTime CustomerOfflineTime { get; set; } /// /// 结算数量 @@ -214,53 +222,100 @@ public class PubSaSeCompareDetailExport [ExporterHeader(DisplayName = "WMS发货数量")] public decimal SEQty { get; set; } - ///// - ///// 差异数量 - ///// - //[ExporterHeader(DisplayName = "差异数量")] - //public decimal DiffQty { set; get; } - - ///// - ///// 匹配类型 - ///// - //[Display(Name = "匹配类型")] - //[ExporterHeader(DisplayName = "是否完全匹配")] - //public string MateType { get; set; } - - ///// - ///// 定价 - ///// - //[Display(Name = "定价")] - //[ExporterHeader(DisplayName = "定价")] - //public decimal FixPrice { get; set; } - - ///// - ///// 日顺序号 - ///// - //[Display(Name = "日顺序号")] - //[ExporterHeader(DisplayName = "日顺序号")] - //public string SeqNumber { get; set; } - - ///// - ///// PJIS日顺序号 - ///// - //[Display(Name = "PJIS日顺序号")] - //[ExporterHeader(DisplayName = "PJIS日顺序号")] - //public string PJISSeqNumber { get; set; } - - ///// - ///// WMS目标库位 - ///// - //[Display(Name = "WMS目标库位")] - //[ExporterHeader(DisplayName = "WMS目标库位")] - //public string ToLocCode { get; set; } - - ///// - ///// ERP目标库位 - ///// - //[Display(Name = "ERP目标库位")] - //[ExporterHeader(DisplayName = "ERP目标库位")] - //public string ToErpLocCode { get; set; } + /// + /// 差异数量 + /// + [ExporterHeader(DisplayName = "差异数量")] + public decimal DiffQty { set; get; } + + /// + /// 匹配类型 + /// + [Display(Name = "匹配类型")] + [ExporterHeader(DisplayName = "是否完全匹配")] + public string MateType { get; set; } + + /// + /// 定价 + /// + [Display(Name = "定价")] + [ExporterHeader(DisplayName = "定价")] + public decimal FixPrice { get; set; } + + /// + /// 日顺序号 + /// + [Display(Name = "日顺序号")] + [ExporterHeader(DisplayName = "日顺序号")] + public string SeqNumber { get; set; } + + /// + /// PJIS日顺序号 + /// + [Display(Name = "PJIS日顺序号")] + [ExporterHeader(DisplayName = "PJIS日顺序号")] + public string PJISSeqNumber { get; set; } + + /// + /// WMS目标库位 + /// + [Display(Name = "WMS目标库位")] + [ExporterHeader(DisplayName = "WMS目标库位")] + public string ToLocCode { get; set; } + + /// + /// ERP目标库位 + /// + [Display(Name = "ERP目标库位")] + [ExporterHeader(DisplayName = "ERP目标库位")] + public string ToErpLocCode { get; set; } +} + +/// +/// PUB结算与发运对比明细 +/// +public interface IPubSaSeCompareDetailExport +{ + /// + /// 类别 + /// 有结算有发运 + /// 有结算无发运 + /// 无结算有发运 + /// + [Display(Name = "类别")] + [ExporterHeader(DisplayName = "类别")] + [ValueMapping("有结算有发运", 1)] + [ValueMapping("有结算无发运", 2)] + [ValueMapping("无结算有发运", 3)] + public EnumPubSaSeCompareCategory Category { get; set; } + + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + [ExporterHeader(DisplayName = "物料描述")] + public string MaterialDes { get; set; } + + /// + ///替换LU + /// + [Display(Name = "替换LU")] + [ExporterHeader(DisplayName = "替换LU")] + public string ReplaceLU { get; set; } + + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + [ExporterHeader(DisplayName = "结算数量")] + public decimal SAQty { get; set; } + + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + [ExporterHeader(DisplayName = "WMS发货数量")] + public decimal SEQty { get; set; } } /// @@ -308,7 +363,7 @@ public class PubSaSeCompareSumExport /// 直供件BBAC结算与发运对比明细 /// [ExcelExporter(MaxRowNumberOnASheet = 900000)] -public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport +public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport { /// /// 类别 @@ -397,7 +452,7 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp /// 差异数量 /// [ExporterHeader(DisplayName = "差异数量")] - public decimal DiffQty { set; get; } + public decimal DiffQty => SAQty - SEQty; /// /// 匹配类型 @@ -432,7 +487,7 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp /// 直供件HBPO结算与发运对比明细 /// [ExcelExporter(MaxRowNumberOnASheet = 900000)] -public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport +public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport { /// /// 类别 @@ -521,7 +576,7 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp /// 差异数量 /// [ExporterHeader(DisplayName = "差异数量")] - public decimal DiffQty { set; get; } + public decimal DiffQty => SAQty - SEQty; /// /// 匹配类型 @@ -645,7 +700,7 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo /// 差异数量 /// [ExporterHeader(DisplayName = "差异数量")] - public decimal DiffQty { set; get; } + public decimal DiffQty => SAQty - SEQty; /// /// 匹配类型 @@ -680,7 +735,7 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo /// 备件结算与发运对比明细 /// [ExcelExporter(MaxRowNumberOnASheet = 900000)] -public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport +public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport { /// /// 类别 @@ -769,7 +824,7 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport /// 差异数量 /// [ExporterHeader(DisplayName = "差异数量")] - public decimal DiffQty { set; get; } + public decimal DiffQty => SAQty - SEQty; /// /// 匹配类型 @@ -804,7 +859,7 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport /// 印度件结算与发运对比明细 /// [ExcelExporter(MaxRowNumberOnASheet = 900000)] -public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport +public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport { /// /// 类别 @@ -893,7 +948,7 @@ public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport /// 差异数量 /// [ExporterHeader(DisplayName = "差异数量")] - public decimal DiffQty { set; get; } + public decimal DiffQty => SAQty - SEQty; /// /// 匹配类型 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs index 1331cf9b..f1f50c37 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs @@ -37,7 +37,9 @@ public class PubSaSeCompareDapperRepository : DapperRepository(); - haveSaHaveSes.ForEach(t => t.PrimitiveLU = t.ReplaceLU = t.SaLU); - haveSaNotHaveSes.ForEach(t => t.PrimitiveLU = t.ReplaceLU = t.SaLU); - notHaveSaHaveSes.ForEach(t => t.PrimitiveLU = t.ReplaceLU = t.SeLU); - #region 二次对比 - //二次对比(替换零件号) - var repLUs = notHaveSaHaveSes.Select(t => t.SeLU).Distinct().ToList(); - var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && t.BusinessType == businessType).Result; + ////二次对比(替换零件号) + //var repLUs = notHaveSaHaveSes.Select(t => t.SeLU).Distinct().ToList(); + //var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && t.BusinessType == businessType).Result; - tbRePartsRelationships.ForEach(tbRePartsRelationship => - { - notHaveSaHaveSes.FindAll(t => t.SeLU == tbRePartsRelationship.RepLU).ForEach(t => - { - t.ReplaceLU = tbRePartsRelationship.LU; - }); - }); + //tbRePartsRelationships.ForEach(tbRePartsRelationship => + //{ + // notHaveSaHaveSes.FindAll(t => t.SeLU == tbRePartsRelationship.RepLU).ForEach(t => + // { + // t.ReplaceLU = tbRePartsRelationship.LU; + // }); + //}); - var haveSaNotHaveSeLUPNs = haveSaNotHaveSes.Select(t => new { t.ReplaceLU, t.PN }); - var notHaveSaHaveSeLUPNs = notHaveSaHaveSes.Select(t => new { t.ReplaceLU, t.PN }); - //二次匹配 匹配上的零件号 - var secondMatchLUPNs = haveSaNotHaveSeLUPNs.Intersect(notHaveSaHaveSeLUPNs); - if (secondMatchLUPNs.Any() == true) - { - pubSaSeCompareDiffs.RemoveAll(t => secondMatchLUPNs.Contains(new { t.ReplaceLU, t.PN })); + //var haveSaNotHaveSeLUPNs = haveSaNotHaveSes.Select(t => new { t.ReplaceLU, t.PN }); + //var notHaveSaHaveSeLUPNs = notHaveSaHaveSes.Select(t => new { t.ReplaceLU, t.PN }); + ////二次匹配 匹配上的零件号 + //var secondMatchLUPNs = haveSaNotHaveSeLUPNs.Intersect(notHaveSaHaveSeLUPNs); + //if (secondMatchLUPNs.Any() == true) + //{ + // pubSaSeCompareDiffs.RemoveAll(t => secondMatchLUPNs.Contains(new { t.ReplaceLU, t.PN })); - foreach (var secondMatchLUPN in secondMatchLUPNs) - { - var haveSaNotHaveSe = haveSaNotHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN); - var notHaveSaHaveSe = notHaveSaHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN); - secondMatchHaveSaHaveSes.Add(new PubSaSeCompareDiff() - { - WmsBillNum = notHaveSaHaveSe.WmsBillNum, - ShippingDate = notHaveSaHaveSe.ShippingDate, - SeqNumber = notHaveSaHaveSe.SeqNumber, - PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, - MaterialNumber = haveSaNotHaveSe.MaterialNumber, - MaterialDes = haveSaNotHaveSe.MaterialDes, - CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, - SAQty = haveSaNotHaveSe.SAQty, - SEQty = notHaveSaHaveSe.SEQty, - MateType = haveSaNotHaveSe.MateType, - FixPrice = haveSaNotHaveSe.FixPrice, - PrimitiveLU = haveSaNotHaveSe.PrimitiveLU, - ReplaceLU = haveSaNotHaveSe.ReplaceLU, - SeLU = notHaveSaHaveSe.SeLU, - SaLU = haveSaNotHaveSe.SaLU, - PN = haveSaNotHaveSe.PN, - Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, - IsRemove = false - }); - } - } + // foreach (var secondMatchLUPN in secondMatchLUPNs) + // { + // var haveSaNotHaveSe = haveSaNotHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN); + // var notHaveSaHaveSe = notHaveSaHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN); + // secondMatchHaveSaHaveSes.Add(new PubSaSeCompareDiff() + // { + // WmsBillNum = notHaveSaHaveSe.WmsBillNum, + // ShippingDate = notHaveSaHaveSe.ShippingDate, + // SeqNumber = notHaveSaHaveSe.SeqNumber, + // PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, + // MaterialNumber = haveSaNotHaveSe.MaterialNumber, + // MaterialDes = haveSaNotHaveSe.MaterialDes, + // CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, + // SAQty = haveSaNotHaveSe.SAQty, + // SEQty = notHaveSaHaveSe.SEQty, + // MateType = haveSaNotHaveSe.MateType, + // FixPrice = haveSaNotHaveSe.FixPrice, + // PrimitiveLU = haveSaNotHaveSe.PrimitiveLU, + // ReplaceLU = haveSaNotHaveSe.ReplaceLU, + // SeLU = notHaveSaHaveSe.SeLU, + // SaLU = haveSaNotHaveSe.SaLU, + // PN = haveSaNotHaveSe.PN, + // Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, + // IsRemove = false + // }); + // } + //} - //二次对比比对上的数据入库 - if (secondMatchHaveSaHaveSes.Count > 0) - { - pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); + ////二次对比比对上的数据入库 + //if (secondMatchHaveSaHaveSes.Count > 0) + //{ + // pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); - var pubSeCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); - _pubSeCDetailRepository.InsertManyAsync(pubSeCDetailEntitys); - } + // var pubSeCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); + // _pubSeCDetailRepository.InsertManyAsync(pubSeCDetailEntitys); + //} #endregion if (string.IsNullOrEmpty(lu) == false) @@ -197,8 +193,6 @@ namespace SettleAccount.Job.Services.Report { pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn); } - - var pubSaSeCompareDetailExports = _objectMapper.Map, List>(pubSaSeCompareDiffs); var excelExporter = new ExcelExporter(); #region 根据业务分类转换不同导出Dto @@ -206,33 +200,33 @@ namespace SettleAccount.Job.Services.Report { case EnumBusinessType.ZhiGongJianBBAC: { - var items = _objectMapper.Map, List>(pubSaSeCompareDetailExports); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; case EnumBusinessType.ZhiGongJianHBPO: { - var items = _objectMapper.Map, List>(pubSaSeCompareDetailExports); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; case EnumBusinessType.MaiDanJianBBAC: break; case EnumBusinessType.MaiDanJianHBPO: - { - var items = _objectMapper.Map, List>(pubSaSeCompareDetailExports); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } + //{ + // var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + // excelExporter = BindExcelExporter(items, businessTypeDisplayName); + //} break; case EnumBusinessType.BeiJian: { - var items = _objectMapper.Map, List>(pubSaSeCompareDetailExports); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; case EnumBusinessType.YinDuJian: { - var items = _objectMapper.Map, List>(pubSaSeCompareDetailExports); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; @@ -250,7 +244,7 @@ namespace SettleAccount.Job.Services.Report } #region 私有方法 - public ExcelExporter BindExcelExporter(List pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, new() + public ExcelExporter BindExcelExporter(List pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport, new() { //结算核对汇总 var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs index ea66b2d3..3ca3cbeb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs @@ -27,14 +27,12 @@ namespace SettleAccount.Job /// private void CreateMapPubSaSeCompare() { - CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); CreateMap(); - - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); } } }