水质监控功能开发
正在显示
7 个修改的文件
包含
270 行增加
和
142 行删除
... | @@ -308,7 +308,7 @@ public class MaterialINController { | ... | @@ -308,7 +308,7 @@ public class MaterialINController { |
308 | } | 308 | } |
309 | result.setResult(materialIN); | 309 | result.setResult(materialIN); |
310 | result.setSuccess(true); | 310 | result.setSuccess(true); |
311 | }*/ | 311 | } |
312 | return result; | 312 | return result; |
313 | } | 313 | } |
314 | 314 | ... | ... |
... | @@ -35,6 +35,10 @@ | ... | @@ -35,6 +35,10 @@ |
35 | <groupId>org.jeecgframework.boot</groupId> | 35 | <groupId>org.jeecgframework.boot</groupId> |
36 | <artifactId>sk-base-common</artifactId> | 36 | <artifactId>sk-base-common</artifactId> |
37 | </dependency> | 37 | </dependency> |
38 | <dependency> | ||
39 | <groupId>org.jeecgframework.boot</groupId> | ||
40 | <artifactId>sk-module-system</artifactId> | ||
41 | </dependency> | ||
38 | </dependencies> | 42 | </dependencies> |
39 | 43 | ||
40 | </project> | 44 | </project> | ... | ... |
... | @@ -31,6 +31,7 @@ | ... | @@ -31,6 +31,7 @@ |
31 | <orderEntry type="module" module-name="sk-base-common" /> | 31 | <orderEntry type="module" module-name="sk-base-common" /> |
32 | <orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" /> | 32 | <orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" /> |
33 | <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.1" level="project" /> | 33 | <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.1" level="project" /> |
34 | <orderEntry type="module" module-name="sk-module-system" /> | ||
34 | <orderEntry type="library" name="Maven: com.kingtroldata:core:2.0.3" level="project" /> | 35 | <orderEntry type="library" name="Maven: com.kingtroldata:core:2.0.3" level="project" /> |
35 | <orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.0.1" level="project" /> | 36 | <orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.0.1" level="project" /> |
36 | <orderEntry type="library" name="Maven: org.lz4:lz4-java:1.4.1" level="project" /> | 37 | <orderEntry type="library" name="Maven: org.lz4:lz4-java:1.4.1" level="project" /> | ... | ... |
... | @@ -9,6 +9,7 @@ import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO; | ... | @@ -9,6 +9,7 @@ import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO; |
9 | import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringVO; | 9 | import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringVO; |
10 | import com.skua.modules.dataAnalysis.vo.WaterQualityParams; | 10 | import com.skua.modules.dataAnalysis.vo.WaterQualityParams; |
11 | import io.swagger.annotations.Api; | 11 | import io.swagger.annotations.Api; |
12 | import io.swagger.annotations.ApiModelProperty; | ||
12 | import io.swagger.annotations.ApiOperation; | 13 | import io.swagger.annotations.ApiOperation; |
13 | import lombok.extern.slf4j.Slf4j; | 14 | import lombok.extern.slf4j.Slf4j; |
14 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
... | @@ -186,18 +187,32 @@ public class FactoryCenterController { | ... | @@ -186,18 +187,32 @@ public class FactoryCenterController { |
186 | 187 | ||
187 | @ApiOperation(value="水质监控实时数据查询", notes="水质监控实时数据查询") | 188 | @ApiOperation(value="水质监控实时数据查询", notes="水质监控实时数据查询") |
188 | @GetMapping(value = "/queryMonitoringData") | 189 | @GetMapping(value = "/queryMonitoringData") |
189 | public Result<List<WaterQualityMonitoringDetailVO>> queryMonitoringData(WaterQualityParams waterQualityParams) { | 190 | public Result<WaterQualityMonitoringVO> queryMonitoringData(WaterQualityParams waterQualityParams) { |
190 | Result<List<WaterQualityMonitoringDetailVO>> result = new Result<List<WaterQualityMonitoringDetailVO>>(); | 191 | Result<WaterQualityMonitoringVO> result = new Result<WaterQualityMonitoringVO>(); |
192 | int all = 0;//全部 | ||
193 | int abnormal = 0;//异常 | ||
191 | List<WaterQualityMonitoringDetailVO> list = new ArrayList<>(); | 194 | List<WaterQualityMonitoringDetailVO> list = new ArrayList<>(); |
192 | String departIds = waterQualityParams.getDepartId(); | 195 | WaterQualityMonitoringVO res = new WaterQualityMonitoringVO(); |
196 | String departIds = ""; | ||
193 | if(waterQualityParams.getDepartId()!=null){ | 197 | if(waterQualityParams.getDepartId()!=null){ |
194 | departIds = commonSqlService.getChildFactorys(waterQualityParams.getDepartId()); | 198 | departIds = commonSqlService.getChildFactorys(waterQualityParams.getDepartId()); |
195 | }else{ | 199 | }else{ |
196 | departIds = commonSqlService.getChildFactorys(BaseContextHandler.getRealDepartId()); | 200 | departIds = commonSqlService.getChildFactorys(BaseContextHandler.getRealDepartId()); |
197 | } | 201 | } |
198 | list = factoryCenterService.queryMonitoringData(departIds,waterQualityParams.getParmType()); | 202 | list = factoryCenterService.queryMonitoringData(departIds,waterQualityParams.getParmType()); |
203 | res.setList(list); | ||
204 | all = list.size(); | ||
205 | res.setAll(String.valueOf(all)); | ||
206 | for (WaterQualityMonitoringDetailVO vo:list) { | ||
207 | if("1".equals(vo.getCodAbnormal())||"1".equals(vo.getNh3Abnormal())|| | ||
208 | "1".equals(vo.getTnAbnormal())||"1".equals(vo.getTpAbnormal())||"1".equals(vo.getPhAbnormal())){ | ||
209 | abnormal++; | ||
210 | } | ||
211 | } | ||
212 | res.setNormal(String.valueOf(all-abnormal)); | ||
213 | res.setAbnormal(String.valueOf(abnormal)); | ||
199 | result.setSuccess(true); | 214 | result.setSuccess(true); |
200 | result.setResult(list); | 215 | result.setResult(res); |
201 | return result; | 216 | return result; |
202 | } | 217 | } |
203 | } | 218 | } | ... | ... |
... | @@ -14,6 +14,8 @@ import com.skua.modules.dataAnalysis.vo.StatisticsParam; | ... | @@ -14,6 +14,8 @@ import com.skua.modules.dataAnalysis.vo.StatisticsParam; |
14 | import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO; | 14 | import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO; |
15 | import com.skua.modules.system.datestandard.entity.SysMonitorMetricInfo; | 15 | import com.skua.modules.system.datestandard.entity.SysMonitorMetricInfo; |
16 | import com.skua.modules.system.datestandard.service.ISysMonitorMetricInfoService; | 16 | import com.skua.modules.system.datestandard.service.ISysMonitorMetricInfoService; |
17 | import com.skua.modules.system.entity.SysDepart; | ||
18 | import com.skua.modules.system.service.ISysDepartService; | ||
17 | import com.skua.tool.util.DateUtils; | 19 | import com.skua.tool.util.DateUtils; |
18 | import org.apache.commons.lang3.StringUtils; | 20 | import org.apache.commons.lang3.StringUtils; |
19 | import org.springframework.beans.factory.annotation.Autowired; | 21 | import org.springframework.beans.factory.annotation.Autowired; |
... | @@ -40,6 +42,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -40,6 +42,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
40 | @Autowired | 42 | @Autowired |
41 | IFactoryInfoService factoryInfoService; | 43 | IFactoryInfoService factoryInfoService; |
42 | @Autowired | 44 | @Autowired |
45 | private ISysDepartService sysDepartService; | ||
46 | @Autowired | ||
43 | private ISysMonitorMetricInfoService sysMonitorMetricInfoService; | 47 | private ISysMonitorMetricInfoService sysMonitorMetricInfoService; |
44 | 48 | ||
45 | private static DecimalFormat df = new DecimalFormat("#.##"); | 49 | private static DecimalFormat df = new DecimalFormat("#.##"); |
... | @@ -66,6 +70,14 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -66,6 +70,14 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
66 | qw.in("depart_id", departId.split(",")); | 70 | qw.in("depart_id", departId.split(",")); |
67 | qw.groupBy("depart_id","metric_uid_tag"); | 71 | qw.groupBy("depart_id","metric_uid_tag"); |
68 | List<SysMonitorMetricInfo> monitorList = sysMonitorMetricInfoService.list(qw); | 72 | List<SysMonitorMetricInfo> monitorList = sysMonitorMetricInfoService.list(qw); |
73 | Map<String,String> departMap = new HashMap<>(); | ||
74 | Map<String,String> departParentMap = new HashMap<>(); | ||
75 | List<SysDepart> departList = sysDepartService.list(); | ||
76 | for (SysDepart depart : departList ) { | ||
77 | departMap.put(depart.getId(),depart.getDepartName()); | ||
78 | departParentMap.put(depart.getId(),depart.getParentId()); | ||
79 | } | ||
80 | Map<String,Object> levelMap = getFactorysLevel(departId); | ||
69 | //获取实时指标 | 81 | //获取实时指标 |
70 | String fields = ""; | 82 | String fields = ""; |
71 | for(SysMonitorMetricInfo monitorInfo : monitorList) { | 83 | for(SysMonitorMetricInfo monitorInfo : monitorList) { |
... | @@ -84,29 +96,93 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -84,29 +96,93 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
84 | String[] departArray = departId.split(","); | 96 | String[] departArray = departId.split(","); |
85 | int sort = 0;//序号 | 97 | int sort = 0;//序号 |
86 | for(String depart : departArray) { | 98 | for(String depart : departArray) { |
99 | Map<String,Object> limitMap = new HashMap<>(); | ||
100 | if(levelMap.get(depart)!=null){ | ||
101 | List<Map<String,String>> limitList = (List<Map<String,String>>)levelMap.get(depart); | ||
102 | for (Map<String,String> lMap : limitList) { | ||
103 | limitMap.put(lMap.get("code"),lMap); | ||
104 | } | ||
105 | } | ||
87 | if(parmType != null){ | 106 | if(parmType != null){ |
88 | if("in".equals(parmType)){ | 107 | if("in".equals(parmType)){ |
89 | sort++; | 108 | sort++; |
90 | list = putInWaterDataInList(sort,list,dataMap,monitorTagMap,depart); | 109 | list = putInWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap); |
91 | }else if("out".equals(parmType)){ | 110 | }else if("out".equals(parmType)){ |
92 | sort++; | 111 | sort++; |
93 | list = putOutWaterDataInList(sort,list,dataMap,monitorTagMap,depart); | 112 | list = putOutWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap); |
94 | }else{ | 113 | }else{ |
95 | sort++; | 114 | sort++; |
96 | list = putInWaterDataInList(sort,list,dataMap,monitorTagMap,depart); | 115 | list = putInWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap); |
97 | sort++; | 116 | sort++; |
98 | list = putOutWaterDataInList(sort,list,dataMap,monitorTagMap,depart); | 117 | list = putOutWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap); |
99 | } | 118 | } |
100 | }else{ | 119 | }else{ |
101 | sort++; | 120 | sort++; |
102 | list = putInWaterDataInList(sort,list,dataMap,monitorTagMap,depart); | 121 | list = putInWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap); |
103 | sort++; | 122 | sort++; |
104 | list = putOutWaterDataInList(sort,list,dataMap,monitorTagMap,depart); | 123 | list = putOutWaterDataInList(sort,list,dataMap,monitorTagMap,depart,departMap,departParentMap,limitMap); |
105 | } | 124 | } |
106 | } | 125 | } |
107 | return list; | 126 | return list; |
108 | } | 127 | } |
109 | 128 | ||
129 | private Map<String,Object> getFactorysLevel(String departIds) { | ||
130 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); | ||
131 | Map<String,Object> resMap = new HashMap<String,Object>(); | ||
132 | String factoryInPart = ""; | ||
133 | String[] departIdsArray = departIds.split(","); | ||
134 | for(String departId : departIdsArray) { | ||
135 | factoryInPart = "'"+departId+"',"+factoryInPart; | ||
136 | } | ||
137 | factoryInPart = factoryInPart + "''"; | ||
138 | //获取进出水报警阈值 | ||
139 | String alarmSql = "SELECT aa.* FROM " + | ||
140 | " (SELECT " + | ||
141 | " a.depart_id, " + | ||
142 | " b.alarm_param_code AS index_code," + | ||
143 | " b.alarm_param_upper_limit AS upper," + | ||
144 | " b.alarm_param_lower_limit AS lower " + | ||
145 | " FROM sys_factory_info a " + | ||
146 | " LEFT JOIN alarm_param_standard_config b ON a.out_level = b.alarm_level_standard_id " + | ||
147 | " WHERE depart_id IN ( "+factoryInPart+" ) " + | ||
148 | " UNION ALL " + | ||
149 | " SELECT " + | ||
150 | " DISTINCT depart_id,index_code,upper,lower " + | ||
151 | " FROM water_quality_in_level " + | ||
152 | " WHERE depart_id IN ("+factoryInPart+")) aa " + | ||
153 | " ORDER BY aa.depart_id"; | ||
154 | List<Map<String,Object>> alarmList = masterDB.queryForList(alarmSql); | ||
155 | String depart = ""; | ||
156 | List<Map<String,String>> list = new ArrayList<>(); | ||
157 | for(Map<String,Object> map : alarmList) { | ||
158 | if(ConvertUtils.isNotEmpty(map.get("depart_id"))){ | ||
159 | Map<String,String> departMap = new HashMap<String,String>(); | ||
160 | if(depart.equals(ConvertUtils.getString(map.get("depart_id")))){ | ||
161 | String code = ConvertUtils.getString(map.get("index_code")); | ||
162 | String upper = ConvertUtils.getString(map.get("upper")); | ||
163 | String lower = ConvertUtils.getString(map.get("lower")); | ||
164 | departMap.put("code", code); | ||
165 | departMap.put("upper", upper); | ||
166 | departMap.put("lower", lower); | ||
167 | list.add(departMap); | ||
168 | }else{ | ||
169 | if(!"".equals(depart)){resMap.put(depart,list);} | ||
170 | list = new ArrayList<>(); | ||
171 | depart = ConvertUtils.getString(map.get("depart_id")); | ||
172 | String code = ConvertUtils.getString(map.get("index_code")); | ||
173 | String upper = ConvertUtils.getString(map.get("upper")); | ||
174 | String lower = ConvertUtils.getString(map.get("lower")); | ||
175 | departMap.put("code", code); | ||
176 | departMap.put("upper", upper); | ||
177 | departMap.put("lower", lower); | ||
178 | list.add(departMap); | ||
179 | } | ||
180 | } | ||
181 | } | ||
182 | resMap.put(depart,list); | ||
183 | return resMap; | ||
184 | } | ||
185 | |||
110 | /** | 186 | /** |
111 | * 进水数据 | 187 | * 进水数据 |
112 | * @param sort | 188 | * @param sort |
... | @@ -117,21 +193,39 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -117,21 +193,39 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
117 | * @return | 193 | * @return |
118 | */ | 194 | */ |
119 | private List<WaterQualityMonitoringDetailVO> putInWaterDataInList(int sort, List<WaterQualityMonitoringDetailVO> list, | 195 | private List<WaterQualityMonitoringDetailVO> putInWaterDataInList(int sort, List<WaterQualityMonitoringDetailVO> list, |
120 | Map<String, Object> dataMap, Map<String, Object> monitorTagMap, String depart) { | 196 | Map<String, Object> dataMap, Map<String, Object> monitorTagMap, |
197 | String depart,Map<String,String> departMap, | ||
198 | Map<String,String> departParentMap,Map<String,Object> limitMap) { | ||
121 | WaterQualityMonitoringDetailVO inVO = new WaterQualityMonitoringDetailVO(); | 199 | WaterQualityMonitoringDetailVO inVO = new WaterQualityMonitoringDetailVO(); |
200 | Map<String,String> codMap = (Map<String,String>)limitMap.get("JSCOD"); | ||
201 | Map<String,String> nh3nMap = (Map<String,String>)limitMap.get("JSNH3N"); | ||
202 | Map<String,String> tnMap = (Map<String,String>)limitMap.get("JSTN"); | ||
203 | Map<String,String> tpMap = (Map<String,String>)limitMap.get("JSTP"); | ||
204 | Map<String,String> phMap = (Map<String,String>)limitMap.get("JSPH"); | ||
122 | inVO.setParmType("in"); | 205 | inVO.setParmType("in"); |
123 | inVO.setNum(sort); | 206 | inVO.setNum(sort); |
124 | inVO.setDepartId(depart); | 207 | inVO.setDepartId(depart); |
125 | inVO.setCodUpper("150"); | 208 | inVO.setDepartName(departMap.get(depart)); |
126 | inVO.setCodLower("0"); | 209 | if(departParentMap.get(depart)!=null){ |
127 | inVO.setNh3Upper("35"); | 210 | String parentId = departParentMap.get(depart); |
128 | inVO.setNh3Lower("0"); | 211 | inVO.setParentId(parentId); |
129 | inVO.setTpUpper("4"); | 212 | inVO.setParentName(departMap.get(parentId)); |
130 | inVO.setTpLower("0"); | 213 | } |
131 | inVO.setTnUpper("20"); | 214 | inVO.setCodUpper(codMap.getOrDefault("upper","0")); |
132 | inVO.setTnLower("0"); | 215 | inVO.setCodLower(codMap.getOrDefault("lower","0")); |
133 | inVO.setPhUpper("14"); | 216 | inVO.setCodAbnormal("0"); |
134 | inVO.setPhLower("0"); | 217 | inVO.setNh3Upper(nh3nMap.getOrDefault("upper","0")); |
218 | inVO.setNh3Lower(nh3nMap.getOrDefault("lower","0")); | ||
219 | inVO.setNh3Abnormal("0"); | ||
220 | inVO.setTpUpper(tpMap.getOrDefault("upper","0")); | ||
221 | inVO.setTpLower(tpMap.getOrDefault("lower","0")); | ||
222 | inVO.setTpAbnormal("0"); | ||
223 | inVO.setTnUpper(tnMap.getOrDefault("upper","0")); | ||
224 | inVO.setTnLower(tnMap.getOrDefault("lower","0")); | ||
225 | inVO.setTnAbnormal("0"); | ||
226 | inVO.setPhUpper(phMap.getOrDefault("upper","0")); | ||
227 | inVO.setPhLower(phMap.getOrDefault("lower","0")); | ||
228 | inVO.setPhAbnormal("0"); | ||
135 | inVO.setCodVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSCOD")); | 229 | inVO.setCodVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSCOD")); |
136 | inVO.setNh3Val(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSNH3N")); | 230 | inVO.setNh3Val(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSNH3N")); |
137 | inVO.setTpVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSTP")); | 231 | inVO.setTpVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSTP")); |
... | @@ -140,6 +234,7 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -140,6 +234,7 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
140 | inVO.setSsllVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSLL")); | 234 | inVO.setSsllVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSLL")); |
141 | inVO.setLjllVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSLJLL")); | 235 | inVO.setLjllVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSLJLL")); |
142 | inVO.setZdVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSSS")); | 236 | inVO.setZdVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"JSSS")); |
237 | inVO = updateDataStatus(inVO); | ||
143 | list.add(inVO); | 238 | list.add(inVO); |
144 | return list; | 239 | return list; |
145 | } | 240 | } |
... | @@ -154,21 +249,39 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -154,21 +249,39 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
154 | * @return | 249 | * @return |
155 | */ | 250 | */ |
156 | private List<WaterQualityMonitoringDetailVO> putOutWaterDataInList(int sort, List<WaterQualityMonitoringDetailVO> list, | 251 | private List<WaterQualityMonitoringDetailVO> putOutWaterDataInList(int sort, List<WaterQualityMonitoringDetailVO> list, |
157 | Map<String, Object> dataMap, Map<String, Object> monitorTagMap, String depart) { | 252 | Map<String, Object> dataMap, Map<String, Object> monitorTagMap, |
253 | String depart,Map<String,String> departMap, | ||
254 | Map<String,String> departParentMap,Map<String,Object> limitMap) { | ||
158 | WaterQualityMonitoringDetailVO outVO = new WaterQualityMonitoringDetailVO(); | 255 | WaterQualityMonitoringDetailVO outVO = new WaterQualityMonitoringDetailVO(); |
256 | Map<String,String> codMap = (Map<String,String>)limitMap.get("CSCOD"); | ||
257 | Map<String,String> nh3nMap = (Map<String,String>)limitMap.get("CSNH3N"); | ||
258 | Map<String,String> tnMap = (Map<String,String>)limitMap.get("CSTN"); | ||
259 | Map<String,String> tpMap = (Map<String,String>)limitMap.get("CSTP"); | ||
260 | Map<String,String> phMap = (Map<String,String>)limitMap.get("CSPH"); | ||
159 | outVO.setParmType("out"); | 261 | outVO.setParmType("out"); |
160 | outVO.setNum(sort++); | 262 | outVO.setNum(sort++); |
161 | outVO.setDepartId(depart); | 263 | outVO.setDepartId(depart); |
162 | outVO.setCodUpper("30"); | 264 | outVO.setDepartName(departMap.get(depart)); |
163 | outVO.setCodLower("0"); | 265 | if(departParentMap.get(depart)!=null){ |
164 | outVO.setNh3Upper("1.5"); | 266 | String parentId = departParentMap.get(depart); |
165 | outVO.setNh3Lower("0"); | 267 | outVO.setParentId(parentId); |
166 | outVO.setTpUpper("0.3"); | 268 | outVO.setParentName(departMap.get(parentId)); |
167 | outVO.setTpLower("0"); | 269 | } |
168 | outVO.setTnUpper("10"); | 270 | outVO.setCodUpper(codMap.getOrDefault("upper","0")); |
169 | outVO.setTnLower("0"); | 271 | outVO.setCodLower(codMap.getOrDefault("lower","0")); |
170 | outVO.setPhUpper("9"); | 272 | outVO.setCodAbnormal("0"); |
171 | outVO.setPhLower("6"); | 273 | outVO.setNh3Upper(nh3nMap.getOrDefault("upper","0")); |
274 | outVO.setNh3Lower(nh3nMap.getOrDefault("lower","0")); | ||
275 | outVO.setNh3Abnormal("0"); | ||
276 | outVO.setTpUpper(tpMap.getOrDefault("upper","0")); | ||
277 | outVO.setTpLower(tpMap.getOrDefault("lower","0")); | ||
278 | outVO.setTpAbnormal("0"); | ||
279 | outVO.setTnUpper(tnMap.getOrDefault("upper","0")); | ||
280 | outVO.setTnLower(tnMap.getOrDefault("lower","0")); | ||
281 | outVO.setTnAbnormal("0"); | ||
282 | outVO.setPhUpper(phMap.getOrDefault("upper","0")); | ||
283 | outVO.setPhLower(phMap.getOrDefault("lower","0")); | ||
284 | outVO.setPhAbnormal("0"); | ||
172 | outVO.setCodVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSCOD")); | 285 | outVO.setCodVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSCOD")); |
173 | outVO.setNh3Val(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSNH3N")); | 286 | outVO.setNh3Val(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSNH3N")); |
174 | outVO.setTpVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSTP")); | 287 | outVO.setTpVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSTP")); |
... | @@ -177,10 +290,35 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -177,10 +290,35 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
177 | outVO.setSsllVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSLL")); | 290 | outVO.setSsllVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSLL")); |
178 | outVO.setLjllVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSLJLL")); | 291 | outVO.setLjllVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSLJLL")); |
179 | outVO.setZdVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSSS")); | 292 | outVO.setZdVal(getValueFromDataMap(dataMap,monitorTagMap,depart,"CSSS")); |
293 | outVO = updateDataStatus(outVO); | ||
180 | list.add(outVO); | 294 | list.add(outVO); |
181 | return list; | 295 | return list; |
182 | } | 296 | } |
183 | 297 | ||
298 | private WaterQualityMonitoringDetailVO updateDataStatus(WaterQualityMonitoringDetailVO waterQualityMonitoringDetailVO) { | ||
299 | if(Double.parseDouble(waterQualityMonitoringDetailVO.getCodVal()) > Double.parseDouble(waterQualityMonitoringDetailVO.getCodUpper())|| | ||
300 | Double.parseDouble(waterQualityMonitoringDetailVO.getCodVal()) < Double.parseDouble(waterQualityMonitoringDetailVO.getCodLower())){ | ||
301 | waterQualityMonitoringDetailVO.setCodAbnormal("1"); | ||
302 | } | ||
303 | if(Double.parseDouble(waterQualityMonitoringDetailVO.getNh3Val()) > Double.parseDouble(waterQualityMonitoringDetailVO.getNh3Upper())|| | ||
304 | Double.parseDouble(waterQualityMonitoringDetailVO.getNh3Val()) < Double.parseDouble(waterQualityMonitoringDetailVO.getNh3Lower())){ | ||
305 | waterQualityMonitoringDetailVO.setNh3Abnormal("1"); | ||
306 | } | ||
307 | if(Double.parseDouble(waterQualityMonitoringDetailVO.getTnVal()) > Double.parseDouble(waterQualityMonitoringDetailVO.getTnUpper())|| | ||
308 | Double.parseDouble(waterQualityMonitoringDetailVO.getTnVal()) < Double.parseDouble(waterQualityMonitoringDetailVO.getTnLower())){ | ||
309 | waterQualityMonitoringDetailVO.setTnAbnormal("1"); | ||
310 | } | ||
311 | if(Double.parseDouble(waterQualityMonitoringDetailVO.getTpVal()) > Double.parseDouble(waterQualityMonitoringDetailVO.getTpUpper())|| | ||
312 | Double.parseDouble(waterQualityMonitoringDetailVO.getTpVal()) < Double.parseDouble(waterQualityMonitoringDetailVO.getTpLower())){ | ||
313 | waterQualityMonitoringDetailVO.setTpAbnormal("1"); | ||
314 | } | ||
315 | if(Double.parseDouble(waterQualityMonitoringDetailVO.getPhVal()) > Double.parseDouble(waterQualityMonitoringDetailVO.getPhUpper())|| | ||
316 | Double.parseDouble(waterQualityMonitoringDetailVO.getPhVal()) < Double.parseDouble(waterQualityMonitoringDetailVO.getPhLower())){ | ||
317 | waterQualityMonitoringDetailVO.setPhAbnormal("1"); | ||
318 | } | ||
319 | return waterQualityMonitoringDetailVO; | ||
320 | } | ||
321 | |||
184 | /** | 322 | /** |
185 | * 获取数据值 | 323 | * 获取数据值 |
186 | * @param dataMap | 324 | * @param dataMap | ... | ... |
... | @@ -15,92 +15,77 @@ public class WaterQualityMonitoringDetailVO { | ... | @@ -15,92 +15,77 @@ public class WaterQualityMonitoringDetailVO { |
15 | 15 | ||
16 | @ApiModelProperty(value = "进出水类型") | 16 | @ApiModelProperty(value = "进出水类型") |
17 | private Integer num; | 17 | private Integer num; |
18 | /** | 18 | |
19 | * 进出水类型 | ||
20 | */ | ||
21 | @ApiModelProperty(value = "进出水类型") | 19 | @ApiModelProperty(value = "进出水类型") |
22 | private String parmType; | 20 | private String parmType; |
23 | /** | 21 | |
24 | * 厂id | 22 | @ApiModelProperty(value = "上级ID") |
25 | */ | 23 | private String parentId; |
24 | |||
25 | @ApiModelProperty(value = "上级名称") | ||
26 | private String parentName; | ||
27 | |||
26 | @ApiModelProperty(value = "厂id") | 28 | @ApiModelProperty(value = "厂id") |
27 | private String departId; | 29 | private String departId; |
28 | /** | 30 | |
29 | * 厂站名称 | ||
30 | */ | ||
31 | @ApiModelProperty(value = "厂站名称") | 31 | @ApiModelProperty(value = "厂站名称") |
32 | private String departName; | 32 | private String departName; |
33 | @ApiModelProperty(value = "厂区排序") | 33 | // @ApiModelProperty(value = "厂区排序") |
34 | private int departOrder; | 34 | // private int departOrder; |
35 | // | ||
36 | // @ApiModelProperty(value = "厂区负责人") | ||
37 | // private String proPerson; | ||
38 | // | ||
39 | // @ApiModelProperty(value = "厂区负责人电话") | ||
40 | // private String proPhone; | ||
35 | 41 | ||
36 | @ApiModelProperty(value = "厂区负责人") | ||
37 | private String proPerson; | ||
38 | |||
39 | @ApiModelProperty(value = "厂区负责人电话") | ||
40 | private String proPhone; | ||
41 | /** | ||
42 | * 监测时间 | ||
43 | */ | ||
44 | @ApiModelProperty(value = "监测时间") | 42 | @ApiModelProperty(value = "监测时间") |
45 | private String monitorTime; | 43 | private String monitorTime; |
46 | /** | 44 | |
47 | * 流量 | 45 | // @ApiModelProperty(value = "流量") |
48 | */ | 46 | // private String flowVal; |
49 | @ApiModelProperty(value = "流量") | 47 | // private String flowUpper; |
50 | private String flowVal; | 48 | // private String flowLower; |
51 | private String flowUpper; | 49 | // private String flowAbnormal; |
52 | private String flowLower; | 50 | |
53 | private String flowAbnormal; | ||
54 | /** | ||
55 | * cod | ||
56 | */ | ||
57 | @ApiModelProperty(value = "cod") | 51 | @ApiModelProperty(value = "cod") |
58 | private String codVal; | 52 | private String codVal; |
59 | private String codUpper; | 53 | private String codUpper; |
60 | private String codLower; | 54 | private String codLower; |
61 | private String codAbnormal; | 55 | private String codAbnormal; |
62 | private String codWarnMessage;//预警 | 56 | // private String codWarnMessage;//预警 |
63 | /** | 57 | |
64 | * 氨氮 | ||
65 | */ | ||
66 | @ApiModelProperty(value = "氨氮") | 58 | @ApiModelProperty(value = "氨氮") |
67 | private String nh3Val; | 59 | private String nh3Val; |
68 | private String nh3Upper; | 60 | private String nh3Upper; |
69 | private String nh3Lower; | 61 | private String nh3Lower; |
70 | private String nh3Abnormal; | 62 | private String nh3Abnormal; |
71 | private String nh3WarnMessage; | 63 | // private String nh3WarnMessage; |
72 | /** | 64 | |
73 | * 总磷 | ||
74 | */ | ||
75 | @ApiModelProperty(value = "总磷") | 65 | @ApiModelProperty(value = "总磷") |
76 | private String tpVal; | 66 | private String tpVal; |
77 | private String tpUpper; | 67 | private String tpUpper; |
78 | private String tpLower; | 68 | private String tpLower; |
79 | private String tpAbnormal; | 69 | private String tpAbnormal; |
80 | private String tpWarnMessage; | 70 | // private String tpWarnMessage; |
81 | /** | 71 | |
82 | * 总氮 | ||
83 | */ | ||
84 | @ApiModelProperty(value = "总氮") | 72 | @ApiModelProperty(value = "总氮") |
85 | private String tnVal; | 73 | private String tnVal; |
86 | private String tnUpper; | 74 | private String tnUpper; |
87 | private String tnLower; | 75 | private String tnLower; |
88 | private String tnAbnormal; | 76 | private String tnAbnormal; |
89 | private String tnWarnMessage; | 77 | // private String tnWarnMessage; |
90 | /** | 78 | |
91 | * 温度 | 79 | // @ApiModelProperty(value = "温度") |
92 | */ | 80 | // private String temperatureVal; |
93 | @ApiModelProperty(value = "温度") | 81 | // private String temperatureWarnMessage; |
94 | private String temperatureVal; | 82 | |
95 | private String temperatureWarnMessage; | ||
96 | /** | ||
97 | * ph | ||
98 | */ | ||
99 | @ApiModelProperty(value = "ph") | 83 | @ApiModelProperty(value = "ph") |
100 | private String phVal; | 84 | private String phVal; |
101 | private String phUpper; | 85 | private String phUpper; |
102 | private String phLower; | 86 | private String phLower; |
103 | private String phAbnormal; | 87 | private String phAbnormal; |
88 | // private String phWarnMessage; | ||
104 | 89 | ||
105 | @ApiModelProperty(value = "浊度") | 90 | @ApiModelProperty(value = "浊度") |
106 | private String zdVal; | 91 | private String zdVal; |
... | @@ -110,55 +95,40 @@ public class WaterQualityMonitoringDetailVO { | ... | @@ -110,55 +95,40 @@ public class WaterQualityMonitoringDetailVO { |
110 | @ApiModelProperty(value = "累计流量") | 95 | @ApiModelProperty(value = "累计流量") |
111 | private String ljllVal; | 96 | private String ljllVal; |
112 | 97 | ||
98 | // @ApiModelProperty(value = "摄像头") | ||
99 | // private String cameraVal; | ||
100 | // | ||
101 | // @ApiModelProperty(value = "出水标准") | ||
102 | // private String outLevel; | ||
103 | // | ||
104 | // //是否水质正常 | ||
105 | // private String isHaveNormal; | ||
106 | // | ||
107 | // //是否水质超标 | ||
108 | // private String isHaveAbnormal; | ||
109 | // | ||
110 | // //超标指标个数 | ||
111 | // private int abnormalCount; | ||
112 | // | ||
113 | // //指标未配置 | ||
114 | // private int notConfiguredCount; | ||
115 | // | ||
116 | // //厂站指标没有配置标记 | ||
117 | // private String isNotHaveConfigured; | ||
118 | // | ||
119 | // //是否含有0值 | ||
120 | // private String isHaveZero; | ||
121 | // | ||
122 | // //是否脱机 | ||
123 | // private String isHaveOffline; | ||
124 | // | ||
125 | // //是否预警 | ||
126 | // private String isHaveWarn; | ||
127 | // | ||
128 | // //预警个数 | ||
129 | // private int abWarnCount; | ||
130 | // | ||
131 | // //离线数量 | ||
132 | // private int offLineCount; | ||
113 | 133 | ||
114 | |||
115 | /** | ||
116 | * 摄像头 | ||
117 | */ | ||
118 | @ApiModelProperty(value = "摄像头") | ||
119 | private String cameraVal; | ||
120 | /** | ||
121 | * 出水标准 | ||
122 | */ | ||
123 | @ApiModelProperty(value = "出水标准") | ||
124 | private String outLevel; | ||
125 | |||
126 | /** | ||
127 | * 是否水质正常 | ||
128 | */ | ||
129 | private String isHaveNormal; | ||
130 | /** | ||
131 | * 是否水质超标 | ||
132 | */ | ||
133 | private String isHaveAbnormal; | ||
134 | /** | ||
135 | * 超标指标个数 | ||
136 | */ | ||
137 | private int abnormalCount; | ||
138 | /** | ||
139 | * 指标未配置 | ||
140 | */ | ||
141 | private int notConfiguredCount; | ||
142 | /** | ||
143 | * 厂站指标没有配置标记 | ||
144 | */ | ||
145 | private String isNotHaveConfigured; | ||
146 | /** | ||
147 | * 是否含有0值 | ||
148 | */ | ||
149 | private String isHaveZero; | ||
150 | /** | ||
151 | * 是否脱机 | ||
152 | */ | ||
153 | private String isHaveOffline; | ||
154 | /** | ||
155 | * 是否预警 | ||
156 | */ | ||
157 | private String isHaveWarn; | ||
158 | /** | ||
159 | * 预警个数 | ||
160 | */ | ||
161 | private int abWarnCount; | ||
162 | |||
163 | private int offLineCount; | ||
164 | } | 134 | } | ... | ... |
... | @@ -11,16 +11,16 @@ import java.util.List; | ... | @@ -11,16 +11,16 @@ import java.util.List; |
11 | public class WaterQualityMonitoringVO { | 11 | public class WaterQualityMonitoringVO { |
12 | @ApiModelProperty(value = "总数") | 12 | @ApiModelProperty(value = "总数") |
13 | private String all;//全部 | 13 | private String all;//全部 |
14 | @ApiModelProperty(value = "在线") | 14 | @ApiModelProperty(value = "正常") |
15 | private String normal;//正常 | 15 | private String normal;//正常 |
16 | @ApiModelProperty(value = "异常") | 16 | @ApiModelProperty(value = "异常") |
17 | private String abnormal;//异常 | 17 | private String abnormal;//异常 |
18 | @ApiModelProperty(value = "脱机") | 18 | // @ApiModelProperty(value = "脱机") |
19 | private String offline;//脱机 | 19 | // private String offline;//脱机 |
20 | @ApiModelProperty(value = "零值") | 20 | // @ApiModelProperty(value = "零值") |
21 | private String zeroVal;//零值 | 21 | // private String zeroVal;//零值 |
22 | @ApiModelProperty(value = "预警") | 22 | // @ApiModelProperty(value = "预警") |
23 | private String warnVal;//零值 | 23 | // private String warnVal;//零值 |
24 | @ApiModelProperty(value = "水质监控明细") | 24 | @ApiModelProperty(value = "水质监控明细") |
25 | private List<WaterQualityMonitoringDetailVO> list;//明细 | 25 | private List<WaterQualityMonitoringDetailVO> list;//明细 |
26 | } | 26 | } | ... | ... |
-
请 注册 或 登录 后发表评论