Commit f747ab21 by 陶光胜

授权常量

parent a34a3577
......@@ -3,7 +3,8 @@ package com.gic.auth.constant;
public enum AuthorizationStatusEnum {
NORMAL(1, "授权中"),
SUCCESS(2, "授权成功"),
FAIL(3, "授权失败");
FAIL(3, "授权失败"),
NO(4, "不授权");
private Integer code;
private String message;
......
......@@ -15,4 +15,6 @@ public interface UnionEnterpriseApiService {
ServiceResponse<Page<UnionEnterpriseDTO>> pageUnionEnterprise(String search, Integer enterpriseId, Integer pageNum,
Integer pageSize, Integer authorizationStatus);
ServiceResponse<Void> updateStoreAuthorizationStatus(int authOrizationStatus, Integer enterpriseId, String ...message);
}
......@@ -57,4 +57,9 @@ public interface TabSysUnionEnterpriseResourceMapper {
List<TabSysUnionEnterpriseResource> getResource(@Param("unionId") Integer unionId, @Param("type") int type);
int delResource(@Param("enterpriseId") Integer enterpriseId, @Param("unionId") Integer unionId);
int updateAuthorizationStatus(@Param("authOrizationStatus") int authOrizationStatus,
@Param("enterpriseId") Integer enterpriseId,
@Param("resourceType") Integer resourceType,
@Param("authOrizationMessage") String authOrizationMessage);
}
\ No newline at end of file
......@@ -8,4 +8,6 @@ public interface UnionEnterpriseResourceService {
TabSysUnionEnterpriseResource getByUnionIdAndType(Integer unionId, int type);
int delResource(Integer unionId, Integer enterpriseId);
void updateAuthorizationStatus(int authOrizationStatus, Integer enterpriseId, Integer resourceType, String authOrizationMessage);
}
......@@ -50,4 +50,9 @@ public class UnionEnterrpiseResourceServiceImpl implements UnionEnterpriseResour
public int delResource(Integer unionId, Integer enterpriseId) {
return this.tabSysUnionEnterpriseResourceMapper.delResource(enterpriseId, unionId);
}
@Override
public void updateAuthorizationStatus(int authOrizationStatus, Integer enterpriseId, Integer resourceType,String authOrizationMessage) {
this.tabSysUnionEnterpriseResourceMapper.updateAuthorizationStatus(authOrizationStatus, enterpriseId, resourceType, authOrizationMessage);
}
}
......@@ -83,6 +83,16 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
return ServiceResponse.success(PageHelperUtils.changePageHelperToCurrentPage(page, UnionEnterpriseDTO.class));
}
@Override
public ServiceResponse<Void> updateStoreAuthorizationStatus(int authOrizationStatus, Integer enterpriseId, String ...message) {
String authOrizationMessage = null;
if(message != null){
authOrizationMessage = message[0];
}
this.unionEnterpriseResourceService.updateAuthorizationStatus(authOrizationStatus, enterpriseId, ResourceTypeEnum.STORE_RESOURCE.getCode(), authOrizationMessage);
return null;
}
private int saveResource(Integer unionId, UnionEnterpriseDTO enterpriseDTO){
int i = 0;
i = this.unionEnterpriseResourceService.saveResource(unionId, enterpriseDTO.getMemberCardResourceId(),
......
......@@ -177,4 +177,9 @@
where union_id = #{unionId,jdbcType=INTEGER}
and enterprise_id= #{enterpriseId}
</update>
<update id="updateAuthorizationStatus" >
update tab_sys_union_enterprise_resource
set authorization_status=#{authOrizationStatus},authorization_time=now(),authorization_message=#{authOrizationMessage}
where enterprise_id= #{enterpriseId} and resource_type=#{resourceType} and status = 1
</update>
</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