lihong 1 年之前
父节点
当前提交
bde6ba7240

+ 13 - 9
src/main/java/cn/hnthyy/thmz/controller/mz/ClinicController.java

@@ -21,6 +21,8 @@ import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
 import cn.hnthyy.thmz.service.his.zy.APatientMiService;
 import cn.hnthyy.thmz.service.his.zy.ZyActpatientService;
 import cn.hnthyy.thmz.service.thmz.*;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.IdcardUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -135,15 +137,17 @@ public class ClinicController {
                 return resultMap;
             }
             if(StringUtils.isNotBlank(mzPatientMi.getSocialNo())){
-                List<APatientMi> aPatientMis= aPatientMiService.queryAPatientBySocialNo(mzPatientMi.getSocialNo());
-                if(aPatientMis!=null && aPatientMis.size()>0){
-                    for (APatientMi aPatientMi:aPatientMis){
-                        if(aPatientMi!=null && StringUtils.isNotBlank(aPatientMi.getInpatientNo())){
-                            int num= zyActpatientService.queryCountByInpatientNo(aPatientMi.getInpatientNo());
-                            if(num>0){
-                                resultMap.put("code", -1);
-                                resultMap.put("message", "当前患者正在我院住院治疗,无法继续在门诊就诊!");
-                                return resultMap;
+                if(IdcardUtil.isValidCard(mzPatientMi.getSocialNo())){
+                    List<APatientMi> aPatientMis= aPatientMiService.queryAPatientBySocialNo(mzPatientMi.getSocialNo());
+                    if(aPatientMis!=null && aPatientMis.size()>0){
+                        for (APatientMi aPatientMi:aPatientMis){
+                            if(aPatientMi!=null && StringUtils.isNotBlank(aPatientMi.getInpatientNo())){
+                                int num= zyActpatientService.queryCountByInpatientNo(aPatientMi.getInpatientNo());
+                                if(num>0){
+                                    resultMap.put("code", -1);
+                                    resultMap.put("message", "当前患者正在我院住院治疗,无法继续在门诊就诊!");
+                                    return resultMap;
+                                }
                             }
                         }
                     }

+ 18 - 13
src/main/java/cn/hnthyy/thmz/service/impl/thmz/DiscountServiceImpl.java

@@ -30,6 +30,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.lang.model.element.VariableElement;
 import java.math.BigDecimal;
 import java.net.InetAddress;
 import java.net.URLEncoder;
@@ -37,6 +38,9 @@ import java.net.UnknownHostException;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static java.util.stream.Collectors.collectingAndThen;
+import static java.util.stream.Collectors.toCollection;
+
 @Slf4j
 @Service
 public class DiscountServiceImpl implements DiscountService {
@@ -311,26 +315,27 @@ public class DiscountServiceImpl implements DiscountService {
         List<Map<String, Object>> list = new ArrayList<>();
         List<Discount> discounts = discountMapper.queryTcDiscunt();
         if (CollUtil.isEmpty(discounts)) return list;
+        if(discounts.stream().anyMatch(item->item.getDeptType() == 2)){
+            Map<String, Object> map = new HashMap<>(1);
+            map.put("deptName", "全院");
+            map.put("deptType", 2);
+            map.put("deptNo", "");
+            list.add(map);
+        }
         discounts.forEach(item->{
-            if (StrUtil.isNotBlank(item.getDeptNo())) {
+            if (StrUtil.isNotBlank(item.getDeptNo()) && item.getDeptType() != 2) {
                 String[] split = item.getDeptNo().split(",");
                 for(String str :split){
-                    Map<String, Object> map = new HashMap<>(5);
-                    map.put("deptType", 1);
-                    map.put("deptNo", item.getDeptNo());
+                    Map<String, Object> temp = new HashMap<>(5);
+                    temp.put("deptType", 1);
+                    temp.put("deptNo", item.getDeptNo());
                     String deptName= zdUnitCodeService.queryDeptNameByIdInCache(str);
-                    map.put("deptName", deptName);
-                    list.add(map);
+                    temp.put("deptName", deptName);
+                    list.add(temp);
                 }
-            }else {
-                Map<String, Object> map = new HashMap<>(1);
-                map.put("deptName", "全院");
-                map.put("deptType", 2);
-                map.put("deptNo", "");
-                list.add(map);
             }
         });
-        return list;
+        return list.stream().distinct().collect(Collectors.toList());
     }
 
 

+ 72 - 28
src/main/resources/static/js/jBox/common.js

@@ -12,36 +12,77 @@ $().ready(function(){
 //身份证
 //includeScript("baseISSObject.js", function(){
 //includeScript("baseISSOnline.js", function(){
-var setting = {
-    Cert: {
-        callBack: function (result) {
-            setCertificateData(result);
-        },
-        select: "#button_readID"
-    },
-    Methods: {
-        showMessage: function (type, message) {
-            $("#cert_message").text(message);
-            $("#cert_message_type").text(msgType[type]);
-        },
-        downloadDrive: function () {
-            $.jBox.closeTip();
-            messageBox({
-                messageType: "confirm", text: "请安装相关硬件驱动!点击确定下载驱动。",
-                callback: function (result) {
-                    if (result) {
-                        window.location.href = "middleware/ZKIDROnline.exe";
-                    }
-                    closeMessage();
+// var setting = {
+//     Cert: {
+//         callBack: function (result) {
+//             setCertificateData(result);
+//         },
+//         select: "#button_readID"
+//     },
+//     Methods: {
+//         showMessage: function (type, message) {
+//             $("#cert_message").text(message);
+//             $("#cert_message_type").text(msgType[type]);
+//         },
+//         downloadDrive: function () {
+//             $.jBox.closeTip();
+//             messageBox({
+//                 messageType: "confirm", text: "请安装相关硬件驱动!点击确定下载驱动。",
+//                 callback: function (result) {
+//                     if (result) {
+//                         window.location.href = "middleware/ZKIDROnline.exe";
+//                     }
+//                     closeMessage();
+//                 }
+//             });
+//         }
+//     }
+// }
+// try {
+//     createISSonlineDevice(setting);
+// } catch (e) {
+//     console.info("不要用读取身份证");
+// }
+/**
+ * 身份证读卡
+ * @param params
+ */
+function siReadIdCard(params) {
+    $.ajax({
+        type: "GET",
+        url: 'http://localhost:8321/readcard/entry?param='+params,
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        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 == 200) {
+                var str =  res.data.split("^")
+                var str1=  str.filter(item=>item !='')
+                var Certificate = {
+                    Birthday:str1[4],
+                    IDNumber:str1[0],
+                    Name:str1[1],
+                    Address:str1[5],
+                    Base64Photo:str1[8],
+                    Nation:str1[3],
+                    IDIssued:str1[6],
+                    IssuedData:str1[7].substring(0,8),
+                    ValidDate:str1[7].substring(8),
+                    Sex:str1[2]
                 }
-            });
+                var resultData = {Certificate:Certificate}
+                console.log('resultData',resultData);
+                setCertificateData(resultData)
+            } else {
+                errorMesage(res);
+            }
         }
-    }
-}
-try {
-    createISSonlineDevice(setting);
-} catch (e) {
-    console.info("不要用读取身份证");
+    });
+    // window.open('ReadCard://'+prm, '_self')
 }
 
 
@@ -76,8 +117,11 @@ function setCertificateData(result) {
         $("#imageIdCard").val(result.Certificate.Base64Photo);
         setNation(result.Certificate.Nation);
         $("#nationToUpload").val(result.Certificate.Nation);
+        //机关单位
         $("#idIssued").val(result.Certificate.IDIssued);
+        //有效期 开始时间
         $("#issuedData").val(result.Certificate.IssuedData);
+        //有效期结束时间
         $("#validDate").val(result.Certificate.ValidDate);
 
     } catch (e) {

+ 2 - 2
src/main/resources/static/js/mz/clinic.js

@@ -1720,8 +1720,8 @@ function queryParamsClinic(params) {
     var commonParams = $("#userName").val();
     var needDateParams = commonParams == null || commonParams == "null" || commonParams == "";
     var temp = {
-        beginDate:  rePortRangeArr[0] ,
-        endDate:  rePortRangeArr[1],
+        beginDate:  needDateParams ? rePortRangeArr[0] : "2012-02-01 00:00:00" ,
+        endDate:  needDateParams ? rePortRangeArr[1]: format(new Date(),"yyyy-MM-dd HH:mm:ss"),
         commonParams: commonParams,
         clinicStatuses: [5, 6, 7],
         pageSize: params.limit,

+ 16 - 9
src/main/resources/static/js/mz/registration.js

@@ -168,6 +168,13 @@ $(function () {
     });
 
 
+    /**
+     * 身份证读卡
+     */
+    $("#siReadIdCard").on("click", function (t) {
+        siReadIdCard("idcard_01101");
+    });
+
     /**
      * 清空
      */
@@ -229,7 +236,7 @@ $(function () {
 
 
     //每隔三秒读一次身份证
-    readIcCard();
+    // readIcCard();
     // setInterval(function () {
     //     new Device().startFun();
     // }, 3000);
@@ -326,14 +333,14 @@ $(function () {
 /**
  * 刷新列表,解决越来越快的问题
  */
-function readIcCard() {
-    //clearInterval要放在方法开始,不然的话,下面的代码还没运行到clearInterval,又开始了循环了。
-    clearInterval(readIcCardTimerForRegistration);
-    new Device().startFun();
-    readIcCardTimerForRegistration = setInterval(() => {
-        readIcCard()
-    }, 3000);
-}
+// function readIcCard() {
+//     //clearInterval要放在方法开始,不然的话,下面的代码还没运行到clearInterval,又开始了循环了。
+//     clearInterval(readIcCardTimerForRegistration);
+//     new Device().startFun();
+//     readIcCardTimerForRegistration = setInterval(() => {
+//         readIcCard()
+//     }, 3000);
+// }
 
 // function CreatePageList() {
 //     LODOP = getLodop();

+ 13 - 3
src/main/resources/static/js/zy/hospitalized.js

@@ -47,6 +47,13 @@ $(function () {
         siReadCard("face_01101");
     });
 
+    /**
+     * 身份证读卡
+     */
+    $("#siReadIdCard").on("click", function (t) {
+        siReadIdCard("idcard_01101");
+    });
+
     /**
      * 清空
      */
@@ -148,9 +155,9 @@ $(function () {
     initProvince(4);
 
     //每隔三秒读一次身份证
-    setInterval(function () {
-        new Device().startFun();
-    }, 5000);
+    // setInterval(function () {
+    //     new Device().startFun();
+    // }, 5000);
 
 
     $("#birthDay").change(function (e) {
@@ -1452,6 +1459,9 @@ function siReadCard(params) {
 }
 
 
+
+
+
 /**
  * 复制地址
  */

+ 1 - 0
src/main/resources/templates/mz/registration.html

@@ -62,6 +62,7 @@
                         <!--<a id="editWindows"><i class="fa fa-gears">&nbsp;窗口号设cardNo置</i></a>-->
                         <a id="btn_tools"><i
                                 class="fa fa-suitcase">&nbsp;智能POS工具包</i></a>
+                        <a id="siReadIdCard"><i class="fa fa-hand-o-right">&nbsp;身份证读卡</i></a>
                         <a id="nucleicAcid" hidden onclick="nucleicAcid()"><i
                                 class="fa fa-eyedropper">&nbsp;核酸检测(单人)</i></a>
                         <a id="hybridTest" hidden onclick="hybridTest()"><i class="fa fa-eyedropper">&nbsp;核酸检测(混检)</i></a>

+ 1 - 0
src/main/resources/templates/zy/hospitalized.html

@@ -57,6 +57,7 @@
                 </div>
                 <div class="col-md-9 col-sm-9 col-xs-12">
                     <div class="clearRegistrationDiv">
+                        <a id="siReadIdCard"><i class="fa fa-hand-o-right">&nbsp;身份证读卡</i></a>
                         <a id="siReadCard"><i class="fa fa-barcode">&nbsp;医保电子凭证</i></a>
                         <a id="siReadCardFace"><i class="fa fa-github-alt">&nbsp;医保刷脸</i></a>
                         <a id="uploadIdCard"><i class="fa fa-arrow-up">&nbsp;上传身份证</i></a>