change - 角色权限问题修改

main
Wen JY 1 year ago
parent 8cc4233573
commit e8446928de

@ -70,7 +70,7 @@ public class BaseMonitorunitInfoController extends BaseController {
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos = new ArrayList<>();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(ShiroUtils.getLoginName().equals("admin")){
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos1 =
@ -304,7 +304,7 @@ public class BaseMonitorunitInfoController extends BaseController {
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos = new ArrayList<>();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(ShiroUtils.getLoginName().equals("admin")){
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos1 =

@ -66,7 +66,7 @@ public class DeviceMonitorController {
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos = new ArrayList<>();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(ShiroUtils.getLoginName().equals("admin")){
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos1 =
@ -131,7 +131,7 @@ public class DeviceMonitorController {
List<BaseMonitorunitInfoDto> baseMonitorunitInfos = new ArrayList<>();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(ShiroUtils.getLoginName().equals("admin")){
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos1 =

@ -69,7 +69,7 @@ public class IndexController {
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(!ShiroUtils.getLoginName().equals("admin")){
for (SysRole sysRole : sysRoles) {
//
@ -159,7 +159,7 @@ public class IndexController {
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtoList = new ArrayList<BaseMonitorunitInfoDto>();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(!ShiroUtils.getLoginName().equals("admin")){
for (SysRole sysRole : sysRoles) {
@ -237,7 +237,7 @@ public class IndexController {
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
List<BaseSensorInfoDto> baseSensorInfoDtos = new ArrayList<>();
if(!ShiroUtils.getLoginName().equals("admin")){
@ -324,7 +324,7 @@ public class IndexController {
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
baseSensorTypeList.forEach(
@ -405,7 +405,7 @@ public class IndexController {
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(!ShiroUtils.getLoginName().equals("admin")){
for (SysRole sysRole : sysRoles) {
@ -465,7 +465,7 @@ public class IndexController {
List<RecordAlarm> recordAlarms = new ArrayList<>();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
for (SysRole sysRole : sysRoles) {
RecordAlarm recordAlarm = new RecordAlarm();
recordAlarm.setRoleId(sysRole.getRoleId());
@ -550,7 +550,7 @@ public class IndexController {
List<RecordAlarmDto> recordAlarmDtos1 = recordAlarmService.selectAlarmTrendList("");
recordAlarmDtos.addAll(recordAlarmDtos1);
}else{
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
for (SysRole sysRole : sysRoles) {
RecordAlarm recordAlarm = new RecordAlarm();
recordAlarm.setRoleId(sysRole.getRoleId());

@ -77,7 +77,7 @@ public class SensorSummaryController extends BaseController {
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(ShiroUtils.getLoginName().equals("admin")){
List<BaseSensorInfoDto> baseSensorInfoDto =

@ -63,7 +63,7 @@ public class WisdomScenarioContorller extends BaseController {
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(!ShiroUtils.getLoginName().equals("admin")){
for (SysRole sysRole : sysRoles) {
@ -136,7 +136,7 @@ public class WisdomScenarioContorller extends BaseController {
List<BaseMonitorunitInfoDto> baseMonitorunitInfoDtos = new ArrayList<>();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(!ShiroUtils.getLoginName().equals("admin")){
for (SysRole sysRole : sysRoles) {
@ -184,7 +184,7 @@ public class WisdomScenarioContorller extends BaseController {
List<BaseAlarmModuleDto> baseAlarmModuleDtos = new ArrayList();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(!ShiroUtils.getLoginName().equals("admin")){
for (SysRole sysRole : sysRoles) {
@ -248,7 +248,7 @@ public class WisdomScenarioContorller extends BaseController {
List<RecordAlarmDto> recordAlarmDtos = new ArrayList<>();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
for (SysRole sysRole : sysRoles) {
RecordAlarm recordAlarm = new RecordAlarm();
recordAlarm.setRoleId(sysRole.getRoleId());

@ -638,7 +638,7 @@
html += '<p>' + x.paramTitle + '<span>' + x.paramValue + '</span></p>';
});
}
html += ' <p>所属变电站:<span>' + res[0].substationName + '</span></p>';
/*html += ' <p>所属变电站:<span>' + res[0].substationName + '</span></p>';*/
$("#sensor-text").append(html);
},
error: () => {

@ -36,6 +36,13 @@ public interface ISysRoleService
*/
public List<SysRole> selectRolesByUserId(Long userId);
/**
* ID
* @param userId
* @return
*/
public List<SysRole> GetRoleInfoByUserId(Long userId);
/**
*
*

@ -61,7 +61,7 @@ public class BaseSensorInfoServiceImpl implements IBaseSensorInfoService
List<BaseSensorInfoDto> list = new ArrayList<>();
SysUser sysUser = ShiroUtils.getSysUser();
List<SysRole> sysRoles = iSysRoleService.selectRolesByUserId(sysUser.getUserId());
List<SysRole> sysRoles = iSysRoleService.GetRoleInfoByUserId(sysUser.getUserId());
if(ShiroUtils.getLoginName().equals("admin")){
List<BaseSensorInfoDto> baseSensorInfoDtos = baseSensorInfoMapper.selectBaseSensorInfoList(baseSensorInfo);

@ -108,6 +108,21 @@ public class SysRoleServiceImpl implements ISysRoleService
return roles;
}
/**
* ID
* @param userId
* @return
*/
public List<SysRole> GetRoleInfoByUserId(Long userId)
{
List<SysRole> userRoles = roleMapper.selectRolesByUserId(userId);
List<SysRole> roles = selectRoleAll();
if (userRoles.size() == 0){
return roles;
}
return userRoles;
}
/**
*
*

Loading…
Cancel
Save