Commit 687bb4a5 authored by WeiWei's avatar WeiWei

Merge remote-tracking branch 'cash-loan-flow-boss/v1' into v1

parents 6ee6de7e e106e7db
...@@ -38,7 +38,7 @@ public class ChannelConfController { ...@@ -38,7 +38,7 @@ public class ChannelConfController {
return Result.buildSuccess(channelConfService.getChannelInfo(pageNumber, pageSize, channelId)); return Result.buildSuccess(channelConfService.getChannelInfo(pageNumber, pageSize, channelId));
} }
@ChannelIdInit
@CheckChannelRole @CheckChannelRole
@GetMapping("/cfg/info") @GetMapping("/cfg/info")
public Result getChannelConfInfo(Long channelId) { public Result getChannelConfInfo(Long channelId) {
......
...@@ -27,10 +27,12 @@ import org.springframework.beans.BeanUtils; ...@@ -27,10 +27,12 @@ import org.springframework.beans.BeanUtils;
public class ChannelConfUtil { public class ChannelConfUtil {
public static final String channelRoleName = "channel_role";
public static final String channelIdParamName = "channelId"; public static final String channelIdParamName = "channelId";
public static ChannelConfVo channelConfConvertVOModel(ChannelConf channelConf) { public static ChannelConfVo channelConfConvertVOModel(ChannelConf channelConf) {
if (channelConf == null) {
return null;
}
ChannelConfBaseModel channelConfBaseModel = new ChannelConfBaseModel(); ChannelConfBaseModel channelConfBaseModel = new ChannelConfBaseModel();
BeanUtils.copyProperties(channelConf, channelConfBaseModel); BeanUtils.copyProperties(channelConf, channelConfBaseModel);
......
...@@ -6,6 +6,7 @@ import cn.quantgroup.cashloanflowboss.api.order.model.ApproveVo; ...@@ -6,6 +6,7 @@ import cn.quantgroup.cashloanflowboss.api.order.model.ApproveVo;
import cn.quantgroup.cashloanflowboss.api.order.model.OrderVo; import cn.quantgroup.cashloanflowboss.api.order.model.OrderVo;
import cn.quantgroup.cashloanflowboss.api.order.util.OrderUtil; import cn.quantgroup.cashloanflowboss.api.order.util.OrderUtil;
import cn.quantgroup.cashloanflowboss.api.user.model.UserSessionInfo; import cn.quantgroup.cashloanflowboss.api.user.model.UserSessionInfo;
import cn.quantgroup.cashloanflowboss.core.Application;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping; import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping;
import cn.quantgroup.cashloanflowboss.spi.clf.repository.ClfOrderMappingRepository; import cn.quantgroup.cashloanflowboss.spi.clf.repository.ClfOrderMappingRepository;
import cn.quantgroup.cashloanflowboss.spi.clotho.service.ClothoCenter; import cn.quantgroup.cashloanflowboss.spi.clotho.service.ClothoCenter;
...@@ -92,11 +93,10 @@ public class OrderService { ...@@ -92,11 +93,10 @@ public class OrderService {
return false; return false;
} }
// 可以查看Application.getPrincipal()方法 if (Application.getPrincipal().isChannel() && !Application.getPrincipal().isSameChannel(orderMapping.getRegisteredFrom())) {
// UserSessionInfo userSessionInfo = userSessionService.findUserSessionInfo(); log.info("approveOpt,审批失败,不是该渠道订单无法审批 channelOrderNumber={}", approveVo.getChannelOrderNumber());
// if (!userSessionInfo.getChannelId().equals(orderMapping.getRegisteredFrom())) { return false;
// }
// }
XUser xUser = xyqbUserService.findXUserById(orderMapping.getQgUserId()); XUser xUser = xyqbUserService.findXUserById(orderMapping.getQgUserId());
if (xUser == null) { if (xUser == null) {
......
...@@ -49,18 +49,9 @@ public class RoleLoadAspect { ...@@ -49,18 +49,9 @@ public class RoleLoadAspect {
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);
if (annotation != null && ChannelConfUtil.channelRoleName.equals(Application.getPrincipal().getChannelId())) { if (annotation != null && Application.getPrincipal().isChannel()) {
String[] paramNames = ((CodeSignature) pjp.getSignature()).getParameterNames(); String[] paramNames = ((CodeSignature) pjp.getSignature()).getParameterNames();
for (int i = 0; i < paramNames.length; i++) { for (int i = 0; i < paramNames.length; i++) {
if (ChannelConfUtil.channelIdParamName.equals(paramNames[i])) { if (ChannelConfUtil.channelIdParamName.equals(paramNames[i])) {
...@@ -85,7 +76,7 @@ public class RoleLoadAspect { ...@@ -85,7 +76,7 @@ public class RoleLoadAspect {
return Result.buildFial(ApplicationStatus.ARGUMENT_VALID_EXCEPTION); return Result.buildFial(ApplicationStatus.ARGUMENT_VALID_EXCEPTION);
} }
requestChannelId = Long.valueOf(String.valueOf(requestChannelIdObj)); requestChannelId = Long.valueOf(String.valueOf(requestChannelIdObj));
if (Application.getPrincipal().isSameChannel(requestChannelId)) { if (!Application.getPrincipal().isSameChannel(requestChannelId)) {
log.info("[CheckChannelRole]渠道用户,登陆channelId与查询channelId不是同一个"); log.info("[CheckChannelRole]渠道用户,登陆channelId与查询channelId不是同一个");
return Result.buildFial(ApplicationStatus.INVALID_AUTHORITY); return Result.buildFial(ApplicationStatus.INVALID_AUTHORITY);
} }
...@@ -103,7 +94,7 @@ public class RoleLoadAspect { ...@@ -103,7 +94,7 @@ public class RoleLoadAspect {
requestChannelId = channelIdTemp; requestChannelId = channelIdTemp;
} }
} }
if (Application.getPrincipal().isSameChannel(requestChannelId)) { if (!Application.getPrincipal().isSameChannel(requestChannelId)) {
log.info("[CheckChannelRole]渠道用户,登陆channelId与查询channelId不是同一个"); log.info("[CheckChannelRole]渠道用户,登陆channelId与查询channelId不是同一个");
return Result.buildFial(ApplicationStatus.INVALID_AUTHORITY); return Result.buildFial(ApplicationStatus.INVALID_AUTHORITY);
} }
......
...@@ -26,7 +26,7 @@ public interface ClothoCenter { ...@@ -26,7 +26,7 @@ public interface ClothoCenter {
@Override @Override
public String approve(Map approveData) { public String approve(Map approveData) {
return "error"; return "error1";
} }
} }
} }
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