| | |
| | | @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);
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 根据线性表单的条件规则,获取一条线性表单数据
|
| | | * 根据线性表单的条件规则,获取一条线性表单数据,包含 所有检测项目
|
| | | * @param sensorKeys
|
| | | * @param timePeriod
|
| | | * @param dataCondition
|
| | |
| | | // list to map
|
| | | int finalN = n;
|
| | | sensorKeys.forEach(sensorKey -> {
|
| | | Double sensorValue = rowData.get(sensorKey)!= null?new Double(rowData.get(sensorKey).toString()):null;
|
| | | lineChartDatasWithEmpty.get(sensorKey).set(finalN,sensorValue);
|
| | | Object value = rowData.get(sensorKey);
|
| | | List<Double> lineChartDatasWithEmptyTemp = lineChartDatasWithEmpty.get(sensorKey);
|
| | | if(finalN < lineChartDatasWithEmptyTemp.size()){
|
| | | Double sensorValue = value!= null?new Double(value.toString()):null;
|
| | | lineChartDatasWithEmptyTemp.set(finalN,sensorValue);
|
| | | }
|
| | | });
|
| | | // 置为 -1,防止越界
|
| | | m = m<dataLength ? m+1 : -1;
|