change - 首页传感器数量修改

main
wenjy 3 years ago
parent 9647eb4729
commit 3474a2ce0a

@ -218,6 +218,7 @@ 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<>();
if(!ShiroUtils.getLoginName().equals("admin")){
for (SysRole sysRole : sysRoles) { for (SysRole sysRole : sysRoles) {
BaseSensorInfo baseSensorInfo = new BaseSensorInfo(); BaseSensorInfo baseSensorInfo = new BaseSensorInfo();
baseSensorInfo.setEnableFlag(0L); baseSensorInfo.setEnableFlag(0L);
@ -225,6 +226,10 @@ public class IndexController {
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo); List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo);
baseSensorInfoDtos.addAll(baseSensorInfoDtos1); baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
} }
}else {
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(null,0L));
baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
}
/*List<BaseSensorInfoDto> baseSensorInfoDtos = /*List<BaseSensorInfoDto> baseSensorInfoDtos =
baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo());*/ baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo());*/
@ -303,6 +308,7 @@ public class IndexController {
baseSensorTypeList.forEach( baseSensorTypeList.forEach(
x -> { x -> {
List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>(); List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>();
if(!ShiroUtils.getLoginName().equals("admin")){
for (SysRole sysRole : sysRoles) { for (SysRole sysRole : sysRoles) {
// //
BaseSensorInfo baseSensorInfo = new BaseSensorInfo(); BaseSensorInfo baseSensorInfo = new BaseSensorInfo();
@ -312,6 +318,10 @@ public class IndexController {
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo); List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(baseSensorInfo);
baseSensorInfoDtos.addAll(baseSensorInfoDtos1); baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
} }
}else{
List<BaseSensorInfoDto> baseSensorInfoDtos1 = baseSensorInfoService.selectBaseSensorInfoList(new BaseSensorInfo(x.getSensortypeId(),0L));
baseSensorInfoDtos.addAll(baseSensorInfoDtos1);
}
data.add( data.add(
new ArrayList<String>() { new ArrayList<String>() {
@ -371,6 +381,8 @@ 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());
if(!ShiroUtils.getLoginName().equals("admin")){
for (SysRole sysRole : sysRoles) { for (SysRole sysRole : sysRoles) {
// //
BaseSensorInfo baseSensorInfo = new BaseSensorInfo(); BaseSensorInfo baseSensorInfo = new BaseSensorInfo();
@ -385,6 +397,16 @@ public class IndexController {
baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(baseMonitorunitInfo); baseMonitorunitInfoService.selectBaseMonitorunitInfoDtoList(baseMonitorunitInfo);
baseMonitorunitInfoDtoList.addAll(baseMonitorunitInfoDtos); 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);
}
List<Integer> result = List<Integer> result =
new ArrayList<Integer>() { new ArrayList<Integer>() {
{ {

Loading…
Cancel
Save