c2f21995 张雷

奥体项目实时数据增加累计流量

1 个父辈 49d66248
...@@ -12,5 +12,7 @@ public interface WhatStructDataMapper { ...@@ -12,5 +12,7 @@ public interface WhatStructDataMapper {
12 12
13 List<WhatStructData> getList(); 13 List<WhatStructData> getList();
14 14
15 List<WhatStructData> getListForUE();
16
15 WhatStructData getOneById(@Param("id") String id); 17 WhatStructData getOneById(@Param("id") String id);
16 } 18 }
......
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
6 select * from what_struct_data 6 select * from what_struct_data
7 </select> 7 </select>
8 8
9 <select id="getListForUE" resultType="com.skua.modules.business.entity.WhatStructData">
10 select * from what_struct_data where equip_type in ('flow','pressure','temperature')
11 </select>
12
9 <select id="getOneById" resultType="com.skua.modules.business.entity.WhatStructData"> 13 <select id="getOneById" resultType="com.skua.modules.business.entity.WhatStructData">
10 select * from what_struct_data where id = #{id} limit 1 14 select * from what_struct_data where id = #{id} limit 1
11 </select> 15 </select>
......
...@@ -39,6 +39,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -39,6 +39,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
39 Map<String, Object> monitorMap = new HashMap<>(); 39 Map<String, Object> monitorMap = new HashMap<>();
40 List<WhatStructData> pybList = new ArrayList<>(); 40 List<WhatStructData> pybList = new ArrayList<>();
41 List<WhatStructData> fybList = new ArrayList<>(); 41 List<WhatStructData> fybList = new ArrayList<>();
42 List<WhatStructData> ljbList = new ArrayList<>();
42 List<WhatStructData> wybList = new ArrayList<>(); 43 List<WhatStructData> wybList = new ArrayList<>();
43 List<TextResult> pList = new ArrayList<>(); 44 List<TextResult> pList = new ArrayList<>();
44 List<TextResult> fList = new ArrayList<>(); 45 List<TextResult> fList = new ArrayList<>();
...@@ -55,6 +56,8 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -55,6 +56,8 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
55 pybList.add(whatStructData); 56 pybList.add(whatStructData);
56 }else if("flow".equals(whatStructData.getEquipType())){ 57 }else if("flow".equals(whatStructData.getEquipType())){
57 fybList.add(whatStructData); 58 fybList.add(whatStructData);
59 }else if("flow_ljll".equals(whatStructData.getEquipType())){
60 ljbList.add(whatStructData);
58 }else if("temperature".equals(whatStructData.getEquipType())){ 61 }else if("temperature".equals(whatStructData.getEquipType())){
59 wybList.add(whatStructData); 62 wybList.add(whatStructData);
60 }else{ } 63 }else{ }
...@@ -73,7 +76,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -73,7 +76,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
73 if(monitorMap.get(pybList.get(i).getMonitorId())==null){ 76 if(monitorMap.get(pybList.get(i).getMonitorId())==null){
74 textResult.setValue("--"); 77 textResult.setValue("--");
75 }else{ 78 }else{
76 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/1000); 79 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/100);
77 textResult.setValue(String.valueOf(pResult)); 80 textResult.setValue(String.valueOf(pResult));
78 } 81 }
79 }else{ 82 }else{
...@@ -97,6 +100,21 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -97,6 +100,21 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
97 } 100 }
98 fList.add(j,textResult); 101 fList.add(j,textResult);
99 } 102 }
103 for (int k = 0; k < 8; k++) {
104 TextResult textResult = new TextResult();
105 if(k<ljbList.size()){
106 textResult.setTitle(ljbList.get(k).getId());
107 if(monitorMap.get(ljbList.get(k).getMonitorId())==null){
108 textResult.setValue("--");
109 }else{
110 textResult.setValue(monitorMap.get(ljbList.get(k).getMonitorId()).toString());
111 }
112 }else{
113 textResult.setTitle("flow_ljll"+(k+1));
114 textResult.setValue("--");
115 }
116 fList.add(textResult);
117 }
100 map.put("pressure",pList); 118 map.put("pressure",pList);
101 map.put("flow",fList); 119 map.put("flow",fList);
102 }else if("hot".equals(sourceType)){//压力10流量4温度4; 120 }else if("hot".equals(sourceType)){//压力10流量4温度4;
...@@ -107,7 +125,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -107,7 +125,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
107 if(monitorMap.get(pybList.get(i).getMonitorId())==null){ 125 if(monitorMap.get(pybList.get(i).getMonitorId())==null){
108 textResult.setValue("--"); 126 textResult.setValue("--");
109 }else{ 127 }else{
110 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/1000); 128 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/100);
111 textResult.setValue(String.valueOf(pResult)); 129 textResult.setValue(String.valueOf(pResult));
112 } 130 }
113 }else{ 131 }else{
...@@ -131,6 +149,21 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -131,6 +149,21 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
131 } 149 }
132 fList.add(j,textResult); 150 fList.add(j,textResult);
133 } 151 }
152 for (int h = 0; h < 4; h++) {
153 TextResult textResult = new TextResult();
154 if(h<ljbList.size()){
155 textResult.setTitle(ljbList.get(h).getId());
156 if(monitorMap.get(ljbList.get(h).getMonitorId())==null){
157 textResult.setValue("--");
158 }else{
159 textResult.setValue(monitorMap.get(ljbList.get(h).getMonitorId()).toString());
160 }
161 }else{
162 textResult.setTitle("flow_ljll"+(h+1));
163 textResult.setValue("--");
164 }
165 fList.add(textResult);
166 }
134 for (int k = 0; k < 4; k++) { 167 for (int k = 0; k < 4; k++) {
135 TextResult textResult = new TextResult(); 168 TextResult textResult = new TextResult();
136 if(k<wybList.size()){ 169 if(k<wybList.size()){
...@@ -157,7 +190,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -157,7 +190,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
157 if(monitorMap.get(pybList.get(i).getMonitorId())==null){ 190 if(monitorMap.get(pybList.get(i).getMonitorId())==null){
158 textResult.setValue("--"); 191 textResult.setValue("--");
159 }else{ 192 }else{
160 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/1000); 193 double pResult = formatDouble(Double.parseDouble(monitorMap.get(pybList.get(i).getMonitorId()).toString())/100);
161 textResult.setValue(String.valueOf(pResult)); 194 textResult.setValue(String.valueOf(pResult));
162 } 195 }
163 }else{ 196 }else{
...@@ -181,6 +214,21 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -181,6 +214,21 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
181 } 214 }
182 fList.add(j,textResult); 215 fList.add(j,textResult);
183 } 216 }
217 for (int k = 0; k < 2; k++) {
218 TextResult textResult = new TextResult();
219 if(k<ljbList.size()){
220 textResult.setTitle(ljbList.get(k).getId());
221 if(monitorMap.get(ljbList.get(k).getMonitorId())==null){
222 textResult.setValue("--");
223 }else{
224 textResult.setValue(monitorMap.get(ljbList.get(k).getMonitorId()).toString());
225 }
226 }else{
227 textResult.setTitle("flow_ljll"+(k+1));
228 textResult.setValue("--");
229 }
230 fList.add(textResult);
231 }
184 map.put("pressure",pList); 232 map.put("pressure",pList);
185 map.put("flow",fList); 233 map.put("flow",fList);
186 }else{ 234 }else{
...@@ -196,6 +244,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -196,6 +244,12 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
196 textResult.setValue("0.00"); 244 textResult.setValue("0.00");
197 fList.add(j,textResult); 245 fList.add(j,textResult);
198 } 246 }
247 for (int h = 0; h < 14; h++) {
248 TextResult textResult = new TextResult();
249 textResult.setTitle("flow_ljll"+(h+1));
250 textResult.setValue("0.00");
251 fList.add(h,textResult);
252 }
199 for (int k = 0; k < 4; k++) { 253 for (int k = 0; k < 4; k++) {
200 TextResult textResult = new TextResult(); 254 TextResult textResult = new TextResult();
201 textResult.setTitle("temperature"+(k+1)); 255 textResult.setTitle("temperature"+(k+1));
...@@ -333,7 +387,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -333,7 +387,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
333 EchartResult echartResult = new EchartResult(); 387 EchartResult echartResult = new EchartResult();
334 echartResult.setName(map.get("time").toString()); 388 echartResult.setName(map.get("time").toString());
335 if("p".equals(type)){ 389 if("p".equals(type)){
336 double pResult = formatDouble(Double.parseDouble(map.get(whatStructData.getMonitorId()).toString())/1000); 390 double pResult = formatDouble(Double.parseDouble(map.get(whatStructData.getMonitorId()).toString())/100);
337 echartResult.setValue(String.valueOf(pResult)); 391 echartResult.setValue(String.valueOf(pResult));
338 echartResult.setSeries("压力表"); 392 echartResult.setSeries("压力表");
339 }else if("f".equals(type)){ 393 }else if("f".equals(type)){
...@@ -463,7 +517,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -463,7 +517,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
463 517
464 @Override 518 @Override
465 public Map<String, Object> getRealTimeDataToUE() { 519 public Map<String, Object> getRealTimeDataToUE() {
466 List<WhatStructData> list = whatStructDataMapper.getList(); 520 List<WhatStructData> list = whatStructDataMapper.getListForUE();
467 Map<String, Object> map = new HashMap<>(); 521 Map<String, Object> map = new HashMap<>();
468 Map<String, Object> monitorMap = new HashMap<>(); 522 Map<String, Object> monitorMap = new HashMap<>();
469 String pgField = ""; 523 String pgField = "";
...@@ -476,7 +530,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { ...@@ -476,7 +530,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
476 for (WhatStructData whatStructData:list) { 530 for (WhatStructData whatStructData:list) {
477 if(whatStructData.getMonitorId()!=null){ 531 if(whatStructData.getMonitorId()!=null){
478 if("pressure".equals(whatStructData.getEquipType())){ 532 if("pressure".equals(whatStructData.getEquipType())){
479 double pResult = formatDouble(Double.parseDouble(monitorMap.get(whatStructData.getMonitorId()).toString())/1000); 533 double pResult = formatDouble(Double.parseDouble(monitorMap.get(whatStructData.getMonitorId()).toString())/100);
480 map.put(whatStructData.getId(),String.valueOf(pResult)); 534 map.put(whatStructData.getId(),String.valueOf(pResult));
481 }else{ 535 }else{
482 map.put(whatStructData.getId(),monitorMap.get(whatStructData.getMonitorId())); 536 map.put(whatStructData.getId(),monitorMap.get(whatStructData.getMonitorId()));
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!