Browse Source

Merge branch 'feature/yujt_AppendP2' of http://121.42.41.42:7070/r/epdc-cloud-property-yushan into feature/yujt_AppendP2

hotfix/yujt_opt
zhangyuan 5 years ago
parent
commit
dbba903e3c
  1. 13
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologyQuestionServiceImpl.java
  2. 2
      epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml
  3. 6
      epdc-cloud-property/src/main/resources/mapper/psychology/PsychologyQuestionDao.xml

13
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologyQuestionServiceImpl.java

@ -28,7 +28,9 @@ import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.dto.constant.PsychologyConstant; import com.elink.esua.epdc.dto.constant.PsychologyConstant;
import com.elink.esua.epdc.dto.psychology.PsychologyQuestionDTO; import com.elink.esua.epdc.dto.psychology.PsychologyQuestionDTO;
import com.elink.esua.epdc.dto.psychology.form.PsychologyQuestionFormDTO; import com.elink.esua.epdc.dto.psychology.form.PsychologyQuestionFormDTO;
import com.elink.esua.epdc.modules.psychology.dao.PsychologistDao;
import com.elink.esua.epdc.modules.psychology.dao.PsychologyQuestionDao; 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.PsychologyQuestionEntity; import com.elink.esua.epdc.modules.psychology.entity.PsychologyQuestionEntity;
import com.elink.esua.epdc.modules.psychology.redis.PsychologyQuestionRedis; import com.elink.esua.epdc.modules.psychology.redis.PsychologyQuestionRedis;
import com.elink.esua.epdc.modules.psychology.service.PsychologyQuestionService; import com.elink.esua.epdc.modules.psychology.service.PsychologyQuestionService;
@ -50,8 +52,9 @@ import java.util.Map;
@Service @Service
public class PsychologyQuestionServiceImpl extends BaseServiceImpl<PsychologyQuestionDao, PsychologyQuestionEntity> implements PsychologyQuestionService { public class PsychologyQuestionServiceImpl extends BaseServiceImpl<PsychologyQuestionDao, PsychologyQuestionEntity> implements PsychologyQuestionService {
@Autowired @Autowired
private PsychologyQuestionRedis psychologyQuestionRedis; private PsychologistDao psychologistDao;
@Override @Override
public PageData<PsychologyQuestionDTO> page(Map<String, Object> params) { public PageData<PsychologyQuestionDTO> page(Map<String, Object> params) {
@ -94,6 +97,14 @@ public class PsychologyQuestionServiceImpl extends BaseServiceImpl<PsychologyQue
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void saveQuestion(PsychologyQuestionFormDTO dto) { public void saveQuestion(PsychologyQuestionFormDTO dto) {
// 向指定咨询师提问
if (StringUtils.isNotBlank(dto.getPsychologistId())) {
PsychologistEntity psychologistEntity = psychologistDao.selectById(dto.getPsychologistId());
if (null != psychologistEntity) {
// 心理咨询问题表存储的 咨询师id=pc端用户id
dto.setPsychologistId(psychologistEntity.getUserId());
}
}
if (YesOrNoEnum.YES.value().equals(dto.getAnonymousFlag())) { if (YesOrNoEnum.YES.value().equals(dto.getAnonymousFlag())) {
dto.setUserName(PsychologyConstant.PROPERTY_PSYCHOLOGY_ANONYMOUS_NAME); dto.setUserName(PsychologyConstant.PROPERTY_PSYCHOLOGY_ANONYMOUS_NAME);
dto.setUserAvatar(PsychologyConstant.PROPERTY_PSYCHOLOGY_ANONYMOUS_AVATAR); dto.setUserAvatar(PsychologyConstant.PROPERTY_PSYCHOLOGY_ANONYMOUS_AVATAR);

2
epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml

@ -43,7 +43,7 @@
<result property="id" column="ID"/> <result property="id" column="ID"/>
<result property="name" column="NAME"/> <result property="name" column="NAME"/>
<result property="avatar" column="AVATAR"/> <result property="avatar" column="AVATAR"/>
<result property="motto" column="MOBILE"/> <result property="motto" column="MOTTO"/>
<result property="briefIntroduction" column="BRIEF_INTRODUCTION"/> <result property="briefIntroduction" column="BRIEF_INTRODUCTION"/>
<collection property="titleList" ofType="java.lang.String"> <collection property="titleList" ofType="java.lang.String">
<result column="TITLE" /> <result column="TITLE" />

6
epdc-cloud-property/src/main/resources/mapper/psychology/PsychologyQuestionDao.xml

@ -41,9 +41,9 @@
<resultMap id="selectListAllQuestionsMap" type="com.elink.esua.epdc.dto.psychology.result.PsychologyAnswerListResultDTO"> <resultMap id="selectListAllQuestionsMap" type="com.elink.esua.epdc.dto.psychology.result.PsychologyAnswerListResultDTO">
<result property="id" column="ID" /> <result property="id" column="ID" />
<result property="userId" column="ID" /> <result property="userId" column="USER_ID" />
<result property="userName" column="ID" /> <result property="userName" column="USER_NAME" />
<result property="userAvatar" column="ID" /> <result property="userAvatar" column="USER_AVATAR" />
<result property="questionContent" column="QUESTION_CONTENT" /> <result property="questionContent" column="QUESTION_CONTENT" />
<collection property="answerList" ofType="com.elink.esua.epdc.dto.psychology.result.PsychologyAnswerInfoResultDTO"> <collection property="answerList" ofType="com.elink.esua.epdc.dto.psychology.result.PsychologyAnswerInfoResultDTO">
<result property="psychologistId" column="PSYCHOLOGIST_ID" /> <result property="psychologistId" column="PSYCHOLOGIST_ID" />

Loading…
Cancel
Save