zxc 3 years ago
parent
commit
265ce7639c
  1. 1
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/RoleUserFormDTO.java
  2. 9
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java
  3. 1
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleUserServiceImpl.java
  4. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

1
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/RoleUserFormDTO.java

@ -22,4 +22,5 @@ public class RoleUserFormDTO implements Serializable {
private List<String> roleIds;
private String userId;
private String customerId;
}

9
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java

@ -242,16 +242,15 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit
* @Date 15:51 2021-03-16
**/
private List<GovMenuDTO> getCustomerMenuList(String customerId, Integer type, String tableName,String userId) {
/*List<GovMenuDTO> govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type,tableName);
List<GovMenuDTO> govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type,tableName);
if (!CollectionUtils.isEmpty(govMenuDTOS)){
return govMenuDTOS;
}*/
}
List<GovMenuEntity> menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage(),tableName);
disposeGovMenu(menuList,userId);
Map<Boolean, List<GovMenuEntity>> groupByStatus = menuList.stream().collect(Collectors.groupingBy(GovMenuEntity::getRoleStatus));
List<GovMenuDTO> dtoList = ConvertUtils.sourceToTarget(CollectionUtils.isEmpty(groupByStatus.get(true)) ? new ArrayList<>() : groupByStatus.get(true), GovMenuDTO.class);
List<GovMenuDTO> govMenuDTOS = TreeUtils.buildTree(dtoList);
// govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS,tableName);
govMenuDTOS = TreeUtils.buildTree(dtoList);
govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS,tableName);
return govMenuDTOS;
}

1
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleUserServiceImpl.java

@ -171,6 +171,7 @@ public class GovRoleUserServiceImpl extends BaseServiceImpl<GovRoleUserDao, GovR
formDTO.getRoleIds().forEach(r -> {
GovRoleUserEntity entity = new GovRoleUserEntity();
entity.setUserId(formDTO.getUserId());
entity.setCustomerId(formDTO.getCustomerId());
entity.setRoleId(r);
entityList.add(entity);
});

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -194,7 +194,7 @@ public class StaffServiceImpl implements StaffService {
return new Result().error(EpmetErrorCode.STAFF_EDIT_FAILED.getCode(), EpmetErrorCode.STAFF_EDIT_FAILED.getMsg());
}
if (CollectionUtils.isNotEmpty(fromDTO.getNewRoles())){
Result roleUserAccess = govAccessFeignClient.roleUser(new RoleUserFormDTO(fromDTO.getNewRoles(), fromDTO.getStaffId()));
Result roleUserAccess = govAccessFeignClient.roleUser(new RoleUserFormDTO(fromDTO.getNewRoles(), fromDTO.getStaffId(),fromDTO.getCustomerId()));
if (!roleUserAccess.success()){
throw new EpmetException("save data to gov-role-user failure");
}
@ -588,7 +588,7 @@ public class StaffServiceImpl implements StaffService {
staffOrgRelationService.insert(staffOrgRelationEntity);
if (CollectionUtils.isNotEmpty(fromDTO.getNewRoles())){
Result roleUserAccess = govAccessFeignClient.roleUser(new RoleUserFormDTO(fromDTO.getNewRoles(), customerStaffAgencyEntity.getUserId()));
Result roleUserAccess = govAccessFeignClient.roleUser(new RoleUserFormDTO(fromDTO.getNewRoles(), customerStaffAgencyEntity.getUserId(),fromDTO.getCustomerId()));
if (!roleUserAccess.success()){
throw new EpmetException("save data to gov-role-user failure");
}

Loading…
Cancel
Save