Commit 19afa8ac by guojuxing

删除策略接口

parent 930b6bdb
package com.gic.enterprise.config;
import javax.validation.ConstraintViolationException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.context.annotation.Configuration;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
/**
* api层错误全部统一返回
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/9 9:46 AM

*/
@Aspect
@Configuration
public class ExceptionResultAop {
private Logger logger = LogManager.getLogger(ExceptionResultAop.class);
/**
* 环绕通知
*
* @param joinPoint
* @return
* @throws Throwable
*/
@Around(value = "execution(* com.gic.*.service.outer.impl.*(..))")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
try {
// 执行当前方法
return joinPoint.proceed();
} catch (Throwable throwable) {
logger.warn("拦截器错误", throwable);
return handlerException(throwable);
}
}
private ServiceResponse handlerException(Throwable e) {
ServiceResponse response = new ServiceResponse();
if (e instanceof CommonException) {
response.setCode(((CommonException) e).getErrorCode());
} else if (e instanceof ConstraintViolationException) {
response.setCode(ErrorCode.SYSTEM_ERROR.getCode());
} else {
response.setCode(ErrorCode.SYSTEM_ERROR.getCode());
}
response.setMessage(e.getMessage());
return response;
}
}
\ No newline at end of file
package com.gic.enterprise.config;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -12,11 +9,9 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.context.annotation.Configuration;
import javax.validation.ConstraintViolationException;
/**
* 采集GIC系统操作日志
*
*
* @author leeon
* @date 2019年6月28日
*/
......@@ -45,22 +40,8 @@ public class ParamAop {
return joinPoint.proceed();
} catch (Throwable throwable) {
logger.warn("拦截器错误", throwable);
return handlerException(throwable);
}
}
private ServiceResponse handlerException(Throwable e) {
ServiceResponse response = new ServiceResponse();
if (e instanceof CommonException) {
response.setCode(((CommonException) e).getErrorCode());
} else if (e instanceof ConstraintViolationException) {
response.setCode(ErrorCode.SYSTEM_ERROR.getCode());
} else {
response.setCode(ErrorCode.SYSTEM_ERROR.getCode());
throw throwable;
}
response.setMessage(e.getMessage());
return response;
}
/**
......
......@@ -78,5 +78,5 @@ public interface TabSysUnionEnterpriseAuthAppMapper {
* @param unionEnterpriseAuthId
* @return
*/
int deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@Param("unionEnterpriseAuthId") Integer unionEnterpriseAuthId);
Integer deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@Param("unionEnterpriseAuthId") Integer unionEnterpriseAuthId);
}
\ No newline at end of file
......@@ -93,4 +93,11 @@ public interface TabSysUnionEnterpriseAuthMapper {
* @return
*/
List<TabSysUnionEnterpriseAuth> listAll();
/**
* 查询
* @param ownEnterpriseId
* @return
*/
List<TabSysUnionEnterpriseAuth> listUnionEnterprise(@Param("ownEnterpriseId") Integer ownEnterpriseId);
}
\ No newline at end of file
......@@ -64,5 +64,5 @@ public interface UnionEnterpriseAuthAppService {
* @param unionEnterpriseAuthId
* @return
*/
int deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@NotNull Integer unionEnterpriseAuthId);
Integer deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@NotNull Integer unionEnterpriseAuthId);
}
......@@ -62,4 +62,11 @@ public interface UnionEnterpriseAuthService {
* @return
*/
List<TabSysUnionEnterpriseAuth> listAll();
/**
* 查询
* @param ownEnterpriseId
* @return
*/
List<TabSysUnionEnterpriseAuth> listUnionEnterpriseAuth(@NotNull Integer ownEnterpriseId);
}
......@@ -69,7 +69,7 @@ public class UnionEnterpriseAuthAppServiceImpl implements UnionEnterpriseAuthApp
}
@Override
public int deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@NotNull Integer unionEnterpriseAuthId) {
public Integer deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@NotNull Integer unionEnterpriseAuthId) {
return tabSysUnionEnterpriseAuthAppMapper.deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(unionEnterpriseAuthId);
}
}
......@@ -67,4 +67,9 @@ public class UnionEnterpriseAuthServiceImpl implements UnionEnterpriseAuthServic
return tabSysUnionEnterpriseAuthMapper.listAll();
}
@Override
public List<TabSysUnionEnterpriseAuth> listUnionEnterpriseAuth(@NotNull Integer ownEnterpriseId) {
return tabSysUnionEnterpriseAuthMapper.listUnionEnterprise(ownEnterpriseId);
}
}
......@@ -212,7 +212,11 @@ public class UnionEnterpriseAuthApiServiceImpl implements UnionEnterpriseAuthApi
@Override
public ServiceResponse<List<UnionEnterpriseAuthDTO>> listUnionEnterpriseAuth(@NotNull Integer ownEnterpriseId) {
return ServiceResponse.success();
List<TabSysUnionEnterpriseAuth> list = unionEnterpriseAuthService.listUnionEnterpriseAuth(ownEnterpriseId);
if (list == null) {
return ServiceResponse.success(Collections.emptyList());
}
return ServiceResponse.success(EntityUtil.changeEntityListNew(UnionEnterpriseAuthDTO.class, list));
}
@Override
......@@ -282,7 +286,7 @@ public class UnionEnterpriseAuthApiServiceImpl implements UnionEnterpriseAuthApi
@Override
public ServiceResponse<String> deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@NotNull Integer unionEnterpriseAuthId) {
int num = unionEnterpriseAuthAppService.deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(unionEnterpriseAuthId);
unionEnterpriseAuthAppService.deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(unionEnterpriseAuthId);
return ServiceResponse.success();
}
......
......@@ -144,7 +144,7 @@
and union_enterprise_auth_id = #{unionEnterpriseAuthId}
</select>
<select id="countRepeatStrategyName" resultType="Integer">
<select id="countRepeatStrategyName" resultType="int">
select count(1) from tab_sys_union_enterprise_auth_app
where delete_flag = 0
and union_enterprise_auth_id = #{unionEnterpriseAuthId}
......@@ -154,7 +154,7 @@
and strategy_name = #{strategyName}
</select>
<select id="deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId" resultType="Integer">
<select id="deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId" resultType="integer">
update tab_sys_union_enterprise_auth_app set delete_flag = 1
where delete_flag = 0
and union_enterprise_auth_id = #{unionEnterpriseAuthId}
......
......@@ -309,4 +309,14 @@
and status_flag = 4
</select>
<select id="listUnionEnterprise" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_union_enterprise_auth
where delete_flag = 0
and status_flag != 3
and own_enterprise_id = #{ownEnterpriseId}
</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