Commit 59c85911 authored by suntao's avatar suntao

审批

parent 3f18c965
......@@ -6,9 +6,7 @@ import cn.quantgroup.cashloanflowboss.core.annotation.ChannelIdInit;
import cn.quantgroup.cashloanflowboss.core.annotation.CheckChannelRole;
import cn.quantgroup.cashloanflowboss.core.base.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
......@@ -28,14 +26,14 @@ public class OrderController {
@ChannelIdInit
@CheckChannelRole
@RequestMapping("/info")
@GetMapping("/info")
public Result getOrders(Long channelId, String channelOrderNumber, Integer pageNumber, Integer pageSize) {
return Result.buildSuccess(orderService.getOrders(channelId, channelOrderNumber, pageNumber, pageSize));
}
@ChannelIdInit
@CheckChannelRole
@RequestMapping("/approve")
@PostMapping("/approve")
public Result approveOpt(@RequestBody @Valid ApproveVo approveVo) {
return Result.buildSuccess(orderService.approveOpt(approveVo));
}
......
......@@ -34,21 +34,37 @@ import java.lang.reflect.Method;
@Slf4j
@Component
@Aspect
@Order(1)
@Order(Ordered.LOWEST_PRECEDENCE)
public class RoleLoadAspect {
@Autowired
private UserSessionService userSessionService;
@Pointcut("execution(* cn.quantgroup.cashloanflowboss.api.*.controller.*.*(..))")
private void channelRoleInit() {}
@Pointcut("execution(* cn.quantgroup.cashloanflowboss.api.channel.controller.*.*(..))")
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) {
Object[] args = pjp.getArgs();
MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
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
ChannelIdInit annotation = method.getAnnotation(ChannelIdInit.class);
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