模块数据隔离,bug修改

Signed-off-by: lSun <15893999301@qq.com>
This commit is contained in:
lSun 2025-01-11 14:00:40 +08:00
parent 5090ce5bb2
commit 42f81f9c7b
1 changed files with 17 additions and 2 deletions

View File

@ -54,9 +54,24 @@ public class HolidayController extends BaseController {
@Log(title = "流程管理->假期管理->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo list(HolidayBean bean) {
try{
//不是管理员只能查自己
Long userId = SecurityUtils.getUserId();
List<SysRole> sysRoleList = dao.getRoleListByUserId(userId);
int roleCount = 0;
if(!sysRoleList.isEmpty()){
for (SysRole sysRole : sysRoleList) {
if(sysRole.getRoleName().contains("管理员")){
roleCount = 1;
break;
}
}
}
if(roleCount==1){
}else{
bean.setUserId(userId);
}
startPage();
//只能查询自己的或自己导入的
bean.setUserId(SecurityUtils.getLoginUser().getSysUser().getUserId());
return getDataTable(holidayService.getHolidayList(bean));
}catch (Exception e){
log.error(e.toString(),e);