From c9abcaf3ed2d30f49668b1d2eb9c0ad44fb55326 Mon Sep 17 00:00:00 2001 From: yujt Date: Fri, 12 Jun 2020 17:35:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BF=83=E7=90=86=E5=92=A8?= =?UTF-8?q?=E8=AF=A2=E5=B8=88=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AppPsychologistController.java | 16 ++++++---- .../psychology/dao/PsychologistDao.java | 14 ++++----- .../dao/PsychologistTitleRelationDao.java | 10 ------- .../service/PsychologistService.java | 5 ++-- .../service/impl/PsychologistServiceImpl.java | 26 +++++----------- .../mapper/psychology/PsychologistDao.xml | 30 +++++++++++++++---- .../PsychologistTitleRelationDao.xml | 24 --------------- 7 files changed, 53 insertions(+), 72 deletions(-) diff --git a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/AppPsychologistController.java b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/AppPsychologistController.java index 09f227b..fd88d12 100644 --- a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/AppPsychologistController.java +++ b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/AppPsychologistController.java @@ -62,11 +62,17 @@ public class AppPsychologistController { return new Result>().ok(list); } - @GetMapping("psychologistInfo") - public Result psychologistInfo(@RequestBody PsychologistInfoFormDTO formDto) throws Exception { - //效验数据 - ValidatorUtils.validateEntity(formDto, AddGroup.class, DefaultGroup.class); - PsychologistInfoResultDTO data = psychologistService.psychologistInfo(formDto); + /** + * 查询心理咨询师详细信息 + * + * @param psychologistId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2020/6/12 16:28 + */ + @GetMapping("psychologistInfo/{psychologistId}") + public Result psychologistInfo(@PathVariable("psychologistId") String psychologistId) { + PsychologistInfoResultDTO data = psychologistService.psychologistInfo(psychologistId); return new Result().ok(data); } diff --git a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistDao.java b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistDao.java index 17b8165..160d163 100644 --- a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistDao.java +++ b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistDao.java @@ -18,12 +18,12 @@ package com.elink.esua.epdc.modules.psychology.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; -import com.elink.esua.epdc.dto.psychology.PsychologistDTO; import com.elink.esua.epdc.dto.psychology.form.PsychologistFormDTO; -import com.elink.esua.epdc.dto.psychology.form.PsychologistInfoFormDTO; import com.elink.esua.epdc.dto.psychology.form.PsychologySubmitAnswerFormDTO; +import com.elink.esua.epdc.dto.psychology.result.PsychologistInfoResultDTO; import com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -60,12 +60,12 @@ public interface PsychologistDao extends BaseDao { /** * 心理咨询师详细 * - * @return java.util.List - * @params [params] - * @author zhangyuan - * @since 2020/5/21 14:54 + * @param psychologistId + * @return com.elink.esua.epdc.dto.psychology.result.PsychologistInfoResultDTO + * @author work@yujt.net.cn + * @date 2020/6/12 16:30 */ - PsychologistEntity psychologistInfo(PsychologistInfoFormDTO dto); + PsychologistInfoResultDTO psychologistInfo(@Param("psychologistId") String psychologistId); /** * 心理咨询师详细 diff --git a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleRelationDao.java b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleRelationDao.java index ac7ae94..179cdb3 100644 --- a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleRelationDao.java +++ b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleRelationDao.java @@ -43,16 +43,6 @@ public interface PsychologistTitleRelationDao extends BaseDao selectTitleIds(@Param("id") String id); - /** - * 咨询师头衔名称列表 - * - * @return java.util.List - * @params [id] - * @author zhangyuan - * @since 2020/5/21 14:54 - */ - List selectTitles(@Param("id") String id); - /** * 清空关联 * diff --git a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistService.java b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistService.java index 51b1a26..0cd20e8 100644 --- a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistService.java +++ b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistService.java @@ -21,7 +21,6 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.dto.psychology.PsychologistDTO; import com.elink.esua.epdc.dto.psychology.form.PsychologistFormDTO; -import com.elink.esua.epdc.dto.psychology.form.PsychologistInfoFormDTO; import com.elink.esua.epdc.dto.psychology.form.PsychologyAnswerFormDTO; import com.elink.esua.epdc.dto.psychology.form.PsychologyUnansweredFormDTO; import com.elink.esua.epdc.dto.psychology.result.*; @@ -111,12 +110,12 @@ public interface PsychologistService extends BaseService { /** * 心理咨询师详细API * - * @param dto + * @param psychologistId * @return PsychologistInfoResultDTO * @author zhangyuan * @date 2020-06-04 */ - PsychologistInfoResultDTO psychologistInfo(PsychologistInfoFormDTO dto); + PsychologistInfoResultDTO psychologistInfo(String psychologistId); /** * 居民端-心理咨询-我的问题列表 diff --git a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistServiceImpl.java b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistServiceImpl.java index 0aa807e..c9ab329 100644 --- a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistServiceImpl.java +++ b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistServiceImpl.java @@ -29,7 +29,6 @@ import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.dto.psychology.PsychologistDTO; import com.elink.esua.epdc.dto.psychology.form.PsychologistFormDTO; -import com.elink.esua.epdc.dto.psychology.form.PsychologistInfoFormDTO; import com.elink.esua.epdc.dto.psychology.form.PsychologyAnswerFormDTO; import com.elink.esua.epdc.dto.psychology.form.PsychologyUnansweredFormDTO; import com.elink.esua.epdc.dto.psychology.result.*; @@ -40,9 +39,9 @@ import com.elink.esua.epdc.modules.psychology.dao.PsychologyQuestionDao; import com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity; import com.elink.esua.epdc.modules.psychology.entity.PsychologistTitleRelationEntity; import com.elink.esua.epdc.modules.psychology.entity.PsychologyAnswerEntity; -import com.elink.esua.epdc.modules.psychology.redis.PsychologistRedis; import com.elink.esua.epdc.modules.psychology.service.PsychologistService; import org.apache.commons.lang3.StringUtils; +import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -64,16 +63,13 @@ import java.util.stream.Collectors; public class PsychologistServiceImpl extends BaseServiceImpl implements PsychologistService { @Autowired - private PsychologistRedis psychologistRedis; + private PsychologistTitleRelationDao psychologistTitleRelationDao; - @Resource - PsychologistTitleRelationDao psychologistTitleRelationDao; - - @Resource - PsychologyQuestionDao psychologyQuestionDao; + @Autowired + private PsychologyQuestionDao psychologyQuestionDao; - @Resource - PsychologyAnswerDao psychologyAnswerDao; + @Autowired + private PsychologyAnswerDao psychologyAnswerDao; @Override public PageData page(Map params) { @@ -175,14 +171,8 @@ public class PsychologistServiceImpl extends BaseServiceImpl titles = psychologistTitleRelationDao.selectTitles(dto.getPsychologistId()); - data.setTitle(titles.size() == 0 ? new ArrayList<>() : titles); - } - return data; + public PsychologistInfoResultDTO psychologistInfo(String psychologistId) { + return baseDao.psychologistInfo(psychologistId); } @Override diff --git a/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml b/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml index c13195f..f2c3128 100644 --- a/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml +++ b/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml @@ -56,14 +56,34 @@ - SELECT - + p.ID, + p.`NAME`, + p.AVATAR, + p.MOTTO, + p.BRIEF_INTRODUCTION, + pt.TITLE FROM - epdc_psychologist + epdc_psychologist p + LEFT JOIN epdc_psychologist_title_relation ptr ON p.ID = ptr.PSYCHOLOGIST_ID + LEFT JOIN epdc_psychologist_title pt ON ptr.TITLE_ID = pt.ID WHERE - DEL_FLAG = '0' - AND ID = #{psychologistId} + p.ID = #{psychologistId} + AND p.DEL_FLAG = '0' + AND ptr.DEL_FLAG = '0' SELECT TITLE_ID @@ -27,18 +15,6 @@ t.SORT ASC, t.CREATED_TIME DESC - DELETE FROM