Commit 2a9d4f43 by guojuxing

管理员权限集&管理员资源组引用维护调整

parent c565cea8
......@@ -159,6 +159,12 @@
<artifactId>gic-authcenter-api</artifactId>
<version>${gic-authcenter-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-popup-sdk</artifactId>
<version>${gic-popup-sdk}</version>
</dependency>
</dependencies>
<build>
......
......@@ -12,11 +12,16 @@ import com.gic.enterprise.dto.union.UnionEnterpriseAuthDTO;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.service.UnionEnterpriseAuthApiService;
import com.gic.member.config.api.service.UserGroupPermissionApiService;
import com.gic.popup.config.InitPopupConfig;
import com.gic.popup.config.PopupUtil;
import com.gic.popup.dto.PopupDTO;
import com.gic.popup.dto.RelationBusinessInfoDTO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
......@@ -47,8 +52,18 @@ import com.gic.store.utils.valid.ValidUtil;
* @date 2019/7/16 6:55 PM
*/
@Service("userApiService")
@Import(value = InitPopupConfig.class)
public class UserApiServiceImpl implements UserApiService {
private static final Logger LOGGER = LogManager.getLogger(UserApiServiceImpl.class);
/**
* 管理员权限集引用类型
*/
private final static Integer REFER_BUSINESS_USER_ROLE = 4;
/**
* 管理员资源组
*/
private final static Integer REFER_BUSINESS_USER_RESOURCE = 5;
@Autowired
private UserService userService;
@Autowired
......@@ -523,6 +538,11 @@ public class UserApiServiceImpl implements UserApiService {
accountGroupRelService.deleteByUserId(userId, AccountGroupMemberTypeEnum.ADMIN.getCode());
//受审组
auditedGroupUserRelService.deleteByUserId(userId);
//删除权限集和资源组引用数据
PopupUtil.deletePopupLog(tabUser.getEnterpriseId(), Long.valueOf(userId), REFER_BUSINESS_USER_ROLE);
PopupUtil.deletePopupLog(tabUser.getEnterpriseId(), Long.valueOf(userId), REFER_BUSINESS_USER_RESOURCE);
userService.delete(userId);
try {
......@@ -917,6 +937,9 @@ public class UserApiServiceImpl implements UserApiService {
return result;
}
}
//业务类型配置在:gic-member-config4.0.tab_conf_reference_type
saveRefer(userId, "管理员权限集", 4, userRoleIdArr);
//新增用户资源关联数据
UserResourceDTO userResourceDTO = new UserResourceDTO();
userResourceDTO.setUserId(userId);
......@@ -933,6 +956,9 @@ public class UserApiServiceImpl implements UserApiService {
return result;
}
}
saveRefer(userId, "管理员资源组", 5, userResourceIdArr);
//账号分组用户关联数据维护
if (StringUtils.isNotBlank(accountGroupIds)) {
ServiceResponse<String[]> accountGroupIdValid = ValidSplitUtils.validStr(accountGroupIds);
......@@ -972,4 +998,25 @@ public class UserApiServiceImpl implements UserApiService {
return tabUser;
}
/**
*
* @param businessId
* @param businessName
* @param businessType 业务类型配置在:gic-member-config4.0.tab_conf_reference_type
* @param businessReferIdArr
*/
private void saveRefer(Integer businessId, String businessName, Integer businessType, String[] businessReferIdArr) {
PopupDTO popupDTO = new PopupDTO();
popupDTO.setBusinessId(Long.valueOf(businessId));
popupDTO.setBusinessName(businessName);
if (businessReferIdArr != null && businessReferIdArr.length > 0) {
popupDTO.setRelationBusinessIdList(Arrays.stream(businessReferIdArr).filter(e -> StringUtils.isNotBlank(e))
.map(e -> new RelationBusinessInfoDTO(businessType, Long.valueOf(e)))
.collect(Collectors.toList()));
ServiceResponse response = PopupUtil.savePopupLog(popupDTO);
LOGGER.info("保存数据引用结果:{}", JSON.toJSONString(response));
}
}
}
......@@ -170,6 +170,12 @@
<artifactId>gic-mall-share-api</artifactId>
<version>${gic-mall-share-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-popup-sdk</artifactId>
<version>${gic-popup-sdk}</version>
</dependency>
</dependencies>
<build>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment