|
|
@@ -179,25 +179,36 @@ public class FsPatientBaseInfoServiceImpl extends ServiceImpl<FsPatientBaseInfoM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R getPatientBaseInfoDetail(Long patientId) {
|
|
|
- PatientBaseInfoVO patientBaseInfoVO = new PatientBaseInfoVO();
|
|
|
-
|
|
|
- //患者信息
|
|
|
+ public R getPatientBaseInfoDetail(Long patientId,Long userId) {
|
|
|
+ //扫码的患者信息
|
|
|
FsPatientBaseInfo info = fsPatientBaseInfoMapper.selectFsPatientBaseInfoById(patientId);
|
|
|
if (info == null) {
|
|
|
return R.error("患者信息错误");
|
|
|
}
|
|
|
- BeanUtils.copyProperties(info, patientBaseInfoVO);
|
|
|
+ FsDoctor doctor = null;
|
|
|
+ Long projectId = info.getProjectId();
|
|
|
+
|
|
|
+ PatientBaseInfoVO patientBaseInfoVO = new PatientBaseInfoVO();
|
|
|
+
|
|
|
|
|
|
- //医生信息
|
|
|
- FsDoctor doctor = doctorService.selectFsDoctorByDoctorId(info.getDoctorId());
|
|
|
+ //自己的患者信息
|
|
|
+ FsPatientBaseInfo selectedByUserId = fsPatientBaseInfoMapper.selectByUserId(userId);
|
|
|
+
|
|
|
+ if (selectedByUserId != null) {
|
|
|
+ BeanUtils.copyProperties(selectedByUserId, patientBaseInfoVO);
|
|
|
+ //医生信息
|
|
|
+ doctor = doctorService.selectFsDoctorByDoctorId(selectedByUserId.getDoctorId());
|
|
|
+ } else {
|
|
|
+ BeanUtils.copyProperties(info, patientBaseInfoVO);
|
|
|
+ //医生信息
|
|
|
+ doctor = doctorService.selectFsDoctorByDoctorId(info.getDoctorId());
|
|
|
+ }
|
|
|
if (doctor != null) {
|
|
|
patientBaseInfoVO.setDoctorName(doctor.getDoctorName());
|
|
|
patientBaseInfoVO.setDoctorNo(doctor.getCertificateCode());
|
|
|
}
|
|
|
-
|
|
|
- //理疗项目信息
|
|
|
- FsProject fsProject = projectService.selectFsProjectById(info.getProjectId());
|
|
|
+ //理疗项目信息 始终取分享的理疗数据
|
|
|
+ FsProject fsProject = projectService.selectFsProjectById(projectId);
|
|
|
if (fsProject != null) {
|
|
|
patientBaseInfoVO.setProject(fsProject);
|
|
|
}
|