From c88325d6b133052dc74b45b4f190a8bfdb5e8e2f Mon Sep 17 00:00:00 2001 From: heminjian502 Date: Wed, 24 Aug 2022 14:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E6=B7=BB=E5=8A=A0=E6=82=A3?= =?UTF-8?q?=E8=80=85=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/web/controller/api/AppController.java | 14 ++++++++++++-- .../com/ruoyi/system/service/ITPatientService.java | 2 ++ .../system/service/impl/TPatientServiceImpl.java | 5 +++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index c41499a..b07ad1b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -205,9 +205,19 @@ public class AppController extends BaseController logger.info("add patient param is {} ", appPatientReq); TPatient tPatient = new 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); Long identifier = 10000000L + tPatient.getId(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientService.java index 076069a..d64a7d8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITPatientService.java @@ -64,4 +64,6 @@ public interface ITPatientService List queryByPage(PcTPatintQueryByPageReq pcTPatintQueryByPageReq); String checkPhoneUnique(String phone); + + public TPatient queryTPatient(TPatient tPatient); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java index eaafadf..1f6e81c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPatientServiceImpl.java @@ -134,4 +134,9 @@ public class TPatientServiceImpl implements ITPatientService } return UserConstants.UNIQUE; } + + @Override + public TPatient queryTPatient(TPatient tPatient) { + return tPatientMapper.queryTPatient(tPatient); + } }