| | |
| | | List<Record> hazardRecords = recordMapper.selectList(recordWrapper); |
| | | |
| | | if (hazardRecords.isEmpty()) { |
| | | log.info("项目没有隐患记录,projectIds: {}", projectIds); |
| | | log.info("项目没有隐患记录,所有项目归类为 A,projectIds: {}", projectIds); |
| | | for (Integer projectId : projectIds) { |
| | | categoryMap.put(projectId, "A"); |
| | | } |
| | | return categoryMap; |
| | | } |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | // 按优先级顺序判断:A -> B -> C |
| | | String[] categories = {"a", "b", "c"}; |
| | | // 按优先级顺序判断:C -> B,都不满足则归类为 A |
| | | String[] categories = {"c", "b"}; |
| | | |
| | | for (String category : categories) { |
| | | JSONArray categoryRules = config.getJSONArray(category); |
| | |
| | | } |
| | | |
| | | if (matchesCategory) { |
| | | return category.toUpperCase(); // 返回 "A", "B", "C" |
| | | return category.toUpperCase(); // 返回 "C" 或 "B" |
| | | } |
| | | } |
| | | |
| | | return null; // 不满足任何类别 |
| | | return "A"; // 不满足 C 和 B,直接归类为 A |
| | | } |
| | | } |