lihong 2 年 前
コミット
cf1e6cbabb

+ 5 - 1
pom.xml

@@ -29,7 +29,11 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.10</version>
+        </dependency>
 
         <!--<dependency>-->
         <!--<groupId>org.springframework.cloud</groupId>-->

+ 5 - 0
src/main/java/cn/hnthyy/thmz/common/Constants.java

@@ -30,6 +30,11 @@ public class Constants {
      * token最大有效时间 小时数
      */
     public static final int JWT_TTL = 24;
+
+    /**
+     * 密码正则表达式 密码应该包含字母、数字和特殊符号,且长度在8位以上
+     */
+    public static final String PASSWORD_REGEX = "^(?![^a-zA-Z]+$)(?!\\D+$)(?![a-zA-Z0-9]+$).{8,}$";
     /**
      * 挂号时段的上午编码
      */

+ 16 - 2
src/main/java/cn/hnthyy/thmz/controller/mz/MzyReqrecController.java

@@ -865,14 +865,28 @@ public class MzyReqrecController {
                 count = mzyReqrecService.queryValidMzyReqrec(patientId, null, deptCode, beforeDate);
             } else {
                 beforeDate = DateUtil.getDateFromNow(-1);
-                count = mzyReqrecService.queryValidMzyReqrec(patientId, null, deptCode, beforeDate);
+                if(Constants.JY_EXEC_CODE.equals(deptCode)){
+                    count = mzyReqrecService.queryValidMzyReqrec(patientId, tokenUser.getUserIdCode(), null, beforeDate);
+                }else {
+                    count = mzyReqrecService.queryValidMzyReqrec(patientId, null, deptCode, beforeDate);
+                }
             }
             if (count == null) {
                 count = 0;
             }
+            String message = "";
+            if(count > 0){
+                message ="判断当前病人的挂号信息是否有效成功";
+            }else {
+                if(Constants.JY_EXEC_CODE.equals(deptCode)){
+                    message = "当前病人简易门诊挂的医生不为您,不能接诊!";
+                }else {
+                    message = "挂号失效,请重新挂号";
+                }
+            }
             resultMap.put("code", 0);
             resultMap.put("data", count);
-            resultMap.put("message", "判断当前病人的挂号信息是否有效成功");
+            resultMap.put("message", message);
             return resultMap;
         } catch (Exception e) {
             e.printStackTrace();

+ 4 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzfzPatientOrderMapper.java

@@ -186,16 +186,18 @@ public interface MzfzPatientOrderMapper {
      * @return
      */
     @Select({"<script>",
-            "select * from mzfz_patient_order WITH(NOLOCK) where patient_id = #{patientId} and ((status_flag in (0,1,2,3,8) and (doctor_code=#{userIdCode} or req_type in('10', '16')  ",
-            //"select * from mzfz_patient_order WITH(NOLOCK) where patient_id = #{patientId} and ((status_flag in (0,1,2,3,8) and (doctor_code=#{userIdCode} or req_type ='16' ",
+            //"select * from mzfz_patient_order WITH(NOLOCK) where patient_id = #{patientId} and ((status_flag in (0,1,2,3,8) and (doctor_code=#{userIdCode} or req_type in('10', '16')  ",
+            "select * from mzfz_patient_order WITH(NOLOCK) where patient_id = #{patientId} and ((status_flag in (0,1,2,3,8) and (doctor_code=#{userIdCode} or req_type ='16' ",
             " or (dept_code in ",
             "<foreach item='item' index='index' collection='deptNos' open='(' separator=',' close=')'>",
             "#{item}",
             "</foreach>",
+            "<when test='jzReqTypes!=null and jzReqTypes.size > 0'>",
             " and req_type IN ",
             "<foreach item='item' index='index' collection='jzReqTypes' open='(' separator=',' close=')'>",
             "#{item}",
             "</foreach>",
+            "</when>",
             " ))) or (status_flag =9 and DateDiff(hh,visit_date,getDate()) &lt;=24 and dept_code in ",
             "<foreach item='item' index='index' collection='deptNos' open='(' separator=',' close=')'>",
             "#{item}",

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzyReqrecMapper.java

@@ -180,7 +180,7 @@ public interface MzyReqrecMapper {
     @Select({"<script>",
             "select count(1) from mzy_reqrec WITH(NOLOCK) where patient_id=#{patientId} and isnull(visit_date,request_day)>#{befoDate} ",
             "<when test='doctorCode!=null'>",
-            " and visit_doctor =#{doctorCode} ",
+            " and doctor_code =#{doctorCode} ",
             "</when>",
             "<when test='deptCode!=null'>",
             " and (visit_dept = #{deptCode} or unit_code = #{deptCode})",

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/thmz/ClinicMapper.java

@@ -84,7 +84,7 @@ public interface ClinicMapper {
             "<foreach item='item' index='index' collection='deptCodes' open='(' separator=',' close=')'>" +
             "#{item}" +
             "</foreach>" +
-            " and jz_flag=1) or doctor_code = #{doctorCode})" +
+            " ) or doctor_code = #{doctorCode})" +
             "</when>" +
             "<otherwise>" +
             "<when test='doctorCode!=null'>" +
@@ -159,7 +159,7 @@ public interface ClinicMapper {
             "<foreach item='item' index='index' collection='deptCodes' open='(' separator=',' close=')'>" +
             "#{item}" +
             "</foreach>" +
-            " and jz_flag=1) or doctor_code = #{doctorCode})" +
+            " ) or doctor_code = #{doctorCode})" +
             "</when>" +
             "<otherwise>" +
             "<when test='doctorCode!=null'>" +

+ 8 - 7
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzfzPatientOrderServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hnthyy.thmz.mapper.his.mz.MzyZdChargeTypeMapper;
 import cn.hnthyy.thmz.mapper.thmz.UserDeptRelationMapper;
 import cn.hnthyy.thmz.service.his.mz.MzfzPatientOrderService;
 import cn.hnthyy.thmz.service.thmz.UserDeptRelationService;
+import org.apache.regexp.RE;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -49,15 +50,15 @@ public class MzfzPatientOrderServiceImpl implements MzfzPatientOrderService {
     public List<MzfzPatientOrder> queryByPatientId(String patientId,String userIdCode) {
         List<String> deptNos= userDeptRelationMapper.selectAllByUserIdCode(userIdCode);
         if(deptNos==null){
-            deptNos=new ArrayList<>();
+            return new ArrayList<>();
         }
-        deptNos.add(Constants.JY_EXEC_CODE);
+        //deptNos.add(Constants.JY_EXEC_CODE);
         List<String> reqTypes=mzyZdChargeTypeMapper.selectCodesByReqType(Constants.JZ_CODE);
-        if(reqTypes==null){
-            reqTypes=Arrays.asList(Constants.SIMPLE_OUTPATIENT_CODE);
-        }else {
-            reqTypes.add(Constants.SIMPLE_OUTPATIENT_CODE);
-        }
+        //if(reqTypes==null){
+        //    reqTypes=Arrays.asList(Constants.SIMPLE_OUTPATIENT_CODE);
+        //}else {
+        //    reqTypes.add(Constants.SIMPLE_OUTPATIENT_CODE);
+        //}
         return mzfzPatientOrderMapper.selectByPatientId(patientId, deptNos,userIdCode,reqTypes);
     }
 

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

@@ -9794,7 +9794,7 @@ function repeatAccepts(patientId, times, clnicId, deptCode) {
                     //     repeatAcceptsConfirm(patientId, times, clnicId);
                     // });
                     // $("#cancelButton").off("click");
-                    warningMesageSimaple("挂号失效,请重新挂号");
+                    warningMesageSimaple(res.message);
                     return;
                 }
                 repeatAcceptsConfirm(patientId, times, clnicId);