31 changed files with 9215 additions and 208 deletions
@ -0,0 +1,128 @@ |
|||||
|
using Magicodes.ExporterAndImporter.Core; |
||||
|
using Magicodes.ExporterAndImporter.Excel; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 零件查询结果DTO
|
||||
|
/// </summary>
|
||||
|
[ExcelExporter(Name = "M110单据", AutoFitAllColumn = true, MaxRowNumberOnASheet = 1000)] //一个Sheet最大允许的行数,设置了之后将输出多个Sheet
|
||||
|
[Serializable] |
||||
|
public class BillM110Dto: AuditedEntityDto<Guid> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 流水号#
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "流水号")] |
||||
|
[ImporterHeader(Name = "流水号")] |
||||
|
public int? SerialNum { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 大众顺序号
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "大众顺序号")] |
||||
|
[ImporterHeader(Name = "大众顺序号")] |
||||
|
public int? HostSN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// KNR
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "KNR")] |
||||
|
[ImporterHeader(Name = "KNR")] |
||||
|
public string KNR { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 底牌号#
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "底牌号")] |
||||
|
[ImporterHeader(Name = "底牌号")] |
||||
|
public string VIN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 总成ID
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "总成ID")] |
||||
|
[ImporterHeader(Name = "总成ID")] |
||||
|
public Guid? AssemblyID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上线时间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "上线时间")] |
||||
|
[ImporterHeader(Name = "上线时间")] |
||||
|
public DateTime? OnlineTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 车型代码(取通用字典)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "车型代码")] |
||||
|
[ImporterHeader(Name = "车型代码")] |
||||
|
public string VehicleModelCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线(派格按生产线分类)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = " 生产线")] |
||||
|
[ImporterHeader(Name = " 生产线")] |
||||
|
public virtual string ProductLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 版本
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "版本")] |
||||
|
[ImporterHeader(Name = "版本")] |
||||
|
public string Version { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 接收时间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "接收时间")] |
||||
|
[ImporterHeader(Name = "接收时间")] |
||||
|
public DateTime? ReceiveTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 单据状态(0 空;1 未匹配;2 已匹配未打印;3 已打印)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "单据状态")] |
||||
|
[ImporterHeader(Name = "单据状态")] |
||||
|
public BillStatusEnum BillStatus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "描述")] |
||||
|
[ImporterHeader(Name = "描述")] |
||||
|
public string Description { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 涂装重复单据包含的零件列表
|
||||
|
/// </summary>
|
||||
|
public List<BillM110PartDto> BillM110Parts { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 手工操作类型:0 none,1 手工添加,2 手工修改
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "手工操作类型")] |
||||
|
[ImporterHeader(Name = "手工操作类型")] |
||||
|
public ManualOperationTypeEnum OperationType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 手工操作员
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "手工操作员")] |
||||
|
[ImporterHeader(Name = "手工操作员")] |
||||
|
public string Operator { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 手工操作日期
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "手工操作日期")] |
||||
|
[ImporterHeader(Name = "手工操作日期")] |
||||
|
public DateTime? OperationTime { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
using Magicodes.ExporterAndImporter.Core; |
||||
|
using Magicodes.ExporterAndImporter.Excel; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 零件查询结果DTO
|
||||
|
/// </summary>
|
||||
|
[ExcelExporter(Name = "M110单据包含的零件信息", AutoFitAllColumn = true, MaxRowNumberOnASheet = 1000)] //一个Sheet最大允许的行数,设置了之后将输出多个Sheet
|
||||
|
[Serializable] |
||||
|
public class BillM110PartDto : EntityDto<Guid> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 客户零件代码
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "客户零件代码")] |
||||
|
[ImporterHeader(Name = "客户零件代码")] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 客户零件数量
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "客户零件数量")] |
||||
|
[ImporterHeader(Name = "客户零件数量")] |
||||
|
public double? PartNum { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "描述")] |
||||
|
[ImporterHeader(Name = "描述")] |
||||
|
public string Description { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,104 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
[Serializable] |
||||
|
public class CreateUpdateBillM110Dto |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 流水号#
|
||||
|
/// </summary>
|
||||
|
public int? SerialNum { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 大众顺序号
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
public int? HostSN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// KNR
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[StringLength(100)] |
||||
|
public string KNR { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 底牌号#
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[StringLength(100)] |
||||
|
public string VIN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 总成ID
|
||||
|
/// </summary>
|
||||
|
public Guid? AssemblyID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上线时间
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
public DateTime? OnlineTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 车型代码(取通用字典)
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
public string VehicleModelCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线(派格按生产线分类)
|
||||
|
/// </summary>
|
||||
|
public virtual string ProductLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 版本
|
||||
|
/// </summary>
|
||||
|
public string Version { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 接收时间
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
public DateTime? ReceiveTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 单据状态(0 空;1 未匹配;2 已匹配未打印;3 已打印)
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
public BillStatusEnum BillStatus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
[StringLength(200)] |
||||
|
public string Description { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 涂装重复单据包含的零件列表
|
||||
|
/// </summary>
|
||||
|
public virtual List<CreateUpdateBillM110PartDto> BillM110Parts { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 手工操作类型:0 none,1 手工添加,2 手工修改
|
||||
|
/// </summary>
|
||||
|
public ManualOperationTypeEnum OperationType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 手工操作员
|
||||
|
/// </summary>
|
||||
|
public string Operator { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 手工操作日期
|
||||
|
/// </summary>
|
||||
|
public DateTime? OperationTime { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
[Serializable] |
||||
|
public class CreateUpdateBillM110PartDto |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 客户零件代码
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
[StringLength(100)] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 客户零件数量
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
public double? PartNum { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
[StringLength(200)] |
||||
|
public string Description { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,127 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using System.Text.RegularExpressions; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using WY.NewJit.Common; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
[Serializable] |
||||
|
public class QueryBillM110Dto : PagedAndSortedBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 流水号起
|
||||
|
/// </summary>
|
||||
|
public int? SerialNumBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 流水号止
|
||||
|
/// </summary>
|
||||
|
public int? SerialNumEnd { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 大众顺序号起
|
||||
|
/// </summary>
|
||||
|
public int? HostSNBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 大众顺序号止
|
||||
|
/// </summary>
|
||||
|
public int? HostSNEnd { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// KNR起
|
||||
|
/// </summary>
|
||||
|
public string KNRBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// KNR止
|
||||
|
/// </summary>
|
||||
|
public string KNREnd { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 底牌号起
|
||||
|
/// </summary>
|
||||
|
public string VINBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 底牌号止
|
||||
|
/// </summary>
|
||||
|
public string VINEnd { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 总成ID
|
||||
|
/// </summary>
|
||||
|
public Guid? AssemblyID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上线时间起
|
||||
|
/// </summary>
|
||||
|
public DateTime? OnlineTimeBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上线时间止
|
||||
|
/// </summary>
|
||||
|
public DateTime? OnlineTimeEnd { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 车型代码(取通用字典)
|
||||
|
/// </summary>
|
||||
|
public string VehicleModelCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线(派格按生产线分类)
|
||||
|
/// </summary>
|
||||
|
public virtual string ProductLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 版本
|
||||
|
/// </summary>
|
||||
|
public string Version { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 接收时间起
|
||||
|
/// </summary>
|
||||
|
public DateTime? ReceiveTimeBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 接收时间止
|
||||
|
/// </summary>
|
||||
|
public DateTime? ReceiveTimeEnd { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 单据状态(0 空;1 未匹配;2 未打印;3 已打印)
|
||||
|
/// </summary>
|
||||
|
public BillStatusEnum? BillStatus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 是否单据维护
|
||||
|
/// </summary>
|
||||
|
public bool? IsBillMaintenance { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 不可打印
|
||||
|
/// </summary>
|
||||
|
public bool? CanNotPrint { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 柱护板单据状态(0 空;1 未匹配;2 未打印;3 已打印)
|
||||
|
/// </summary>
|
||||
|
public ZHBBillStatusEnum? ZHBBillStatus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 为真时只显示需要补打的记录
|
||||
|
/// </summary>
|
||||
|
public bool IsNeedReplenishPrint { get; set; } |
||||
|
|
||||
|
|
||||
|
public string GroupName { get; set; } = ""; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 是否查询M110归档数据
|
||||
|
/// </summary>
|
||||
|
public bool IsQueryArchive { get; set; } = false; |
||||
|
} |
||||
|
} |
@ -0,0 +1,157 @@ |
|||||
|
using Magicodes.ExporterAndImporter.Core; |
||||
|
using Magicodes.ExporterAndImporter.Excel; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 零件查询结果DTO
|
||||
|
/// </summary>
|
||||
|
[ExcelExporter(Name = "M110单据查询结果", AutoFitAllColumn = true, MaxRowNumberOnASheet = 1000)] //一个Sheet最大允许的行数,设置了之后将输出多个Sheet
|
||||
|
[Serializable] |
||||
|
public class ResultBillM110Dto : EntityDto<Guid> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 流水号#
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "流水号")] |
||||
|
[ImporterHeader(Name = "流水号")] |
||||
|
public int? SerialNum { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 大众顺序号
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "大众顺序号")] |
||||
|
[ImporterHeader(Name = "大众顺序号")] |
||||
|
public int? HostSN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// KNR
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "KNR")] |
||||
|
[ImporterHeader(Name = "KNR")] |
||||
|
public string KNR { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 底牌号#
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "底牌号")] |
||||
|
[ImporterHeader(Name = "底牌号")] |
||||
|
public string VIN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 总成ID
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "总成ID")] |
||||
|
[ImporterHeader(Name = "总成ID")] |
||||
|
public Guid? AssemblyID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上线时间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "上线时间")] |
||||
|
[ImporterHeader(Name = "上线时间")] |
||||
|
public DateTime? OnlineTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 车型代码(取通用字典)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "车型代码")] |
||||
|
[ImporterHeader(Name = "车型代码")] |
||||
|
public string VehicleModelCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线(派格按生产线分类)
|
||||
|
/// </summary>
|
||||
|
public virtual string ProductLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 版本
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "版本")] |
||||
|
[ImporterHeader(Name = "版本")] |
||||
|
public string Version { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 接收时间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "接收时间")] |
||||
|
[ImporterHeader(Name = "接收时间")] |
||||
|
public DateTime? ReceiveTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 单据状态(0 空;1 未匹配;2 已匹配未打印;3 已打印)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "单据状态")] |
||||
|
[ImporterHeader(Name = "单据状态")] |
||||
|
public BillStatusEnum BillStatus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "描述")] |
||||
|
[ImporterHeader(Name = "描述")] |
||||
|
public string Description { get; set; } |
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 涂装重复单据包含的零件列表
|
||||
|
///// </summary>
|
||||
|
//public List<BillM110PartDto> M110BillParts { get; set; }
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 总成名称
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "总成名称")] |
||||
|
[ImporterHeader(Name = "总成名称")] |
||||
|
public string AssemblyName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 车型名称(取通用字典)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "车型名称")] |
||||
|
[ImporterHeader(Name = "车型名称")] |
||||
|
public string VehicleModelName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// R100总成名称
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "R100总成名称")] |
||||
|
[ImporterHeader(Name = "R100总成名称")] |
||||
|
public string R100AssemblyName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// R100上线时间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "R100上线时间")] |
||||
|
[ImporterHeader(Name = "R100上线时间")] |
||||
|
public DateTime? R100OnlineTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 打印时间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "打印时间")] |
||||
|
[ImporterHeader(Name = "打印时间")] |
||||
|
public virtual DateTime? PrintTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 不可打印
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(IsIgnore =true)] |
||||
|
[ImporterHeader(IsIgnore = true)] |
||||
|
public virtual bool? CanNotPrint { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 柱护板打印状态(不为空时表示已打印)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(IsIgnore = true)] |
||||
|
[ImporterHeader(IsIgnore = true)] |
||||
|
public virtual string PrintBillNum { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,115 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using WY.NewJit.Extends; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
public interface IBillM110AppService |
||||
|
{ |
||||
|
#region 接口方法
|
||||
|
|
||||
|
/// 根据筛选条件获取分页实体列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">输入查询条件</param>
|
||||
|
/// <param name="page">输入分页条件</param>
|
||||
|
/// <returns>返回符合条件的排序分页列表</returns>
|
||||
|
Task<PagedResultDto<ResultBillM110Dto>> GetListAsync(QueryBillM110Dto input); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 按主键获取唯一实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="id">主键</param>
|
||||
|
/// <returns>实体信息</returns>
|
||||
|
Task<ObjectResultDto<BillM110Dto>> GetAsync(Guid id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 添加实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">添加内容</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
Task<ObjectResultDto<Guid>> CreateAsync(CreateUpdateBillM110Dto input); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 修改实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="id">更新主键</param>
|
||||
|
/// <param name="input">修改内容</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
Task<ObjectResultDto> UpdateAsync(Guid id, CreateUpdateBillM110Dto input); |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 删除实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="id">删除主键</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
Task<ObjectResultDto> DeleteAsync(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导出信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">导出查询条件</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
Task<ObjectResultDto<string>> ExportAsync(QueryBillM110Dto input); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导入信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">导入文件流</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
Task<ObjectResultDto> ImportAsync(Byte[] input); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据生产线获取正常打印单据的起始大众顺序号
|
||||
|
/// </summary>
|
||||
|
/// <param name="productLine">生产线</param>
|
||||
|
/// <returns>起始大众顺序号</returns>
|
||||
|
Task<ObjectResultDto<int?>> GetPrintStartHostSN2(string productLine, string isZhuHuBan,string GroupName = null); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 打印前检查门板大众顺序号是否断号
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns>断号时Item不为空</returns>
|
||||
|
Task<ListResultDto<string>> CheckMBHostSNBreakNum(MenBanPrintInputDto input); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 打印前检查柱护板大众顺序号是否断号
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns>断号时Item不为空</returns>
|
||||
|
//Task<ListResultDto<string>> CheckZHBHostSNBreakNum(ZhuHuBanPrintInputDto input);
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 打印门板装箱单
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
//Task<ObjectResultDto<MenBanPrintResultDto>> PrintMenBanPackingList(MenBanPrintInputDto input);
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 打印柱护板装箱单
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
//Task<ObjectResultDto<ZhuHuBanPrintResultDto>> PrintZhuHuBanPackingList(ZhuHuBanPrintInputDto input);
|
||||
|
|
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线超时提醒
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">生产线编号列表</param>
|
||||
|
/// <returns>生产线超时情况</returns>
|
||||
|
Task<ListResultDto<TimeOutRemindResultDto>> ProductLineTimeoutRemind(TimeOutRemindInputDto input); |
||||
|
|
||||
|
//Task<PagedResultDto<ResultBillM110Dto>> GetReplenishPrintListAsync(QueryBillM110Dto input);
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,85 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Collections.ObjectModel; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Entities.Auditing; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 涂装重复单据
|
||||
|
/// </summary>
|
||||
|
[Serializable] |
||||
|
public class CreateUpdateRepeatM110Dto |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 报文接收ID,对应报文接收表主键
|
||||
|
/// </summary>
|
||||
|
public Guid MessageFileReceiveID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 流水号#
|
||||
|
/// </summary>
|
||||
|
public int? SerialNum { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 大众顺序号
|
||||
|
/// </summary>
|
||||
|
public int? HostSN { get; set; } |
||||
|
/// <summary>
|
||||
|
/// KNR
|
||||
|
/// </summary>
|
||||
|
public string KNR { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 底牌号#
|
||||
|
/// </summary>
|
||||
|
public string VIN { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 总成ID
|
||||
|
/// </summary>
|
||||
|
public Guid? AssemblyID { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 上线时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? OnlineTime { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 接收时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? ReceiveTime { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 车型代码(取通用字典)
|
||||
|
/// </summary>
|
||||
|
public string VehicleModelCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线(派格按生产线分类)
|
||||
|
/// </summary>
|
||||
|
public virtual string ProductLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 版本
|
||||
|
/// </summary>
|
||||
|
public string Version { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 单据状态(0 空;1 未匹配;2 已匹配未打印;3 已打印)
|
||||
|
/// </summary>
|
||||
|
public BillStatusEnum BillStatus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
public virtual string Description { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 涂装重复单据包含的零件列表
|
||||
|
/// </summary>
|
||||
|
public virtual List<CreateUpdateRepeatM110PartDto> M110RepeatParts { get; set; } |
||||
|
|
||||
|
public CreateUpdateRepeatM110Dto() |
||||
|
{ } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Entities.Auditing; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 涂装重复单据和零件关系表
|
||||
|
/// </summary>
|
||||
|
[Serializable] |
||||
|
public class CreateUpdateRepeatM110PartDto |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 客户零件代码
|
||||
|
/// </summary>
|
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 客户零件数量
|
||||
|
/// </summary>
|
||||
|
public double? PartNum { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
public string Description { get; set; } |
||||
|
|
||||
|
public CreateUpdateRepeatM110PartDto() |
||||
|
{ } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using WY.NewJit.Common; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
[Serializable] |
||||
|
public class QueryRepeatM110Dto : PagedAndSortedBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 大众顺序号起
|
||||
|
/// </summary>
|
||||
|
public int? HostSNBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 大众顺序号止
|
||||
|
/// </summary>
|
||||
|
public int? HostSNEnd { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// KNR起
|
||||
|
/// </summary>
|
||||
|
public string KNRBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// KNR止
|
||||
|
/// </summary>
|
||||
|
public string KNREnd { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 底牌号起
|
||||
|
/// </summary>
|
||||
|
public string VINBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 底牌号止
|
||||
|
/// </summary>
|
||||
|
public string VINEnd { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 总成ID
|
||||
|
/// </summary>
|
||||
|
//public Guid? AssemblyID { get; set; }
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上线时间起
|
||||
|
/// </summary>
|
||||
|
public DateTime? OnlineTimeBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上线时间止
|
||||
|
/// </summary>
|
||||
|
public DateTime? OnlineTimeEnd { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 车型代码(取通用字典)
|
||||
|
/// </summary>
|
||||
|
public string VehicleModelCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线(派格按生产线分类)
|
||||
|
/// </summary>
|
||||
|
public virtual string ProductLine { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 版本
|
||||
|
/// </summary>
|
||||
|
public string Version { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 接收时间起
|
||||
|
/// </summary>
|
||||
|
public DateTime? ReceiveTimeBegin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 接收时间止
|
||||
|
/// </summary>
|
||||
|
public DateTime? ReceiveTimeEnd { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,115 @@ |
|||||
|
using Magicodes.ExporterAndImporter.Core; |
||||
|
using Magicodes.ExporterAndImporter.Excel; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 零件查询结果DTO
|
||||
|
/// </summary>
|
||||
|
[ExcelExporter(Name = "M110重复报文", AutoFitAllColumn = true, MaxRowNumberOnASheet = 1000)] //一个Sheet最大允许的行数,设置了之后将输出多个Sheet
|
||||
|
[Serializable] |
||||
|
public class RepeatM110Dto: AuditedEntityDto<Guid> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 流水号#
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "流水号")] |
||||
|
[ImporterHeader(Name = "流水号")] |
||||
|
public int? SerialNum { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 大众顺序号
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "大众顺序号")] |
||||
|
[ImporterHeader(Name = "大众顺序号")] |
||||
|
public int? HostSN { get; set; } |
||||
|
/// <summary>
|
||||
|
/// KNR
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "KNR")] |
||||
|
[ImporterHeader(Name = "KNR")] |
||||
|
public string KNR { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 底牌号#
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "底牌号")] |
||||
|
[ImporterHeader(Name = "底牌号")] |
||||
|
public string VIN { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 总成ID
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "总成ID")] |
||||
|
[ImporterHeader(Name = "总成ID")] |
||||
|
public Guid? AssemblyID { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 上线时间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "上线时间")] |
||||
|
[ImporterHeader(Name = "上线时间")] |
||||
|
public DateTime? OnlineTime { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 接收时间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "接收时间")] |
||||
|
[ImporterHeader(Name = "接收时间")] |
||||
|
public DateTime? ReceiveTime { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 车型代码(取通用字典)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "车型代码")] |
||||
|
[ImporterHeader(Name = "车型代码")] |
||||
|
public string VehicleModelCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线(派格按生产线分类)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "生产线")] |
||||
|
[ImporterHeader(Name = "生产线")] |
||||
|
public virtual string ProductLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 版本
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "版本")] |
||||
|
[ImporterHeader(Name = "版本")] |
||||
|
public string Version { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 单据状态(0 空;1 未匹配;2 已匹配未打印;3 已打印)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "单据状态")] |
||||
|
[ImporterHeader(Name = "单据状态")] |
||||
|
public BillStatusEnum BillStatus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "描述")] |
||||
|
[ImporterHeader(Name = "描述")] |
||||
|
public string Description { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 涂装重复单据包含的零件列表
|
||||
|
/// </summary>
|
||||
|
public List<RepeatM110PartDto> M110RepeatParts { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 总成名称
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "总成名称")] |
||||
|
[ImporterHeader(Name = "总成名称")] |
||||
|
public string AssemblyName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 车型名称(取通用字典)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "车型名称")] |
||||
|
[ImporterHeader(Name = "车型名称")] |
||||
|
public string VehicleModelName { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
using Magicodes.ExporterAndImporter.Core; |
||||
|
using Magicodes.ExporterAndImporter.Excel; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 零件查询结果DTO
|
||||
|
/// </summary>
|
||||
|
[ExcelExporter(Name = "M110重复报文包含的零件信息", AutoFitAllColumn = true, MaxRowNumberOnASheet = 1000)] //一个Sheet最大允许的行数,设置了之后将输出多个Sheet
|
||||
|
[Serializable] |
||||
|
public class RepeatM110PartDto : EntityDto<Guid> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 客户零件代码
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "客户零件代码")] |
||||
|
[ImporterHeader(Name = "客户零件代码")] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 客户零件数量
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "客户零件数量")] |
||||
|
[ImporterHeader(Name = "客户零件数量")] |
||||
|
public double? PartNum { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "描述")] |
||||
|
[ImporterHeader(Name = "描述")] |
||||
|
public string Description { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
public interface IRepeatM110AppService |
||||
|
{ |
||||
|
#region 接口方法
|
||||
|
|
||||
|
/// 根据筛选条件获取分页实体列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">输入查询条件</param>
|
||||
|
/// <param name="page">输入分页条件</param>
|
||||
|
/// <returns>返回符合条件的排序分页列表</returns>
|
||||
|
Task<PagedResultDto<RepeatM110Dto>> GetListAsync(QueryRepeatM110Dto input); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 按主键获取唯一实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="id">主键</param>
|
||||
|
/// <returns>实体信息</returns>
|
||||
|
Task<ObjectResultDto<RepeatM110Dto>> GetAsync(Guid id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 添加实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">添加内容</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
Task<ObjectResultDto<Guid>> CreateAsync(CreateUpdateRepeatM110Dto input); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 删除实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="id">删除主键</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
Task<ObjectResultDto> DeleteAsync(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导出信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">导出查询条件</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
Task<ObjectResultDto<string>> ExportAsync(QueryRepeatM110Dto input); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导入信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">导入文件流</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
Task<ObjectResultDto> ImportAsync(Byte[] input); |
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,375 @@ |
|||||
|
using Magicodes.ExporterAndImporter.Core; |
||||
|
using Magicodes.ExporterAndImporter.Excel; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.Extensions.Logging; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Dynamic.Core; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Volo.Abp.Domain.Repositories.Dapper; |
||||
|
using WY.NewJit.EntityFrameworkCore; |
||||
|
using WY.NewJit.Common; |
||||
|
using Shouldly; |
||||
|
using Volo.Abp.BlobStoring; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// M110重复报文应用服务实现
|
||||
|
/// </summary>
|
||||
|
[Route("api/newjit/repeat-M110")] |
||||
|
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.报文解析及校验)] |
||||
|
public class RepeatM110AppService : ApplicationService, IRepeatM110AppService |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 仓储
|
||||
|
/// </summary>
|
||||
|
private readonly IRepository<RepeatM110, Guid> _repeatM110Repository; |
||||
|
|
||||
|
private readonly IRepository<RepeatM110Part, Guid> _repeatM110PartRepository; |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 日志
|
||||
|
/// </summary>
|
||||
|
private ILogger<RepeatM110AppService> _logger; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Dapper仓储
|
||||
|
/// </summary>
|
||||
|
private readonly NewJitDapperRepository _newJitDapperRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// BLOB存储
|
||||
|
/// </summary>
|
||||
|
private readonly IBlobContainer<OurFileContainer> _blobContainer; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 错误信息前缀
|
||||
|
/// </summary>
|
||||
|
private string _errorMessagePrefix |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "."; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造函数
|
||||
|
/// </summary>
|
||||
|
public RepeatM110AppService( |
||||
|
IRepository<RepeatM110, Guid> repeatM110Repository, |
||||
|
IRepository<RepeatM110Part, Guid> repeatM110PartRepository, |
||||
|
ILogger<RepeatM110AppService> logger, |
||||
|
NewJitDapperRepository newJitDapperRepository, |
||||
|
IBlobContainer<OurFileContainer> blobContainer |
||||
|
) |
||||
|
{ |
||||
|
_repeatM110Repository = repeatM110Repository; |
||||
|
_repeatM110PartRepository = repeatM110PartRepository; |
||||
|
_logger = logger; |
||||
|
_newJitDapperRepository = newJitDapperRepository; |
||||
|
_blobContainer = blobContainer; |
||||
|
} |
||||
|
|
||||
|
#region 私有方法
|
||||
|
/// <summary>
|
||||
|
/// 根据筛选条件获取实体列表
|
||||
|
/// </summary>
|
||||
|
private async Task<PagedResultDto<RepeatM110Dto>> QueryByConditionAsync(QueryRepeatM110Dto input, PagedAndSortedBase page) |
||||
|
{ |
||||
|
PagedResultDto<RepeatM110Dto> ret = new PagedResultDto<RepeatM110Dto>(); |
||||
|
|
||||
|
string sqlCnt = @"
|
||||
|
with d as |
||||
|
( |
||||
|
select * from FisDicItem where DicTypeCode in (select DicTypeCode from FisDicType where DicTypeName = '车型') |
||||
|
) |
||||
|
select * from |
||||
|
( |
||||
|
select count(*) as cnt |
||||
|
from FisRepeatM110 r |
||||
|
left join d on r.VehicleModelCode = d.DicItemCode |
||||
|
left join FisAssemblyCfgVehicle a on r.AssemblyID = a.Id |
||||
|
where 1=1 {0} |
||||
|
) t |
||||
|
";
|
||||
|
|
||||
|
string sql = @"
|
||||
|
with d as |
||||
|
( |
||||
|
select * from FisDicItem where DicTypeCode in (select DicTypeCode from FisDicType where DicTypeName = '车型') |
||||
|
) |
||||
|
select * from |
||||
|
( |
||||
|
select ROW_NUMBER() OVER(order by r.OnlineTime, r.HostSN) as row_number, |
||||
|
r.*, d.DicItemName as VehicleModelName, a.AssemblyName |
||||
|
from FisRepeatM110 r |
||||
|
left join d on r.VehicleModelCode = d.DicItemCode |
||||
|
left join FisAssemblyCfgVehicle a on r.AssemblyID = a.Id |
||||
|
where 1=1 {0} |
||||
|
) t where row_number between {1} and {2} |
||||
|
";
|
||||
|
string where = ""; |
||||
|
if (input.HostSNBegin != null) |
||||
|
{ |
||||
|
where += string.Format(" and r.HostSN >= {0}", input.HostSNBegin); |
||||
|
} |
||||
|
if (input.HostSNEnd != null) |
||||
|
{ |
||||
|
where += string.Format(" and r.HostSN <= {0}", input.HostSNEnd); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(input.KNRBegin)) |
||||
|
{ |
||||
|
where += string.Format(" and r.KNR >= '{0}'", input.KNRBegin); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(input.KNREnd)) |
||||
|
{ |
||||
|
where += string.Format(" and r.KNR <= '{0}'", input.KNREnd); |
||||
|
} |
||||
|
|
||||
|
if (!string.IsNullOrEmpty(input.VINBegin)) |
||||
|
{ |
||||
|
where += string.Format(" and r.VIN >= '{0}'", input.VINBegin); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(input.VINEnd)) |
||||
|
{ |
||||
|
where += string.Format(" and r.VIN <= '{0}'", input.VINEnd); |
||||
|
} |
||||
|
if (input.OnlineTimeBegin != null) |
||||
|
{ |
||||
|
where += string.Format(" and r.OnlineTime >= '{0}'", ((DateTime)input.OnlineTimeBegin).ToString("yyyy-MM-dd HH:mm:ss")); |
||||
|
} |
||||
|
if (input.OnlineTimeEnd != null) |
||||
|
{ |
||||
|
where += string.Format(" and r.OnlineTime <= '{0}'", ((DateTime)input.OnlineTimeEnd).ToString("yyyy-MM-dd HH:mm:ss")); |
||||
|
} |
||||
|
if (!string.IsNullOrEmpty(input.VehicleModelCode)) |
||||
|
{ |
||||
|
where += string.Format(" and r.VehicleModelCode = '{0}'", input.VehicleModelCode); |
||||
|
} |
||||
|
if (input.ProductLine != null) |
||||
|
{ |
||||
|
where += string.Format(" and r.ProductLine = '{0}'", input.ProductLine); |
||||
|
} |
||||
|
if (input.Version != null) |
||||
|
{ |
||||
|
where += string.Format(" and r.Version like '%{0}%'", input.Version); |
||||
|
} |
||||
|
if (input.ReceiveTimeBegin != null) |
||||
|
{ |
||||
|
where += string.Format(" and r.ReceiveTime >= '{0}'", ((DateTime)input.ReceiveTimeBegin).ToString("yyyy-MM-dd HH:mm:ss")); |
||||
|
} |
||||
|
if (input.ReceiveTimeEnd != null) |
||||
|
{ |
||||
|
where += string.Format(" and r.ReceiveTime <= '{0}'", ((DateTime)input.ReceiveTimeEnd).ToString("yyyy-MM-dd HH:mm:ss")); |
||||
|
} |
||||
|
sqlCnt = string.Format(sqlCnt, where); |
||||
|
ret.TotalCount = await _newJitDapperRepository.GetSingleBySqlAsync<int>(sqlCnt); |
||||
|
|
||||
|
//计算分页
|
||||
|
int fromRec = page.SkipCount + 1; |
||||
|
int ToRec = page.SkipCount + page.MaxResultCount; |
||||
|
sql = string.Format(sql, where, fromRec, ToRec); |
||||
|
var lst = await _newJitDapperRepository.GetListBySqlAsync<RepeatM110Dto>(sql); |
||||
|
ret.Items = lst; |
||||
|
return ret; |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
#region 公共方法
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据筛选条件获取分页实体列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">输入查询条件</param>
|
||||
|
/// <param name="page">输入分页条件</param>
|
||||
|
/// <returns>返回符合条件的排序分页列表</returns>
|
||||
|
[HttpGet] |
||||
|
[UnitOfWork(false)] |
||||
|
[Route("list")] |
||||
|
public virtual async Task<PagedResultDto<RepeatM110Dto>> GetListAsync(QueryRepeatM110Dto input) |
||||
|
{ |
||||
|
_logger.LogDebug(_errorMessagePrefix + "GetListAsync 进入"); |
||||
|
try |
||||
|
{ |
||||
|
PagedResultDto<RepeatM110Dto> ret = await QueryByConditionAsync(input, (PagedAndSortedBase)input); |
||||
|
return ret; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
string errMsg = _errorMessagePrefix + "GetListAsync 执行出错:" + ex.Message; |
||||
|
_logger.LogError(errMsg); |
||||
|
return new PagedResultDto<RepeatM110Dto>(0, new List<RepeatM110Dto>()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 按主键获取唯一实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="id">主键</param>
|
||||
|
/// <returns>实体信息</returns>
|
||||
|
[HttpGet] |
||||
|
[Route("{id}")]//obj/
|
||||
|
public virtual async Task<ObjectResultDto<RepeatM110Dto>> GetAsync(Guid id) |
||||
|
{ |
||||
|
_logger.LogDebug(_errorMessagePrefix + "GetAsync 进入"); |
||||
|
ObjectResultDto<RepeatM110Dto> ret = new ObjectResultDto<RepeatM110Dto>(); |
||||
|
try |
||||
|
{ |
||||
|
RepeatM110 sourceObj = await _repeatM110Repository.GetAsync(id); |
||||
|
RepeatM110Dto targetObj = ObjectMapper.Map<RepeatM110, RepeatM110Dto>(sourceObj); |
||||
|
ret.Item = targetObj; |
||||
|
return ret; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
ret.Status = false; |
||||
|
ret.Message = _errorMessagePrefix + "GetAsync 执行出错:" + ex.Message; |
||||
|
_logger.LogError(ret.Message); |
||||
|
return ret; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 添加实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">添加内容</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
[HttpPost] |
||||
|
[UnitOfWork] |
||||
|
[Route("")]//create
|
||||
|
public virtual async Task<ObjectResultDto<Guid>> CreateAsync(CreateUpdateRepeatM110Dto input) |
||||
|
{ |
||||
|
_logger.LogDebug(_errorMessagePrefix + "CreateAsync 进入"); |
||||
|
ObjectResultDto<Guid> ret = new ObjectResultDto<Guid>(); |
||||
|
try |
||||
|
{ |
||||
|
//取重复报文 最大流水号
|
||||
|
//int repeatMaxSN = _repeatM110Repository.Max(itm => itm.SerialNum) ?? 0;
|
||||
|
|
||||
|
|
||||
|
RepeatM110 obj = ObjectMapper.Map<CreateUpdateRepeatM110Dto, RepeatM110>(input); |
||||
|
obj.SetSerialNum(ServerHelper.VinToSN(obj.VIN)); //++repeatMaxSN
|
||||
|
#region 主子表主键Id赋值
|
||||
|
foreach (var item in obj.M110RepeatParts) |
||||
|
{ |
||||
|
item.SetId(GuidGenerator.Create()); |
||||
|
} |
||||
|
#endregion
|
||||
|
RepeatM110 obj2 = await _repeatM110Repository.InsertAsync(obj); |
||||
|
ret.Item = obj2.Id; //返回添加对象的主键
|
||||
|
return ret; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
ret.Status = false; |
||||
|
ret.Message = _errorMessagePrefix + "CreateAsync 执行出错:" + ex.Message; |
||||
|
_logger.LogError(ret.Message); |
||||
|
return ret; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 删除实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="id">删除主键</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
[UnitOfWork] |
||||
|
[HttpDelete] |
||||
|
[Route("{id}")]//delete/
|
||||
|
public virtual async Task<ObjectResultDto> DeleteAsync(string id) |
||||
|
{ |
||||
|
_logger.LogDebug(_errorMessagePrefix + "DeleteAsync 进入"); |
||||
|
ObjectResultDto ret = new ObjectResultDto(); |
||||
|
try |
||||
|
{ |
||||
|
List<Guid> idLst = ServerHelper.GetGuidListByStr(id); |
||||
|
foreach (Guid item in idLst) |
||||
|
{ |
||||
|
RepeatM110 sourceObj = await _repeatM110Repository.GetAsync(item); |
||||
|
if (sourceObj != null) |
||||
|
{ |
||||
|
await _repeatM110PartRepository.DeleteManyAsync(sourceObj.M110RepeatParts); |
||||
|
await _repeatM110Repository.DeleteAsync(item); |
||||
|
} |
||||
|
} |
||||
|
return ret; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
ret.Status = false; |
||||
|
ret.Message = _errorMessagePrefix + "DeleteAsync 执行出错:" + ex.Message; |
||||
|
_logger.LogError(ret.Message); |
||||
|
return ret; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导出信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">导出查询条件</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
[UnitOfWork(false)] |
||||
|
[HttpPost] |
||||
|
[Route("export")] |
||||
|
public virtual async Task<ObjectResultDto<string>> ExportAsync(QueryRepeatM110Dto input) |
||||
|
{ |
||||
|
_logger.LogDebug(_errorMessagePrefix + "ExportAsync 进入"); |
||||
|
ObjectResultDto<string> ret = new ObjectResultDto<string>(); |
||||
|
try |
||||
|
{ |
||||
|
input.SkipCount = 0; |
||||
|
input.MaxResultCount = 50000; |
||||
|
PagedResultDto<RepeatM110Dto> query = await QueryByConditionAsync(input, (PagedAndSortedBase)input); |
||||
|
List<RepeatM110Dto> items = query.Items.ToList(); |
||||
|
//将实体列表转换成excel文件流
|
||||
|
IExporter exporter = new ExcelExporter(); |
||||
|
byte[] byteArr = await exporter.ExportAsByteArray<RepeatM110Dto>(items); |
||||
|
byteArr.ShouldNotBeNull(); |
||||
|
//将excel文件流保存到服务器端文件系统
|
||||
|
string fileName = string.Format("重复报文M110_{0}.xlsx", Guid.NewGuid().ToString()); |
||||
|
await _blobContainer.SaveAsync(fileName, byteArr); |
||||
|
|
||||
|
ret.Item = fileName; |
||||
|
return ret; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
ret.Status = false; |
||||
|
ret.Message = _errorMessagePrefix + "ExportAsync 执行出错:" + ex.Message; |
||||
|
_logger.LogError(ret.Message); |
||||
|
return ret; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导入信息
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">导入文件流</param>
|
||||
|
/// <returns>执行成功返回真</returns>
|
||||
|
[UnitOfWork] |
||||
|
[HttpPost] |
||||
|
[Route("import")] |
||||
|
public virtual async Task<ObjectResultDto> ImportAsync(byte[] input) |
||||
|
{ |
||||
|
throw new NotImplementedException("暂不实现所有导入"); |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,704 @@ |
|||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.Extensions.Logging; |
||||
|
using Newtonsoft.Json.Linq; |
||||
|
using NPOI.SS.Formula.Functions; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.IO; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Dynamic.Core; |
||||
|
using System.Text; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Domain.Services; |
||||
|
using Volo.Abp.ObjectMapping; |
||||
|
using Volo.Abp.Uow; |
||||
|
using WY.NewJit.Common; |
||||
|
using WY.NewJit.IRepositories; |
||||
|
using WY.NewJit.MsgBaseData; |
||||
|
using WY.NewJit.MsgCheck; |
||||
|
using WY.NewJit.MsgConversion; |
||||
|
using WY.NewJit.MsgTransmission; |
||||
|
|
||||
|
|
||||
|
namespace WY.NewJit.MsgCheck |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 报文校验领域服务实现
|
||||
|
/// </summary>
|
||||
|
public class M110CheckDomainService : DomainService |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// M110单据
|
||||
|
/// </summary>
|
||||
|
private readonly IRepository<BillM110, Guid> _billM110Repository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 日志
|
||||
|
/// </summary>
|
||||
|
private ILogger<M110CheckDomainService> _logger; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 日志提醒
|
||||
|
/// </summary>
|
||||
|
private readonly LogRemindDomainService _logRemindDomainService; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 对象映射
|
||||
|
/// </summary>
|
||||
|
private readonly IObjectMapper _objectMapper; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 重复M110
|
||||
|
/// </summary>
|
||||
|
private readonly IRepository<RepeatM110, Guid> _repeatM110Repository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 排除零件配置
|
||||
|
/// </summary>
|
||||
|
private readonly IRepository<ExcludePartCfg, Guid> _excludePartCfgRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 未知总成维护
|
||||
|
/// </summary>
|
||||
|
private readonly IRepository<UnknownAssembly, Guid> _unknownAssemblyRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 配置文件
|
||||
|
/// </summary>
|
||||
|
private readonly Microsoft.Extensions.Configuration.IConfiguration _configuration; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Dapper仓储
|
||||
|
/// </summary>
|
||||
|
private readonly INewJitDapperRepository _newJitDapperRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 整车总成配置仓库
|
||||
|
/// </summary>
|
||||
|
private readonly IRepository<AssemblyCfgVehicle, Guid> _assemblyCfgVehicleRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 零件配置
|
||||
|
/// </summary>
|
||||
|
private readonly IRepository<PartCfg, Guid> _partCfgRepository; |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 错误信息前缀
|
||||
|
/// </summary>
|
||||
|
private string _errorMessagePrefix |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "."; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
int? _hostSN = 0; |
||||
|
/// <summary>
|
||||
|
/// 单据号,写日志时用(R100时是KNR,M110是时VIN)
|
||||
|
/// </summary>
|
||||
|
private string _billNumber = ""; |
||||
|
string _fileName = ""; |
||||
|
|
||||
|
private int _parseAssemblyCycleCount = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 解析Erp总成时的循环数量
|
||||
|
/// </summary>
|
||||
|
public int ParseAssemblyCycleCount |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
if (_parseAssemblyCycleCount == 0) |
||||
|
{ |
||||
|
_parseAssemblyCycleCount = _configuration["ConfigDic:ParseAssemblyCycleCount"].TryToInt() ?? 4; |
||||
|
} |
||||
|
return _parseAssemblyCycleCount; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 整车总成Id列表
|
||||
|
/// </summary>
|
||||
|
static List<VehicleAssemblyMainList> _vehicleAssemblyIdList = new List<VehicleAssemblyMainList>(); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 整车vs零件列表
|
||||
|
/// </summary>
|
||||
|
//static List<AssemblyCfgVehicle2Part> _vehicle2partList = new List<AssemblyCfgVehicle2Part>();
|
||||
|
|
||||
|
static Dictionary<Guid, List<AssemblyCfgVehicle2Part>> _vehicle2partDict |
||||
|
= new Dictionary<Guid, List<AssemblyCfgVehicle2Part>>(); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Erp总成Id列表
|
||||
|
/// </summary>
|
||||
|
static List<ErpAssemblyMain> _erpAssemblyMainList = new List<ErpAssemblyMain>(); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Erp总成vs零件列表
|
||||
|
/// </summary>
|
||||
|
static List<AssemblyCfgErp2Part> _erp2partList = new List<AssemblyCfgErp2Part>(); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 结算件切换列表
|
||||
|
/// </summary>
|
||||
|
static List<PartSwitch> _partSwitchList = new List<PartSwitch>(); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 切换目标零件编码
|
||||
|
/// </summary>
|
||||
|
static List<string> _switchTargetPartCodeList = new List<string>(); |
||||
|
|
||||
|
|
||||
|
public M110CheckDomainService() |
||||
|
{ } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造函数
|
||||
|
/// </summary>
|
||||
|
public M110CheckDomainService( |
||||
|
IRepository<BillM110, Guid> billM110Repository, |
||||
|
ILogger<M110CheckDomainService> logger, |
||||
|
LogRemindDomainService logRemindDomainService, |
||||
|
IObjectMapper objectMapper, |
||||
|
IRepository<RepeatM110, Guid> repeatM110Repository, |
||||
|
IRepository<ExcludePartCfg, Guid> excludePartCfgRepository, |
||||
|
IRepository<UnknownAssembly, Guid> unknownAssemblyRepository, |
||||
|
Microsoft.Extensions.Configuration.IConfiguration configuration, |
||||
|
INewJitDapperRepository newJitDapperRepository, |
||||
|
IRepository<AssemblyCfgVehicle, Guid> assemblyCfgVehicleRepository, |
||||
|
IRepository<PartCfg, Guid> partCfgRepository |
||||
|
) |
||||
|
{ |
||||
|
_billM110Repository = billM110Repository; |
||||
|
_logger = logger; |
||||
|
_logRemindDomainService = logRemindDomainService; |
||||
|
_objectMapper = objectMapper; |
||||
|
_repeatM110Repository = repeatM110Repository; |
||||
|
_excludePartCfgRepository = excludePartCfgRepository; |
||||
|
_unknownAssemblyRepository = unknownAssemblyRepository; |
||||
|
_configuration = configuration; |
||||
|
_newJitDapperRepository = newJitDapperRepository; |
||||
|
_assemblyCfgVehicleRepository = assemblyCfgVehicleRepository; |
||||
|
_partCfgRepository = partCfgRepository; |
||||
|
} |
||||
|
|
||||
|
#region 公共方法
|
||||
|
|
||||
|
public virtual void InitPub(List<VehicleAssemblyMainList> vehicleAssemblyIdList, List<AssemblyCfgVehicle2Part> vehicle2partList, List<ErpAssemblyMain> erpAssemblyMainList, List<AssemblyCfgErp2Part> erp2partList, List<PartSwitch> partSwitchList) |
||||
|
{ |
||||
|
_vehicleAssemblyIdList = vehicleAssemblyIdList; |
||||
|
//_vehicle2partList = vehicle2partList;
|
||||
|
_vehicle2partDict = vehicle2partList.GroupBy(p => p.VehicleAssemblyId).ToDictionary(p => p.Key, p => p.ToList()); |
||||
|
_erpAssemblyMainList = erpAssemblyMainList; |
||||
|
_erp2partList = erp2partList; |
||||
|
_partSwitchList = partSwitchList; |
||||
|
_switchTargetPartCodeList = partSwitchList.Select(itm => itm.TargetPartCode).ToList(); //切换目标零件编码,判断单据是否存在切换零件时使用
|
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// M110报文解析-正常入口
|
||||
|
/// </summary>
|
||||
|
/// <param name="msgReceiveObj"></param>
|
||||
|
/// <param name="m110Bill"></param>
|
||||
|
/// <returns></returns>
|
||||
|
/// <exception cref="Exception"></exception>
|
||||
|
public ObjectResultDto DoCheckM110Bill(MessageReceive msgReceiveObj, BillM110 m110Bill) |
||||
|
{ |
||||
|
ObjectResultDto ret = new ObjectResultDto(false, null); |
||||
|
_hostSN = m110Bill.HostSN; |
||||
|
_billNumber = m110Bill.VIN; |
||||
|
_fileName = msgReceiveObj.MessageFileName; |
||||
|
try |
||||
|
{ |
||||
|
#region 更新不可打印标志
|
||||
|
List<BillM110> canNotPrintLst = _billM110Repository.Where(itm => |
||||
|
itm.ProductLine == m110Bill.ProductLine |
||||
|
&& itm.HostSN == m110Bill.HostSN |
||||
|
&& (itm.CanNotPrint == null || itm.CanNotPrint == false)).ToList(); |
||||
|
foreach (BillM110 canNotPrintObj in canNotPrintLst) |
||||
|
{ |
||||
|
canNotPrintObj.CanNotPrint = true; |
||||
|
_billM110Repository.UpdateAsync(canNotPrintObj, true).GetAwaiter().GetResult(); |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
bool isMatch = DoMatchAssembly(m110Bill); //仅仅插入或更新M110主子表
|
||||
|
if (isMatch) |
||||
|
{ |
||||
|
#region 判断是否断号
|
||||
|
//断号判断规则:大众顺序号生成规则是1至1999的重复循环,重复循环到1时判断之前最近的相同车型的VIN和当前VIN是否连续,如果不连续则表示断号
|
||||
|
//断号判断:大众顺序号按生产线分类判断;VIN按车型分类判断
|
||||
|
string curProductLine = m110Bill.ProductLine; |
||||
|
string curSerialNumStr = m110Bill.SerialNumStr; //排序依据
|
||||
|
int curHostSN = m110Bill.HostSN ?? 0; |
||||
|
string curVehicleModel = m110Bill.VehicleModelCode; |
||||
|
int curVinNum = m110Bill.SerialNum ?? 0; //VIN后六位
|
||||
|
//取当前生产线最近一条SerialNumStr
|
||||
|
string priorSerialNumStr = _billM110Repository.Where(itm => |
||||
|
itm.ProductLine == curProductLine |
||||
|
&& itm.SerialNumStr.CompareTo(curSerialNumStr) < 0 |
||||
|
).Max(itm => itm.SerialNumStr); |
||||
|
if (priorSerialNumStr != null) |
||||
|
{ |
||||
|
//取当前生产线最近一条
|
||||
|
int priorHostSN = _billM110Repository.FirstOrDefault(itm => itm.ProductLine == curProductLine && itm.SerialNumStr == priorSerialNumStr).HostSN ?? 0; |
||||
|
if (curHostSN == priorHostSN + 1) |
||||
|
{ |
||||
|
//不断号
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
//取当前生产线、相同车型、最近一条SerialNumStr
|
||||
|
string priorSerialNumStr2 = _billM110Repository.Where(itm => |
||||
|
itm.ProductLine == curProductLine |
||||
|
&& itm.VehicleModelCode == curVehicleModel |
||||
|
&& itm.SerialNumStr.CompareTo(curSerialNumStr) < 0 |
||||
|
).Max(itm => itm.SerialNumStr); |
||||
|
if (priorSerialNumStr2 != null) |
||||
|
{ |
||||
|
int priorVinNum = _billM110Repository.FirstOrDefault(itm => itm.SerialNumStr == priorSerialNumStr2).SerialNum ?? 0; |
||||
|
if (curVinNum == priorVinNum + 1) |
||||
|
{ |
||||
|
//不断号
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
//断号提醒
|
||||
|
string errorMsg = $"{curProductLine}生产线M110报文出现断号,当前VIN:{curVinNum}:{curHostSN},上一VIN:{priorVinNum}:{priorHostSN}。可以操作M110单据信息维护模块进行补号!"; |
||||
|
_logger.LogError(errorMsg); |
||||
|
_logRemindDomainService.WriteLogRemind(_billNumber, errorMsg, LogTypeEnum.M110); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
ret.Status = true; |
||||
|
} |
||||
|
return ret; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
string errorMsg = "调用报文解析及校验方法DoCheckM110Bill出错:" + ex.Message; |
||||
|
_logRemindDomainService.WriteLogRemind(_billNumber, errorMsg, LogTypeEnum.M110); |
||||
|
_logger.LogError(errorMsg); |
||||
|
throw new Exception(errorMsg); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public bool DoMatchAssembly(BillM110 m110Bill, bool isBillUpdate = false, bool isUnknowAssembly = false) |
||||
|
{ |
||||
|
bool ret = false; |
||||
|
try |
||||
|
{ |
||||
|
#region 更新单据表
|
||||
|
m110Bill.SetAssemblyID(Guid.Parse("00000000-0000-0000-0000-000000000000")); |
||||
|
m110Bill.SetBillStatus(BillStatusEnum.Match); |
||||
|
BillM110 succObj; |
||||
|
if (isBillUpdate == true) //未知总成模块-重新解析时修改R100单据(单据已经存在)
|
||||
|
{ |
||||
|
if (isUnknowAssembly) |
||||
|
{ |
||||
|
succObj = _billM110Repository.UpdateAsync(m110Bill).GetAwaiter().GetResult(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
succObj = _billM110Repository.UpdateAsync(m110Bill, true).GetAwaiter().GetResult(); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
succObj = _billM110Repository.InsertAsync(m110Bill, true).GetAwaiter().GetResult(); |
||||
|
} |
||||
|
|
||||
|
if (succObj == null) |
||||
|
{ |
||||
|
throw new Exception("插入或更新M110整车总成ID返回结果为空InsertAsync!!"); |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
ret = true; |
||||
|
return ret; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw new Exception(ex.Message); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 私有方法
|
||||
|
|
||||
|
public RepeatM110 InsertM110RepeatBill(MessageReceive msgReceiveObj, BillM110 m110Bill) //, int? maxSerialNum
|
||||
|
{ |
||||
|
RepeatM110 ret = null; |
||||
|
int newSN = ServerHelper.VinToSN(m110Bill.VIN); |
||||
|
RepeatM110 repeatBill = new RepeatM110( |
||||
|
GuidGenerator.Create(), |
||||
|
msgReceiveObj.Id, |
||||
|
newSN, //maxSerialNum,
|
||||
|
m110Bill.HostSN, |
||||
|
m110Bill.KNR, |
||||
|
m110Bill.VIN, |
||||
|
null, |
||||
|
m110Bill.OnlineTime, |
||||
|
ServerHelper.CurrentDateTime, |
||||
|
m110Bill.VehicleModelCode, |
||||
|
m110Bill.ProductLine, |
||||
|
((DateTime)m110Bill.OnlineTime).ToString("yyyyMM"), |
||||
|
BillStatusEnum.None |
||||
|
); |
||||
|
|
||||
|
//零件子表赋值
|
||||
|
foreach (BillM110Part m110Part in m110Bill.BillM110Parts) |
||||
|
{ |
||||
|
repeatBill.AddChildObj(GuidGenerator.Create(), m110Part.PartCode, m110Part.PartNum, m110Part.Description); |
||||
|
} |
||||
|
//插入重复单据
|
||||
|
ret = _repeatM110Repository.InsertAsync(repeatBill, true).GetAwaiter().GetResult(); |
||||
|
return ret; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 总成比较
|
||||
|
/// </summary>
|
||||
|
/// <param name="m110Bill"></param>
|
||||
|
/// <param name="isBillSaved"></param>
|
||||
|
/// <returns></returns>
|
||||
|
//private CompareAssemblyResult IsMatchAssembly(BillM110 m110Bill, bool isBillSaved = false)
|
||||
|
//{
|
||||
|
// CompareAssemblyResult ret = new CompareAssemblyResult();
|
||||
|
// try
|
||||
|
// {
|
||||
|
// #region 先进行整车总成匹配
|
||||
|
// CompareVehicleAssemblyResult vehicleResult = CompareVehicleAssembly(m110Bill);
|
||||
|
// if (vehicleResult.IsMatch == true)
|
||||
|
// {
|
||||
|
// ret.VehicleAssemblyResult = vehicleResult;
|
||||
|
// ret.VehicleModel = m110Bill.VehicleModelCode;
|
||||
|
// return ret;
|
||||
|
// }
|
||||
|
// #endregion
|
||||
|
|
||||
|
// #region 再进行Erp总成匹配
|
||||
|
// if (ConfigDic.CurrentVersion == ConfigDicVersionOption.派格)
|
||||
|
// {
|
||||
|
// CompareErpAssemblyResult erpResult = CompareErpAssembly_PaiGe(m110Bill);
|
||||
|
// if (erpResult.IsMatch == true)
|
||||
|
// {
|
||||
|
// ret.ErpAssemblyResult = erpResult;
|
||||
|
// ret.VehicleModel = m110Bill.VehicleModelCode;
|
||||
|
// return ret;
|
||||
|
// }
|
||||
|
// }
|
||||
|
// else
|
||||
|
// {
|
||||
|
// //CompareErpAssemblyResult erpResult = CompareErpAssembly(m110Bill);
|
||||
|
// //if (erpResult.IsMatch == true)
|
||||
|
// //{
|
||||
|
// // ret.ErpAssemblyResult = erpResult;
|
||||
|
// // ret.VehicleModel = m110Bill.VehicleModelCode;
|
||||
|
// // return ret;
|
||||
|
// //}
|
||||
|
// }
|
||||
|
// #endregion
|
||||
|
|
||||
|
// #region 零件切换
|
||||
|
// if (ConfigDic.CurrentVersion == ConfigDicVersionOption.派格)
|
||||
|
// {
|
||||
|
// bool isSwitch = m110Bill.BillM110Parts.Any(itm => _switchTargetPartCodeList.Contains(itm.PartCode));
|
||||
|
// if (isSwitch == true) //存在零件切换情况
|
||||
|
// {
|
||||
|
// List<string> billPartCodeLst01 = m110Bill.BillM110Parts.Select(itm => itm.PartCode).ToList();
|
||||
|
// List<PartSwitch> partSwitchLstByBill = _partSwitchList.Where(itm => billPartCodeLst01.Contains(itm.TargetPartCode) == true).ToList(); //根据单据零件数据,从零件切换表中取要切换的零件
|
||||
|
|
||||
|
|
||||
|
// #region 先进行整车总成匹配
|
||||
|
// CompareVehicleAssemblyResult vehicleResult22 = CompareVehicleAssembly(m110Bill, partSwitchLstByBill);
|
||||
|
// if (vehicleResult22.IsMatch == true)
|
||||
|
// {
|
||||
|
// ret.VehicleAssemblyResult = vehicleResult22;
|
||||
|
// ret.VehicleModel = m110Bill.VehicleModelCode;
|
||||
|
// ret.IsPartSwitch = true;
|
||||
|
// return ret;
|
||||
|
// }
|
||||
|
// #endregion
|
||||
|
|
||||
|
// #region 再进行Erp总成匹配
|
||||
|
// CompareErpAssemblyResult erpResult = CompareErpAssembly_PaiGe(m110Bill, partSwitchLstByBill);
|
||||
|
// if (erpResult.IsMatch == true)
|
||||
|
// {
|
||||
|
// ret.ErpAssemblyResult = erpResult;
|
||||
|
// ret.VehicleModel = m110Bill.VehicleModelCode;
|
||||
|
// ret.IsPartSwitch = true;
|
||||
|
// return ret;
|
||||
|
// }
|
||||
|
// #endregion
|
||||
|
// }
|
||||
|
// }
|
||||
|
// #endregion
|
||||
|
|
||||
|
// _logger.LogDebug(_errorMessagePrefix + "未匹配Erp总成:" + _billNumber);
|
||||
|
|
||||
|
// return ret;
|
||||
|
// }
|
||||
|
// catch (Exception ex)
|
||||
|
// {
|
||||
|
// throw new Exception($"-MatchAssembly子方法-{_billNumber}-" + ex.Message);
|
||||
|
// }
|
||||
|
//}
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 整车总成比较
|
||||
|
/// </summary>
|
||||
|
/// <param name="m110Bill"></param>
|
||||
|
/// <returns>整车总成ID</returns>
|
||||
|
//private CompareVehicleAssemblyResult CompareVehicleAssembly(BillM110 m110Bill, List<PartSwitch> partSwitchListByBillFilter = null)
|
||||
|
//{
|
||||
|
// try
|
||||
|
// {
|
||||
|
// CompareVehicleAssemblyResult ret = new CompareVehicleAssemblyResult();
|
||||
|
// //取切换源零件列表
|
||||
|
// List<string> switchSourcePartCodeLst = new List<string>();
|
||||
|
// if (partSwitchListByBillFilter != null)
|
||||
|
// {
|
||||
|
// switchSourcePartCodeLst = partSwitchListByBillFilter.Select(itm => itm.SourcePartCode).ToList();
|
||||
|
// }
|
||||
|
|
||||
|
// #region 单据子零件转换成PartBase(排除柱护板)
|
||||
|
// List<PartBase> billPartBaseLst = new List<PartBase>();
|
||||
|
// List<BillM110Part> tempPartLst = m110Bill.BillM110Parts;
|
||||
|
// if (ConfigDic.CurrentVersion == ConfigDicVersionOption.派格)
|
||||
|
// {
|
||||
|
// tempPartLst = m110Bill.BillM110Parts.Where(itm => itm.PartType != "2").ToList(); //不等于柱护板
|
||||
|
// }
|
||||
|
// foreach (BillM110Part obj in tempPartLst)
|
||||
|
// {
|
||||
|
// PartBase tempObj = new PartBase(obj.PartCode, obj.PartNum);
|
||||
|
// billPartBaseLst.Add(tempObj);
|
||||
|
// }
|
||||
|
// #endregion
|
||||
|
|
||||
|
// //遍历所有整车总成
|
||||
|
// var vaLst = _vehicleAssemblyIdList.Where(itm => itm.VehicleModel == m110Bill.VehicleModelCode || string.IsNullOrEmpty(itm.VehicleModel) == true).Select(itm => itm.Id);
|
||||
|
// foreach (Guid vehicleId in vaLst)
|
||||
|
// {
|
||||
|
// if (!_vehicle2partDict.TryGetValue(vehicleId, out List<AssemblyCfgVehicle2Part> vehicle2PartLst))
|
||||
|
// {
|
||||
|
// continue;
|
||||
|
// }
|
||||
|
// //先判断数量是否一致
|
||||
|
// if (vehicle2PartLst.Count != billPartBaseLst.Count) continue;
|
||||
|
|
||||
|
// #region 整车总成零件转换成PartBase
|
||||
|
// List<PartBase> vehiclePartBaseLst = new List<PartBase>();
|
||||
|
// if (partSwitchListByBillFilter == null)
|
||||
|
// {
|
||||
|
// foreach (AssemblyCfgVehicle2Part v2pItm in vehicle2PartLst)
|
||||
|
// {
|
||||
|
// PartBase tempObj = new PartBase(v2pItm.PartCode, v2pItm.PartNum);
|
||||
|
// vehiclePartBaseLst.Add(tempObj);
|
||||
|
// }
|
||||
|
// }
|
||||
|
// else //执行零件切换
|
||||
|
// {
|
||||
|
// bool isAssemblyContainsSwitch = vehicle2PartLst.Any(itm => switchSourcePartCodeLst.Contains(itm.PartCode));
|
||||
|
// if (isAssemblyContainsSwitch == false) //整车总成中不包含切换零件,直接跳过
|
||||
|
// {
|
||||
|
// //continue;
|
||||
|
// }
|
||||
|
// else
|
||||
|
// {
|
||||
|
// foreach (AssemblyCfgVehicle2Part v2pItm in vehicle2PartLst)
|
||||
|
// {
|
||||
|
// PartSwitch psObj = partSwitchListByBillFilter.FirstOrDefault(itm => itm.SourcePartCode == v2pItm.PartCode);
|
||||
|
// if (psObj != null)
|
||||
|
// {
|
||||
|
// PartBase tempObj = new PartBase(psObj.TargetPartCode, v2pItm.PartNum);
|
||||
|
// vehiclePartBaseLst.Add(tempObj);
|
||||
|
// }
|
||||
|
// else
|
||||
|
// {
|
||||
|
// PartBase tempObj = new PartBase(v2pItm.PartCode, v2pItm.PartNum);
|
||||
|
// vehiclePartBaseLst.Add(tempObj);
|
||||
|
// }
|
||||
|
// }
|
||||
|
// }
|
||||
|
// }
|
||||
|
// #endregion
|
||||
|
|
||||
|
// //集合比较
|
||||
|
// bool isSame = ServerHelper.CompareTwoCollection(billPartBaseLst, vehiclePartBaseLst);
|
||||
|
// if (isSame) //已匹配
|
||||
|
// {
|
||||
|
// ret.VehicleId = vehicleId; //整车总成ID
|
||||
|
// ret.IsMatch = true;
|
||||
|
// return ret;
|
||||
|
// }
|
||||
|
// }
|
||||
|
// //不匹配
|
||||
|
// ret.IsMatch = false;
|
||||
|
// return ret;
|
||||
|
// }
|
||||
|
// catch (Exception ex)
|
||||
|
// {
|
||||
|
// throw new Exception($"-CompareVehicleAssembly子方法-{_billNumber}-" + ex.Message);
|
||||
|
// }
|
||||
|
//}
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// ERP总成比较【派格版】
|
||||
|
/// </summary>
|
||||
|
/// <param name="m110Bill"></param>
|
||||
|
/// <returns>匹配的若干个Erp总成ID</returns>
|
||||
|
//private CompareErpAssemblyResult CompareErpAssembly_PaiGe(BillM110 m110Bill, List<PartSwitch> partSwitchListByBillFilter = null)
|
||||
|
//{
|
||||
|
// try
|
||||
|
// {
|
||||
|
// CompareErpAssemblyResult ret = new CompareErpAssemblyResult();
|
||||
|
|
||||
|
// #region 单据零件转换成PartBase
|
||||
|
// List<PartBase> billPartBaseLst = new List<PartBase>();
|
||||
|
|
||||
|
// //排除柱护板
|
||||
|
// List<BillM110Part> tempBillPartLst = m110Bill.BillM110Parts;
|
||||
|
// if (ConfigDic.CurrentVersion == ConfigDicVersionOption.派格)
|
||||
|
// {
|
||||
|
// tempBillPartLst = m110Bill.BillM110Parts.Where(itm => itm.PartType != "2").ToList(); //不等于柱护板
|
||||
|
// }
|
||||
|
// //按PartCode分组汇总PartNum
|
||||
|
// var qry2 = from item in tempBillPartLst
|
||||
|
// group item by item.PartCode into g
|
||||
|
// select new
|
||||
|
// {
|
||||
|
// PartCode = g.Key,
|
||||
|
// PartNum = g.Sum(itm => itm.PartNum)
|
||||
|
// };
|
||||
|
// foreach (var item in qry2)
|
||||
|
// {
|
||||
|
// PartBase obj = new PartBase(item.PartCode, item.PartNum);
|
||||
|
// billPartBaseLst.Add(obj);
|
||||
|
// }
|
||||
|
// #endregion
|
||||
|
|
||||
|
// //取ERP总成分组
|
||||
|
// string assGroupSql = $"select Id, GroupCode, VehicleModel from FisAssemblyCfgGroup where IsDeleted = 0 and IsDisable <> 1 and (VehicleModel = '{m110Bill.VehicleModelCode}' or VehicleModel is null)";
|
||||
|
// List<AssemblyCfgGroup> assGroupLst = _newJitDapperRepository.GetListBySql<AssemblyCfgGroup>(assGroupSql, true);
|
||||
|
// //遍历ERP总成分组
|
||||
|
// foreach (AssemblyCfgGroup assGroupObj in assGroupLst)
|
||||
|
// {
|
||||
|
// #region ERP总成子零件转换成PartBase
|
||||
|
|
||||
|
// var query = from item in _erp2partList
|
||||
|
// where item.GroupId == assGroupObj.Id
|
||||
|
// group item by item.PartCode into g
|
||||
|
// select new
|
||||
|
// {
|
||||
|
// PartCode = g.Key,
|
||||
|
// PartNum = g.Sum(itm => itm.PartNum)
|
||||
|
// };
|
||||
|
// List<PartBase> erpPartBaseLst = new List<PartBase>();
|
||||
|
|
||||
|
// if (partSwitchListByBillFilter == null)
|
||||
|
// {
|
||||
|
// foreach (var item in query)
|
||||
|
// {
|
||||
|
// PartBase obj = new PartBase(item.PartCode, item.PartNum);
|
||||
|
// erpPartBaseLst.Add(obj);
|
||||
|
// }
|
||||
|
// }
|
||||
|
// else //执行零件切换
|
||||
|
// {
|
||||
|
// //foreach (var item in query)
|
||||
|
// //{
|
||||
|
// // PartSwitch psObj = partSwitchListByBillFilter.FirstOrDefault(itm => itm.SourcePartCode == item.PartCode);
|
||||
|
// // if (psObj != null)
|
||||
|
// // {
|
||||
|
// // PartBase obj = new PartBase(psObj.TargetPartCode, item.PartNum); //根据切换关系表,将总成的零件,从源零件替换成目标零件
|
||||
|
// // erpPartBaseLst.Add(obj);
|
||||
|
// // }
|
||||
|
// // else
|
||||
|
// // {
|
||||
|
// // PartBase obj = new PartBase(item.PartCode, item.PartNum);
|
||||
|
// // erpPartBaseLst.Add(obj);
|
||||
|
// // }
|
||||
|
// //}
|
||||
|
// }
|
||||
|
// #endregion
|
||||
|
|
||||
|
// bool isSame = ServerHelper.CompareTwoCollection(billPartBaseLst, erpPartBaseLst);
|
||||
|
// if (isSame) //已匹配
|
||||
|
// {
|
||||
|
// ret.ErpAssemblyIdList = _erp2partList.Where(itm => itm.GroupId == assGroupObj.Id).Select(itm => itm.ErpAssemblyId).Distinct().ToList();
|
||||
|
// //为了在调用方法中将整车总成添加到内存
|
||||
|
// List<AssemblyCfgVehicle2Part> vehicle2PartLst = new List<AssemblyCfgVehicle2Part>();
|
||||
|
// foreach (var erpPart in erpPartBaseLst)
|
||||
|
// {
|
||||
|
// AssemblyCfgVehicle2Part vehicle2PartObj = new AssemblyCfgVehicle2Part();
|
||||
|
// vehicle2PartObj.PartCode = erpPart.PartCode;
|
||||
|
// vehicle2PartObj.PartNum = erpPart.PartNum;
|
||||
|
// vehicle2PartLst.Add(vehicle2PartObj);
|
||||
|
// }
|
||||
|
// ret.Vehicle2PartList = vehicle2PartLst;
|
||||
|
// ret.IsMatch = true;
|
||||
|
// return ret;
|
||||
|
// }
|
||||
|
// } //foreach
|
||||
|
|
||||
|
// ret.IsMatch = false;
|
||||
|
// return ret;
|
||||
|
// }
|
||||
|
// catch (Exception ex)
|
||||
|
// {
|
||||
|
// throw new Exception($"-CompareErpAssembly子方法-{_billNumber}-" + ex.Message);
|
||||
|
// }
|
||||
|
//}
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 不匹配时,插入未知总成,写提醒日志
|
||||
|
/// </summary>
|
||||
|
/// <param name="bill"></param>
|
||||
|
public UnknownAssembly InsertUnknownAssembly(BillM110 bill) |
||||
|
{ |
||||
|
UnknownAssembly ret = null; |
||||
|
try |
||||
|
{ |
||||
|
//插入未知总成
|
||||
|
UnknownAssembly unknownAssemblyObj = new UnknownAssembly(GuidGenerator.Create(), bill.Id, "M110"); |
||||
|
//预批量赋值
|
||||
|
unknownAssemblyObj.Description = bill.Description; //描述字段保存预批量信息
|
||||
|
|
||||
|
foreach (BillM110Part billPart in bill.BillM110Parts) |
||||
|
{ |
||||
|
unknownAssemblyObj.AddChildObj(GuidGenerator.Create(), billPart.PartCode, billPart.PartNum, billPart.Description); |
||||
|
} |
||||
|
var partNumSum = unknownAssemblyObj.UnknownAssemblyParts.Sum(itm => (int)itm.PartNum); |
||||
|
unknownAssemblyObj.SetPartNum(partNumSum); |
||||
|
ret = _unknownAssemblyRepository.InsertAsync(unknownAssemblyObj, true).GetAwaiter().GetResult(); |
||||
|
return ret; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
throw new Exception($"-InsertUnknownAssembly子方法-{_billNumber}-" + ex.Message); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
}//class
|
||||
|
|
||||
|
} |
||||
|
|
Loading…
Reference in new issue