Browse Source

开发消卡功能

hurugang 6 years ago
parent
commit
645cff8125

+ 8 - 0
src/main/java/cn/hnthyy/thmz/controller/ChargeFeeVoController.java

@@ -4,6 +4,7 @@ import cn.hnthyy.thmz.Utils.DateUtil;
 import cn.hnthyy.thmz.Utils.JsonUtil;
 import cn.hnthyy.thmz.Utils.TokenUtil;
 import cn.hnthyy.thmz.comment.UserLoginToken;
+import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.Employee;
 import cn.hnthyy.thmz.entity.his.MzReceiptSerial;
@@ -90,6 +91,13 @@ public class ChargeFeeVoController {
             for (ChargeFeeVo co : chargeFeeVos) {
                 PayMarkEnum payMark = PayMarkEnum.getPayMarkByCode(co.getPayMark());
                 co.setPayMark(payMark == null ? co.getPayMark() : payMark.name);
+                if(Constants.BRZZJF_CODE.equalsIgnoreCase(co.getOpId())){
+                    if(Constants.WX.equalsIgnoreCase(co.getChequeType())){
+                        co.setChequeType(Constants.ZZWX);
+                    }else if(Constants.ZFB.equalsIgnoreCase(co.getChequeType())){
+                        co.setChequeType(Constants.ZZZFB);
+                    }
+                }
                 co.setChequeType(chequeTypeMap.get(co.getChequeType()));
                 if (YesNoEnum.YES.equals(fitEmpName)) {
                     co.setOpId(employeeMap.get(co.getOpId()));

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

@@ -245,6 +245,11 @@ public class MzPatientMiController {
             resultMap.put("message", "病人id不能为空");
             return true;
         }
+        if (StringUtils.isBlank(mzPatientMi.getIcCardNo())) {
+            resultMap.put("code", -1);
+            resultMap.put("message", "病人卡号不能为空");
+            return true;
+        }
         if (StringUtils.isBlank(mzPatientMi.getName())) {
             resultMap.put("code", -1);
             resultMap.put("message", "病人姓名不能为空");
@@ -265,11 +270,6 @@ public class MzPatientMiController {
             resultMap.put("message", "病人出生日期不能为空");
             return true;
         }
-        if (StringUtils.isBlank(mzPatientMi.getIcCardNo())) {
-            resultMap.put("code", -1);
-            resultMap.put("message", "病人卡号不能为空");
-            return true;
-        }
         if (StringUtils.isBlank(mzPatientMi.getPhoneNo())) {
             resultMap.put("code", -1);
             resultMap.put("message", "病人手机号码不能为空");

+ 35 - 0
src/main/java/cn/hnthyy/thmz/controller/MzyReqrecController.java

@@ -621,4 +621,39 @@ public class MzyReqrecController {
         }
     }
 
+
+
+
+    /**
+     * 消卡
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/clearIcCardNo", method = {RequestMethod.GET})
+    public Map<String, Object> clearIcCardNo(@RequestParam String patientId) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if(StringUtils.isBlank(patientId)){
+                resultMap.put("code", -1);
+                resultMap.put("message", "销卡的病人id不能为空");
+                return resultMap;
+            }
+            int num=mzPatientMiService.clearIcCardNo(patientId);
+            if(num==1){
+                resultMap.put("code", 0);
+                resultMap.put("message", "销卡成功");
+                return resultMap;
+            }
+            resultMap.put("code", -1);
+            resultMap.put("message", "销卡失败");
+            return resultMap;
+        }catch (Exception e){
+            e.printStackTrace();
+            resultMap.put("code", -1);
+            resultMap.put("message", "销卡失败,系统出错,请联系管理员");
+            log.error("销卡失败,系统异常,错误信息{}",e.getMessage());
+            return resultMap;
+        }
+    }
+
 }

+ 6 - 6
src/main/java/cn/hnthyy/thmz/mapper/his/ChargeFeeVoMapper.java

@@ -25,7 +25,7 @@ public interface ChargeFeeVoMapper {
             "         pay_id=max(pay_id)," +
             "         charge_date=max(mz_receipt_serial.charge_date)," +
             "         receipt_sn=mz_receipt_serial.receipt_sn ," +
-            "         b.cheque_type " +
+            "         b.cheque_type,b.op_id  " +
             "  FROM   mz_receipt_serial,mz_deposit_file b " +
             "  where  mz_receipt_serial.operator_id=#{userIdCode} and " +
             "         mz_receipt_serial.dcount_no=0 and " +
@@ -34,7 +34,7 @@ public interface ChargeFeeVoMapper {
             "         mz_receipt_serial.receipt_no*=b.receipt_no and " +
             "         mz_receipt_serial.receipt_sn*=b.receipt_sn and " +
             "         (b.cheque_type <> 'Z' or  b.cheque_type <> 'Y') " +
-            "group by mz_receipt_serial.receipt_sn,mz_receipt_serial.receipt_bill,b.cheque_type,mz_receipt_serial.pay_mark " +
+            "group by mz_receipt_serial.receipt_sn,mz_receipt_serial.receipt_bill,b.cheque_type,mz_receipt_serial.pay_mark,b.op_id  " +
             "order by abs(mz_receipt_serial.receipt_sn),mz_receipt_serial.receipt_bill")
     List<ChargeFeeVo> selectChargeFeeVoUnAccount(@Param("userIdCode") String userIdCode);
 
@@ -88,7 +88,7 @@ public interface ChargeFeeVoMapper {
             "         charge_date=max(mz_receipt_serial_b.charge_date), " +
             "         receipt_sn=mz_receipt_serial_b.receipt_sn , " +
             "         b.cheque_type, " +
-            "         op_id " +
+            "         b.op_id " +
             "  FROM   mz_receipt_serial_b,mz_deposit_file b " +
             "  where" +
             "         mz_receipt_serial_b.dcount_no=1 and " +
@@ -119,7 +119,7 @@ public interface ChargeFeeVoMapper {
             "         pay_id=max(pay_id), " +
             "         charge_date=max(mz_receipt_serial.charge_date), " +
             "         receipt_sn=mz_receipt_serial.receipt_sn , " +
-            "         b.cheque_type " +
+            "         b.cheque_type,b.op_id " +
             "  FROM   mz_receipt_serial,mz_deposit_file b " +
             "  where " +
             "         mz_receipt_serial.dcount_no=1 and " +
@@ -130,7 +130,7 @@ public interface ChargeFeeVoMapper {
             "         mz_receipt_serial.receipt_no*=b.receipt_no and "  +
             "         mz_receipt_serial.receipt_sn*=b.receipt_sn and " +
             "         b.cheque_type  <> 'Z' " +
-            "group by mz_receipt_serial.receipt_sn,mz_receipt_serial.receipt_bill,b.cheque_type,mz_receipt_serial.pay_mark " +
+            "group by mz_receipt_serial.receipt_sn,mz_receipt_serial.receipt_bill,b.cheque_type,mz_receipt_serial.pay_mark,b.op_id " +
             "order by abs(mz_receipt_serial.receipt_sn),mz_receipt_serial.receipt_bill")
     List<ChargeFeeVo> selectChargeFeeVoReprint(@Param("userIdCode") String userIdCode, @Param("caseType") String caseType, @Param("dcountDate") Date dcountDate);
 
@@ -448,7 +448,7 @@ public interface ChargeFeeVoMapper {
                     "isnull ( sum ( total_charge ) , 0 ) total_charge," +
                     "isnull (sum ( case mz_receipt_serial.pay_mark when '0' then 1 when '2' then 1 else 0 end ) ,0)total_count " +
                     "FROM mz_receipt_serial " +
-                    " where 1=1 and pay_mark <![CDATA[<>]]> 2 " +
+                    " where 1=1 and pay_mark <![CDATA[<>]]> 2 and cheque_type not in ('W','Z') " +
                     "<when test='userIdCode!=null'>",
             " and operator_id=#{userIdCode} ",
             "</when>",

+ 11 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/MzPatientMiMapper.java

@@ -114,6 +114,14 @@ public interface MzPatientMiMapper {
             ,"</script>"})
     int updateMzPatientMi(MzPatientMi mzPatientMi);
 
+    /**
+     * 销卡
+     * @param patientId
+     * @return
+     */
+    @Update("update mz_patient_mi set ic_card_no ='' where patient_id =#{patientId} ")
+    int clearIcCardNo(@Param("patientId") String patientId);
+
     /**
      * 按照身份证号码查询病人信息,如果病人id参数不为空,则是查询是否存在除当前编号以外的相同身份证号码
      * @param socialNo 身份证号码
@@ -155,4 +163,7 @@ public interface MzPatientMiMapper {
             "rtrim(baddebt_mark) baddebt_mark,rtrim(response_type) response_type,rtrim(charge_type) charge_type,times,rtrim(reqdel_mark) reqdel_mark,age,birth_day," +
             "rtrim(ic_card_no) ic_card_no,rtrim(phone_no) phone_no,rtrim(adress) address,rtrim(yb_card_no) yb_card_no,first_date,rtrim(rel_name) rel_name,rtrim(contract_name) contract_name from mz_patient_mi  where  phone_no =#{phoneNo}")
     List<MzPatientMi> selectByPhoneNo(@Param("phoneNo") String phoneNo);
+
+
+
 }

+ 8 - 0
src/main/java/cn/hnthyy/thmz/service/his/MzPatientMiService.java

@@ -63,4 +63,12 @@ public interface MzPatientMiService {
      * @return
      */
     List<MzPatientMi> queryByPhoneNo(String phoneNo);
+
+
+    /**
+     * 销卡
+     * @param patientId
+     * @return
+     */
+    int clearIcCardNo(String patientId);
 }

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/MzPatientMiServiceImpl.java

@@ -68,5 +68,10 @@ public class MzPatientMiServiceImpl implements MzPatientMiService {
         return mzPatientMiMapper.selectByPhoneNo(phoneNo);
     }
 
+    @Override
+    public int clearIcCardNo(String patientId) {
+        return mzPatientMiMapper.clearIcCardNo(patientId);
+    }
+
 
 }

+ 1 - 1
src/main/resources/application.yml

@@ -38,4 +38,4 @@ mybatis:
 #打印SQL信息
 logging:
   level:
-    cn.hnthyy.thmz.mapper: debug
+    cn.hnthyy.thmz.mapper: info

+ 2 - 1
src/main/resources/static/js/jBox/common.js

@@ -265,7 +265,7 @@ function queryUserInfoBySocialNo() {
                 }
                 if (res.code == 0) {
                     if (res.data != null) {
-                        $("#cardNo").blur();
+                        $("#cardNo").val(res.data.icCardNo);
                         $("#userName").val(res.data.name);
                         $("#userName").blur();
                         $("#userNameReadOnly").val(res.data.name);
@@ -292,6 +292,7 @@ function queryUserInfoBySocialNo() {
                         $("#patientId").val(res.data.patientId);
                         if (res.data.name != null && res.data.name != "") {
                             $("#editUser").show();
+                            $("#clearIcCardNo").show();
                         }
 
                         $("#cardNo").attr("readonly", "readonly");

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

@@ -6,8 +6,6 @@ var pageIndex = 0;
 var msg_list_loading = false;
 //挂号卡片列表页面下标
 var pageIndex = 0;
-//判断表格列表是否已经初始化
-var isTableListInit = false;
 var LODOP; //声明为全局变量
 //默认打印机下标
 var printIndex = -1;
@@ -572,13 +570,6 @@ function listTypeChange(object) {
 }
 
 
-/**
- * 打开编辑挂号信息窗口
- * @param data
- */
-function editRegistration(data) {
-    $("#editRegiModal").modal();
-}
 
 
 /**
@@ -621,73 +612,8 @@ function editUserModal(data) {
     });
 }
 
-/**
- * 打开退费信息窗口
- * @param patientId
- * @param times
- */
-function backNoModal(patientId, times) {
-    $.ajax({
-        type: "POST",
-        url: '/thmz/getMzyReqrecByPatientIdAndTimes',
-        contentType: "application/json;charset=UTF-8",
-        dataType: "json",
-        data: JSON.stringify({"patientId": patientId, "times": times}),
-        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) {
-                if (res.data != null) {
-                    $("#backNoPatientId").val(patientId);
-                    $("#backNoTimes").val(times);
-                    $("#backNoSickName").text(res.data.mzyReqrec.name);
-                    $("#backNoPayType").text(res.data.mzyReqrec.paymode);
-                    $("#backNoPhone").text(res.data.mzPatientMi.phoneNo);
-                    $("#backNoAmpm").text(res.data.mzyReqrec.ampm);
-                    $("#backNoDeptName").text(res.data.mzyReqrec.unitCode);
-                    $("#backNoChargeType").text(res.data.mzyReqrec.chargeType);
-                    $("#backNoDoctorName").text(res.data.mzyReqrec.doctorCode);
-                    $("#backNoRegiDate").text(format(res.data.mzyReqrec.requestDay, "yyyy-MM-dd HH:mm:ss"));
-                    var index = 0;
-                    var trHtml = '';
-                    if (res.data.mzyReqrec.reqFee != null && res.data.mzyReqrec.reqFee != "" && res.data.mzyReqrec.reqFee > 0) {
-                        trHtml = '<tr data-index="' + index + '"><td style="text-align: center; vertical-align: middle; ">挂号费</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.reqFee + '</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.reqFee + '</td></tr>';
-                        index++;
-                    }
-                    if (res.data.mzyReqrec.clinicFee != null && res.data.mzyReqrec.clinicFee != "" && res.data.mzyReqrec.clinicFee > 0) {
-                        trHtml += '<tr data-index="' + index + '"><td style="text-align: center; vertical-align: middle; ">诊查费</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.clinicFee + '</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.clinicFee + '</td></tr>';
-                        index++;
-                    }
-                    if (res.data.mzyReqrec.othFee != null && res.data.mzyReqrec.othFee != "" && res.data.mzyReqrec.othFee > 0) {
-                        trHtml += '<tr data-index="' + index + '"><td style="text-align: center; vertical-align: middle; ">检查费</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.othFee + '</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.othFee + '</td></tr>';
-                    }
-                    $("#tb_fee_info").find("tbody").empty();
-                    $("#tb_fee_info").find("tbody").append(trHtml);
-                }
-            } else {
-                new PNotify({
-                    title: '错误提示',
-                    text: res.message,
-                    type: 'error',
-                    hide: true,
-                    styling: 'bootstrap3'
-                });
-            }
-        }
-    });
-    $("#backNoModal").modal();
-}
 
-/**
- * 打开打印窗口
- * @param data
- */
-function printOrPreviewModal(data) {
-    $("#printOrPreviewModal").modal();
-}
+
 
 /**
  * 打开打印内容窗口
@@ -778,6 +704,7 @@ function queryUserInfoByCardNo() {
                         $("#patientId").val(res.data.patientId);
                         if (res.data.name != null && res.data.name != "") {
                             $("#editUser").show();
+                            $("#clearIcCardNo").show();
                         }
                         readonlyOrNot(true);
                     } else {
@@ -1323,6 +1250,38 @@ function savePatient() {
 }
 
 
+// /**
+//  * 修改病人信息诊疗卡信息
+//  */
+// function modifyPatientIcCardNo() {
+//     $.ajax({
+//         type: "POST",
+//         url: '/thmz/modifyPatient',
+//         contentType: "application/json;charset=UTF-8",
+//         dataType: "json",
+//         data: JSON.stringify({
+//             //"age": jsGetAge($("#birthDayReadonly").val()),
+//             "icCardNo": $("#cardNo").val(),
+//             "patientId": $("#patientId").val(),
+//         }),
+//         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) {
+//                 editIcCardNo=false;
+//                 saveMzyReqrec();
+//                successMesage(res)
+//             } else {
+//                 errorMesage(res);
+//             }
+//         }
+//     });
+// }
+
+
 /**
  * 修改病人信息
  */
@@ -1486,34 +1445,8 @@ function initListDoctorSelect() {
 
 
 
-/**
- * 获取按钮组选择的下标
- * @param id
- * @returns {number}
- */
-function getIndex(id) {
-    var index = 0;
-    var item = $("#" + id).find("button");
-    for (var i = 0; i <= item.length; i++) {
-        if ($(item[i]).hasClass("btn-primary")) {
-            index = i;
-            break;
-        }
-    }
-    return index;
-}
 
-/**
- * 获取时间选择器的时间数组
- * @returns {string[]}
- */
-function getRePortRangeArr() {
-    var rePortRange = $('#reportrange span').html();
-    var rePortRangeArr = rePortRange.split(" - ");
-    rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
-    rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
-    return rePortRangeArr;
-}
+
 
 /**
  * 清空搜索参数
@@ -1595,6 +1528,7 @@ function clearRegistration() {
     $("#address").val(null);
     $("#patientId").val(null);
     $("#editUser").hide();
+    $("#clearIcCardNo").hide();
     //默认光标在卡号输入框
     $("#cardNo").focus();
     initMzWorkTime();
@@ -1674,11 +1608,32 @@ function prn1Print(patientId,times) {
 };
 
 
-//判断字符是否为空的方法
-function isEmpty(obj) {
-    if (typeof obj == "undefined" || obj == null || obj == "") {
-        return true;
-    } else {
-        return false;
-    }
+
+
+
+
+
+/**
+ * 销卡
+ * @param data
+ */
+function clearIcCardNo() {
+    $.ajax({
+        type: "GET",
+        url: '/thmz/clearIcCardNo?patientId=' + $("#patientId").val(),
+        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 == 0) {
+                successMesage(res);
+            } else {
+                errorMesage(res);
+            }
+        }
+    });
 }

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

@@ -56,6 +56,7 @@
                     <div class="clearRegistrationDiv">
                         <!--<a id="editPrint"><i class="fa fa-cog">&nbsp;打印设置</i></a>-->
                         <!--<a id="editWindows"><i class="fa fa-gears">&nbsp;窗口号设置</i></a>-->
+                        <a id="clearIcCardNo" hidden onclick="clearIcCardNo()"><i class="fa fa-chain-broken">&nbsp;销卡</i></a>
                         <a onclick="editUserModal(null)" id="editUser" hidden><i class="fa fa-user">&nbsp;修改患者</i></a>
                         <a id="clearRegistration"><i class="fa fa-trash">&nbsp;清空</i></a>
                     </div>