提交 9e303581 authored 作者: 杨凯's avatar 杨凯

feat:家庭医生初始化

上级 8685e547
...@@ -37,6 +37,7 @@ import java.util.Date; ...@@ -37,6 +37,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Random; import java.util.Random;
import java.util.stream.Collectors;
/** /**
* @ClassName: PatientServiceImpl * @ClassName: PatientServiceImpl
...@@ -97,6 +98,17 @@ public class PatientServiceImpl implements PatientService { ...@@ -97,6 +98,17 @@ public class PatientServiceImpl implements PatientService {
String doctorName = reqVo.getDoctorName(); String doctorName = reqVo.getDoctorName();
Long deptId = reqVo.getDeptId(); Long deptId = reqVo.getDeptId();
String deptName = reqVo.getDeptName(); String deptName = reqVo.getDeptName();
PatientSignEntity oldPatientSignEntity = new PatientSignEntity();
// 改签或者排班医生获取签约的id
if (!SignStatus.SIGNED.getValue().equals(reqVo.getSignStatus())) {
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
PatientSignEntity patientSign = new PatientSignEntity();
patientSign.setAdmId(reqVo.getAdmId());
psWrapper.setEntity(patientSign);
oldPatientSignEntity = patientSignMapper.selectOne(psWrapper);
}
if (!SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) { if (!SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
List<PatientSignEntity> patientSignEntities = getPatientSignList(reqVo.getPhone(), reqVo.getPackageOrderId(), List<PatientSignEntity> patientSignEntities = getPatientSignList(reqVo.getPhone(), reqVo.getPackageOrderId(),
reqVo.getSignStatus(), StatusEnum.IN_CONSULTATION.getValue()); reqVo.getSignStatus(), StatusEnum.IN_CONSULTATION.getValue());
...@@ -120,21 +132,13 @@ public class PatientServiceImpl implements PatientService { ...@@ -120,21 +132,13 @@ public class PatientServiceImpl implements PatientService {
} }
// 查询排班医生信息 // 查询排班医生信息
ScheduleRecordEntity scheduleRecordEntity = getScheduleDoctor(reqVo.getPatientId()); ScheduleRecordEntity scheduleRecordEntity = getScheduleDoctor(reqVo.getPatientId(), oldPatientSignEntity.getDoctorId());
doctorId = Long.valueOf(scheduleRecordEntity.getDoctorId()); doctorId = Long.valueOf(scheduleRecordEntity.getDoctorId());
doctorName = scheduleRecordEntity.getDoctorName(); doctorName = scheduleRecordEntity.getDoctorName();
deptId = Long.valueOf(scheduleRecordEntity.getDeptId()); deptId = Long.valueOf(scheduleRecordEntity.getDeptId());
deptName = scheduleRecordEntity.getDeptName(); deptName = scheduleRecordEntity.getDeptName();
} }
PatientSignEntity oldPatientSignEntity = new PatientSignEntity();
// 改签或者排班医生获取签约的id
if (!SignStatus.SIGNED.getValue().equals(reqVo.getSignStatus())) {
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
PatientSignEntity patientSign = new PatientSignEntity();
patientSign.setAdmId(reqVo.getAdmId());
psWrapper.setEntity(patientSign);
oldPatientSignEntity = patientSignMapper.selectOne(psWrapper);
}
// 处理换绑医生 // 处理换绑医生
if ((!StringUtils.isEmpty(reqVo.getAdmId()) || !StringUtils.isEmpty(reqVo.getSignSeqId())) if ((!StringUtils.isEmpty(reqVo.getAdmId()) || !StringUtils.isEmpty(reqVo.getSignSeqId()))
...@@ -284,7 +288,7 @@ public class PatientServiceImpl implements PatientService { ...@@ -284,7 +288,7 @@ public class PatientServiceImpl implements PatientService {
* @param patientId * @param patientId
* @return * @return
*/ */
public ScheduleRecordEntity getScheduleDoctor(String patientId) { public ScheduleRecordEntity getScheduleDoctor(String patientId, Long doctorId) {
String date = DateUtils.dateToSimpleString(new Date()); String date = DateUtils.dateToSimpleString(new Date());
String hourAndSecond = DateUtils.getHourAndSecond(); String hourAndSecond = DateUtils.getHourAndSecond();
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>(); QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
...@@ -305,6 +309,8 @@ public class PatientServiceImpl implements PatientService { ...@@ -305,6 +309,8 @@ public class PatientServiceImpl implements PatientService {
throw new BusinessException("暂无排班医生,请稍后重试"); throw new BusinessException("暂无排班医生,请稍后重试");
} }
scheduleRecordEntities.stream().filter(scheduleRecordEntity -> !scheduleRecordEntity.getDoctorId().equals(doctorId)).collect(Collectors.toList());
ScheduleRecordEntity scheduleRecordEntity = new ScheduleRecordEntity(); ScheduleRecordEntity scheduleRecordEntity = new ScheduleRecordEntity();
Random random = new Random(); Random random = new Random();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论