ソースを参照

门诊号别报表完善

hurugang 5 年 前
コミット
ef23b25b15

+ 43 - 6
src/main/java/cn/hnthyy/thmz/controller/MzyReqrecController.java

@@ -686,25 +686,62 @@ public class MzyReqrecController {
             }
             Set<String> chargeTypeSet = new HashSet<>();
             Set<String> depetSet = new HashSet<>();
-            List<Map<String, String>> chargeTypeList = new ArrayList<>();
-            List<Map<String, String>> depetList = new ArrayList<>();
+            //医生类别列表
+            List<Map<String, Object>> chargeTypeList = new ArrayList<>();
+            //科室列表
+            List<Map<String, Object>> depetList = new ArrayList<>();
+            //按照科室合计统计
+            Map<String,Map<String,Object>> deptHjMap = new HashMap<>();
+            //按照号别类型合计统计
+            Map<String,Map<String,Object>> chargeTypeHjMap = new HashMap<>();
             for(Map<String, Object> map:mzhbCounts){
                 String chargeType=(String) map.get("charge_type");
                 if(!chargeTypeSet.contains(chargeType)){
-                    Map<String, String> chargeTemp = new HashMap<>();
-                    chargeTemp.put("charge_type_name",(String) map.get("charge_type_name"));
+                    Map<String, Object> chargeTemp = new HashMap<>();
+                    chargeTemp.put("charge_type_name", map.get("charge_type_name"));
                     chargeTemp.put("charge_type",chargeType);
                     chargeTypeList.add(chargeTemp);
                     chargeTypeSet.add(chargeType);
+                    chargeTypeHjMap.put(chargeType,chargeTemp);
                 }
                 String unitCode=(String) map.get("unit_code");
                 if(!depetSet.contains(unitCode)){
-                    Map<String, String> deptTemp = new HashMap<>();
-                    deptTemp.put("dept_name",(String) map.get("dept_name"));
+                    Map<String, Object> deptTemp = new HashMap<>();
+                    deptTemp.put("dept_name",map.get("dept_name"));
                     deptTemp.put("unit_code",unitCode);
                     depetList.add(deptTemp);
                     depetSet.add(unitCode);
+                    deptHjMap.put(unitCode,deptTemp);
                 }
+                Map<String,Object> deptMap = deptHjMap.get(unitCode);
+                Integer hshj = (Integer) deptMap.get("hshj");
+                Double jehj = (Double) deptMap.get("jehj");
+                if(hshj==null){
+                    hshj= 0;
+                }
+                if(jehj==null){
+                    jehj=0D;
+                }
+               Integer patientCount= (Integer) map.get("patient_count");
+                Double reqFee=((Double)map.get("req_fee"));
+                hshj=hshj+patientCount;
+                jehj=jehj+reqFee;
+                deptMap.put("hshj",hshj);
+                deptMap.put("jehj",jehj);
+
+                Map<String,Object> chargeMap = chargeTypeHjMap.get(chargeType);
+                Integer chargeHshj = (Integer) chargeMap.get("chargeHshj");
+                Double chargeHehj = (Double) chargeMap.get("chargeHehj");
+                if(chargeHshj==null){
+                    chargeHshj= 0;
+                }
+                if(chargeHehj==null){
+                    chargeHehj=0D;
+                }
+                chargeHshj=chargeHshj+patientCount;
+                chargeHehj=chargeHehj+reqFee;
+                chargeMap.put("chargeHshj",chargeHshj);
+                chargeMap.put("chargeHehj",chargeHehj);
             }
             resultMap.put("depetList", depetList);
             resultMap.put("chargeTypeList", chargeTypeList);

+ 1 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -850,6 +850,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 m.setPayMark(PayMarkEnum.CHARGED.code);
                 m.setChargeDate(now);
                 m.setDcountNo(YesNoEnum.NO.code);
+                m.setDcountDate(null);
                 m.setOpId(opId);
                 m.setReceiptSn(serialNo);
                 m.setSerialNo(serialNo);

+ 59 - 41
src/main/resources/static/js/mzhbtj.js

@@ -2,7 +2,7 @@
 $(function () {
     init_daterangepicker();
     //daterangepicker(getAllOperator);
-      initMzsrmxTable();
+    initMzsrmxTable();
     //重置查询参数
     $('#btn_clean').click(function () {
         cleanParams();
@@ -24,7 +24,6 @@ $(function () {
 });
 
 
-
 /**
  * 初始化下拉选
  */
@@ -42,8 +41,6 @@ function initSelect() {
 }
 
 
-
-
 /**
  * 父类码下拉选
  */
@@ -159,42 +156,65 @@ function initMzsrmxTable() {
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
-        data: JSON.stringify({"beginDate": rePortRangeArr[0], "endDate": rePortRangeArr[1], "caseType":  $('#timeParam').val(), "jzSqDept":  $("#jzSqDept").val(), "jzSqDoctor":  $("#jzSqDoctor").val(),"hisData": $('#hisData').is(':checked') ? 0 : 1}),
+        data: JSON.stringify({
+            "beginDate": rePortRangeArr[0],
+            "endDate": rePortRangeArr[1],
+            "caseType": $('#timeParam').val(),
+            "jzSqDept": $("#jzSqDept").val(),
+            "jzSqDoctor": $("#jzSqDoctor").val(),
+            "hisData": $('#hisData').is(':checked') ? 0 : 1
+        }),
         success: function (res) {
             if (res == '401' || res == 401) {
                 window.location.href = '/thmz/login/view'
                 return;
             }
-            if(res.code==0){
-                if(res.depetList!=null && res.depetList.length>0 && res.chargeTypeList!=null && res.chargeTypeList.length>0){
-                    var html ="<thead><tr><th rowspan='2'>科室</th>";
-                    var secondRow='<tr>';
-                    for (var i=0;i<res.chargeTypeList.length;i++){
-                        html+="<th colspan='2'>"+res.chargeTypeList[i].charge_type_name+"</th>";
-                        secondRow+="<th>号数</th><th>金额</th>"
+            if (res.code == 0) {
+                if (res.depetList != null && res.depetList.length > 0 && res.chargeTypeList != null && res.chargeTypeList.length > 0) {
+                    var html = "<thead><tr><th rowspan='2' class='text-center' style='vertical-align: middle !important;' >科室</th>";
+                    var secondRow = '<tr>';
+                    var totalTr = '<tr><th class="text-center">总计</th>';
+                    for (var i = 0; i < res.chargeTypeList.length; i++) {
+                        var charge_type_name=res.chargeTypeList[i].charge_type_name;
+                        if(charge_type_name==null){
+                            charge_type_name="";
+                        }
+                        html += "<th colspan='2' class='text-center'>" + charge_type_name + "</th>";
+                        secondRow += "<th class='text-center'>号数</th><th class='text-center'>金额</th>";
+                        totalTr += "<th>"+res.chargeTypeList[i].chargeHshj+"</th><th>"+res.chargeTypeList[i].chargeHehj+"</th>";
                     }
-                    html+="<th colspan='2'>合计</th></tr>"
-                    secondRow+="<th>号数</th><th>金额</th></tr></thead>"
-                    html+=secondRow;
-                    html+="<tbody>";
-                    for (var i=0;i<res.depetList.length;i++){
-                        html+="<tr><td>"+res.depetList[i].dept_name+"</td>";
-                        for (var j=0;j<res.chargeTypeList.length;j++){
-                            var id_after = res.chargeTypeList[j].charge_type+"_"+res.depetList[i].unit_code;
-                            var hsid= "hs_"+id_after;
-                            var jeid= "je_"+id_after;
-                            html+="<td id='"+hsid+"'></td><td id='"+jeid+"'></td>";
+                    html += "<th colspan='2' class='text-center'>合计</th></tr>";
+                    secondRow += "<th class='text-center'>号数</th><th class='text-center'>金额</th></tr></thead>";
+                    html += secondRow;
+                    html += "<tbody>";
+                    var allhsht=0;
+                    var alljehj=0.0;
+                    for (var i = 0; i < res.depetList.length; i++) {
+                        html += "<tr><td>" + res.depetList[i].dept_name + "</td>";
+                        for (var j = 0; j < res.chargeTypeList.length; j++) {
+                            var id_after = res.chargeTypeList[j].charge_type.trim() + "_" + res.depetList[i].unit_code;
+                            var hsid = "hs_" + id_after;
+                            var jeid = "je_" + id_after;
+                            html += "<td id='" + hsid + "'></td><td id='" + jeid + "'></td>";
                         }
-                        var hjhsid= "hs_hj_"+res.depetList[i].unit_code;
-                        var hjjeid= "je_hj_"+res.depetList[i].unit_code;
-                        html+="<td id='"+hjhsid+"'></td><td id='"+hjjeid+"'></td>";
-                        html+="</tr>";
+                        html += "<td>" + res.depetList[i].hshj + "</td><td>" + res.depetList[i].jehj.toFixed(2) + "</td>";
+                        html += "</tr>";
+                        allhsht=allhsht+res.depetList[i].hshj;
+                        alljehj=alljehj+res.depetList[i].jehj;
                     }
-                    html+="</tbody>";
+                    totalTr+="<th>"+allhsht+"</th><th>"+alljehj.toFixed(2)+"</th></tr>";
+                    html+=totalTr;
+                    html += "</tbody>";
                     $("#tb_table").html(html);
 
-                    for(var i=0;i<res.data.length;i++){
-                        
+                    for (var i = 0; i < res.data.length; i++) {
+                        var id_after = res.data[i].charge_type.trim() + "_" + res.data[i].unit_code;
+                        var hsid = "hs_" + id_after;
+                        var jeid = "je_" + id_after;
+                        $("#" + hsid).text(res.data[i].patient_count);
+                        if (res.data[i].req_fee != null) {
+                            $("#" + jeid).text(res.data[i].req_fee.toFixed(2));
+                        }
                     }
                 }
             }
@@ -214,19 +234,18 @@ function queryParams(params) {
         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()
+        jzSqDept: $("#jzSqDept").val(),
+        jzSqDoctor: $("#jzSqDoctor").val(),
+        execDept: $("#execDept").val(),
+        hsm: $("#hsm").val(),
+        parentCode: $("#parentCode").val(),
+        xmm: $("#xmm").val()
     };
 
     return temp;
 };
 
 
-
 /**
  * 获取时间选择器的时间数组
  * @returns {string[]}
@@ -240,7 +259,6 @@ function getRePortRangeArr() {
 }
 
 
-
 /**
  * 清空查询条件
  */
@@ -267,7 +285,7 @@ function cleanParams() {
  */
 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();
+    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();
 }