Commit 4a7aad75 by 陶光胜

授权常量

parent 91f7b4d1
......@@ -4,6 +4,8 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.UnionEnterpriseDTO;
import java.util.List;
public interface UnionEnterpriseApiService {
ServiceResponse<Integer> saveUnionEnterprise(UnionEnterpriseDTO enterpriseDTO);
......@@ -17,4 +19,6 @@ public interface UnionEnterpriseApiService {
Integer pageSize, Integer authorizationStatus);
ServiceResponse<Void> updateStoreAuthorizationStatus(int authOrizationStatus, Integer enterpriseId, String ...message);
ServiceResponse<List<Long>> listStoreResourceByEnterpriseId(Integer enterpriseId);
}
......@@ -62,4 +62,7 @@ public interface TabSysUnionEnterpriseResourceMapper {
@Param("enterpriseId") Integer enterpriseId,
@Param("resourceType") Integer resourceType,
@Param("authOrizationMessage") String authOrizationMessage);
List<Long> listResourceByEnterpriseIdAndType(@Param("enterpriseId") Integer enterpriseId,
@Param("type") int type);
}
\ No newline at end of file
......@@ -2,6 +2,8 @@ package com.gic.auth.service;
import com.gic.auth.entity.TabSysUnionEnterpriseResource;
import java.util.List;
public interface UnionEnterpriseResourceService {
int saveResource(Integer unionId, Long resourceId, int type, Integer enterpriseId);
......@@ -10,4 +12,6 @@ public interface UnionEnterpriseResourceService {
int delResource(Integer unionId, Integer enterpriseId);
void updateAuthorizationStatus(int authOrizationStatus, Integer enterpriseId, Integer resourceType, String authOrizationMessage);
List<Long> listResourceByEnterpriseIdAndType(Integer enterpriseId, int type);
}
......@@ -55,4 +55,9 @@ public class UnionEnterrpiseResourceServiceImpl implements UnionEnterpriseResour
public void updateAuthorizationStatus(int authOrizationStatus, Integer enterpriseId, Integer resourceType,String authOrizationMessage) {
this.tabSysUnionEnterpriseResourceMapper.updateAuthorizationStatus(authOrizationStatus, enterpriseId, resourceType, authOrizationMessage);
}
@Override
public List<Long> listResourceByEnterpriseIdAndType(Integer enterpriseId, int type) {
return this.tabSysUnionEnterpriseResourceMapper.listResourceByEnterpriseIdAndType(enterpriseId, type);
}
}
......@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@Service("unionEnterpriseApiService")
public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService {
......@@ -96,6 +97,12 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
return null;
}
@Override
public ServiceResponse<List<Long>> listStoreResourceByEnterpriseId(Integer enterpriseId) {
List<Long> longList = this.unionEnterpriseResourceService.listResourceByEnterpriseIdAndType(enterpriseId, ResourceTypeEnum.STORE_RESOURCE.getCode());
return ServiceResponse.success(longList);
}
private int saveResource(Integer unionId, UnionEnterpriseDTO enterpriseDTO){
int i = 0;
i = this.unionEnterpriseResourceService.saveResource(unionId, enterpriseDTO.getMemberCardResourceId(),
......
......@@ -182,4 +182,12 @@
set authorization_status=#{authOrizationStatus},authorization_time=now(),authorization_message=#{authOrizationMessage}
where enterprise_id= #{enterpriseId} and resource_type=#{resourceType} and status = 1
</update>
<select id="listResourceByEnterpriseIdAndType" resultType="java.lang.Long">
select
resource
from tab_sys_union_enterprise_resource
where enterprise_id = #{enterpriseId,jdbcType=INTEGER}
and resource_type = #{type}
and status = 1
</select>
</mapper>
\ No newline at end of file
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