Browse Source

发运数据

master
mahao 1 year ago
parent
commit
ae6f23c404
  1. 238
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs
  2. 238
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs
  3. 275
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs
  4. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs
  5. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs
  6. 37
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
  7. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs
  8. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs
  9. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs
  10. 245
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  11. 6
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
  12. 126
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  13. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

238
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 Magicodes.ExporterAndImporter.Core;
using System; using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; 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<Guid> public class BBAC_SE_DETAIL_DTO : EntityDto<Guid>
{ {
/// <summary> /// <summary>
/// 发货单号 /// 期间
/// </summary> /// </summary>
[Display(Name = "发货单号")] public int Version { set; get; }
public string WmsBillNum { get; set; }
/// <summary> /// <summary>
/// 单据编号 /// 发货时间
/// </summary> /// </summary>
[Display(Name = "单据编号")] public DateTime ShippingDate { set; get; }
public string Num { get; set; }
/// <summary> /// <summary>
/// 发货时间 /// 发运单号
/// </summary> /// </summary>
[Display(Name = "发货时间")] public string WmsBillNum { set; get; }
public DateTime BillTime { get; set; }
/// <summary> /// <summary>
/// 发货人 /// 客户零件号
/// </summary> /// </summary>
[Display(Name = "发货人")] public string LU { get; set; }
public string Oper { get; set; }
/// <summary> /// <summary>
/// 排序单 /// 厂内零件号
/// </summary> /// </summary>
[Display(Name = "排序单号")] public string FactoryPartCode { get; set; }
public string OrderNum { get; set; }
/// <summary> /// <summary>
/// 订单序 /// 生产号
/// </summary> /// </summary>
[Display(Name = "订单序号")] public string PN { get; set; }
public string Seq { get; set; }
/// <summary> /// <summary>
/// 实际生产码 /// 组合键值(PN+LU)
/// </summary> /// </summary>
[Display(Name = "实际生产码")] public string KeyCode { get; set; }
public string RealCode { get; set; }
/// <summary> /// <summary>
/// 订单生产码 /// 数量
/// </summary> /// </summary>
[Display(Name = "订单生产码")] public decimal Qty { get; set; }
/// <summary>
/// UID
/// </summary>
[Display(Name = "UID")]
[DisplayName("UID")]
public long UID { get; set; }
/// <summary>
/// JIT订单号
/// </summary>
[Display(Name = "JIT订单号")]
[DisplayName("JIT订单号")]
public string JISNum { get; set; }
/// <summary>
/// JIT排序生产码
/// </summary>
[Display(Name = "JIT排序生产码")]
public string VinCode { get; set; } public string VinCode { get; set; }
/// <summary> /// <summary>
/// 生产码类型 /// JIT排序生产码类型
/// </summary> /// </summary>
[Display(Name = "生产码类型")] [Display(Name = "JIT排序生产码类型")]
public string CodeType { get; set; } public string CodeType { get; set; }
/// <summary> /// <summary>
/// 实际零件号 /// 订单零件号
/// </summary> /// </summary>
[Display(Name = "实际零件号")] [Display(Name = "订单零件号")]
public string RealPartCode { get; set; } public string PartCode { get; set; }
/// <summary> /// <summary>
/// 零件号 /// 订单零件号
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "订单零件号")]
public string PartCode { get; set; } public string RealPartCode { get; set; }
/// <summary> /// <summary>
/// 批次 /// 批次
/// </summary> /// </summary>
[Display(Name = "批次")] [Display(Name = "批次")]
public string Batch { get; set; } public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary>
/// 订单序号
/// </summary>
[Display(Name = "订单序号")]
public string Seq { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary>
/// 发货条码
/// </summary>
[Display(Name = "发货条码")]
public string DeliverCode { get; set; }
/// <summary>
/// 发货单号
/// </summary>
[Display(Name = "发货单号")]
public string BillNum { get; set; }
/// <summary>
/// 发货时间
/// </summary>
[Display(Name = "发货时间")]
public DateTime? BillTime { get; set; }
/// <summary>
/// 发货人
/// </summary>
[Display(Name = "发货人")]
public string Oper { get; set; }
/// <summary>
/// 客户位置
/// </summary>
[Display(Name = "客户位置")]
public string Position { get; set; }
/// <summary>
/// 工厂
/// </summary>
[Display(Name = "工厂")]
public string Factory { get; set; }
/// <summary> /// <summary>
/// MES配置码 /// MES配置码
/// </summary> /// </summary>
[Display(Name = "MES配置码")] [Display(Name = "MES配置码")]
public string MESConfigCode { get; set; } public string MESConfigCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary> /// <summary>
/// 目标库位 /// 目标库位
/// </summary> /// </summary>
[Display(Name = "目标库位")] [Display(Name = "目标库位")]
public string ToLoc { get; set; } public string ToLoc { get; set; }
/// <summary> /// <summary>
/// 参照订单生产码 /// 单据类型
/// </summary> /// </summary>
[Display(Name = "参照订单生产码")] public EnumBillType BillType { get; set; }
public string RefVinCode { get; set; }
/// <summary> /// <summary>
/// 单据性质 /// 子单据类型
/// </summary> /// </summary>
[Display(Name = "单据性质")] [Display(Name = "子单据类型")]
public string BillCharacter { get; set; } public EnumSubBillType SubBillType { get; set; }
/// <summary> /// <summary>
/// 发货关联单号 /// 事务类型
/// </summary> /// </summary>
[Display(Name = "发货关联单号")] [Display(Name = "事务类型")]
public string RefBillNum { get; set; } public EnumDelTransType TransType { get; set; }
/// <summary> /// <summary>
/// Erp目标库位 /// 发运主类型
/// </summary> /// </summary>
[Display(Name = "Erp目标库位")] [Display(Name = "发运主类型")]
public string ErpToLoc { get; set; } public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
/// <summary>
/// 发运子类型
/// </summary>
[Display(Name = "发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
/// <summary>
/// 单据性质
/// </summary>
[Display(Name = "单据性质")]
public string BillCharacter { get; set; }
/// <summary> /// <summary>
/// 原生产码 /// 原生产码
/// </summary> /// </summary>
[Display(Name = "原生产码")] [Display(Name = "原生产码")]
public string OrigiCode { get; set; } public string OrigiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
[Display(Name = "描述")]
public string PartDesc { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
[Display(Name = "备注")] [Display(Name = "备注")]
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[Display(Name = "业务类型")]
public EnumProTpe ProType { get; set; }
/// <summary>
/// JIS排序单号
/// </summary>
[Display(Name = "JIS排序单号")]
public string OrderNum { get; set; }
/// <summary>
/// JIS实际生产码
/// </summary>
[Display(Name = "JIS实际生产码")]
public string RealCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary>
/// 参照订单生产码
/// </summary>
[Display(Name = "参照订单生产码")]
public string RefVinCode { get; set; }
/// <summary>
/// 发货关联单号
/// </summary>
[Display(Name = "发货关联单号")]
public string RefBillNum { get; set; }
/// <summary>
/// Erp目标库位
/// </summary>
[Display(Name = "Erp目标库位")]
public string ErpToLoc { get; set; }
/// <summary> /// <summary>
/// 塑件唯一码 /// 塑件唯一码
/// </summary> /// </summary>
[Display(Name = "塑件唯一码")] [Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; } public string UniqueCode { get; set; }
/// <summary> /// <summary>
/// PJS顺序号 /// PJS顺序号
/// </summary> /// </summary>
[Display(Name = "PJS顺序号")] [Display(Name = "PJS顺序号")]
public string PjsNum { get; set; } public string PjsNum { get; set; }
/// <summary> /// <summary>
/// 虚拟小总成 /// 虚拟小总成
/// </summary> /// </summary>
[Display(Name = "虚拟小总成")] [Display(Name = "虚拟小总成")]
public string MatchNumber { get; set; } public string MatchNumber { get; set; }
/// <summary> /// <summary>
/// 发货条码 /// 状态
/// </summary> /// </summary>
[Display(Name = "发货条码")] [Display(Name = "状态")]
public string DeliverCode { get; set; } public EnumBillState State { get; set; }
/// <summary> /// <summary>
/// 客户位置 /// 创建时间
/// </summary> /// </summary>
[Display(Name = "客户位置")] [Display(Name = "创建时间")]
public string Position { get; set; } public DateTime CreateTime { get; set; }
/// <summary>
/// 是否有EDI数据
/// </summary>
[Display(Name = "是否有EDI数据")]
public bool IsHaveEdiData { get; set; }
} }
/// <summary> /// <summary>

238
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs

@ -1,7 +1,9 @@
using System; using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; 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<Guid> public class HBPO_SE_DETAIL_DTO : EntityDto<Guid>
{ {
/// <summary> /// <summary>
/// 发货单号 /// 期间
/// </summary> /// </summary>
[Display(Name = "发货单号")] public int Version { set; get; }
public string WmsBillNum { get; set; }
/// <summary> /// <summary>
/// 单据编号 /// 发货时间
/// </summary> /// </summary>
[Display(Name = "单据编号")] public DateTime ShippingDate { set; get; }
public string Num { get; set; }
/// <summary> /// <summary>
/// 发货时间 /// 发运单号
/// </summary> /// </summary>
[Display(Name = "发货时间")] public string WmsBillNum { set; get; }
public DateTime BillTime { get; set; }
/// <summary> /// <summary>
/// 发货人 /// 客户零件号
/// </summary> /// </summary>
[Display(Name = "发货人")] public string LU { get; set; }
public string Oper { get; set; }
/// <summary> /// <summary>
/// 排序单 /// 厂内零件号
/// </summary> /// </summary>
[Display(Name = "排序单号")] public string FactoryPartCode { get; set; }
public string OrderNum { get; set; }
/// <summary> /// <summary>
/// 订单序 /// 生产号
/// </summary> /// </summary>
[Display(Name = "订单序号")] public string PN { get; set; }
public string Seq { get; set; }
/// <summary> /// <summary>
/// 实际生产码 /// 组合键值(PN+LU)
/// </summary> /// </summary>
[Display(Name = "实际生产码")] public string KeyCode { get; set; }
public string RealCode { get; set; }
/// <summary> /// <summary>
/// 订单生产码 /// 数量
/// </summary> /// </summary>
[Display(Name = "订单生产码")] public decimal Qty { get; set; }
/// <summary>
/// UID
/// </summary>
[Display(Name = "UID")]
[DisplayName("UID")]
public long UID { get; set; }
/// <summary>
/// JIT订单号
/// </summary>
[Display(Name = "JIT订单号")]
[DisplayName("JIT订单号")]
public string JISNum { get; set; }
/// <summary>
/// JIT排序生产码
/// </summary>
[Display(Name = "JIT排序生产码")]
public string VinCode { get; set; } public string VinCode { get; set; }
/// <summary> /// <summary>
/// 生产码类型 /// JIT排序生产码类型
/// </summary> /// </summary>
[Display(Name = "生产码类型")] [Display(Name = "JIT排序生产码类型")]
public string CodeType { get; set; } public string CodeType { get; set; }
/// <summary> /// <summary>
/// 实际零件号 /// 订单零件号
/// </summary> /// </summary>
[Display(Name = "实际零件号")] [Display(Name = "订单零件号")]
public string RealPartCode { get; set; } public string PartCode { get; set; }
/// <summary> /// <summary>
/// 零件号 /// 订单零件号
/// </summary> /// </summary>
[Display(Name = "零件号")] [Display(Name = "订单零件号")]
public string PartCode { get; set; } public string RealPartCode { get; set; }
/// <summary> /// <summary>
/// 批次 /// 批次
/// </summary> /// </summary>
[Display(Name = "批次")] [Display(Name = "批次")]
public string Batch { get; set; } public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary>
/// 订单序号
/// </summary>
[Display(Name = "订单序号")]
public string Seq { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary>
/// 发货条码
/// </summary>
[Display(Name = "发货条码")]
public string DeliverCode { get; set; }
/// <summary>
/// 发货单号
/// </summary>
[Display(Name = "发货单号")]
public string BillNum { get; set; }
/// <summary>
/// 发货时间
/// </summary>
[Display(Name = "发货时间")]
public DateTime? BillTime { get; set; }
/// <summary>
/// 发货人
/// </summary>
[Display(Name = "发货人")]
public string Oper { get; set; }
/// <summary>
/// 客户位置
/// </summary>
[Display(Name = "客户位置")]
public string Position { get; set; }
/// <summary>
/// 工厂
/// </summary>
[Display(Name = "工厂")]
public string Factory { get; set; }
/// <summary> /// <summary>
/// MES配置码 /// MES配置码
/// </summary> /// </summary>
[Display(Name = "MES配置码")] [Display(Name = "MES配置码")]
public string MESConfigCode { get; set; } public string MESConfigCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary> /// <summary>
/// 目标库位 /// 目标库位
/// </summary> /// </summary>
[Display(Name = "目标库位")] [Display(Name = "目标库位")]
public string ToLoc { get; set; } public string ToLoc { get; set; }
/// <summary> /// <summary>
/// 参照订单生产码 /// 单据类型
/// </summary> /// </summary>
[Display(Name = "参照订单生产码")] public EnumBillType BillType { get; set; }
public string RefVinCode { get; set; }
/// <summary> /// <summary>
/// 单据性质 /// 子单据类型
/// </summary> /// </summary>
[Display(Name = "单据性质")] [Display(Name = "子单据类型")]
public string BillCharacter { get; set; } public EnumSubBillType SubBillType { get; set; }
/// <summary> /// <summary>
/// 发货关联单号 /// 事务类型
/// </summary> /// </summary>
[Display(Name = "发货关联单号")] [Display(Name = "事务类型")]
public string RefBillNum { get; set; } public EnumDelTransType TransType { get; set; }
/// <summary> /// <summary>
/// Erp目标库位 /// 发运主类型
/// </summary> /// </summary>
[Display(Name = "Erp目标库位")] [Display(Name = "发运主类型")]
public string ErpToLoc { get; set; } public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
/// <summary>
/// 发运子类型
/// </summary>
[Display(Name = "发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
/// <summary>
/// 单据性质
/// </summary>
[Display(Name = "单据性质")]
public string BillCharacter { get; set; }
/// <summary> /// <summary>
/// 原生产码 /// 原生产码
/// </summary> /// </summary>
[Display(Name = "原生产码")] [Display(Name = "原生产码")]
public string OrigiCode { get; set; } public string OrigiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
[Display(Name = "描述")]
public string PartDesc { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
[Display(Name = "备注")] [Display(Name = "备注")]
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[Display(Name = "业务类型")]
public EnumProTpe ProType { get; set; }
/// <summary>
/// JIS排序单号
/// </summary>
[Display(Name = "JIS排序单号")]
public string OrderNum { get; set; }
/// <summary>
/// JIS实际生产码
/// </summary>
[Display(Name = "JIS实际生产码")]
public string RealCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary>
/// 参照订单生产码
/// </summary>
[Display(Name = "参照订单生产码")]
public string RefVinCode { get; set; }
/// <summary>
/// 发货关联单号
/// </summary>
[Display(Name = "发货关联单号")]
public string RefBillNum { get; set; }
/// <summary>
/// Erp目标库位
/// </summary>
[Display(Name = "Erp目标库位")]
public string ErpToLoc { get; set; }
/// <summary> /// <summary>
/// 塑件唯一码 /// 塑件唯一码
/// </summary> /// </summary>
[Display(Name = "塑件唯一码")] [Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; } public string UniqueCode { get; set; }
/// <summary> /// <summary>
/// PJS顺序号 /// PJS顺序号
/// </summary> /// </summary>
[Display(Name = "PJS顺序号")] [Display(Name = "PJS顺序号")]
public string PjsNum { get; set; } public string PjsNum { get; set; }
/// <summary> /// <summary>
/// 虚拟小总成 /// 虚拟小总成
/// </summary> /// </summary>
[Display(Name = "虚拟小总成")] [Display(Name = "虚拟小总成")]
public string MatchNumber { get; set; } public string MatchNumber { get; set; }
/// <summary> /// <summary>
/// 发货条码 /// 状态
/// </summary> /// </summary>
[Display(Name = "发货条码")] [Display(Name = "状态")]
public string DeliverCode { get; set; } public EnumBillState State { get; set; }
/// <summary> /// <summary>
/// 客户位置 /// 创建时间
/// </summary> /// </summary>
[Display(Name = "客户位置")] [Display(Name = "创建时间")]
public string Position { get; set; } public DateTime CreateTime { get; set; }
/// <summary>
/// 是否有EDI数据
/// </summary>
[Display(Name = "是否有EDI数据")]
public bool IsHaveEdiData { get; set; }
} }
/// <summary> /// <summary>

275
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 System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -11,113 +12,184 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
/// </summary> /// </summary>
public class PUB_SE_DETAIL_DTO : EntityDto<Guid> public class PUB_SE_DETAIL_DTO : EntityDto<Guid>
{ {
/// <summary>
/// 期间
/// </summary>
public int Version { set; get; }
/// <summary>
/// 发货时间
/// </summary>
public DateTime ShippingDate { set; get; }
/// <summary>
/// 发运单号
/// </summary>
public string WmsBillNum { set; get; }
/// <summary>
/// 客户零件号
/// </summary>
public string LU { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
public string FactoryPartCode { get; set; }
/// <summary>
/// 生产号
/// </summary>
public string PN { get; set; }
/// <summary>
/// 组合键值(PN+LU)
/// </summary>
public string KeyCode { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Qty { get; set; }
/// <summary>
/// UID
/// </summary>
[Display(Name = "UID")]
[DisplayName("UID")]
public long UID { get; set; }
/// <summary> /// <summary>
/// 发货单号 /// 发货单号
/// </summary> /// </summary>
[Display(Name = "发货单号")] [Display(Name = "发货单号")]
public string WmsBillNum { get; set; } public string BillNum { get; set; }
/// <summary> /// <summary>
/// 发货时间 /// 发货时间
/// </summary> /// </summary>
[DisplayName("发货时间")] [Display(Name = "发货时间")]
public DateTime BillTime { get; set; } public DateTime BillTime { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary> /// <summary>
/// 零件号 /// 零件号
/// </summary> /// </summary>
[DisplayName("零件号")] [Display(Name = "零件号")]
public string PartCode { get; set; } public string PartCode { get; set; }
/// <summary> /// <summary>
/// 批次 /// 批次
/// </summary> /// </summary>
[DisplayName("批次")] [Display(Name = "批次")]
public string Batch { get; set; } public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary> /// <summary>
/// 发货人 /// 发货人
/// </summary> /// </summary>
[DisplayName("发货人")] [Display(Name = "发货人")]
public string Oper { get; set; } public string Oper { get; set; }
/// <summary> /// <summary>
/// DN单据号 /// DN单据号
/// </summary> /// </summary>
[DisplayName("DN单据号")] [Display(Name = "DN单据号")]
public string DnBillNum { get; set; } public string DnBillNum { get; set; }
/// <summary> /// <summary>
/// DN单据时间 /// DN单据时间
/// </summary> /// </summary>
[DisplayName("DN单据时间")] [Display(Name = "DN单据时间")]
public DateTime DnBillTime { get; set; } public DateTime DnBillTime { get; set; }
/// <summary> /// <summary>
/// DN单添加人 /// DN单添加人
/// </summary> /// </summary>
[DisplayName("DN单添加人")] [Display(Name = "DN单添加人")]
public string DnOper { get; set; } public string DnOper { get; set; }
/// <summary> /// <summary>
/// 交付索引 /// 交付索引
/// </summary> /// </summary>
[DisplayName("交付索引")] [Display(Name = "交付索引")]
public string DeliveryIndex { get; set; } public string DeliveryIndex { get; set; }
/// <summary> /// <summary>
/// 客户 /// 客户
/// </summary> /// </summary>
[DisplayName("客户")] [Display(Name = "客户")]
public string CustId { get; set; } public string CustId { get; set; }
/// <summary> /// <summary>
/// 发货仓库 /// 发货仓库
/// </summary> /// </summary>
[DisplayName("发货仓库")] [Display(Name = "发货仓库")]
public string DeliveryHose { get; set; } public string DeliveryHose { get; set; }
/// <summary> /// <summary>
/// 来源库位 /// 来源库位
/// </summary> /// </summary>
[DisplayName("来源库位")] [Display(Name = "来源库位")]
public string FromLocCode { get; set; } public string FromLocCode { get; set; }
/// <summary> /// <summary>
/// 来源仓库 /// 来源仓库
/// </summary> /// </summary>
[DisplayName("来源仓库")] [Display(Name = "来源仓库")]
public string FromHose { get; set; } public string FromHose { get; set; }
/// <summary> /// <summary>
/// 来源ERP库存 /// 来源ERP库存
/// </summary> /// </summary>
[DisplayName("来源ERP库存")] [Display(Name = "来源ERP库存")]
public string FromErpLocCode { get; set; } public string FromErpLocCode { get; set; }
/// <summary> /// <summary>
/// 目标库位 /// 目标库位
/// </summary> /// </summary>
[DisplayName("目标库位")] [Display(Name = "目标库位")]
public string ToLocCode { get; set; } public string ToLocCode { get; set; }
/// <summary>
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
public string ToHose { get; set; }
/// <summary> /// <summary>
/// 目标Erp库位 /// 目标Erp库位
/// </summary> /// </summary>
[DisplayName("目标Erp库位")] [Display(Name = "目标Erp库位")]
public string ToErpLocCode { get; set; } public string ToErpLocCode { get; set; }
/// <summary> /// <summary>
/// 目标仓库 /// 状态
/// </summary> /// </summary>
[DisplayName("目标仓库")] [Display(Name = "状态")]
public string ToHose { get; set; } public EnumBillState State { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
[DisplayName("备注")] [Display(Name = "备注")]
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 单据类型
/// </summary>
[Display(Name = "单据类型")]
public EnumBillType BillType { get; set; }
/// <summary>
/// 子单据类型
/// </summary>
[Display(Name = "子单据类型")]
public EnumSubBillType SubBillType { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[Display(Name = "业务类型")]
public EnumProTpe ProType { get; set; }
/// <summary>
/// 事务类型
/// </summary>
[Display(Name = "事务类型")]
public EnumDelTransType TransType { get; set; }
/// <summary>
/// 发运主类型
/// </summary>
[Display(Name = "发运主类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; }
/// <summary>
/// 发运子类型
/// </summary>
[Display(Name = "发运子类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Display(Name = "创建时间")]
public DateTime CreateTime { get; set; }
} }
/// <summary> /// <summary>
@ -136,129 +208,182 @@ public class PUB_SE_DETAIL_RequestDto : RequestDto
/// </summary> /// </summary>
public class PUB_SE_DETAIL_EXPORT_DTO public class PUB_SE_DETAIL_EXPORT_DTO
{ {
/// <summary>
/// 期间
/// </summary>
[ExporterHeader(DisplayName = "期间")]
public int Version { set; get; }
/// <summary>
/// 发货时间
/// </summary>
[ExporterHeader(DisplayName = "发货时间")]
public DateTime ShippingDate { set; get; }
/// <summary>
/// 发运单号
/// </summary>
[ExporterHeader(DisplayName = "发运单号")]
public string WmsBillNum { set; get; }
/// <summary>
/// 客户零件号
/// </summary>
[ExporterHeader(DisplayName = "客户零件号")]
public string LU { get; set; }
/// <summary>
/// 厂内零件号
/// </summary>
[ExporterHeader(DisplayName = "厂内零件号")]
public string FactoryPartCode { get; set; }
/// <summary>
/// 生产号
/// </summary>
[ExporterHeader(DisplayName = "生产号")]
public string PN { get; set; }
/// <summary>
/// 组合键值(PN+LU)
/// </summary>
[ExporterHeader(DisplayName = "组合键值")]
public string KeyCode { get; set; }
/// <summary>
/// 数量
/// </summary>
[ExporterHeader(DisplayName = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// UID
/// </summary>
[Display(Name = "UID")]
[ExporterHeader(DisplayName = "UID")]
public long UID { get; set; }
/// <summary> /// <summary>
/// 发货单号 /// 发货单号
/// </summary> /// </summary>
[Display(Name = "发货单号")] [Display(Name = "发货单号")]
[ExporterHeader(DisplayName = "发货单号")] [ExporterHeader(DisplayName = "发货单号")]
public string WmsBillNum { get; set; } public string BillNum { get; set; }
/// <summary> /// <summary>
/// 发货时间 /// 发货时间
/// </summary> /// </summary>
[DisplayName("发货时间")] [Display(Name = "发货时间")]
[ExporterHeader(DisplayName = "发货时间")] [ExporterHeader(DisplayName = "发货时间")]
public DateTime BillTime { get; set; } public DateTime BillTime { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
[ExporterHeader(DisplayName = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary> /// <summary>
/// 零件号 /// 零件号
/// </summary> /// </summary>
[DisplayName("零件号")] [Display(Name = "零件号")]
[ExporterHeader(DisplayName = "零件号")] [ExporterHeader(DisplayName = "零件号")]
public string PartCode { get; set; } public string PartCode { get; set; }
/// <summary> /// <summary>
/// 批次 /// 批次
/// </summary> /// </summary>
[DisplayName("批次")] [Display(Name = "批次")]
[ExporterHeader(DisplayName = "批次")] [ExporterHeader(DisplayName = "批次")]
public string Batch { get; set; } public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary> /// <summary>
/// 发货人 /// 发货人
/// </summary> /// </summary>
[DisplayName("发货人")] [Display(Name = "发货人")]
[ExporterHeader(DisplayName = "发货人")] [ExporterHeader(DisplayName = "发货人")]
public string Oper { get; set; } public string Oper { get; set; }
/// <summary> /// <summary>
/// DN单据号 /// DN单据号
/// </summary> /// </summary>
[DisplayName("DN单据号")] [Display(Name = "DN单据号")]
[ExporterHeader(DisplayName = "DN单据号")] [ExporterHeader(DisplayName = "DN单据号")]
public string DnBillNum { get; set; } public string DnBillNum { get; set; }
/// <summary> /// <summary>
/// DN单据时间 /// DN单据时间
/// </summary> /// </summary>
[DisplayName("DN单据时间")] [Display(Name = "DN单据时间")]
[ExporterHeader(DisplayName = "DN单据时间")] [ExporterHeader(DisplayName = "DN单据时间")]
public DateTime DnBillTime { get; set; } public DateTime DnBillTime { get; set; }
/// <summary> /// <summary>
/// DN单添加人 /// DN单添加人
/// </summary> /// </summary>
[DisplayName("DN单添加人")] [Display(Name = "DN单添加人")]
[ExporterHeader(DisplayName = "DN单添加人")] [ExporterHeader(DisplayName = "DN单添加人")]
public string DnOper { get; set; } public string DnOper { get; set; }
/// <summary> /// <summary>
/// 交付索引 /// 交付索引
/// </summary> /// </summary>
[DisplayName("交付索引")] [Display(Name = "交付索引")]
[ExporterHeader(DisplayName = "交付索引")] [ExporterHeader(DisplayName = "交付索引")]
public string DeliveryIndex { get; set; } public string DeliveryIndex { get; set; }
/// <summary> /// <summary>
/// 客户 /// 客户
/// </summary> /// </summary>
[DisplayName("客户")] [Display(Name = "客户")]
[ExporterHeader(DisplayName = "客户")] [ExporterHeader(DisplayName = "客户")]
public string CustId { get; set; } public string CustId { get; set; }
/// <summary> /// <summary>
/// 发货仓库 /// 发货仓库
/// </summary> /// </summary>
[DisplayName("发货仓库")] [Display(Name = "发货仓库")]
[ExporterHeader(DisplayName = "发货仓库")] [ExporterHeader(DisplayName = "发货仓库")]
public string DeliveryHose { get; set; } public string DeliveryHose { get; set; }
/// <summary> /// <summary>
/// 来源库位 /// 来源库位
/// </summary> /// </summary>
[DisplayName("来源库位")] [Display(Name = "来源库位")]
[ExporterHeader(DisplayName = "来源库位")] [ExporterHeader(DisplayName = "来源库位")]
public string FromLocCode { get; set; } public string FromLocCode { get; set; }
/// <summary> /// <summary>
/// 来源仓库 /// 来源仓库
/// </summary> /// </summary>
[DisplayName("来源仓库")] [Display(Name = "来源仓库")]
[ExporterHeader(DisplayName = "来源仓库")] [ExporterHeader(DisplayName = "来源仓库")]
public string FromHose { get; set; } public string FromHose { get; set; }
/// <summary> /// <summary>
/// 来源ERP库存 /// 来源ERP库存
/// </summary> /// </summary>
[DisplayName("来源ERP库存")] [Display(Name = "来源ERP库存")]
[ExporterHeader(DisplayName = "来源ERP库存")] [ExporterHeader(DisplayName = "来源ERP库存")]
public string FromErpLocCode { get; set; } public string FromErpLocCode { get; set; }
/// <summary> /// <summary>
/// 目标库位 /// 目标库位
/// </summary> /// </summary>
[DisplayName("目标库位")] [Display(Name = "目标库位")]
[ExporterHeader(DisplayName = "目标库位")] [ExporterHeader(DisplayName = "目标库位")]
public string ToLocCode { get; set; } public string ToLocCode { get; set; }
/// <summary>
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
[ExporterHeader(DisplayName = "目标仓库")]
public string ToHose { get; set; }
/// <summary> /// <summary>
/// 目标Erp库位 /// 目标Erp库位
/// </summary> /// </summary>
[DisplayName("目标Erp库位")] [Display(Name = "目标Erp库位")]
[ExporterHeader(DisplayName = "目标Erp库位")] [ExporterHeader(DisplayName = "目标Erp库位")]
public string ToErpLocCode { get; set; } public string ToErpLocCode { get; set; }
/// <summary> /// <summary>
/// 目标仓库 /// 状态
/// </summary> /// </summary>
[DisplayName("目标仓库")] [Display(Name = "状态")]
[ExporterHeader(DisplayName = "目标仓库")] [ExporterHeader(DisplayName = "状态")]
public string ToHose { get; set; } public EnumBillState State { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
[DisplayName("备注")] [Display(Name = "备注")]
[ExporterHeader(DisplayName = "备注")] [ExporterHeader(DisplayName = "备注")]
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Display(Name = "创建时间")]
[ExporterHeader(DisplayName = "创建时间")]
public DateTime CreateTime { get; set; }
} }

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs

@ -24,11 +24,12 @@ public class BeiSeSyncAppService : JitSeSyncAppService, IJobService
/// </summary> /// </summary>
public BeiSeSyncAppService( public BeiSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

8
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<JisHBPOSeSyncAppService>(), EnumBusinessType.JisHBPO => scope.ServiceProvider.GetRequiredService<JisHBPOSeSyncAppService>(),
EnumBusinessType.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService<MaiDanBBACSeSyncAppService>(), EnumBusinessType.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService<MaiDanBBACSeSyncAppService>(),
EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService<MaiDanHBPOSeSyncAppService>(), EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService<MaiDanHBPOSeSyncAppService>(),
EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(), //EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(),
EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(), EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService<ZhiGongHBPOSeSyncAppService>(),
EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService<BeiSeSyncAppService>(), //EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService<BeiSeSyncAppService>(),
EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService<YinDuSeSyncAppService>(), //EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService<YinDuSeSyncAppService>(),
_ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"), _ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"),
}; };
await jitSeSyncAppService.Invoke().ConfigureAwait(false); await jitSeSyncAppService.Invoke().ConfigureAwait(false);

37
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 System.Threading.Tasks;
using Coravel.Invocable; using Coravel.Invocable;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using LinqToDB;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.CurrentBranch;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
@ -28,6 +30,11 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 数据上下文
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary> /// <summary>
/// 同步位置标记 /// 同步位置标记
/// </summary> /// </summary>
@ -50,12 +57,14 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
/// </summary> /// </summary>
public JitSeSyncAppService( public JitSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService) VmiAppService vmiService)
{ {
_wmsBJBMPTContext = wmsBJBMPTContext; _wmsBJBMPTContext = wmsBJBMPTContext;
_settleAccountDbContext = settleAccountDbContext;
_syncPositionFlagRepository = syncPositionFlagRepository; _syncPositionFlagRepository = syncPositionFlagRepository;
_pubSeDetailRepository = pubSeDetailRepository; _pubSeDetailRepository = pubSeDetailRepository;
_materialRelationshipManager = materialRelationshipManager; _materialRelationshipManager = materialRelationshipManager;
@ -99,7 +108,8 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
if (luRePartCodes.Any()) if (luRePartCodes.Any())
{ {
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); 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 => pubSeDetails.ForEach(t =>
@ -108,7 +118,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
t.BusinessType = businessType; t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU; t.KeyCode = t.PN + t.LU;
}); });
await _pubSeDetailRepository.DbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false); await _settleAccountDbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {
@ -182,4 +192,25 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
} }
} }
} }
/// <summary>
/// 添加零件关系
/// </summary>
public async Task AddNewMaterialRelationships(IEnumerable<MaterialRelationship> materialRelationships)
{
//新客户零件号和厂内零件号
var noHaveLuRePartCodes = from item1 in materialRelationships
join item2 in _settleAccountDbContext.Set<MaterialRelationship>()
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);
}
}
} }

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs

@ -24,11 +24,12 @@ public class YinDuSeSyncAppService : JitSeSyncAppService, IJobService
/// </summary> /// </summary>
public YinDuSeSyncAppService( public YinDuSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs

@ -24,11 +24,12 @@ public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService, IJobService
/// </summary> /// </summary>
public ZhiGongBBACSeSyncAppService( public ZhiGongBBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs

@ -1,11 +1,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -23,12 +27,14 @@ public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService
/// 构造 /// 构造
/// </summary> /// </summary>
public ZhiGongHBPOSeSyncAppService( public ZhiGongHBPOSeSyncAppService(
IHost host,
WMSBJBMPTDbContext wmsBJBMPTContext, WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository, INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager, MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService) ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{ {
base.SeSyncConfigInfo = new SeSyncConfig() base.SeSyncConfigInfo = new SeSyncConfig()
{ {
@ -44,6 +50,6 @@ public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService
public async Task Invoke(IServiceProvider serviceProvider) public async Task Invoke(IServiceProvider serviceProvider)
{ {
await this.Invoke(); await base.Invoke().ConfigureAwait(false);
} }
} }

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

@ -130,6 +130,14 @@ public class PubSaSeCompareDiff
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExport public class PubSaSeCompareDetailExport
{
}
/// <summary>
/// PUB结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExport2
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -144,33 +152,33 @@ public class PubSaSeCompareDetailExport
[ValueMapping("无结算有发运", 3)] [ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; } public EnumPubSaSeCompareCategory Category { get; set; }
///// <summary> /// <summary>
///// Wms发货单号 /// Wms发货单号
///// </summary> /// </summary>
//[Display(Name = "Wms发货单号")] [Display(Name = "Wms发货单号")]
//[ExporterHeader(DisplayName = "交货单号")] [ExporterHeader(DisplayName = "交货单号")]
//public string WmsBillNum { get; set; } public string WmsBillNum { get; set; }
///// <summary> /// <summary>
///// 发货日期 /// 发货日期
///// </summary> /// </summary>
//[Display(Name = "发货日期")] [Display(Name = "发货日期")]
//[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
//public DateTime ShippingDate { get; set; } public DateTime ShippingDate { get; set; }
///// <summary> /// <summary>
///// 生产码 /// 生产码
///// </summary> /// </summary>
//[Display(Name = "生产码")] [Display(Name = "生产码")]
//[ExporterHeader(DisplayName = "ASN发货单号")] [ExporterHeader(DisplayName = "ASN发货单号")]
//public string PN { get; set; } public string PN { get; set; }
///// <summary> /// <summary>
///// 物料号 /// 物料号
///// </summary> /// </summary>
//[Display(Name = "物料号")] [Display(Name = "物料号")]
//[ExporterHeader(DisplayName = "厂内物料号")] [ExporterHeader(DisplayName = "厂内物料号")]
//public string MaterialNumber { get; set; } public string MaterialNumber { get; set; }
/// <summary> /// <summary>
/// 物料描述 /// 物料描述
@ -179,12 +187,12 @@ public class PubSaSeCompareDetailExport
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; } public string MaterialDes { get; set; }
///// <summary> /// <summary>
///// 原始LU /// 原始LU
///// </summary> /// </summary>
//[Display(Name = "原始LU")] [Display(Name = "原始LU")]
//[ExporterHeader(DisplayName = "原始LU")] [ExporterHeader(DisplayName = "原始LU")]
//public string PrimitiveLU { get; set; } public string PrimitiveLU { get; set; }
/// <summary> /// <summary>
///替换LU ///替换LU
@ -193,12 +201,12 @@ public class PubSaSeCompareDetailExport
[ExporterHeader(DisplayName = "替换LU")] [ExporterHeader(DisplayName = "替换LU")]
public string ReplaceLU { get; set; } public string ReplaceLU { get; set; }
///// <summary> /// <summary>
///// 结算数据中的过账日期 /// 结算数据中的过账日期
///// </summary> /// </summary>
//[Display(Name = "客户下线时间")] [Display(Name = "客户下线时间")]
//[ExporterHeader(DisplayName = "客户下线时间")] [ExporterHeader(DisplayName = "客户下线时间")]
//public DateTime CustomerOfflineTime { get; set; } public DateTime CustomerOfflineTime { get; set; }
/// <summary> /// <summary>
/// 结算数量 /// 结算数量
@ -214,53 +222,100 @@ public class PubSaSeCompareDetailExport
[ExporterHeader(DisplayName = "WMS发货数量")] [ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; } public decimal SEQty { get; set; }
///// <summary> /// <summary>
///// 差异数量 /// 差异数量
///// </summary> /// </summary>
//[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
//public decimal DiffQty { set; get; } public decimal DiffQty { set; get; }
///// <summary> /// <summary>
///// 匹配类型 /// 匹配类型
///// </summary> /// </summary>
//[Display(Name = "匹配类型")] [Display(Name = "匹配类型")]
//[ExporterHeader(DisplayName = "是否完全匹配")] [ExporterHeader(DisplayName = "是否完全匹配")]
//public string MateType { get; set; } public string MateType { get; set; }
///// <summary> /// <summary>
///// 定价 /// 定价
///// </summary> /// </summary>
//[Display(Name = "定价")] [Display(Name = "定价")]
//[ExporterHeader(DisplayName = "定价")] [ExporterHeader(DisplayName = "定价")]
//public decimal FixPrice { get; set; } public decimal FixPrice { get; set; }
///// <summary> /// <summary>
///// 日顺序号 /// 日顺序号
///// </summary> /// </summary>
//[Display(Name = "日顺序号")] [Display(Name = "日顺序号")]
//[ExporterHeader(DisplayName = "日顺序号")] [ExporterHeader(DisplayName = "日顺序号")]
//public string SeqNumber { get; set; } public string SeqNumber { get; set; }
///// <summary> /// <summary>
///// PJIS日顺序号 /// PJIS日顺序号
///// </summary> /// </summary>
//[Display(Name = "PJIS日顺序号")] [Display(Name = "PJIS日顺序号")]
//[ExporterHeader(DisplayName = "PJIS日顺序号")] [ExporterHeader(DisplayName = "PJIS日顺序号")]
//public string PJISSeqNumber { get; set; } public string PJISSeqNumber { get; set; }
///// <summary> /// <summary>
///// WMS目标库位 /// WMS目标库位
///// </summary> /// </summary>
//[Display(Name = "WMS目标库位")] [Display(Name = "WMS目标库位")]
//[ExporterHeader(DisplayName = "WMS目标库位")] [ExporterHeader(DisplayName = "WMS目标库位")]
//public string ToLocCode { get; set; } public string ToLocCode { get; set; }
///// <summary> /// <summary>
///// ERP目标库位 /// ERP目标库位
///// </summary> /// </summary>
//[Display(Name = "ERP目标库位")] [Display(Name = "ERP目标库位")]
//[ExporterHeader(DisplayName = "ERP目标库位")] [ExporterHeader(DisplayName = "ERP目标库位")]
//public string ToErpLocCode { get; set; } public string ToErpLocCode { get; set; }
}
/// <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 MaterialDes { get; set; }
/// <summary>
///替换LU
/// </summary>
[Display(Name = "替换LU")]
[ExporterHeader(DisplayName = "替换LU")]
public string ReplaceLU { 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>
@ -308,7 +363,7 @@ public class PubSaSeCompareSumExport
/// 直供件BBAC结算与发运对比明细 /// 直供件BBAC结算与发运对比明细
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -397,7 +452,7 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
@ -432,7 +487,7 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp
/// 直供件HBPO结算与发运对比明细 /// 直供件HBPO结算与发运对比明细
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -521,7 +576,7 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
@ -645,7 +700,7 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
@ -680,7 +735,7 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo
/// 备件结算与发运对比明细 /// 备件结算与发运对比明细
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -769,7 +824,7 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型
@ -804,7 +859,7 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport
/// 印度件结算与发运对比明细 /// 印度件结算与发运对比明细
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport
{ {
/// <summary> /// <summary>
/// 类别 /// 类别
@ -893,7 +948,7 @@ public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; } public decimal DiffQty => SAQty - SEQty;
/// <summary> /// <summary>
/// 匹配类型 /// 匹配类型

6
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs

@ -37,7 +37,9 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
SELECT SELECT
A.WmsBillNum, A.WmsBillNum,
A.ShippingDate, A.ShippingDate,
A.PartCode AS MaterialNumber, A.LU AS MaterialNumber,
A.FactoryPartCode AS PrimitiveLU,
A.FactoryPartCode AS ReplaceLU,
'' MaterialDes, '' MaterialDes,
B.SettleDate CustomerOfflineTime, B.SettleDate CustomerOfflineTime,
A.LU SeLU, A.LU SeLU,
@ -50,7 +52,7 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
A.ToLocCode, A.ToLocCode,
A.ToErpLocCode A.ToErpLocCode
FROM FROM
(SELECT SUM(QTY) SEQty,LU,PN,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate,MAX(PartCode) PartCode, MAX(ToLocCode) ToLocCode, MAX(ToErpLocCode) ToErpLocCode FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} {strSeWhere} GROUP BY LU,PN) A (SELECT SUM(QTY) SEQty,LU,PN,FactoryPartCode,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate,MAX(PartCode) PartCode, MAX(ToLocCode) ToLocCode, MAX(ToErpLocCode) ToErpLocCode FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} {strSeWhere} GROUP BY LU,PN,FactoryPartCode) A
FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate 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 FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate 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; ORDER BY B.SettleDate DESC;
"; ";

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

@ -126,67 +126,63 @@ namespace SettleAccount.Job.Services.Report
//二次匹配上的记录 //二次匹配上的记录
var secondMatchHaveSaHaveSes = new List<PubSaSeCompareDiff>(); var secondMatchHaveSaHaveSes = new List<PubSaSeCompareDiff>();
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 二次对比 #region 二次对比
//二次对比(替换零件号) ////二次对比(替换零件号)
var repLUs = notHaveSaHaveSes.Select(t => t.SeLU).Distinct().ToList(); //var repLUs = notHaveSaHaveSes.Select(t => t.SeLU).Distinct().ToList();
var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && t.BusinessType == businessType).Result; //var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && t.BusinessType == businessType).Result;
tbRePartsRelationships.ForEach(tbRePartsRelationship => //tbRePartsRelationships.ForEach(tbRePartsRelationship =>
{ //{
notHaveSaHaveSes.FindAll(t => t.SeLU == tbRePartsRelationship.RepLU).ForEach(t => // notHaveSaHaveSes.FindAll(t => t.SeLU == tbRePartsRelationship.RepLU).ForEach(t =>
{ // {
t.ReplaceLU = tbRePartsRelationship.LU; // t.ReplaceLU = tbRePartsRelationship.LU;
}); // });
}); //});
var haveSaNotHaveSeLUPNs = haveSaNotHaveSes.Select(t => 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 notHaveSaHaveSeLUPNs = notHaveSaHaveSes.Select(t => new { t.ReplaceLU, t.PN });
//二次匹配 匹配上的零件号 ////二次匹配 匹配上的零件号
var secondMatchLUPNs = haveSaNotHaveSeLUPNs.Intersect(notHaveSaHaveSeLUPNs); //var secondMatchLUPNs = haveSaNotHaveSeLUPNs.Intersect(notHaveSaHaveSeLUPNs);
if (secondMatchLUPNs.Any() == true) //if (secondMatchLUPNs.Any() == true)
{ //{
pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchLUPNs.Contains(new { t.ReplaceLU, t.PN })); // pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchLUPNs.Contains(new { t.ReplaceLU, t.PN }));
foreach (var secondMatchLUPN in secondMatchLUPNs) // foreach (var secondMatchLUPN in secondMatchLUPNs)
{ // {
var haveSaNotHaveSe = haveSaNotHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN); // 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); // var notHaveSaHaveSe = notHaveSaHaveSes.FirstOrDefault(t => t.ReplaceLU == secondMatchLUPN.ReplaceLU && t.PN == secondMatchLUPN.PN);
secondMatchHaveSaHaveSes.Add(new PubSaSeCompareDiff() // secondMatchHaveSaHaveSes.Add(new PubSaSeCompareDiff()
{ // {
WmsBillNum = notHaveSaHaveSe.WmsBillNum, // WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate, // ShippingDate = notHaveSaHaveSe.ShippingDate,
SeqNumber = notHaveSaHaveSe.SeqNumber, // SeqNumber = notHaveSaHaveSe.SeqNumber,
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber, // PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber,
MaterialNumber = haveSaNotHaveSe.MaterialNumber, // MaterialNumber = haveSaNotHaveSe.MaterialNumber,
MaterialDes = haveSaNotHaveSe.MaterialDes, // MaterialDes = haveSaNotHaveSe.MaterialDes,
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, // CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
SAQty = haveSaNotHaveSe.SAQty, // SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty, // SEQty = notHaveSaHaveSe.SEQty,
MateType = haveSaNotHaveSe.MateType, // MateType = haveSaNotHaveSe.MateType,
FixPrice = haveSaNotHaveSe.FixPrice, // FixPrice = haveSaNotHaveSe.FixPrice,
PrimitiveLU = haveSaNotHaveSe.PrimitiveLU, // PrimitiveLU = haveSaNotHaveSe.PrimitiveLU,
ReplaceLU = haveSaNotHaveSe.ReplaceLU, // ReplaceLU = haveSaNotHaveSe.ReplaceLU,
SeLU = notHaveSaHaveSe.SeLU, // SeLU = notHaveSaHaveSe.SeLU,
SaLU = haveSaNotHaveSe.SaLU, // SaLU = haveSaNotHaveSe.SaLU,
PN = haveSaNotHaveSe.PN, // PN = haveSaNotHaveSe.PN,
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe, // Category = EnumPubSaSeCompareCategory.HaveSaHaveSe,
IsRemove = false // IsRemove = false
}); // });
} // }
} //}
//二次对比比对上的数据入库 ////二次对比比对上的数据入库
if (secondMatchHaveSaHaveSes.Count > 0) //if (secondMatchHaveSaHaveSes.Count > 0)
{ //{
pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); // pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes);
var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes); // var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
_pubSeCDetailRepository.InsertManyAsync(pubSeCDetailEntitys); // _pubSeCDetailRepository.InsertManyAsync(pubSeCDetailEntitys);
} //}
#endregion #endregion
if (string.IsNullOrEmpty(lu) == false) if (string.IsNullOrEmpty(lu) == false)
@ -197,8 +193,6 @@ namespace SettleAccount.Job.Services.Report
{ {
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn); pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn);
} }
var pubSaSeCompareDetailExports = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExport>>(pubSaSeCompareDiffs);
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
#region 根据业务分类转换不同导出Dto #region 根据业务分类转换不同导出Dto
@ -206,33 +200,33 @@ namespace SettleAccount.Job.Services.Report
{ {
case EnumBusinessType.ZhiGongJianBBAC: case EnumBusinessType.ZhiGongJianBBAC:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportZhiGongJianBBAC>>(pubSaSeCompareDetailExports); var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBAC>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBAC>(items, businessTypeDisplayName);
} }
break; break;
case EnumBusinessType.ZhiGongJianHBPO: case EnumBusinessType.ZhiGongJianHBPO:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportZhiGongJianHBPO>>(pubSaSeCompareDetailExports); var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPO>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPO>(items, businessTypeDisplayName);
} }
break; break;
case EnumBusinessType.MaiDanJianBBAC: case EnumBusinessType.MaiDanJianBBAC:
break; break;
case EnumBusinessType.MaiDanJianHBPO: case EnumBusinessType.MaiDanJianHBPO:
{ //{
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDetailExports); // var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName); // excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName);
} //}
break; break;
case EnumBusinessType.BeiJian: case EnumBusinessType.BeiJian:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportBeiJian>>(pubSaSeCompareDetailExports); var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportBeiJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJian>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJian>(items, businessTypeDisplayName);
} }
break; break;
case EnumBusinessType.YinDuJian: case EnumBusinessType.YinDuJian:
{ {
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportYinDuJian>>(pubSaSeCompareDetailExports); var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportYinDuJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJian>(items, businessTypeDisplayName); excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJian>(items, businessTypeDisplayName);
} }
break; break;
@ -250,7 +244,7 @@ namespace SettleAccount.Job.Services.Report
} }
#region 私有方法 #region 私有方法
public ExcelExporter BindExcelExporter<T>(List<T> pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, new() public ExcelExporter BindExcelExporter<T>(List<T> pubSaSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport, new()
{ {
//结算核对汇总 //结算核对汇总
var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport() var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()

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

@ -27,14 +27,12 @@ namespace SettleAccount.Job
/// </summary> /// </summary>
private void CreateMapPubSaSeCompare() private void CreateMapPubSaSeCompare()
{ {
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExport>(); CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportBeiJian>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportYinDuJian>();
CreateMap<PubSaSeCompareDiff, PUB_SEC_DETAIL>(); CreateMap<PubSaSeCompareDiff, PUB_SEC_DETAIL>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportBeiJian>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportYinDuJian>();
} }
} }
} }

Loading…
Cancel
Save