|
@@ -1,5 +1,6 @@
|
|
|
package com.fs.hisStore.service.impl;
|
|
package com.fs.hisStore.service.impl;
|
|
|
|
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
import java.util.Comparator;
|
|
import java.util.Comparator;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -10,6 +11,7 @@ import java.util.stream.Stream;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fs.common.BeanCopyUtils;
|
|
import com.fs.common.BeanCopyUtils;
|
|
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.exception.CustomException;
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -21,7 +23,9 @@ import com.fs.his.service.IFsDoctorService;
|
|
|
import com.fs.his.service.IFsQuestionAndAnswerService;
|
|
import com.fs.his.service.IFsQuestionAndAnswerService;
|
|
|
import com.fs.his.vo.AnswerVO;
|
|
import com.fs.his.vo.AnswerVO;
|
|
|
import com.fs.his.vo.FsQuestionAndAnswerVO;
|
|
import com.fs.his.vo.FsQuestionAndAnswerVO;
|
|
|
|
|
+import com.fs.hisStore.param.FsUserInformationCollectionListDParam;
|
|
|
import com.fs.hisStore.param.FsUserInformationCollectionParam;
|
|
import com.fs.hisStore.param.FsUserInformationCollectionParam;
|
|
|
|
|
+import com.fs.hisStore.vo.FsUserInformationCollectionListDVO;
|
|
|
import com.fs.hisStore.vo.FsUserInformationCollectionVO;
|
|
import com.fs.hisStore.vo.FsUserInformationCollectionVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -51,6 +55,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IFsQuestionAndAnswerService questionAndAnswerService;
|
|
private IFsQuestionAndAnswerService questionAndAnswerService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private FsUserInformationCollectionMapper fsUserInformationCollectionMapper;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询用户信息采集
|
|
* 查询用户信息采集
|
|
|
*
|
|
*
|
|
@@ -135,6 +142,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
Long questionId = map.getQuestionId();
|
|
Long questionId = map.getQuestionId();
|
|
|
FsUserInformationCollection fsUserInformationCollection = baseMapper.selectByUserId(userId);
|
|
FsUserInformationCollection fsUserInformationCollection = baseMapper.selectByUserId(userId);
|
|
|
if (fsUserInformationCollection != null) {
|
|
if (fsUserInformationCollection != null) {
|
|
|
|
|
+ //组装返回数据
|
|
|
vo.setQuestionId(fsUserInformationCollection.getQuestionId());
|
|
vo.setQuestionId(fsUserInformationCollection.getQuestionId());
|
|
|
vo.setId(fsUserInformationCollection.getId());
|
|
vo.setId(fsUserInformationCollection.getId());
|
|
|
vo.setAmount(fsUserInformationCollection.getAmount());
|
|
vo.setAmount(fsUserInformationCollection.getAmount());
|
|
@@ -177,6 +185,43 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
return vo;
|
|
return vo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<FsUserInformationCollectionListDVO> selectFsUserInformationCollectionListDVO(FsUserInformationCollectionListDParam param) {
|
|
|
|
|
+ return fsUserInformationCollectionMapper.selectFsUserInformationCollectionListDVO(param);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public FsUserInformationCollectionVO detail(Long id) {
|
|
|
|
|
+ FsUserInformationCollectionVO vo = new FsUserInformationCollectionVO();
|
|
|
|
|
+ FsUserInformationCollection collection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(id);
|
|
|
|
|
+ if (collection != null) {
|
|
|
|
|
+ vo.setAnswers(JSON.parseArray(collection.getJsonInfo(), AnswerVO.class));
|
|
|
|
|
+ }
|
|
|
|
|
+ return vo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public R doctorConfirm(FsUserInformationCollection collection) {
|
|
|
|
|
+ FsUserInformationCollection fsUserInformationCollection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(collection.getId());
|
|
|
|
|
+ if (fsUserInformationCollection == null) {
|
|
|
|
|
+ return R.error("没有用户采集信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (fsUserInformationCollection.getUserConfirm() == 0){
|
|
|
|
|
+ return R.error("用户未确认");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (fsUserInformationCollection.getDoctorConfirm() == 1){
|
|
|
|
|
+ return R.error("医生已确认");
|
|
|
|
|
+ }
|
|
|
|
|
+ FsUserInformationCollection map = new FsUserInformationCollection();
|
|
|
|
|
+ map.setId(collection.getId());
|
|
|
|
|
+ map.setDoctorAdvice(collection.getDoctorAdvice());
|
|
|
|
|
+ map.setDoctorConfirm(1);
|
|
|
|
|
+ if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
|
|
|
|
|
+ return R.ok();
|
|
|
|
|
+ }
|
|
|
|
|
+ return R.error("医生确认失败");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private List<AnswerVO> getAnswerVOs(List<AnswerVO> target,List<AnswerVO> source) {
|
|
private List<AnswerVO> getAnswerVOs(List<AnswerVO> target,List<AnswerVO> source) {
|
|
|
target.addAll(source);
|
|
target.addAll(source);
|
|
|
return target.stream()
|
|
return target.stream()
|