AdoS0ProductStructureRules.cs 606 B

12345678910111213141516171819
  1. using Admin.NET.Plugin.AiDOP.Dto.S0.Manufacturing;
  2. namespace Admin.NET.Plugin.AiDOP.Infrastructure;
  3. public static class AdoS0ProductStructureRules
  4. {
  5. public static string? ValidateUpsert(AdoS0ProductStructureUpsertDto dto)
  6. {
  7. if (dto.ParentMaterialId == dto.ComponentMaterialId)
  8. return "父项与子项物料不能相同";
  9. if (dto.Qty < 0)
  10. return "标准用量不能为负";
  11. if (dto.Scrap < 0)
  12. return "损耗率不能为负";
  13. if (dto.QtyConsumed < 0)
  14. return "固定损耗量不能为负";
  15. return null;
  16. }
  17. }