| | |
| | | @Override
|
| | | public Map<String, List<Object>> getCompareReport(Map<String, Object> parameters) throws Exception {
|
| | | Map<String, List<Object>> resultMap = new HashMap<String, List<Object>>();
|
| | | List<Map<String, Object>> list = JSON.parseObject((String)parameters.get("items"), new TypeReference<List<Map<String, Object>>>() {});
|
| | | parameters.remove("items");
|
| | | Map<String, Object> timeType = JSON.parseObject((String)parameters.get("timeTypes"), new TypeReference<Map<String, Object>>() {});
|
| | | parameters.remove("timeTypes");
|
| | | List<Map<String, Object>> list = JSON.parseObject((String)parameters.remove("items"), new TypeReference<List<Map<String, Object>>>() {});
|
| | | Map<String, Object> timeType = JSON.parseObject((String)parameters.remove("timeType"), new TypeReference<Map<String, Object>>() {});
|
| | | parameters.putAll(timeType);
|
| | | parameters.put("type", parameters.get("value"));
|
| | | parameters.remove("value");
|
| | | parameters.put("type", parameters.remove("value"));
|
| | |
|
| | | ExecutorService threadPool = Executors.newCachedThreadPool();
|
| | | CompletionService<Map<String, List<Object>>> cs = new ExecutorCompletionService<Map<String, List<Object>>>(threadPool);
|
| | |
| | | if (ObjectUtils.isEmpty(map.get("mac"))) {
|
| | | map.remove("mac");
|
| | | }
|
| | | map.put("time", map.get("formatTime"));
|
| | | map.remove("formatTime");
|
| | | map.put("time", map.remove("formatTime"));
|
| | | map.putAll(parameters);
|
| | | cs.submit(new Callable<Map<String, List<Object>>>() {
|
| | | @Override
|
| | |
| | | // 监控点平均值
|
| | | if (!parameters.containsKey("mac")) {
|
| | | resultList = new ArrayList<Map<String,Object>>();
|
| | | Integer monitorPointId = Integer.valueOf(parameters.get("monitorPoint").toString());
|
| | | Integer monitorPointId = Integer.valueOf(parameters.get("monitorPointId").toString());
|
| | | List<Map<String, Object>> deviceVersions = deviceMapper.getDeviceVersionIdByMonitorPoint(monitorPointId);
|
| | | ExecutorService threadPool = Executors.newCachedThreadPool();
|
| | | CompletionService<List<Map<String, Object>>> cs = new ExecutorCompletionService<List<Map<String, Object>>>(threadPool);
|
| | |
| | | }
|
| | | Map<String, Map<String, Number[]>> result = new LinkedHashMap<String, Map<String, Number[]>>();
|
| | | for (Map<String, Object> map : list) {
|
| | | time = (String) map.get("time");
|
| | | map.remove("time");
|
| | | time = (String) map.remove("time");
|
| | | Map<String, Number[]> times = new HashMap<String, Number[]>();
|
| | | if (result.containsKey(time)) {
|
| | | times = (Map<String, Number[]>) result.get(time);
|