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 e284724..c21091e 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 @@ -20,6 +20,8 @@ package com.elink.esua.epdc.modules.psychology.controller; import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.utils.Result; 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.result.PsychologistInfoResultDTO; import com.elink.esua.epdc.dto.psychology.result.PsychologistResultDTO; import com.elink.esua.epdc.modules.psychology.service.PsychologistService; import org.springframework.beans.factory.annotation.Autowired; @@ -45,9 +47,14 @@ public class AppPsychologistController { private PsychologistService psychologistService; @GetMapping("listPsychiatrist") - public Result> export(@RequestBody PsychologistFormDTO formDto) throws Exception { + public Result> listPsychiatrist(@RequestBody PsychologistFormDTO formDto) throws Exception { List list = psychologistService.listPsychiatrist(formDto); return new Result>().ok(list); } + @GetMapping("psychologistInfo") + public Result psychologistInfo(@RequestBody PsychologistInfoFormDTO formDto) throws Exception { + PsychologistInfoResultDTO data = psychologistService.psychologistInfo(formDto); + return new Result().ok(data); + } } \ No newline at end of file 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 4b1cd29..154c741 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 @@ -19,6 +19,7 @@ package com.elink.esua.epdc.modules.psychology.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.psychology.form.PsychologistFormDTO; +import com.elink.esua.epdc.dto.psychology.form.PsychologistInfoFormDTO; import com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity; import org.apache.ibatis.annotations.Mapper; @@ -53,4 +54,15 @@ public interface PsychologistDao extends BaseDao { * @since 2020/5/21 14:54 */ List listPsychiatrist(PsychologistFormDTO dto); + + /** + * 心理咨询师详细 + * + * @return java.util.List + * @params [params] + * @author zhangyuan + * @since 2020/5/21 14:54 + */ + PsychologistEntity psychologistInfo(PsychologistInfoFormDTO dto); + } \ No newline at end of file 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 5b6e778..ac7ae94 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 @@ -34,7 +34,17 @@ import java.util.List; public interface PsychologistTitleRelationDao extends BaseDao { /** - * 咨询师列表 + * 咨询师头衔id列表 + * + * @return java.util.List + * @params [id] + * @author zhangyuan + * @since 2020/5/21 14:54 + */ + List selectTitleIds(@Param("id") String id); + + /** + * 咨询师头衔名称列表 * * @return java.util.List * @params [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 2194709..8a369bb 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,6 +21,8 @@ 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.result.PsychologistInfoResultDTO; import com.elink.esua.epdc.dto.psychology.result.PsychologistResultDTO; import com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity; @@ -105,4 +107,14 @@ public interface PsychologistService extends BaseService { */ List listPsychiatrist(PsychologistFormDTO dto); + /** + * 心理咨询师详细API + * + * @param dto + * @return PsychologistInfoResultDTO + * @author zhangyuan + * @date 2020-06-04 + */ + PsychologistInfoResultDTO psychologistInfo(PsychologistInfoFormDTO dto); + } \ No newline at end of file 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 6019c47..98c3567 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 @@ -25,6 +25,8 @@ 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.result.PsychologistInfoResultDTO; import com.elink.esua.epdc.dto.psychology.result.PsychologistResultDTO; import com.elink.esua.epdc.modules.psychology.dao.PsychologistDao; import com.elink.esua.epdc.modules.psychology.dao.PsychologistTitleRelationDao; @@ -86,7 +88,7 @@ public class PsychologistServiceImpl extends BaseServiceImpl titles = psychologistTitleRelationDao.selectTitles(id); + List titles = psychologistTitleRelationDao.selectTitleIds(id); dto.setTitles(titles == null ? new ArrayList<>() : titles); return dto; } @@ -136,4 +138,14 @@ public class PsychologistServiceImpl extends BaseServiceImpl entity = baseDao.listPsychiatrist(dto); return ConvertUtils.sourceToTarget(entity, PsychologistResultDTO.class); } + + @Override + public PsychologistInfoResultDTO psychologistInfo(PsychologistInfoFormDTO dto) { + PsychologistEntity entity = baseDao.psychologistInfo(dto); + PsychologistInfoResultDTO data = ConvertUtils.sourceToTarget(entity, PsychologistInfoResultDTO.class); + List titles = psychologistTitleRelationDao.selectTitles(dto.getPsychologistId()); + data.setTitle(titles == null ? new ArrayList<>() : titles); + return data; + } + } \ No newline at end of file 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 1e651d1..fc229e2 100644 --- a/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml +++ b/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml @@ -57,4 +57,14 @@ LIMIT 4 + + \ No newline at end of file diff --git a/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleRelationDao.xml b/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleRelationDao.xml index 6602d4d..d4cea74 100644 --- a/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleRelationDao.xml +++ b/epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleRelationDao.xml @@ -15,7 +15,7 @@ - SELECT TITLE_ID FROM @@ -27,6 +27,18 @@ t.SORT ASC, t.CREATED_TIME DESC + DELETE FROM