Jelajahi Sumber

Merge remote-tracking branch 'origin/dev/one' into dev/one

wangyu 6 tahun lalu
induk
melakukan
4ae07547f8
52 mengubah file dengan 217 tambahan dan 366 penghapusan
  1. 0 6
      admin-service/pom.xml
  2. 0 11
      bi-service/pom.xml
  3. 1 10
      config-server/pom.xml
  4. 0 7
      config-server/src/main/resources/application.yml
  5. 0 7
      config-server/src/main/resources/shared/application-dev.yml
  6. 0 7
      config-server/src/main/resources/shared/application-local.yml
  7. 0 11
      config-server/src/main/resources/shared/bi-service-dev.yml
  8. 0 11
      config-server/src/main/resources/shared/bi-service-local.yml
  9. 0 11
      config-server/src/main/resources/shared/diagbotman-service-dev.yml
  10. 0 11
      config-server/src/main/resources/shared/diagbotman-service-local.yml
  11. 0 11
      config-server/src/main/resources/shared/feedback-service-dev.yml
  12. 0 11
      config-server/src/main/resources/shared/feedback-service-local.yml
  13. 0 11
      config-server/src/main/resources/shared/knowledge-service-dev.yml
  14. 0 11
      config-server/src/main/resources/shared/knowledge-service-local.yml
  15. 0 12
      config-server/src/main/resources/shared/logger-service-dev.yml
  16. 0 12
      config-server/src/main/resources/shared/logger-service-local.yml
  17. 0 11
      config-server/src/main/resources/shared/uaa-service-dev.yml
  18. 0 11
      config-server/src/main/resources/shared/uaa-service-local.yml
  19. 0 12
      config-server/src/main/resources/shared/user-service-dev.yml
  20. 0 17
      config-server/src/main/resources/shared/user-service-local.yml
  21. 0 11
      diagbotman-service/pom.xml
  22. 7 2
      diagbotman-service/src/main/java/com/diagbot/dto/AuthDetailDTO.java
  23. 10 0
      diagbotman-service/src/main/java/com/diagbot/dto/GetConsoleOnTrialDTO.java
  24. 16 1
      diagbotman-service/src/main/java/com/diagbot/dto/GetConsoleOpenedDTO.java
  25. 14 1
      diagbotman-service/src/main/java/com/diagbot/facade/OpenedProductsFacade.java
  26. 11 2
      diagbotman-service/src/main/java/com/diagbot/facade/ProductOrderFacade.java
  27. 11 10
      diagbotman-service/src/main/java/com/diagbot/facade/ProductServiceFacade.java
  28. 45 1
      diagbotman-service/src/main/java/com/diagbot/facade/ServiceInfoFacade.java
  29. 4 4
      diagbotman-service/src/main/java/com/diagbot/facade/ServiceTokenFacade.java
  30. 2 2
      diagbotman-service/src/main/java/com/diagbot/mapper/ProductServiceMapper.java
  31. 2 2
      diagbotman-service/src/main/java/com/diagbot/service/ProductServiceService.java
  32. 3 3
      diagbotman-service/src/main/java/com/diagbot/service/impl/ProductServiceServiceImpl.java
  33. 4 3
      diagbotman-service/src/main/java/com/diagbot/vo/ProductServiceSaveVO.java
  34. 2 2
      diagbotman-service/src/main/java/com/diagbot/web/ProductServiceController.java
  35. 18 0
      diagbotman-service/src/main/java/com/diagbot/web/ServiceInfoController.java
  36. 3 2
      diagbotman-service/src/main/resources/mapper/OpenedProductsMapper.xml
  37. 1 1
      diagbotman-service/src/main/resources/mapper/ProductOrderMapper.xml
  38. 15 5
      diagbotman-service/src/main/resources/mapper/ProductServiceMapper.xml
  39. 0 6
      eureka-server/pom.xml
  40. 0 7
      eureka-server/src/main/resources/bootstrap.yml
  41. 0 12
      feedback-service/pom.xml
  42. 0 7
      gateway-service/pom.xml
  43. 0 13
      knowledge-service/pom.xml
  44. 0 7
      monitor-service/pom.xml
  45. 0 11
      uaa-service/pom.xml
  46. 5 9
      uaa-service/src/main/resources/mapper/PermissionMapper.xml
  47. 0 11
      user-service/pom.xml
  48. 4 3
      user-service/src/main/java/com/diagbot/facade/PermissionFacade.java
  49. 9 6
      user-service/src/main/java/com/diagbot/facade/UserAuthenticationFacade.java
  50. 24 2
      user-service/src/main/java/com/diagbot/facade/UserFacade.java
  51. 1 1
      user-service/src/main/resources/mapper/MenuMapper.xml
  52. 5 8
      user-service/src/main/resources/mapper/PermissionMapper.xml

+ 0 - 6
admin-service/pom.xml

@@ -83,12 +83,6 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
     </dependencies>
 
     <build>

+ 0 - 11
bi-service/pom.xml

@@ -95,10 +95,6 @@
             <artifactId>mysql-connector-java</artifactId>
             <scope>runtime</scope>
         </dependency>
-        <!--<dependency>-->
-        <!--<groupId>org.springframework.boot</groupId>-->
-        <!--<artifactId>spring-boot-starter-data-jpa</artifactId>-->
-        <!--</dependency>-->
 
         <!--security-->
         <dependency>
@@ -128,13 +124,6 @@
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
 
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
-
         <!-- mybatis-plus begin -->
         <dependency>
             <groupId>com.baomidou</groupId>

+ 1 - 10
config-server/pom.xml

@@ -42,16 +42,7 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-actuator</artifactId>
         </dependency>
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.cloud</groupId>-->
-            <!--<artifactId>spring-cloud-starter-bus-amqp</artifactId>-->
-        <!--</dependency>-->
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
+
         <dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>

+ 0 - 7
config-server/src/main/resources/application.yml

@@ -30,13 +30,6 @@ spring:
 #    password: guest
 #    publisher-confirms: true
 #    virtual-host: /
-#  #热部署设置
-#  thymeleaf:
-#    cache: true #关闭缓存,及时刷新
-#    devtools:
-#      restart:
-#        enabled: true #热部署生效
-#        additional-paths: src/main/java #设置重启的目录,添加那个目录的文件需要restart(监听目录)
 
 # port
 server:

+ 0 - 7
config-server/src/main/resources/shared/application-dev.yml

@@ -55,13 +55,6 @@ spring:
       enabled: true
       trace:
         enabled: true
-#  #热部署设置
-#  thymeleaf:
-#    cache: true #关闭缓存,及时刷新
-#    devtools:
-#      restart:
-#        enabled: true #热部署生效
-#        additional-paths: src/main/java #设置重启的目录,添加那个目录的文件需要restart(监听目录)
 
 swagger:
   enable: true

+ 0 - 7
config-server/src/main/resources/shared/application-local.yml

@@ -55,13 +55,6 @@ spring:
       enabled: true
       trace:
         enabled: true
-#  #热部署设置
-#  thymeleaf:
-#    cache: true #关闭缓存,及时刷新
-#    devtools:
-#      restart:
-#        enabled: true #热部署生效
-#        additional-paths: src/main/java #设置重启的目录,添加那个目录的文件需要restart(监听目录)
 
 swagger:
   enable: true

+ 0 - 11
config-server/src/main/resources/shared/bi-service-dev.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 server:
   port: 8841
 

+ 0 - 11
config-server/src/main/resources/shared/bi-service-local.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 server:
   port: 8841
 

+ 0 - 11
config-server/src/main/resources/shared/diagbotman-service-dev.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 server:
   port: 8811
 

+ 0 - 11
config-server/src/main/resources/shared/diagbotman-service-local.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 server:
   port: 8811
 

+ 0 - 11
config-server/src/main/resources/shared/feedback-service-dev.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 server:
   port: 8831
 

+ 0 - 11
config-server/src/main/resources/shared/feedback-service-local.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 server:
   port: 8831
 

+ 0 - 11
config-server/src/main/resources/shared/knowledge-service-dev.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 server:
   port: 8821
 

+ 0 - 11
config-server/src/main/resources/shared/knowledge-service-local.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 server:
   port: 8821
 

+ 0 - 12
config-server/src/main/resources/shared/logger-service-dev.yml

@@ -1,15 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
-
 server:
   port: 9997
 

+ 0 - 12
config-server/src/main/resources/shared/logger-service-local.yml

@@ -1,15 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
-
 server:
   port: 9997
 

+ 0 - 11
config-server/src/main/resources/shared/uaa-service-dev.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 # 驱动配置信息
 spring:
   datasource:

+ 0 - 11
config-server/src/main/resources/shared/uaa-service-local.yml

@@ -1,14 +1,3 @@
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 # 驱动配置信息
 spring:
   datasource:

+ 0 - 12
config-server/src/main/resources/shared/user-service-dev.yml

@@ -1,18 +1,6 @@
 server:
   port: 8762
 
-
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 # 驱动配置信息
 spring:
   datasource:

+ 0 - 17
config-server/src/main/resources/shared/user-service-local.yml

@@ -1,18 +1,6 @@
 server:
   port: 8762
 
-
-#spring:
-#  datasource:
-#    driver-class-name: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-#    username: root
-#    password: root
-#  jpa:
-#    hibernate:
-#      ddl-auto: update
-#    show-sql: true
-
 # 驱动配置信息
 spring:
   datasource:
@@ -122,9 +110,4 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
-##logging
-#logging:
-#  level.com.diagbot: debug
-#  file: "logs/user-service-local.log"
-
 foo: foo version 1

+ 0 - 11
diagbotman-service/pom.xml

@@ -95,10 +95,6 @@
             <artifactId>mysql-connector-java</artifactId>
             <scope>runtime</scope>
         </dependency>
-        <!--<dependency>-->
-        <!--<groupId>org.springframework.boot</groupId>-->
-        <!--<artifactId>spring-boot-starter-data-jpa</artifactId>-->
-        <!--</dependency>-->
 
         <!--security-->
         <dependency>
@@ -128,13 +124,6 @@
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
 
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
-
         <!-- mybatis-plus begin -->
         <dependency>
             <groupId>com.baomidou</groupId>

+ 7 - 2
diagbotman-service/src/main/java/com/diagbot/dto/AuthDetailDTO.java

@@ -25,9 +25,14 @@ public class AuthDetailDTO implements Serializable {
     private String name;
 
     /**
-     * 是否通过审核,N:未通过,Y:已通过
+     * 是否通过审核,0.不通过1.通过2.待审核
      */
-    private String auditStatus;
+    private Integer auditStatus;
+    
+    /**
+     * 审核信息
+     */
+    private String auditStatusMsg;
 
     /**
      * 不通过原因

+ 10 - 0
diagbotman-service/src/main/java/com/diagbot/dto/GetConsoleOnTrialDTO.java

@@ -28,6 +28,11 @@ public class GetConsoleOnTrialDTO implements Serializable {
      * 接入模式
      */
     private String accessType;
+    
+    /**
+     * 接入模式信息
+     */
+    private String accessTypeMsg;
 
     /**
      * 是否已试用
@@ -48,4 +53,9 @@ public class GetConsoleOnTrialDTO implements Serializable {
      * 到期时间
      */
     private String expiringDate;
+    
+    /**
+     * 剩余时间
+     */
+    private String surplusTime;
 }

+ 16 - 1
diagbotman-service/src/main/java/com/diagbot/dto/GetConsoleOpenedDTO.java

@@ -43,6 +43,21 @@ public class GetConsoleOpenedDTO implements Serializable {
      * 当前用户的产品停用状态
      */
     private Integer serviceStatus;
+    
+    /**
+     * 当前用户产品停用状态信息
+     */
+    private String serviceStatusMsg;
 
 
-}
+    /**
+     * 接入方式(1:嵌入式,2:接口方式,3:online)
+     */
+    private String accessType;
+    
+    /**
+     * 接入方式信息
+     */
+    private String accessTypeMsg;
+    
+}

+ 14 - 1
diagbotman-service/src/main/java/com/diagbot/facade/OpenedProductsFacade.java

@@ -21,6 +21,8 @@ import com.diagbot.dto.UserAndProdutDTO;
 import com.diagbot.entity.OpenedProducts;
 import com.diagbot.entity.ProductService;
 import com.diagbot.entity.ServiceInfo;
+import com.diagbot.enums.AccessTypeEnum;
+import com.diagbot.enums.StatusEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.OpenedProductsServiceImpl;
@@ -54,7 +56,18 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
      */
     public List<GetConsoleOpenedDTO> getConsoleOpened() {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
-        return baseMapper.getConsoleOpened(userId);
+        
+        List<GetConsoleOpenedDTO> retList = baseMapper.getConsoleOpened(userId);
+        for(GetConsoleOpenedDTO i : retList){
+        	String accessTypeMsg = "";
+        	for(String j:i.getAccessType().split(",")){
+        		accessTypeMsg+=AccessTypeEnum.getName(Integer.parseInt(j))+" ";
+        	}
+        	i.setAccessTypeMsg(accessTypeMsg);
+        	i.setServiceStatusMsg(StatusEnum.getName(i.getServiceStatus()));
+        }
+        
+        return retList;
     }
 
     /**

+ 11 - 2
diagbotman-service/src/main/java/com/diagbot/facade/ProductOrderFacade.java

@@ -70,16 +70,25 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
         for (ProductOrder i : orderList) {
             nums.add(i.getNum());
         }
+        
+        if(nums.size()==0){
+        	return retList;
+        }
+        
         List<AuthDetailDTO> detailList = baseMapper.getOrderDetailsByNums(nums);
+        List<AuthDetailDTO> products = null;
         Map<String, List<AuthDetailDTO>> detailMap = detailList.stream().collect(Collectors.groupingBy(AuthDetailDTO::getNum));
         for (String num : detailMap.keySet()) {
             ProductAuthProgressDTO productAuthProgressDTO = new ProductAuthProgressDTO();
             productAuthProgressDTO.setNum(num);
-            productAuthProgressDTO.setProducts(detailMap.get(num));
+            products = detailMap.get(num);
+            for(AuthDetailDTO i : products){
+            	i.setAuditStatusMsg(AuditStatusEnum.getName(i.getAuditStatus()));
+            }
+            productAuthProgressDTO.setProducts(products);
             retList.add(productAuthProgressDTO);
         }
 
-
         return retList;
     }
 

+ 11 - 10
diagbotman-service/src/main/java/com/diagbot/facade/ProductServiceFacade.java

@@ -11,6 +11,8 @@ import com.diagbot.entity.ProductService;
 import com.diagbot.entity.ServiceInfo;
 import com.diagbot.entity.ServiceToken;
 import com.diagbot.entity.wrapper.ProductServiceWrapper;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.StatusEnum;
 import com.diagbot.enums.TokenTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -25,7 +27,6 @@ import org.springframework.stereotype.Component;
 
 import java.util.Calendar;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -72,7 +73,7 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
         QueryWrapper<ProductService> qwps = new QueryWrapper<>();
         qwps.eq("product_id", productServiceSaveVO.getProductId());
         qwps.eq("service_id", productServiceSaveVO.getServiceId());
-        qwps.eq("is_deleted", "N");
+        qwps.eq("is_deleted", IsDeleteEnum.N.getKey());
         ProductService productService = this.getOne(qwps);
         if (productService == null) {
             productService = new ProductService();
@@ -103,7 +104,7 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
         serviceToken.setType(productServiceSaveVO.getType());
         serviceToken.setAppKeyId(GuidUtil.App_key());
         serviceToken.setAppKeySecret(GuidUtil.App_screct());
-        serviceToken.setStatus(1);
+        serviceToken.setStatus(StatusEnum.Enable.getKey());
         if (old_serviceToken != null && old_serviceToken.getType().equals(TokenTypeEnum.Trial.getKey())) {
             //如果试用已过期,不允许再生成
             if (calendar.after(old_serviceToken.getExpiringDate())) {
@@ -133,7 +134,7 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
         QueryWrapper<ProductService> qwps = new QueryWrapper<>();
         qwps.eq("product_id", productServiceSaveVO.getProductId());
         qwps.eq("service_id", productServiceSaveVO.getServiceId());
-        qwps.eq("is_deleted", "N");
+        qwps.eq("is_deleted", IsDeleteEnum.N.getKey());
         ProductService productService = this.getOne(qwps);
         if (productService == null) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS,
@@ -160,30 +161,30 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         //当前登录用户服务端列表
         QueryWrapper<ServiceInfo> qwService = new QueryWrapper<>();
-        qwService.eq("is_deleted", "N");
+        qwService.eq("is_deleted", IsDeleteEnum.N.getKey());
         qwService.eq("user_id", userId);
         List<ServiceInfo> serviceInfoList = serviceInfoFacade.list(qwService);
         Map<Long, ServiceInfo> serviceData = EntityUtil.makeEntityMap(serviceInfoList, "id");
         //服务令牌列表
         QueryWrapper<ServiceToken> qwToken = new QueryWrapper<>();
-        qwToken.eq("is_deleted", "N");
+        qwToken.eq("is_deleted", IsDeleteEnum.N.getKey());
         List<ServiceToken> serviceTokenList = serviceTokenFacade.list(qwToken);
         Map<Long, ServiceToken> tokenData = EntityUtil.makeEntityMap(serviceTokenList, "productServiceId");
         //产品列表
         QueryWrapper<LantoneProduct> qwProduct = new QueryWrapper<>();
-        qwProduct.eq("is_deleted", "N");
+        qwProduct.eq("is_deleted", IsDeleteEnum.N.getKey());
         List<LantoneProduct> lantoneProductList = lantoneProductFacade.list(qwProduct);
         Map<Long, LantoneProduct> lantoneProductData = EntityUtil.makeEntityMap(lantoneProductList, "id");
         //当前用户开通的产品列表
         QueryWrapper<OpenedProducts> qwOpenedProducts = new QueryWrapper<>();
-        qwOpenedProducts.eq("is_deleted", "N");
+        qwOpenedProducts.eq("is_deleted", IsDeleteEnum.N.getKey());
         qwOpenedProducts.eq("user_id", userId);
         List<OpenedProducts> openedProductsList = openedProductsFacade.list(qwOpenedProducts);
         Map<Long, OpenedProducts> openedProductData = EntityUtil.makeEntityMap(openedProductsList, "productId");
 
         ProductServiceWrapper productServiceVO = new ProductServiceWrapper();
         productServiceVO.setUserId(userId);
-        IPage<ProductServiceWrapper> psPage = this.selectProductServiceByUserIdPage(page, productServiceVO);
+        IPage<ProductServiceWrapper> psPage = this.selectProductServicePage(page, productServiceVO);
         List<ProductServiceWrapper> psList = psPage.getRecords();
         for (ProductServiceWrapper productService : psList) {
             productService.setLantoneProduct(lantoneProductData.get(productService.getProductId()));
@@ -194,4 +195,4 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
         psPage.setRecords(psList);
         return psPage;
     }
-}
+}

+ 45 - 1
diagbotman-service/src/main/java/com/diagbot/facade/ServiceInfoFacade.java

@@ -1,15 +1,19 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.entity.ProductService;
 import com.diagbot.entity.ServiceInfo;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.ServiceTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.ServiceInfoServiceImpl;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.ServiceSaveVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
@@ -22,6 +26,9 @@ import java.util.List;
  */
 @Component
 public class ServiceInfoFacade extends ServiceInfoServiceImpl {
+    @Autowired
+    private ProductServiceFacade productServiceFacade;
+
     /**
      * 新建服务端
      *
@@ -30,7 +37,14 @@ public class ServiceInfoFacade extends ServiceInfoServiceImpl {
      */
     public ServiceInfo createService(ServiceSaveVO serviceSaveVO) {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
-        ServiceInfo serviceInfo = new ServiceInfo();
+        QueryWrapper<ServiceInfo> qw = new QueryWrapper<>();
+        qw.eq("name", serviceSaveVO.getName());
+        qw.eq("is_deleted", IsDeleteEnum.N.getKey());
+        ServiceInfo serviceInfo = this.getOne(qw);
+        if (serviceInfo != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS,
+                    "服务端【" + serviceSaveVO.getName() + "】已存在,不允许重复建立");
+        }
         serviceInfo.setName(serviceSaveVO.getName());
         serviceInfo.setDescription(serviceSaveVO.getDescription());
         serviceInfo.setType(serviceSaveVO.getType());
@@ -59,6 +73,35 @@ public class ServiceInfoFacade extends ServiceInfoServiceImpl {
         return this.updateById(serviceInfo);
     }
 
+    /**
+     * 删除服务端
+     * 删除之前判断是否有产品关联,如果有,不允许删除
+     *
+     * @param serviceId
+     * @return
+     */
+    public Boolean delService(Long serviceId) {
+        Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
+        ServiceInfo serviceInfo = this.getById(serviceId);
+        if (serviceInfo == null) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "服务端不存在");
+        } else if (userId != serviceInfo.getUserId()) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                    "服务端【" + serviceInfo.getName() + "】关联用户与当前登录用户不匹配,不允许删除");
+        }
+        QueryWrapper<ProductService> qwps = new QueryWrapper<>();
+        qwps.eq("is_deleted", IsDeleteEnum.N.getKey());
+        qwps.eq("service_id", serviceId);
+        List<ProductService> psList = productServiceFacade.list(qwps);
+        if (psList.size() > 0) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                    "该服务端正在使用,不允许删除,请先删除关联产品!");
+        }
+        serviceInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
+        this.updateById(serviceInfo);
+        return true;
+    }
+
     /**
      * 获取当前登录用户服务列表
      *
@@ -90,6 +133,7 @@ public class ServiceInfoFacade extends ServiceInfoServiceImpl {
         qw.eq("is_deleted", "N");
         qw.eq("type", ServiceTypeEnum.User_Create.getKey());
         qw.eq("user_id", userId);
+        qw.orderByDesc("gmt_create");
         IPage<ServiceInfo> pagelist = this.page(page, qw);
         return pagelist;
     }

+ 4 - 4
diagbotman-service/src/main/java/com/diagbot/facade/ServiceTokenFacade.java

@@ -101,7 +101,7 @@ public class ServiceTokenFacade extends ServiceTokenServiceImpl {
      */
     public ServiceToken getByProductServiceId(Long productServiceId) {
         QueryWrapper<ServiceToken> qw = new QueryWrapper<>();
-        qw.eq("product_sevice_id", productServiceId);
+        qw.eq("product_service_id", productServiceId);
         return this.selectOneRecord(qw);
     }
 
@@ -114,7 +114,7 @@ public class ServiceTokenFacade extends ServiceTokenServiceImpl {
     public Integer deleteByProductServiceId(Long productServiceId) {
         checkCurrentUser(productServiceId);
         UpdateWrapper<ServiceToken> uw = new UpdateWrapper<>();
-        uw.eq("product_sevice_id", productServiceId);
+        uw.eq("product_service_id", productServiceId);
         ServiceToken serviceToken = new ServiceToken();
         serviceToken.setIsDeleted(IsDeleteEnum.Y.getKey());
         return this.updateRecord(serviceToken, uw);
@@ -129,7 +129,7 @@ public class ServiceTokenFacade extends ServiceTokenServiceImpl {
     public Integer enableToken(Long productServiceId) {
         checkCurrentUser(productServiceId);
         UpdateWrapper<ServiceToken> uw = new UpdateWrapper<>();
-        uw.eq("product_sevice_id", productServiceId);
+        uw.eq("product_service_id", productServiceId);
         uw.eq("type", TokenTypeEnum.Manual.getKey());
         ServiceToken serviceToken = new ServiceToken();
         serviceToken.setStatus(StatusEnum.Enable.getKey());
@@ -145,7 +145,7 @@ public class ServiceTokenFacade extends ServiceTokenServiceImpl {
     public Integer disableToken(Long productServiceId) {
         checkCurrentUser(productServiceId);
         UpdateWrapper<ServiceToken> uw = new UpdateWrapper<>();
-        uw.eq("product_sevice_id", productServiceId);
+        uw.eq("product_service_id", productServiceId);
         uw.eq("type", TokenTypeEnum.Manual.getKey());
         ServiceToken serviceToken = new ServiceToken();
         serviceToken.setStatus(StatusEnum.Disable.getKey());

+ 2 - 2
diagbotman-service/src/main/java/com/diagbot/mapper/ProductServiceMapper.java

@@ -18,11 +18,11 @@ import org.apache.ibatis.annotations.Param;
 public interface ProductServiceMapper extends BaseMapper<ProductService> {
 
     /**
-     * 根据用户id获取产品与服务端的关联列表(分页)
+     * 查询产品与服务端的关联列表(分页)
      *
      * @param page
      * @param productService
      * @return
      */
-    IPage<ProductServiceWrapper> selectProductServiceByUserIdPage(Page page, @Param("productService") ProductServiceWrapper productService);
+    IPage<ProductServiceWrapper> selectProductServicePage(Page page, @Param("productService") ProductServiceWrapper productService);
 }

+ 2 - 2
diagbotman-service/src/main/java/com/diagbot/service/ProductServiceService.java

@@ -21,11 +21,11 @@ import java.util.Map;
 public interface ProductServiceService extends IService<ProductService> {
 
     /**
-     * 根据用户id获取产品与服务端的关联列表(分页)
+     * 查询产品与服务端的关联列表(分页)
      *
      * @param page
      * @param productService
      * @return
      */
-    IPage<ProductServiceWrapper> selectProductServiceByUserIdPage(Page<ProductServiceWrapper> page, ProductServiceWrapper productService);
+    IPage<ProductServiceWrapper> selectProductServicePage(Page<ProductServiceWrapper> page, ProductServiceWrapper productService);
 }

+ 3 - 3
diagbotman-service/src/main/java/com/diagbot/service/impl/ProductServiceServiceImpl.java

@@ -21,13 +21,13 @@ import org.springframework.stereotype.Service;
 public class ProductServiceServiceImpl extends ServiceImpl<ProductServiceMapper, ProductService> implements ProductServiceService {
 
     /**
-     * 根据用户id获取产品与服务端的关联列表(分页)
+     * 查询产品与服务端的关联列表(分页)
      *
      * @param page
      * @param productService
      * @return
      */
-    public IPage<ProductServiceWrapper> selectProductServiceByUserIdPage(Page<ProductServiceWrapper> page, ProductServiceWrapper productService) {
-        return baseMapper.selectProductServiceByUserIdPage(page, productService);
+    public IPage<ProductServiceWrapper> selectProductServicePage(Page<ProductServiceWrapper> page, ProductServiceWrapper productService) {
+        return baseMapper.selectProductServicePage(page, productService);
     }
 }

+ 4 - 3
diagbotman-service/src/main/java/com/diagbot/vo/ProductServiceSaveVO.java

@@ -4,6 +4,7 @@ import lombok.Getter;
 import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 
 /**
  * @Description:
@@ -13,10 +14,10 @@ import javax.validation.constraints.NotBlank;
 @Getter
 @Setter
 public class ProductServiceSaveVO {
-    @NotBlank(message = "请输入产品Id!")
+    @NotNull(message = "请输入产品Id!")
     private Long productId;
-    @NotBlank(message = "请输入服务Id!")
+    @NotNull(message = "请输入服务Id!")
     private Long serviceId;
-    @NotBlank(message = "请输入令牌类型!")
+    @NotNull(message = "请输入令牌类型!")
     private Integer type;
 }

+ 2 - 2
diagbotman-service/src/main/java/com/diagbot/web/ProductServiceController.java

@@ -70,12 +70,12 @@ public class ProductServiceController {
     }
 
     /**
-     * 根据用户id获取产品服务关联信息
+     * 获取当前登录用户产品服务分页列表
      *
      * @param page
      * @return
      */
-    @ApiOperation(value = "根据用户id获取产品服务关联信息[by:zhaops]", notes = "根据用户id获取产品服务关联信息")
+    @ApiOperation(value = "获取当前登录用户产品服务分页列表[by:zhaops]", notes = "获取当前登录用户产品服务分页列表")
     @PostMapping("/getProductServiceByCurrentUser")
     @SysLogger("getProductServiceByCurrentUser")
     public RespDTO getProductServiceByCurrentUser(Page page) {

+ 18 - 0
diagbotman-service/src/main/java/com/diagbot/web/ServiceInfoController.java

@@ -15,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
 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.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
@@ -73,6 +74,23 @@ public class ServiceInfoController {
         return RespDTO.onSuc(isSuccess);
     }
 
+    /**
+     * 删除服务
+     *
+     * @param serviceId
+     * @return
+     */
+    @ApiOperation(value = "删除服务[by:zhaops]",
+            notes = "id:id,必填<br>")
+    @PostMapping("/delService")
+    @SysLogger("delService")
+    @Transactional
+    public RespDTO<Boolean> delService(@RequestParam Long serviceId) {
+        Boolean isSuccess = serviceInfoFacade.delService(serviceId);
+        return RespDTO.onSuc(isSuccess);
+    }
+
+
     /**
      * 获取当前登录用户的服务列表
      *

+ 3 - 2
diagbotman-service/src/main/resources/mapper/OpenedProductsMapper.xml

@@ -56,7 +56,7 @@
 
     <select id="getByAppkeyAndSecret" resultMap="BaseResultMap" parameterType="java.util.Map">
         select os.* from diag_service_token st, diag_product_service ps, diag_service_info si, diag_opened_products os
-        where st.product_sevice_id = ps.id and ps.product_id = os.product_id and ps.service_id = si.id and si.user_id = os.user_id
+        where st.product_service_id = ps.id and ps.product_id = os.product_id and ps.service_id = si.id and si.user_id = os.user_id
         and st.is_deleted = 'N' and ps.is_deleted = 'N' and si.is_deleted = 'N' AND os.is_deleted = 'N'
         and st.app_key_id = #{appkey} and st.app_key_secret = #{secret}
     </select>
@@ -69,7 +69,8 @@
 			b.name as name,
 			DATE_FORMAT(a.start_time,'%Y-%m-%d') as startTime,
 			DATE_FORMAT(a.end_time,'%Y-%m-%d') as endTime,
-			a.service_status as serviceStatus
+			a.service_status as serviceStatus,
+			b.access_type as accessType
 		from diag_opened_products a join diag_lantone_product b on a.product_id=b.id
 		where a.is_deleted='N' and b.is_deleted='N' and a.user_id=#{userId};
     </select>

+ 1 - 1
diagbotman-service/src/main/resources/mapper/ProductOrderMapper.xml

@@ -76,7 +76,7 @@
     	SELECT
 			count(DISTINCT a.num)
 		from diag_product_order a join diag_order_details b on a.num=b.order_num
-		where b.audit_status is null
+		where b.audit_status=2
     </select>
 
     <select id="selectAllProductOrder" resultMap="BaseResultWrapper"

+ 15 - 5
diagbotman-service/src/main/resources/mapper/ProductServiceMapper.xml

@@ -29,11 +29,21 @@
         <result column="remark" property="remark"/>
     </resultMap>
 
-    <!-- 根据用户id获取产品与服务端的关联列表(分页) -->
-    <select id="selectProductServiceByUserIdPage" resultMap="BaseResultWrapperMap">
+    <!-- 查询产品与服务端的关联列表(分页) -->
+    <select id="selectProductServicePage" resultMap="BaseResultWrapperMap">
         select a.* from diag_product_service a,diag_opened_products b,diag_service_info c ,diag_lantone_product d
-        where a.product_id=b.product_id and a.product_id=d.id and a.service_id=c.id and a.is_deleted='N' and b.is_deleted='N' and c.is_deleted='N' and b.service_status=1  and d.is_deleted='N'
-        and b.user_id=#{productService.userId} and c.user_id=#{productService.userId} and (find_in_set('1',d.access_type) or FIND_IN_SET('2',d.access_type))
+        where a.product_id=b.product_id
+        and a.product_id=d.id
+        and a.service_id=c.id
+        and a.is_deleted='N'
+        and b.is_deleted='N'
+        and c.is_deleted='N'
+        and b.service_status=1
+        and d.is_deleted='N'
+        and (find_in_set('1',d.access_type) or FIND_IN_SET('2',d.access_type))
+        <if test="productService.userId != null and productService.userId != '' ">
+            and b.user_id=#{productService.userId} and c.user_id=#{productService.userId}
+        </if>
+        order by a.gmt_create desc
     </select>
-
 </mapper>

+ 0 - 6
eureka-server/pom.xml

@@ -47,12 +47,6 @@
             <groupId>net.logstash.logback</groupId>
             <artifactId>logstash-logback-encoder</artifactId>
         </dependency>
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
     </dependencies>
 
     <build>

+ 0 - 7
eureka-server/src/main/resources/bootstrap.yml

@@ -1,10 +1,3 @@
 spring:
   profiles:
     active: local
-#  #热部署设置
-#  thymeleaf:
-#    cache: true #关闭缓存,及时刷新
-#    devtools:
-#      restart:
-#        enabled: true #热部署生效
-#        additional-paths: src/main/java #设置重启的目录,添加那个目录的文件需要restart(监听目录)

+ 0 - 12
feedback-service/pom.xml

@@ -95,11 +95,6 @@
             <artifactId>mysql-connector-java</artifactId>
             <scope>runtime</scope>
         </dependency>
-        <!--<dependency>-->
-        <!--<groupId>org.springframework.boot</groupId>-->
-        <!--<artifactId>spring-boot-starter-data-jpa</artifactId>-->
-        <!--</dependency>-->
-
         <!--security-->
         <dependency>
             <groupId>org.springframework.cloud</groupId>
@@ -128,13 +123,6 @@
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
 
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
-
         <!-- mybatis-plus begin -->
         <dependency>
             <groupId>com.baomidou</groupId>

+ 0 - 7
gateway-service/pom.xml

@@ -61,13 +61,6 @@
             <optional>true</optional>
         </dependency>
 
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
-
         <!--swagger-->
         <dependency>
             <groupId>io.springfox</groupId>

+ 0 - 13
knowledge-service/pom.xml

@@ -95,11 +95,6 @@
             <artifactId>mysql-connector-java</artifactId>
             <scope>runtime</scope>
         </dependency>
-        <!--<dependency>-->
-        <!--<groupId>org.springframework.boot</groupId>-->
-        <!--<artifactId>spring-boot-starter-data-jpa</artifactId>-->
-        <!--</dependency>-->
-
         <!--security-->
         <dependency>
             <groupId>org.springframework.cloud</groupId>
@@ -127,14 +122,6 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
-
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
-
         <!-- mybatis-plus begin -->
         <dependency>
             <groupId>com.baomidou</groupId>

+ 0 - 7
monitor-service/pom.xml

@@ -69,13 +69,6 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
-
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
     </dependencies>
 
     <build>

+ 0 - 11
uaa-service/pom.xml

@@ -54,10 +54,6 @@
             <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
         </dependency>
 
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-starter-data-jpa</artifactId>-->
-        <!--</dependency>-->
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-actuator</artifactId>
@@ -80,13 +76,6 @@
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
 
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
-
         <!-- mybatis-plus begin -->
         <dependency>
             <groupId>com.baomidou</groupId>

+ 5 - 9
uaa-service/src/main/resources/mapper/PermissionMapper.xml

@@ -17,14 +17,10 @@
         <result column="descritpion" property="descritpion"/>
     </resultMap>
 
-    <select id="getByUserId" parameterType="java.lang.Long"
-            resultType="com.diagbot.entity.Permission">
-      select p.*
-        from sys_user u
-        LEFT JOIN sys_user_role sru on u.id= sru.user_id and sru.is_deleted = 'N'
-        LEFT JOIN sys_role_menu srp on srp.role_id=sru.role_id and srp.is_deleted = 'N'
-        LEFT JOIN sys_menu_permission mp on mp.menu_id =srp.menu_id and mp.is_deleted = 'N'
-                LEFT JOIN sys_permission p on p.id =mp.permission_id and p.is_deleted = 'N'
-        where u.id= #{userId} and u.is_deleted = 'N'
+    <select id="getByUserId" parameterType="java.lang.Long" resultType="com.diagbot.entity.Permission">
+      select p.* from sys_user u, sys_user_role sru, sys_role_permission rp, sys_permission p
+      where u.is_deleted = 'N' and sru.is_deleted = 'N' and rp.is_deleted = 'N' and p.is_deleted = 'N'
+      and u.id = sru.user_id and sru.role_id = rp.role_id and rp.permission_id = p.id
+      and u.id= #{userId}
      </select>
 </mapper>

+ 0 - 11
user-service/pom.xml

@@ -95,10 +95,6 @@
             <artifactId>mysql-connector-java</artifactId>
             <scope>runtime</scope>
         </dependency>
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-starter-data-jpa</artifactId>-->
-        <!--</dependency>-->
 
         <!--security-->
         <dependency>
@@ -128,13 +124,6 @@
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
 
-        <!--&lt;!&ndash;热部署引用&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-devtools</artifactId>-->
-            <!--<optional>true</optional>-->
-        <!--</dependency>-->
-
         <!-- mybatis-plus begin -->
         <dependency>
             <groupId>com.baomidou</groupId>

+ 4 - 3
user-service/src/main/java/com/diagbot/facade/PermissionFacade.java

@@ -25,9 +25,10 @@ public class PermissionFacade extends PermissionServiceImpl {
     UserFacade userFacade;
 
     /**
-     * @Description: 获取资源信息
-     * @Author: ztg
-     * @Date: 2018/9/25 15:10
+     * 获取资源信息
+     * @param appkey 参数
+     * @param secret 参数
+     * @return 资源信息
      */
     public RespDTO getPermission(String appkey, String secret) {
         User user = userFacade.findByName(appkey);

+ 9 - 6
user-service/src/main/java/com/diagbot/facade/UserAuthenticationFacade.java

@@ -8,6 +8,7 @@ import com.diagbot.entity.Organization;
 import com.diagbot.entity.User;
 import com.diagbot.entity.UserAuthentication;
 import com.diagbot.enums.AuthStatusEnum;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.OrganizationTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -61,7 +62,7 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
         //更新机构信息
         QueryWrapper<Organization> qwOrganization = new QueryWrapper<>();
         qwOrganization.eq("name", userAuthenticationVO.getOrganization());
-        qwOrganization.eq("is_deleted", "N");
+        qwOrganization.eq("is_deleted", IsDeleteEnum.N.getKey());
         Organization organization = organizationFacade.getOne(qwOrganization);
         if (organization == null) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS,
@@ -81,7 +82,7 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
         //更新验证信息
         QueryWrapper<UserAuthentication> qwAuthentication = new QueryWrapper<>();
         qwAuthentication.eq("user_id", userId);
-        qwAuthentication.eq("is_deleted", "N");
+        qwAuthentication.eq("is_deleted", IsDeleteEnum.N.getKey());
         UserAuthentication userAuthentication = this.getOne(qwAuthentication);
         if (userAuthentication == null) {
             userAuthentication = new UserAuthentication();
@@ -115,10 +116,12 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
     public UserAuthenticationDTO getuserAuthenticationInfo() {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         User user = userFacade.getById(userId);
+        //密码置空
+        user.setPassword(null);
         Organization organization = organizationFacade.getByUserId(userId);
         QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
         qw.eq("user_id", userId);
-        qw.eq("is_deleted", "N");
+        qw.eq("is_deleted", IsDeleteEnum.N.getKey());
         UserAuthentication userAuthentication = this.getOne(qw);
         UserAuthenticationDTO userAuthenticationDTO = new UserAuthenticationDTO();
         userAuthenticationDTO.setUser(user);
@@ -141,11 +144,11 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
         qw.eq("user_id", userId);
-        qw.eq("is_deleted", "N");
+        qw.eq("is_deleted", IsDeleteEnum.N.getKey());
         UserAuthentication userAuthentication = this.getOne(qw);
         Map<Integer, Object> map = new HashMap<>();
         if (userAuthentication == null) {
-            map.put(99, "当前用户没有认证信息");
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "当前用户没有认证信息");
         } else {
             Integer status = userAuthentication.getStatus();
             String statusName = AuthStatusEnum.getName(status);
@@ -163,7 +166,7 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
         qw.eq("user_id", userId);
-        qw.eq("is_deleted", "N");
+        qw.eq("is_deleted", IsDeleteEnum.N.getKey());
         UserAuthentication userAuthentication = this.getOne(qw);
 
         QueryAuthProgressDTO queryAuthProgressDTO = new QueryAuthProgressDTO();

+ 24 - 2
user-service/src/main/java/com/diagbot/facade/UserFacade.java

@@ -253,12 +253,34 @@ public class UserFacade extends UserServiceImpl {
         loginDTO.setOrganization(org);
         //添加菜单信息
         List<MenuWrapper> menuList = menuFacade.getByRole(user.getId());
-        getMenuStruct(menuList);
-        loginDTO.setMenuWrappers(menuList);
+        Map<Long, List<MenuWrapper>> menuMap = EntityUtil.makeEntityListMap(menuList, "parentId");
+        List<MenuWrapper> menuRes = menuMap.get(-1L);
+        for(MenuWrapper bean : menuRes) {
+            getSonMenu(bean, menuMap);
+        }
+        loginDTO.setMenuWrappers(menuRes);
         return RespDTO.onSuc(loginDTO);
     }
 
 
+    /**
+     * 递归获取菜单结构
+     * @param menu 当前菜单
+     * @param menuMap 菜单集
+     * @return 菜单结构
+     */
+    public List<MenuWrapper> getSonMenu(MenuWrapper menu, Map<Long, List<MenuWrapper>> menuMap) {
+        List<MenuWrapper> res = new ArrayList<>();
+        List<MenuWrapper> list = menuMap.get(menu.getId());
+        if(ListUtil.isNotEmpty(list)) {
+            menu.setSubMenuList(list);
+            for(MenuWrapper bean : list) {
+                getSonMenu(bean, menuMap);
+            }
+        }
+        return res;
+    }
+
     /**
      * 递归获取菜单结构
      *

+ 1 - 1
user-service/src/main/resources/mapper/MenuMapper.xml

@@ -21,7 +21,7 @@
         select a.* from sys_menu a, sys_role_menu b, sys_user_role c
         where a.id = b.menu_id and b.role_id and b.role_id = c.role_id and c.user_id = #{userId}
         and a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N'
-        ORDER BY a.order_no
+        ORDER BY a.parent_id , a.order_no
     </select>
 
     <select id="getSubMenuById" resultMap="BaseResultMap">

+ 5 - 8
user-service/src/main/resources/mapper/PermissionMapper.xml

@@ -25,14 +25,11 @@
     </select>
 
 
-    <select id="getByUserId" parameterType="java.lang.Long"
-            resultType="com.diagbot.entity.Permission">
+    <select id="getByUserId" parameterType="java.lang.Long" resultType="com.diagbot.entity.Permission">
         select p.*
-        from sys_user u
-        LEFT JOIN sys_user_role sru on u.id= sru.user_id and sru.is_deleted = 'N'
-        LEFT JOIN sys_role_menu srp on srp.role_id=sru.role_id and srp.is_deleted = 'N'
-        LEFT JOIN sys_menu_permission mp on mp.menu_id =srp.menu_id and mp.is_deleted = 'N'
-        LEFT JOIN sys_permission p on p.id =mp.permission_id and p.is_deleted = 'N'
-        where u.id= #{userId} and u.is_deleted = 'N'
+        from sys_user u, sys_user_role sru, sys_role_permission rp, sys_permission p
+        where u.is_deleted = 'N' and sru.is_deleted = 'N' and rp.is_deleted = 'N' and p.is_deleted = 'N'
+        and u.id = sru.user_id and sru.role_id = rp.role_id and rp.permission_id = p.id
+        and u.id= #{userId}
     </select>
 </mapper>