From f4ac2e7d9c77737886edc56a43f7921b88a00a4c Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Fri, 4 Nov 2022 14:33:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=8A=E6=96=AD=E8=AE=B0=E5=BD=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/api/MpController.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/MpController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/MpController.java index 9ae46b6..b4229f1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/MpController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/MpController.java @@ -67,6 +67,7 @@ public class MpController extends BaseController { recordHistoryService.saveHistory(recordId); tRecord.setId(recordId); + tRecord.setStatus("0"); tRecord.setUpdateResult(""); tRecord.setUpdateResult2(""); tRecordService.updateTRecord(tRecord); @@ -90,11 +91,9 @@ public class MpController extends BaseController { TRecord tRecord = new TRecord(); tRecord.setPatientId(appPatientHospitalDoctor.getPatientId()); tRecord.setHospitalId(appPatientHospitalDoctor.getHospitalId()); - tRecord.setStatus("0"); tRecord.setDoctorId(appPatientHospitalDoctor.getDoctorId()); tRecord.setAppointmentTime(DateUtils.dateTime(new Date())); - List tRecords = tRecordService.selectTRecordList(tRecord); - if (!CollectionUtils.isEmpty(tRecords)) { + if (whetherRegistration(tRecord, "0") || whetherRegistration(tRecord, "2") || whetherRegistration(tRecord, "3")) { AjaxResult ajaxResult = AjaxResult.error(); ajaxResult.put("msg", "当前患者已登记过信息!"); return ajaxResult; @@ -104,6 +103,7 @@ public class MpController extends BaseController { TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor); tRecord.setCreateBy(getUsername()); + tRecord.setStatus("0"); tRecordService.insertTRecord(tRecord); List tPHDs = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor); if (tPHDs.isEmpty()) @@ -118,4 +118,10 @@ public class MpController extends BaseController { ajaxResult.put("msg", "登记成功"); return ajaxResult; } + + private Boolean whetherRegistration(TRecord tRecord, String status) { + tRecord.setStatus(status); + List tRecords = tRecordService.selectTRecordList(tRecord); + return !CollectionUtils.isEmpty(tRecords); + } }