预约新增使用数和已用数

This commit is contained in:
cjw 2024-08-21 15:06:27 +08:00
parent 57706319ae
commit ee48e15837
10 changed files with 66 additions and 7 deletions

View File

@ -53,6 +53,17 @@ public class WxCounselorController extends BaseController {
return R.ok(counselorService.queryById(userId));
}
/**
* 修改咨询师信息
*/
@Log(title = "修改咨询师信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> editInfo(@RequestBody CounselorBo bo) {
return toAjax(counselorService.updateInfo(bo));
}
/**
* 新增预约
*/
@ -72,7 +83,7 @@ public class WxCounselorController extends BaseController {
@GetMapping("/reservation/date")
public R<List<ReservationDateVo>> getReservationList(String time) {
Long userId = LoginHelper.getUserId();
return R.ok(reservationService.selectDateList(time, userId));
return R.ok(reservationService.selectUseDateList(time, userId));
}
/**

View File

@ -91,5 +91,15 @@ public class CounselorBo extends BaseEntity {
*/
private String countyCode;
/**
* 家庭住址
*/
private String address;
/**
* 用户性别
*/
private String sex;
}

View File

@ -22,5 +22,7 @@ public class ReservationDateVo implements Serializable {
private String dayTime;
private Integer useNum;
private Integer notUseNum;
}

View File

@ -18,6 +18,8 @@ public class ReservationOrderVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Long timeId;
private String name;
private String startTime;

View File

@ -19,7 +19,9 @@ import java.util.List;
@Mapper
public interface ReservationDayMapper extends BaseMapperPlus<ReservationDay, ReservationDayVo> {
List<ReservationDateVo> selectDateList(@Param("time") String time, @Param("userId") Long userId);
List<ReservationDateVo> selectUseDateList(@Param("time") String time, @Param("userId") Long userId);
List<ReservationDateVo> selectNotUseDateList(@Param("time") String time, @Param("userId") Long userId);
List<ReservationOrderVo> selectOrderList(@Param("time") String time, @Param("userId") Long userId);
}

View File

@ -71,6 +71,14 @@ public interface ICounselorService {
*/
Boolean updatePrive(CounselorBo bo);
/**
* 修改咨询师信息
*
* @param bo 心理咨询师
* @return 是否修改成功
*/
Boolean updateInfo(CounselorBo bo);
/**
* 校验并批量删除心理咨询师信息
*

View File

@ -16,7 +16,7 @@ public interface IReservationService {
*/
Boolean insertByBo(ReservationDayBo bo);
List<ReservationDateVo> selectDateList(String time, Long counselorId);
List<ReservationDateVo> selectUseDateList(String time, Long counselorId);
List<ReservationOrderVo> selectOrderList(String time, Long counselorId);
}

View File

@ -147,6 +147,17 @@ public class CounselorServiceImpl implements ICounselorService {
return baseMapper.updateById(update) > 0;
}
@Override
public Boolean updateInfo(CounselorBo bo) {
Long userId = LoginHelper.getUserId();
String name = bo.getName();
Counselor update = new Counselor();
update.setId(userId);
//update.setPrice(price);
return null;
}
/**
* 保存前的数据校验
*/

View File

@ -72,8 +72,8 @@ public class ReservationServiceImpl implements IReservationService {
}
@Override
public List<ReservationDateVo> selectDateList(String time, Long counselorId) {
return dayMapper.selectDateList(time, counselorId);
public List<ReservationDateVo> selectUseDateList(String time, Long counselorId) {
return dayMapper.selectUseDateList(time, counselorId);
}
@Override

View File

@ -3,8 +3,8 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.scale.mapper.ReservationDayMapper">
<select id="selectDateList" resultType="org.dromara.scale.domain.vo.ReservationDateVo">
select rd.id as dayId, DATE_FORMAT(rd.day_time, '%Y-%m-%d') as dayTime, t.num as notUseNum
<select id="selectUseDateList" resultType="org.dromara.scale.domain.vo.ReservationDateVo">
select rd.id as dayId, DATE_FORMAT(rd.day_time, '%Y-%m-%d') as dayTime, ifnull(t.num, 0) as useNum
from m_reservation_day rd
left join (select count(*) as num, day_id
from m_reservation_time
@ -15,8 +15,21 @@
and DATE_FORMAT(rd.day_time, '%Y-%m') = #{time}
</select>
<select id="selectNotUseDateList" resultType="org.dromara.scale.domain.vo.ReservationDateVo">
select rd.id as dayId, DATE_FORMAT(rd.day_time, '%Y-%m-%d') as dayTime, ifnull(t.num, 0) as useNum
from m_reservation_day rd
left join (select count(*) as num, day_id
from m_reservation_time
where counselor_id = #{userId}
and status = 0
group by day_id) t on t.day_id = rd.id
where rd.counselor_id = #{userId}
and DATE_FORMAT(rd.day_time, '%Y-%m') = #{time}
</select>
<select id="selectOrderList" resultType="org.dromara.scale.domain.vo.ReservationOrderVo">
select u.nick_name as name,
rt.id as timeId,
DATE_FORMAT(rt.start_time, '%H:%i') as startTime,
DATE_FORMAT(rt.end_time, '%H:%i') as endTime,
rt.status