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
......@@ -32,6 +32,8 @@ public interface SysOrganizationMapper {
List<Integer> selectOrgByUserId(@Param("userId")Integer userId);
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
......@@ -77,6 +77,7 @@ import com.glsx.ordercenter.mapper.SysMerchantMapper;
import com.glsx.ordercenter.mapper.SysOrderMapper;
import com.glsx.ordercenter.mapper.SysOrderRepairMapper;
import com.glsx.ordercenter.mapper.SysOrderStatusMapper;
import com.glsx.ordercenter.mapper.SysOrganizationMapper;
import com.glsx.ordercenter.mapper.SysUserMapper;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderExample;
......@@ -139,6 +140,9 @@ public class OrderServiceImpl implements IOrderService {
@Autowired
private CarBrandClient carBrandClient;
@Autowired
private SysOrganizationMapper orderChannelDao;
/**
*
*/
......@@ -216,13 +220,16 @@ public class OrderServiceImpl implements IOrderService {
// TODO 根据用户类型管理订单
// 如果当前用户是商户 限制搜索范围
byte userType = user.getByte("userType");
if (userType == 1) {
// SysMerchantExample sysMerchantExample = new SysMerchantExample();
// sysMerchantExample.createCriteria().andUserIdEqualTo(userId);
// SysMerchant sysMerchant = sysMerchantDao.selectByExample(sysMerchantExample).get(0);
criteria.andMerchantIdEqualTo(userId);
}
// if (userType == 1) {
//// SysMerchantExample sysMerchantExample = new SysMerchantExample();
//// sysMerchantExample.createCriteria().andUserIdEqualTo(userId);
//// SysMerchant sysMerchant = sysMerchantDao.selectByExample(sysMerchantExample).get(0);
// criteria.andMerchantIdEqualTo(userId);
//
// }
// 订单渠道过滤
criteria.andShopIdIn(orderChannelDao.getDateRight(userId, oueryOrderReq.getOrderChannel()));
// 订单编号
if (oueryOrderReq.getOrderSn() != null) {
......@@ -230,16 +237,16 @@ public class OrderServiceImpl implements IOrderService {
}
// 订单渠道 如果当前用户是商户只能搜索当前商户的订单
if (oueryOrderReq.getOrderChannel() != null) {
// criteria.andShopIdEqualTo(value)
if(userType == 0){
// TODO 查出该用户拥有的数据权限
List<Integer> merIds=new ArrayList<>();
criteria.andMerchantIdIn(merIds);
}
criteria.andMerchantIdEqualTo(oueryOrderReq.getOrderChannel());
}
// if (oueryOrderReq.getOrderChannel() != null) {
//// criteria.andShopIdEqualTo(value)
// if(userType == 0){
//// TODO 查出该用户拥有的数据权限
// List<Integer> merIds=new ArrayList<>();
// criteria.andMerchantIdIn(merIds);
//
// }
// criteria.andMerchantIdEqualTo(oueryOrderReq.getOrderChannel());
// }
// 服务类型
if (oueryOrderReq.getServiceType() != null) {
......@@ -334,7 +341,7 @@ public class OrderServiceImpl implements IOrderService {
// 已完成(状态8)、
// 已拒绝(状态3)
criteria.andMerchantIdEqualTo(userId);
// criteria.andMerchantIdEqualTo(userId);
if (orderStatus != null) {
switch (orderStatus) {
case 0:
......
##\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
......
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.password=123456
spring.datasource.password=Msd^*$@online
#spring.datasource.connectionProperties="config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANj300lzSmW05DuzVoluFG6oza+WlEbv2aYCQA2+pkf0mE4p19UAcxfY/BweOyJ6TBNoY5XebPqoiav5lsKVD6sCAwEAAQ=="
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......
spring.datasource.name=test
spring.datasource.url=jdbc:mysql://192.168.3.222:3307/glsx_car_service
spring.datasource.username=biz_car_service
spring.datasource.password=jiuir29e
#spring.datasource.url=jdbc:mysql://192.168.3.222:3307/glsx_car_service
#spring.datasource.username=biz_car_service
#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.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......
......@@ -310,4 +310,19 @@
ORDER BY
sys_organization.id ASC
</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>
\ No newline at end of file
......@@ -68,7 +68,7 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_user
from sys_user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!