提交 7f6c3036 authored 作者: 杨凯's avatar 杨凯

feat:家庭医生初始化

上级 f715f52a
......@@ -105,34 +105,42 @@ public class PatientServiceImpl implements PatientService {
PatientSignEntity oldPatientSignEntity = new PatientSignEntity();
// 改签或者排班医生获取签约的id
Date signCreateTime = null;
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);
signCreateTime = oldPatientSignEntity.getCreateTime();
// 改签查询原始签约信息
if (SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus())) {
QueryWrapper<PatientSignEntity> cpsWrapper = new QueryWrapper<>();
PatientSignEntity cPatientSign = new PatientSignEntity();
cPatientSign.setId(oldPatientSignEntity.getSignId());
cpsWrapper.setEntity(cPatientSign);
oldPatientSignEntity = patientSignMapper.selectOne(cpsWrapper);
}
}
if (!SignStatus.NORMAL.getValue().equals(reqVo.getSignStatus())) {
Integer signStatus = SignStatus.SIGNED.getValue();
Integer status = StatusEnum.IN_CONSULTATION.getValue();
if (SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus())) {
signStatus = SignStatus.CANCEL.getValue();
status = StatusEnum.FINISH_APPLY.getValue();
}
// if (SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus())) {
// signStatus = SignStatus.CANCEL.getValue();
// status = StatusEnum.FINISH_APPLY.getValue();
// }
List<PatientSignEntity> patientSignEntities = getPatientSignList(reqVo.getPhone(), reqVo.getPackageOrderId(),
signStatus, status);
if (!patientSignEntities.isEmpty()) {
if (!SignStatus.CANCEL.getValue().equals(reqVo.getSignStatus())) {
if (SignStatus.SIGNED.getValue().equals(reqVo.getSignStatus())) {
return BaseResponse.error("已经有进行中的签约或者改签医生,不能再进行签约或者改签!!!");
}
PatientSignEntity patientSignEntity = patientSignEntities.get(0);
Date signCreateTime = oldPatientSignEntity.getCreateTime();
log.info("signCreateTime={}, signStartTime={}, signEndTime={}", signCreateTime, signStartTime, signEndTime);
if (signCreateTime.after(signStartTime) && signCreateTime.before(signEndTime)) {
return BaseResponse.error("已经有进行中的签约或者改签医生,不能再进行签约或者改签!!!");
}
oldPatientSignEntity = patientSignEntity;
// oldPatientSignEntity = patientSignEntity;
}
} else {
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论