Commit ef7bd564 by 陶光胜

联合商户取消授权

parent c8d0116c
......@@ -14,7 +14,7 @@ public interface UnionEnterpriseApiService {
ServiceResponse<Integer> delUnionEnterprise(Integer unionId, Integer enterpriseId);
ServiceResponse<Integer> delUnionEnterpriseSource(Long resourceId);
ServiceResponse<Integer> delUnionEnterpriseSource(Long resourceId, Integer enterpriseId);
ServiceResponse<UnionEnterpriseDTO> getUnionEnterpriseById(Integer unionId);
......
......@@ -74,4 +74,6 @@ public interface TabSysUnionEnterpriseResourceMapper {
int delResourceByResourceId(Long resourceId);
List<String> getKeyByResourceId(@Param("resourceId") Long resourceId);
List<Integer> getUnionEnterpriseIdByResouce(@Param("resourceId") Long resourceId);
}
\ No newline at end of file
......@@ -23,4 +23,6 @@ public interface UnionEnterpriseResourceService {
List<TabSysUnionEnterpriseResource> listResourceByUnionId(Integer unionId);
String getKeyByResourceId(Long resourceId);
Integer getUnionEnterpriseIdByResouce(Long resourceId);
}
......@@ -83,4 +83,13 @@ public class UnionEnterrpiseResourceServiceImpl implements UnionEnterpriseResour
}
return null;
}
@Override
public Integer getUnionEnterpriseIdByResouce(Long resourceId) {
List<Integer> list = this.tabSysUnionEnterpriseResourceMapper.getUnionEnterpriseIdByResouce(resourceId);
if(CollectionUtils.isNotEmpty(list)){
return list.get(0);
}
return 0;
}
}
......@@ -74,8 +74,12 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
}
@Override
public ServiceResponse<Integer> delUnionEnterpriseSource(Long resourceId) {
public ServiceResponse<Integer> delUnionEnterpriseSource(Long resourceId, Integer enterpriseId) {
int i = this.unionEnterpriseResourceService.delResource(resourceId);
if(i > 0){
Integer unionEnterpriseId = this.unionEnterpriseResourceService.getUnionEnterpriseIdByResouce(resourceId);
this.storeAuthorizationApiService.cancelStoreAll(enterpriseId, unionEnterpriseId);
}
return ServiceResponse.success(i);
}
......
......@@ -210,4 +210,10 @@
where resource=#{resourceId}
and status = 1
</select>
<select id="getUnionEnterpriseIdByResouce" resultMap="BaseResultMap">
select
union_enterprise_id
from tab_sys_union_enterprise_resource t1, tab_sys_union_enterprise t2 where t1.union_id= t2.union_id
and t1.resource=#{resourceId}
</select>
</mapper>
\ No newline at end of file
......@@ -116,11 +116,12 @@ public class UnionEnterpriseController {
}
@RequestMapping("del-union-enterprise-resource")
public RestResponse delUnionEnterprise(Long resourceId, Integer resourceType){
public RestResponse delUnionEnterprise(Long resourceId, Integer resourceType, Integer unionEnterpriseId){
if(resourceId == null){
return EnterpriseRestResponse.failure(ErrorCode.MISS_PARAMETER);
}
ServiceResponse<Integer> response = this.unionEnterpriseApiService.delUnionEnterpriseSource(resourceId);
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<Integer> response = this.unionEnterpriseApiService.delUnionEnterpriseSource(, );
if(response.getResult()>0){
ResourceTypeEnum[] values = ResourceTypeEnum.values();
for(ResourceTypeEnum typeEnum : values){
......
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