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

Loading…
Cancel
Save