优化我的页面
This commit is contained in:
parent
512f40e3bd
commit
ed50d0d3a2
|
@ -87,7 +87,7 @@ public class WxCounselorController extends BaseController {
|
|||
* 预约处理列表
|
||||
*/
|
||||
@GetMapping("/reservation/pageList")
|
||||
public TableDataInfo<ReservationCounselorOrderVo> reservationPageList(PageQuery pageQuery) {
|
||||
public TableDataInfo<ReservationOrderListVo> reservationPageList(PageQuery pageQuery) {
|
||||
return reservationService.queryReservationPageList(pageQuery);
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ public class WxCounselorController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/reservation/order")
|
||||
public R<List<ReservationCounselorOrderVo>> getReservationOrder(String time) {
|
||||
public R<List<ReservationOrderListVo>> getReservationOrder(String time) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
return R.ok(reservationService.selectOrderList(time, userId));
|
||||
}
|
||||
|
|
|
@ -46,8 +46,8 @@ public class WxMyController extends BaseController {
|
|||
* 查询我的测评任务
|
||||
*/
|
||||
@GetMapping("/evaluation/task/pageList")
|
||||
public TableDataInfo<SysEvaluationRecordVo> list(PageQuery pageQuery) {
|
||||
return myService.queryEvaluationRecordPageList(pageQuery);
|
||||
public TableDataInfo<SysEvaluationRecordVo> taskList(PageQuery pageQuery) {
|
||||
return myService.queryPersonalEvaluationRecordPageList(pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,4 +65,12 @@ public class WxMyController extends BaseController {
|
|||
public TableDataInfo<ReservationOrderVo> list(ReservationOrderBo bo, PageQuery pageQuery) {
|
||||
return myService.queryReservationPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询团队测评
|
||||
*/
|
||||
@GetMapping("/evaluation/publish/pageList")
|
||||
public TableDataInfo<SysEvaluationRecordVo> publishList(PageQuery pageQuery) {
|
||||
return myService.queryPublishEvaluationRecordPageList(pageQuery);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
package org.dromara.scale.controller.wx;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.scale.service.IReservationService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>预约<p>
|
||||
*
|
||||
* @author cjw
|
||||
* @version V1.0.0
|
||||
* @date 2024/9/23 14:23
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wx/reservation/")
|
||||
public class WxReservationController extends BaseController {
|
||||
|
||||
private IReservationService reservationService;
|
||||
|
||||
/**
|
||||
* 查询咨询师预约列表
|
||||
*/
|
||||
// @GetMapping("/user/reservation/pageList")
|
||||
// public TableDataInfo<ReservationVo> userReservationOrderList(PageQuery pageQuery) {
|
||||
// Long userId = LoginHelper.getUserId();
|
||||
// return reservationService.queryPageList(bo, pageQuery);
|
||||
// }
|
||||
}
|
|
@ -6,14 +6,14 @@ import java.io.Serial;
|
|||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>预约订单<p>
|
||||
* <p>预约和订单的列表展示类<p>
|
||||
*
|
||||
* @author cjw
|
||||
* @version V1.0.0
|
||||
* @date 2024/8/20 10:23
|
||||
*/
|
||||
@Data
|
||||
public class ReservationCounselorOrderVo implements Serializable {
|
||||
public class ReservationOrderListVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
|
@ -6,7 +6,7 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||
import org.dromara.scale.domain.ReservationDay;
|
||||
import org.dromara.scale.domain.vo.ReservationDateVo;
|
||||
import org.dromara.scale.domain.vo.ReservationDayVo;
|
||||
import org.dromara.scale.domain.vo.ReservationCounselorOrderVo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderListVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -23,5 +23,5 @@ public interface ReservationDayMapper extends BaseMapperPlus<ReservationDay, Res
|
|||
|
||||
List<ReservationDateVo> selectNotUseDateList(@Param("time") String time, @Param("userId") Long userId);
|
||||
|
||||
List<ReservationCounselorOrderVo> selectOrderList(@Param("time") String time, @Param("userId") Long userId);
|
||||
List<ReservationOrderListVo> selectOrderList(@Param("time") String time, @Param("userId") Long userId);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.scale.domain.ReservationTime;
|
||||
import org.dromara.scale.domain.vo.ReservationCounselorOrderVo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderListVo;
|
||||
import org.dromara.scale.domain.vo.ReservationTimeVo;
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,6 @@ import org.dromara.scale.domain.vo.ReservationTimeVo;
|
|||
@Mapper
|
||||
public interface ReservationTimeMapper extends BaseMapperPlus<ReservationTime, ReservationTimeVo> {
|
||||
|
||||
Page<ReservationCounselorOrderVo> selectPageList(@Param("page") Page<ReservationTime> page, @Param("counselorId") Long counselorId);
|
||||
Page<ReservationOrderListVo> selectPageList(@Param("page") Page<ReservationTime> page, @Param("counselorId") Long counselorId);
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,8 @@ public interface IMyService {
|
|||
|
||||
List<StatisticNumVo> getMyNum();
|
||||
|
||||
TableDataInfo<SysEvaluationRecordVo> queryEvaluationRecordPageList(PageQuery pageQuery);
|
||||
TableDataInfo<SysEvaluationRecordVo> queryPersonalEvaluationRecordPageList(PageQuery pageQuery);
|
||||
TableDataInfo<SysEvaluationRecordVo> queryPublishEvaluationRecordPageList(PageQuery pageQuery);
|
||||
|
||||
TableDataInfo<SysScaleVo> queryScalePageList(SysScaleBo bo, PageQuery pageQuery);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|||
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.ReservationCounselorOrderVo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderListVo;
|
||||
import org.dromara.scale.domain.vo.ReservationDayVo;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -19,7 +19,7 @@ public interface IReservationService {
|
|||
* @param pageQuery 分页参数
|
||||
* @return 心理咨询师分页列表
|
||||
*/
|
||||
TableDataInfo<ReservationCounselorOrderVo> queryReservationPageList(PageQuery pageQuery);
|
||||
TableDataInfo<ReservationOrderListVo> queryReservationPageList(PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 新增预约
|
||||
|
@ -35,7 +35,7 @@ public interface IReservationService {
|
|||
|
||||
List<ReservationDayVo> selectTimeListBy7Day(Long counselorId);
|
||||
|
||||
List<ReservationCounselorOrderVo> selectOrderList(String time, Long counselorId);
|
||||
List<ReservationOrderListVo> selectOrderList(String time, Long counselorId);
|
||||
|
||||
/**
|
||||
* 新增干预记录
|
||||
|
|
|
@ -70,19 +70,15 @@ public class MyServiceImpl implements IMyService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysEvaluationRecordVo> queryEvaluationRecordPageList(PageQuery pageQuery) {
|
||||
public TableDataInfo<SysEvaluationRecordVo> queryPersonalEvaluationRecordPageList(PageQuery pageQuery) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
LambdaQueryWrapper<SysEvaluationRecord> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(SysEvaluationRecord::getUserId, userId);
|
||||
lqw.orderByDesc(SysEvaluationRecord::getCreateTime);
|
||||
Page<SysEvaluationRecordVo> result = evaluationRecordMapper.selectRecordVoPage(pageQuery.build(), lqw);
|
||||
List<SysEvaluationRecordVo> records = result.getRecords();
|
||||
for (SysEvaluationRecordVo record : records) {
|
||||
SysScale scale = scaleMapper.selectById(record.getScaleId());
|
||||
String s = ossService.selectUrlByIds(String.valueOf(scale.getAppCover()));
|
||||
record.setAppCoverUrl(s);
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
return queryEvaluationRecordPageList(userId, 0, pageQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysEvaluationRecordVo> queryPublishEvaluationRecordPageList(PageQuery pageQuery) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
return queryEvaluationRecordPageList(userId, 1, pageQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -101,4 +97,20 @@ public class MyServiceImpl implements IMyService {
|
|||
new LambdaQueryWrapper<ReservationOrder>().eq(ReservationOrder::getCreateBy, userId));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private TableDataInfo<SysEvaluationRecordVo> queryEvaluationRecordPageList(Long userId, int flag, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysEvaluationRecord> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(SysEvaluationRecord::getUserId, userId);
|
||||
//根据flag查询个人或发布
|
||||
lqw.eq(SysEvaluationRecord::getPublishFlag, flag);
|
||||
lqw.orderByDesc(SysEvaluationRecord::getCreateTime);
|
||||
Page<SysEvaluationRecordVo> result = evaluationRecordMapper.selectRecordVoPage(pageQuery.build(), lqw);
|
||||
List<SysEvaluationRecordVo> records = result.getRecords();
|
||||
for (SysEvaluationRecordVo record : records) {
|
||||
SysScale scale = scaleMapper.selectById(record.getScaleId());
|
||||
String s = ossService.selectUrlByIds(String.valueOf(scale.getAppCover()));
|
||||
record.setAppCoverUrl(s);
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.dromara.scale.domain.ReservationOrder;
|
|||
import org.dromara.scale.domain.ReservationTime;
|
||||
import org.dromara.scale.domain.bo.ReservationDayBo;
|
||||
import org.dromara.scale.domain.bo.SysInterveneRecordBo;
|
||||
import org.dromara.scale.domain.vo.ReservationCounselorOrderVo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderListVo;
|
||||
import org.dromara.scale.domain.vo.ReservationDateVo;
|
||||
import org.dromara.scale.domain.vo.ReservationDayVo;
|
||||
import org.dromara.scale.mapper.ReservationDayMapper;
|
||||
|
@ -44,13 +44,14 @@ public class ReservationServiceImpl implements IReservationService {
|
|||
|
||||
/**
|
||||
* 预约处理列表 -只捞取未完成的数据
|
||||
*
|
||||
* @param pageQuery 分页参数
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ReservationCounselorOrderVo> queryReservationPageList(PageQuery pageQuery) {
|
||||
public TableDataInfo<ReservationOrderListVo> queryReservationPageList(PageQuery pageQuery) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
Page<ReservationCounselorOrderVo> result = timeMapper.selectPageList(pageQuery.build(), userId);
|
||||
Page<ReservationOrderListVo> result = timeMapper.selectPageList(pageQuery.build(), userId);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
@ -119,7 +120,7 @@ public class ReservationServiceImpl implements IReservationService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ReservationCounselorOrderVo> selectOrderList(String time, Long counselorId) {
|
||||
public List<ReservationOrderListVo> selectOrderList(String time, Long counselorId) {
|
||||
return dayMapper.selectOrderList(time, counselorId);
|
||||
}
|
||||
|
||||
|
@ -127,8 +128,12 @@ public class ReservationServiceImpl implements IReservationService {
|
|||
public Boolean insertIntervene(SysInterveneRecordBo bo) {
|
||||
Long orderId = bo.getBatchNo();
|
||||
ReservationOrder reservationOrder = reservationOrderMapper.selectById(orderId);
|
||||
if (reservationOrder == null || reservationOrder.getOrderStatus() !=1) {
|
||||
throw new ServiceException("订单状态异常,请确认后再提交");
|
||||
if (reservationOrder == null || reservationOrder.getOrderStatus() != 1) {
|
||||
throw new ServiceException("订单状态异常,请确认后再提交");
|
||||
}
|
||||
Long timeId = bo.getInterveneId();
|
||||
if (timeId == null) {
|
||||
throw new ServiceException("必要参数为空,请确认后再提交");
|
||||
}
|
||||
ReservationOrder orderUpdate = new ReservationOrder();
|
||||
orderUpdate.setDiagnose(bo.getDiagnose());
|
||||
|
@ -137,7 +142,7 @@ public class ReservationServiceImpl implements IReservationService {
|
|||
orderUpdate.setId(orderId);
|
||||
boolean orderFlag = reservationOrderMapper.updateById(orderUpdate) > 0;
|
||||
ReservationTime timeUpdate = new ReservationTime();
|
||||
timeUpdate.setId(bo.getInterveneId());
|
||||
timeUpdate.setId(timeId);
|
||||
timeUpdate.setStatus(2);
|
||||
boolean timeFlag = timeMapper.updateById(timeUpdate) > 0;
|
||||
return orderFlag && timeFlag;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
and DATE_FORMAT(rd.day_time, '%Y-%m') = #{time}
|
||||
</select>
|
||||
|
||||
<select id="selectOrderList" resultType="org.dromara.scale.domain.vo.ReservationCounselorOrderVo">
|
||||
<select id="selectOrderList" resultType="org.dromara.scale.domain.vo.ReservationOrderListVo">
|
||||
select u.nick_name as name,
|
||||
rt.id as timeId,
|
||||
ro.id as orderId,
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.scale.mapper.ReservationTimeMapper">
|
||||
|
||||
<select id="selectPageList" resultType="org.dromara.scale.domain.vo.ReservationCounselorOrderVo">
|
||||
<select id="selectPageList" resultType="org.dromara.scale.domain.vo.ReservationOrderListVo">
|
||||
select u.nick_name as name,
|
||||
rt.id as timeId,
|
||||
ro.id as orderId,
|
||||
|
|
Loading…
Reference in New Issue