From 64e275b2075c8ab8d9d19a3fae743ea493ac7dbe Mon Sep 17 00:00:00 2001 From: cjw Date: Wed, 13 Nov 2024 16:29:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=B9=E6=8D=AE=E5=B9=B4?= =?UTF-8?q?=E6=9C=88=E6=97=A5=E8=8E=B7=E5=8F=96=E9=A2=84=E7=BA=A6=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/wx/WxCounselorController.java | 11 +++++++++++ .../system/mapper/ReservationDayMapper.java | 14 ++++++++++++++ .../system/service/IReservationService.java | 2 ++ .../service/impl/ReservationServiceImpl.java | 16 ++++++++++++++++ 4 files changed, 43 insertions(+) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/wx/WxCounselorController.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/wx/WxCounselorController.java index 154c189..f869a88 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/wx/WxCounselorController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/controller/wx/WxCounselorController.java @@ -137,6 +137,17 @@ public class WxCounselorController extends BaseController { return R.ok(reservationService.selectTimeListBy7Day(counselorId)); } + /** + * 获取咨询师预约日历时间段-客户 + * + * @param counselorId 咨询师 + * @return + */ + @GetMapping("/reservation/day") + public R> getReservationTimeList(String day, Long counselorId) { + return R.ok(reservationService.selectTimeListByDay(day, counselorId)); + } + /** * 获取预约订单 * diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/ReservationDayMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/ReservationDayMapper.java index 2479a0f..a225685 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/ReservationDayMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/ReservationDayMapper.java @@ -21,7 +21,21 @@ public interface ReservationDayMapper extends BaseMapperPlus selectUseDateList(@Param("time") String time, @Param("userId") Long userId); + /** + * 查询time中大于当天的数据 + * @param time 年-月 + * @param day 年-月-日 + * @param userId + * @return + */ List selectNotUseDateList(@Param("time") String time,@Param("day") String day, @Param("userId") Long userId); + /** + * 查询day的数据 + * @param day 年-月-日 + * @param userId + * @return + */ + //List selectNotUseDateList(@Param("day") String day, @Param("userId") Long userId); List selectOrderList(@Param("time") String time, @Param("userId") Long userId); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IReservationService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IReservationService.java index ae99fca..a072aa0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IReservationService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IReservationService.java @@ -36,6 +36,8 @@ public interface IReservationService { List selectTimeListBy7Day(Long counselorId); + List selectTimeListByDay(String day,Long counselorId); + List selectOrderList(String time, Long counselorId); /** diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ReservationServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ReservationServiceImpl.java index 9e707db..6d813ff 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ReservationServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ReservationServiceImpl.java @@ -126,6 +126,22 @@ public class ReservationServiceImpl implements IReservationService { return dayList; } + @Override + public List selectTimeListByDay(String day, Long counselorId) { + List dayList = dayMapper.selectVoList(new LambdaQueryWrapper() + .eq(ReservationDay::getCounselorId, counselorId) + .apply("DATE_FORMAT(day_time, '%Y-%m-%d') =" + day)); + for (ReservationDayVo one : dayList) { + Date dayTime = one.getDayTime(); + one.setWeek(DateUtils.getWeek(dayTime)); + List timeList = timeMapper.selectList(new LambdaQueryWrapper() + .eq(ReservationTime::getDayId, one.getId()) + .orderByAsc(ReservationTime::getStartTime)); + one.setTimeList(timeList); + } + return dayList; + } + @Override public List selectOrderList(String time, Long counselorId) { return dayMapper.selectOrderList(time, counselorId);