Commit ab05af23eed974a6239fbe070a6f1a9585d03d58

Authored by liquanyu
1 parent 82b2b04b85

角色用户

Showing 3 changed files with 31 additions and 6 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RolesController.java View file @ ab05af2
... ... @@ -4,11 +4,13 @@
4 4 import com.lyms.platform.common.annotation.TokenRequired;
5 5 import com.lyms.platform.common.base.BaseController;
6 6 import com.lyms.platform.common.base.LoginContext;
  7 +import com.lyms.platform.common.base.PageInfo;
7 8 import com.lyms.platform.common.constants.ErrorCodeConstants;
8 9 import com.lyms.platform.common.enums.YnEnums;
9 10 import com.lyms.platform.common.exception.BusinessException;
10 11 import com.lyms.platform.common.utils.Assert;
11 12 import com.lyms.platform.common.utils.ResultUtils;
  13 +import com.lyms.platform.operate.web.facade.AccessPermissionFacade;
12 14 import com.lyms.platform.operate.web.result.FrontEndResult;
13 15 import com.lyms.platform.permission.model.*;
14 16 import com.lyms.platform.permission.service.*;
... ... @@ -49,6 +51,8 @@
49 51 private UserRoleMapsService userRoleMapsService;
50 52 @Autowired
51 53 private OrganizationService organizationService;
  54 + @Autowired
  55 + private AccessPermissionFacade accessPermissionFacade;
52 56  
53 57 /**
54 58 * 管理员角色权限配置
... ... @@ -380,7 +384,7 @@
380 384  
381 385 limit = 200;
382 386 page = page == null ? 1 : page;
383   -
  387 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
384 388 RolesQuery rolesQuery = new RolesQuery();
385 389 rolesQuery.setNeed("true");
386 390 rolesQuery.setSort("modified desc");
387 391  
388 392  
... ... @@ -391,17 +395,26 @@
391 395 rolesQuery.setLimit(limit);
392 396 rolesQuery.setEnable(enable);
393 397 List list =new ArrayList();
394   - if(StringUtils.isNotEmpty(orgIds)){
  398 + /* if(StringUtils.isNotEmpty(orgIds)){
395 399 String[] as =orgIds.split(",");
396 400 for(String a :as){
397 401 list.add(Integer.valueOf(a));
398 402 }
399 403 }
  404 +*/
  405 +
  406 +
  407 + List<Organization> organizations = accessPermissionFacade.getOrganization(accessPermissionFacade.findAccessPerminssionByUserId(loginState.getId()));
  408 + if (CollectionUtils.isNotEmpty(organizations)) {
  409 + for (Organization organization : organizations) {
  410 + list .add(organization.getId());
  411 + }
  412 + }
400 413 rolesQuery.setOrgIds(list);
401 414 List<Roles> roles = rolesService.queryRoles(rolesQuery);
402 415 List<Roles> rolesList = new ArrayList<>();
403 416 if (CollectionUtils.isNotEmpty(roles)) {
404   - LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  417 +
405 418 Users users = usersService.getUsers(loginState.getId());
406 419 if (users.getType() == 2) {
407 420 rolesList.addAll(roles);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java View file @ ab05af2
... ... @@ -207,8 +207,20 @@
207 207  
208 208 List<Integer> ids = null;
209 209 if (u.getType().equals(UserTypeEnum.NORMAL_USER.getId())) {
210   - if (null != u.getOrgId()) {
211   - orgId = u.getOrgId();
  210 +// if (null != u.getOrgId()) {
  211 +// orgId = u.getOrgId();
  212 +// } else {
  213 +// FrontEndResult frontEndResult = new FrontEndResult();
  214 +// frontEndResult.setPageInfo(new PageInfo(0, 0, 0, 10));
  215 +// frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS);
  216 +// return frontEndResult;
  217 +// }
  218 + List<Organization> organizations = accessPermissionFacade.getOrganization(accessPermissionFacade.findAccessPerminssionByUserId(u.getId()));
  219 + ids = new ArrayList<>();
  220 + if (CollectionUtils.isNotEmpty(organizations)) {
  221 + for (Organization organization : organizations) {
  222 + ids.add(organization.getId());
  223 + }
212 224 } else {
213 225 FrontEndResult frontEndResult = new FrontEndResult();
214 226 frontEndResult.setPageInfo(new PageInfo(0, 0, 0, 10));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HiskCountTask.java View file @ ab05af2
... ... @@ -49,7 +49,7 @@
49 49  
50 50 BasicConfigQuery basicConfigQuery = new BasicConfigQuery();
51 51 basicConfigQuery.setYn(YnEnums.YES.getId());
52   - basicConfigQuery.setEnable(1);
  52 + //basicConfigQuery.setEnable(1);
53 53 basicConfigQuery.setParentId(levelConfig.getId());
54 54  
55 55 List<RiskReportResult> results = new ArrayList<>();