| | |
| | | long stop = 0L; |
| | | long maintenance = 0L; |
| | | for (Map<String, Object> stat : machineryStats) { |
| | | int status = ((Number) stat.get("status")).intValue(); |
| | | long count = ((Number) stat.get("count")).longValue(); |
| | | total += count; |
| | | // 状态为空的设备(历史数据)计入总数,但不归类,避免解引用 null 导致 NPE |
| | | Number statusValue = (Number) stat.get("status"); |
| | | if (statusValue == null) { |
| | | continue; |
| | | } |
| | | int status = statusValue.intValue(); |
| | | if (status == MesDvMachineryStatusEnum.PRODUCING.getStatus()) { |
| | | producing = count; |
| | | } else if (status == MesDvMachineryStatusEnum.STOP.getStatus()) { |