Commit 739423e4 by zhengxj

finish 订单渠道搜索 on 20190320 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18650 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent a181ee8b
...@@ -490,6 +490,11 @@ public class OrderController extends BaseController { ...@@ -490,6 +490,11 @@ public class OrderController extends BaseController {
@RequestMapping(value = "/getChannel", method = { RequestMethod.GET, RequestMethod.POST }) @RequestMapping(value = "/getChannel", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject getChannel(HttpServletRequest request) { public ResultObject getChannel(HttpServletRequest request) {
return new ResultObject(ResultCodeEnum.SUCCESS.getCode() , ResultCodeEnum.SUCCESS.getMsg(),orderChannelService.getChannel(UserUtils.getUserId(request))); Integer userId=UserUtils.getUserId(request);
if(userId==BizConstants.USER_TYPE_AMIN){
// 超级管理员特殊处理
userId=null;
}
return new ResultObject(ResultCodeEnum.SUCCESS.getCode() , ResultCodeEnum.SUCCESS.getMsg(),orderChannelService.getChannel(userId));
} }
} }
...@@ -228,7 +228,8 @@ public class OrderServiceImpl implements IOrderService { ...@@ -228,7 +228,8 @@ public class OrderServiceImpl implements IOrderService {
// //
// } // }
// 订单渠道过滤 // 订单渠道过滤
if(userId==0){ if (userId == 0){
// 超级管理员
criteria.andShopIdIn(orderChannelDao.getDataRight(null, null)); criteria.andShopIdIn(orderChannelDao.getDataRight(null, null));
}else{ }else{
criteria.andShopIdIn(orderChannelDao.getDataRight(userId, oueryOrderReq.getOrderChannel())); criteria.andShopIdIn(orderChannelDao.getDataRight(userId, oueryOrderReq.getOrderChannel()));
......
...@@ -299,14 +299,16 @@ ...@@ -299,14 +299,16 @@
and suo.user_id= #{userId} and suo.user_id= #{userId}
</select> </select>
<select id="getOrderChannel" resultType="com.glsx.ordercenter.pojo.SysOrganization"> <select id="getOrderChannel" resultType="com.glsx.ordercenter.pojo.SysOrganization">
SELECT SELECT DISTINCT
sys_organization.id,sys_organization.name sys_organization.id,sys_organization.name
FROM FROM
sys_organization sys_organization
LEFT JOIN sys_user_org ON sys_user_org.org_id = sys_organization.id LEFT JOIN sys_user_org ON sys_user_org.org_id = sys_organization.id
WHERE WHERE
sys_organization.parent_id = 0 sys_organization.parent_id = 0
<if test="userId !=null ">
and sys_user_org.user_id = #{userId} and sys_user_org.user_id = #{userId}
</if>
ORDER BY ORDER BY
sys_organization.id ASC sys_organization.id ASC
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!