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 { ...@@ -34,6 +34,6 @@ public interface SysOrganizationMapper {
List<SysOrganization> getOrderChannel(@Param("userId")Integer userId); 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 \ No newline at end of file
...@@ -30,8 +30,19 @@ public class SysUser { ...@@ -30,8 +30,19 @@ public class SysUser {
private String remark; private String remark;
private Byte userType; 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; return id;
} }
......
...@@ -228,8 +228,12 @@ public class OrderServiceImpl implements IOrderService { ...@@ -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) { if (oueryOrderReq.getOrderSn() != null) {
...@@ -436,14 +440,23 @@ public class OrderServiceImpl implements IOrderService { ...@@ -436,14 +440,23 @@ public class OrderServiceImpl implements IOrderService {
// 订单地址信息 // 订单地址信息
order.setArea(areaService.getAllChargeItems(order.getDistrict())); order.setArea(areaService.getAllChargeItems(order.getDistrict()));
// 渠道名称 // 渠道名称
if (order.getMerchantId() != null) { // if (order.getMerchantId() != null) {
// 经产品再次确认 为公司名称 而非门店名称 // // 经产品再次确认 为公司名称 而非门店名称
// sysUserDao.selectByPrimaryKey(order.getMerchantId()); //// sysUserDao.selectByPrimaryKey(order.getMerchantId());
// SysMerchantExample sysMerchantExample = new SysMerchantExample(); //// SysMerchantExample sysMerchantExample = new SysMerchantExample();
// sysMerchantExample.createCriteria().andUserIdEqualTo(order.getShopId()); //// sysMerchantExample.createCriteria().andUserIdEqualTo(order.getShopId());
// sysMerchantDao.selectByExample(sysMerchantExample); //// sysMerchantDao.selectByExample(sysMerchantExample);
order.setOrderChannel(sysUserDao.selectByPrimaryKey(order.getMerchantId()).getUsername()); // 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) { if (order.getMechanicId() != null) {
MachanicInfo machanicInfo = new MachanicInfo(); MachanicInfo machanicInfo = new MachanicInfo();
...@@ -1202,6 +1215,8 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1202,6 +1215,8 @@ public class OrderServiceImpl implements IOrderService {
if (order.getMerchantId() != null) { if (order.getMerchantId() != null) {
// SysMerchantExample example = new SysMerchantExample(); // SysMerchantExample example = new SysMerchantExample();
// example.createCriteria().andUserIdEqualTo(order.getMerchantId()); // example.createCriteria().andUserIdEqualTo(order.getMerchantId());
order.setOrderChannel(sysUserDao.selectByPrimaryKey(order.getMerchantId()).getName()); order.setOrderChannel(sysUserDao.selectByPrimaryKey(order.getMerchantId()).getName());
} }
// 门店名称 // 门店名称
...@@ -1846,8 +1861,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1846,8 +1861,7 @@ public class OrderServiceImpl implements IOrderService {
@Transactional @Transactional
@Override @Override
public ResultObject cancel(HttpServletRequest request, Integer orderId) { public ResultObject cancel(HttpServletRequest request, Integer orderId) {
// TODO Auto-generated method stub
ResultObject result = null; ResultObject result = null;
Integer userId = UserUtils.getUserId(request); Integer userId = UserUtils.getUserId(request);
/* /*
......
...@@ -311,15 +311,17 @@ ...@@ -311,15 +311,17 @@
sys_organization.id ASC sys_organization.id ASC
</select> </select>
<select id="getDateRight" resultType="Integer"> <select id="getDataRight" resultType="Integer">
SELECT sys_user.id from sys_user SELECT DISTINCT sys_user.id from sys_user
LEFT JOIN LEFT JOIN
sys_organization ON sys_user.org_id = sys_organization.id sys_organization ON sys_user.org_id = sys_organization.id
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
and sys_user.user_type =2 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 "> <if test="groupId !=null ">
and sys_user.group_id = #{groupId} and sys_user.group_id = #{groupId}
</if> </if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!