Commit 59c85911 authored by suntao's avatar suntao

审批

parent 3f18c965
...@@ -6,9 +6,7 @@ import cn.quantgroup.cashloanflowboss.core.annotation.ChannelIdInit; ...@@ -6,9 +6,7 @@ import cn.quantgroup.cashloanflowboss.core.annotation.ChannelIdInit;
import cn.quantgroup.cashloanflowboss.core.annotation.CheckChannelRole; import cn.quantgroup.cashloanflowboss.core.annotation.CheckChannelRole;
import cn.quantgroup.cashloanflowboss.core.base.Result; import cn.quantgroup.cashloanflowboss.core.base.Result;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid; import javax.validation.Valid;
...@@ -28,14 +26,14 @@ public class OrderController { ...@@ -28,14 +26,14 @@ public class OrderController {
@ChannelIdInit @ChannelIdInit
@CheckChannelRole @CheckChannelRole
@RequestMapping("/info") @GetMapping("/info")
public Result getOrders(Long channelId, String channelOrderNumber, Integer pageNumber, Integer pageSize) { public Result getOrders(Long channelId, String channelOrderNumber, Integer pageNumber, Integer pageSize) {
return Result.buildSuccess(orderService.getOrders(channelId, channelOrderNumber, pageNumber, pageSize)); return Result.buildSuccess(orderService.getOrders(channelId, channelOrderNumber, pageNumber, pageSize));
} }
@ChannelIdInit @ChannelIdInit
@CheckChannelRole @CheckChannelRole
@RequestMapping("/approve") @PostMapping("/approve")
public Result approveOpt(@RequestBody @Valid ApproveVo approveVo) { public Result approveOpt(@RequestBody @Valid ApproveVo approveVo) {
return Result.buildSuccess(orderService.approveOpt(approveVo)); return Result.buildSuccess(orderService.approveOpt(approveVo));
} }
......
...@@ -34,21 +34,37 @@ import java.lang.reflect.Method; ...@@ -34,21 +34,37 @@ import java.lang.reflect.Method;
@Slf4j @Slf4j
@Component @Component
@Aspect @Aspect
@Order(1) @Order(Ordered.LOWEST_PRECEDENCE)
public class RoleLoadAspect { public class RoleLoadAspect {
@Autowired @Autowired
private UserSessionService userSessionService; private UserSessionService userSessionService;
@Pointcut("execution(* cn.quantgroup.cashloanflowboss.api.*.controller.*.*(..))") @Pointcut("execution(* cn.quantgroup.cashloanflowboss.api.channel.controller.*.*(..))")
private void channelRoleInit() {} private void channelController() {}
@Pointcut("execution(* cn.quantgroup.cashloanflowboss.api.order.controller.*.*(..))")
private void orderController() {}
@Around(value = "channelRoleInit()") @Pointcut("channelController() || orderController() ")
private void doSomeRole() {}
@Around(value = "doSomeRole()")
public Object around(ProceedingJoinPoint pjp) { public Object around(ProceedingJoinPoint pjp) {
Object[] args = pjp.getArgs(); Object[] args = pjp.getArgs();
MethodSignature methodSignature = (MethodSignature) pjp.getSignature(); MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
Method method = methodSignature.getMethod(); Method method = methodSignature.getMethod();
// if ("login".equals(method.getName())) {
// try {
// return pjp.proceed(args);
// } catch (Throwable throwable) {
// log.error("请求失败,e={}", ExceptionUtils.getStackTrace(throwable));
// return Result.buildFial();
// }
// }
// 如果是渠道用户登陆 默认加载channelId // 如果是渠道用户登陆 默认加载channelId
ChannelIdInit annotation = method.getAnnotation(ChannelIdInit.class); ChannelIdInit annotation = method.getAnnotation(ChannelIdInit.class);
UserSessionInfo userSessionInfo = userSessionService.findUserSessionInfo(); UserSessionInfo userSessionInfo = userSessionService.findUserSessionInfo();
......
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