Commit 39e23811 by zhengxj

finish 获取用户订单渠道 on 20190319 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18627 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent cfe8d8e6
...@@ -56,5 +56,14 @@ public interface BizConstants { ...@@ -56,5 +56,14 @@ public interface BizConstants {
* 订单是否取消。0.已取消 * 订单是否取消。0.已取消
*/ */
public static final int ORDER_CANCELED = 0; public static final int ORDER_CANCELED = 0;
/**
* 用户类型(0:系统管理员,1:服务商,2:门店,3:技工)
*/
public static final byte USER_TYPE_AMIN = 0;
public static final byte USER_TYPE_MERCHANT = 1;
public static final byte USER_TYPE_SHOP = 2;
public static final byte USER_TYPE_MECHANIC = 3;
} }
...@@ -62,6 +62,7 @@ import com.glsx.ordercenter.dto.ServiceItemScale; ...@@ -62,6 +62,7 @@ import com.glsx.ordercenter.dto.ServiceItemScale;
import com.glsx.ordercenter.pojo.SysOrder; import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderExample; import com.glsx.ordercenter.pojo.SysOrderExample;
import com.glsx.ordercenter.pojo.SysOrderStatus; import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.service.IOrderChannelService;
import com.glsx.ordercenter.service.IOrderService; import com.glsx.ordercenter.service.IOrderService;
/** /**
...@@ -77,6 +78,10 @@ public class OrderController extends BaseController { ...@@ -77,6 +78,10 @@ public class OrderController extends BaseController {
@Autowired @Autowired
private IOrderService orderService; private IOrderService orderService;
@Autowired
private IOrderChannelService orderChannelService;
@SuppressWarnings("resource") @SuppressWarnings("resource")
@RequestMapping(value = "/getByParams", method = { RequestMethod.GET, RequestMethod.POST }) @RequestMapping(value = "/getByParams", method = { RequestMethod.GET, RequestMethod.POST })
...@@ -472,4 +477,19 @@ public class OrderController extends BaseController { ...@@ -472,4 +477,19 @@ public class OrderController extends BaseController {
ResultObject result = orderService.getOrderByUserId(userId); ResultObject result = orderService.getOrderByUserId(userId);
return result; return result;
} }
/**
*
* @author zhengxj
* @Title: getChannel
* @Description: 获取订单渠道
* @return ResultObject
*
*/
@RequestMapping(value = "/getChannel", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject getChannel(HttpServletRequest request) {
return new ResultObject(ResultCodeEnum.SUCCESS.getCode() , ResultCodeEnum.SUCCESS.getMsg(),orderChannelService.getChannel(UserUtils.getUserId(request)));
}
} }
package com.glsx.ordercenter.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.glsx.ordercenter.pojo.SysOrganization;
import com.glsx.ordercenter.pojo.SysOrganizationExample;
public interface SysOrganizationMapper {
long countByExample(SysOrganizationExample example);
List<SysOrganization> selectByExample(SysOrganizationExample example);
SysOrganization selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysOrganization record);
List<SysOrganization> findOrgByParams(Map map);
List<SysOrganization> findOrgByParentId(@Param("id")Integer id);
List<SysOrganization> getAllGroupByParentId(@Param("id")Integer id,@Param("parentId")Integer parentId);
SysOrganization selectDetailById(Integer id);
List<Integer> selectOrgByUserId(@Param("userId")Integer userId);
List<SysOrganization> getOrderChannel(@Param("userId")Integer userId);
}
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.pojo;
import java.util.Date;
import java.util.List;
public class SysOrganization {
private Integer id;
private Integer parentId;
private String name;
private Byte orgStatus;
private Byte orgType;
private Integer sort;
private Date createTime;
private Date updateTime;
private String remark;
private String updateBy;
private String createBy;
private Byte label;
private String orgGroup;
private String parentName;
private List<SysOrganization> children;
public List<SysOrganization> getChildren() {
return children;
}
public void setChildren(List<SysOrganization> children) {
this.children = children;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Byte getOrgStatus() {
return orgStatus;
}
public void setOrgStatus(Byte orgStatus) {
this.orgStatus = orgStatus;
}
public Byte getOrgType() {
return orgType;
}
public void setOrgType(Byte orgType) {
this.orgType = orgType;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public Byte getLabel() {
return label;
}
public void setLabel(Byte label) {
this.label = label;
}
public String getOrgGroup() {
return orgGroup;
}
public void setOrgGroup(String orgGroup) {
this.orgGroup = orgGroup == null ? null : orgGroup.trim();
}
/**
* @return the parentName
*/
public String getParentName() {
return parentName;
}
/**
* @param parentName the parentName to set
*/
public void setParentName(String parentName) {
this.parentName = parentName;
}
}
\ No newline at end of file \ No newline at end of file
/*
* Copyright (c) 2018, 2028, glsx and/or its affiliates. All rights reserved.
* GLSX PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.glsx.ordercenter.service;
import java.util.List;
import com.glsx.ordercenter.pojo.SysOrganization;
/**
* @ClassName: IOrderChannel
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Zheng Xiajun
* @date 2019年3月19日
*
*/
public interface IOrderChannelService {
List<SysOrganization> getChannel(Integer userId);
}
...@@ -165,5 +165,6 @@ public interface IOrderService { ...@@ -165,5 +165,6 @@ public interface IOrderService {
ResultObject assignMechanic(HttpServletRequest request, Integer orderId, ResultObject assignMechanic(HttpServletRequest request, Integer orderId,
Integer userId); Integer userId);
ResultObject getOrderByUserId( Integer userId); ResultObject getOrderByUserId( Integer userId);
} }
/*
* Copyright (c) 2018, 2028, glsx and/or its affiliates. All rights reserved.
* GLSX PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.glsx.ordercenter.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.glsx.ordercenter.mapper.SysOrganizationMapper;
import com.glsx.ordercenter.pojo.SysOrganization;
import com.glsx.ordercenter.service.IOrderChannelService;
/**
* @ClassName: OrderChannel
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Zheng Xiajun
* @date 2019年3月19日
*
*/
@Service
public class OrderChannelImpl implements IOrderChannelService {
@Autowired
private SysOrganizationMapper sysOrganizationDao;
/* (non-Javadoc)
* @see com.glsx.ordercenter.service.IOrderChannel#getChannel(java.lang.Integer)
*/
@Override
public List<SysOrganization> getChannel(Integer userId) {
// TODO Auto-generated method stub
return sysOrganizationDao.getOrderChannel(userId);
}
}
...@@ -232,6 +232,12 @@ public class OrderServiceImpl implements IOrderService { ...@@ -232,6 +232,12 @@ public class OrderServiceImpl implements IOrderService {
// 订单渠道 如果当前用户是商户只能搜索当前商户的订单 // 订单渠道 如果当前用户是商户只能搜索当前商户的订单
if (oueryOrderReq.getOrderChannel() != null) { if (oueryOrderReq.getOrderChannel() != null) {
// criteria.andShopIdEqualTo(value) // criteria.andShopIdEqualTo(value)
if(userType == 0){
// TODO 查出该用户拥有的数据权限
List<Integer> merIds=new ArrayList<>();
criteria.andMerchantIdIn(merIds);
}
criteria.andMerchantIdEqualTo(oueryOrderReq.getOrderChannel()); criteria.andMerchantIdEqualTo(oueryOrderReq.getOrderChannel());
} }
...@@ -2050,6 +2056,5 @@ public class OrderServiceImpl implements IOrderService { ...@@ -2050,6 +2056,5 @@ public class OrderServiceImpl implements IOrderService {
} }
return null; return null;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!