| | |
| | | List<MdcAlarmDto> equipmentCountList = new ArrayList<>(); |
| | | String startDate = DateUtils.format(DateUtils.toDate(vo.getStartDate(), DateUtils.STRDATE), DateUtils.STR_DATE) + " 00:00:00"; |
| | | String endDate = DateUtils.format(DateUtils.addDays(DateUtils.toDate(vo.getEndDate(), DateUtils.STRDATE), 1), DateUtils.STR_DATE) + " 00:00:00"; |
| | | List<MdcAlarmListDto> alarmList = mdcEquipmentRunningSectionService.selectAlarmList(vo, startDate, endDate); |
| | | result.setAlarmList(alarmList); |
| | | /*List<MdcAlarmListDto> alarmList = mdcEquipmentRunningSectionService.selectAlarmList(vo, startDate, endDate); |
| | | result.setAlarmList(alarmList);*/ |
| | | for (String equipmentId : result.getEquipmentList()) { |
| | | MdcAlarmDto mdcAlarmDto = new MdcAlarmDto(); |
| | | mdcAlarmDto.setKey(equipmentId); |
| | |
| | | result.setDateCountList(dateCountList); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<MdcAlarmListDto> equipmentAlarmList(String userId, MdcAlarmAnalyzeQueryVo vo) { |
| | | List<String> equipmentIds = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(vo.getParentId()) && StringUtils.isEmpty(vo.getEquipmentId())) { |
| | | if ("2".equals(vo.getTypeTree())) { |
| | | // 部门层级 |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, vo.getParentId()); |
| | | } else { |
| | | // 产线层级 |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, vo.getParentId()); |
| | | } |
| | | } else if (StringUtils.isNotEmpty(vo.getEquipmentId())) { |
| | | // 单台设备信息 |
| | | vo.setEquipmentIdList(Collections.singletonList(vo.getEquipmentId())); |
| | | } else { |
| | | // 查询用户拥有的所有设备信息 |
| | | if ("2".equals(vo.getTypeTree())) { |
| | | // 部门层级 |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, null); |
| | | } else { |
| | | // 产线层级 |
| | | equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, null); |
| | | } |
| | | } |
| | | if (vo.getEquipmentIdList() == null || vo.getEquipmentIdList().isEmpty()) { |
| | | vo.setEquipmentIdList(equipmentIds); |
| | | } |
| | | if (vo.getEquipmentIdList() == null || vo.getEquipmentIdList().isEmpty()) { |
| | | return null; |
| | | } |
| | | String startDate = DateUtils.format(DateUtils.toDate(vo.getStartDate(), DateUtils.STRDATE), DateUtils.STR_DATE) + " 00:00:00"; |
| | | String endDate = DateUtils.format(DateUtils.addDays(DateUtils.toDate(vo.getEndDate(), DateUtils.STRDATE), 1), DateUtils.STR_DATE) + " 00:00:00"; |
| | | return mdcEquipmentRunningSectionService.selectAlarmList(vo, startDate, endDate); |
| | | } |
| | | } |