| | |
| | | return map; |
| | | } |
| | | |
| | | public List<Report> getAlarmAndWarnByTime(Date begin, Date end) { |
| | | public List<Report> getAlarmAndWarnByTime(Date beginDate, Date endDate) { |
| | | String strStart = DateUtils.getYyyyMmDdHh(beginDate); |
| | | String strEnd = DateUtils.getYyyyMmDdHh(endDate); |
| | | Integer start = Integer.parseInt(strStart); |
| | | Integer end = Integer.parseInt(strEnd); |
| | | |
| | | List<Qxsh> rsList = qxshMapper.selectByBeginAndEnd(start, end); |
| | | if (null == rsList || rsList.isEmpty()) return null; |
| | | |
| | | Hashtable<String, Boolean> dict = getExistTabDict(rsList); |
| | | List<Report> list = new ArrayList<>(); |
| | | for (Qxsh qxsh : rsList) { |
| | | String tab = "su_yuan_" + qxsh.getTime(); |
| | | if (!dict.get(tab)) continue; |
| | | |
| | | MonitorPointPosition point = commonService.select3dCheckPointByName(qxsh.getName()); |
| | | String suYuanId = point.getId().substring(0, point.getId().lastIndexOf("_") + 1) + "0"; |
| | | Double lastVal = qxshMapper.selectLastYearVal(Integer.parseInt(qxsh.getTime()) - 1000000, qxsh.getName()); |
| | | |
| | | WarningDetail wd = new WarningDetail(0L, tab, suYuanId, qxsh.getName(), null, 0, qxsh.getValue()); |
| | | DistanceSuYuan suYuan = suYuanMapper.getSuYuanById(tab, suYuanId); |
| | | List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50); |
| | | DistanceSuYuan suMax = suYuanMapper.getSuYuan500Max(tab, ids3d); |
| | | suMax.setAddr(getAddr(suMax.getId())); |
| | | |
| | | Report report = Report.calcReport(wd, suYuan, suMax); |
| | | report.setLastVal(lastVal); |
| | | |
| | | list.add(report); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | private Hashtable<String, Boolean> getExistTabDict(List<Qxsh> rsList) { |
| | | Hashtable<String, Boolean> dict = new Hashtable<>(); |
| | | for (Qxsh qxsh : rsList) { |
| | | String tab = "su_yuan_" + qxsh.getTime(); |
| | | if (dict.containsKey(tab)) { |
| | | continue; |
| | | } |
| | | |
| | | Boolean b = suYuanMapper.isTableExists(tab) > 0; |
| | | dict.put(tab, b); |
| | | } |
| | | |
| | | return dict; |
| | | } |
| | | |
| | | public List<Report> getAlarmAndWarnByTime2(Date begin, Date end) { |
| | | String startTime = DateUtils.getYyyyMmDdHhMmSs(begin); |
| | | String endTime = DateUtils.getYyyyMmDdHhMmSs(end); |
| | | |
| | |
| | | Hashtable<String, Boolean> dict = new Hashtable<>(); |
| | | List<Report> list = new ArrayList<>(); |
| | | for (WarningDetail wd : rs) { |
| | | //String time = ymdh.format(wd.getCreateTime()); |
| | | //list.add(new WarningVo(wd.getLocationName(), wd.getSuYuanId(), 0.0, 0.0, wd.getValue(), time)); |
| | | |
| | | /*DistanceSuYuan suYuan = suYuanMapper.getSuYuanById(wd.getTableName(), wd.getSuYuanId()); |
| | | Double lastVal = warningDetailMapper.getLastYearVal(wd.getId()); |
| | | |
| | |
| | | } else { |
| | | suMax = suYuan; |
| | | }*/ |
| | | |
| | | if (dict.containsKey(wd.getTableName())) { |
| | | if (!dict.get(wd.getTableName())) continue; |
| | | } else { |