Ver código fonte

门诊号别列表统计

hurugang 5 anos atrás
pai
commit
a44e90eecc

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

@@ -286,7 +286,7 @@ public interface MzChargeDetailMapper {
      * @return
      */
     @Select("select * from mz_charge_detail where patient_id =#{patientId,jdbcType=CHAR} and times =#{times,jdbcType=INTEGER} and charge_item_code=#{chargeItemCode,jdbcType=CHAR} and order_no =#{orderNo} and quantity>0")
-    MzChargeDetail selectMzChargeDetailByChargeItemCode(@Param("patientId") String patientId, @Param("times") Integer times, @Param("chargeItemCode") String chargeItemCode,@Param("orderNo") Integer orderNo);
+    List<MzChargeDetail> selectMzChargeDetailByChargeItemCode(@Param("patientId") String patientId, @Param("times") Integer times, @Param("chargeItemCode") String chargeItemCode,@Param("orderNo") Integer orderNo);
     /**
      * 新增收费明细记录
      * @param mzChargeDetail

+ 28 - 23
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -560,33 +560,38 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 ypMzFytjList = ypMzFytjMapper.selectXyTyYpMzFytj(patientId, refundTimes);
                 if (ypMzFytjList != null && ypMzFytjList.size() > 0) {
                     for (YpMzFytj ypMzFytj : ypMzFytjList) {
-                        MzChargeDetail mzChargeDetail = mzChargeDetailMapper.selectMzChargeDetailByChargeItemCode(ypMzFytj.getPatientId(), ypMzFytj.getTimes(), ypMzFytj.getChargeItemCode(), ypMzFytj.getOrderNo());
-                        Integer syCount = BigDecimal.valueOf(mzChargeDetail.getQuantity()).subtract(mzChargeDetail.getDecAmount() == null ? BigDecimal.ZERO : mzChargeDetail.getDecAmount()).intValue();
-                        //皮试药特别逻辑
-                        if (Constants.XYF.equals(mzChargeDetail.getBillItemCode())) {
-                            BigDecimal origPrice = mzChargeDetail.getOrigPrice();
-                            origPrice = origPrice == null ? BigDecimal.ZERO : origPrice;
-                            BigDecimal unitPrice = mzChargeDetail.getUnitPrice();
-                            unitPrice = unitPrice == null ? BigDecimal.ZERO : unitPrice;
-                            //如果原价大于单价,说明是皮试自备
-                            if (origPrice.compareTo(unitPrice) == 1) {
-                                if (Integer.valueOf(1).equals(syCount)) {
-                                    syCount = 0;
+                        List<MzChargeDetail> mzChargeDetails = mzChargeDetailMapper.selectMzChargeDetailByChargeItemCode(ypMzFytj.getPatientId(), ypMzFytj.getTimes(), ypMzFytj.getChargeItemCode(), ypMzFytj.getOrderNo());
+                        if(mzChargeDetails==null || mzChargeDetails.size()==0){
+                            continue;
+                        }
+                        for (MzChargeDetail mzChargeDetail:mzChargeDetails){
+                            Integer syCount = BigDecimal.valueOf(mzChargeDetail.getQuantity()).subtract(mzChargeDetail.getDecAmount() == null ? BigDecimal.ZERO : mzChargeDetail.getDecAmount()).intValue();
+                            //皮试药特别逻辑
+                            if (Constants.XYF.equals(mzChargeDetail.getBillItemCode())) {
+                                BigDecimal origPrice = mzChargeDetail.getOrigPrice();
+                                origPrice = origPrice == null ? BigDecimal.ZERO : origPrice;
+                                BigDecimal unitPrice = mzChargeDetail.getUnitPrice();
+                                unitPrice = unitPrice == null ? BigDecimal.ZERO : unitPrice;
+                                //如果原价大于单价,说明是皮试自备
+                                if (origPrice.compareTo(unitPrice) == 1) {
+                                    if (Integer.valueOf(1).equals(syCount)) {
+                                        syCount = 0;
+                                    }
                                 }
                             }
-                        }
 
-                        if (syCount <= 0) {
-                            continue;
+                            if (syCount <= 0) {
+                                continue;
+                            }
+                            ypMzFytj.setTimes(times);
+                            ypMzFytj.setReceiptNo(ypMzFytj.getReceiptNo() + 1);
+                            ypMzFytj.setQuantity(Double.valueOf(syCount));
+                            ypMzFytj.setSerialNo(serialNo);
+                            ypMzFytj.setConfirmFlag(ConfirmFlagEnum.CONFIRM.code);
+                            ypMzFytj.setRealNo(serialNo);
+                            ypMzFytj.setItemNo(itemNoMap.get(ypMzFytj.getChargeItemCode().trim()));
+                            ypMzFytjMapper.insertYpMzFytj(ypMzFytj);
                         }
-                        ypMzFytj.setTimes(times);
-                        ypMzFytj.setReceiptNo(ypMzFytj.getReceiptNo() + 1);
-                        ypMzFytj.setQuantity(Double.valueOf(syCount));
-                        ypMzFytj.setSerialNo(serialNo);
-                        ypMzFytj.setConfirmFlag(ConfirmFlagEnum.CONFIRM.code);
-                        ypMzFytj.setRealNo(serialNo);
-                        ypMzFytj.setItemNo(itemNoMap.get(ypMzFytj.getChargeItemCode().trim()));
-                        ypMzFytjMapper.insertYpMzFytj(ypMzFytj);
                     }
                 }
             }

Diferenças do arquivo suprimidas por serem muito extensas
+ 1987 - 0
src/main/resources/static/js/excel/table2excel.js


+ 7 - 83
src/main/resources/static/js/mzhbtj.js

@@ -1,4 +1,4 @@
-//@ sourceURL=mzsrmx.js
+//@ sourceURL=mzhbtj.js
 $(function () {
     init_daterangepicker();
     //daterangepicker(getAllOperator);
@@ -41,55 +41,7 @@ function initSelect() {
 }
 
 
-/**
- * 父类码下拉选
- */
-function initBillItemSelect() {
-    //科室列表
-    $.ajax({
-        type: "GET",
-        url: '/thmz/getAllBillItems',
-        dataType: "json",
-        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
-        success: function (data) {
-            if (data == '401' || data == 401) {
-                window.location.href = '/thmz/login/view'
-                return;
-            }
-            var html = '';
-            $.each(data.data, function (commentIndex, comment) {
-                html += '<option value="' + comment.code + '">' + comment.name + '</option>';
-            });
-            $('#parentCode').html(html);
-            $('#parentCode').selectpicker('refresh');
-        }
-    });
-}
 
-/**
- * 核算码下拉选
- */
-function initHsmNameSelect() {
-    //科室列表
-    $.ajax({
-        type: "GET",
-        url: '/thmz/getAllHsmName',
-        dataType: "json",
-        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
-        success: function (data) {
-            if (data == '401' || data == 401) {
-                window.location.href = '/thmz/login/view'
-                return;
-            }
-            var html = '';
-            $.each(data.data, function (commentIndex, comment) {
-                html += '<option value="' + comment + '">' + comment + '</option>';
-            });
-            $('#hsm').html(html);
-            $('#hsm').selectpicker('refresh');
-        }
-    });
-}
 
 /**
  * 挂号列表中的科室列表
@@ -217,33 +169,13 @@ function initMzsrmxTable() {
                         }
                     }
                 }
+            }else {
+                $("#tb_table").find("tbody").html(null);
             }
         }
     });
 }
 
-/**
- * 构建列表查询参数
- * @param params
- * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
-function queryParams(params) {
-    var rePortRangeArr = getRePortRangeArr();
-    var temp = {
-        beginDate: rePortRangeArr[0],
-        endDate: rePortRangeArr[1],
-        commonParams: $('#commonParams').val(),
-        caseType: $('#timeParam').val(),
-        jzSqDept: $("#jzSqDept").val(),
-        jzSqDoctor: $("#jzSqDoctor").val(),
-        execDept: $("#execDept").val(),
-        hsm: $("#hsm").val(),
-        parentCode: $("#parentCode").val(),
-        xmm: $("#xmm").val()
-    };
-
-    return temp;
-};
 
 
 /**
@@ -264,28 +196,20 @@ function getRePortRangeArr() {
  */
 function cleanParams() {
     $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
-    $("#commonParams").val(null);
     $("#timeParam").selectpicker('val', 0);//默认选中
     $("#timeParam").selectpicker('refresh');
     $("#jzSqDept").selectpicker('val', null);//默认选中
     $("#jzSqDept").selectpicker('refresh');
     $("#jzSqDoctor").selectpicker('val', null);//默认选中
     $("#jzSqDoctor").selectpicker('refresh');
-    $("#execDept").selectpicker('val', null);//默认选中
-    $("#execDept").selectpicker('refresh');
-    $("#parentCode").selectpicker('val', null);//默认选中
-    $("#parentCode").selectpicker('refresh');
-    $("#hsm").selectpicker('val', null);//默认选中
-    $("#hsm").selectpicker('refresh');
-    $("#xmm").val(null);
+    $("#hisData").removeAttr("checked");
 }
 
 /**
  * 导出excel
  */
 function exportExcel() {
-    var rePortRangeArr = getRePortRangeArr();
-    window.location.href = "/thmz/excelThmzmxsr?beginDate=" + rePortRangeArr[0] + "&endDate=" + rePortRangeArr[1] + "&commonParams=" + $('#commonParams').val()
-        + "&caseType=" + $('#timeParam').val() + "&jzSqDept=" + $("#jzSqDept").val() + "&jzSqDoctor=" + $("#jzSqDoctor").val() + "&execDept=" + $("#execDept").val() + "&hsm="
-        + $("#hsm").val() + "&parentCode=" + $("#parentCode").val() + "&xmm=" + $("#xmm").val();
+    var table2excel = new Table2Excel();
+// 传入你的tableId即可导出
+    table2excel.export($('#tb_table'), "门诊号别列表");
 }

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

@@ -4,6 +4,7 @@
 <link rel="stylesheet" href="/thmz/css/toll_administration.css">
 <script src="/thmz/js/bootstrap-select.js"></script>
 <script src="/thmz/js/daterangepicker.js"></script>
+<script src="/thmz/js/excel/table2excel.js"></script>
 <script src="/thmz/js/mzhbtj.js"></script>
 <div class="row">
     <div class="col-md-12 col-sm-12 col-xs-12">

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff