Просмотр исходного кода

1.血液培养按瓶数统计总数
2.质量指标增加保存单位配置

huangws 4 месяцев назад
Родитель
Сommit
0cabdde62f

+ 9 - 2
GetDataByView/src/main/java/com/jyxt/getdatabyview/HandleData.java

@@ -30,6 +30,9 @@ public class HandleData {
     @Value("${manualQryMonth}")
     private String manualQryMonth;
 
+    @Value("${resultWithUnit}")
+    private String resultWithUnit;
+
     public static final Map<String, String> RerunSampleField = new HashMap<>();
 
     static {
@@ -365,7 +368,7 @@ public class HandleData {
             log.info("fail update");
         }
 
-
+        //以下暂停使用
 //        for (Map<String, Object> qualityIndicatorMap : qualityIndicatorList) {
 //            log.info(qualityIndicatorMap.toString());
 //            String DateRange = DateRangeUtil.getDateRange(qualityIndicatorMap.get("bian_zhi_shi_jian").toString());
@@ -384,6 +387,7 @@ public class HandleData {
 //        ibpsRepository.updateQualityIndicatorData(updateDataList);
     }
 
+    //与LIS中List进行匹配
     public List<Map<String, Object>> MatchLISRes(Map<String, Object> undoQIMap, List<Map<String, Object>> lisRetList, List<Map<String, Object>> matchList, String formattedDateTime) {
         // 如果 matchList 为 null,则初始化
         if (matchList == null) {
@@ -400,12 +404,15 @@ public class HandleData {
                 // 找到匹配项,创建新的匹配记录
                 Map<String, Object> matchRecord = new HashMap<>();
                 matchRecord.put("id_", undoQIMap.get("id_")); // 从 undoQIMap 取 id_
-                matchRecord.put("shi_ji_shu_zhi_", lisMap.get("percentage")); // 从 lisRetList 取 percentage
                 //计算是否达标
                 String curValue = lisMap.get("percentage").toString();
                 String compChar = undoQIMap.get("yuan_shi_shu_ju_").toString();
                 String compRes = ValueEvaluator.evaluateValue(curValue, compChar);
                 matchRecord.put("da_biao_qing_kuan", compRes);
+                if(resultWithUnit.equals("1")){
+                    curValue = curValue + compChar.split("@")[2];
+                }
+                matchRecord.put("shi_ji_shu_zhi_", curValue);
                 matchRecord.put("zhuang_tai_", "已完成");
                 matchRecord.put("update_time_", Timestamp.valueOf(String.valueOf(formattedDateTime)));
                 log.info("curValue:"+curValue+", compChar:"+compChar+", cpmpare result:"+compRes);

+ 23 - 2
GetDataByView/src/main/java/com/jyxt/getdatabyview/view/repository/LISViewRepository.java

@@ -244,8 +244,29 @@ public class LISViewRepository {
         String sqlQry = "select P1,P2,WR2,WR3,WR4 from V_JT_ZLBloodCulture where sampledate BETWEEN '" + startDate + "' AND '" + endDate + "'";
         log.info("excute sql:"+sqlQry);
         List<Map<String, Object>> qryList = jdbcTemplate.queryForList(sqlQry);
-        // 计算总数
-        int totalCount = qryList.size();
+        // 计算总数 按照瓶数统计
+        int totalCount = 0;
+        for (Map<String, Object> row : qryList) {
+            Object p1Obj = row.get("P1");
+            Object p2Obj = row.get("P2");
+            int p1 = 0;
+            int p2 = 0;
+            try {
+                if (p1Obj != null) {
+                    p1 = Integer.parseInt(p1Obj.toString());
+                }
+                if (p2Obj != null) {
+                    p2 = Integer.parseInt(p2Obj.toString());
+                }
+            } catch (NumberFormatException e) {
+                // 记录日志,但使用默认值0
+                log.warn("解析P1或P2时出现数字格式异常,P1: " + p1Obj + ", P2: " + p2Obj);
+            }
+
+            if (p1 == 1) {
+                totalCount += (1 + p2);
+            }
+        }
         // 如果总数为0,直接返回原结果列表
         if (totalCount == 0) {
             return resultList;

+ 1 - 0
GetDataByView/src/main/resources/application.properties

@@ -24,3 +24,4 @@ showTestCodeName=1
 delayLimit=10
 #yyyy?M??
 manualQryMonth=
+resultWithUnit=0