6793290b 张雷

奥体项目设备实时数据,模拟量实时数据接口开发

1 个父辈 c8036cd1
...@@ -339,4 +339,14 @@ public class OlympicCenterController { ...@@ -339,4 +339,14 @@ public class OlympicCenterController {
339 result.setSuccess(true); 339 result.setSuccess(true);
340 return result; 340 return result;
341 } 341 }
342
343 @ApiOperation(value="获取新锅炉房泵实时数据", notes="获取新锅炉房泵实时数据")
344 @GetMapping(value = "/getNewBoilerPumpRealTimeData")
345 public Result<Map<String,Object>> getNewBoilerPumpRealTimeData(String sourceType,String pumpId){
346 Result<Map<String,Object>> result = new Result<Map<String,Object>>();
347 Map<String,Object> map = olympicCenterService.getNewBoilerPumpRealTimeData(sourceType, pumpId);
348 result.setResult(map);
349 result.setSuccess(true);
350 return result;
351 }
342 } 352 }
......
...@@ -37,4 +37,6 @@ public interface WhatStructDataMapper { ...@@ -37,4 +37,6 @@ public interface WhatStructDataMapper {
37 List<WhatStructData> getEquipDataListOfNewBoiler(@Param("sourceType") String sourceType); 37 List<WhatStructData> getEquipDataListOfNewBoiler(@Param("sourceType") String sourceType);
38 38
39 List<WhatStructData> getRealTimeDataOfNewBoiler(@Param("sourceType") String sourceType, @Param("pipeDn") String pipeDn); 39 List<WhatStructData> getRealTimeDataOfNewBoiler(@Param("sourceType") String sourceType, @Param("pipeDn") String pipeDn);
40
41 List<WhatStructData> getXglfEquipDataList(@Param("sourceType") String sourceType, @Param("pumpId") String pumpId);
40 } 42 }
......
...@@ -96,4 +96,9 @@ ...@@ -96,4 +96,9 @@
96 AND equip_type = 'other' 96 AND equip_type = 'other'
97 </select> 97 </select>
98 98
99 <select id="getXglfEquipDataList" resultType="com.skua.modules.business.entity.WhatStructData">
100 select * from what_struct_data_xglf
101 where pump_code = #{sourceType} and equip_code = #{pumpId}
102 </select>
103
99 </mapper> 104 </mapper>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -64,4 +64,6 @@ public interface IOlympicCenterService { ...@@ -64,4 +64,6 @@ public interface IOlympicCenterService {
64 List<Map<String,Object>> getNewBoilerRealTimeReport(String sourceType); 64 List<Map<String,Object>> getNewBoilerRealTimeReport(String sourceType);
65 65
66 List<TableResult> getNewBoilerRealDataReport(String sourceType,String pipeDn); 66 List<TableResult> getNewBoilerRealDataReport(String sourceType,String pipeDn);
67
68 Map<String, Object> getNewBoilerPumpRealTimeData(String sourceType, String pumpId);
67 } 69 }
......
...@@ -2968,6 +2968,52 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -2968,6 +2968,52 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
2968 return list; 2968 return list;
2969 } 2969 }
2970 2970
2971 @Override
2972 public Map<String, Object> getNewBoilerPumpRealTimeData(String sourceType, String pumpId) {
2973 Map<String, Object> map = new HashMap<>();
2974 map.put("status","停止");
2975 map.put("runtime","0");
2976 map.put("name",pumpId);
2977 map.put("id",pumpId);
2978 String pgField = "";
2979 List<Map<String, Object>> statusList = new ArrayList<>();
2980 List<WhatStructData> equipList = new ArrayList<>();
2981 equipList = whatStructDataMapper.getXglfEquipDataList(sourceType, pumpId);
2982 if(equipList.size()==0){
2983 return map;
2984 }
2985 Map<String, Object> equipMap = new HashMap<>();
2986 for (WhatStructData whatStructData : equipList) {
2987 pgField = pgField +","+whatStructData.getMonitorId();
2988 if("equip_status".equals(whatStructData.getEquipType())){
2989 Map<String, Object> statusMap = new HashMap<>();
2990 statusMap.put("name",whatStructData.getMonitorName());
2991 statusMap.put("id",whatStructData.getId());
2992 statusMap.put("monitorid",whatStructData.getMonitorId());
2993 statusList.add(statusMap);
2994 map.put("name",whatStructData.getMonitorName());
2995 }
2996 if("equip_time".equals(whatStructData.getEquipType())){
2997 equipMap.put("runtime",whatStructData.getMonitorId());
2998 }
2999
3000 }
3001 Map<String, Object> monitorMap = new HashMap<>();
3002 List<Map<String, Object>> monitorList = fmPgQueryService.queryFactoryMonitorFromRealTimeData(AT_ID,pgField);
3003 if(monitorList.size()==1){
3004 monitorMap = monitorList.get(0);
3005 if(monitorMap.get(equipMap.get("runtime").toString())!=null){
3006 map.put("runtime", monitorMap.get(equipMap.get("runtime").toString()));
3007 }else{
3008 map.put("runtime", "--");
3009 }
3010 String equipStatus = "停止";
3011 equipStatus = getStatusNew2(monitorMap,statusList,pumpId);
3012 map.put("status",equipStatus);
3013 }
3014 return map;
3015 }
3016
2971 //遍历两个年份之间的年份 3017 //遍历两个年份之间的年份
2972 private static String[] getYearsArray(String startYear, String endYear) { 3018 private static String[] getYearsArray(String startYear, String endYear) {
2973 int length = Integer.parseInt(endYear) - Integer.parseInt(startYear) + 1; 3019 int length = Integer.parseInt(endYear) - Integer.parseInt(startYear) + 1;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!