设备台账实时数据问题修改
正在显示
2 个修改的文件
包含
3 行增加
和
26 行删除
... | @@ -43,6 +43,7 @@ public class EmergencyCommandLiaison { | ... | @@ -43,6 +43,7 @@ public class EmergencyCommandLiaison { |
43 | /**所属厂区*/ | 43 | /**所属厂区*/ |
44 | @Excel(name = "所属厂区", width = 15) | 44 | @Excel(name = "所属厂区", width = 15) |
45 | @ApiModelProperty(value = "所属厂区") | 45 | @ApiModelProperty(value = "所属厂区") |
46 | @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") | ||
46 | private String departId; | 47 | private String departId; |
47 | /**版块类型:1-河道,2-污水厂,3-排水管网*/ | 48 | /**版块类型:1-河道,2-污水厂,3-排水管网*/ |
48 | @Excel(name = "版块类型:1-河道,2-污水厂,3-排水管网", width = 15) | 49 | @Excel(name = "版块类型:1-河道,2-污水厂,3-排水管网", width = 15) | ... | ... |
... | @@ -518,9 +518,7 @@ public class EquipmentController { | ... | @@ -518,9 +518,7 @@ public class EquipmentController { |
518 | @ApiOperation(value = "设备-采集实时数据", notes = "设备-采集实时数据") | 518 | @ApiOperation(value = "设备-采集实时数据", notes = "设备-采集实时数据") |
519 | @GetMapping(value = "/realTimeData") | 519 | @GetMapping(value = "/realTimeData") |
520 | public Result<List<Map<String,Object>>> equipRealTimeDataCtrl(@RequestParam(value = "infoId") String infoId, | 520 | public Result<List<Map<String,Object>>> equipRealTimeDataCtrl(@RequestParam(value = "infoId") String infoId, |
521 | @RequestParam(value = "departId") String departId, | 521 | @RequestParam(value = "departId") String departId) { |
522 | @RequestParam(value = "startTime") String startTime, | ||
523 | @RequestParam(value = "endTime") String endTime) { | ||
524 | Result<List<Map<String,Object>>> result = new Result<>(); | 522 | Result<List<Map<String,Object>>> result = new Result<>(); |
525 | QueryWrapper<SysMonitorMetricInfo> queryWrapper = new QueryWrapper<>(); | 523 | QueryWrapper<SysMonitorMetricInfo> queryWrapper = new QueryWrapper<>(); |
526 | queryWrapper.eq("equipment_code", infoId) | 524 | queryWrapper.eq("equipment_code", infoId) |
... | @@ -533,31 +531,11 @@ public class EquipmentController { | ... | @@ -533,31 +531,11 @@ public class EquipmentController { |
533 | //获取实时指标 | 531 | //获取实时指标 |
534 | String fields = ""; | 532 | String fields = ""; |
535 | for(SysMonitorMetricInfo monitorInfo : list) { | 533 | for(SysMonitorMetricInfo monitorInfo : list) { |
536 | // | ||
537 | // if("1".equals(monitorInfo.getMetricType())) { | ||
538 | // //数字量判断表达式 | ||
539 | // String express1 = monitorInfo.getMetricExpress1(); | ||
540 | // String express2 = monitorInfo.getMetricExpress1(); | ||
541 | // String express3 = monitorInfo.getMetricExpress1(); | ||
542 | // if(!StringUtils.isEmpty(express1)) { | ||
543 | // fields = fields+","+express1; | ||
544 | // } | ||
545 | // if(!StringUtils.isEmpty(express2)) { | ||
546 | // fields = fields+","+express2; | ||
547 | // } | ||
548 | // if(!StringUtils.isEmpty(express3)) { | ||
549 | // fields = fields+","+express3; | ||
550 | // } | ||
551 | // }else { | ||
552 | // fields = fields+","+monitorInfo.getId(); | ||
553 | // } | ||
554 | fields = fields+","+monitorInfo.getId(); | 534 | fields = fields+","+monitorInfo.getId(); |
555 | } | 535 | } |
556 | if(!StringUtils.isEmpty(fields)) { | 536 | if(!StringUtils.isEmpty(fields)) { |
557 | fields = fields.substring(1); | 537 | fields = fields.substring(1); |
558 | } | 538 | } |
559 | List<SysMetricDict> sysMetricDicts = sysMetricDictService.list(); | ||
560 | Map<String, String> dictMap = sysMetricDicts.stream().collect(Collectors.toMap(o1 -> o1.getId(), o2 -> o2.getMetricUnit())); | ||
561 | //List<Map<String, Object>> pgDataList = iFactoryInfoService.queryFactoryInfos(departId, fields, startTime, endTime, "0"); | 539 | //List<Map<String, Object>> pgDataList = iFactoryInfoService.queryFactoryInfos(departId, fields, startTime, endTime, "0"); |
562 | List<Map<String, Object>> pgDataList = pgQueryService.queryFactoryMonitorFromRealTimeData(departId, fields); | 540 | List<Map<String, Object>> pgDataList = pgQueryService.queryFactoryMonitorFromRealTimeData(departId, fields); |
563 | Map<String, Object> dataMap = new HashMap<String,Object>(); | 541 | Map<String, Object> dataMap = new HashMap<String,Object>(); |
... | @@ -565,15 +543,13 @@ public class EquipmentController { | ... | @@ -565,15 +543,13 @@ public class EquipmentController { |
565 | dataMap = pgDataList.get(0); | 543 | dataMap = pgDataList.get(0); |
566 | } | 544 | } |
567 | List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>(); | 545 | List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>(); |
568 | |||
569 | for(SysMonitorMetricInfo monitorInfo : list) { | 546 | for(SysMonitorMetricInfo monitorInfo : list) { |
570 | Map<String,Object> tempMap = new HashMap<String,Object>(); | 547 | Map<String,Object> tempMap = new HashMap<String,Object>(); |
571 | tempMap.put("time", DateUtils.formatTime(Long.parseLong(dataMap.get("time") + "000"))); | 548 | tempMap.put("time", DateUtils.formatTime(Long.parseLong(dataMap.get("time") + "000"))); |
572 | tempMap.put("indexName", monitorInfo.getMetricName()); | 549 | tempMap.put("indexName", monitorInfo.getMetricName()); |
573 | tempMap.put("indexCode", monitorInfo.getId()); | 550 | tempMap.put("indexCode", monitorInfo.getId()); |
574 | tempMap.put("indexValue", dataMap.get(monitorInfo.getId())); | 551 | tempMap.put("indexValue", dataMap.get(monitorInfo.getId())); |
575 | String metricUidTag = monitorInfo.getMetricUidTag(); | 552 | tempMap.put("indexUnit",StringUtils.isNotBlank(monitorInfo.getMetricUnit()) ? monitorInfo.getMetricUnit():""); |
576 | tempMap.put("indexUnit",StringUtils.isBlank(dictMap.get(metricUidTag) )?monitorInfo.getMetricUnit():""); | ||
577 | tempMap.put("indexType", monitorInfo.getMetricType()); | 553 | tempMap.put("indexType", monitorInfo.getMetricType()); |
578 | resultList.add(tempMap); | 554 | resultList.add(tempMap); |
579 | } | 555 | } | ... | ... |
-
请 注册 或 登录 后发表评论