医生添加患者逻辑修改

master
heminjian502 2 years ago
parent 9e8a58b8ae
commit c88325d6b1

@ -205,9 +205,19 @@ public class AppController extends BaseController
logger.info("add patient param is {} ", appPatientReq); logger.info("add patient param is {} ", appPatientReq);
TPatient tPatient = new TPatient(); TPatient tPatient = new TPatient();
BeanUtils.copyProperties(appPatientReq, tPatient); BeanUtils.copyProperties(appPatientReq, tPatient);
if (UserConstants.NOT_UNIQUE.equals(tPatientService.checkPhoneUnique(tPatient.getPhone()))) // 查询患者信息
TPatient currentPatient = tPatientService.queryTPatient(tPatient);
if (Objects.nonNull(currentPatient))
{ {
return AjaxResult.error("手机号已注册"); //患者信息已存在 新增诊断记录
TRecord tRecord = new TRecord();
tRecord.setHospitalId(appPatientReq.getHospitalId());
tRecord.setPatientId(currentPatient.getId());
tRecord.setDoctorId(appPatientReq.getDoctorId());
tRecord.setStatus("0");
tRecord.setCreateBy(getUsername());
tRecordService.insertTRecord(tRecord);
return AjaxResult.success("手机号已注册");
} }
tPatientService.insertTPatient(tPatient); tPatientService.insertTPatient(tPatient);
Long identifier = 10000000L + tPatient.getId(); Long identifier = 10000000L + tPatient.getId();

@ -64,4 +64,6 @@ public interface ITPatientService
List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq); List<PcTPatientQueryByPageResp> queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq);
String checkPhoneUnique(String phone); String checkPhoneUnique(String phone);
public TPatient queryTPatient(TPatient tPatient);
} }

@ -134,4 +134,9 @@ public class TPatientServiceImpl implements ITPatientService
} }
return UserConstants.UNIQUE; return UserConstants.UNIQUE;
} }
@Override
public TPatient queryTPatient(TPatient tPatient) {
return tPatientMapper.queryTPatient(tPatient);
}
} }

Loading…
Cancel
Save