| | |
| | | public List<WarningVo> getRunTimeAlarmAnalyse() { |
| | | List<WarningVo> result = new ArrayList<>(); |
| | | Date nowDate = DateUtils.getNowDate(); |
| | | String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate); |
| | | DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); |
| | | if (StringUtils.isNull(dictRecord)) { |
| | | nowDate = DateUtils.getAPeriodOfTime(nowDate, -1, Calendar.HOUR_OF_DAY); |
| | | } |
| | | |
| | | //String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate); |
| | | //DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); |
| | | //if (StringUtils.isNull(dictRecord)) { |
| | | // nowDate = DateUtils.getAPeriodOfTime(nowDate, -1, Calendar.HOUR_OF_DAY); |
| | | //} |
| | | //List<WarningDetail> list = alarmAnalyseOperation(nowDate); |
| | | |
| | | List<WarningDetail> list = new ArrayList<>(); |
| | |
| | | list.addAll(rs); |
| | | } |
| | | } |
| | | |
| | | list.forEach(s -> { |
| | | result.add(new WarningVo(s.getLocationName(), s.getSuYuanId(), 0.0, 0.0, s.getValue())); |
| | | }); |
| | |
| | | public List<WarningVo> getRunTimeWarningAnalyse() { |
| | | List<WarningVo> result = new ArrayList<>(); |
| | | Date nowDate = DateUtils.getNowDate(); |
| | | String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate); |
| | | DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); |
| | | if (StringUtils.isNull(dictRecord)) { |
| | | nowDate = DateUtils.getAPeriodOfTime(nowDate, -1, Calendar.HOUR_OF_DAY); |
| | | } |
| | | |
| | | //String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate); |
| | | //DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); |
| | | //if (StringUtils.isNull(dictRecord)) { |
| | | // nowDate = DateUtils.getAPeriodOfTime(nowDate, -1, Calendar.HOUR_OF_DAY); |
| | | //} |
| | | //List<WarningDetail> list = warningAnalyseOperation(nowDate); |
| | | |
| | | List<WarningDetail> list = new ArrayList<>(); |
| | | Calendar calendar = getCalendar(nowDate); |
| | | for (int i = 0; i < 3; i++) { |
| | |
| | | list.addAll(rs); |
| | | } |
| | | } |
| | | |
| | | list.forEach(s -> { |
| | | result.add(new WarningVo(s.getLocationName(), s.getSuYuanId(), 0.0, 0.0, s.getValue())); |
| | | }); |
| | |
| | | } |
| | | |
| | | public List<WarningDetail> alarmAnalyseOperation(Date date) { |
| | | List<WarningDetail> result = new ArrayList<WarningDetail>(); |
| | | List<WarningDetail> result = new ArrayList<>(); |
| | | String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); |
| | | List<String> ids = CalculateUtils.assembleId(commonService.getCheckPoints3d()); |
| | | if (ids.size() == 0) { |
| | | return result; |
| | | } |
| | | DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); |
| | | if (StringUtils.isNull(dictRecord)) { |
| | | if (null == dictRecord) { |
| | | return result; |
| | | } |
| | | String tableName = dictRecord.getTableName(); |
| | | if (suYuanMapper.isTableExists(tableName) == 0) { |
| | | return result; |
| | | } |
| | | |
| | | List<SuYuan2d> list = suYuanMapper.getAlarmsAnalyse(tableName, ids); |
| | | list.forEach(s -> { |
| | | String locationName = commonService.select3dCheckPointById(s.getId()).getName(); |
| | | result.add(new WarningDetail(0L, tableName, s.getId(), locationName, date, 0, s.getValue())); |
| | | }); |
| | | if (null != list && list.size() > 0) { |
| | | for (SuYuan2d s : list) { |
| | | String locationName = commonService.select3dCheckPointById(s.getId()).getName(); |
| | | result.add(new WarningDetail(0L, tableName, s.getId(), locationName, date, 0, s.getValue())); |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public List<WarningDetail> warningAnalyseOperation(Date date) { |
| | | List<WarningDetail> result = new ArrayList<WarningDetail>(); |
| | | List<WarningDetail> result = new ArrayList<>(); |
| | | String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); |
| | | List<String> ids = CalculateUtils.assembleId(commonService.getCheckPoints3d()); |
| | | if (ids.size() == 0) { |
| | | return result; |
| | | } |
| | | DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); |
| | | if (StringUtils.isNull(dictRecord)) { |
| | | if (null == dictRecord) { |
| | | return result; |
| | | } |
| | | String tableName = dictRecord.getTableName(); |
| | | if (suYuanMapper.isTableExists(tableName) == 0) { |
| | | return result; |
| | | } |
| | | |
| | | List<SuYuan2d> list = suYuanMapper.getWarningAnalyse(tableName, ids); |
| | | list.forEach(s -> { |
| | | String locationName = commonService.select3dCheckPointById(s.getId()).getName(); |
| | | result.add(new WarningDetail(0L, tableName, s.getId(), locationName, date, 1, s.getValue())); |
| | | }); |
| | | if (null != list && list.size() > 0) { |
| | | for (SuYuan2d s : list) { |
| | | String locationName = commonService.select3dCheckPointById(s.getId()).getName(); |
| | | result.add(new WarningDetail(0L, tableName, s.getId(), locationName, date, 1, s.getValue())); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |