技师列表条件筛选,未支付订单取消
This commit is contained in:
parent
0618ec99e2
commit
d7ecfab561
|
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.sqx.modules.artificer.entity.ArtificerClassify;
|
import com.sqx.modules.artificer.entity.ArtificerClassify;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ArtificerClassifyDao extends BaseMapper<ArtificerClassify> {
|
public interface ArtificerClassifyDao extends BaseMapper<ArtificerClassify> {
|
||||||
|
List<Long> getUserIdByClassify(List<Long> classifyIdList);
|
||||||
}
|
}
|
|
@ -22,7 +22,7 @@ public interface ArtificerDao extends BaseMapper<Artificer> {
|
||||||
@Param("authentication") Integer authentication,@Param("by") Integer by,
|
@Param("authentication") Integer authentication,@Param("by") Integer by,
|
||||||
@Param("status") Integer status,@Param("city") String city,
|
@Param("status") Integer status,@Param("city") String city,
|
||||||
@Param("classifyId") String classifyId,@Param("phone") String phone,
|
@Param("classifyId") String classifyId,@Param("phone") String phone,
|
||||||
Integer user,@Param("isStart") Integer isStart,@Param("technicianType")Integer technicianType,@Param("isBack")String isBack);
|
Integer user,@Param("isStart") Integer isStart,@Param("technicianType")Integer technicianType,@Param("isBack")String isBack, @Param("userIdList")List<Long> userIdList);
|
||||||
|
|
||||||
Artificer selectArtificerById(@Param("userId") Long userId,@Param("artificerId") Long artificerId,@Param("longitude") String longitude,@Param("latitude") String latitude);
|
Artificer selectArtificerById(@Param("userId") Long userId,@Param("artificerId") Long artificerId,@Param("longitude") String longitude,@Param("latitude") String latitude);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ package com.sqx.modules.artificer.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.sqx.modules.artificer.entity.ArtificerClassify;
|
import com.sqx.modules.artificer.entity.ArtificerClassify;
|
||||||
|
|
||||||
public interface ArtificerClassifyService extends IService<ArtificerClassify> {
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ArtificerClassifyService extends IService<ArtificerClassify> {
|
||||||
|
List<Long> getUserIdByClassify(List<Long> classifyIdList);
|
||||||
}
|
}
|
|
@ -6,7 +6,14 @@ import com.sqx.modules.artificer.entity.ArtificerClassify;
|
||||||
import com.sqx.modules.artificer.service.ArtificerClassifyService;
|
import com.sqx.modules.artificer.service.ArtificerClassifyService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ArtificerClassifyServiceImpl extends ServiceImpl<ArtificerClassifyDao, ArtificerClassify> implements ArtificerClassifyService {
|
public class ArtificerClassifyServiceImpl extends ServiceImpl<ArtificerClassifyDao, ArtificerClassify> implements ArtificerClassifyService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Long> getUserIdByClassify(List<Long> classifyIdList){
|
||||||
|
return baseMapper.getUserIdByClassify(classifyIdList);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -20,6 +20,7 @@ import com.sqx.modules.app.entity.UserMoney;
|
||||||
import com.sqx.modules.app.service.UserMoneyService;
|
import com.sqx.modules.app.service.UserMoneyService;
|
||||||
import com.sqx.modules.artificer.dao.*;
|
import com.sqx.modules.artificer.dao.*;
|
||||||
import com.sqx.modules.artificer.entity.*;
|
import com.sqx.modules.artificer.entity.*;
|
||||||
|
import com.sqx.modules.artificer.service.ArtificerClassifyService;
|
||||||
import com.sqx.modules.artificer.service.ArtificerService;
|
import com.sqx.modules.artificer.service.ArtificerService;
|
||||||
import com.sqx.modules.artificer.service.ArtificerTimeService;
|
import com.sqx.modules.artificer.service.ArtificerTimeService;
|
||||||
import com.sqx.modules.artificer.service.CollectArtificerService;
|
import com.sqx.modules.artificer.service.CollectArtificerService;
|
||||||
|
@ -74,6 +75,8 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
||||||
private FaceMain faceMain;
|
private FaceMain faceMain;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDictService sysDictService;
|
private SysDictService sysDictService;
|
||||||
|
@Autowired
|
||||||
|
private ArtificerClassifyService artificerClassifyService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId,String artificerName,
|
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId,String artificerName,
|
||||||
|
@ -91,8 +94,23 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
||||||
city = "长春市";
|
city = "长春市";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Long> userIdList = new ArrayList<>();
|
||||||
|
if(classifyId!=null && !classifyId.equals("")){
|
||||||
|
String[] classifyIdArr = classifyId.split(",");
|
||||||
|
List<Long> classifyIdList = new ArrayList<>();
|
||||||
|
if(classifyIdArr.length>0){
|
||||||
|
for(int i=0;i<classifyIdArr.length;i++){
|
||||||
|
String classifyIdStr = classifyIdArr[i];
|
||||||
|
Long classifyIdL = Long.valueOf(classifyIdStr);
|
||||||
|
classifyIdList.add(classifyIdL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(classifyIdList.size()>0){
|
||||||
|
userIdList = artificerClassifyService.getUserIdByClassify(classifyIdList);
|
||||||
|
}
|
||||||
|
}
|
||||||
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, massageTypeId, artificerName,
|
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, massageTypeId, artificerName,
|
||||||
longitude, latitude, sort, authentication, by, status, city, classifyId,phone,user,isStart,technicianType,isBack);
|
longitude, latitude, sort, authentication, by, status, city, classifyId,phone,user,isStart,technicianType,isBack,userIdList);
|
||||||
List<Artificer> records = artificerIPage.getRecords();
|
List<Artificer> records = artificerIPage.getRecords();
|
||||||
String value = commonInfoService.findOne(392).getValue();
|
String value = commonInfoService.findOne(392).getValue();
|
||||||
if("30".equals(value)){
|
if("30".equals(value)){
|
||||||
|
@ -731,7 +749,7 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
||||||
public Result getHomeArtificerList(Integer page, Integer limit, Integer isStart,Integer status, String city, String longitude, String latitude){
|
public Result getHomeArtificerList(Integer page, Integer limit, Integer isStart,Integer status, String city, String longitude, String latitude){
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
Page<Artificer> pages=new Page<>(page,limit);
|
Page<Artificer> pages=new Page<>(page,limit);
|
||||||
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, null, "",longitude, latitude, 1, 2, 1, status, city, null,"",1,0,null,"");
|
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, null, "",longitude, latitude, 1, 2, 1, status, city, null,"",1,0,null,"",null);
|
||||||
map.put("nearData",new PageUtils(artificerIPage));
|
map.put("nearData",new PageUtils(artificerIPage));
|
||||||
map.put("startData",new PageUtils(baseMapper.getHomeStartArtificerList(pages,isStart,status,city)));
|
map.put("startData",new PageUtils(baseMapper.getHomeStartArtificerList(pages,isStart,status,city)));
|
||||||
return Result.success(map);
|
return Result.success(map);
|
||||||
|
|
|
@ -2544,7 +2544,10 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||||
@Override
|
@Override
|
||||||
public Result cancelOrdersMoney(Long userId, Long ordersId) {
|
public Result cancelOrdersMoney(Long userId, Long ordersId) {
|
||||||
Orders orders = baseMapper.selectById(ordersId);
|
Orders orders = baseMapper.selectById(ordersId);
|
||||||
if (orders.getStatus() == 4) {
|
if (orders.getStatus() == 1) {
|
||||||
|
String remarks = "取消订单将扣除:0元的手续费!";
|
||||||
|
return Result.success().put("data",remarks);
|
||||||
|
}else if (orders.getStatus() == 4) {
|
||||||
return Result.error("订单已经取消了!");
|
return Result.error("订单已经取消了!");
|
||||||
}else if (orders.getStatus() == 1) {
|
}else if (orders.getStatus() == 1) {
|
||||||
String remarks = "取消订单将扣除:0元的手续费!";
|
String remarks = "取消订单将扣除:0元的手续费!";
|
||||||
|
@ -2659,7 +2662,14 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||||
public Result cancelOrders(Long userId, Long ordersId) {
|
public Result cancelOrders(Long userId, Long ordersId) {
|
||||||
Orders orders = baseMapper.selectById(ordersId);
|
Orders orders = baseMapper.selectById(ordersId);
|
||||||
//状态 1待支付 2待服务 3待评论 4已取消 5已完成 6进行中 7技师出发 8技师到达 9用户已支付技师待接单 10待补单
|
//状态 1待支付 2待服务 3待评论 4已取消 5已完成 6进行中 7技师出发 8技师到达 9用户已支付技师待接单 10待补单
|
||||||
if (orders.getStatus() == 4) {
|
if (orders.getStatus() == 1) {
|
||||||
|
if(orders.getUserPackageDetailId() !=null){
|
||||||
|
return cancelPackageOrders(userId,orders,BigDecimal.ZERO,BigDecimal.ZERO);
|
||||||
|
}else{
|
||||||
|
return cancelMassageOrders(userId,orders,BigDecimal.ZERO,BigDecimal.ZERO,BigDecimal.ZERO,BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (orders.getStatus() == 4) {
|
||||||
return Result.error("订单已经取消了!");
|
return Result.error("订单已经取消了!");
|
||||||
} else if (orders.getStatus() == 3 || orders.getStatus() == 5) {
|
} else if (orders.getStatus() == 3 || orders.getStatus() == 5) {
|
||||||
return Result.error("订单已经完成了,无法取消!");
|
return Result.error("订单已经完成了,无法取消!");
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.sqx.modules.artificer.dao.ArtificerClassifyDao">
|
||||||
|
|
||||||
|
<select id="getUserIdByClassify" resultType="Long">
|
||||||
|
select distinct user_id
|
||||||
|
from artificer_classify
|
||||||
|
where classify_id IN
|
||||||
|
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -23,8 +23,14 @@
|
||||||
<if test="isStart!=null and isStart!=0">
|
<if test="isStart!=null and isStart!=0">
|
||||||
and a.is_start=#{isStart}
|
and a.is_start=#{isStart}
|
||||||
</if>
|
</if>
|
||||||
<if test="classifyId!=null and classifyId!=0">
|
<!-- <if test="classifyId!=null and classifyId!=0">-->
|
||||||
and FIND_IN_SET(#{classifyId},a.classify_id) > 0
|
<!-- and FIND_IN_SET(#{classifyId},a.classify_id) > 0-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<if test="userIdList!=null and userIdList.size() > 0">
|
||||||
|
and a.user_id IN
|
||||||
|
<foreach item="id" collection="userIdList" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="technicianType!=null and technicianType!=0">
|
<if test="technicianType!=null and technicianType!=0">
|
||||||
and a.technician_type=#{technicianType}
|
and a.technician_type=#{technicianType}
|
||||||
|
|
Loading…
Reference in New Issue