Browse Source

检验报告没有数据处理优化

hurugang 3 years ago
parent
commit
fd91bfce17

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

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -367,6 +368,7 @@ public class JcJyController {
         try {
             if (patientId == null || StringUtils.isBlank(patientId)) {
                 resultMap.put("code", -1);
+                resultMap.put("data", new ArrayList<>());
                 resultMap.put("message", "查询检验项目列表失败,病人门诊ID为空");
                 return resultMap;
             }
@@ -379,12 +381,14 @@ public class JcJyController {
                 String firstDate = jcJyItemChargeService.queryFirstDateByPatientId(patientId);
                 if (StringUtils.isBlank(firstDate)) {
                     resultMap.put("code", -1);
+                    resultMap.put("data", new ArrayList<>());
                     resultMap.put("message", "查询检验项目列表失败,没有查询到对应的检验申请时间");
                     return resultMap;
                 }
                 String lastDate = jcJyItemChargeService.queryLastDateByPatientId(patientId);
                 if (StringUtils.isBlank(lastDate)) {
                     resultMap.put("code", -1);
+                    resultMap.put("data", new ArrayList<>());
                     resultMap.put("message", "查询检验项目列表失败,没有查询到对应的检验申请时间");
                     return resultMap;
                 }
@@ -394,6 +398,7 @@ public class JcJyController {
                 String reqDate = jcJyItemChargeService.queryDateByPatientIdAndTimes(patientId, times);
                 if (StringUtils.isBlank(reqDate)) {
                     resultMap.put("code", -1);
+                    resultMap.put("data", new ArrayList<>());
                     resultMap.put("message", "查询检验项目列表失败,没有查询到对应的检验申请时间");
                     return resultMap;
                 }
@@ -403,6 +408,7 @@ public class JcJyController {
             List<InspectionsIndex> data = jcJyItemChargeService.getJyList(patientId, beginTime, endTime);
             if (data == null) {
                 resultMap.put("code", -1);
+                resultMap.put("data", new ArrayList<>());
                 resultMap.put("message", "查询检验项目列表失败,暂时没有对应的报告");
                 return resultMap;
             }
@@ -414,12 +420,14 @@ public class JcJyController {
             e.printStackTrace();
             log.error("查询检验项目列表失败,错误信息{}", e);
             resultMap.put("code", -1);
+            resultMap.put("data", new ArrayList<>());
             resultMap.put("message", e.getMessage());
             return resultMap;
         } catch (Exception e) {
             e.printStackTrace();
             log.error("查询检验项目列表失败,错误信息{}", e);
             resultMap.put("code", -1);
+            resultMap.put("data", new ArrayList<>());
             resultMap.put("message", "查询检验项目列表失败");
             return resultMap;
         }

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

@@ -7888,8 +7888,8 @@ function initJyListTable() {
                     errorMesage(ress);
                 }
                 return {
-                    "total": 0,//总页数
-                    "rows": {}   //数据
+                    "total": ress.data.length,//总页数
+                    "rows": ress.data   //数据
                 };
             }
             if (ress.data.length <= 0 && retryCount ==0) {