我的预约;处理干预;其他优化

This commit is contained in:
cjw 2024-08-21 16:44:10 +08:00
parent 31dfdc388d
commit 262b423933
9 changed files with 92 additions and 7 deletions

View File

@ -7,12 +7,11 @@ import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.idempotent.annotation.RepeatSubmit; import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log; import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType; import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.web.core.BaseController; import org.dromara.common.web.core.BaseController;
import org.dromara.scale.domain.bo.CounselorBo; import org.dromara.scale.domain.bo.*;
import org.dromara.scale.domain.bo.CounselorExperienceBo;
import org.dromara.scale.domain.bo.CounselorQualificationBo;
import org.dromara.scale.domain.bo.ReservationDayBo;
import org.dromara.scale.domain.vo.*; import org.dromara.scale.domain.vo.*;
import org.dromara.scale.service.ICounselorExperienceService; import org.dromara.scale.service.ICounselorExperienceService;
import org.dromara.scale.service.ICounselorQualificationService; import org.dromara.scale.service.ICounselorQualificationService;
@ -63,6 +62,13 @@ public class WxCounselorController extends BaseController {
return toAjax(counselorService.updateInfo(bo)); return toAjax(counselorService.updateInfo(bo));
} }
/**
* 预约列表
*/
@GetMapping("/reservation/pageList")
public TableDataInfo<ReservationOrderVo> reservationPageList(PageQuery pageQuery) {
return reservationService.queryReservationPageList(pageQuery);
}
/** /**
* 新增预约 * 新增预约
@ -98,6 +104,15 @@ public class WxCounselorController extends BaseController {
return R.ok(reservationService.selectOrderList(time, userId)); return R.ok(reservationService.selectOrderList(time, userId));
} }
/**
* 订单列表
*/
@GetMapping("/order/pageList")
public TableDataInfo<ReservationOrderVo> orderPageList(PageQuery pageQuery) {
//todo
return null;
}
/** /**
* 获取咨询师证书 * 获取咨询师证书
* *
@ -177,4 +192,13 @@ public class WxCounselorController extends BaseController {
return toAjax(counselorService.updateByBo(newBo)); return toAjax(counselorService.updateByBo(newBo));
} }
/**
* 新增干预记录
*/
@Log(title = "新增干预记录", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping("/intervene")
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysInterveneRecordBo bo) {
return toAjax(reservationService.insertIntervene(bo));
}
} }

View File

@ -20,6 +20,8 @@ public class ReservationOrderVo implements Serializable {
private Long timeId; private Long timeId;
private Long orderId;
private String name; private String name;
private String startTime; private String startTime;

View File

@ -1,9 +1,12 @@
package org.dromara.scale.mapper; package org.dromara.scale.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.dromara.scale.domain.ReservationTime; import org.apache.ibatis.annotations.Param;
import org.dromara.scale.domain.vo.ReservationTimeVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.scale.domain.ReservationTime;
import org.dromara.scale.domain.vo.ReservationOrderVo;
import org.dromara.scale.domain.vo.ReservationTimeVo;
/** /**
* 预约-时间Mapper接口 * 预约-时间Mapper接口
@ -14,4 +17,6 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
@Mapper @Mapper
public interface ReservationTimeMapper extends BaseMapperPlus<ReservationTime, ReservationTimeVo> { public interface ReservationTimeMapper extends BaseMapperPlus<ReservationTime, ReservationTimeVo> {
Page<ReservationOrderVo> selectPageList(@Param("page") Page<ReservationTime> page, @Param("counselorId") Long counselorId);
} }

View File

@ -66,6 +66,7 @@ public interface ICounselorService {
/** /**
* 修改价格 * 修改价格
*
* @param bo * @param bo
* @return * @return
*/ */
@ -87,4 +88,6 @@ public interface ICounselorService {
* @return 是否删除成功 * @return 是否删除成功
*/ */
Boolean deleteWithValidById(Long id, Boolean isValid); Boolean deleteWithValidById(Long id, Boolean isValid);
} }

View File

@ -1,6 +1,9 @@
package org.dromara.scale.service; package org.dromara.scale.service;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.scale.domain.bo.ReservationDayBo; import org.dromara.scale.domain.bo.ReservationDayBo;
import org.dromara.scale.domain.bo.SysInterveneRecordBo;
import org.dromara.scale.domain.vo.ReservationDateVo; import org.dromara.scale.domain.vo.ReservationDateVo;
import org.dromara.scale.domain.vo.ReservationOrderVo; import org.dromara.scale.domain.vo.ReservationOrderVo;
@ -8,6 +11,15 @@ import java.util.List;
public interface IReservationService { public interface IReservationService {
/**
* 分页查询预约列表
*
* @param pageQuery 分页参数
* @return 心理咨询师分页列表
*/
TableDataInfo<ReservationOrderVo> queryReservationPageList(PageQuery pageQuery);
/** /**
* 新增预约 * 新增预约
* *
@ -21,4 +33,12 @@ public interface IReservationService {
List<ReservationDateVo> selectNotUseDateList(String time, Long counselorId); List<ReservationDateVo> selectNotUseDateList(String time, Long counselorId);
List<ReservationOrderVo> selectOrderList(String time, Long counselorId); List<ReservationOrderVo> selectOrderList(String time, Long counselorId);
/**
* 新增干预记录
*
* @param bo 干预记录
* @return 是否新增成功
*/
Boolean insertIntervene(SysInterveneRecordBo bo);
} }

View File

@ -186,4 +186,5 @@ public class CounselorServiceImpl implements ICounselorService {
} }
return baseMapper.deleteById(id) > 0; return baseMapper.deleteById(id) > 0;
} }
} }

View File

@ -1,14 +1,18 @@
package org.dromara.scale.service.impl; package org.dromara.scale.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.TimeBucket; import org.dromara.common.core.utils.TimeBucket;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.scale.domain.ReservationDay; import org.dromara.scale.domain.ReservationDay;
import org.dromara.scale.domain.ReservationTime; import org.dromara.scale.domain.ReservationTime;
import org.dromara.scale.domain.bo.ReservationDayBo; import org.dromara.scale.domain.bo.ReservationDayBo;
import org.dromara.scale.domain.bo.SysInterveneRecordBo;
import org.dromara.scale.domain.vo.ReservationDateVo; import org.dromara.scale.domain.vo.ReservationDateVo;
import org.dromara.scale.domain.vo.ReservationOrderVo; import org.dromara.scale.domain.vo.ReservationOrderVo;
import org.dromara.scale.mapper.ReservationDayMapper; import org.dromara.scale.mapper.ReservationDayMapper;
@ -34,6 +38,12 @@ public class ReservationServiceImpl implements IReservationService {
private final ReservationTimeMapper timeMapper; private final ReservationTimeMapper timeMapper;
@Override
public TableDataInfo<ReservationOrderVo> queryReservationPageList(PageQuery pageQuery) {
Long userId = LoginHelper.getUserId();
Page<ReservationOrderVo> result = timeMapper.selectPageList(pageQuery.build(), userId);
return TableDataInfo.build(result);
}
@Override @Override
public Boolean insertByBo(ReservationDayBo bo) { public Boolean insertByBo(ReservationDayBo bo) {
@ -85,4 +95,10 @@ public class ReservationServiceImpl implements IReservationService {
public List<ReservationOrderVo> selectOrderList(String time, Long counselorId) { public List<ReservationOrderVo> selectOrderList(String time, Long counselorId) {
return dayMapper.selectOrderList(time, counselorId); return dayMapper.selectOrderList(time, counselorId);
} }
@Override
public Boolean insertIntervene(SysInterveneRecordBo bo) {
//todo
return null;
}
} }

View File

@ -30,6 +30,7 @@
<select id="selectOrderList" resultType="org.dromara.scale.domain.vo.ReservationOrderVo"> <select id="selectOrderList" resultType="org.dromara.scale.domain.vo.ReservationOrderVo">
select u.nick_name as name, select u.nick_name as name,
rt.id as timeId, rt.id as timeId,
ro.id as orderId,
DATE_FORMAT(rt.start_time, '%H:%i') as startTime, DATE_FORMAT(rt.start_time, '%H:%i') as startTime,
DATE_FORMAT(rt.end_time, '%H:%i') as endTime, DATE_FORMAT(rt.end_time, '%H:%i') as endTime,
rt.status rt.status

View File

@ -4,4 +4,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.scale.mapper.ReservationTimeMapper"> <mapper namespace="org.dromara.scale.mapper.ReservationTimeMapper">
<select id="selectPageList" resultType="org.dromara.scale.domain.vo.ReservationOrderVo">
select u.nick_name as name,
rt.id as timeId,
ro.id as orderId,
DATE_FORMAT(rt.start_time, '%H:%i') as startTime,
DATE_FORMAT(rt.end_time, '%H:%i') as endTime
from m_reservation_time rt
left join m_reservation_order ro on ro.time_id = rt.id
left join sys_user u on u.user_id = ro.create_by
where rt.counselor_id = #{counselorId}
and rt.`status` = 1
and ro.order_status = 1
</select>
</mapper> </mapper>