Browse Source

核酸检测必须有合规的身份证

hurugang 4 years ago
parent
commit
85912a9672

+ 41 - 0
src/main/java/cn/hnthyy/thmz/controller/MzPatientMiController.java

@@ -401,6 +401,47 @@ public class MzPatientMiController {
 
 
 
+    /**
+     * 验证病人身份证
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/identityCardVerification", method = {RequestMethod.GET})
+    public Map<String, Object> identityCardVerification(@RequestParam("patientId") String patientId) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (StringUtils.isBlank(patientId)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "病人ID不能为空");
+                return resultMap;
+            }
+            MzPatientMi mzPatientMi =mzPatientMiService.queryByPatientId(patientId);
+            if(mzPatientMi==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "病人不存在");
+                return resultMap;
+            }
+            //校验身份证号码格式
+            String checkResult = IDCardUtil.IdentityCardVerification(mzPatientMi.getSocialNo());
+            if (StringUtils.isNotBlank(mzPatientMi.getSocialNo()) && StringUtils.isNotBlank(checkResult)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", checkResult);
+                return resultMap;
+            }
+            resultMap.put("code", 0);
+            resultMap.put("message", "身份证校验成功");
+            return resultMap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            resultMap.put("code", -1);
+            resultMap.put("message", "系统出错,请联系管理员");
+            log.error("系统异常,错误信息{},{}", e.getMessage(),"病人ID"+patientId);
+            return resultMap;
+        }
+    }
+
+
     /**
      * 消卡
      *

+ 64 - 40
src/main/resources/static/js/registration.js

@@ -1852,38 +1852,10 @@ function nucleicAcid() {
  */
 function saveNucleicAcid() {
     $.ajax({
-        type: "POST",
-        url: '/thmz/savePrescription',
+        type: "GET",
+        url: '/thmz/identityCardVerification?patientId='+$("#patientId").val(),
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
-        data: JSON.stringify({
-            "patientId": $("#patientId").val(),
-            "inspectPart": "",
-            "reqComment": "申请核酸检测",
-            "reqTzComment": "申请核酸检测",
-            "birthDate": $("#birthDay").val(),
-            "icdCode": "",
-            "icdText": "申请核酸检测",
-            "jzFlag": "0",
-            "mzBlRecord": {
-                "firstOrNot": "1",
-                "emrChiefComplaint": "申请核酸检测",
-                "emrHpi": "无",
-                "emrPs": "无",
-                "emrPe": "申请核酸检测",
-                "emrFzjc": "申请核酸检测",
-                "emrProcess": "申请核酸检测",
-                "emrXyy": "无",
-                "emrYypg": "无",
-                "emrGnpg": "无",
-                "emrJkjy": "无"
-            },
-            "mzYjReqList": [
-                {
-                    "orderCode": "003585"
-                }
-            ]
-        }),
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
         success: function (res) {
             if (res == '401' || res == 401) {
@@ -1891,17 +1863,68 @@ function saveNucleicAcid() {
                 return;
             }
             if (res.code == 0) {
-                new PNotify({
-                    title: '操作提示',
-                    text: res.message,
-                    type: 'success',
-                    hide: true,
-                    styling: 'bootstrap3'
+                $.ajax({
+                    type: "POST",
+                    url: '/thmz/savePrescription',
+                    contentType: "application/json;charset=UTF-8",
+                    dataType: "json",
+                    data: JSON.stringify({
+                        "patientId": $("#patientId").val(),
+                        "inspectPart": "",
+                        "reqComment": "申请核酸检测",
+                        "reqTzComment": "申请核酸检测",
+                        "birthDate": $("#birthDay").val(),
+                        "icdCode": "",
+                        "icdText": "申请核酸检测",
+                        "jzFlag": "0",
+                        "mzBlRecord": {
+                            "firstOrNot": "1",
+                            "emrChiefComplaint": "申请核酸检测",
+                            "emrHpi": "无",
+                            "emrPs": "无",
+                            "emrPe": "申请核酸检测",
+                            "emrFzjc": "申请核酸检测",
+                            "emrProcess": "申请核酸检测",
+                            "emrXyy": "无",
+                            "emrYypg": "无",
+                            "emrGnpg": "无",
+                            "emrJkjy": "无"
+                        },
+                        "mzYjReqList": [
+                            {
+                                "orderCode": "003585"
+                            }
+                        ]
+                    }),
+                    headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+                    success: function (res) {
+                        if (res == '401' || res == 401) {
+                            window.location.href = '/thmz/login/view'
+                            return;
+                        }
+                        if (res.code == 0) {
+                            new PNotify({
+                                title: '操作提示',
+                                text: res.message,
+                                type: 'success',
+                                hide: true,
+                                styling: 'bootstrap3'
+                            });
+                            $("#nucleicAcidTip").html("患者【" + $("#userName").val() + "】的核酸检查申请已经创建成功,是否立即缴费?");
+                            $("#chargeFeeNucleicAcid").removeClass("hide");
+                            $("#saveNucleicAcid").addClass("hide");
+                            //$("#nucleicAcidModal").modal("hide");
+                        } else {
+                            new PNotify({
+                                title: '错误提示',
+                                text: res.message,
+                                type: 'error',
+                                hide: true,
+                                styling: 'bootstrap3'
+                            });
+                        }
+                    }
                 });
-                $("#nucleicAcidTip").html("患者【" + $("#userName").val() + "】的核酸检查申请已经创建成功,是否立即缴费?");
-                $("#chargeFeeNucleicAcid").removeClass("hide");
-                $("#saveNucleicAcid").addClass("hide");
-                //$("#nucleicAcidModal").modal("hide");
             } else {
                 new PNotify({
                     title: '错误提示',
@@ -1913,6 +1936,7 @@ function saveNucleicAcid() {
             }
         }
     });
+
 }