| | |
| | | @Resource |
| | | private VocValsService vocValsService; |
| | | |
| | | private SimpleDateFormat ym = new SimpleDateFormat("yyyyMM%"); |
| | | private static HashMap<String, String> filterMap = new HashMap<>(); |
| | | |
| | | @Async("threadPoolTaskExecutor") |
| | | public void insertWarningDetails(List<WarningDetail> warning) throws Exception { |
| | |
| | | |
| | | 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); |
| | | //List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50); |
| | | //DistanceSuYuan suMax = suYuanMapper.getSuYuan500Max(tab, ids3d); |
| | | |
| | | //String filter = CalculateUtils.getFilterByExtend(point, 50); |
| | | String filter = getFilterByPoint(point, 50); |
| | | DistanceSuYuan suMax = suYuanMapper.getSuYuan500MaxByFilter(tab, filter); |
| | | suMax.setAddr(getAddr(suMax.getId())); |
| | | |
| | | Report report = Report.calcReport(wd, suYuan, suMax); |
| | |
| | | return list; |
| | | } |
| | | |
| | | public static String getFilterByPoint(MonitorPointPosition point, int range) { |
| | | String key = String.format("%d_%d_%d", point.getX(), point.getY(), range); |
| | | if (filterMap.containsKey(key)) { |
| | | return filterMap.get(key); |
| | | } |
| | | |
| | | List<String> ids = CalculateUtils.aloneCrosswiseExtend(point, range); |
| | | for (int i = 0, c = ids.size(); i < c; i++) { |
| | | ids.set(i, "'" + ids.get(i) + "'"); |
| | | } |
| | | |
| | | String filter = "id in (" + StringUtils.join(ids, ",") + ")"; |
| | | if (!filterMap.containsKey(key)) { |
| | | filterMap.put(key, filter); |
| | | } |
| | | |
| | | return filter; |
| | | } |
| | | |
| | | private Hashtable<String, Boolean> getExistTabDict(List<Qxsh> rsList) { |
| | | Hashtable<String, Boolean> dict = new Hashtable<>(); |
| | | for (Qxsh qxsh : rsList) { |