Commit a181ee8b by zhengxj

finish 订单渠道搜索 on 20190319 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18641 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 16e1029a
......@@ -34,6 +34,6 @@ public interface SysOrganizationMapper {
List<SysOrganization> getOrderChannel(@Param("userId")Integer userId);
List<Integer> getDateRight(@Param("userId")Integer userId,@Param("groupId")Integer groupId);
List<Integer> getDataRight(@Param("userId")Integer userId,@Param("groupId")Integer groupId);
}
\ No newline at end of file
......@@ -30,8 +30,19 @@ public class SysUser {
private String remark;
private Byte userType;
private Integer groupId;
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
public Integer getId() {
public Integer getId() {
return id;
}
......
......@@ -228,8 +228,12 @@ public class OrderServiceImpl implements IOrderService {
//
// }
// 订单渠道过滤
if(userId==0){
criteria.andShopIdIn(orderChannelDao.getDataRight(null, null));
}else{
criteria.andShopIdIn(orderChannelDao.getDataRight(userId, oueryOrderReq.getOrderChannel()));
}
criteria.andShopIdIn(orderChannelDao.getDateRight(userId, oueryOrderReq.getOrderChannel()));
// 订单编号
if (oueryOrderReq.getOrderSn() != null) {
......@@ -436,14 +440,23 @@ public class OrderServiceImpl implements IOrderService {
// 订单地址信息
order.setArea(areaService.getAllChargeItems(order.getDistrict()));
// 渠道名称
if (order.getMerchantId() != null) {
// 经产品再次确认 为公司名称 而非门店名称
// sysUserDao.selectByPrimaryKey(order.getMerchantId());
// SysMerchantExample sysMerchantExample = new SysMerchantExample();
// sysMerchantExample.createCriteria().andUserIdEqualTo(order.getShopId());
// sysMerchantDao.selectByExample(sysMerchantExample);
order.setOrderChannel(sysUserDao.selectByPrimaryKey(order.getMerchantId()).getUsername());
}
// if (order.getMerchantId() != null) {
// // 经产品再次确认 为公司名称 而非门店名称
//// sysUserDao.selectByPrimaryKey(order.getMerchantId());
//// SysMerchantExample sysMerchantExample = new SysMerchantExample();
//// sysMerchantExample.createCriteria().andUserIdEqualTo(order.getShopId());
//// sysMerchantDao.selectByExample(sysMerchantExample);
// order.setOrderChannel(sysUserDao.selectByPrimaryKey(order.getMerchantId()).getUsername());
// }
// 渠道名称
if (oueryOrderReq.getOrderChannel() != null) {
order.setOrderChannel(orderChannelDao.selectByPrimaryKey(oueryOrderReq.getOrderChannel()).getName());
} else {
SysUser sysuser = sysUserDao.selectByPrimaryKey(order.getShopId());
order.setOrderChannel(orderChannelDao.selectByPrimaryKey(sysuser.getGroupId()).getName());
}
// 技工信息
if (order.getMechanicId() != null) {
MachanicInfo machanicInfo = new MachanicInfo();
......@@ -1202,6 +1215,8 @@ public class OrderServiceImpl implements IOrderService {
if (order.getMerchantId() != null) {
// SysMerchantExample example = new SysMerchantExample();
// example.createCriteria().andUserIdEqualTo(order.getMerchantId());
order.setOrderChannel(sysUserDao.selectByPrimaryKey(order.getMerchantId()).getName());
}
// 门店名称
......@@ -1846,8 +1861,7 @@ public class OrderServiceImpl implements IOrderService {
@Transactional
@Override
public ResultObject cancel(HttpServletRequest request, Integer orderId) {
// TODO Auto-generated method stub
public ResultObject cancel(HttpServletRequest request, Integer orderId) {
ResultObject result = null;
Integer userId = UserUtils.getUserId(request);
/*
......
......@@ -311,15 +311,17 @@
sys_organization.id ASC
</select>
<select id="getDateRight" resultType="Integer">
SELECT sys_user.id from sys_user
<select id="getDataRight" resultType="Integer">
SELECT DISTINCT sys_user.id from sys_user
LEFT JOIN
sys_organization ON sys_user.org_id = sys_organization.id
LEFT JOIN sys_user_org ON sys_user_org.org_id = sys_organization.id
WHERE
sys_organization.parent_id != 0
and sys_user.user_type =2
and sys_user_org.user_id = #{userId}
<if test="userId !=null ">
and sys_user.id = #{userId}
</if>
<if test="groupId !=null ">
and sys_user.group_id = #{groupId}
</if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!