Просмотр исходного кода

fix(s0): add NetWeight validation guard

YY968XX 4 недель назад
Родитель
Сommit
cc0db3adb5

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

@@ -169,6 +169,13 @@ public class AdoS0ItemMasterUpsertDto
     public string? Location { get; set; }
     public string? DefaultShelf { get; set; }
     public bool KeyItem { get; set; }
+
+    // C2 技术护栏:上下界对齐 Entity 列类型 decimal(18,5)(max ±9,999,999,999,999.99999)。
+    // 这不是业务净重上限,仅为防止 MySQL out-of-range 触发 unhandled 500。
+    // 业务实际上限待 C0 业务签字(参见 lwb/C0-business-rule-scope-review-20260425.md C2-Q1/Q2)。
+    // 负数语义未在本轮处理,下界保留为列允许的负向极值。
+    [Range(typeof(decimal), "-9999999999999.99999", "9999999999999.99999",
+        ErrorMessage = "净重数值超出技术允许范围(decimal(18,5))")]
     public decimal? NetWeight { get; set; }
     public string? NetWeightUM { get; set; }
     public bool Inspect { get; set; }