奥体项目实时数据接口开发
正在显示
7 个修改的文件
包含
77 行增加
和
6 行删除
... | @@ -39,6 +39,16 @@ public class OlympicCenterController { | ... | @@ -39,6 +39,16 @@ public class OlympicCenterController { |
39 | return result; | 39 | return result; |
40 | } | 40 | } |
41 | 41 | ||
42 | @ApiOperation(value="获取整体实时数据给UE", notes="获取整体实时数据给UE") | ||
43 | @GetMapping(value = "/getRealTimeDataToUE") | ||
44 | public Result<Map<String,Object>> getRealTimeDataToUE(){ | ||
45 | Result<Map<String,Object>> result = new Result<Map<String,Object>>(); | ||
46 | Map<String,Object> map = olympicCenterService.getRealTimeDataToUE(); | ||
47 | result.setResult(map); | ||
48 | result.setSuccess(true); | ||
49 | return result; | ||
50 | } | ||
51 | |||
42 | /** | 52 | /** |
43 | * 获取泵站指标历史趋势曲线 | 53 | * 获取泵站指标历史趋势曲线 |
44 | * @param field ssll:瞬时流量 ljll:累计流量 rll:日流量 | 54 | * @param field ssll:瞬时流量 ljll:累计流量 rll:日流量 | ... | ... |
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | <mapper namespace="com.skua.modules.business.mapper.WhatStructDataMapper"> | ||
4 | |||
5 | <select id="getList" resultType="com.skua.modules.business.entity.WhatStructData"> | ||
6 | select * from what_struct_data | ||
7 | </select> | ||
8 | |||
9 | </mapper> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -19,4 +19,6 @@ public interface IOlympicCenterService { | ... | @@ -19,4 +19,6 @@ public interface IOlympicCenterService { |
19 | List<EchartResult> getPressureChart(String equipId,String type); | 19 | List<EchartResult> getPressureChart(String equipId,String type); |
20 | 20 | ||
21 | Map<String, Object> getBzRealTimeData(String sourceType); | 21 | Map<String, Object> getBzRealTimeData(String sourceType); |
22 | |||
23 | Map<String, Object> getRealTimeDataToUE(); | ||
22 | } | 24 | } | ... | ... |
1 | package com.skua.modules.business.service.impl; | 1 | package com.skua.modules.business.service.impl; |
2 | 2 | ||
3 | import com.skua.core.service.IPgQueryService; | 3 | import com.skua.core.service.IPgQueryService; |
4 | import com.skua.modules.business.entity.WhatStructData; | ||
5 | import com.skua.modules.business.mapper.WhatStructDataMapper; | ||
4 | import com.skua.modules.business.service.IOlympicCenterService; | 6 | import com.skua.modules.business.service.IOlympicCenterService; |
5 | import com.skua.modules.business.vo.EchartResult; | 7 | import com.skua.modules.business.vo.EchartResult; |
6 | import com.skua.modules.business.vo.TextResult; | 8 | import com.skua.modules.business.vo.TextResult; |
9 | import com.skua.modules.equip.mapper.FmEquipInfoMapper; | ||
7 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
8 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
9 | 12 | ||
... | @@ -18,6 +21,8 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -18,6 +21,8 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
18 | 21 | ||
19 | // @Autowired | 22 | // @Autowired |
20 | // private IPgQueryService pgQueryService; | 23 | // private IPgQueryService pgQueryService; |
24 | @Autowired | ||
25 | private WhatStructDataMapper whatStructDataMapper; | ||
21 | 26 | ||
22 | @Override | 27 | @Override |
23 | public Map<String,Object> getRealTimeData(String sourceType) { | 28 | public Map<String,Object> getRealTimeData(String sourceType) { |
... | @@ -35,7 +40,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -35,7 +40,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
35 | TextResult textResult = new TextResult(); | 40 | TextResult textResult = new TextResult(); |
36 | textResult.setTitle("压力表"+(i+1)); | 41 | textResult.setTitle("压力表"+(i+1)); |
37 | if(i==8){ | 42 | if(i==8){ |
38 | textResult.setValue("0.41"); | 43 | textResult.setValue("0.04"); |
39 | }else{ | 44 | }else{ |
40 | textResult.setValue("0.00"); | 45 | textResult.setValue("0.00"); |
41 | } | 46 | } |
... | @@ -91,7 +96,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -91,7 +96,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
91 | TextResult textResult = new TextResult(); | 96 | TextResult textResult = new TextResult(); |
92 | textResult.setTitle("压力表"+(i+1)); | 97 | textResult.setTitle("压力表"+(i+1)); |
93 | if(i==8){ | 98 | if(i==8){ |
94 | textResult.setValue("0.41"); | 99 | textResult.setValue("0.041"); |
95 | }else{ | 100 | }else{ |
96 | textResult.setValue("0.00"); | 101 | textResult.setValue("0.00"); |
97 | } | 102 | } |
... | @@ -258,6 +263,38 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -258,6 +263,38 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
258 | return map; | 263 | return map; |
259 | } | 264 | } |
260 | 265 | ||
266 | @Override | ||
267 | public Map<String, Object> getRealTimeDataToUE() { | ||
268 | List<WhatStructData> list = whatStructDataMapper.getList(); | ||
269 | Map<String, Object> map = new HashMap<>(); | ||
270 | List<WhatStructData> pAtList = new ArrayList<>(); | ||
271 | List<WhatStructData> fAtList = new ArrayList<>(); | ||
272 | List<WhatStructData> wAtList = new ArrayList<>(); | ||
273 | for (WhatStructData whatStructData:list) { | ||
274 | if("pressure".equals(whatStructData.getEquipType())){ | ||
275 | pAtList.add(whatStructData); | ||
276 | }else if("flow".equals(whatStructData.getEquipType())){ | ||
277 | fAtList.add(whatStructData); | ||
278 | }else if("temperature".equals(whatStructData.getEquipType())){ | ||
279 | wAtList.add(whatStructData); | ||
280 | }else{ } | ||
281 | } | ||
282 | for (int i = 0; i < pAtList.size(); i++) { | ||
283 | if("205".equals(pAtList.get(i).getId())){ | ||
284 | map.put(pAtList.get(i).getId(),"0.04"); | ||
285 | }else{ | ||
286 | map.put(pAtList.get(i).getId(),"0.00"); | ||
287 | } | ||
288 | } | ||
289 | for (int j = 0; j < fAtList.size(); j++) { | ||
290 | map.put(fAtList.get(j).getId(),"0.00"); | ||
291 | } | ||
292 | for (int k = 0; k < wAtList.size(); k++) { | ||
293 | map.put(wAtList.get(k).getId(),"--"); | ||
294 | } | ||
295 | return map; | ||
296 | } | ||
297 | |||
261 | public static void main(String[] args) { | 298 | public static void main(String[] args) { |
262 | for (int i = 0; i < 24; i++) { | 299 | for (int i = 0; i < 24; i++) { |
263 | Calendar date = Calendar.getInstance(); | 300 | Calendar date = Calendar.getInstance(); | ... | ... |
... | @@ -98,9 +98,9 @@ spring: | ... | @@ -98,9 +98,9 @@ spring: |
98 | driver-class-name: com.mysql.jdbc.Driver | 98 | driver-class-name: com.mysql.jdbc.Driver |
99 | # 多数据源配置 | 99 | # 多数据源配置 |
100 | pg-db: | 100 | pg-db: |
101 | url: jdbc:postgresql://120.24.205.69:10086/postgres?useUnicode=true&characterEncoding=UTF8 | 101 | url: jdbc:postgresql://47.104.99.86:10086/postgres?useUnicode=true&characterEncoding=UTF8 |
102 | username: postgres | 102 | username: postgres |
103 | password: Sever@3202_Jksc$ | 103 | password: JKjnf9713xt |
104 | driver-class-name: org.postgresql.Driver | 104 | driver-class-name: org.postgresql.Driver |
105 | #redis 配置 | 105 | #redis 配置 |
106 | redis: | 106 | redis: | ... | ... |
... | @@ -98,8 +98,8 @@ spring: | ... | @@ -98,8 +98,8 @@ spring: |
98 | driver-class-name: com.mysql.jdbc.Driver | 98 | driver-class-name: com.mysql.jdbc.Driver |
99 | # 多数据源配置 | 99 | # 多数据源配置 |
100 | pg-db: | 100 | pg-db: |
101 | url: jdbc:mysql://192.168.21.6:13306/zhsw_modules?characterEncoding=UTF-8&useUnicode=true&useSSL=false | 101 | url: jdbc:postgresql://192.168.21.5:10086/postgres?useUnicode=true&characterEncoding=UTF8 |
102 | username: root | 102 | username: postgres |
103 | password: jkauto@123wh | 103 | password: jkauto@123wh |
104 | driver-class-name: org.postgresql.Driver | 104 | driver-class-name: org.postgresql.Driver |
105 | #redis 配置 | 105 | #redis 配置 | ... | ... |
-
请 注册 或 登录 后发表评论