| | |
| | | using MiniExcelLibs.Attributes; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.ComponentModel; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Enums; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial |
| | | { |
| | | |
| | | /// <summary> |
| | | /// WmsMaterialå¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class MaterialExportModel |
| | | { |
| | | /// <summary> |
| | | 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; |
| | | |
| | | /// <summary> |
| | | /// ç©æåºç¡ä¿¡æ¯è¡¨å¯¼åºæ¨¡å |
| | | /// </summary> |
| | | public class WmsMaterialExportModel |
| | | { |
| | | /// <summary> |
| | | /// ç©æç¼ç ï¼å¯ä¸æ è¯ï¼ |
| | | /// </summary> |
| | | /// <example>MAT-2023-001</example> |
| | | [ExcelColumn(Name = "ç©æç¼ç ", Width = 25)] |
| | | [ExcelColumn(Name = "ç©æç¼ç ï¼å¯ä¸æ è¯ï¼", Width = 25)] |
| | | public string MaterialCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ææç©æ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ¯å¦ææç©æ", Width = 25)] |
| | | public bool IsValid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦èªäº§ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ¯å¦èªäº§", Width = 25)] |
| | | public bool? IsSelfMade { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "æ°é", Width = 25)] |
| | | public int Num { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªææ°é |
| | | /// </summary> |
| | | [ExcelColumn(Name = "èªææ°é", Width = 25)] |
| | | public int? SelfNum { 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)] |
| | | [ExcelColumn(Name = "å¯ç©ºé¿åº¦", Width = 25)] |
| | | public decimal? NullLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´ç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "éè´ç±»åï¼æä¸¾å¼ï¼", Width = 25)] |
| | | public PurchaseTypeEnum PurchaseType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»å |
| | | /// ç©æç±»åï¼æä¸¾å¼ï¼ |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// 1:åææ 2:åæå 3:æå |
| | | /// </remarks> |
| | | /// <example>1</example> |
| | | [ExcelColumn(Name = "ç©æç±»å", Width = 25)] |
| | | [ExcelColumn(Name = "ç©æç±»åï¼æä¸¾å¼ï¼", Width = 25)] |
| | | public MaterialTypeEnum MaterialType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主计éåä½ |
| | | /// 主åä½ï¼å¦ï¼kgãmãä¸ªï¼ |
| | | /// </summary> |
| | | /// <example>kg</example> |
| | | [ExcelColumn(Name = "主åä½", Width = 25)] |
| | | [ExcelColumn(Name = "主åä½ï¼å¦ï¼kgãmã个ï¼", Width = 25)] |
| | | public string PrimaryUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼/ææ¯æ å |
| | | /// è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼ |
| | | /// </summary> |
| | | /// <example>GB/T 8163-2018</example> |
| | | [ExcelColumn(Name = "è§æ ¼/æ å", Width = 25)] |
| | | [ExcelColumn(Name = "è§æ ¼/æ åï¼å¦ï¼GB/T 8163-2018ï¼", Width = 25)] |
| | | public string Standard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤å¾ï¼åä½ï¼æ¯«ç±³ï¼ |
| | | /// å¤å¾ï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | /// <example>50.5</example> |
| | | [ExcelColumn(Name = "å¤å¾(mm)", Width = 25)] |
| | | [ExcelColumn(Name = "å¤å¾ï¼åä½ï¼mmï¼", Width = 25)] |
| | | public decimal OuterDiameter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å£åï¼åä½ï¼æ¯«ç±³ï¼ |
| | | /// å£åï¼åä½ï¼mmï¼ |
| | | /// </summary> |
| | | /// <example>2.5</example> |
| | | [ExcelColumn(Name = "å£å(mm)", Width = 25)] |
| | | [ExcelColumn(Name = "å£åï¼åä½ï¼mmï¼", Width = 25)] |
| | | public decimal WallThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè´¨è¯´æ |
| | | /// æè´¨ï¼å¦ï¼304ä¸éé¢ï¼ |
| | | /// </summary> |
| | | /// <example>304ä¸éé¢</example> |
| | | [ExcelColumn(Name = "æè´¨", Width = 25)] |
| | | [ExcelColumn(Name = "æè´¨ï¼å¦ï¼304ä¸éé¢ï¼", Width = 25)] |
| | | public string MaterialQuality { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦ï¼åä½ï¼ç±³ï¼ |
| | | /// é¿åº¦ï¼åä½ï¼mï¼ |
| | | /// </summary> |
| | | /// <example>6.0</example> |
| | | [ExcelColumn(Name = "é¿åº¦(m)", Width = 25)] |
| | | [ExcelColumn(Name = "é¿åº¦ï¼åä½ï¼mï¼", Width = 25)] |
| | | public decimal Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸»æ¯ç®¡æ è¯ |
| | | /// æ¯å¦ä¸ºä¸»æ¯ç®¡ |
| | | /// </summary> |
| | | /// <example>true</example> |
| | | [ExcelColumn(Name = "æ¯å¦ä¸»æ¯ç®¡", Width = 25)] |
| | | [Description("æ¯/å¦")] |
| | | [ExcelColumn(Name = "æ¯å¦ä¸ºä¸»æ¯ç®¡", Width = 25)] |
| | | 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 |
| | | /// åä½å段1 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// å¯ç¨äºä¸´æ¶åå¨ä¾åºåç¼ç çæ©å±ä¿¡æ¯ |
| | | /// </remarks> |
| | | [ExcelColumn(Name = "æ©å±å段1", Width = 25)] |
| | | [ExcelColumn(Name = "åä½å段1 - é¢çæ©å±ç¨é", Width = 25)] |
| | | public string RedundantField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¢çæ©å±å段2 |
| | | /// åä½å段2 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// å¯ç¨äºä¸´æ¶å卿¹æ¬¡å·çæ©å±ä¿¡æ¯ |
| | | /// </remarks> |
| | | [ExcelColumn(Name = "æ©å±å段2", Width = 25)] |
| | | [ExcelColumn(Name = "åä½å段2 - é¢çæ©å±ç¨é", Width = 25)] |
| | | public string RedundantField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¢çæ©å±å段3 |
| | | /// åä½å段3 - é¢çæ©å±ç¨é |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// å¯ç¨äºä¸´æ¶åå¨èªå®ä¹åç±»çæ©å±ä¿¡æ¯ |
| | | /// </remarks> |
| | | [ExcelColumn(Name = "æ©å±å段3", Width = 25)] |
| | | [ExcelColumn(Name = "åä½å段3 - é¢çæ©å±ç¨é", Width = 25)] |
| | | public string RedundantField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "夿³¨",Width = 25)] |
| | | [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()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å建æ¶é´", Width = 25)] |
| | | public DateTime CreationTime { get; set; } |
| | | |
| | | return exportData; |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ä¿®æ¹æ¶é´ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä¿®æ¹æ¶é´", Width = 25)] |
| | | public DateTime LastModificationTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å建人", Width = 25)] |
| | | public string CreatorName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹äºº |
| | | /// </summary> |
| | | [ExcelColumn(Name = "ä¿®æ¹äºº", Width = 25)] |
| | | public string LastModifierName { get; set; } |
| | | |
| | | |
| | | |
| | | public Dictionary<string, object> GetExportData() |
| | | { |
| | | var exportData = new Dictionary<string, object>(); |
| | | foreach (var property in this.GetType().GetProperties()) |
| | | { |
| | | exportData.Add(property.Name, property.GetValue(this)); |
| | | } |
| | | |
| | | return exportData; |
| | | } |
| | | } |