change - 传感器汇总数据不显示问题处理

main
wenjy 2 years ago
parent d983773edd
commit e6c8416705

@ -91,7 +91,7 @@ public class IndexController {
baseMonitorunitInfoDtoList.stream() baseMonitorunitInfoDtoList.stream()
.filter( .filter(
y -> y ->
!y.getParentId().isEmpty() y.getParentId()!=null
&& y.getMonitorunitType().equals(x.getMonitorunittypeId())) && y.getMonitorunitType().equals(x.getMonitorunittypeId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
BaseMonitorunitInfoDto info = new BaseMonitorunitInfoDto(); BaseMonitorunitInfoDto info = new BaseMonitorunitInfoDto();
@ -396,6 +396,9 @@ public class IndexController {
@GetMapping("/quantityStatistics") @GetMapping("/quantityStatistics")
@ResponseBody @ResponseBody
public String quantityStatistics() { public String quantityStatistics() {
List<Integer> result = new ArrayList<>();
try {
List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>(); List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>();
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtoList = new ArrayList<BaseMonitorunitInfoDto>(); List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtoList = new ArrayList<BaseMonitorunitInfoDto>();
@ -429,17 +432,21 @@ public class IndexController {
baseMonitorunitInfoDtoList.addAll(baseMonitorunitInfoDtos); baseMonitorunitInfoDtoList.addAll(baseMonitorunitInfoDtos);
} }
List<Integer> result = result =
new ArrayList<Integer>() { new ArrayList<Integer>() {
{ {
this.add(baseSensorInfoDtos.size()); this.add(baseSensorInfoDtos.size());
this.add( this.add(
baseMonitorunitInfoDtoList.stream() baseMonitorunitInfoDtoList.stream()
.filter(x -> !x.getParentId().isEmpty() && x.getEnableFlag() == 0L) .filter(x -> x.getParentId() != null && x.getEnableFlag() == 0L)
.collect(Collectors.toList()) .collect(Collectors.toList())
.size()); .size());
} }
}; };
}catch (Exception ex) {
System.out.println(ex.getMessage());
}
return JSONArray.toJSONString(result); return JSONArray.toJSONString(result);
} }
@ -454,6 +461,7 @@ public class IndexController {
@ResponseBody @ResponseBody
public String getAlarmAmount() { public String getAlarmAmount() {
List<String> info = new ArrayList<>(); List<String> info = new ArrayList<>();
try{
List<RecordAlarm> recordAlarms = new ArrayList<>(); List<RecordAlarm> recordAlarms = new ArrayList<>();
SysUser sysUser = ShiroUtils.getSysUser(); SysUser sysUser = ShiroUtils.getSysUser();
@ -479,6 +487,9 @@ public class IndexController {
info.add("--"); info.add("--");
info.add("--"); info.add("--");
} }
}catch (Exception ex) {
System.out.println(ex.getMessage());
}
return JSONArray.toJSONString(info); return JSONArray.toJSONString(info);
} }

@ -99,6 +99,7 @@ public class SensorSummaryController extends BaseController {
baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(sensorTypeId, 0L));*/ baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(sensorTypeId, 0L));*/
for (BaseSensorInfoDto x : baseSensorInfoDtos) { for (BaseSensorInfoDto x : baseSensorInfoDtos) {
try{
Map<String, Object> info = new HashMap<>(); Map<String, Object> info = new HashMap<>();
Object jrm = redisTemplate.opsForHash().get(x.getSensorType(), x.getSensorId()); Object jrm = redisTemplate.opsForHash().get(x.getSensorType(), x.getSensorId());
if (jrm != null) { if (jrm != null) {
@ -140,6 +141,9 @@ public class SensorSummaryController extends BaseController {
info.put("sensorType", baseSensorTypeList.get(0).getSensortypeName()); info.put("sensorType", baseSensorTypeList.get(0).getSensortypeName());
result.add(info); result.add(info);
}catch (Exception ex) {
System.out.println("异常:"+ex.getMessage());
}
} }
String s = JSONArray.toJSONString(result); String s = JSONArray.toJSONString(result);

@ -9,9 +9,9 @@ spring:
url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: Haiwei123456 password: Haiwei123456
# url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://47.122.6.3:6001/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&failOverReadOnly=false
# username: root # username: root
# password: root # password: jrmRoot
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

@ -71,16 +71,16 @@ spring:
enabled: true enabled: true
#Redis配置 #Redis配置
redis: redis:
port: 6379
password: admin123
host: 121.36.58.109 host: 121.36.58.109
port: 6379
password:
timeout: 12000ms
jedis: jedis:
pool: pool:
max-active: 8 max-active: 300
max-wait: -1ms max-wait: -1ms
max-idle: 8 max-idle: 8
min-idle: 0 min-idle: 0
timeout: 5000ms
# MyBatis # MyBatis
mybatis: mybatis:

@ -2,7 +2,8 @@ $(document).ready(function () {
//$.cookie('userID', '0001'); //$.cookie('userID', '0001');
var wsImpl = window.WebSocket || window.MozWebSocket; var wsImpl = window.WebSocket || window.MozWebSocket;
console.log("connecting to server .."); console.log("connecting to server ..");
window.ws = new wsImpl('ws://121.36.58.109:7181'); //window.ws = new wsImpl('ws://121.36.58.109:7181');
window.ws = new wsImpl('ws://47.122.6.3:7181');
ws.onmessage = function (evt) { ws.onmessage = function (evt) {
let result = $.parseJSON(evt.data); let result = $.parseJSON(evt.data);
}; };

@ -579,7 +579,8 @@
$.cookie('userID', '0000'); $.cookie('userID', '0000');
var wsImpl = window.WebSocket || window.MozWebSocket; var wsImpl = window.WebSocket || window.MozWebSocket;
console.log("connecting to server .."); console.log("connecting to server ..");
window.ws = new wsImpl('ws://121.36.58.109:7181'); //window.ws = new wsImpl('ws://121.36.58.109:7181');
window.ws = new wsImpl('ws://47.122.6.3:7181');
ws.onmessage = function (evt) { ws.onmessage = function (evt) {
let result = $.parseJSON(evt.data); let result = $.parseJSON(evt.data);
console.log(result); console.log(result);

@ -178,7 +178,6 @@
var roleSort = $("input[name='roleSort']").val(); var roleSort = $("input[name='roleSort']").val();
var status = $("input[id='status']").is(':checked') == true ? 0 : 1; var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
var remark = $("input[name='remark']").val(); var remark = $("input[name='remark']").val();
//var menuIds = $.tree.getCheckedNodes();
var menuIds = getCheckedNodes("menuTrees"); var menuIds = getCheckedNodes("menuTrees");
var monitorunits = getCheckedNodes("menuTreess"); var monitorunits = getCheckedNodes("menuTreess");

Loading…
Cancel
Save