change - 首页传感器数量修改

main
wenjy 3 years ago
parent 9647eb4729
commit 3474a2ce0a

@ -218,11 +218,16 @@ public class IndexController {
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId()); List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>(); List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>();
for (SysRole sysRole : sysRoles) { if(!ShiroUtils.getLoginName().equals("admin")){
BaseSensorInfo baseSensorInfo = new BaseSensorInfo(); for (SysRole sysRole : sysRoles) {
baseSensorInfo.setEnableFlag(0L); BaseSensorInfo baseSensorInfo = new BaseSensorInfo();
baseSensorInfo.setRoleId(sysRole.getRoleId()); baseSensorInfo.setEnableFlag(0L);
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo); baseSensorInfo.setRoleId(sysRole.getRoleId());
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo);
baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
}
}else {
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(null,0L));
baseSensorInfoDtos.addAll(baseSensorInfoDtos1); baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
} }
@ -303,13 +308,18 @@ public class IndexController {
baseSensorTypeList.forEach( baseSensorTypeList.forEach(
x -> { x -> {
List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>(); List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>();
for (SysRole sysRole : sysRoles) { if(!ShiroUtils.getLoginName().equals("admin")){
// for (SysRole sysRole : sysRoles) {
BaseSensorInfo baseSensorInfo = new BaseSensorInfo(); //
baseSensorInfo.setEnableFlag(0L); BaseSensorInfo baseSensorInfo = new BaseSensorInfo();
baseSensorInfo.setRoleId(sysRole.getRoleId()); baseSensorInfo.setEnableFlag(0L);
baseSensorInfo.setSensorType(x.getSensortypeId()); baseSensorInfo.setRoleId(sysRole.getRoleId());
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo); baseSensorInfo.setSensorType(x.getSensortypeId());
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo);
baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
}
}else{
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(x.getSensortypeId(),0L));
baseSensorInfoDtos.addAll(baseSensorInfoDtos1); baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
} }
@ -371,20 +381,32 @@ public class IndexController {
SysUser sysUser = ShiroUtils.getSysUser(); SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId()); List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
for (SysRole sysRole : sysRoles) {
// if(!ShiroUtils.getLoginName().equals("admin")){
BaseSensorInfo baseSensorInfo = new BaseSensorInfo(); for (SysRole sysRole : sysRoles) {
baseSensorInfo.setEnableFlag(0L); //
baseSensorInfo.setRoleId(sysRole.getRoleId()); BaseSensorInfo baseSensorInfo = new BaseSensorInfo();
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(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); baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
BaseMonitorunitInfo baseMonitorunitInfo = new BaseMonitorunitInfo();
baseMonitorunitInfo.setRoleId(sysRole.getRoleId());
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos = List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos =
baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(baseMonitorunitInfo); baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(new BaseMonitorunitInfo());
baseMonitorunitInfoDtoList.addAll(baseMonitorunitInfoDtos); baseMonitorunitInfoDtoList.addAll(baseMonitorunitInfoDtos);
} }
List<Integer> result = List<Integer> result =
new ArrayList<Integer>() { new ArrayList<Integer>() {
{ {

Loading…
Cancel
Save