Commit f899478b by zhengxj

finish 解决小程序端订单列表报错问题 on 20190321 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18767 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 83b57fac
......@@ -40,6 +40,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.glsx.common.annotation.AuthCheck;
import com.glsx.common.constants.ResultObject;
......@@ -92,6 +93,10 @@ public class OrderController extends BaseController {
// TODO 获取当前用户信息 根据用户角色筛选订单
// int userId = UserUtils.getUserId(request);
if(oueryOrderReq!=null){
logger.info("订单搜索传递的参数:"+JSONObject.toJSONString(oueryOrderReq));
}
// SysUser sysUser =orderService.getUser(UserUtils.getUserId(request));
SysOrderExample example = new SysOrderExample();
// sysUser.setUserType(userType);
......
......@@ -38,4 +38,7 @@ import com.glsx.ordercenter.pojo.SysOrganization;
public interface IOrderChannelService {
List<SysOrganization> getChannel(Integer userId);
List<Integer> getDataRight (Integer userId, Byte userType,Integer channel);
}
......@@ -24,11 +24,13 @@
*/
package com.glsx.ordercenter.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.glsx.ordercenter.constants.BizConstants;
import com.glsx.ordercenter.mapper.SysOrganizationMapper;
import com.glsx.ordercenter.pojo.SysOrganization;
import com.glsx.ordercenter.service.IOrderChannelService;
......@@ -46,6 +48,11 @@ public class OrderChannelImpl implements IOrderChannelService {
@Autowired
private SysOrganizationMapper sysOrganizationDao;
@Autowired
private SysOrganizationMapper orderChannelDao;
/* (non-Javadoc)
* @see com.glsx.ordercenter.service.IOrderChannel#getChannel(java.lang.Integer)
*/
......@@ -54,5 +61,20 @@ public class OrderChannelImpl implements IOrderChannelService {
// TODO Auto-generated method stub
return sysOrganizationDao.getOrderChannel(userId);
}
/* (non-Javadoc)
* @see com.glsx.ordercenter.service.IOrderChannelService#getDataRight(java.lang.Integer, java.lang.Byte)
*/
@Override
public List<Integer> getDataRight(Integer userId, Byte userType,Integer channel) {
List<Integer> dataRight = new ArrayList<>();
if (userId == BizConstants.USER_TYPE_AMIN) {
// 超级管理员
dataRight = orderChannelDao.getDataRight(null, channel);
} else {
dataRight = orderChannelDao.getDataRight(userId, channel);
}
return dataRight;
}
}
......@@ -94,6 +94,7 @@ import com.glsx.ordercenter.pojo.user.SysMerchantExample;
import com.glsx.ordercenter.pojo.user.SysUser;
import com.glsx.ordercenter.pojo.user.SysUserExample;
import com.glsx.ordercenter.service.IAreaService;
import com.glsx.ordercenter.service.IOrderChannelService;
import com.glsx.ordercenter.service.IOrderService;
import com.glsx.ordercenter.service.IResourceMatchingService;
......@@ -143,6 +144,12 @@ public class OrderServiceImpl implements IOrderService {
@Autowired
private SysOrganizationMapper orderChannelDao;
@Autowired
private IOrderChannelService orderChannelService;
/**
*
......@@ -225,15 +232,10 @@ public class OrderServiceImpl implements IOrderService {
byte userType = user.getByte("userType");
//
// 订单渠道过滤
List<Integer> dataRight = new ArrayList<>();
List<Integer> dataRight =null;
// 非服务商用户 按数据权限获取订单数据
if (BizConstants.USER_TYPE_MERCHANT != userType){
if (userId == BizConstants.USER_TYPE_AMIN) {
// 超级管理员
dataRight = orderChannelDao.getDataRight(null, oueryOrderReq.getOrderChannel());
} else {
dataRight = orderChannelDao.getDataRight(userId, oueryOrderReq.getOrderChannel());
}
dataRight=orderChannelService.getDataRight(userId, userType, oueryOrderReq.getOrderChannel());
if (dataRight == null || dataRight.size() == 0) {
// 集团下无商户
logger.info("");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!