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

main
wenjy 2 years ago
parent d983773edd
commit e6c8416705

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

@ -99,6 +99,7 @@ public class SensorSummaryController extends BaseController {
baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(sensorTypeId, 0L));*/
for (BaseSensorInfoDto x : baseSensorInfoDtos) {
try{
Map<String, Object> info = new HashMap<>();
Object jrm = redisTemplate.opsForHash().get(x.getSensorType(), x.getSensorId());
if (jrm != null) {
@ -140,6 +141,9 @@ public class SensorSummaryController extends BaseController {
info.put("sensorType", baseSensorTypeList.get(0).getSensortypeName());
result.add(info);
}catch (Exception ex) {
System.out.println("异常:"+ex.getMessage());
}
}
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
username: root
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
# password: root
# password: jrmRoot
# 从库数据源
slave:
# 从数据源开关/默认关闭

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

@ -2,7 +2,8 @@ $(document).ready(function () {
//$.cookie('userID', '0001');
var wsImpl = window.WebSocket || window.MozWebSocket;
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) {
let result = $.parseJSON(evt.data);
};

@ -579,7 +579,8 @@
$.cookie('userID', '0000');
var wsImpl = window.WebSocket || window.MozWebSocket;
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) {
let result = $.parseJSON(evt.data);
console.log(result);

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

Loading…
Cancel
Save