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