|
|
|
@ -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,50 +396,57 @@ public class IndexController {
|
|
|
|
|
@GetMapping("/quantityStatistics")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String quantityStatistics() {
|
|
|
|
|
List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>();
|
|
|
|
|
List<Integer> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtoList = new ArrayList<BaseMonitorunitInfoDto>();
|
|
|
|
|
try {
|
|
|
|
|
List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
SysUser sysUser = ShiroUtils.getSysUser();
|
|
|
|
|
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtoList = new ArrayList<BaseMonitorunitInfoDto>();
|
|
|
|
|
|
|
|
|
|
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
|
|
|
|
|
SysUser sysUser = ShiroUtils.getSysUser();
|
|
|
|
|
|
|
|
|
|
if(!ShiroUtils.getLoginName().equals("admin")){
|
|
|
|
|
for (SysRole sysRole : sysRoles) {
|
|
|
|
|
//
|
|
|
|
|
BaseSensorInfo baseSensorInfo = new BaseSensorInfo();
|
|
|
|
|
baseSensorInfo.setEnableFlag(0L);
|
|
|
|
|
baseSensorInfo.setRoleId(sysRole.getRoleId());
|
|
|
|
|
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo);
|
|
|
|
|
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
|
|
|
|
|
|
|
|
|
|
if(!ShiroUtils.getLoginName().equals("admin")){
|
|
|
|
|
for (SysRole sysRole : sysRoles) {
|
|
|
|
|
//
|
|
|
|
|
BaseSensorInfo baseSensorInfo = new BaseSensorInfo();
|
|
|
|
|
baseSensorInfo.setEnableFlag(0L);
|
|
|
|
|
baseSensorInfo.setRoleId(sysRole.getRoleId());
|
|
|
|
|
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo);
|
|
|
|
|
baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
|
|
|
|
|
|
|
|
|
|
BaseMonitorunitInfo baseMonitorunitInfo = new BaseMonitorunitInfo();
|
|
|
|
|
baseMonitorunitInfo.setRoleId(sysRole.getRoleId());
|
|
|
|
|
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos =
|
|
|
|
|
baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(baseMonitorunitInfo);
|
|
|
|
|
baseMonitorunitInfoDtoList.addAll(baseMonitorunitInfoDtos);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(null,0L));
|
|
|
|
|
baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
|
|
|
|
|
|
|
|
|
|
BaseMonitorunitInfo baseMonitorunitInfo = new BaseMonitorunitInfo();
|
|
|
|
|
baseMonitorunitInfo.setRoleId(sysRole.getRoleId());
|
|
|
|
|
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos =
|
|
|
|
|
baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(baseMonitorunitInfo);
|
|
|
|
|
baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(new BaseMonitorunitInfo());
|
|
|
|
|
baseMonitorunitInfoDtoList.addAll(baseMonitorunitInfoDtos);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(null,0L));
|
|
|
|
|
baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
|
|
|
|
|
|
|
|
|
|
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos =
|
|
|
|
|
baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(new BaseMonitorunitInfo());
|
|
|
|
|
baseMonitorunitInfoDtoList.addAll(baseMonitorunitInfoDtos);
|
|
|
|
|
result =
|
|
|
|
|
new ArrayList<Integer>() {
|
|
|
|
|
{
|
|
|
|
|
this.add(baseSensorInfoDtos.size());
|
|
|
|
|
this.add(
|
|
|
|
|
baseMonitorunitInfoDtoList.stream()
|
|
|
|
|
.filter(x -> x.getParentId() != null && x.getEnableFlag() == 0L)
|
|
|
|
|
.collect(Collectors.toList())
|
|
|
|
|
.size());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}catch (Exception ex) {
|
|
|
|
|
System.out.println(ex.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Integer> result =
|
|
|
|
|
new ArrayList<Integer>() {
|
|
|
|
|
{
|
|
|
|
|
this.add(baseSensorInfoDtos.size());
|
|
|
|
|
this.add(
|
|
|
|
|
baseMonitorunitInfoDtoList.stream()
|
|
|
|
|
.filter(x -> !x.getParentId().isEmpty() && x.getEnableFlag() == 0L)
|
|
|
|
|
.collect(Collectors.toList())
|
|
|
|
|
.size());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return JSONArray.toJSONString(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -454,30 +461,34 @@ public class IndexController {
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getAlarmAmount() {
|
|
|
|
|
List<String> info = new ArrayList<>();
|
|
|
|
|
List<RecordAlarm> recordAlarms = new ArrayList<>();
|
|
|
|
|
SysUser sysUser = ShiroUtils.getSysUser();
|
|
|
|
|
try{
|
|
|
|
|
List<RecordAlarm> recordAlarms = new ArrayList<>();
|
|
|
|
|
SysUser sysUser = ShiroUtils.getSysUser();
|
|
|
|
|
|
|
|
|
|
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
|
|
|
|
|
for (SysRole sysRole : sysRoles) {
|
|
|
|
|
RecordAlarm recordAlarm = new RecordAlarm();
|
|
|
|
|
recordAlarm.setRoleId(sysRole.getRoleId());
|
|
|
|
|
List<RecordAlarm> recordAlarms1 = recordAlarmService.selectRecordAlarmList(recordAlarm);
|
|
|
|
|
recordAlarms.addAll(recordAlarms1);
|
|
|
|
|
}
|
|
|
|
|
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
|
|
|
|
|
for (SysRole sysRole : sysRoles) {
|
|
|
|
|
RecordAlarm recordAlarm = new RecordAlarm();
|
|
|
|
|
recordAlarm.setRoleId(sysRole.getRoleId());
|
|
|
|
|
List<RecordAlarm> recordAlarms1 = recordAlarmService.selectRecordAlarmList(recordAlarm);
|
|
|
|
|
recordAlarms.addAll(recordAlarms1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (recordAlarms.size() > 0) {
|
|
|
|
|
int size =
|
|
|
|
|
recordAlarms.stream()
|
|
|
|
|
.filter(x -> x.getDisposeFlag() == 0L)
|
|
|
|
|
.collect(Collectors.toList())
|
|
|
|
|
.size();
|
|
|
|
|
if (recordAlarms.size() > 0) {
|
|
|
|
|
int size =
|
|
|
|
|
recordAlarms.stream()
|
|
|
|
|
.filter(x -> x.getDisposeFlag() == 0L)
|
|
|
|
|
.collect(Collectors.toList())
|
|
|
|
|
.size();
|
|
|
|
|
|
|
|
|
|
info.add(size + "");
|
|
|
|
|
info.add(recordAlarms.size() + "");
|
|
|
|
|
info.add(size + "");
|
|
|
|
|
info.add(recordAlarms.size() + "");
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
info.add("--");
|
|
|
|
|
info.add("--");
|
|
|
|
|
} else {
|
|
|
|
|
info.add("--");
|
|
|
|
|
info.add("--");
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception ex) {
|
|
|
|
|
System.out.println(ex.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return JSONArray.toJSONString(info);
|
|
|
|
|