优化租户配置;优化小程序首页接口
This commit is contained in:
parent
fea2186856
commit
b9da0c7d40
|
@ -140,6 +140,14 @@ tenant:
|
||||||
- sys_user_role
|
- sys_user_role
|
||||||
- sys_client
|
- sys_client
|
||||||
- sys_oss_config
|
- sys_oss_config
|
||||||
|
- sys_oss
|
||||||
|
- m_counselor
|
||||||
|
- m_counselor_experience
|
||||||
|
- m_counselor_qualification
|
||||||
|
- m_reservation_day
|
||||||
|
- m_reservation_order
|
||||||
|
- m_reservation_time
|
||||||
|
- m_score_record
|
||||||
|
|
||||||
# MyBatisPlus配置
|
# MyBatisPlus配置
|
||||||
# https://baomidou.com/config/
|
# https://baomidou.com/config/
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
package org.dromara.scale.controller.wx;
|
package org.dromara.scale.controller.wx;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>TODO<p>
|
* <p>TODO<p>
|
||||||
|
@ -38,6 +40,7 @@ public class WxScaleController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/pageList")
|
@GetMapping("/pageList")
|
||||||
public TableDataInfo<SysScaleVo> pageList(SysScaleBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SysScaleVo> pageList(SysScaleBo bo, PageQuery pageQuery) {
|
||||||
|
bo.setOrderBy("num");
|
||||||
return sysScaleService.queryPageList(bo, pageQuery);
|
return sysScaleService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,8 +48,11 @@ public class WxScaleController extends BaseController {
|
||||||
* 查询心理测评量列表,默认展示两条数据
|
* 查询心理测评量列表,默认展示两条数据
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public R<List<SysScaleVo>> list(@NotBlank(message = "类型不能为空") String scaleType) {
|
public R<Map<String, List<SysScaleVo>>> list(String[] scaleType) {
|
||||||
return R.ok(sysScaleService.queryWxList(scaleType));
|
if (ObjectUtil.isEmpty(scaleType)) {
|
||||||
|
throw new ServiceException("类型不能为空");
|
||||||
|
}
|
||||||
|
return R.ok(sysScaleService.queryWxMapList(scaleType));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -122,4 +122,6 @@ public class SysScaleBo extends BaseEntity {
|
||||||
private Integer freeFlag;
|
private Integer freeFlag;
|
||||||
|
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
|
private String orderBy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import org.dromara.scale.domain.vo.SysScaleVo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 心理测评量Service接口
|
* 心理测评量Service接口
|
||||||
|
@ -46,5 +47,5 @@ public interface ISysScaleService {
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
List<SysScaleVo> queryWxList(String scaleType);
|
Map<String,List<SysScaleVo>> queryWxMapList(String[] scaleType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,7 @@ import org.dromara.system.mapper.SysOssMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Collection;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.OptionalDouble;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,7 +67,11 @@ public class SysScaleServiceImpl implements ISysScaleService {
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<SysScaleVo> queryPageList(SysScaleBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SysScaleVo> queryPageList(SysScaleBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysScale> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<SysScale> lqw = buildQueryWrapper(bo);
|
||||||
lqw.orderByDesc(SysScale::getUpdateTime);
|
if ("num".equals(bo.getOrderBy())) {
|
||||||
|
lqw.orderByDesc(SysScale::getPublishNums);
|
||||||
|
} else {
|
||||||
|
lqw.orderByDesc(SysScale::getUpdateTime);
|
||||||
|
}
|
||||||
Page<SysScaleVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysScaleVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
for (SysScaleVo record : result.getRecords()) {
|
for (SysScaleVo record : result.getRecords()) {
|
||||||
List<SysDictDataVo> scaleTypeList = sysDictDataMapper.selectDictDataByTypeAndDictValue("scale_type", StrUtil.join(StrUtil.COMMA, record.getScaleType()));
|
List<SysDictDataVo> scaleTypeList = sysDictDataMapper.selectDictDataByTypeAndDictValue("scale_type", StrUtil.join(StrUtil.COMMA, record.getScaleType()));
|
||||||
|
@ -148,11 +150,16 @@ public class SysScaleServiceImpl implements ISysScaleService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysScaleVo> queryWxList(String scaleType) {
|
public Map<String,List<SysScaleVo>> queryWxMapList(String[] scaleType) {
|
||||||
LambdaQueryWrapper<SysScale> lqw = new LambdaQueryWrapper<>();
|
Map<String, List<SysScaleVo>> map = new HashMap<>(scaleType.length);
|
||||||
lqw.like(SysScale::getScaleType, scaleType);
|
for (String s : scaleType) {
|
||||||
lqw.orderByDesc(SysScale::getPublishNums);
|
LambdaQueryWrapper<SysScale> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.last("limit 2");
|
lqw.like(SysScale::getScaleType, s);
|
||||||
return baseMapper.selectVoList(lqw);
|
lqw.orderByDesc(SysScale::getPublishNums);
|
||||||
|
lqw.last("limit 2");
|
||||||
|
List<SysScaleVo> list = baseMapper.selectVoList(lqw);
|
||||||
|
map.put(s, list);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue