zhoutg 4 лет назад
Родитель
Сommit
0acc989d47

+ 1 - 0
src/main/java/com/diagbot/facade/IndicationFacade.java

@@ -103,6 +103,7 @@ public class IndicationFacade {
 
         // 输入调试信息
         CoreUtil.getDebugStr(l1, "本次调用总计耗时", res.getDebug());
+        CoreUtil.getDebugObject("数据", res.getDebug(), wordCrfDTO);
         return res;
     }
 }

+ 3 - 0
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -458,6 +458,9 @@ public class NeoFacade {
      */
     public void getConvertMap(Map<String, Map<String, StandConvertCrfDTO>> crfDTO, String type, List<String> convertList,
                               List<String> orginList, Map<String, Map<String, String>> map) {
+        if (ListUtil.isEmpty(orginList)) {
+            return ;
+        }
         Map<String, StandConvertCrfDTO> crfMap = crfDTO.get(type);
         Map<String, String> typeMap = new LinkedHashMap<>();
         Boolean updateRedis = false;

+ 22 - 0
src/main/java/com/diagbot/util/CoreUtil.java

@@ -9,6 +9,8 @@ import com.diagbot.model.entity.Vital;
 import com.diagbot.model.label.VitalLabel;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
 
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
@@ -23,8 +25,16 @@ import java.util.Map;
  * @time: 2020/7/30 15:18
  */
 @Slf4j
+@Component
 public class CoreUtil {
 
+    public static Boolean debugFlag;
+
+    @Value("${debugFlag}")
+    public void setDebugFlag(Boolean debugFlag) {
+        CoreUtil.debugFlag = debugFlag;
+    }
+
     /**
      * 将列表中属性对应的值以list形式返回
      *
@@ -603,6 +613,18 @@ public class CoreUtil {
         debugMap.put(msg,  + (end - start) / 1000.0 + "秒");
     }
 
+    /**
+     * 输出调试信息
+     *
+     * @param msg
+     * @param debugMap
+     */
+    public static void getDebugObject(String msg, Map<String, Object> debugMap, Object obj) {
+        if (debugFlag) {
+            debugMap.put(msg, obj);
+        }
+    }
+
     /**
      * 输出调试信息
      *

+ 3 - 1
src/main/resources/application-dev.yml

@@ -153,4 +153,6 @@ ChiefPresentSimilarity:
 
 StandConvert:
   url: http://192.168.3.150:23232
-  rate: 0.9
+  rate: 0.9
+
+debugFlag: true

+ 3 - 1
src/main/resources/application-local.yml

@@ -153,4 +153,6 @@ ChiefPresentSimilarity:
 
 StandConvert:
   url: http://192.168.3.150:23232
-  rate: 0.9
+  rate: 0.9
+
+debugFlag: true

+ 3 - 1
src/main/resources/application-pre.yml

@@ -153,4 +153,6 @@ ChiefPresentSimilarity:
 
 StandConvert:
   url: http://192.168.3.150:23232
-  rate: 0.9
+  rate: 0.9
+
+debugFlag: true

+ 2 - 0
src/main/resources/application-pro.yml

@@ -156,3 +156,5 @@ ChiefPresentSimilarity:
 StandConvert:
   url: http://192.168.3.150:23232
   rate: 0.9
+
+debugFlag: true

+ 3 - 1
src/main/resources/application-test.yml

@@ -153,4 +153,6 @@ ChiefPresentSimilarity:
 
 StandConvert:
   url: http://192.168.3.150:23232
-  rate: 0.9
+  rate: 0.9
+
+debugFlag: true