Commit e106e7db authored by suntao's avatar suntao

suntao

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