|
|
@ -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.psychology.PsychologyQuestionDTO; |
|
|
|
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.entity.PsychologistEntity; |
|
|
|
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.service.PsychologyQuestionService; |
|
|
@ -50,8 +52,9 @@ import java.util.Map; |
|
|
|
@Service |
|
|
|
public class PsychologyQuestionServiceImpl extends BaseServiceImpl<PsychologyQuestionDao, PsychologyQuestionEntity> implements PsychologyQuestionService { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private PsychologyQuestionRedis psychologyQuestionRedis; |
|
|
|
private PsychologistDao psychologistDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<PsychologyQuestionDTO> page(Map<String, Object> params) { |
|
|
@ -94,6 +97,14 @@ public class PsychologyQuestionServiceImpl extends BaseServiceImpl<PsychologyQue |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
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())) { |
|
|
|
dto.setUserName(PsychologyConstant.PROPERTY_PSYCHOLOGY_ANONYMOUS_NAME); |
|
|
|
dto.setUserAvatar(PsychologyConstant.PROPERTY_PSYCHOLOGY_ANONYMOUS_AVATAR); |
|
|
|