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 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<Guid>
{
/// <summary>
/// 发货单号
/// 期间
/// </summary>
[Display(Name = "发货单号")]
public string WmsBillNum { get; set; }
public int Version { set; get; }
/// <summary>
/// 单据编号
/// 发货时间
/// </summary>
[Display(Name = "单据编号")]
public string Num { get; set; }
public DateTime ShippingDate { set; get; }
/// <summary>
/// 发货时间
/// 发运单号
/// </summary>
[Display(Name = "发货时间")]
public DateTime BillTime { get; set; }
public string WmsBillNum { set; get; }
/// <summary>
/// 发货人
/// 客户零件号
/// </summary>
[Display(Name = "发货人")]
public string Oper { get; set; }
public string LU { get; set; }
/// <summary>
/// 排序单
/// 厂内零件号
/// </summary>
[Display(Name = "排序单号")]
public string OrderNum { get; set; }
public string FactoryPartCode { get; set; }
/// <summary>
/// 订单序
/// 生产号
/// </summary>
[Display(Name = "订单序号")]
public string Seq { get; set; }
public string PN { get; set; }
/// <summary>
/// 实际生产码
/// 组合键值(PN+LU)
/// </summary>
[Display(Name = "实际生产码")]
public string RealCode { get; set; }
public string KeyCode { get; set; }
/// <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; }
/// <summary>
/// 生产码类型
/// JIT排序生产码类型
/// </summary>
[Display(Name = "生产码类型")]
[Display(Name = "JIT排序生产码类型")]
public string CodeType { get; set; }
/// <summary>
/// 实际零件号
/// 订单零件号
/// </summary>
[Display(Name = "实际零件号")]
public string RealPartCode { get; set; }
[Display(Name = "订单零件号")]
public string PartCode { get; set; }
/// <summary>
/// 零件号
/// 订单零件号
/// </summary>
[Display(Name = "零件号")]
public string PartCode { get; set; }
[Display(Name = "订单零件号")]
public string RealPartCode { get; set; }
/// <summary>
/// 批次
/// </summary>
[Display(Name = "批次")]
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>
/// MES配置码
/// </summary>
[Display(Name = "MES配置码")]
public string MESConfigCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary>
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
public string ToLoc { get; set; }
/// <summary>
/// 参照订单生产码
/// 单据类型
/// </summary>
[Display(Name = "参照订单生产码")]
public string RefVinCode { get; set; }
public EnumBillType BillType { get; set; }
/// <summary>
/// 单据性质
/// 子单据类型
/// </summary>
[Display(Name = "单据性质")]
public string BillCharacter { get; set; }
[Display(Name = "子单据类型")]
public EnumSubBillType SubBillType { get; set; }
/// <summary>
/// 发货关联单号
/// 事务类型
/// </summary>
[Display(Name = "发货关联单号")]
public string RefBillNum { get; set; }
[Display(Name = "事务类型")]
public EnumDelTransType TransType { get; set; }
/// <summary>
/// Erp目标库位
/// 发运主类型
/// </summary>
[Display(Name = "Erp目标库位")]
public string ErpToLoc { get; set; }
[Display(Name = "发运主类型")]
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>
[Display(Name = "原生产码")]
public string OrigiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
[Display(Name = "描述")]
public string PartDesc { get; set; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "备注")]
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>
[Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; }
/// <summary>
/// PJS顺序号
/// </summary>
[Display(Name = "PJS顺序号")]
public string PjsNum { get; set; }
/// <summary>
/// 虚拟小总成
/// </summary>
[Display(Name = "虚拟小总成")]
public string MatchNumber { get; set; }
/// <summary>
/// 发货条码
/// 状态
/// </summary>
[Display(Name = "发货条码")]
public string DeliverCode { get; set; }
[Display(Name = "状态")]
public EnumBillState State { get; set; }
/// <summary>
/// 客户位置
/// 创建时间
/// </summary>
[Display(Name = "客户位置")]
public string Position { get; set; }
[Display(Name = "创建时间")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 是否有EDI数据
/// </summary>
[Display(Name = "是否有EDI数据")]
public bool IsHaveEdiData { get; set; }
}
/// <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.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<Guid>
{
/// <summary>
/// 发货单号
/// 期间
/// </summary>
[Display(Name = "发货单号")]
public string WmsBillNum { get; set; }
public int Version { set; get; }
/// <summary>
/// 单据编号
/// 发货时间
/// </summary>
[Display(Name = "单据编号")]
public string Num { get; set; }
public DateTime ShippingDate { set; get; }
/// <summary>
/// 发货时间
/// 发运单号
/// </summary>
[Display(Name = "发货时间")]
public DateTime BillTime { get; set; }
public string WmsBillNum { set; get; }
/// <summary>
/// 发货人
/// 客户零件号
/// </summary>
[Display(Name = "发货人")]
public string Oper { get; set; }
public string LU { get; set; }
/// <summary>
/// 排序单
/// 厂内零件号
/// </summary>
[Display(Name = "排序单号")]
public string OrderNum { get; set; }
public string FactoryPartCode { get; set; }
/// <summary>
/// 订单序
/// 生产号
/// </summary>
[Display(Name = "订单序号")]
public string Seq { get; set; }
public string PN { get; set; }
/// <summary>
/// 实际生产码
/// 组合键值(PN+LU)
/// </summary>
[Display(Name = "实际生产码")]
public string RealCode { get; set; }
public string KeyCode { get; set; }
/// <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; }
/// <summary>
/// 生产码类型
/// JIT排序生产码类型
/// </summary>
[Display(Name = "生产码类型")]
[Display(Name = "JIT排序生产码类型")]
public string CodeType { get; set; }
/// <summary>
/// 实际零件号
/// 订单零件号
/// </summary>
[Display(Name = "实际零件号")]
public string RealPartCode { get; set; }
[Display(Name = "订单零件号")]
public string PartCode { get; set; }
/// <summary>
/// 零件号
/// 订单零件号
/// </summary>
[Display(Name = "零件号")]
public string PartCode { get; set; }
[Display(Name = "订单零件号")]
public string RealPartCode { get; set; }
/// <summary>
/// 批次
/// </summary>
[Display(Name = "批次")]
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>
/// MES配置码
/// </summary>
[Display(Name = "MES配置码")]
public string MESConfigCode { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[Display(Name = "来源库位")]
public string FromLoc { get; set; }
/// <summary>
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
public string ToLoc { get; set; }
/// <summary>
/// 参照订单生产码
/// 单据类型
/// </summary>
[Display(Name = "参照订单生产码")]
public string RefVinCode { get; set; }
public EnumBillType BillType { get; set; }
/// <summary>
/// 单据性质
/// 子单据类型
/// </summary>
[Display(Name = "单据性质")]
public string BillCharacter { get; set; }
[Display(Name = "子单据类型")]
public EnumSubBillType SubBillType { get; set; }
/// <summary>
/// 发货关联单号
/// 事务类型
/// </summary>
[Display(Name = "发货关联单号")]
public string RefBillNum { get; set; }
[Display(Name = "事务类型")]
public EnumDelTransType TransType { get; set; }
/// <summary>
/// Erp目标库位
/// 发运主类型
/// </summary>
[Display(Name = "Erp目标库位")]
public string ErpToLoc { get; set; }
[Display(Name = "发运主类型")]
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>
[Display(Name = "原生产码")]
public string OrigiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
[Display(Name = "描述")]
public string PartDesc { get; set; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "备注")]
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>
[Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; }
/// <summary>
/// PJS顺序号
/// </summary>
[Display(Name = "PJS顺序号")]
public string PjsNum { get; set; }
/// <summary>
/// 虚拟小总成
/// </summary>
[Display(Name = "虚拟小总成")]
public string MatchNumber { get; set; }
/// <summary>
/// 发货条码
/// 状态
/// </summary>
[Display(Name = "发货条码")]
public string DeliverCode { get; set; }
[Display(Name = "状态")]
public EnumBillState State { get; set; }
/// <summary>
/// 客户位置
/// 创建时间
/// </summary>
[Display(Name = "客户位置")]
public string Position { get; set; }
[Display(Name = "创建时间")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 是否有EDI数据
/// </summary>
[Display(Name = "是否有EDI数据")]
public bool IsHaveEdiData { get; set; }
}
/// <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 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;
/// </summary>
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>
[Display(Name = "发货单号")]
public string WmsBillNum { get; set; }
public string BillNum { get; set; }
/// <summary>
/// 发货时间
/// </summary>
[DisplayName("发货时间")]
[Display(Name = "发货时间")]
public DateTime BillTime { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary>
/// 零件号
/// </summary>
[DisplayName("零件号")]
[Display(Name = "零件号")]
public string PartCode { get; set; }
/// <summary>
/// 批次
/// </summary>
[DisplayName("批次")]
[Display(Name = "批次")]
public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary>
/// 发货人
/// </summary>
[DisplayName("发货人")]
[Display(Name = "发货人")]
public string Oper { get; set; }
/// <summary>
/// DN单据号
/// </summary>
[DisplayName("DN单据号")]
[Display(Name = "DN单据号")]
public string DnBillNum { get; set; }
/// <summary>
/// DN单据时间
/// </summary>
[DisplayName("DN单据时间")]
[Display(Name = "DN单据时间")]
public DateTime DnBillTime { get; set; }
/// <summary>
/// DN单添加人
/// </summary>
[DisplayName("DN单添加人")]
[Display(Name = "DN单添加人")]
public string DnOper { get; set; }
/// <summary>
/// 交付索引
/// </summary>
[DisplayName("交付索引")]
[Display(Name = "交付索引")]
public string DeliveryIndex { get; set; }
/// <summary>
/// 客户
/// </summary>
[DisplayName("客户")]
[Display(Name = "客户")]
public string CustId { get; set; }
/// <summary>
/// 发货仓库
/// </summary>
[DisplayName("发货仓库")]
[Display(Name = "发货仓库")]
public string DeliveryHose { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[DisplayName("来源库位")]
[Display(Name = "来源库位")]
public string FromLocCode { get; set; }
/// <summary>
/// 来源仓库
/// </summary>
[DisplayName("来源仓库")]
[Display(Name = "来源仓库")]
public string FromHose { get; set; }
/// <summary>
/// 来源ERP库存
/// </summary>
[DisplayName("来源ERP库存")]
[Display(Name = "来源ERP库存")]
public string FromErpLocCode { get; set; }
/// <summary>
/// 目标库位
/// </summary>
[DisplayName("目标库位")]
[Display(Name = "目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
public string ToHose { get; set; }
/// <summary>
/// 目标Erp库位
/// </summary>
[DisplayName("目标Erp库位")]
[Display(Name = "目标Erp库位")]
public string ToErpLocCode { get; set; }
/// <summary>
/// 目标仓库
/// 状态
/// </summary>
[DisplayName("目标仓库")]
public string ToHose { get; set; }
[Display(Name = "状态")]
public EnumBillState State { get; set; }
/// <summary>
/// 备注
/// </summary>
[DisplayName("备注")]
[Display(Name = "备注")]
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>
@ -136,129 +208,182 @@ public class PUB_SE_DETAIL_RequestDto : RequestDto
/// </summary>
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>
[Display(Name = "发货单号")]
[ExporterHeader(DisplayName = "发货单号")]
public string WmsBillNum { get; set; }
public string BillNum { get; set; }
/// <summary>
/// 发货时间
/// </summary>
[DisplayName("发货时间")]
[Display(Name = "发货时间")]
[ExporterHeader(DisplayName = "发货时间")]
public DateTime BillTime { get; set; }
/// <summary>
/// 订单时间
/// </summary>
[Display(Name = "订单时间")]
[ExporterHeader(DisplayName = "订单时间")]
public DateTime AssembleData { get; set; }
/// <summary>
/// 零件号
/// </summary>
[DisplayName("零件号")]
[Display(Name = "零件号")]
[ExporterHeader(DisplayName = "零件号")]
public string PartCode { get; set; }
/// <summary>
/// 批次
/// </summary>
[DisplayName("批次")]
[Display(Name = "批次")]
[ExporterHeader(DisplayName = "批次")]
public string Batch { get; set; }
/// <summary>
/// 客户零件号
/// </summary>
[Display(Name = "客户零件号")]
[ExporterHeader(DisplayName = "客户零件号")]
public string CustPartCode { get; set; }
/// <summary>
/// 发货人
/// </summary>
[DisplayName("发货人")]
[Display(Name = "发货人")]
[ExporterHeader(DisplayName = "发货人")]
public string Oper { get; set; }
/// <summary>
/// DN单据号
/// </summary>
[DisplayName("DN单据号")]
[Display(Name = "DN单据号")]
[ExporterHeader(DisplayName = "DN单据号")]
public string DnBillNum { get; set; }
/// <summary>
/// DN单据时间
/// </summary>
[DisplayName("DN单据时间")]
[Display(Name = "DN单据时间")]
[ExporterHeader(DisplayName = "DN单据时间")]
public DateTime DnBillTime { get; set; }
/// <summary>
/// DN单添加人
/// </summary>
[DisplayName("DN单添加人")]
[Display(Name = "DN单添加人")]
[ExporterHeader(DisplayName = "DN单添加人")]
public string DnOper { get; set; }
/// <summary>
/// 交付索引
/// </summary>
[DisplayName("交付索引")]
[Display(Name = "交付索引")]
[ExporterHeader(DisplayName = "交付索引")]
public string DeliveryIndex { get; set; }
/// <summary>
/// 客户
/// </summary>
[DisplayName("客户")]
[Display(Name = "客户")]
[ExporterHeader(DisplayName = "客户")]
public string CustId { get; set; }
/// <summary>
/// 发货仓库
/// </summary>
[DisplayName("发货仓库")]
[Display(Name = "发货仓库")]
[ExporterHeader(DisplayName = "发货仓库")]
public string DeliveryHose { get; set; }
/// <summary>
/// 来源库位
/// </summary>
[DisplayName("来源库位")]
[Display(Name = "来源库位")]
[ExporterHeader(DisplayName = "来源库位")]
public string FromLocCode { get; set; }
/// <summary>
/// 来源仓库
/// </summary>
[DisplayName("来源仓库")]
[Display(Name = "来源仓库")]
[ExporterHeader(DisplayName = "来源仓库")]
public string FromHose { get; set; }
/// <summary>
/// 来源ERP库存
/// </summary>
[DisplayName("来源ERP库存")]
[Display(Name = "来源ERP库存")]
[ExporterHeader(DisplayName = "来源ERP库存")]
public string FromErpLocCode { get; set; }
/// <summary>
/// 目标库位
/// </summary>
[DisplayName("目标库位")]
[Display(Name = "目标库位")]
[ExporterHeader(DisplayName = "目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
[ExporterHeader(DisplayName = "目标仓库")]
public string ToHose { get; set; }
/// <summary>
/// 目标Erp库位
/// </summary>
[DisplayName("目标Erp库位")]
[Display(Name = "目标Erp库位")]
[ExporterHeader(DisplayName = "目标Erp库位")]
public string ToErpLocCode { get; set; }
/// <summary>
/// 目标仓库
/// 状态
/// </summary>
[DisplayName("目标仓库")]
[ExporterHeader(DisplayName = "目标仓库")]
public string ToHose { get; set; }
[Display(Name = "状态")]
[ExporterHeader(DisplayName = "状态")]
public EnumBillState State { get; set; }
/// <summary>
/// 备注
/// </summary>
[DisplayName("备注")]
[Display(Name = "备注")]
[ExporterHeader(DisplayName = "备注")]
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>
public BeiSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{
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.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService<MaiDanBBACSeSyncAppService>(),
EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService<MaiDanHBPOSeSyncAppService>(),
EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(),
EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(),
EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService<BeiSeSyncAppService>(),
EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService<YinDuSeSyncAppService>(),
//EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(),
EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService<ZhiGongHBPOSeSyncAppService>(),
//EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService<BeiSeSyncAppService>(),
//EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService<YinDuSeSyncAppService>(),
_ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"),
};
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 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
/// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 数据上下文
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary>
/// 同步位置标记
/// </summary>
@ -50,12 +57,14 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
/// </summary>
public JitSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> 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
}
}
}
/// <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>
public YinDuSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{
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>
public ZhiGongBBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, pubSeDetailRepository, materialRelationshipManager, vmiService)
{
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.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
/// 构造
/// </summary>
public ZhiGongHBPOSeSyncAppService(
IHost host,
WMSBJBMPTDbContext wmsBJBMPTContext,
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> 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);
}
}

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

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

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

@ -37,7 +37,9 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
SELECT
A.WmsBillNum,
A.ShippingDate,
A.PartCode AS MaterialNumber,
A.LU AS MaterialNumber,
A.FactoryPartCode AS PrimitiveLU,
A.FactoryPartCode AS ReplaceLU,
'' MaterialDes,
B.SettleDate CustomerOfflineTime,
A.LU SeLU,
@ -50,7 +52,7 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
A.ToLocCode,
A.ToErpLocCode
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
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>();
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<PubSaSeCompareDiff>(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<PubSaSeCompareDiff>(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<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
_pubSeCDetailRepository.InsertManyAsync(pubSeCDetailEntitys);
}
// var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(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<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExport>>(pubSaSeCompareDiffs);
var excelExporter = new ExcelExporter();
#region 根据业务分类转换不同导出Dto
@ -206,33 +200,33 @@ namespace SettleAccount.Job.Services.Report
{
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);
}
break;
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);
}
break;
case EnumBusinessType.MaiDanJianBBAC:
break;
case EnumBusinessType.MaiDanJianHBPO:
{
var items = _objectMapper.Map<List<PubSaSeCompareDetailExport>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDetailExports);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName);
}
//{
// var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDiffs);
// excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName);
//}
break;
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);
}
break;
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);
}
break;
@ -250,7 +244,7 @@ namespace SettleAccount.Job.Services.Report
}
#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()

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

@ -27,14 +27,12 @@ namespace SettleAccount.Job
/// </summary>
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<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportBeiJian>();
CreateMap<PubSaSeCompareDetailExport, PubSaSeCompareDetailExportYinDuJian>();
}
}
}

Loading…
Cancel
Save