using Admin.NET.Plugin.AiDOP.Dto.S0.Manufacturing; namespace Admin.NET.Plugin.AiDOP.Infrastructure; public static class AdoS0ProductStructureRules { public static string? ValidateUpsert(AdoS0ProductStructureUpsertDto dto) { if (dto.ParentMaterialId == dto.ComponentMaterialId) return "父项与子项物料不能相同"; if (dto.Qty < 0) return "标准用量不能为负"; if (dto.Scrap < 0) return "损耗率不能为负"; if (dto.QtyConsumed < 0) return "固定损耗量不能为负"; return null; } }