Explorar el Código

[task-5744] 室内质控月分析需要支持可以推送给多人

huangws hace 2 meses
padre
commit
a26461f5e0

+ 14 - 29
GetDataByView/src/main/java/com/jyxt/getdatabyview/HandleData.java

@@ -99,6 +99,7 @@ public class HandleData {
         DepartmentLeaderField.put("1353739725613039616","1353762508984287232"); //分子组 许媛
         DepartmentLeaderField.put("1353739809322958848","1353762523634991104"); //文化路院区 马强
         DepartmentLeaderField.put("1353739909701042176","1353762541930545152"); //医疗助理组 杨珣
+
     }
 
 
@@ -236,11 +237,8 @@ public class HandleData {
                     log.warn("error auditUserInfo,skip to insert:"+auditUserInfo);
                     continue;
                 }
-                LocalDateTime currentDateTime = LocalDateTime.now();
-                DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                String formattedDateTime = currentDateTime.format(formatter2);
                 insertMap.put("create_by_", createUserInfo.trim().split("@")[0]);
-                insertMap.put("create_time_", Timestamp.valueOf(String.valueOf(formattedDateTime)));
+                insertMap.put("create_time_", getCurTime("yyyy-MM-dd HH:mm:ss"));
                 insertMap.put("bian_zhi_ren_", createUserInfo.trim().split("@")[0]);
                 insertMap.put("jian_yan_zhe_", String.valueOf(entityMap.get("AUDITUSER")));
                 insertMap.put("jian_yan_yuan_", auditUserInfo.trim().split("@")[0]);
@@ -270,20 +268,18 @@ public class HandleData {
 
                 insertReportMap.put("id_", entityMap.get("REPORTID"));
                 insertReportMap.put("shi_fou_guo_shen_", "待推送");
-                LocalDateTime currentDateTime = LocalDateTime.now();
-                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                String formattedDateTime = currentDateTime.format(formatter);
-                insertReportMap.put("create_time_", Timestamp.valueOf(String.valueOf(formattedDateTime)));
+                insertReportMap.put("create_time_", getCurTime("yyyy-MM-dd HH:mm:ss"));
                 String editUser = entityMap.get("CREATEBY").toString();
-                String editUserInfo = ibpsRepository.getUserInfoByName(editUser);
+                String launchUser = ibpsRepository.getUserIDByName(editUser);
                 //insertReportMap.put("bian_zhi_shi_jian", String.valueOf(formattedDateTime));
                 String posID = ibpsRepository.getPosiByCode(entityMap.get("GROUPCODE").toString());
-                if ((posID != "-1")&&(!editUserInfo.split("\\^")[0].equals("-1"))) {
+                if (posID != "-1") {
                     insertReportMap.put("di_dian_", posID);
                     insertReportMap.put("bian_zhi_bu_men_", posID);
-                    insertReportMap.put("bian_zhi_ren_", editUserInfo.split("@")[0]);
+//                    insertReportMap.put("bian_zhi_ren_", editUserInfo.split("@")[0]);
+                    insertReportMap.put("zhi_kong_pin_", launchUser);   //质控品字段已弃用,现当作发起人字段用来支持多人,编制人字段由实际启动的人决定
                 } else{
-                    log.info("error editUserInfo or posID,skip to insert,posID:"+posID+" ,editUserInfo:"+editUserInfo);
+                    log.info("error launchUser or posID,skip to insert,posID:"+posID+" ,launchUser:"+editUser);
                     continue;
                 }
                 insertReportMap.put("xi_tong_ming_chen", entityMap.get("GROUPNAME")+"全组仪器");
@@ -304,10 +300,7 @@ public class HandleData {
     };
 
     public String handQCTestCode(List<Map<String, Object>> reportList) {
-        LocalDateTime currentDateTime = LocalDateTime.now();
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-        String formattedDateTime = currentDateTime.format(formatter);
-        Timestamp currentTimestamp = Timestamp.valueOf(currentDateTime);
+        Timestamp currentTimestamp = getCurTime("yyyy-MM-dd HH:mm:ss");
         long sequenceCounter = 0;
         for (Map<String, Object> reportMap : reportList) {
             String reportID = getStringValue(reportMap, "id_");
@@ -382,10 +375,7 @@ public class HandleData {
 
     public void HandleUnControlReport(List<Map<String, Object>> retList){
         if (retList.size() > 0) {
-            LocalDateTime currentDateTime = LocalDateTime.now();
-            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-            String formattedDateTime = currentDateTime.format(formatter);
-            Timestamp currentTimestamp = Timestamp.valueOf(currentDateTime);
+            Timestamp currentTimestamp = getCurTime("yyyy-MM-dd HH:mm:ss");
             long sequenceCounter = 0;
             List<Map<String, Object>> insertList = new ArrayList<>();
             for (Map<String, Object> retMap : retList) {
@@ -580,11 +570,6 @@ public class HandleData {
 //        // 转换为List
 //        List<String> distinctList = new ArrayList<>(distinctSet);
 
-        LocalDateTime currentDateTime = LocalDateTime.now();
-        DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-        String formattedDateTime = currentDateTime.format(formatter2);
-
-
         YearMonth currentYearMonth = YearMonth.now();
         YearMonth previousMonth = currentYearMonth.minusMonths(1);
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年M月份", Locale.CHINA);
@@ -602,7 +587,7 @@ public class HandleData {
             if(!editTime.equals(manualQryMonth)){
                 continue;
             }
-            matchList = MatchLISRes(undoQIMap, lisRetList, matchList, formattedDateTime);
+            matchList = MatchLISRes(undoQIMap, lisRetList, matchList, getCurTime("yyyy-MM-dd HH:mm:ss"));
         }
         if (matchList == null) {
             log.info("no match data found");
@@ -641,7 +626,7 @@ public class HandleData {
     }
 
     //与LIS中List进行匹配
-    public List<Map<String, Object>> MatchLISRes(Map<String, Object> undoQIMap, List<Map<String, Object>> lisRetList, List<Map<String, Object>> matchList, String formattedDateTime) {
+    public List<Map<String, Object>> MatchLISRes(Map<String, Object> undoQIMap, List<Map<String, Object>> lisRetList, List<Map<String, Object>> matchList, Timestamp formattedDateTime) {
         // 如果 matchList 为 null,则初始化
         if (matchList == null) {
             matchList = new ArrayList<>();
@@ -667,7 +652,7 @@ public class HandleData {
                 }
                 matchRecord.put("shi_ji_shu_zhi_", curValue);
                 matchRecord.put("zhuang_tai_", "已完成");
-                matchRecord.put("update_time_", Timestamp.valueOf(String.valueOf(formattedDateTime)));
+                matchRecord.put("update_time_", formattedDateTime);
                 log.info("curValue:"+curValue+", compChar:"+compChar+", cpmpare result:"+compRes);
                 matchList.add(matchRecord);
                 break; // 找到匹配后跳出内层循环
@@ -675,6 +660,7 @@ public class HandleData {
         }
         return matchList;
     }
+
     public void AbilityMonitor(){
         // 1. 转为 Set 便于 O(1) 查询
         Set<String> pushDates = new HashSet<>(Arrays.asList(pushDate.split(",")));
@@ -799,4 +785,3 @@ public class HandleData {
         return currentTimestamp;
     }
 }
-

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

@@ -48,6 +48,20 @@ public class LISViewRepository {
         }
         //月分析主表
         if(tableName.equals("V_JT_QCMonthReport")) {
+            if(1==2){
+                // 1. 创建最外层的List
+                List<Map<String, Object>> list = new ArrayList<>();
+                // 2. 创建内层Map
+                Map<String, Object> map = new HashMap<>(); // 保持插入顺序
+                // 3. 向Map中添加数据
+                map.put("REPORTID", "G036202602");
+                map.put("CREATETIME", "202602");
+                map.put("CREATEBY", "许媛,马强");
+                map.put("GROUPCODE", "G036");
+                map.put("GROUPNAME", "文化大检验");
+                list.add(map);
+                return list;
+            }
             // 新增条件判断:当需要检查首日时,验证当前日期是否为2号
             if ("1".equals(onlyQrySecondDay)) {
                 Calendar calendar = Calendar.getInstance();
@@ -99,6 +113,15 @@ public class LISViewRepository {
     }
 
     public List<Map<String, Object>> getQCTestCodeList(String reportID) {
+        if(1==2){
+            // 1. 创建最外层的List
+            List<Map<String, Object>> list = new ArrayList<>();
+            // 2. 创建内层Map
+            Map<String, Object> map = new HashMap<>(); // 保持插入顺序
+            // 3. 向Map中添加数据
+            list.add(map);
+            return list;
+        }
         List<Map<String, Object>> retList = new ArrayList<>();
         String sqlQry = "select * from V_JT_QCTestCodeReport where reportID='"+reportID+"' order by TESTCODENAME,LOTNUMBER";
         log.info("excute sql:"+sqlQry);