Selaa lähdekoodia

fix(s0): validate overlong input lengths

Bump backend version to 1.0.172.
YY968XX 1 kuukausi sitten
vanhempi
commit
4a6f9ae282

+ 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.171</AssemblyVersion>
-    <FileVersion>1.0.171</FileVersion>
-    <Version>1.0.171</Version>
+    <AssemblyVersion>1.0.172</AssemblyVersion>
+    <FileVersion>1.0.172</FileVersion>
+    <Version>1.0.172</Version>
   </PropertyGroup>
 
   <ItemGroup>

+ 4 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Manufacturing/AdoS0ManufacturingDtos.cs

@@ -424,9 +424,13 @@ public class AdoS0MfgPersonSkillUpsertDto
 {
     public long CompanyRefId { get; set; }
     public long FactoryRefId { get; set; }
+    [MaxLength(100)]
     public string Code { get; set; } = string.Empty;
+    [MaxLength(200)]
     public string Name { get; set; } = string.Empty;
+    [MaxLength(50)]
     public string? SkillLevel { get; set; }
+    [MaxLength(500)]
     public string? Remark { get; set; }
     public bool IsEnabled { get; set; } = true;
 }

+ 14 - 3
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Sales/AdoS0PriorityRuleDtos.cs

@@ -14,23 +14,34 @@ public class AdoS0PriorityRuleUpsertDto
 {
     public long CompanyRefId { get; set; }
     public long FactoryRefId { get; set; }
+    [MaxLength(100)]
     public string Code { get; set; } = string.Empty;
+    [MaxLength(200)]
     public string Name { get; set; } = string.Empty;
     public int PriorityLevel { get; set; }
+    [MaxLength(10)]
     public string SortDirection { get; set; } = "asc";
+    [MaxLength(200)]
     public string? SourceEntity { get; set; }
+    [MaxLength(200)]
     public string? SourceField { get; set; }
+    [MaxLength(100)]
     public string? SourceFieldType { get; set; }
+    [MaxLength(200)]
     public string? SourceLinkField { get; set; }
+    [MaxLength(200)]
     public string? WorkOrderField { get; set; }
+    [MaxLength(100)]
     public string? WorkOrderFieldType { get; set; }
+    [MaxLength(200)]
     public string? WorkOrderLinkField { get; set; }
-    /// <summary>客户类型(写入 RuleExpr JSON)</summary>
+    /// <summary>客户类型(写入 RuleExpr JSON,无 1:1 列长度,本批次不加 MaxLength)</summary>
     public string? CustomerType { get; set; }
-    /// <summary>订单类型(写入 RuleExpr JSON)</summary>
+    /// <summary>订单类型(写入 RuleExpr JSON,无 1:1 列长度,本批次不加 MaxLength)</summary>
     public string? OrderType { get; set; }
-    /// <summary>到期状态(写入 RuleExpr JSON)</summary>
+    /// <summary>到期状态(写入 RuleExpr JSON,无 1:1 列长度,本批次不加 MaxLength)</summary>
     public string? DueStatus { get; set; }
+    [MaxLength(500)]
     public string? Remark { get; set; }
     public bool IsEnabled { get; set; } = true;
 }

+ 25 - 0
server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Sales/AdoS0SalesDtos.cs

@@ -153,21 +153,32 @@ public class AdoS0ItemMasterUpsertDto
     [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;
 
     [Required(ErrorMessage = "物料名称不能为空")]
+    [MaxLength(200)]
     public string Descr { get; set; } = string.Empty;
 
+    [MaxLength(200)]
     public string? Descr1 { get; set; }
+    [MaxLength(50)]
     public string? PkgCode { get; set; }
+    [MaxLength(50)]
     public string? UM { get; set; }
+    [MaxLength(100)]
     public string? PurMfg { get; set; }
+    [MaxLength(100)]
     public string? Drawing { get; set; }
+    [MaxLength(100)]
     public string? ItemType { get; set; }
+    [MaxLength(100)]
     public string? Location { get; set; }
+    [MaxLength(100)]
     public string? DefaultShelf { get; set; }
     public bool KeyItem { get; set; }
 
@@ -177,6 +188,7 @@ public class AdoS0ItemMasterUpsertDto
     [Range(typeof(decimal), "0", "9999999999999.99999",
         ErrorMessage = "净重不能为负,且不能超过技术允许范围(decimal(18,5))")]
     public decimal? NetWeight { get; set; }
+    [MaxLength(50)]
     public string? NetWeightUM { get; set; }
     public bool Inspect { get; set; }
     public int? PurLT { get; set; }
@@ -184,11 +196,15 @@ public class AdoS0ItemMasterUpsertDto
     public int? MfgLT { get; set; }
     public decimal? Length { get; set; }
     public decimal? Size { get; set; }
+    [MaxLength(50)]
     public string? SizeUM { get; set; }
     public bool IssuePolicy { get; set; }
     public int? MfgMttr { get; set; }
+    [MaxLength(50)]
     public string? LocationType { get; set; }
+    [MaxLength(100)]
     public string? CommodityCode { get; set; }
+    [MaxLength(50)]
     public string? Rev { get; set; }
     public decimal? MaxOrd { get; set; }
     public decimal? MinOrd { get; set; }
@@ -202,23 +218,32 @@ public class AdoS0ItemMasterUpsertDto
     public decimal? StockTurnOver { get; set; }
     public bool LotSerialControl { get; set; }
     public bool AllocateSingleLot { get; set; }
+    [MaxLength(50)]
     public string? Status { get; set; }
+    [MaxLength(100)]
     public string? Planner { get; set; }
     public bool TraceDetail { get; set; }
     public bool IsMainMas { get; set; }
+    [MaxLength(1000)]
     public string? Remark { get; set; }
+    [MaxLength(50)]
     public string? EMTType { get; set; }
+    [MaxLength(100)]
     public string? OwnerApplication { get; set; }
+    [MaxLength(50)]
     public string? BomVersion { get; set; }
     public bool EnableBomVersion { get; set; }
     public int? BOMDesign { get; set; }
     public int? RoutingDes { get; set; }
     public bool CustSupplied { get; set; }
     public int? DrawingDesign { get; set; }
+    [MaxLength(100)]
     public string? DesignOwner { get; set; }
     public bool IsActive { get; set; } = true;
     public bool IsConfirm { get; set; }
+    [MaxLength(100)]
     public string? CreateUser { get; set; }
+    [MaxLength(100)]
     public string? UpdateUser { get; set; }
 }