Browse Source

表添加customerId

master
zhaoqifeng 5 years ago
parent
commit
b0107f0e54
  1. 5
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleOperationDTO.java
  2. 5
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleScopeDTO.java
  3. 2
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/InitDefaultOperationsFormDTO.java
  4. 5
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationEntity.java
  5. 4
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleScopeEntity.java
  6. 12
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java
  7. 5
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeDetailDTO.java
  8. 5
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeDetailEntity.java
  9. 1
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeServiceImpl.java
  10. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java

5
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleOperationDTO.java

@ -39,6 +39,11 @@ public class RoleOperationDTO implements Serializable {
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 角色ID
*/

5
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/RoleScopeDTO.java

@ -33,6 +33,11 @@ public class RoleScopeDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
*
*/

2
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/InitDefaultOperationsFormDTO.java

@ -13,7 +13,7 @@ public class InitDefaultOperationsFormDTO {
public static class InitDefaultOpesRoleDTO {
public InitDefaultOpesRoleDTO() {
}
private String customerId;
private String roleId;
private String roleKey;
}

5
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationEntity.java

@ -38,6 +38,11 @@ public class RoleOperationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 角色ID
*/

4
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleScopeEntity.java

@ -37,6 +37,10 @@ import java.util.Date;
public class RoleScopeEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 角色ID

12
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java

@ -128,11 +128,12 @@ public class RoleOperationServiceImpl extends BaseServiceImpl<RoleOperationDao,
for (InitDefaultOperationsFormDTO.InitDefaultOpesRoleDTO role : roles) {
String roleId = role.getRoleId();
String roleKey = role.getRoleKey();
String customerId = role.getCustomerId();
List<RoleOperationDefaultResultDTO> defaultOperations = roleOperationDefaultDao.listByRoleKey(roleKey);
if (!CollectionUtils.isEmpty(defaultOperations)) {
// 有的角色并没有配置默认的操作权限,应该忽略
initDefaultOperationsForRole(roleId, defaultOperations);
initDefaultOperationScopesForRole(roleId, roleKey, defaultOperations);
initDefaultOperationsForRole(roleId, customerId, defaultOperations);
initDefaultOperationScopesForRole(roleId, roleKey, customerId, defaultOperations);
}
}
}
@ -140,13 +141,15 @@ public class RoleOperationServiceImpl extends BaseServiceImpl<RoleOperationDao,
/**
* 为某一个角色初始化默认操作权限
* @param roleId
* @param customerId
* @param operations
*/
public void initDefaultOperationsForRole(String roleId, List<RoleOperationDefaultResultDTO> operations) {
public void initDefaultOperationsForRole(String roleId, String customerId, List<RoleOperationDefaultResultDTO> operations) {
for (RoleOperationDefaultResultDTO operation : operations) {
RoleOperationEntity entity = new RoleOperationEntity();
entity.setOperationKey(operation.getOperationKey());
entity.setRoleId(roleId);
entity.setCustomerId(customerId);
roleOperationDao.insert(entity);
}
}
@ -157,7 +160,7 @@ public class RoleOperationServiceImpl extends BaseServiceImpl<RoleOperationDao,
* @param roleId 角色ID
* @param operations 该角色可以做的操作列表
*/
public void initDefaultOperationScopesForRole(String roleId, String roleKey, List<RoleOperationDefaultResultDTO> operations) {
public void initDefaultOperationScopesForRole(String roleId, String roleKey, String customerId, List<RoleOperationDefaultResultDTO> operations) {
HashMap<String, Set<String>> opeScopeMap = listDefaultOpeScopesMap(roleKey);
for (RoleOperationDefaultResultDTO operation : operations) {
// 该角色,该操作的操作范围列表
@ -168,6 +171,7 @@ public class RoleOperationServiceImpl extends BaseServiceImpl<RoleOperationDao,
roleScopeEntity.setOperationKey(operation.getOperationKey());
roleScopeEntity.setRoleId(roleId);
roleScopeEntity.setScopeKey(scopeKey);
roleScopeEntity.setCustomerId(customerId);
roleScopeDao.insert(roleScopeEntity);
}
}

5
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeDetailDTO.java

@ -38,6 +38,11 @@ public class CustomerHomeDetailDTO implements Serializable {
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 界面ID customer_home.ID
*/

5
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeDetailEntity.java

@ -37,7 +37,10 @@ import java.util.Date;
public class CustomerHomeDetailEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 界面ID customer_home.ID
*/

1
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeServiceImpl.java

@ -160,6 +160,7 @@ public class CustomerHomeServiceImpl extends BaseServiceImpl<CustomerHomeDao, Cu
List<CustomerHomeDetailEntity> list = tempList.stream().map(temp -> {
CustomerHomeDetailEntity detailEntity = new CustomerHomeDetailEntity();
detailEntity.setCustomerId(customerId);
detailEntity.setHomeId(entity.getId());
detailEntity.setComponentId(temp.getComponentId());
detailEntity.setConfiguration(temp.getConfiguration());

1
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java

@ -154,6 +154,7 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl<GovStaffRoleDao, Go
baseDao.insert(entity);
InitDefaultOperationsFormDTO.InitDefaultOpesRoleDTO role = new InitDefaultOperationsFormDTO.InitDefaultOpesRoleDTO();
role.setCustomerId(customerId);
role.setRoleId(entity.getId());
role.setRoleKey(entity.getRoleKey());
roles.add(role);

Loading…
Cancel
Save