Pārlūkot izejas kodu

fix(s0): validate warehouse and quality string lengths

Add MaxLength annotations for S0 warehouse and quality upsert DTOs.
No DB schema changes.
YY968XX 16 stundas atpakaļ
vecāks
revīzija
0882f7fabe

+ 3 - 3
server/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj

@@ -11,9 +11,9 @@
     <GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
     <Copyright>Admin.NET</Copyright>
     <Description>Admin.NET 通用权限开发平台</Description>
-    <AssemblyVersion>1.0.172</AssemblyVersion>
-    <FileVersion>1.0.172</FileVersion>
-    <Version>1.0.172</Version>
+    <AssemblyVersion>1.0.173</AssemblyVersion>
+    <FileVersion>1.0.173</FileVersion>
+    <Version>1.0.173</Version>
   </PropertyGroup>
 
   <ItemGroup>

+ 44 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Quality/AdoS0QualityDtos.cs

@@ -50,20 +50,31 @@ public class AdoS0QmsRawWhitelistUpsertDto : IValidatableObject
 public class AdoS0QmsSamplingSchemeUpsertDto
 {
     [Required(ErrorMessage = "编号不能为空")]
+    [MaxLength(255)]
     public string Number { get; set; } = string.Empty;
 
     [Required(ErrorMessage = "名称不能为空")]
+    [MaxLength(255)]
     public string Name { get; set; } = string.Empty;
 
+    [MaxLength(255)]
     public string? SamplingType { get; set; }
+    [MaxLength(255)]
     public string? InspectionLevel { get; set; }
+    [MaxLength(255)]
     public string? Strictness { get; set; }
+    [MaxLength(255)]
     public string? AqlValue { get; set; }
+    [MaxLength(255)]
     public string? InspectionType { get; set; }
     public long? InspectOrgId { get; set; }
+    [MaxLength(255)]
     public string? InspectUserId { get; set; }
+    [MaxLength(255)]
     public string? Status { get; set; }
+    [MaxLength(255)]
     public string? EnableStatus { get; set; }
+    [MaxLength(255)]
     public string? Comment { get; set; }
     public decimal? FixedSamplingRate { get; set; }
 }
@@ -71,81 +82,114 @@ public class AdoS0QmsSamplingSchemeUpsertDto
 public class AdoS0QmsInspectionInstrumentUpsertDto
 {
     [Required(ErrorMessage = "编号不能为空")]
+    [MaxLength(255)]
     public string Number { get; set; } = string.Empty;
 
     [Required(ErrorMessage = "名称不能为空")]
+    [MaxLength(255)]
     public string Name { get; set; } = string.Empty;
 
+    [MaxLength(255)]
     public string? Model { get; set; }
+    [MaxLength(255)]
     public string? Specification { get; set; }
+    [MaxLength(255)]
     public string? Manufacturer { get; set; }
+    [MaxLength(255)]
     public string? Status { get; set; }
+    [MaxLength(255)]
     public string? EnableStatus { get; set; }
+    [MaxLength(255)]
     public string? Comment { get; set; }
+    [MaxLength(255)]
     public string? GaugeCategory { get; set; }
     public int? CalibrationCycleDays { get; set; }
+    [MaxLength(50)]
     public string? NextCalibrationDate { get; set; }
 }
 
 public class AdoS0QmsQualityBaseTypeUpsertDto
 {
     [Required(ErrorMessage = "类型分类不能为空")]
+    [MaxLength(100)]
     public string TypeCategory { get; set; } = string.Empty;
 
     [Required(ErrorMessage = "类型编码不能为空")]
+    [MaxLength(100)]
     public string TypeCode { get; set; } = string.Empty;
 
     [Required(ErrorMessage = "简称不能为空")]
+    [MaxLength(200)]
     public string ShortName { get; set; } = string.Empty;
 
+    [MaxLength(255)]
     public string? FullName { get; set; }
     public bool IsActive { get; set; } = true;
+    [MaxLength(500)]
     public string? Remark { get; set; }
 }
 
 public class AdoS0QmsInspectionMethodUpsertDto
 {
     [Required(ErrorMessage = "编号不能为空")]
+    [MaxLength(255)]
     public string Number { get; set; } = string.Empty;
 
     [Required(ErrorMessage = "名称不能为空")]
+    [MaxLength(255)]
     public string Name { get; set; } = string.Empty;
 
+    [MaxLength(255)]
     public string? ControlStrategy { get; set; }
+    [MaxLength(255)]
     public string? Status { get; set; }
+    [MaxLength(255)]
     public string? EnableStatus { get; set; }
+    [MaxLength(255)]
     public string? Comment { get; set; }
 }
 
 public class AdoS0QmsInspectionItemUpsertDto
 {
     [Required(ErrorMessage = "编号不能为空")]
+    [MaxLength(255)]
     public string Number { get; set; } = string.Empty;
 
     [Required(ErrorMessage = "名称不能为空")]
+    [MaxLength(255)]
     public string Name { get; set; } = string.Empty;
 
     public long? CheckMethodId { get; set; }
     public long? CheckBasisId { get; set; }
     public long? CheckInstructId { get; set; }
+    [MaxLength(255)]
     public string? RadioGroupField { get; set; }
+    [MaxLength(255)]
     public string? RadioGroupField1 { get; set; }
     public long? MetricType { get; set; }
+    [MaxLength(255)]
     public string? Status { get; set; }
+    [MaxLength(255)]
     public string? EnableStatus { get; set; }
+    [MaxLength(255)]
     public string? Comment { get; set; }
 }
 
 public class AdoS0QmsInspectionFrequencyUpsertDto
 {
     [Required(ErrorMessage = "编号不能为空")]
+    [MaxLength(255)]
     public string Number { get; set; } = string.Empty;
 
     [Required(ErrorMessage = "名称不能为空")]
+    [MaxLength(255)]
     public string Name { get; set; } = string.Empty;
 
+    [MaxLength(255)]
     public string? Remark { get; set; }
+    [MaxLength(255)]
     public string? Status { get; set; }
+    [MaxLength(255)]
     public string? EnableStatus { get; set; }
 }
 

+ 37 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Warehouse/AdoS0WarehouseBarcodeDtos.cs

@@ -22,63 +22,94 @@ public class AdoS0BarcodeRuleUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(8)]
     public string? DomainCode { get; set; }
+    [MaxLength(50)]
     public string? Customer { get; set; }
+    [MaxLength(30)]
     public string? Type { get; set; }
+    [MaxLength(8)]
     public string? WaterRules { get; set; }
     public int? WaterLen { get; set; }
+    [MaxLength(8)]
     public string? Separator { get; set; }
     public int? FirmLength { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString1 { get; set; }
     public int? FirmStringLen1 { get; set; }
+    [MaxLength(30)]
     public string? FirmString1Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString2 { get; set; }
     public int? FirmStringLen2 { get; set; }
+    [MaxLength(30)]
     public string? FirmString2Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString3 { get; set; }
     public int? FirmStringLen3 { get; set; }
+    [MaxLength(30)]
     public string? FirmString3Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString4 { get; set; }
     public int? FirmStringLen4 { get; set; }
+    [MaxLength(30)]
     public string? FirmString4Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString5 { get; set; }
     public int? FirmStringLen5 { get; set; }
+    [MaxLength(30)]
     public string? FirmString5Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString6 { get; set; }
     public int? FirmStringLen6 { get; set; }
+    [MaxLength(30)]
     public string? FirmString6Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString7 { get; set; }
     public int? FirmStringLen7 { get; set; }
+    [MaxLength(30)]
     public string? FirmString7Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString8 { get; set; }
     public int? FirmStringLen8 { get; set; }
+    [MaxLength(30)]
     public string? FirmString8Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString9 { get; set; }
     public int? FirmStringLen9 { get; set; }
+    [MaxLength(30)]
     public string? FirmString9Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString10 { get; set; }
     public int? FirmStringLen10 { get; set; }
+    [MaxLength(30)]
     public string? FirmString10Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString11 { get; set; }
     public int? FirmStringLen11 { get; set; }
+    [MaxLength(30)]
     public string? FirmString11Note { get; set; }
 
+    [MaxLength(20)]
     public string? FirmString12 { get; set; }
     public int? FirmStringLen12 { get; set; }
+    [MaxLength(30)]
     public string? FirmString12Note { get; set; }
 
+    [MaxLength(24)]
     public string? CreateUser { get; set; }
+    [MaxLength(24)]
     public string? UpdateUser { get; set; }
 }
 
@@ -103,13 +134,19 @@ public class AdoS0LabelTypeUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
 
     [Required(ErrorMessage = "标签类型编码不能为空")]
+    [MaxLength(100)]
     public string BarType { get; set; } = string.Empty;
 
+    [MaxLength(50)]
     public string? Class { get; set; }
+    [MaxLength(1000)]
     public string? InputString { get; set; }
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }

+ 41 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Warehouse/AdoS0WarehouseBasicDtos.cs

@@ -21,14 +21,19 @@ public class AdoS0DepartmentUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
 
     [Required(ErrorMessage = "部门编码不能为空")]
+    [MaxLength(100)]
     public string Department { get; set; } = string.Empty;
 
+    [MaxLength(255)]
     public string? Descr { get; set; }
     public bool IsActive { get; set; } = true;
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }
 
@@ -54,27 +59,42 @@ public class AdoS0EmployeeUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
 
     [Required(ErrorMessage = "员工编码不能为空")]
+    [MaxLength(100)]
     public string Employee { get; set; } = string.Empty;
 
+    [MaxLength(200)]
     public string? Name { get; set; }
+    [MaxLength(10)]
     public string? Sex { get; set; }
+    [MaxLength(50)]
     public string? Phone { get; set; }
+    [MaxLength(200)]
     public string? Email { get; set; }
     public DateTime? BirthDate { get; set; }
+    [MaxLength(100)]
     public string? Department { get; set; }
     public DateTime? DateEmployed { get; set; }
+    [MaxLength(50)]
     public string? EmploymentStatus { get; set; }
+    [MaxLength(50)]
     public string? MaritalStatus { get; set; }
+    [MaxLength(100)]
     public string? JobTitle { get; set; }
     public DateTime? DateTerminated { get; set; }
+    [MaxLength(100)]
     public string? WorkCtr { get; set; }
+    [MaxLength(100)]
     public string? CarId { get; set; }
+    [MaxLength(100)]
     public string? DefaultWorkLocation { get; set; }
     public bool IsActive { get; set; } = true;
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }
 
@@ -98,15 +118,21 @@ public class AdoS0CostCtrUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
 
     [Required(ErrorMessage = "成本中心编码不能为空")]
+    [MaxLength(100)]
     public string CostCtr { get; set; } = string.Empty;
 
+    [MaxLength(255)]
     public string? Descr { get; set; }
+    [MaxLength(255)]
     public string? Ufld1 { get; set; }
     public DateTime? EffTime { get; set; }
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }
 
@@ -132,17 +158,25 @@ public class AdoS0LocationUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
 
     [Required(ErrorMessage = "库位编码不能为空")]
+    [MaxLength(100)]
     public string Location { get; set; } = string.Empty;
 
+    [MaxLength(255)]
     public string? Descr { get; set; }
+    [MaxLength(300)]
     public string? Storer { get; set; }
+    [MaxLength(50)]
     public string? Typed { get; set; }
+    [MaxLength(500)]
     public string? PhysicalAddress { get; set; }
     public bool IsActive { get; set; } = true;
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }
 
@@ -180,16 +214,23 @@ public class AdoS0LocationShelfUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
 
     [Required(ErrorMessage = "库位编码不能为空")]
+    [MaxLength(100)]
     public string Location { get; set; } = string.Empty;
 
     [Required(ErrorMessage = "货架编码不能为空")]
+    [MaxLength(100)]
     public string InvShelf { get; set; } = string.Empty;
 
+    [MaxLength(255)]
     public string? Descr { get; set; }
+    [MaxLength(100)]
     public string? Area { get; set; }
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }

+ 16 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Warehouse/AdoS0WarehouseNbrDtos.cs

@@ -23,16 +23,23 @@ public class AdoS0NbrTypeUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(8)]
     public string? DomainCode { get; set; }
+    [MaxLength(8)]
     public string? Dept { get; set; }
+    [MaxLength(4)]
     public string? NbrClass { get; set; }
 
     [Required(ErrorMessage = "单号类型编码不能为空")]
+    [MaxLength(8)]
     public string NbrType { get; set; } = string.Empty;
 
+    [MaxLength(24)]
     public string? Descr1 { get; set; }
     public bool IsActive { get; set; } = true;
+    [MaxLength(24)]
     public string? CreateUser { get; set; }
+    [MaxLength(24)]
     public string? UpdateUser { get; set; }
 }
 
@@ -56,14 +63,20 @@ public class AdoS0NbrControlUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
 
     [Required(ErrorMessage = "单号类型编码不能为空")]
+    [MaxLength(50)]
     public string NbrType { get; set; } = string.Empty;
 
+    [MaxLength(50)]
     public string? Description { get; set; }
+    [MaxLength(50)]
     public string? NbrPre1 { get; set; }
+    [MaxLength(50)]
     public string? NbrPre2 { get; set; }
+    [MaxLength(50)]
     public string? NbrPre3 { get; set; }
     public int? IniValue { get; set; }
     public int? MinValue { get; set; }
@@ -71,8 +84,11 @@ public class AdoS0NbrControlUpsertDto
     public bool AllowReset { get; set; }
     public bool AllowSkip { get; set; }
     public bool AllowManual { get; set; }
+    [MaxLength(50)]
     public string? DateType { get; set; }
     public bool IsDateType { get; set; }
+    [MaxLength(24)]
     public string? CreateUser { get; set; }
+    [MaxLength(24)]
     public string? UpdateUser { get; set; }
 }

+ 33 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Warehouse/AdoS0WarehouseOtherDtos.cs

@@ -22,24 +22,33 @@ public class AdoS0ItemPackUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
 
     [Required(ErrorMessage = "物料编码不能为空")]
+    [MaxLength(100)]
     public string ItemNum { get; set; } = string.Empty;
 
     public decimal? PackingQty { get; set; }
     public decimal? SmallPackingQty { get; set; }
+    [MaxLength(50)]
     public string? PackingType { get; set; }
     public decimal? NetWeight { get; set; }
+    [MaxLength(20)]
     public string? WeightUM { get; set; }
     public decimal? Length { get; set; }
     public decimal? Width { get; set; }
     public decimal? High { get; set; }
+    [MaxLength(50)]
     public string? IssSpecific { get; set; }
+    [MaxLength(100)]
     public string? CustItem { get; set; }
+    [MaxLength(500)]
     public string? Remark { get; set; }
     public bool IsActive { get; set; } = true;
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }
 
@@ -66,20 +75,32 @@ public class AdoS0EmpWorkDutyUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
 
     [Required(ErrorMessage = "员工编码不能为空")]
+    [MaxLength(100)]
     public string Employee { get; set; } = string.Empty;
 
+    [MaxLength(100)]
     public string? ItemNum { get; set; }
+    [MaxLength(100)]
     public string? ItemNum1 { get; set; }
+    [MaxLength(100)]
     public string? ItemNum2 { get; set; }
+    [MaxLength(100)]
     public string? Location { get; set; }
+    [MaxLength(100)]
     public string? ProdLine { get; set; }
+    [MaxLength(500)]
     public string? Duty { get; set; }
+    [MaxLength(50)]
     public string? EmpType { get; set; }
+    [MaxLength(255)]
     public string? Ufld2 { get; set; }
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }
 
@@ -106,19 +127,31 @@ public class AdoS0TaskAssignmentUpsertDto
     [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
     public long FactoryRefId { get; set; }
 
+    [MaxLength(50)]
     public string? DomainCode { get; set; }
     public DateTime? Tcrq { get; set; }
+    [MaxLength(100)]
     public string? Sqr { get; set; }
+    [MaxLength(50)]
     public string? Rwlx { get; set; }
+    [MaxLength(100)]
     public string? Wlbm { get; set; }
     public decimal? Sl { get; set; }
+    [MaxLength(100)]
     public string? Rqpc { get; set; }
+    [MaxLength(100)]
     public string? Yskw { get; set; }
+    [MaxLength(100)]
     public string? Mdkw { get; set; }
     public DateTime? Xqsj { get; set; }
+    [MaxLength(100)]
     public string? Clr { get; set; }
+    [MaxLength(500)]
     public string? Bz { get; set; }
+    [MaxLength(50)]
     public string? Zt { get; set; }
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }