微信端查看咨询师培训经历;咨询师的擅长领域数据格式优化
This commit is contained in:
parent
5602f14254
commit
77e48de989
|
@ -35,7 +35,7 @@ import java.util.List;
|
|||
@RequestMapping("/counselor/experience")
|
||||
public class CounselorExperienceController extends BaseController {
|
||||
|
||||
private final ICounselorExperienceService counselorExperienceService;
|
||||
private final ICounselorExperienceService experienceService;
|
||||
|
||||
/**
|
||||
* 查询培训经历列表
|
||||
|
@ -43,7 +43,7 @@ public class CounselorExperienceController extends BaseController {
|
|||
@SaCheckPermission("counselor:experience:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CounselorExperienceVo> list(CounselorExperienceBo bo, PageQuery pageQuery) {
|
||||
return counselorExperienceService.queryPageList(bo, pageQuery);
|
||||
return experienceService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,7 +53,7 @@ public class CounselorExperienceController extends BaseController {
|
|||
@Log(title = "培训经历", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CounselorExperienceBo bo, HttpServletResponse response) {
|
||||
List<CounselorExperienceVo> list = counselorExperienceService.queryList(bo);
|
||||
List<CounselorExperienceVo> list = experienceService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "培训经历", CounselorExperienceVo.class, response);
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class CounselorExperienceController extends BaseController {
|
|||
@GetMapping("/{id}")
|
||||
public R<CounselorExperienceVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(counselorExperienceService.queryById(id));
|
||||
return R.ok(experienceService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,7 +77,7 @@ public class CounselorExperienceController extends BaseController {
|
|||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CounselorExperienceBo bo) {
|
||||
return toAjax(counselorExperienceService.insertByBo(bo));
|
||||
return toAjax(experienceService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -88,7 +88,7 @@ public class CounselorExperienceController extends BaseController {
|
|||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CounselorExperienceBo bo) {
|
||||
return toAjax(counselorExperienceService.updateByBo(bo));
|
||||
return toAjax(experienceService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,6 +101,6 @@ public class CounselorExperienceController extends BaseController {
|
|||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(counselorExperienceService.deleteWithValidByIds(List.of(ids), true));
|
||||
return toAjax(experienceService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,14 @@ import org.dromara.common.log.annotation.Log;
|
|||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.scale.domain.bo.CounselorExperienceBo;
|
||||
import org.dromara.scale.domain.bo.CounselorQualificationBo;
|
||||
import org.dromara.scale.domain.bo.ReservationDayBo;
|
||||
import org.dromara.scale.domain.vo.CounselorExperienceVo;
|
||||
import org.dromara.scale.domain.vo.CounselorQualificationVo;
|
||||
import org.dromara.scale.domain.vo.CounselorVo;
|
||||
import org.dromara.scale.domain.vo.ReservationDateVo;
|
||||
import org.dromara.scale.service.ICounselorExperienceService;
|
||||
import org.dromara.scale.service.ICounselorQualificationService;
|
||||
import org.dromara.scale.service.ICounselorService;
|
||||
import org.dromara.scale.service.IReservationService;
|
||||
|
@ -40,6 +43,8 @@ public class WxCounselorController extends BaseController {
|
|||
|
||||
private final ICounselorQualificationService qualificationService;
|
||||
|
||||
private final ICounselorExperienceService experienceService;
|
||||
|
||||
/**
|
||||
* 获取心理咨询师详细信息
|
||||
*/
|
||||
|
@ -59,17 +64,42 @@ public class WxCounselorController extends BaseController {
|
|||
return toAjax(reservationService.insertByBo(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取咨询师预约日历
|
||||
*
|
||||
* @param time 年-月
|
||||
* @param counselorId 咨询师id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/date")
|
||||
public R<List<ReservationDateVo>> getReservationList(String time, Long counselorId) {
|
||||
return R.ok(reservationService.selectDateList(time, counselorId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取咨询师证书
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/qualification")
|
||||
public R<List<CounselorQualificationVo>> getQualificationList() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
CounselorQualificationBo bo = new CounselorQualificationBo();
|
||||
bo.setCounselorId(userId);
|
||||
return R.ok(qualificationService.queryList(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取咨询师培训经历
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/experience")
|
||||
public R<List<CounselorExperienceVo>> getExperienceList() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
CounselorExperienceBo bo = new CounselorExperienceBo();
|
||||
bo.setCounselorId(userId);
|
||||
return R.ok(experienceService.queryList(bo));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,9 +2,12 @@ package org.dromara.scale.domain;
|
|||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import io.github.linpeilie.annotations.AutoMapping;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.scale.domain.vo.CounselorVo;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
@ -19,6 +22,7 @@ import java.util.Date;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("m_counselor")
|
||||
@AutoMapper(target = CounselorVo.class)
|
||||
public class Counselor extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
|
@ -28,6 +32,7 @@ public class Counselor extends BaseEntity {
|
|||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
@AutoMapping(target = "name")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
@ -48,12 +53,13 @@ public class Counselor extends BaseEntity {
|
|||
/**
|
||||
* 擅长领域
|
||||
*/
|
||||
@AutoMapping(target = "specialityField", expression = "java(cn.hutool.core.util.StrUtil.split(source.getSpecialityField(), \",\"))")
|
||||
private String specialityField;
|
||||
|
||||
/**
|
||||
* 封面组
|
||||
*/
|
||||
|
||||
@AutoMapping(target = "coversUrl")
|
||||
private String covers;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.scale.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapping;
|
||||
import org.dromara.scale.domain.Counselor;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
|
@ -10,6 +11,7 @@ import lombok.EqualsAndHashCode;
|
|||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 心理咨询师业务对象 m_counselor
|
||||
|
@ -55,8 +57,8 @@ public class CounselorBo extends BaseEntity {
|
|||
/**
|
||||
* 擅长领域
|
||||
*/
|
||||
@NotBlank(message = "擅长领域标签不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String specialityField;
|
||||
@AutoMapping(target = "specialityField", expression = "java(java.lang.String.join(\",\", source.getSpecialityField()))")
|
||||
private List<String> specialityField;
|
||||
|
||||
/**
|
||||
* 封面组
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.io.Serial;
|
|||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -35,8 +36,7 @@ public class CounselorVo implements Serializable {
|
|||
* 姓名
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME)
|
||||
@AutoMapping(target = "id")
|
||||
private String name;
|
||||
private Long name;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
|
@ -56,7 +56,8 @@ public class CounselorVo implements Serializable {
|
|||
/**
|
||||
* 擅长领域
|
||||
*/
|
||||
private String specialityField;
|
||||
@AutoMapping(ignore = true)
|
||||
private List<String> specialityField;
|
||||
|
||||
/**
|
||||
* 封面组
|
||||
|
@ -65,7 +66,6 @@ public class CounselorVo implements Serializable {
|
|||
private String covers;
|
||||
|
||||
@Translation(type = TransConstant.OSS_ID_TO_URL)
|
||||
@AutoMapping(target = "covers")
|
||||
private String coversUrl;
|
||||
|
||||
/**
|
||||
|
|
|
@ -70,7 +70,8 @@ public class CounselorExperienceServiceImpl implements ICounselorExperienceServi
|
|||
private LambdaQueryWrapper<CounselorExperience> buildQueryWrapper(CounselorExperienceBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CounselorExperience> lqw = Wrappers.lambdaQuery();
|
||||
//lqw.eq(StringUtils.isNotBlank(bo.getDescribe()), CounselorExperience::getDescribe, bo.getDescribe());
|
||||
lqw.eq(bo.getCounselorId() != null, CounselorExperience::getCounselorId, bo.getCounselorId());
|
||||
lqw.orderByAsc(CounselorExperience::getStartTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,23 +1,22 @@
|
|||
package org.dromara.scale.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.scale.domain.CounselorQualification;
|
||||
import org.dromara.scale.domain.bo.CounselorQualificationBo;
|
||||
import org.dromara.scale.domain.vo.CounselorQualificationVo;
|
||||
import org.dromara.scale.domain.CounselorQualification;
|
||||
import org.dromara.scale.mapper.CounselorQualificationMapper;
|
||||
import org.dromara.scale.service.ICounselorQualificationService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 资质证书Service业务层处理
|
||||
|
@ -72,8 +71,6 @@ public class CounselorQualificationServiceImpl implements ICounselorQualificatio
|
|||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CounselorQualification> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getCounselorId() != null, CounselorQualification::getCounselorId, bo.getCounselorId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCertificateName()), CounselorQualification::getCertificateName, bo.getCertificateName());
|
||||
lqw.eq(bo.getCertificateImage() != null, CounselorQualification::getCertificateImage, bo.getCertificateImage());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ public class CounselorServiceImpl implements ICounselorService {
|
|||
//lqw.like(StringUtils.isNotBlank(bo.getName()), Counselor::getName, bo.getName());
|
||||
lqw.eq(bo.getPrice() != null, Counselor::getPrice, bo.getPrice());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIntroduce()), Counselor::getIntroduce, bo.getIntroduce());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecialityField()), Counselor::getSpecialityField, bo.getSpecialityField());
|
||||
//lqw.eq(StringUtils.isNotBlank(bo.getSpecialityField()), Counselor::getSpecialityField, bo.getSpecialityField());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCovers()), Counselor::getCovers, bo.getCovers());
|
||||
return lqw;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,6 @@ public class ReservationServiceImpl implements IReservationService {
|
|||
|
||||
@Override
|
||||
public List<ReservationDateVo> selectDateList(String time, Long counselorId) {
|
||||
|
||||
return dayMapper.selectDateList(time, counselorId);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue