Commit 72f05639 by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents f914557b 3a598654
......@@ -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);
}
......
......@@ -179,7 +179,7 @@
</update>
<update id="updateAuthorizationStatus" >
update tab_sys_union_enterprise_resource
set authorization_status=#{authOrizationStatus},authorization_time=now(),authorization_message=#{authOrizationMessage}, key=#{key}
set authorization_status=#{authOrizationStatus},authorization_time=now(),authorization_message=#{authOrizationMessage}, auth_key=#{key}
where enterprise_id= #{enterpriseId} and resource_type=#{resourceType} and status = 1
</update>
<select id="listResourceByEnterpriseIdAndType" resultType="com.gic.auth.dto.UnionEnterpriseResourceDTO">
......@@ -205,9 +205,15 @@
</update>
<select id="getKeyByResourceId" resultMap="BaseResultMap">
select
key
auth_key
from tab_sys_union_enterprise_resource
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
......@@ -120,7 +120,8 @@ public class UnionEnterpriseController {
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(resourceId, enterpriseId);
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