Эх сурвалжийг харах

同一时间数据匹配插件问题修复

0027005599 1 жил өмнө
parent
commit
8c2ab78e8f

+ 7 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/common/CommonUtil.java

@@ -14,7 +14,7 @@ import java.util.Date;
 
 @Slf4j
 public class CommonUtil {
-    @Autowired
+
     static RedisTemplate redisTemplate = (RedisTemplate) SpringContextUtils.getBean("redisTemplate");
 
     public static String getProjectType(String projectCode) {
@@ -62,6 +62,10 @@ public class CommonUtil {
         }else if(projectUseTime instanceof java.util.Date || projectUseTime instanceof java.sql.Date){
             Date projectUseTimeDate = (Date) projectUseTime;
             return DateUtil.formatDate(projectUseTimeDate);
+        }else if(projectUseTime instanceof java.lang.Long){
+            Date projectUseTimeDate = new Date(((Long) projectUseTime));
+            return DateUtil.formatDate(projectUseTimeDate);
+
         }else{
             log.error("时间类型匹配不上:{}", projectUseTime.getClass());
         }
@@ -69,7 +73,8 @@ public class CommonUtil {
     }
 
     public static void main(String[] args) {
-        String day = "2023-11-09 19:10:11";
+//        String day = "2023-11-09 19:10:11";
+        Long day = 1607475808000l;
         System.out.println(getProjectUseDay(day));
     }
 }

+ 13 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/SPELUtil.java

@@ -393,9 +393,15 @@ public class SPELUtil {
             if(projectUseTimeStr.length()>15){
                 return projectUseTimeStr.substring(0, 10);
             }
-        }else if(projectUseTime instanceof Date){
+        }else if(projectUseTime instanceof java.util.Date || projectUseTime instanceof java.sql.Date){
             Date projectUseTimeDate = (Date) projectUseTime;
             return DateUtil.formatDate(projectUseTimeDate);
+        }else if(projectUseTime instanceof java.lang.Long){
+            Date projectUseTimeDate = new Date(((Long) projectUseTime));
+            return DateUtil.formatDate(projectUseTimeDate);
+
+        }else{
+            log.error("时间类型匹配不上:{}", projectUseTime.getClass());
         }
         return projectUseTime.toString();
     }
@@ -434,12 +440,15 @@ public class SPELUtil {
 //            log.error(e.getMessage(), e);
 //        }
 
-        String day = "2023-11-09 19:10:11";
-        Date now = new Date();
-        System.out.println(getProjectUseDay(now));
+//        String day = "2023-11-09 19:10:11";
+//        Date now = new Date();
+//        System.out.println(getProjectUseDay(now));
 
         String s = "234sdfsafasdf423";
         System.out.println(isMemberObjectAndObject(s, "safasd"));
+
+        Long day = 1607475808000l;
+        System.out.println(getProjectUseDay(day));
 //        String test ="A0123123";
 //        System.out.println(isNumeric(test));
 //        String[] rolesArr = new String []{"correlationMedicalDiagnoseCode","111"};

+ 3 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/plugin/GroupbyProjectCodeNumPlugin.java

@@ -30,7 +30,7 @@ public class GroupbyProjectCodeNumPlugin implements PluginInterface {
                 int projectNum = 0;
                 int sumProjectNum = 0;
                 Object srcProjectUseTime = localMap.get(SystemEventAttrConstant.PROJECT_USE_TIME);
-                Object srcProjectUseDay = CommonUtil.getProjectUseDay(srcProjectUseTime);
+                String srcProjectUseDay = CommonUtil.getProjectUseDay(srcProjectUseTime);
                 Object srcProjectCode = localMap.getOrDefault(SystemEventAttrConstant.MEDICAL_PROJECT_CODE_KEY, "").toString();
                 log.info("项目编码:{} 项目使用时间:{}", srcProjectCode, srcProjectUseDay);
                 if (null == srcProjectCode || null == srcProjectUseTime) {
@@ -41,7 +41,7 @@ public class GroupbyProjectCodeNumPlugin implements PluginInterface {
                     String projectCode = adviceMap.getOrDefault(SystemEventAttrConstant.MEDICAL_PROJECT_CODE_KEY, "").toString();
                     Object projectUseTime = adviceMap.get(SystemEventAttrConstant.PROJECT_USE_TIME);
                     String projectUseDay = CommonUtil.getProjectUseDay(projectUseTime);
-                    log.info("同批其他项目编码:{} 项目使用时间:{}", projectCode, projectUseDay);
+                    log.info("同批其他项目编码:{} 项目使用时间:{} 原始项目编码:{} 原始项目使用时间:{}", projectCode, projectUseDay, srcProjectCode, srcProjectUseDay);
                     Integer quaity = (Integer) adviceMap.getOrDefault(SystemEventAttrConstant.QUANTITY, 1);
                     if (StringUtils.isNotBlank(projectCode) && null != projectUseTime && projectCode.equals(srcProjectCode) && srcProjectUseDay.equals(projectUseDay)) {
                         projectNum = projectNum + quaity;
@@ -58,6 +58,7 @@ public class GroupbyProjectCodeNumPlugin implements PluginInterface {
                 }
                 localMap.put(SystemEventAttrConstant.SAME_TIME_SAME_CODE_NUM, projectNum);
                 localMap.put(SystemEventAttrConstant.SAME_TIME_SAME_CODE_List, projectCodeList);
+                log.info("原始项目编码:{} 原始项目使用时间:{} 同一批项目:{}", srcProjectCode, srcProjectUseDay, projectCodeList);
                 localMap.put(SystemEventAttrConstant.SAME_CODE_NUM, sumProjectNum);
             }
         } catch (Exception e) {