Explorar el Código

修正项目编译错误,打包错误

louhr hace 5 años
padre
commit
2004e80b57

+ 8 - 151
kernel/pom.xml

@@ -5,12 +5,12 @@
 	<parent>
 		<groupId>org.springframework.boot</groupId>
 		<artifactId>spring-boot-starter-parent</artifactId>
-		<version>2.2.5.RELEASE</version>
+		<version>2.1.2.RELEASE</version>
 		<relativePath/> <!-- lookup parent from repository -->
 	</parent>
 	<groupId>com.lantone.qc.kernel</groupId>
 	<artifactId>kernel</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
+	<version>0.0.1</version>
 	<name>kernel</name>
 	<description>Demo project for Spring Boot</description>
 
@@ -19,18 +19,11 @@
 		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 		<java.version>1.8</java.version>
 		<druid.version>1.0.23</druid.version>
-		<mybatis.version>1.1.1</mybatis.version>
-		<mysql.version>5.1.38</mysql.version>
 		<swagger2.version>2.7.0</swagger2.version>
 		<commons-lang3.version>3.1</commons-lang3.version>
 		<commons-io.version>2.4</commons-io.version>
 		<slf4j.version>1.7.2</slf4j.version>
-		<mysql.version>5.1.38</mysql.version>
 		<logback.version>1.1.2</logback.version>
-		<jackson.version>2.6.5</jackson.version>
-		<servlet.version>3.0.1</servlet.version>
-		<jsp.version>2.2</jsp.version>
-		<jstl.version>1.2</jstl.version>
 		<standard.version>1.1.2</standard.version>
 	</properties>
 
@@ -41,6 +34,12 @@
 			<version>1.0</version>
 		</dependency>
 
+		<dependency>
+			<groupId>com.lantone.qc</groupId>
+			<artifactId>security</artifactId>
+			<version>1.0</version>
+		</dependency>
+
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-web</artifactId>
@@ -62,24 +61,6 @@
 			<artifactId>spring-boot-starter-logging</artifactId>
 		</dependency>
 
-		<!-- 分页插件 -->
-		<dependency>
-			<groupId>com.github.pagehelper</groupId>
-			<artifactId>pagehelper-spring-boot-starter</artifactId>
-			<version>1.2.5</version>
-		</dependency>
-
-		<dependency>
-			<groupId>mysql</groupId>
-			<artifactId>mysql-connector-java</artifactId>
-			<version>${mysql.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.alibaba</groupId>
-			<artifactId>druid</artifactId>
-			<version>${druid.version}</version>
-		</dependency>
-
 		<dependency>
 			<groupId>io.springfox</groupId>
 			<artifactId>springfox-swagger2</artifactId>
@@ -90,130 +71,6 @@
 			<artifactId>springfox-swagger-ui</artifactId>
 			<version>${swagger2.version}</version>
 		</dependency>
-
-		<dependency>
-			<groupId>org.projectlombok</groupId>
-			<artifactId>lombok</artifactId>
-			<optional>true</optional>
-		</dependency>
-
-		<!-- Jackson JSON Mapper -->
-		<dependency>
-			<groupId>org.codehaus.jackson</groupId>
-			<artifactId>jackson-mapper-asl</artifactId>
-			<version>1.9.13</version>
-		</dependency>
-		<dependency>
-			<groupId>com.fasterxml.jackson.core</groupId>
-			<artifactId>jackson-databind</artifactId>
-			<version>${jackson.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.fasterxml.jackson.module</groupId>
-			<artifactId>jackson-module-jaxb-annotations</artifactId>
-			<version>${jackson.version}</version>
-		</dependency>
-
-		<!-- AOP begin -->
-		<dependency>
-			<groupId>org.aspectj</groupId>
-			<artifactId>aspectjrt</artifactId>
-			<version>1.7.1</version>
-		</dependency>
-		<dependency>
-			<groupId>org.aspectj</groupId>
-			<artifactId>aspectjweaver</artifactId>
-			<version>1.7.1</version>
-		</dependency>
-		<dependency>
-			<groupId>cglib</groupId>
-			<artifactId>cglib</artifactId>
-			<version>2.2.2</version>
-			<scope>runtime</scope>
-		</dependency>
-		<dependency>
-			<groupId>asm</groupId>
-			<artifactId>asm</artifactId>
-			<version>3.3.1</version>
-			<scope>runtime</scope>
-		</dependency>
-		<!-- AOP end -->
-
-		<!-- LOGGING begin -->
-		<!-- 代码直接调用commons-logging会被桥接到slf4j -->
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>jcl-over-slf4j</artifactId>
-			<version>${slf4j.version}</version>
-		</dependency>
-
-		<!-- 代码直接调用java.util.logging会被桥接到slf4j -->
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>jul-to-slf4j</artifactId>
-			<version>${slf4j.version}</version>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.httpcomponents</groupId>
-			<artifactId>httpclient</artifactId>
-			<version>4.3.6</version>
-		</dependency>
-		<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient-cache -->
-		<dependency>
-			<groupId>org.apache.httpcomponents</groupId>
-			<artifactId>httpclient-cache</artifactId>
-			<version>4.3.6</version>
-		</dependency>
-		<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
-		<dependency>
-			<groupId>org.apache.httpcomponents</groupId>
-			<artifactId>httpcore</artifactId>
-			<version>4.3.3</version>
-		</dependency>
-
-		<!-- 文件上传相关�?? -->
-		<dependency>
-			<groupId>commons-beanutils</groupId>
-			<artifactId>commons-beanutils</artifactId>
-			<version>1.9.3</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.commons</groupId>
-			<artifactId>commons-lang3</artifactId>
-			<version>${commons-lang3.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>commons-fileupload</groupId>
-			<artifactId>commons-fileupload</artifactId>
-			<version>1.3.1</version>
-		</dependency>
-		<dependency>
-			<groupId>commons-io</groupId>
-			<artifactId>commons-io</artifactId>
-			<version>2.4</version>
-		</dependency>
-		<!-- 代码生成相关 -->
-		<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
-		<dependency>
-			<groupId>org.projectlombok</groupId>
-			<artifactId>lombok</artifactId>
-			<version>1.16.16</version>
-		</dependency>
-
-		<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
-		<dependency>
-			<groupId>com.alibaba</groupId>
-			<artifactId>fastjson</artifactId>
-			<version>1.2.46</version>
-		</dependency>
-
-		<!-- https://mvnrepository.com/artifact/org.mongodb/bson -->
-		<dependency>
-			<groupId>org.mongodb</groupId>
-			<artifactId>bson</artifactId>
-			<version>3.10.1</version>
-		</dependency>
 	</dependencies>
 
 	<build>

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/config/SwaggerConfigurer.java

@@ -1,4 +1,4 @@
-package com.lantone.qc.kernel.config;
+package com.lantone.qc.kernel.web.config;
 
 
 import org.springframework.context.annotation.Bean;

+ 5 - 5
kernel/src/main/java/com/lantone/qc/kernel/web/controller/MrqcTokenController.java

@@ -1,11 +1,11 @@
 package com.lantone.qc.kernel.web.controller;
 
 
-import com.lantone.aop.Security;
-import com.lantone.dto.RespDTO;
-import com.lantone.facade.TokenFacade;
-import com.lantone.vo.LoginKeyVO;
-import com.lantone.vo.TokenVO;
+import com.lantone.qc.pub.model.vo.LoginKeyVO;
+import com.lantone.qc.pub.model.vo.TokenVO;
+import com.lantone.qc.security.aop.Security;
+import com.lantone.qc.security.dto.RespDTO;
+import com.lantone.qc.security.facade.TokenFacade;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;

+ 3 - 22
kernel/src/main/java/com/lantone/qc/kernel/web/controller/QCController.java

@@ -1,14 +1,14 @@
 package com.lantone.qc.kernel.web.controller;
 
+import com.lantone.qc.pub.model.vo.QueryVo;
+import com.lantone.qc.pub.res.Response;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.xml.ws.Response;
 import java.util.Map;
 
 /**
@@ -21,30 +21,11 @@ import java.util.Map;
 @RestController
 @RequestMapping(value = "analyse")
 public class QCController {
-    @Autowired
-    private QcRuleFacade qcRuleFacade;
-
 
     @ApiOperation(value = "质控外部接口,需要token信息", notes = "")
     @PostMapping("rec")
-    @Security
     public Response<Map<String, Object>> extract(@RequestBody QueryVo queryVo) {
-
-
-        Rule rules = new Rule();
-        Response response = qcRuleFacade.parseDocu(queryVo, rules);
-
-        return response;
-    }
-
-
-    @ApiOperation(value = "质控内部接口,不需要token信息", notes = "")
-    @PostMapping("recInner")
-    public Response<Map<String, Object>> extractInner(@RequestBody QueryVo queryVo) {
-
-        Rule rules = new Rule();
-        Response response = qcRuleFacade.parseDocu(queryVo, rules);
-
+        Response response = new Response();
         return response;
     }
 }

+ 0 - 26
pom.xml

@@ -34,25 +34,6 @@
     </properties>
 
     <dependencies>
-        <!-- database -->
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>${mysql.version}</version>
-        </dependency>
-
-        <!-- 分页插件 -->
-        <dependency>
-            <groupId>com.github.pagehelper</groupId>
-            <artifactId>pagehelper</artifactId>
-            <version>5.1.4</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid</artifactId>
-            <version>1.0.23</version>
-        </dependency>
         <!-- spring 相关jar�?? -->
         <dependency>
             <groupId>org.springframework</groupId>
@@ -237,13 +218,6 @@
             <artifactId>fastjson</artifactId>
             <version>1.2.46</version>
         </dependency>
-
-        <!-- https://mvnrepository.com/artifact/org.mongodb/bson -->
-        <dependency>
-            <groupId>org.mongodb</groupId>
-            <artifactId>bson</artifactId>
-            <version>3.10.1</version>
-        </dependency>
     </dependencies>
 
     <!-- .properties xml进行打包 -->

+ 13 - 49
public/pom.xml

@@ -17,62 +17,26 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <maven.compiler.source>1.7</maven.compiler.source>
-        <maven.compiler.target>1.7</maven.compiler.target>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
     </properties>
 
     <dependencies>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.11</version>
-            <scope>test</scope>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>2.8.6</version>
+            <!--<scope>provided</scope>-->
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.collections</groupId>
+            <artifactId>google-collections</artifactId>
+            <version>1.0</version>
         </dependency>
     </dependencies>
 
     <build>
-        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
-            <plugins>
-                <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
-                <plugin>
-                    <artifactId>maven-clean-plugin</artifactId>
-                    <version>3.1.0</version>
-                </plugin>
-                <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
-                <plugin>
-                    <artifactId>maven-resources-plugin</artifactId>
-                    <version>3.0.2</version>
-                </plugin>
-                <plugin>
-                    <artifactId>maven-compiler-plugin</artifactId>
-                    <version>3.8.0</version>
-                </plugin>
-                <plugin>
-                    <artifactId>maven-surefire-plugin</artifactId>
-                    <version>2.22.1</version>
-                </plugin>
-                <plugin>
-                    <artifactId>maven-jar-plugin</artifactId>
-                    <version>3.0.2</version>
-                </plugin>
-                <plugin>
-                    <artifactId>maven-install-plugin</artifactId>
-                    <version>2.5.2</version>
-                </plugin>
-                <plugin>
-                    <artifactId>maven-deploy-plugin</artifactId>
-                    <version>2.8.2</version>
-                </plugin>
-                <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
-                <plugin>
-                    <artifactId>maven-site-plugin</artifactId>
-                    <version>3.7.1</version>
-                </plugin>
-                <plugin>
-                    <artifactId>maven-project-info-reports-plugin</artifactId>
-                    <version>3.0.0</version>
-                </plugin>
-            </plugins>
-        </pluginManagement>
+        <finalName>public</finalName>
     </build>
 </project>

+ 100 - 0
public/src/main/java/com/lantone/qc/pub/util/GsonUtil.java

@@ -0,0 +1,100 @@
+package com.lantone.qc.pub.util;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 基于com.google.code.gson封装的json转换工具类 (少量数据用)
+ * @author: gaodm
+ * @time: 2018/9/4 11:48
+ */
+public class GsonUtil {
+    private static Gson gson = null;
+
+    static {
+        if (gson == null) {
+            gson = new Gson();
+        }
+    }
+
+    private GsonUtil() {
+    }
+
+    /**
+     * 对象转成json
+     *
+     * @param object
+     * @return json
+     */
+    public static String toJson(Object object) {
+        String gsonString = null;
+        if (gson != null) {
+            gsonString = gson.toJson(object);
+        }
+        return gsonString;
+    }
+
+    /**
+     * Json转成对象
+     *
+     * @param gsonString
+     * @param cls
+     * @return 对象
+     */
+    public static <T> T toObject(String gsonString, Class<T> cls) {
+        T t = null;
+        if (gson != null) {
+            t = gson.fromJson(gsonString, cls);
+        }
+        return t;
+    }
+
+    /**
+     * json转成list<T>
+     *
+     * @param gsonString
+     * @param cls
+     * @return list<T>
+     */
+    public static <T> List<T> toList(String gsonString, Class<T> cls) {
+        List<T> list = null;
+        if (gson != null) {
+            list = gson.fromJson(gsonString, new TypeToken<List<T>>() {
+            }.getType());
+        }
+        return list;
+    }
+
+    /**
+     * json转成list中有map的
+     *
+     * @param gsonString
+     * @return List<Map < String ,   T>>
+     */
+    public static <T> List<Map<String, T>> toListMaps(String gsonString) {
+        List<Map<String, T>> list = null;
+        if (gson != null) {
+            list = gson.fromJson(gsonString, new TypeToken<List<Map<String, T>>>() {
+            }.getType());
+        }
+        return list;
+    }
+
+    /**
+     * json转成map的
+     *
+     * @param gsonString
+     * @return Map<String ,   T>
+     */
+    public static <T> Map<String, T> gsonToMaps(String gsonString) {
+        Map<String, T> map = null;
+        if (gson != null) {
+            map = gson.fromJson(gsonString, new TypeToken<Map<String, T>>() {
+            }.getType());
+        }
+        return map;
+    }
+}

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/util/ListUtil.java

@@ -1,4 +1,4 @@
-package com.lantone.qc.kernel.util;
+package com.lantone.qc.pub.util;
 
 import java.util.ArrayList;
 import java.util.Collections;

+ 5 - 4
kernel/src/main/java/com/lantone/qc/kernel/util/StringUtil.java

@@ -1,11 +1,12 @@
-package com.lantone.qc.kernel.util;
+package com.lantone.qc.pub.util;
 
 import com.google.common.collect.Sets;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.time.DateUtils;
 
-import java.text.ParseException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
 
 /**
  * @Description: 字符串有关帮助类 封装了第三方帮助类

+ 2 - 17
security/pom.xml

@@ -31,26 +31,11 @@
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.mybatis.spring.boot</groupId>
-            <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>1.3.2</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-logging</artifactId>
+            <version>2.1.2.RELEASE</version>
         </dependency>
     </dependencies>
 
     <build>
-        
+
     </build>
 </project>

+ 38 - 0
security/src/main/java/com/lantone/qc/security/dto/RespDTO.java

@@ -0,0 +1,38 @@
+package com.lantone.qc.security.dto;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 通用返回格式
+ * @author: gaodm
+ * @time: 2018/8/1 14:55
+ */
+public class RespDTO<T> implements Serializable {
+
+
+    public String code = "0";
+    public String msg = "";
+    public T data;
+
+    public static RespDTO onSuc(Object data) {
+        RespDTO resp = new RespDTO();
+        resp.data = data;
+        return resp;
+    }
+
+    public static RespDTO onError(String errMsg) {
+        RespDTO resp = new RespDTO();
+        resp.code = "-1";
+        resp.msg = errMsg;
+        return resp;
+    }
+
+    @Override
+    public String toString() {
+        return "RespDTO{" +
+                "code=" + code +
+                ", error='" + msg + '\'' +
+                ", data=" + data +
+                '}';
+    }
+}

+ 2 - 2
security/src/main/java/com/lantone/qc/security/exception/CommonExceptionHandler.java

@@ -1,7 +1,7 @@
 package com.lantone.qc.security.exception;
 
-import com.lantone.dto.RespDTO;
-import com.lantone.util.GsonUtil;
+import com.lantone.qc.pub.util.GsonUtil;
+import com.lantone.qc.security.dto.RespDTO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;

+ 0 - 96
security/src/main/java/com/lantone/qc/security/facade/QcRuleFacade.java

@@ -1,96 +0,0 @@
-package com.lantone.qc.security.facade;
-
-
-import com.lantone.analysis.Content;
-import com.lantone.analysis.StructureAnalyze;
-import com.lantone.client.CRFServiceClient;
-import com.lantone.client.GDBServiceClient;
-import com.lantone.pub.Response;
-import com.lantone.qcrule.Rule;
-import com.lantone.qcrule.RuleInfo;
-import com.lantone.util.DictUtil;
-import com.lantone.vo.MedrecVo;
-import com.lantone.vo.QueryVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-//import com.lantone.service.impl.QcRuleServiceImpl;
-
-
-@Component
-public class QcRuleFacade /*extends QcRuleServiceImpl*/ {
-
-    @Autowired
-    GDBServiceClient gdbServiceClient;
-
-    @Autowired
-    CRFServiceClient crfServiceClient;
-
-
-
-    public QcRuleFacade() {
-        DictUtil.LoadDict();
-    }
-
-    public Response<Map<String, Object>> parseDocu(QueryVo queryVo, Rule rules) {
-
-        Response response = new Response();
-        int cid = queryVo.getCid();
-
-        StructureAnalyze structureAnalyze = new StructureAnalyze(gdbServiceClient, crfServiceClient);
-        rules.setGDBSvc(gdbServiceClient);
-
-        List<MedrecVo> medrecVos = preprocess(queryVo.getMedrec(), queryVo.getCid());
-        structureAnalyze.parseContent(cid, medrecVos, rules);
-
-
-        Map<String, Object> res = new HashMap<>();
-
-        res.put(Rule.warntitle, rules.getRules());
-        // 针对ICSS提供的告警信息
-        if (queryVo.getCid()==0) {
-            List<String> warning = new ArrayList<>();
-            Map<String, List<String>> warns = rules.getRules().get(Content.docname[1]);
-            if (null != warns) {
-                for (String key : warns.keySet()) {
-                    if (key.equals(RuleInfo.pre_diag)) {
-                        warning.add(RuleInfo.diag + ": " + String.join(",", warns.get(key)));
-                    } else {
-                        warning.add(key + ": " + String.join(", ", warns.get(key)));
-                    }
-                }
-                res.put(Rule.warntitle, warning);
-            }
-        }
-        // 诊断其它系统的告警信息
-        else {
-            res.put(Rule.warntitle, rules.getRules());
-        }
-
-        res.put(Content.title, rules.getContent());
-
-        response.setData(res);
-
-        return response;
-    }
-
-    private List<MedrecVo> preprocess(List<MedrecVo> medrecVos, int cid) {
-        if (cid==0) {
-            MedrecVo medrecVo = medrecVos.get(0);
-            List<String> lbl = medrecVo.getLabel();
-            String content = medrecVo.getContent().get(Content.label).toString();
-
-            if (lbl.indexOf(RuleInfo.diag)>=0) {
-                content = content.replace(RuleInfo.diag, RuleInfo.pre_diag);
-                medrecVo.getContent().put(Content.label, content);
-                lbl.set(lbl.indexOf(RuleInfo.diag), RuleInfo.pre_diag);
-            }
-        }
-        return medrecVos;
-    }
-}

+ 6 - 6
security/src/main/java/com/lantone/qc/security/facade/TokenFacade.java

@@ -1,11 +1,11 @@
 package com.lantone.qc.security.facade;
 
-import com.lantone.exception.CommonErrorCode;
-import com.lantone.exception.CommonException;
-import com.lantone.util.RSAEncrypt;
-import com.lantone.util.StringUtil;
-import com.lantone.util.TokenUtil;
-import com.lantone.vo.LoginKeyVO;
+import com.lantone.qc.pub.model.vo.LoginKeyVO;
+import com.lantone.qc.pub.util.StringUtil;
+import com.lantone.qc.security.exception.CommonErrorCode;
+import com.lantone.qc.security.exception.CommonException;
+import com.lantone.qc.security.util.RSAEncrypt;
+import com.lantone.qc.security.util.TokenUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;