From 6c4d36e9ada6fa389d3180ef6e4fa5d95658f482 Mon Sep 17 00:00:00 2001 From: loser <12524321+loser111@user.noreply.gitee.com> Date: Thu, 11 May 2023 23:06:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=82=A3=E8=80=85=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97=E5=8D=95=E4=B8=80=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E4=B8=8D=E9=87=8D=E5=A4=8D=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/CheckManageController.java | 3 + .../web/controller/PatientManageController.java | 14 +++- .../resources/templates/check/checkManage/add.html | 26 ++++--- .../templates/patient/patientManage/add.html | 52 +++++++++----- .../templates/patient/patientManage/detail.html | 47 ++++++------ .../templates/patient/patientManage/edit.html | 83 +++++++++++++++------- .../patient/patientManage/patientManage.html | 15 ++-- .../com/ruoyi/system/domain/PatientManage.java | 3 + .../ruoyi/system/mapper/PatientManageMapper.java | 7 ++ .../system/service/IPatientManageService.java | 8 +++ .../service/impl/PatientManageServiceImpl.java | 18 +++++ .../main/resources/mapper/PatientManageMapper.xml | 9 ++- 12 files changed, 196 insertions(+), 89 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/CheckManageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/CheckManageController.java index 3c17544..a9a4cd9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/CheckManageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/CheckManageController.java @@ -1,10 +1,13 @@ package com.ruoyi.web.controller; import java.util.List; + +import com.ruoyi.common.utils.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientManageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientManageController.java index 2247d2c..633c821 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientManageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/PatientManageController.java @@ -1,10 +1,13 @@ package com.ruoyi.web.controller; import java.util.List; + +import com.ruoyi.common.utils.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -73,8 +76,13 @@ public class PatientManageController extends BaseController @Log(title = "患者管理", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(PatientManage patientManage) + public AjaxResult addSave(@Validated PatientManage patientManage) { + + if (StringUtils.isNotEmpty(patientManage.getPatientIdCard()) && !patientManageService.checkPatientIdCardUnique(patientManage)) + { + return error("新增患者'" + patientManage.getPatientName() + "'失败,身份证已存在"); + } return toAjax(patientManageService.insertPatientManage(patientManage)); } @@ -99,6 +107,10 @@ public class PatientManageController extends BaseController @ResponseBody public AjaxResult editSave(PatientManage patientManage) { + if (StringUtils.isNotEmpty(patientManage.getPatientIdCard()) && !patientManageService.checkPatientIdCardUnique(patientManage)) + { + return error("新增患者'" + patientManage.getPatientName() + "'失败,身份证已存在"); + } return toAjax(patientManageService.updatePatientManage(patientManage)); } diff --git a/ruoyi-admin/src/main/resources/templates/check/checkManage/add.html b/ruoyi-admin/src/main/resources/templates/check/checkManage/add.html index 597a6ed..e14607b 100644 --- a/ruoyi-admin/src/main/resources/templates/check/checkManage/add.html +++ b/ruoyi-admin/src/main/resources/templates/check/checkManage/add.html @@ -122,20 +122,28 @@ checkName:{ isName:true, }, - currentPosition:{ - }, - healthState:{ - }, - checkDatetime:{ - }, temperature:{ isTemperature:true }, checkPhonenumber:{ isPhone:true, + remote: { + url: prefix + "/checkPatientIdCardUnique", + type: "post", + dataType: "json", + data: { + "checkPhonenumber": function () { + return $.common.trim($("#checkPhonenumber").val()); + } + } + }, }, - description: { + messages: { + "checkPhonenumber":{ + remote: "电话号码已经存在" + } }, + }, @@ -167,8 +175,8 @@ maximumAge : 1000 } if (navigator.geolocation) { - //浏览器支持geolocation - navigator.geolocation.getcurrentPosition(onSuccess, onError, options); + //浏览器支持geolocationC + navigator.geolocation.getCurrentPosition(onSuccess, onError, options); } else { //浏览器不支持geolocation alert('您的浏览器不支持地理位置定位'); diff --git a/ruoyi-admin/src/main/resources/templates/patient/patientManage/add.html b/ruoyi-admin/src/main/resources/templates/patient/patientManage/add.html index b05d701..ebc3e78 100644 --- a/ruoyi-admin/src/main/resources/templates/patient/patientManage/add.html +++ b/ruoyi-admin/src/main/resources/templates/patient/patientManage/add.html @@ -19,7 +19,7 @@ -
+
@@ -28,7 +28,7 @@
- +
@@ -49,7 +49,7 @@
-
+
@@ -78,7 +78,7 @@
- +
@@ -87,29 +87,45 @@
- \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/patient/patientManage/detail.html b/ruoyi-admin/src/main/resources/templates/patient/patientManage/detail.html index 61f6a13..5796627 100644 --- a/ruoyi-admin/src/main/resources/templates/patient/patientManage/detail.html +++ b/ruoyi-admin/src/main/resources/templates/patient/patientManage/detail.html @@ -9,69 +9,64 @@
- +
-
- -
-
+ +
- +
- +
- -
- +
- +
- -
- +
- +
- - - - - - - - - +
+ +
+
+
+ +
+
+
+ +
+
- -
diff --git a/ruoyi-admin/src/main/resources/templates/patient/patientManage/edit.html b/ruoyi-admin/src/main/resources/templates/patient/patientManage/edit.html index 9e9f2a5..19c42f7 100644 --- a/ruoyi-admin/src/main/resources/templates/patient/patientManage/edit.html +++ b/ruoyi-admin/src/main/resources/templates/patient/patientManage/edit.html @@ -20,10 +20,22 @@
+
+ +
+ +
+
- + +
+
+
+ +
+
@@ -39,12 +51,6 @@
- -
- -
-
-
@@ -53,27 +59,27 @@
-
- -
- -
- -
- -
-
+ + + + + + + + + + + + + + + +
- +
@@ -85,7 +91,34 @@