细化咨询师功能

This commit is contained in:
cjw 2024-07-31 10:16:01 +08:00
parent be3c684de1
commit a664b062b6
13 changed files with 169 additions and 104 deletions

View File

@ -268,7 +268,7 @@ wx:
miniapp: miniapp:
configs: configs:
- appid: wx2e09db4124332242 - appid: wx2e09db4124332242
secret: #微信小程序的Secret secret: ca069319b37b0909e65367c802c53d29
token: #微信小程序消息服务器配置的token token: #微信小程序消息服务器配置的token
aesKey: #微信小程序消息服务器配置的EncodingAESKey aesKey: #微信小程序消息服务器配置的EncodingAESKey
msgDataFormat: JSON msgDataFormat: JSON

View File

@ -1,26 +1,27 @@
package org.dromara.scale.controller; package org.dromara.scale.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated; import jakarta.validation.constraints.NotEmpty;
import org.dromara.common.idempotent.annotation.RepeatSubmit; import jakarta.validation.constraints.NotNull;
import org.dromara.common.log.annotation.Log; import lombok.RequiredArgsConstructor;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup; import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil; import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.scale.domain.vo.CounselorVo; import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.scale.domain.bo.CounselorBo; import org.dromara.common.log.annotation.Log;
import org.dromara.scale.service.ICounselorService; import org.dromara.common.log.enums.BusinessType;
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.scale.domain.bo.CounselorBo;
import org.dromara.scale.domain.vo.CounselorVo;
import org.dromara.scale.service.ICounselorService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* 心理咨询师 * 心理咨询师
@ -31,7 +32,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController @RestController
@RequestMapping("/scale/counselor") @RequestMapping("/counselor")
public class CounselorController extends BaseController { public class CounselorController extends BaseController {
private final ICounselorService counselorService; private final ICounselorService counselorService;
@ -39,7 +40,7 @@ public class CounselorController extends BaseController {
/** /**
* 查询心理咨询师列表 * 查询心理咨询师列表
*/ */
@SaCheckPermission("scale:counselor:list") @SaCheckPermission("sys:counselor:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<CounselorVo> list(CounselorBo bo, PageQuery pageQuery) { public TableDataInfo<CounselorVo> list(CounselorBo bo, PageQuery pageQuery) {
return counselorService.queryPageList(bo, pageQuery); return counselorService.queryPageList(bo, pageQuery);
@ -48,8 +49,8 @@ public class CounselorController extends BaseController {
/** /**
* 导出心理咨询师列表 * 导出心理咨询师列表
*/ */
@SaCheckPermission("scale:counselor:export") @SaCheckPermission("sys:counselor:export")
@Log(title = "心理咨询师", businessType = BusinessType.EXPORT) @Log(title = "导出心理咨询师", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(CounselorBo bo, HttpServletResponse response) { public void export(CounselorBo bo, HttpServletResponse response) {
List<CounselorVo> list = counselorService.queryList(bo); List<CounselorVo> list = counselorService.queryList(bo);
@ -61,7 +62,7 @@ public class CounselorController extends BaseController {
* *
* @param id 主键 * @param id 主键
*/ */
@SaCheckPermission("scale:counselor:query") @SaCheckPermission("sys:counselor:query")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<CounselorVo> getInfo(@NotNull(message = "主键不能为空") public R<CounselorVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) { @PathVariable Long id) {
@ -71,8 +72,8 @@ public class CounselorController extends BaseController {
/** /**
* 新增心理咨询师 * 新增心理咨询师
*/ */
@SaCheckPermission("scale:counselor:add") @SaCheckPermission("sys:counselor:add")
@Log(title = "心理咨询师", businessType = BusinessType.INSERT) @Log(title = "新增心理咨询师", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody CounselorBo bo) { public R<Void> add(@Validated(AddGroup.class) @RequestBody CounselorBo bo) {
@ -82,8 +83,8 @@ public class CounselorController extends BaseController {
/** /**
* 修改心理咨询师 * 修改心理咨询师
*/ */
@SaCheckPermission("scale:counselor:edit") @SaCheckPermission("sys:counselor:edit")
@Log(title = "心理咨询师", businessType = BusinessType.UPDATE) @Log(title = "修改心理咨询师", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CounselorBo bo) { public R<Void> edit(@Validated(EditGroup.class) @RequestBody CounselorBo bo) {
@ -93,13 +94,12 @@ public class CounselorController extends BaseController {
/** /**
* 删除心理咨询师 * 删除心理咨询师
* *
* @param ids 主键串 * @param id 主键串
*/ */
@SaCheckPermission("scale:counselor:remove") @SaCheckPermission("sys:counselor:remove")
@Log(title = "心理咨询师", businessType = BusinessType.DELETE) @Log(title = "删除心理咨询师", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{id}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long id) {
@PathVariable Long[] ids) { return toAjax(counselorService.deleteWithValidById(id, true));
return toAjax(counselorService.deleteWithValidByIds(List.of(ids), true));
} }
} }

View File

@ -1,26 +1,27 @@
package org.dromara.scale.controller; package org.dromara.scale.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated; import jakarta.validation.constraints.NotEmpty;
import org.dromara.common.idempotent.annotation.RepeatSubmit; import jakarta.validation.constraints.NotNull;
import org.dromara.common.log.annotation.Log; import lombok.RequiredArgsConstructor;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup; import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil; import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.scale.domain.vo.CounselorExperienceVo; import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.scale.domain.bo.CounselorExperienceBo; import org.dromara.common.log.annotation.Log;
import org.dromara.scale.service.ICounselorExperienceService; import org.dromara.common.log.enums.BusinessType;
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.scale.domain.bo.CounselorExperienceBo;
import org.dromara.scale.domain.vo.CounselorExperienceVo;
import org.dromara.scale.service.ICounselorExperienceService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* 培训经历 * 培训经历
@ -31,7 +32,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController @RestController
@RequestMapping("/scale/counselorExperience") @RequestMapping("/counselor/experience")
public class CounselorExperienceController extends BaseController { public class CounselorExperienceController extends BaseController {
private final ICounselorExperienceService counselorExperienceService; private final ICounselorExperienceService counselorExperienceService;
@ -39,7 +40,7 @@ public class CounselorExperienceController extends BaseController {
/** /**
* 查询培训经历列表 * 查询培训经历列表
*/ */
@SaCheckPermission("scale:counselorExperience:list") @SaCheckPermission("counselor:experience:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<CounselorExperienceVo> list(CounselorExperienceBo bo, PageQuery pageQuery) { public TableDataInfo<CounselorExperienceVo> list(CounselorExperienceBo bo, PageQuery pageQuery) {
return counselorExperienceService.queryPageList(bo, pageQuery); return counselorExperienceService.queryPageList(bo, pageQuery);
@ -48,7 +49,7 @@ public class CounselorExperienceController extends BaseController {
/** /**
* 导出培训经历列表 * 导出培训经历列表
*/ */
@SaCheckPermission("scale:counselorExperience:export") @SaCheckPermission("counselor:experience:export")
@Log(title = "培训经历", businessType = BusinessType.EXPORT) @Log(title = "培训经历", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(CounselorExperienceBo bo, HttpServletResponse response) { public void export(CounselorExperienceBo bo, HttpServletResponse response) {
@ -61,7 +62,7 @@ public class CounselorExperienceController extends BaseController {
* *
* @param id 主键 * @param id 主键
*/ */
@SaCheckPermission("scale:counselorExperience:query") @SaCheckPermission("counselor:experience:query")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<CounselorExperienceVo> getInfo(@NotNull(message = "主键不能为空") public R<CounselorExperienceVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) { @PathVariable Long id) {
@ -71,8 +72,8 @@ public class CounselorExperienceController extends BaseController {
/** /**
* 新增培训经历 * 新增培训经历
*/ */
@SaCheckPermission("scale:counselorExperience:add") @SaCheckPermission("counselor:experience:add")
@Log(title = "培训经历", businessType = BusinessType.INSERT) @Log(title = "新增培训经历", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody CounselorExperienceBo bo) { public R<Void> add(@Validated(AddGroup.class) @RequestBody CounselorExperienceBo bo) {
@ -82,8 +83,8 @@ public class CounselorExperienceController extends BaseController {
/** /**
* 修改培训经历 * 修改培训经历
*/ */
@SaCheckPermission("scale:counselorExperience:edit") @SaCheckPermission("counselor:experience:edit")
@Log(title = "培训经历", businessType = BusinessType.UPDATE) @Log(title = "修改培训经历", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CounselorExperienceBo bo) { public R<Void> edit(@Validated(EditGroup.class) @RequestBody CounselorExperienceBo bo) {
@ -95,8 +96,8 @@ public class CounselorExperienceController extends BaseController {
* *
* @param ids 主键串 * @param ids 主键串
*/ */
@SaCheckPermission("scale:counselorExperience:remove") @SaCheckPermission("counselor:experience:remove")
@Log(title = "培训经历", businessType = BusinessType.DELETE) @Log(title = "删除培训经历", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) { @PathVariable Long[] ids) {

View File

@ -1,26 +1,27 @@
package org.dromara.scale.controller; package org.dromara.scale.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated; import jakarta.validation.constraints.NotEmpty;
import org.dromara.common.idempotent.annotation.RepeatSubmit; import jakarta.validation.constraints.NotNull;
import org.dromara.common.log.annotation.Log; import lombok.RequiredArgsConstructor;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup; import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil; import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.scale.domain.vo.CounselorQualificationVo; import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.scale.domain.bo.CounselorQualificationBo; import org.dromara.common.log.annotation.Log;
import org.dromara.scale.service.ICounselorQualificationService; import org.dromara.common.log.enums.BusinessType;
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.scale.domain.bo.CounselorQualificationBo;
import org.dromara.scale.domain.vo.CounselorQualificationVo;
import org.dromara.scale.service.ICounselorQualificationService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* 资质证书 * 资质证书
@ -31,7 +32,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
@Validated @Validated
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController @RestController
@RequestMapping("/scale/counselorQualification") @RequestMapping("/counselor/qualification")
public class CounselorQualificationController extends BaseController { public class CounselorQualificationController extends BaseController {
private final ICounselorQualificationService counselorQualificationService; private final ICounselorQualificationService counselorQualificationService;
@ -39,7 +40,7 @@ public class CounselorQualificationController extends BaseController {
/** /**
* 查询资质证书列表 * 查询资质证书列表
*/ */
@SaCheckPermission("scale:counselorQualification:list") @SaCheckPermission("counselor:qualification:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<CounselorQualificationVo> list(CounselorQualificationBo bo, PageQuery pageQuery) { public TableDataInfo<CounselorQualificationVo> list(CounselorQualificationBo bo, PageQuery pageQuery) {
return counselorQualificationService.queryPageList(bo, pageQuery); return counselorQualificationService.queryPageList(bo, pageQuery);
@ -48,7 +49,7 @@ public class CounselorQualificationController extends BaseController {
/** /**
* 导出资质证书列表 * 导出资质证书列表
*/ */
@SaCheckPermission("scale:counselorQualification:export") @SaCheckPermission("counselor:qualification:export")
@Log(title = "资质证书", businessType = BusinessType.EXPORT) @Log(title = "资质证书", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(CounselorQualificationBo bo, HttpServletResponse response) { public void export(CounselorQualificationBo bo, HttpServletResponse response) {
@ -61,7 +62,7 @@ public class CounselorQualificationController extends BaseController {
* *
* @param id 主键 * @param id 主键
*/ */
@SaCheckPermission("scale:counselorQualification:query") @SaCheckPermission("counselor:qualification:query")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<CounselorQualificationVo> getInfo(@NotNull(message = "主键不能为空") public R<CounselorQualificationVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) { @PathVariable Long id) {
@ -71,7 +72,7 @@ public class CounselorQualificationController extends BaseController {
/** /**
* 新增资质证书 * 新增资质证书
*/ */
@SaCheckPermission("scale:counselorQualification:add") @SaCheckPermission("counselor:qualification:add")
@Log(title = "资质证书", businessType = BusinessType.INSERT) @Log(title = "资质证书", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
@ -82,7 +83,7 @@ public class CounselorQualificationController extends BaseController {
/** /**
* 修改资质证书 * 修改资质证书
*/ */
@SaCheckPermission("scale:counselorQualification:edit") @SaCheckPermission("counselor:qualification:edit")
@Log(title = "资质证书", businessType = BusinessType.UPDATE) @Log(title = "资质证书", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
@ -95,7 +96,7 @@ public class CounselorQualificationController extends BaseController {
* *
* @param ids 主键串 * @param ids 主键串
*/ */
@SaCheckPermission("scale:counselorQualification:remove") @SaCheckPermission("counselor:qualification:remove")
@Log(title = "资质证书", businessType = BusinessType.DELETE) @Log(title = "资质证书", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@ -1,11 +1,14 @@
package org.dromara.scale.domain; package org.dromara.scale.domain;
import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import java.io.Serial; import java.io.Serial;
import java.util.Date;
/** /**
* 培训经历对象 m_counselor_experience * 培训经历对象 m_counselor_experience
@ -27,10 +30,25 @@ public class CounselorExperience extends BaseEntity {
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
/**
* 咨询师主键
*/
private Long counselorId;
/** /**
* 经历描述 * 经历描述
*/ */
private String describe; private String describe;
/**
* 经历开始时间
*/
private Date startTime;
/**
* 经历结束时间
*/
private Date endTime;
} }

View File

@ -80,6 +80,8 @@ public class SysScale extends TenantEntity {
*/ */
private Long cover; private Long cover;
private Long appCover;
/** /**
* 发布次数 * 发布次数
*/ */

View File

@ -9,6 +9,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*; import jakarta.validation.constraints.*;
import java.util.Date;
/** /**
* 培训经历业务对象 m_counselor_experience * 培训经历业务对象 m_counselor_experience
* *
@ -21,16 +23,30 @@ import jakarta.validation.constraints.*;
public class CounselorExperienceBo extends BaseEntity { public class CounselorExperienceBo extends BaseEntity {
/** /**
* *
*/ */
@NotNull(message = "不能为空", groups = { EditGroup.class }) @NotNull(message = "不能为空", groups = {EditGroup.class})
private Long id; private Long id;
/**
* 咨询师主键
*/
@NotNull(message = "咨询师主键不能为空", groups = {AddGroup.class, EditGroup.class})
private Long counselorId;
/** /**
* 经历描述 * 经历描述
*/ */
@NotBlank(message = "经历描述不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "经历描述不能为空", groups = {AddGroup.class, EditGroup.class})
private String describe; private String describe;
/**
* 经历开始时间
*/
private Date startTime;
/**
* 经历结束时间
*/
private Date endTime;
} }

View File

@ -0,0 +1,18 @@
package org.dromara.scale.domain.bo;
import lombok.Data;
import java.util.List;
/**
* <p>TODO<p>
*
* @author cjw
* @version V1.0.0
* @date 2024/7/31 9:42
*/
@Data
public class SubmitExperienceBo {
private Long counselorId;
private List<CounselorExperienceBo> list;
}

View File

@ -88,6 +88,8 @@ public class SysScaleBo extends BaseEntity {
@NotNull(message = "封面不能为空", groups = {AddGroup.class, EditGroup.class}) @NotNull(message = "封面不能为空", groups = {AddGroup.class, EditGroup.class})
private Long cover; private Long cover;
private Long appCover;
/** /**
* 量表类型对应字典项scale_type * 量表类型对应字典项scale_type
*/ */

View File

@ -75,10 +75,13 @@ public class SysScaleVo implements Serializable {
*/ */
private Long cover; private Long cover;
private Long appCover;
/** /**
* 封面地址 * 封面地址
*/ */
private String coverUrl; private String coverUrl;
private String appCoverUrl;
/** /**
* 发布次数 * 发布次数

View File

@ -1,11 +1,10 @@
package org.dromara.scale.service; package org.dromara.scale.service;
import org.dromara.scale.domain.vo.CounselorVo;
import org.dromara.scale.domain.bo.CounselorBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
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.scale.domain.bo.CounselorBo;
import org.dromara.scale.domain.vo.CounselorVo;
import java.util.Collection;
import java.util.List; import java.util.List;
/** /**
@ -60,9 +59,9 @@ public interface ICounselorService {
/** /**
* 校验并批量删除心理咨询师信息 * 校验并批量删除心理咨询师信息
* *
* @param ids 待删除的主键集合 * @param id 待删除的主键集合
* @param isValid 是否进行有效性校验 * @param isValid 是否进行有效性校验
* @return 是否删除成功 * @return 是否删除成功
*/ */
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); Boolean deleteWithValidById(Long id, Boolean isValid);
} }

View File

@ -1,23 +1,22 @@
package org.dromara.scale.service.impl; 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.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.scale.domain.Counselor;
import org.dromara.scale.domain.bo.CounselorBo; import org.dromara.scale.domain.bo.CounselorBo;
import org.dromara.scale.domain.vo.CounselorVo; import org.dromara.scale.domain.vo.CounselorVo;
import org.dromara.scale.domain.Counselor;
import org.dromara.scale.mapper.CounselorMapper; import org.dromara.scale.mapper.CounselorMapper;
import org.dromara.scale.service.ICounselorService; import org.dromara.scale.service.ICounselorService;
import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Collection;
/** /**
* 心理咨询师Service业务层处理 * 心理咨询师Service业务层处理
@ -119,15 +118,15 @@ public class CounselorServiceImpl implements ICounselorService {
/** /**
* 校验并批量删除心理咨询师信息 * 校验并批量删除心理咨询师信息
* *
* @param ids 待删除的主键集合 * @param id 待删除的主键集合
* @param isValid 是否进行有效性校验 * @param isValid 是否进行有效性校验
* @return 是否删除成功 * @return 是否删除成功
*/ */
@Override @Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { public Boolean deleteWithValidById(Long id, Boolean isValid) {
if(isValid){ if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验 //TODO 做一些业务上的校验,判断是否需要校验
} }
return baseMapper.deleteByIds(ids) > 0; return baseMapper.deleteById(id) > 0;
} }
} }

View File

@ -10,6 +10,7 @@ import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
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.scale.constant.StatusEnum;
import org.dromara.scale.domain.ScoreRecord; import org.dromara.scale.domain.ScoreRecord;
import org.dromara.scale.domain.SysScale; import org.dromara.scale.domain.SysScale;
import org.dromara.scale.domain.bo.SysScaleBo; import org.dromara.scale.domain.bo.SysScaleBo;
@ -80,8 +81,10 @@ public class SysScaleServiceImpl implements ISysScaleService {
List<SysDictDataVo> peopleTypeList = sysDictDataMapper.selectDictDataByTypeAndDictValue("people_type", StrUtil.join(StrUtil.COMMA, record.getPeopleType())); List<SysDictDataVo> peopleTypeList = sysDictDataMapper.selectDictDataByTypeAndDictValue("people_type", StrUtil.join(StrUtil.COMMA, record.getPeopleType()));
record.setPeopleTypeName(peopleTypeList.stream().map(SysDictDataVo::getDictLabel).collect(Collectors.toList())); record.setPeopleTypeName(peopleTypeList.stream().map(SysDictDataVo::getDictLabel).collect(Collectors.toList()));
SysOss sysOss = sysOssMapper.selectById(record.getCover()); SysOss cover = sysOssMapper.selectById(record.getCover());
record.setCoverUrl(sysOss.getUrl()); record.setCoverUrl(cover.getUrl());
SysOss appCover = sysOssMapper.selectById(record.getAppCover());
record.setAppCoverUrl(appCover.getUrl());
} }
return TableDataInfo.build(result); return TableDataInfo.build(result);
} }
@ -114,6 +117,9 @@ public class SysScaleServiceImpl implements ISysScaleService {
public Boolean insertByBo(SysScaleBo bo) { public Boolean insertByBo(SysScaleBo bo) {
SysScale add = MapstructUtils.convert(bo, SysScale.class); SysScale add = MapstructUtils.convert(bo, SysScale.class);
validEntityBeforeSave(add); validEntityBeforeSave(add);
if (StatusEnum.IN_USE.getValue().equals(add.getFreeFlag())) {
add.setPrice(BigDecimal.ZERO);
}
boolean flag = baseMapper.insert(add) > 0; boolean flag = baseMapper.insert(add) > 0;
if (flag) { if (flag) {
bo.setScaleId(add.getScaleId()); bo.setScaleId(add.getScaleId());
@ -150,7 +156,7 @@ public class SysScaleServiceImpl implements ISysScaleService {
} }
@Override @Override
public Map<String,List<SysScaleVo>> queryWxMapList(String[] scaleType) { public Map<String, List<SysScaleVo>> queryWxMapList(String[] scaleType) {
Map<String, List<SysScaleVo>> map = new HashMap<>(scaleType.length); Map<String, List<SysScaleVo>> map = new HashMap<>(scaleType.length);
for (String s : scaleType) { for (String s : scaleType) {
LambdaQueryWrapper<SysScale> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysScale> lqw = new LambdaQueryWrapper<>();