| | |
| | | using MiniExcelLibs.Attributes; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System; |
| | | using System.ComponentModel; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial |
| | | /// <summary> |
| | | /// 物料基础信息导出模型 |
| | | /// </summary> |
| | | public class WmsMaterialExportModel |
| | | { |
| | | /// <summary> |
| | | /// 物料编码(唯一标识) |
| | | /// </summary> |
| | | //[ExcelColumn(Name = "物料编码(唯一标识)", Width = 25)] |
| | | //public string MaterialCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WmsMaterial导出模型 |
| | | /// 物料编码(唯一标识) |
| | | /// </summary> |
| | | public class MaterialExportModel |
| | | [ExcelColumn(Name = "物料编码(唯一标识)", Width = 25)] |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 物料名称 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "物料名称", Width = 25)] |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 采购类型(枚举值) |
| | | /// </summary> |
| | | [ExcelColumn(Name = "采购类型(枚举值)", Width = 25)] |
| | | public PurchaseTypeEnum PurchaseType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 物料类型(枚举值) |
| | | /// </summary> |
| | | [ExcelColumn(Name = "物料类型(枚举值)", Width = 25)] |
| | | public MaterialTypeEnum MaterialType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主单位(如:kg、m、个) |
| | | /// </summary> |
| | | [ExcelColumn(Name = "主单位(如:kg、m、个)", Width = 25)] |
| | | public string PrimaryUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 规格/标准(如:GB/T 8163-2018) |
| | | /// </summary> |
| | | [ExcelColumn(Name = "规格/标准(如:GB/T 8163-2018)", Width = 25)] |
| | | public string Standard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 外径(单位:mm) |
| | | /// </summary> |
| | | [ExcelColumn(Name = "外径(单位:mm)", Width = 25)] |
| | | public decimal OuterDiameter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 壁厚(单位:mm) |
| | | /// </summary> |
| | | [ExcelColumn(Name = "壁厚(单位:mm)", Width = 25)] |
| | | public decimal WallThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 材质(如:304不锈钢) |
| | | /// </summary> |
| | | [ExcelColumn(Name = "材质(如:304不锈钢)", Width = 25)] |
| | | public string MaterialQuality { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 长度(单位:m) |
| | | /// </summary> |
| | | [ExcelColumn(Name = "长度(单位:m)", Width = 25)] |
| | | public decimal Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否为主支管 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "是否为主支管", Width = 25)] |
| | | public YesNoEnum IsMainBranch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 生产工厂 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "生产工厂", Width = 25)] |
| | | public string Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 证书编号 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "证书编号", Width = 25)] |
| | | public string Certification { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 冗余字段1 - 预留扩展用途 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "冗余字段1 - 预留扩展用途", Width = 25)] |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 冗余字段2 - 预留扩展用途 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "冗余字段2 - 预留扩展用途", Width = 25)] |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 冗余字段3 - 预留扩展用途 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "冗余字段3 - 预留扩展用途", Width = 25)] |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 备注 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "备注", Width = 25)] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [ExcelColumn(Name = "", Width = 25)] |
| | | public DateTime CreationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [ExcelColumn(Name = "", Width = 25)] |
| | | public DateTime LastModificationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 型号 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "型号", Width = 25)] |
| | | public string MaterialModel { get; set; } |
| | | |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | /// <summary> |
| | | /// 物料编码(唯一标识) |
| | | /// </summary> |
| | | /// <example>MAT-2023-001</example> |
| | | [ExcelColumn(Name = "物料编码", Width = 25)] |
| | | public string MaterialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 物料名称 |
| | | /// </summary> |
| | | /// <example>304不锈钢管</example> |
| | | [ExcelColumn(Name = "物料名称", Width = 25)] |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 采购类型 |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// 0:标准采购 1:紧急采购 2:协议采购 |
| | | /// </remarks> |
| | | /// <example>0</example> |
| | | [ExcelColumn(Name = "采购类型", Width = 25)] |
| | | public PurchaseTypeEnum PurchaseType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 物料类型 |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// 1:原材料 2:半成品 3:成品 |
| | | /// </remarks> |
| | | /// <example>1</example> |
| | | [ExcelColumn(Name = "物料类型", Width = 25)] |
| | | public MaterialTypeEnum MaterialType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主计量单位 |
| | | /// </summary> |
| | | /// <example>kg</example> |
| | | [ExcelColumn(Name = "主单位", Width = 25)] |
| | | public string PrimaryUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 规格/技术标准 |
| | | /// </summary> |
| | | /// <example>GB/T 8163-2018</example> |
| | | [ExcelColumn(Name = "规格/标准", Width = 25)] |
| | | public string Standard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 外径(单位:毫米) |
| | | /// </summary> |
| | | /// <example>50.5</example> |
| | | [ExcelColumn(Name = "外径(mm)", Width = 25)] |
| | | public decimal OuterDiameter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 壁厚(单位:毫米) |
| | | /// </summary> |
| | | /// <example>2.5</example> |
| | | [ExcelColumn(Name = "壁厚(mm)", Width = 25)] |
| | | public decimal WallThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 材质说明 |
| | | /// </summary> |
| | | /// <example>304不锈钢</example> |
| | | [ExcelColumn(Name = "材质", Width = 25)] |
| | | public string MaterialQuality { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 型号 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "型号", Width = 25)] |
| | | public string MaterialModel { get; set; } |
| | | /// <summary> |
| | | /// 长度(单位:米) |
| | | /// </summary> |
| | | /// <example>6.0</example> |
| | | [ExcelColumn(Name = "长度(m)", Width = 25)] |
| | | public decimal Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否主支管标识 |
| | | /// </summary> |
| | | /// <example>true</example> |
| | | [ExcelColumn(Name = "是否主支管", Width = 25)] |
| | | [Description("是/否")] |
| | | public YesNoEnum IsMainBranch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 生产工厂名称 |
| | | /// </summary> |
| | | /// <example>上海第一工厂</example> |
| | | [ExcelColumn(Name = "生产工厂", Width = 25)] |
| | | public string Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 认证证书编号 |
| | | /// </summary> |
| | | /// <example>CER-2023-001</example> |
| | | [ExcelColumn(Name = "证书编号", Width = 25)] |
| | | public string Certification { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 预留扩展字段1 |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// 可用于临时存储供应商编码等扩展信息 |
| | | /// </remarks> |
| | | [ExcelColumn(Name = "扩展字段1", Width = 25)] |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 预留扩展字段2 |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// 可用于临时存储批次号等扩展信息 |
| | | /// </remarks> |
| | | [ExcelColumn(Name = "扩展字段2", Width = 25)] |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 预留扩展字段3 |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// 可用于临时存储自定义分类等扩展信息 |
| | | /// </remarks> |
| | | [ExcelColumn(Name = "扩展字段3", Width = 25)] |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 备注 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "备注",Width = 25)] |
| | | public string Remark { get; set; } |
| | | |
| | | public Dictionary<string, object> GetExportData() |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
| | | |