|
|
@@ -4,16 +4,16 @@ import com.fs.common.BeanCopyUtils;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.his.domain.*;
|
|
|
-import com.fs.his.dto.FsPrescribeDataDoctorQueryDto;
|
|
|
-import com.fs.his.dto.FsPrescribeDataDoctorUpdateDto;
|
|
|
-import com.fs.his.dto.FsPrescribeDataDrugDoctorQueryDto;
|
|
|
-import com.fs.his.dto.FsPrescribeDataDrugDoctorUpdateDto;
|
|
|
+import com.fs.his.dto.*;
|
|
|
+import com.fs.his.enums.DoctorTypeEnum;
|
|
|
+import com.fs.his.mapper.FsDoctorMapper;
|
|
|
import com.fs.his.mapper.FsPrescribeDataScrmDrugMapper;
|
|
|
import com.fs.his.mapper.FsPrescribeDataScrmMapper;
|
|
|
import com.fs.his.mapper.PrescribeScrmTaskRecordMapper;
|
|
|
import com.fs.his.param.PrescribeXyImgParam;
|
|
|
import com.fs.his.service.IFsPrescribeDataScrmService;
|
|
|
import com.fs.his.service.PrescriptionImageService;
|
|
|
+import com.fs.his.vo.DoctorSignVO;
|
|
|
import com.fs.his.vo.FsPrescribeDataScrmImgVO;
|
|
|
import com.fs.hisStore.domain.FsStoreProductScrm;
|
|
|
import com.fs.hisStore.mapper.FsStoreProductScrmMapper;
|
|
|
@@ -54,6 +54,10 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
|
|
|
private PrescriptionImageService prescriptionImageService;
|
|
|
@Autowired
|
|
|
private FsStoreProductScrmMapper fsStoreProductScrmMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FsDoctorMapper fsDoctorMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ApplicationContext applicationContext;
|
|
|
|
|
|
@@ -176,6 +180,59 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
|
|
|
return fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(updatePrescribe);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public DoctorSignVO getDoctorSignInfo(List<Long> doctorIds) {
|
|
|
+ // 1. 参数健壮性校验
|
|
|
+ if (CollectionUtils.isEmpty(doctorIds)) {
|
|
|
+ throw new CustomException("医生ID列表不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<FsDoctor> doctorList = fsDoctorMapper.selectDoctorByIds(doctorIds);
|
|
|
+ if (CollectionUtils.isEmpty(doctorList)) {
|
|
|
+ log.error("未查询到有效医生信息, 医生id:{}", doctorIds);
|
|
|
+ throw new CustomException("医生已停用或不存在,请联系管理员");
|
|
|
+ }
|
|
|
+
|
|
|
+ DoctorSignVO doctorSignVO = new DoctorSignVO();
|
|
|
+
|
|
|
+ doctorList.stream()
|
|
|
+ .filter(doctor -> doctor.getDoctorType() != null)
|
|
|
+ .forEach(doctor -> {
|
|
|
+ Integer type = doctor.getDoctorType();
|
|
|
+ if (DoctorTypeEnum.DOCTOR.getCode().equals(type)) {
|
|
|
+ // 医生信息赋值
|
|
|
+ doctorSignVO.setDoctorId(doctor.getDoctorId());
|
|
|
+ doctorSignVO.setDoctorName(doctor.getDoctorName());
|
|
|
+ doctorSignVO.setDoctorSignUrl(doctor.getSignUrl());
|
|
|
+ } else if (DoctorTypeEnum.PHARMACIST.getCode().equals(type)) {
|
|
|
+ // 药师信息赋值
|
|
|
+ doctorSignVO.setDrugDoctorId(doctor.getDoctorId());
|
|
|
+ doctorSignVO.setDrugDoctorName(doctor.getDoctorName());
|
|
|
+ doctorSignVO.setDrugDoctorSignUrl(doctor.getSignUrl());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return doctorSignVO;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int addDoctorAdvice(BeforePrescribeAddDoctorAdviceDTO addDoctorAdviceDTO) {
|
|
|
+ //获取处方信息
|
|
|
+ FsPrescribeDataScrm fsPrescribeDataScrm = fsPrescribeDataScrmMapper.selectFsPrescribeDataScrmByPrescribeId(addDoctorAdviceDTO.getPrescribeId());
|
|
|
+ if (fsPrescribeDataScrm == null) {
|
|
|
+ log.error("未查询到有效处方信息, 处方id:{}", addDoctorAdviceDTO.getPrescribeId());
|
|
|
+ throw new CustomException("未查询到有效处方信息");
|
|
|
+ }
|
|
|
+ //组装处方信息
|
|
|
+ fsPrescribeDataScrm.setDiagnose(addDoctorAdviceDTO.getDiagnose());
|
|
|
+ fsPrescribeDataScrm.setFacialDiagnosis(addDoctorAdviceDTO.getFacialDiagnosis());
|
|
|
+ fsPrescribeDataScrm.setNoteTaboos(addDoctorAdviceDTO.getNoteTaboos());
|
|
|
+ //TODO 处理“治疗方面”json格式
|
|
|
+ //fsPrescribeDataScrm.setHealingAreaJson(JSON.toJSONString(addDoctorAdviceDTO.getHealingArea()));
|
|
|
+ //fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(fsPrescribeDataScrm);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
// ==================== 处方图片生成 ====================
|
|
|
/**
|
|
|
* 生成处方图片(异步任务调用)
|