Commit 3d73b361 by guojuxing

重新解除

parent 540ab2ec
......@@ -38,7 +38,11 @@ public enum UnionEnterpriseAuthDetailStatusEnum {
/**
* 已解除联合
*/
HAS_RELIEVE(8, "已解除联合");
HAS_RELIEVE(8, "已解除联合"),
/**
* 解除失败
*/
RELIEVE_FAIL(9, "解除失败");
private Integer code;
private String message;
......
......@@ -52,6 +52,15 @@ public interface UnionEnterpriseAuthApiService {
ServiceResponse<Void> resetAuthResource(@NotNull Integer ownEnterpriseId, @NotNull Integer unionEnterpriseId, @NotNull Integer resourceType);
/**
* 重新解除资源
* @param ownEnterpriseId
* @param unionEnterpriseId
* @param resourceType UnionEnterpriseAuthResTypeEnum
* @return
*/
ServiceResponse<Void> resetRelieveResource(@NotNull Integer ownEnterpriseId, @NotNull Integer unionEnterpriseId, @NotNull Integer resourceType);
/**
* 解除联合
* @param ownEnterpriseId
* @param unionEnterpriseId
......
......@@ -9,6 +9,7 @@ import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import com.alibaba.fastjson.JSON;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthResTypeEnum;
import com.gic.marketing.process.api.service.sms.SmsSendApiService;
import com.gic.member.config.api.service.AuthorizationEnterConfApiService;
import org.apache.commons.collections.CollectionUtils;
......@@ -179,6 +180,17 @@ public class UnionEnterpriseAuthApiServiceImpl implements UnionEnterpriseAuthApi
}
@Override
public ServiceResponse<Void> resetRelieveResource(@NotNull Integer ownEnterpriseId, @NotNull Integer unionEnterpriseId, @NotNull Integer resourceType) {
//todo 目前只有用户域会有解除失败
if (UnionEnterpriseAuthResTypeEnum.USER_AREA.getCode().equals(resourceType)) {
authorizationEnterConfApiService.delAuthorizationEnterpriseConf(unionEnterpriseId, ownEnterpriseId);
} else if (UnionEnterpriseAuthResTypeEnum.STORE.getCode().equals(resourceType)) {
storeAuthorizationApiService.cancelStoreAll(unionEnterpriseId, ownEnterpriseId);
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> relieveUnion(Integer ownEnterpriseId, Integer unionEnterpriseId, String relieveReason) {
TabSysUnionEnterpriseAuth old = checkExistUnionEnterprise(ownEnterpriseId, unionEnterpriseId);
......
......@@ -314,6 +314,13 @@ public class UnionEnterpriseAuthController {
.resetAuthResource(UserDetailUtils.getUserDetail().getEnterpriseId(), enterpriseId, resourceType));
}
@RequestMapping("resource-reset-relieve")
public RestResponse resourceResetRelieve(Integer enterpriseId, Integer resourceType) {
//重新授权
return ResultControllerUtils.commonResult(unionEnterpriseAuthApiService
.resetRelieveResource(UserDetailUtils.getUserDetail().getEnterpriseId(), enterpriseId, resourceType));
}
/**
* 应用策略的用户域范围数据
* @param resourceGroupId
......
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