Pārlūkot izejas kodu

义乌北仑规则位置修改

rengb 4 gadi atpakaļ
vecāks
revīzija
b524c3dda7

+ 21 - 6
kernel/src/main/java/com/lantone/qc/kernel/KernelApplication.java

@@ -1,15 +1,30 @@
 package com.lantone.qc.kernel;
 
+import com.lantone.qc.kernel.web.config.CustomNameGenerator;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.ComponentScan;
+
 @EnableFeignClients
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
-@ComponentScan("com.lantone.qc")
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+@ComponentScan(nameGenerator = CustomNameGenerator.class, value = {
+        "com.lantone.qc.dbanaly",
+        "com.lantone.qc.nlp",
+        "com.lantone.qc.pub",
+        "com.lantone.qc.security",
+        "com.lantone.qc.trans",
+        "com.lantone.qc.kernel.web",
+        "com.lantone.qc.kernel.util",
+        "com.lantone.qc.kernel.structure",
+        "com.lantone.qc.kernel.client",
+        "com.lantone.qc.kernel.analysis",
+        "com.lantone.qc.kernel.catalogue.beilun",
+        "com.lantone.qc.kernel.catalogue.yiwu"
+})
 public class KernelApplication {
-	public static void main(String[] args) {
-		SpringApplication.run(KernelApplication.class, args);
-	}
-}
+    public static void main(String[] args) {
+        SpringApplication.run(KernelApplication.class, args);
+    }
+}

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/analysis/QCAnalysis.java

@@ -52,10 +52,10 @@ public class QCAnalysis {
         }
         long t3 = System.currentTimeMillis();
         for (Map.Entry<String, Map<String, String>> entry : inputInfo.getInputCatalogueMap().entrySet()) {
-            if (CatalogueUtil.qcCatalogueMap.get(entry.getKey()) == null) {
+            if (CatalogueUtil.qcCatalogueMap.get(queryVo.getCid() + "." + entry.getKey()) == null) {
                 continue;
             }
-            CatalogueUtil.qcCatalogueMap.get(entry.getKey()).execute(inputInfo, outputInfo);
+            CatalogueUtil.qcCatalogueMap.get(queryVo.getCid() + "." + entry.getKey()).execute(inputInfo, outputInfo);
         }
         //        inputInfo.getInputCatalogueMap().entrySet().parallelStream().forEach(entry -> {
         //            if (CatalogueUtil.qcCatalogueMap.get(entry.getKey()) != null) {

+ 23 - 0
kernel/src/main/java/com/lantone/qc/kernel/web/config/CustomNameGenerator.java

@@ -0,0 +1,23 @@
+package com.lantone.qc.kernel.web.config;
+
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.context.annotation.AnnotationBeanNameGenerator;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/11/9 16:30
+ */
+public class CustomNameGenerator extends AnnotationBeanNameGenerator {
+
+    @Override
+    public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
+        String beanName = definition.getBeanClassName();
+        if (beanName.contains("catalogue")) {
+            return beanName;
+        }
+        return super.generateBeanName(definition, registry);
+    }
+
+}