27 changed files with 8154 additions and 185 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
|
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue