| | |
| | | @Resource |
| | | private IEquipmentRunningTraceService equipmentRunningTraceService; |
| | | |
| | | @Resource |
| | | private IMdcAlarmInfoService mdcAlarmInfoService; |
| | | |
| | | @Override |
| | | public List<MdcEquipmentRunningSectionDto> logList(MdcEquipmentRunningSectionVo equipmentRunningSectionVo) { |
| | | |
| | |
| | | List<MdcEquipmentRunningSection> running = loadEquipmentRunningTrace(equipmentRunningSectionVo.getEquipmentId(), equipmentRunningSectionVo.getCollectTimeStr()); |
| | | //查询报警数据 |
| | | List<MdcEquipmentRunningSection> errs = loadEquipmentErrorTrace(equipmentRunningSectionVo.getEquipmentId(), equipmentRunningSectionVo.getCollectTimeStr()); |
| | | Equipment equip = equipmentService.getOne(new LambdaQueryWrapper<Equipment>().eq(Equipment::getEquipmentid, equipmentRunningSectionVo.getEquipmentId())); |
| | | if (!running.isEmpty()) { |
| | | MdcEquipmentRunningSectionDto dto; |
| | | Equipment equip = equipmentService.getOne(new LambdaQueryWrapper<Equipment>().eq(Equipment::getEquipmentid, equipmentRunningSectionVo.getEquipmentId())); |
| | | String tableName = ""; |
| | | Boolean isTableExist = false; |
| | | if (equip != null) { |
| | |
| | | for (MdcEquipmentRunningSection entity : running) { |
| | | dto = new MdcEquipmentRunningSectionDto(); |
| | | BeanUtils.copyProperties(entity, dto); |
| | | if (entity.getStatus() == 3 && StringUtils.isBlank(entity.getSequenceNumber()) && isTableExist) { |
| | | if (entity.getStatus() == 3 && StringUtils.isBlank(entity.getSequenceNumber()) && isTableExist && !"ZUOLAN".equals(equip.getDrivetype())) { |
| | | List<EquipmentMachingDto> esList = equipmentWorkLineService.getEquipmentSequencenumber(tableName, entity.getStartTime(), entity.getEndTime()); |
| | | if (esList != null && esList.size() > 1) { |
| | | dto.setSequenceNumber(esList.get(0).getSequencenumber()); |
| | |
| | | for (MdcEquipmentRunningSection entity : errs) { |
| | | dto = new MdcEquipmentRunningSectionDto(); |
| | | BeanUtils.copyProperties(entity, dto); |
| | | Set<TmpEquipmentAlarm> set = entity.getTmpEquipmentAlarmSet(); |
| | | if (entity.getStatus() == 22 && set != null && !set.isEmpty()) { |
| | | Iterator<TmpEquipmentAlarm> iterator = entity.getTmpEquipmentAlarmSet().iterator(); |
| | | //获取报警编号相同的报警信息 |
| | | while (iterator.hasNext()) { |
| | | TmpEquipmentAlarm next = iterator.next(); |
| | | if (StringUtils.isNotBlank(next.getAlarmNo()) && next.getAlarmNo().equals(entity.getStatus())) { |
| | | dto.setAlarmContent(next.getAlarmContent()); |
| | | if (entity.getStatus() == 22) { |
| | | if (equip != null) { |
| | | List<MdcAlarmInfo> mdcAlarmInfo = mdcAlarmInfoService.list(new LambdaQueryWrapper<MdcAlarmInfo>().eq(MdcAlarmInfo::getDriveType, equip.getDrivetype()).eq(MdcAlarmInfo::getAlarmCode, entity.getAlarm()).eq(MdcAlarmInfo::getIsUse, 0)); |
| | | if (mdcAlarmInfo != null && !mdcAlarmInfo.isEmpty()) { |
| | | dto.setAlarmContent(mdcAlarmInfo.get(0).getAlarmContent()); |
| | | } |
| | | } |
| | | } |
| | | // Set<TmpEquipmentAlarm> set = entity.getTmpEquipmentAlarmSet(); |
| | | // if (entity.getStatus() == 22 && set != null && !set.isEmpty()) { |
| | | // Iterator<TmpEquipmentAlarm> iterator = entity.getTmpEquipmentAlarmSet().iterator(); |
| | | // //获取报警编号相同的报警信息 |
| | | // while (iterator.hasNext()) { |
| | | // TmpEquipmentAlarm next = iterator.next(); |
| | | // if (StringUtils.isNotBlank(next.getAlarmNo()) && next.getAlarmNo().equals(entity.getStatus())) { |
| | | // dto.setAlarmContent(next.getAlarmContent()); |
| | | // } |
| | | // } |
| | | // } |
| | | dtos.add(dto); |
| | | } |
| | | } |
| | |
| | | //整合加工和待机时间小于n秒的数据 |
| | | erts = mergeLessMinTimeRecords(erts, null); |
| | | List<MdcEquipmentRunningSection> running = mergeRunningTrace(erts); |
| | | if (running != null || !running.isEmpty()) { |
| | | if (running != null && !running.isEmpty()) { |
| | | this.ergodicTrim(running); |
| | | } |
| | | return running; |
| | |
| | | return this.baseMapper.selectAlarmList(mdcAlarmAnalyzeQueryVo, startDate, endDate); |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> getDataList(String equipmentId, Date date) { |
| | | return this.baseMapper.getDataList(equipmentId, date); |
| | | } |
| | | |
| | | private Map<String, List<MdcEquipmentRunningSectionDto>> logCharts(MdcEquipmentRunningSectionVo equipmentRunningSectionVo, String date) { |
| | | Map<String, List<MdcEquipmentRunningSectionDto>> map = new HashMap<>(); |
| | | List<MdcEquipmentRunningSectionDto> normal = new ArrayList<>(); |