Commit c4a51191 by zhengxj

finish 订单渠道搜索 on 20190319 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18634 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 2f9f2348
...@@ -34,4 +34,6 @@ public interface SysOrganizationMapper { ...@@ -34,4 +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);
} }
\ No newline at end of file \ No newline at end of file
...@@ -77,6 +77,7 @@ import com.glsx.ordercenter.mapper.SysMerchantMapper; ...@@ -77,6 +77,7 @@ import com.glsx.ordercenter.mapper.SysMerchantMapper;
import com.glsx.ordercenter.mapper.SysOrderMapper; import com.glsx.ordercenter.mapper.SysOrderMapper;
import com.glsx.ordercenter.mapper.SysOrderRepairMapper; import com.glsx.ordercenter.mapper.SysOrderRepairMapper;
import com.glsx.ordercenter.mapper.SysOrderStatusMapper; import com.glsx.ordercenter.mapper.SysOrderStatusMapper;
import com.glsx.ordercenter.mapper.SysOrganizationMapper;
import com.glsx.ordercenter.mapper.SysUserMapper; import com.glsx.ordercenter.mapper.SysUserMapper;
import com.glsx.ordercenter.pojo.SysOrder; import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderExample; import com.glsx.ordercenter.pojo.SysOrderExample;
...@@ -139,6 +140,9 @@ public class OrderServiceImpl implements IOrderService { ...@@ -139,6 +140,9 @@ public class OrderServiceImpl implements IOrderService {
@Autowired @Autowired
private CarBrandClient carBrandClient; private CarBrandClient carBrandClient;
@Autowired
private SysOrganizationMapper orderChannelDao;
/** /**
* *
*/ */
...@@ -216,13 +220,16 @@ public class OrderServiceImpl implements IOrderService { ...@@ -216,13 +220,16 @@ public class OrderServiceImpl implements IOrderService {
// TODO 根据用户类型管理订单 // TODO 根据用户类型管理订单
// 如果当前用户是商户 限制搜索范围 // 如果当前用户是商户 限制搜索范围
byte userType = user.getByte("userType"); byte userType = user.getByte("userType");
if (userType == 1) { // if (userType == 1) {
// SysMerchantExample sysMerchantExample = new SysMerchantExample(); //// SysMerchantExample sysMerchantExample = new SysMerchantExample();
// sysMerchantExample.createCriteria().andUserIdEqualTo(userId); //// sysMerchantExample.createCriteria().andUserIdEqualTo(userId);
// SysMerchant sysMerchant = sysMerchantDao.selectByExample(sysMerchantExample).get(0); //// SysMerchant sysMerchant = sysMerchantDao.selectByExample(sysMerchantExample).get(0);
criteria.andMerchantIdEqualTo(userId); // criteria.andMerchantIdEqualTo(userId);
//
// }
// 订单渠道过滤
} criteria.andShopIdIn(orderChannelDao.getDateRight(userId, oueryOrderReq.getOrderChannel()));
// 订单编号 // 订单编号
if (oueryOrderReq.getOrderSn() != null) { if (oueryOrderReq.getOrderSn() != null) {
...@@ -230,16 +237,16 @@ public class OrderServiceImpl implements IOrderService { ...@@ -230,16 +237,16 @@ public class OrderServiceImpl implements IOrderService {
} }
// 订单渠道 如果当前用户是商户只能搜索当前商户的订单 // 订单渠道 如果当前用户是商户只能搜索当前商户的订单
if (oueryOrderReq.getOrderChannel() != null) { // if (oueryOrderReq.getOrderChannel() != null) {
// criteria.andShopIdEqualTo(value) //// criteria.andShopIdEqualTo(value)
if(userType == 0){ // if(userType == 0){
// TODO 查出该用户拥有的数据权限 //// TODO 查出该用户拥有的数据权限
List<Integer> merIds=new ArrayList<>(); // List<Integer> merIds=new ArrayList<>();
criteria.andMerchantIdIn(merIds); // criteria.andMerchantIdIn(merIds);
//
} // }
criteria.andMerchantIdEqualTo(oueryOrderReq.getOrderChannel()); // criteria.andMerchantIdEqualTo(oueryOrderReq.getOrderChannel());
} // }
// 服务类型 // 服务类型
if (oueryOrderReq.getServiceType() != null) { if (oueryOrderReq.getServiceType() != null) {
...@@ -334,7 +341,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -334,7 +341,7 @@ public class OrderServiceImpl implements IOrderService {
// 已完成(状态8)、 // 已完成(状态8)、
// 已拒绝(状态3) // 已拒绝(状态3)
criteria.andMerchantIdEqualTo(userId); // criteria.andMerchantIdEqualTo(userId);
if (orderStatus != null) { if (orderStatus != null) {
switch (orderStatus) { switch (orderStatus) {
case 0: case 0:
......
##\u5f00\u53d1\u4e2d\u9700\u8981\u8bfb\u53d6\u7684\u914d\u7f6e\u6587\u4ef6 ##\u5f00\u53d1\u4e2d\u9700\u8981\u8bfb\u53d6\u7684\u914d\u7f6e\u6587\u4ef6
spring.profiles.active=test spring.profiles.active=local
server.servlet.context-path=/carservice/ordercenter server.servlet.context-path=/carservice/ordercenter
......
spring.datasource.name=dev spring.datasource.name=dev
spring.datasource.url=jdbc:mysql://192.168.0.39:3306/glsx_car_service #spring.datasource.url=jdbc:mysql://192.168.0.39:3306/glsx_car_service
#spring.datasource.username=root
#spring.datasource.password=123456
spring.datasource.url=jdbc:mysql://14.17.100.222:3307/glsx_car_service
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=123456 spring.datasource.password=Msd^*$@online
#spring.datasource.connectionProperties="config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANj300lzSmW05DuzVoluFG6oza+WlEbv2aYCQA2+pkf0mE4p19UAcxfY/BweOyJ6TBNoY5XebPqoiav5lsKVD6sCAwEAAQ==" #spring.datasource.connectionProperties="config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANj300lzSmW05DuzVoluFG6oza+WlEbv2aYCQA2+pkf0mE4p19UAcxfY/BweOyJ6TBNoY5XebPqoiav5lsKVD6sCAwEAAQ=="
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......
spring.datasource.name=test spring.datasource.name=test
spring.datasource.url=jdbc:mysql://192.168.3.222:3307/glsx_car_service #spring.datasource.url=jdbc:mysql://192.168.3.222:3307/glsx_car_service
spring.datasource.username=biz_car_service #spring.datasource.username=biz_car_service
spring.datasource.password=jiuir29e #spring.datasource.password=jiuir29e
spring.datasource.url=jdbc:mysql://14.17.100.222:3307/glsx_car_service
spring.datasource.username=root
spring.datasource.password=Msd^*$@online
#spring.datasource.connectionProperties="config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANj300lzSmW05DuzVoluFG6oza+WlEbv2aYCQA2+pkf0mE4p19UAcxfY/BweOyJ6TBNoY5XebPqoiav5lsKVD6sCAwEAAQ==" #spring.datasource.connectionProperties="config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANj300lzSmW05DuzVoluFG6oza+WlEbv2aYCQA2+pkf0mE4p19UAcxfY/BweOyJ6TBNoY5XebPqoiav5lsKVD6sCAwEAAQ=="
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......
...@@ -310,4 +310,19 @@ ...@@ -310,4 +310,19 @@
ORDER BY ORDER BY
sys_organization.id ASC sys_organization.id ASC
</select> </select>
<select id="getDateRight" resultType="Integer">
SELECT 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="groupId !=null ">
and sys_user.group_id = #{groupId}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!