我的页面丰富功能
This commit is contained in:
parent
16998cf826
commit
7d83a1516e
|
@ -12,7 +12,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
|||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.scale.domain.bo.ReservationOrderBo;
|
||||
import org.dromara.scale.domain.vo.ReservationCounselorOrderVo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderVo;
|
||||
import org.dromara.scale.service.IReservationOrderService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -38,7 +38,7 @@ public class ReservationOrderController extends BaseController {
|
|||
*/
|
||||
@SaCheckPermission("scale:reservationOrder:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ReservationCounselorOrderVo> list(ReservationOrderBo bo, PageQuery pageQuery) {
|
||||
public TableDataInfo<ReservationOrderVo> list(ReservationOrderBo bo, PageQuery pageQuery) {
|
||||
return reservationOrderService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,8 @@ public class ReservationOrderController extends BaseController {
|
|||
@Log(title = "预约订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ReservationOrderBo bo, HttpServletResponse response) {
|
||||
List<ReservationCounselorOrderVo> list = reservationOrderService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "预约订单", ReservationCounselorOrderVo.class, response);
|
||||
List<ReservationOrderVo> list = reservationOrderService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "预约订单", ReservationOrderVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,7 +60,7 @@ public class ReservationOrderController extends BaseController {
|
|||
*/
|
||||
@SaCheckPermission("scale:reservationOrder:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ReservationCounselorOrderVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
public R<ReservationOrderVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(reservationOrderService.queryById(id));
|
||||
}
|
||||
|
|
|
@ -5,7 +5,10 @@ import org.dromara.common.core.domain.R;
|
|||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.scale.domain.bo.ReservationOrderBo;
|
||||
import org.dromara.scale.domain.bo.SysScaleBo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderVo;
|
||||
import org.dromara.scale.domain.vo.StatisticNumVo;
|
||||
import org.dromara.scale.domain.vo.SysEvaluationRecordVo;
|
||||
import org.dromara.scale.domain.vo.SysScaleVo;
|
||||
import org.dromara.scale.service.IMyService;
|
||||
|
@ -14,6 +17,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>TODO<p>
|
||||
*
|
||||
|
@ -30,31 +35,21 @@ public class WxMyController extends BaseController {
|
|||
private final IMyService myService;
|
||||
|
||||
/**
|
||||
* 获取测评任务数量
|
||||
*
|
||||
* 获取各数量数量
|
||||
*/
|
||||
@GetMapping("/evaluation/task/num")
|
||||
public R<Integer> getEvaluationTaskNum() {
|
||||
return R.ok(myService.getMyEvaluationTaskNum());
|
||||
@GetMapping("/num")
|
||||
public R<List<StatisticNumVo>> getEvaluationTaskNum() {
|
||||
return R.ok(myService.getMyNum());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询测评任务
|
||||
* 查询我的测评任务
|
||||
*/
|
||||
@GetMapping("/evaluation/task/pageList")
|
||||
public TableDataInfo<SysEvaluationRecordVo> list(PageQuery pageQuery) {
|
||||
return myService.queryEvaluationRecordPageList(pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的量表数量
|
||||
*
|
||||
*/
|
||||
@GetMapping("/scale/num")
|
||||
public R<Integer> getScaleNum() {
|
||||
return R.ok(myService.getScaleNum());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的量表
|
||||
*/
|
||||
|
@ -63,5 +58,13 @@ public class WxMyController extends BaseController {
|
|||
return myService.queryScalePageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的干预与诊断
|
||||
*/
|
||||
@GetMapping("/intervene/pageList")
|
||||
public TableDataInfo<ReservationOrderVo> list(ReservationOrderBo bo, PageQuery pageQuery) {
|
||||
return myService.queryReservationPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -30,4 +30,11 @@ public class StatisticNumVo implements Serializable {
|
|||
@JsonIgnore
|
||||
private String parentName;
|
||||
|
||||
public StatisticNumVo() {
|
||||
}
|
||||
|
||||
public StatisticNumVo(String name, int value) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.dromara.scale.domain.SysEvaluationRecord;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -39,6 +39,8 @@ public class SysEvaluationRecordVo implements Serializable {
|
|||
|
||||
private String scaleName;
|
||||
|
||||
private String appCoverUrl;
|
||||
|
||||
/**
|
||||
* 测评人id
|
||||
*/
|
||||
|
@ -61,9 +63,7 @@ public class SysEvaluationRecordVo implements Serializable {
|
|||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
||||
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -11,5 +11,5 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||
* @date 2024-08-19
|
||||
*/
|
||||
public interface ActivityMapper extends BaseMapperPlus<Activity, ActivityVo> {
|
||||
|
||||
int addViewNum(Long id);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.dromara.scale.mapper;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.scale.domain.ReservationOrder;
|
||||
import org.dromara.scale.domain.vo.ReservationCounselorOrderVo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderVo;
|
||||
|
||||
/**
|
||||
* 预约订单Mapper接口
|
||||
|
@ -12,6 +12,6 @@ import org.dromara.scale.domain.vo.ReservationCounselorOrderVo;
|
|||
* @date 2024-08-22
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReservationOrderMapper extends BaseMapperPlus<ReservationOrder, ReservationCounselorOrderVo> {
|
||||
public interface ReservationOrderMapper extends BaseMapperPlus<ReservationOrder, ReservationOrderVo> {
|
||||
|
||||
}
|
||||
|
|
|
@ -2,17 +2,22 @@ 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.ReservationOrderBo;
|
||||
import org.dromara.scale.domain.bo.SysScaleBo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderVo;
|
||||
import org.dromara.scale.domain.vo.StatisticNumVo;
|
||||
import org.dromara.scale.domain.vo.SysEvaluationRecordVo;
|
||||
import org.dromara.scale.domain.vo.SysScaleVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IMyService {
|
||||
|
||||
Integer getMyEvaluationTaskNum();
|
||||
List<StatisticNumVo> getMyNum();
|
||||
|
||||
TableDataInfo<SysEvaluationRecordVo> queryEvaluationRecordPageList(PageQuery pageQuery);
|
||||
|
||||
Integer getScaleNum();
|
||||
|
||||
TableDataInfo<SysScaleVo> queryScalePageList(SysScaleBo bo, PageQuery pageQuery);
|
||||
|
||||
TableDataInfo<ReservationOrderVo> queryReservationPageList(ReservationOrderBo bo, PageQuery pageQuery);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ 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.ReservationOrderBo;
|
||||
import org.dromara.scale.domain.vo.ReservationCounselorOrderVo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -21,7 +21,7 @@ public interface IReservationOrderService {
|
|||
* @param id 主键
|
||||
* @return 预约订单
|
||||
*/
|
||||
ReservationCounselorOrderVo queryById(Long id);
|
||||
ReservationOrderVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询预约订单列表
|
||||
|
@ -30,7 +30,7 @@ public interface IReservationOrderService {
|
|||
* @param pageQuery 分页参数
|
||||
* @return 预约订单分页列表
|
||||
*/
|
||||
TableDataInfo<ReservationCounselorOrderVo> queryPageList(ReservationOrderBo bo, PageQuery pageQuery);
|
||||
TableDataInfo<ReservationOrderVo> queryPageList(ReservationOrderBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的预约订单列表
|
||||
|
@ -38,7 +38,7 @@ public interface IReservationOrderService {
|
|||
* @param bo 查询条件
|
||||
* @return 预约订单列表
|
||||
*/
|
||||
List<ReservationCounselorOrderVo> queryList(ReservationOrderBo bo);
|
||||
List<ReservationOrderVo> queryList(ReservationOrderBo bo);
|
||||
|
||||
/**
|
||||
* 新增预约订单
|
||||
|
|
|
@ -38,7 +38,8 @@ public class ActivityServiceImpl implements IActivityService {
|
|||
* @return 活动
|
||||
*/
|
||||
@Override
|
||||
public ActivityVo queryById(Long id){
|
||||
public ActivityVo queryById(Long id) {
|
||||
baseMapper.addViewNum(id);
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
|
@ -112,7 +113,7 @@ public class ActivityServiceImpl implements IActivityService {
|
|||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(Activity entity){
|
||||
private void validEntityBeforeSave(Activity entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
|
@ -125,7 +126,7 @@ public class ActivityServiceImpl implements IActivityService {
|
|||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
|
|
|
@ -6,20 +6,27 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.service.OssService;
|
||||
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.scale.constant.StatusEnum;
|
||||
import org.dromara.scale.domain.ReservationOrder;
|
||||
import org.dromara.scale.domain.SysEvaluationRecord;
|
||||
import org.dromara.scale.domain.SysScale;
|
||||
import org.dromara.scale.domain.bo.ReservationOrderBo;
|
||||
import org.dromara.scale.domain.bo.SysScaleBo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderVo;
|
||||
import org.dromara.scale.domain.vo.StatisticNumVo;
|
||||
import org.dromara.scale.domain.vo.SysEvaluationRecordVo;
|
||||
import org.dromara.scale.domain.vo.SysScaleVo;
|
||||
import org.dromara.scale.mapper.ReservationOrderMapper;
|
||||
import org.dromara.scale.mapper.SysEvaluationRecordMapper;
|
||||
import org.dromara.scale.mapper.SysScaleMapper;
|
||||
import org.dromara.scale.service.IMyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -35,17 +42,31 @@ import java.util.List;
|
|||
public class MyServiceImpl implements IMyService {
|
||||
|
||||
private final SysEvaluationRecordMapper evaluationRecordMapper;
|
||||
|
||||
private final SysScaleMapper scaleMapper;
|
||||
private final ReservationOrderMapper reservationOrderMapper;
|
||||
|
||||
private final OssService ossService;
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getMyEvaluationTaskNum() {
|
||||
public List<StatisticNumVo> getMyNum() {
|
||||
List<StatisticNumVo> list = new ArrayList<>();
|
||||
Long userId = LoginHelper.getUserId();
|
||||
Long l = evaluationRecordMapper.selectCount(new LambdaQueryWrapper<SysEvaluationRecord>()
|
||||
|
||||
Long recoreNum = evaluationRecordMapper.selectCount(new LambdaQueryWrapper<SysEvaluationRecord>()
|
||||
.eq(SysEvaluationRecord::getUserId, userId)
|
||||
.eq(SysEvaluationRecord::getPublishFlag, 0)
|
||||
.le(SysEvaluationRecord::getStatus, StatusEnum.DISABLED.getValue()));
|
||||
return l.intValue();
|
||||
list.add(new StatisticNumVo("evaluation", recoreNum.intValue()));
|
||||
|
||||
List<String> scaleList = evaluationRecordMapper.selectEvaluationScaleList(userId);
|
||||
list.add(new StatisticNumVo("scale", scaleList.size()));
|
||||
|
||||
Long ordernum = reservationOrderMapper.selectCount(new LambdaQueryWrapper<ReservationOrder>()
|
||||
.eq(ReservationOrder::getCreateBy, userId)
|
||||
.eq(ReservationOrder::getOrderStatus, 2));
|
||||
list.add(new StatisticNumVo("intervene", ordernum.intValue()));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,16 +76,15 @@ public class MyServiceImpl implements IMyService {
|
|||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getScaleNum() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
List<String> list = evaluationRecordMapper.selectEvaluationScaleList(userId);
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysScaleVo> queryScalePageList(SysScaleBo bo, PageQuery pageQuery) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
|
@ -73,4 +93,12 @@ public class MyServiceImpl implements IMyService {
|
|||
new LambdaQueryWrapper<SysScale>().in(SysScale::getScaleId, list));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ReservationOrderVo> queryReservationPageList(ReservationOrderBo bo, PageQuery pageQuery) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
IPage<ReservationOrderVo> page = reservationOrderMapper.selectVoPage(pageQuery.build(),
|
||||
new LambdaQueryWrapper<ReservationOrder>().eq(ReservationOrder::getCreateBy, userId));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.dromara.scale.domain.Counselor;
|
|||
import org.dromara.scale.domain.ReservationOrder;
|
||||
import org.dromara.scale.domain.ReservationTime;
|
||||
import org.dromara.scale.domain.bo.ReservationOrderBo;
|
||||
import org.dromara.scale.domain.vo.ReservationCounselorOrderVo;
|
||||
import org.dromara.scale.domain.vo.ReservationOrderVo;
|
||||
import org.dromara.scale.mapper.CounselorMapper;
|
||||
import org.dromara.scale.mapper.ReservationOrderMapper;
|
||||
import org.dromara.scale.mapper.ReservationTimeMapper;
|
||||
|
@ -48,7 +48,7 @@ public class ReservationOrderServiceImpl implements IReservationOrderService {
|
|||
* @return 预约订单
|
||||
*/
|
||||
@Override
|
||||
public ReservationCounselorOrderVo queryById(Long id) {
|
||||
public ReservationOrderVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
|
@ -60,9 +60,9 @@ public class ReservationOrderServiceImpl implements IReservationOrderService {
|
|||
* @return 预约订单分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ReservationCounselorOrderVo> queryPageList(ReservationOrderBo bo, PageQuery pageQuery) {
|
||||
public TableDataInfo<ReservationOrderVo> queryPageList(ReservationOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ReservationOrder> lqw = buildQueryWrapper(bo);
|
||||
Page<ReservationCounselorOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
Page<ReservationOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class ReservationOrderServiceImpl implements IReservationOrderService {
|
|||
* @return 预约订单列表
|
||||
*/
|
||||
@Override
|
||||
public List<ReservationCounselorOrderVo> queryList(ReservationOrderBo bo) {
|
||||
public List<ReservationOrderVo> queryList(ReservationOrderBo bo) {
|
||||
LambdaQueryWrapper<ReservationOrder> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.scale.mapper.ActivityMapper">
|
||||
|
||||
<update id="addViewNum">
|
||||
update m_activity
|
||||
set view_nums = view_nums + 1
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue