健康监测权限处理
This commit is contained in:
+9
-5
@@ -43,6 +43,7 @@ import org.jeecg.common.export.PoiExportHandler;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.util.DictUtil;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.system.vo.LoginUserNew;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.global.GlobalUtils;
|
||||
@@ -601,11 +602,14 @@ public class WatchMonitorDataServiceImpl extends ServiceImpl<WatchMonitorDataMap
|
||||
|
||||
@Override
|
||||
public IPage<AbnormalEvent> pageCustom(int pageNo, int pageSize, AbnormalEventFilter filter) {
|
||||
// 管理单位
|
||||
String orgCode = getOrgCode(filter.getSecondDepartOrgCode(), filter.getDepartOrgCode());
|
||||
List<String> managedCodes = GlobalUtils.getManagedCodes(orgCode);
|
||||
if (CollUtil.isEmpty(managedCodes)) {
|
||||
return new Page<>();
|
||||
List<String> managedCodes = new ArrayList<>();
|
||||
if (!GlobalUtils.isWatchAdmin()){
|
||||
// 管理单位
|
||||
String orgCode = getOrgCode(filter.getSecondDepartOrgCode(), filter.getDepartOrgCode());
|
||||
managedCodes = GlobalUtils.getManagedCodes(orgCode);
|
||||
if (CollUtil.isEmpty(managedCodes)) {
|
||||
return new Page<>();
|
||||
}
|
||||
}
|
||||
// 条件
|
||||
LambdaQueryWrapper<WatchMonitorData> queryWrapper = getQueryWrapper(filter, managedCodes);
|
||||
|
||||
@@ -175,6 +175,13 @@ public class GlobalUtils {
|
||||
return roleCodes.contains("admin") || roleCodes.contains("system") || roleCodes.contains("medicaladmin");
|
||||
}
|
||||
|
||||
public static boolean isWatchAdmin() {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
List<String> roleCodes = Arrays.asList(Objects.toString(loginUser.getRoleCodes(), "").split(","));
|
||||
//体检旧系统中有根据watchAdmin作为渲染二级单位下拉框的标记,该角色无权限配置,这里先沿用该角色标记
|
||||
return roleCodes.contains("watch_admin");
|
||||
}
|
||||
|
||||
public static boolean isAdminBack(List<String> roleCodes) {
|
||||
|
||||
if (!CollectionUtil.isEmpty(roleCodes)) {
|
||||
|
||||
+2
-1
@@ -1372,8 +1372,9 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
// 权限过滤
|
||||
LoginUser loginUser = GlobalUtils.getLoginUser();
|
||||
boolean loginUserAdmin = GlobalUtils.isLoginUserAdmin();
|
||||
boolean watchAdmin = GlobalUtils.isWatchAdmin();
|
||||
// 获取当前用户所管理的部门
|
||||
if (!loginUserAdmin) {
|
||||
if (!loginUserAdmin && !watchAdmin) {
|
||||
List<String> orgCodes = Arrays.asList(Objects.toString(loginUser.getDepartCodes(), "").split(","));
|
||||
if (CollectionUtil.isEmpty(orgCodes)) {
|
||||
departs = Collections.emptyList();
|
||||
|
||||
Reference in New Issue
Block a user