| | |
| | | package com.yssh.service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.concurrent.CountDownLatch; |
| | | |
| | | import com.yssh.entity.*; |
| | |
| | | private QxshMapper qxshMapper; |
| | | |
| | | @Resource |
| | | private SuYuanService suYuanService; |
| | | private VocValsService vocValsService; |
| | | |
| | | private SimpleDateFormat ym = new SimpleDateFormat("yyyyMM%"); |
| | | |
| | |
| | | List<WarningDetail> rsBj = warningDetailMapper.selectByTimeForBj(startTime, endTime); |
| | | if (null != rsBj && rsBj.size() > 0) rs.addAll(rsBj); |
| | | |
| | | Hashtable<String, Boolean> dict = new Hashtable<>(); |
| | | List<Report> list = new ArrayList<>(); |
| | | for (WarningDetail wd : rs) { |
| | | //String time = ymdh.format(wd.getCreateTime()); |
| | |
| | | suMax = suYuan; |
| | | }*/ |
| | | |
| | | int rows = suYuanMapper.isTableExists(wd.getTableName()); |
| | | if (rows == 0) { |
| | | continue; |
| | | if (dict.containsKey(wd.getTableName())) { |
| | | if (!dict.get(wd.getTableName())) continue; |
| | | } else { |
| | | Boolean b = suYuanMapper.isTableExists(wd.getTableName()) > 0; |
| | | dict.put(wd.getTableName(), b); |
| | | if (!b) continue; |
| | | } |
| | | |
| | | DistanceSuYuan suYuan = suYuanMapper.getSuYuanById(wd.getTableName(), wd.getSuYuanId()); |
| | |
| | | MonitorPointPosition point = commonService.select3dCheckPointByName(wd.getLocationName()); |
| | | List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50); |
| | | DistanceSuYuan suMax = suYuanMapper.getSuYuan500Max(wd.getTableName(), ids3d); |
| | | |
| | | String[] strs = suMax.getId().split("_"); |
| | | int x = Integer.parseInt(strs[0]) / 10; |
| | | int y = Integer.parseInt(strs[1]) / 10; |
| | | String addr = suYuanService.selectAddrByXY(x, y); |
| | | suMax.setAddr(addr); |
| | | suMax.setAddr(getAddr(suMax.getId())); |
| | | |
| | | Report report = Report.calcReport(wd, suYuan, suMax); |
| | | report.setLastVal(lastVal); |
| | |
| | | |
| | | return list; |
| | | } |
| | | |
| | | private String getAddr(String id) { |
| | | String[] strs = id.split("_"); |
| | | int x = Integer.parseInt(strs[0]) / 10; |
| | | int y = Integer.parseInt(strs[1]) / 10; |
| | | |
| | | List<VocCoords> list = vocValsService.selectCoords(x, y); |
| | | for (VocCoords vc : list) { |
| | | if (null != vc.getAddr() && vc.getAddr().length() > 0) { |
| | | return vc.getAddr(); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |