Przeglądaj źródła

Merge branch 'develop' of 192.168.0.144:dcuc/auth-back into huangzqa-delete-api-20210412

huangzqa 4 lat temu
rodzic
commit
0e3c333515
29 zmienionych plików z 605 dodań i 658 usunięć
  1. 14 9
      pom.xml
  2. 6 71
      src/main/assembly/conf/application.yml
  3. 0 77
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/controller/ResourceAccpetController.java
  4. 0 118
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/vo/AppInfoAcceptVo.java
  5. 0 29
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/vo/AppResourceAcceptVo.java
  6. 0 52
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/vo/MenuResourceAcceptVo.java
  7. 0 65
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/vo/ServiceResourceAcceptVo.java
  8. 72 4
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/controller/AuthServiceController.java
  9. 10 3
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/controller/WorkFlowApiController.java
  10. 9 2
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/vo/ServiceAuthFlowAcceptVo.java
  11. 51 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/vo/ServiceAuthResultVo.java
  12. 11 8
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v3/controller/AuthV3ApiController.java
  13. 4 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/ResourceAuthController.java
  14. 7 28
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/ResourceListingController.java
  15. 5 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ListingParam.java
  16. 7 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ResourceRequestParam.java
  17. 7 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ResourceRequestResult.java
  18. 12 25
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ResourceVo.java
  19. 36 4
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ServiceAuthFlowVo.java
  20. 6 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ServiceResourceVo.java
  21. 17 16
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/audit/MgeAuditRptController.java
  22. 0 56
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/ServiceAuthController.java
  23. 118 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/ServiceAuthResultController.java
  24. 54 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/ServiceResourceController.java
  25. 12 12
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/vo/ServiceAuthVo.java
  26. 47 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/vo/ServiceResourceBackVo.java
  27. 17 7
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/login/DcucLoginController.java
  28. 74 0
      src/main/resources/application-base.yml
  29. 9 72
      src/main/resources/application.yml

+ 14 - 9
pom.xml

@@ -5,14 +5,14 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.dragoninfo</groupId>
     <artifactId>dcuc-auth-back</artifactId>
-    <version>2.0.0-SNAPSHOT</version>
+    <version>2.1.0-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <maven.compiler.source>1.8</maven.compiler.source>
         <maven.compiler.target>1.8</maven.compiler.target>
         <!--revisions需写死,用于标识打包的版本号,不可删除-->
-        <revision>2.0.0-SNAPSHOT</revision>
+        <revision>2.1.0-SNAPSHOT</revision>
         <duceap.version>2.1.0-SNAPSHOT</duceap.version>
         <lombok.version>1.18.2</lombok.version>
     </properties>
@@ -89,7 +89,7 @@
         <dependency>
             <groupId>com.dragoninfo</groupId>
             <artifactId>dcuc-common</artifactId>
-            <version>${project.version}</version>
+            <version>2.0.0-SNAPSHOT</version>
             <exclusions>
                 <exclusion>
                     <artifactId>spring-jdbc</artifactId>
@@ -107,7 +107,7 @@
         <dependency>
             <groupId>com.dragoninfo</groupId>
             <artifactId>dcuc-auth-api</artifactId>
-            <version>${project.version}</version>
+            <version>2.1.0-SNAPSHOT</version>
         </dependency>
         <!--redis缓存-->
         <dependency>
@@ -125,31 +125,31 @@
         <dependency>
             <groupId>com.dragoninfo</groupId>
             <artifactId>dcuc-app-api</artifactId>
-            <version>${project.version}</version>
+            <version>2.0.0-SNAPSHOT</version>
         </dependency>
 
         <dependency>
             <groupId>com.dragoninfo</groupId>
             <artifactId>dcuc-user-api</artifactId>
-            <version>${project.version}</version>
+            <version>2.0.1-SNAPSHOT</version>
         </dependency>
 
         <dependency>
             <groupId>com.dragoninfo</groupId>
             <artifactId>dcuc-org-api</artifactId>
-            <version>${project.version}</version>
+            <version>2.0.0-SNAPSHOT</version>
         </dependency>
 
         <dependency>
             <groupId>com.dragoninfo</groupId>
             <artifactId>dcuc-coder-api</artifactId>
-            <version>${project.version}</version>
+            <version>2.0.0-SNAPSHOT</version>
         </dependency>
 
         <dependency>
             <groupId>com.dragoninfo</groupId>
             <artifactId>dcuc-duceap-api</artifactId>
-            <version>${project.version}</version>
+            <version>2.0.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -195,6 +195,11 @@
             <version>1.0.6</version>
             <scope>compile</scope>
         </dependency>
+        <!--dids-->
+        <dependency>
+            <groupId>com.dragonsoft</groupId>
+            <artifactId>duceap-security-dids</artifactId>
+        </dependency>
 
     </dependencies>
     <!--指定仓库地址-->

+ 6 - 71
src/main/assembly/conf/application.yml

@@ -1,76 +1,11 @@
 spring:
-  application:
-    name: dcuc-auth-back
-  cloud:
-    nacos:
-      discovery:
-        # 配置nacos地址
-        server-addr: 127.0.0.1:8848
-  servlet:
-    multipart:
-      # 设置文件上传大小,springboot默认的最大上传大小是1MB
-      max-file-size: 150MB
-      max-request-size: 150MB
-server:
-  port: 8861
-  servlet:
-    context-path: /dcucauth
-    jsp:
-      init-parameters:
-        development: true
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-duceap:
-  swagger:
-    enabled: false
-    package-path: com.dragoninfo.dcuc.authweb
-  license:
-    #配置用来指定license对接的后端项目地址(格式:ip:port/context,如http://10.10.10.10:8080/ctx),
-    #默认使用HttpServletRequest.getLocalAddr()方法获取ip地址,
-    #应用在docker部署环境中无法获取机子的真实ip地址 考虑以配置参数的形式传入
-    address: http://127.0.0.1:8861/dcucauth
-    dataCacheMethod: apollo
-  security:
-    type: dcuc
-    dcuc:
-      cas-server-url-prefix: http://10.11.1.151:8877/dcucserver
-      server-name: 10.11.1.151:1646
-      ignore-pattern: '/js/*|/img/*|/css/*|/api/*|/*.png|/rest/*|/webSocket/*|/oauthLogin/*|/authorizationPage.html|/importAuthorizationFile.html|/license/LicenseManagerServlet|/authorizationFile/'
-      app-code: QXXT0000000000000001
-      api-url: http://10.11.1.151:8861/dcucauth
-  apollo:
-    client:
-      host: http://10.201.3.20:8070
+  profiles:
+    include: base
+#apollo配置
 apollo:
-  # 配置中心地址(服务端)
-  meta: http://192.168.6.123:8080
-  # 集群,默认default
-  cluster: GD
-  # 取消placeholder的自动更新功能(默认true)
   autoUpdateInjectedSpringProperties: false
   bootstrap:
-    # 命名空间,支持多个逗号隔开。按命名空间顺序依次加载,可用于公共配置
-    namespaces: application,dragonsoft.dcuc
-    # 是否启用apollo
     enabled: true
-hystrix:
-  command:
-    default:
-      execution:
-        timeout:
-          #hystrix熔断器开关
-          enabled: true
-        isolation:
-          thread:
-            #hystrix熔断器熔断时间
-            timeoutInMilliseconds: 30000
-ribbon:
-  ReadTimeout: 30000
-  ConnectTimeout: 30000
-dcuc:
-  userweb:
-    app-code: YHZX0000000000000001
-    auth-access: false
+    namespaces: application,dragonsoft.dcuc
+  cluster: default
+  meta: http://192.168.10.80:8081

+ 0 - 77
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/controller/ResourceAccpetController.java

@@ -1,77 +0,0 @@
-package com.dragoninfo.dcuc.authweb.restcontroller.api.appservice.v1.controller;
-
-import com.dragoninfo.dcuc.app.dto.AppResourceAcceptDTO;
-import com.dragoninfo.dcuc.app.dto.ServiceResourceAcceptDTO;
-import com.dragoninfo.dcuc.app.facade.IResourceFacade;
-import com.dragoninfo.dcuc.authweb.restcontroller.api.appservice.v1.vo.AppResourceAcceptVo;
-import com.dragoninfo.dcuc.authweb.restcontroller.api.appservice.v1.vo.ServiceResourceAcceptVo;
-import com.dragoninfo.dcuc.common.entity.ApiResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-/**
- * @author mazq
- * @Description 提供给外部推送应用、服务数据的接口
- * @create 2020-11-25 14:21
- */
-@Api(tags = {"应用服务资源推送处理接口"})
-@Controller
-@RequestMapping(value = "/api/app-service/v1/")
-public class ResourceAccpetController {
-
-    @Autowired
-    private IResourceFacade iResourceFacade;
-
-    /**
-     * 插入或更新资源同步表、应用信息表
-     *
-     * @param acceptVo
-     * @return
-     */
-    @ApiOperation(value = "推送应用资源处理")
-    @ApiImplicitParams({@ApiImplicitParam(name = "acceptVo", value = "应用资源vo")})
-    @RequestMapping(value = "apps/appresource", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
-    @ResponseBody
-    public ApiResult appAccept(@RequestBody AppResourceAcceptVo acceptVo) {
-        AppResourceAcceptDTO dto = new AppResourceAcceptDTO();
-        BeanUtils.copyProperties(acceptVo,dto);
-        boolean result = iResourceFacade.acceptAppResource(dto);
-        if(result) {
-            return ApiResult.setSuccess();
-        } else {
-            return ApiResult.setFailMessage("accept app resource fail");
-        }
-    }
-
-
-    /**
-     * 插入或更新资源同步表、服务信息表
-     *
-     * @param serviceResourceVo
-     * @return
-     */
-    @ApiOperation(value = "推送服务资源处理")
-    @ApiImplicitParams({@ApiImplicitParam(name = "serviceResourceVo", value = "服务资源vo")})
-    @RequestMapping(value = "apps/serviceresource", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
-    @ResponseBody
-    public ApiResult serviceAccept(@RequestBody ServiceResourceAcceptVo serviceResourceVo) {
-        ServiceResourceAcceptDTO acceptDTO = new ServiceResourceAcceptDTO();
-        BeanUtils.copyProperties(serviceResourceVo,acceptDTO);
-        boolean result = iResourceFacade.acceptServiceResource(acceptDTO);
-        if(result){
-           return ApiResult.setSuccess();
-        }else {
-           return ApiResult.setFailMessage("accept service failed");
-        }
-    }
-}

+ 0 - 118
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/vo/AppInfoAcceptVo.java

@@ -1,118 +0,0 @@
-package com.dragoninfo.dcuc.authweb.restcontroller.api.appservice.v1.vo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-/**
- * 推送应用Vo
- * @author mazq
- * @date 2021/2/19
- */
-@ApiModel(value = "推送应用资源vo")
-@Data
-public class AppInfoAcceptVo {
-
-    private String id;
-    /**
-     * 应用系统编号
-     */
-    @ApiModelProperty(value = "应用系统编号")
-    private String yyxtbh;
-    /**
-     *应用系统名称
-     */
-    @ApiModelProperty(value = "应用系统名称")
-    private String yyxtmc;
-    /**
-     * 应用系统说明
-     */
-    @ApiModelProperty(value = "应用系统说明")
-    private String yyxtsm;
-    /**
-     * 应用系统事权单位代码
-     */
-    @ApiModelProperty(value = "应用系统事权单位代码")
-    private String yyxtsqdwdm;
-    /**
-     * 应用系统管理单位代码
-     */
-    @ApiModelProperty(value = "应用系统管理单位代码")
-    private String yyxtgldwdm;
-    /**
-     * 应用系统承建单位名称
-     */
-    @ApiModelProperty(value = "应用系统承建单位名称")
-    private String yyxtcjdwmc;
-    /**
-     * 应用系统承建单位代码
-     */
-    @ApiModelProperty(value = "应用系统承建单位代码")
-    private String yyxtcjdwdm;
-    /**
-     * 应用系统承建单位名称
-     */
-    @ApiModelProperty(value = "应用系统承建单位名称")
-    private String yyxtywdwmc;
-    /**
-     * 上线日期
-     */
-    @ApiModelProperty(value = "上线日期")
-    private String sxrq;
-    /**
-     * 下线日期
-     */
-    @ApiModelProperty(value = "下线日期")
-    private String xxrq;
-    /**
-     * 应用系统分类代码
-     */
-    @ApiModelProperty(value = "应用系统分类代码")
-    private String yyxtfldm;
-    /**
-     * 公安警种分类代码
-     */
-    @ApiModelProperty(value = "公安警种分类代码")
-    private String gajzfldm;
-    /**
-     * 公安业务职责分类代码
-     */
-    @ApiModelProperty(value = "公安业务职责分类代码")
-    private String gazzfldm;
-    /**
-     * 系统在用标识
-     */
-    @ApiModelProperty(value = "系统在用标识")
-    private String xtzybs;
-    /**
-     * 系统注销标识
-     */
-    @ApiModelProperty(value = "系统注销标识")
-    private String xtzxbs;
-    /**
-     * 系统建设标识
-     */
-    @ApiModelProperty(value = "系统建设标识")
-    private String xtjsbs;
-    /**
-     * 系统架构类型
-     */
-    @ApiModelProperty(value = "系统架构类型")
-    private String xtjglx;
-    /**
-     * 应用系统访问地址
-     */
-    @ApiModelProperty(value = "应用系统访问地址")
-    private String yyxtfwdz;
-    /**
-     * 业务使用场景代码
-     */
-    @ApiModelProperty(value = "业务使用场景代码")
-    private String ywsycjdm;
-    /**
-     * 应用系统图标
-     */
-    @ApiModelProperty(value = "应用系统图标")
-    private String yyxttb;
-
-}

+ 0 - 29
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/vo/AppResourceAcceptVo.java

@@ -1,29 +0,0 @@
-package com.dragoninfo.dcuc.authweb.restcontroller.api.appservice.v1.vo;
-
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import java.util.List;
-/**
- * 推送应用和菜单数据Vo
- * @author mazq
- * @date 2021/2/19
- */
-@ApiModel(value = "推送应用和菜单资源vo")
-@Data
-public class AppResourceAcceptVo {
-
-    /**
-     * 推送过来的应用实体类Vo
-     */
-    @ApiModelProperty(value = "推送应用资源vo")
-    private AppInfoAcceptVo tAppSystem;
-    /**
-     * 推送过来的应用对应的菜单实体类Vo
-     */
-    @ApiModelProperty(value = "推送菜单资源vo")
-    private List<MenuResourceAcceptVo> tAppFunctionList;
-
-
-}

+ 0 - 52
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/vo/MenuResourceAcceptVo.java

@@ -1,52 +0,0 @@
-package com.dragoninfo.dcuc.authweb.restcontroller.api.appservice.v1.vo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-/**
- * 推送菜单Vo
- * @author mazq
- * @date 2021/2/18
- */
-@ApiModel(value = "推送菜单资源vo")
-@Data
-public class MenuResourceAcceptVo {
-
-    private String id;
-    /**
-     * 功能编号
-     */
-    @ApiModelProperty(value = "功能编号")
-    private String gnbh;
-    /**
-     * 功能说明
-     */
-    @ApiModelProperty(value = "功能说明")
-    private String gnsm;
-    /**
-     * 上级功能编号
-     */
-    @ApiModelProperty(value = "上级功能编号")
-    private String sjgnbh;
-    /**
-     * 功能使用场景代码
-     */
-    @ApiModelProperty(value = "功能使用场景代码")
-    private String gnsycjdm;
-    /**
-     * 设计安全隐私类别
-     */
-    @ApiModelProperty(value = " 设计安全隐私类别")
-    private String sjaqyslb;
-    /**
-     * 在用状态
-     */
-    @ApiModelProperty(value = "在用状态")
-    private String zyzt;
-    /**
-     * 功能名称
-     */
-    @ApiModelProperty(value = "功能名称")
-    private String gnmc;
-}

+ 0 - 65
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/appservice/v1/vo/ServiceResourceAcceptVo.java

@@ -1,65 +0,0 @@
-package com.dragoninfo.dcuc.authweb.restcontroller.api.appservice.v1.vo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-/**
- * 服务资源推送接收Vo
- * @author mazq
- * @date 2021/2/19
- */
-@ApiModel(value = "推送服务资源vo")
-@Data
-public class ServiceResourceAcceptVo {
-
-    private String id;
-    /**
-     * 服务资源编码
-     */
-    @ApiModelProperty(value = "服务资源编码")
-    private String FWZYBSF;
-    /**
-     * 服务资源名称
-     */
-    @ApiModelProperty(value = "服务资源名称")
-    private String FWZYMC;
-    /**
-     * 服务资源类型
-     */
-    @ApiModelProperty(value = "服务资源类型")
-    private String FWLXDM;
-    /**
-     * 事权单位编号
-     */
-    @ApiModelProperty(value = "事权单位编号")
-    private String FWZYSQDW_JGDM;
-    /**
-     * 管理单位
-     */
-    @ApiModelProperty(value = "管理单位")
-    private String FWZYGLDW_GAJGJGDM;
-    /**
-     * 应用资源标识符
-     */
-    @ApiModelProperty(value = "应用资源标识符")
-    private String TGFWZYD_YYZYBS;
-    /**
-     * 服务资源描述
-     */
-    @ApiModelProperty(value = "服务资源描述")
-    private String FWZYMS;
-    /**
-     * 服务访问地址
-     */
-    @ApiModelProperty(value = "服务访问地址")
-    private String FWFWDZ;
-    /**
-     * 服务资源状态代码 0:未激活;1:启用;2:停止;3:撤销;
-     */
-    @ApiModelProperty(value = "服务资源状态代码")
-    private String FWZYZTDM;
-
-    @ApiModelProperty(value = "信息创建单位GA机构代码")
-    private String XXCZDW_GAJGJGDM;
-}

+ 72 - 4
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/controller/AuthServiceController.java

@@ -1,19 +1,34 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.controller;
 
+import com.dragoninfo.dcuc.app.entity.ApplyInfo;
+import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
+import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthResultDTO;
 import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthFacade;
+import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthResultFacade;
+import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.ServiceAuthResultVo;
 import com.dragoninfo.dcuc.authweb.util.VersionUtils;
 import com.dragoninfo.dcuc.common.entity.ApiResult;
+import com.dragoninfo.dcuc.common.entity.ApiSearchReq;
+import com.dragoninfo.dcuc.common.utils.SearchableUtil;
+import com.dragoninfo.dcuc.user.user.enumresources.YesNotEnum;
+import com.dragonsoft.duceap.base.enums.BooleanEnum;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
+import com.dragonsoft.duceap.core.search.Searchable;
+import com.dragonsoft.duceap.core.search.enums.SearchOperator;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Author yica
@@ -27,6 +42,11 @@ public class AuthServiceController {
     @Autowired
     private IServiceAuthFacade serviceAuthFacade;
 
+    @Autowired
+    private IServiceAuthResultFacade serviceAuthResultFacade;
+    @Autowired
+    private IApplyInfoFacade applyInfoFacade;
+
     /**
      * 服务级鉴权
      *
@@ -39,11 +59,59 @@ public class AuthServiceController {
     public ApiResult authentication(HttpServletRequest request) {
         String appCode = request.getHeader("appCode");
         if (StringUtils.isEmpty(appCode)){
-            return ApiResult.setFailMessage("appcode不能为空");
+            return ApiResult.setFailMessage("appCode is not null");
+        }
+        ApplyInfo applyInfo = applyInfoFacade.getAppByCode(appCode);
+        if (applyInfo == null || BooleanEnum.TRUE.value.equals(applyInfo.getApplyStatus())) {
+            return ApiResult.setFailMessage("app is not enabled");
         }
         Object o = serviceAuthFacade.serviceAuthentication(appCode);
         return ApiResult.setSuccessResult(o);
     }
 
 
+    @ApiOperation(value = "授权服务列表")
+    @ApiImplicitParams({@ApiImplicitParam(name = "ApiSearchReq", value = "授权服务列表查询vo")})
+    @PostMapping("service/search")
+    public ApiResult serviceSearch(@RequestBody ApiSearchReq apiSearchReq) {
+        Map<String, SearchOperator[]> requestMap = new HashMap<>();
+        requestMap.put("appCode", new SearchOperator[]{SearchOperator.eq});
+        requestMap.put("serviceCode", new SearchOperator[]{SearchOperator.eq});
+        Searchable searchable;
+        try {
+            searchable = SearchableUtil.parseApiSearchReqToSearchable(apiSearchReq, requestMap, 1000);
+        } catch (IllegalArgumentException e) {
+            String message = e.getMessage();
+            return ApiResult.setFailMessage(message);
+        }
+        Page<ServiceAuthResultDTO> serviceAuthResultDTOS = serviceAuthResultFacade.serviceAuthResultPage(searchable.toSearchDTO());
+        List<ServiceAuthResultDTO> content = serviceAuthResultDTOS.getContent();
+        List<ServiceAuthResultVo> voList = new ArrayList<>(content.size());
+
+        content.forEach(item -> {
+            ServiceAuthResultVo vo = new ServiceAuthResultVo();
+            BeanUtils.copyProperties(item, vo);
+            vo.setServiceStatus(item.getAuthStatus());
+            vo.setPrivilegedTime(item.getCreateTime());
+            voList.add(vo);
+        });
+        return ApiResult.setSuccessPage(serviceAuthResultDTOS.getTotalElements(), voList);
+    }
+
+    @ApiOperation(value = "服务授权撤销")
+    @ApiImplicitParams({@ApiImplicitParam(name = "appCode", value = "应用编码"),
+            @ApiImplicitParam(name = "serviceCode", value = "服务编码")
+    })
+    @DeleteMapping("service/{appCode}/{serviceCode}")
+    public ApiResult delService(@PathVariable String appCode, @PathVariable String serviceCode)  {
+        try {
+            ServiceAuthResultDTO authDto = serviceAuthResultFacade.getDetailByAppAndService(appCode,serviceCode);
+            serviceAuthResultFacade.delServiceAuthResult(authDto.getId());
+            return ApiResult.setSuccess();
+        } catch (Exception e){
+            e.printStackTrace();
+            return ApiResult.setFailMessage("服务授权撤销失败");
+        }
+
+    }
 }

+ 10 - 3
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/controller/WorkFlowApiController.java

@@ -3,18 +3,20 @@ package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.controller
 import cn.hutool.core.util.StrUtil;
 import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.app.entity.ServiceResource;
-import com.dragoninfo.dcuc.app.enumresources.WorkFlowStatusEnum;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
 import com.dragoninfo.dcuc.app.facade.IServiceResourceFacade;
 import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthFlowDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowResutlAcceptDTO;
+import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
 import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthFacade;
 import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.ResourceAuthInfoVo;
 import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.ServiceAuthFlowAcceptVo;
 import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.WorkFlowResutlAcceptVo;
+import com.dragoninfo.dcuc.common.Constants;
 import com.dragoninfo.dcuc.common.entity.ApiResult;
 import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
 import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
+import com.dragonsoft.duceap.commons.util.string.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -29,6 +31,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import javax.servlet.http.HttpServletRequest;
+
 /**
  * @author mazq
  * @date 2021/2/24
@@ -54,8 +58,10 @@ public class WorkFlowApiController {
     @ApiImplicitParams({@ApiImplicitParam(name = "serviceAuthFlowVo", value = "服务授权工单保存Vo")})
     @PostMapping("service")
     @ResponseBody
-    public ApiResult serviceAuthFlowSave(@RequestBody @Validated ServiceAuthFlowAcceptVo serviceAuthFlowVo) {
-
+    public ApiResult serviceAuthFlowSave(@RequestBody @Validated ServiceAuthFlowAcceptVo serviceAuthFlowVo, HttpServletRequest request) {
+        String idcard = request.getHeader(Constants.IDCARD);
+        String tonken = request.getHeader(Constants.DCUC_USER_TOKEN);
+        String user = StringUtils.isNotBlank(idcard) ? idcard : tonken;
         ResourceAuthInfoVo resourceInfo = serviceAuthFlowVo.getResourceInfo();
         String visitorCode = resourceInfo.getVisitorCode();
         ApplyInfo applyInfo = applyInfoFacade.getAppByCode(visitorCode);
@@ -75,6 +81,7 @@ public class WorkFlowApiController {
         ServiceAuthFlowDTO dto = new ServiceAuthFlowDTO();
         setAppServiceInfo(dto, serviceAuthFlowVo);
         BeanUtils.copyProperties(serviceAuthFlowVo, dto, "serviceCodes", "serviceNames");
+        dto.setUser(user);
         ResponseDTO responseDTO = serviceAuthFacade.serviceAuthFlowSave(dto);
         String statusCode = responseDTO.getStatusCode();
         if (ResponseStatus.SUCCESS_CODE.equals(statusCode)) {

+ 9 - 2
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/vo/ServiceAuthFlowAcceptVo.java

@@ -1,12 +1,15 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import javax.validation.Valid;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
+import java.util.Date;
 
 /**
  * 提交工作流工单Vo
@@ -80,10 +83,14 @@ public class ServiceAuthFlowAcceptVo {
     private String permissionValidType;
 
     @ApiModelProperty(value = "权限有效起始时间(2020-01-01 00:00:00)")
-    private String startTime;
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date startTime;
 
     @ApiModelProperty(value = "权限有效终止时间(2020-01-01 00:00:00)")
-    private String endTime;
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date endTime;
 
     /**
      * 访问资源信息

+ 51 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/vo/ServiceAuthResultVo.java

@@ -0,0 +1,51 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author yica
+ * @Date 2021/3/10 15:22
+ **/
+@Data
+public class ServiceAuthResultVo {
+
+
+    @ApiModelProperty(value = "应用code", required = true)
+    private String appCode;
+
+    @ApiModelProperty(value = "应用appName", required = true)
+    private String appName;
+
+    @ApiModelProperty(value = "服务code", required = true)
+    private String serviceCode;
+
+    @ApiModelProperty(value = "服务名称", required = true)
+    private String serviceName;
+
+    @ApiModelProperty(value = "服务状态", required = true)
+    private String serviceStatus;
+
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "授权时间", required = true)
+    private Date privilegedTime;
+
+    @ApiModelProperty(value = "申请人名字")
+    private String applicantName;
+
+    @ApiModelProperty(value = "申请人身份证")
+    private String applicantIdcard;
+
+    @ApiModelProperty(value = "申请人电话")
+    private String applicantPhoneNo;
+
+
+    @ApiModelProperty(value = "申请人机构名称")
+    private String applicantOrgName;
+
+    @ApiModelProperty(value = "申请人机构Code")
+    private String applicantOrgCode;
+}

+ 11 - 8
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v3/controller/AuthV3ApiController.java

@@ -1,9 +1,10 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v3.controller;
 
+import com.dragoninfo.dcuc.app.entity.ApplyInfo;
+import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
 import com.dragoninfo.dcuc.auth.auth.dto.AppResourcesDto;
 import com.dragoninfo.dcuc.auth.auth.dto.RoleApiDto;
 import com.dragoninfo.dcuc.auth.auth.facade.IRoleFacade;
-import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthFacade;
 import com.dragoninfo.dcuc.auth.auth.vo.AppFunVO;
 import com.dragoninfo.dcuc.auth.power.facade.IAppFunInfoFacade;
 import com.dragoninfo.dcuc.authweb.util.VersionUtils;
@@ -14,6 +15,7 @@ import com.dragoninfo.dcuc.user.user.entity.UserInfo;
 import com.dragoninfo.dcuc.user.user.facade.IUserInfoFacade;
 import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
 import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
+import com.dragonsoft.duceap.base.enums.BooleanEnum;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -23,10 +25,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
 
-import javax.annotation.Resource;
 import java.util.*;
 
 /**
@@ -47,10 +47,9 @@ public class AuthV3ApiController {
     private IRoleFacade roleFacade;
     @Autowired
     private IUserInfoFacade userInfoFacade;
+
     @Autowired
-    private IServiceAuthFacade serviceAuthFacade;
-    @Resource(name = "redisTemplate")
-    private RedisTemplate<String, Object> redisTemplate;
+    private IApplyInfoFacade applyInfoFacade;
 
     /**
      * 推送资源
@@ -118,10 +117,14 @@ public class AuthV3ApiController {
     @ApiImplicitParams({@ApiImplicitParam(name = "AuthManagerRes", value = "资源vo")})
     public ApiResult getFunctions(@RequestBody AuthManagerRes managerRes) {
         if (StringUtils.isEmpty(managerRes.getAppCode())) {
-            return ApiResult.setFailMessage("appCode不能为空");
+            return ApiResult.setFailMessage("appCode is not null");
+        }
+        ApplyInfo applyInfo = applyInfoFacade.getAppByCode(managerRes.getAppCode());
+        if (applyInfo == null || BooleanEnum.TRUE.value.equals(applyInfo.getApplyStatus())) {
+            return ApiResult.setFailMessage("app is not enabled");
         }
         if (StringUtils.isEmpty(managerRes.getIdcard())) {
-            return ApiResult.setFailMessage("idcard不能为空");
+            return ApiResult.setFailMessage("idcard is not null");
         }
         UserInfo userInfo = userInfoFacade.userDetail("idcard", managerRes.getIdcard());
         if (userInfo == null) {

+ 4 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/ResourceAuthController.java

@@ -7,6 +7,8 @@ import com.dragoninfo.duceap.core.response.Result;
 import com.dragonsoft.duceap.core.entity.page.PageImpl;
 import com.dragonsoft.duceap.core.entity.page.PageRequest;
 import com.dragonsoft.duceap.core.search.Searchable;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,6 +39,8 @@ public class ResourceAuthController {
      * 服务授权工单列表
      * @return
      */
+    @ApiOperation(value = "查询应用列表")
+    @ApiImplicitParam(name = "searchable", value = "查询条件")
     @PostMapping(value = "serviceAuthFlow/search", produces = MediaType.APPLICATION_JSON_VALUE)
     public Result<Page<ServiceAuthFlowVo>> serviceAuthFlowPage(Searchable searchable) {
         Page<ServiceAuthFlowDTO> page = iServiceAuthFacade.serviceAuthFlowPage(searchable.toSearchDTO());

+ 7 - 28
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/ResourceListingController.java

@@ -2,22 +2,16 @@ package com.dragoninfo.dcuc.authweb.restcontroller.app;
 
 import com.dragoninfo.dcuc.app.dto.ResourceRequestParamDTO;
 import com.dragoninfo.dcuc.app.dto.ResourceRequestResultDTO;
-import com.dragoninfo.dcuc.app.dto.ServiceResourceDTO;
 import com.dragoninfo.dcuc.app.facade.IResourceFacade;
 import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.ResourceRequestParam;
 import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.ResourceRequestResult;
-import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.ServiceResourceVo;
 import com.dragoninfo.duceap.core.response.Result;
-import com.dragonsoft.duceap.core.entity.page.PageImpl;
-import com.dragonsoft.duceap.core.entity.page.PageRequest;
-import com.dragonsoft.duceap.core.search.Searchable;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
-import java.util.ArrayList;
+
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -33,11 +27,12 @@ public class ResourceListingController {
     @Autowired
     private IResourceFacade iResourceFacade;
 
-
-     /**
+    /**
      * 获取应用和服务资源列表
      * 全量获取时,如果是第一页获取失败表示该资源列表都获取失败
      */
+    @ApiOperation(value = "获取应用和服务资源列表")
+    @ApiImplicitParam(name = "requestParam", value = "获取资源数据请求数据封装对象")
     @PostMapping(value = "getResourceRemote")
     public Result<List<ResourceRequestResult>> getResourceListing(@RequestBody ResourceRequestParam requestParam) {
         ResourceRequestParamDTO paramDTO = new ResourceRequestParamDTO();
@@ -55,27 +50,11 @@ public class ResourceListingController {
     /**
      * 资源同步表与应用、服务资源同步
      */
+    @ApiOperation(value = "资源同步表与应用、服务资源同步")
     @GetMapping(value = "sync")
     public Result ResourceSync() {
         iResourceFacade.resourceSync();
         return Result.success();
     }
 
-    /**
-     * 服务资源列表分页查询
-     */
-    @PostMapping(value = "serviceResource/search", produces = MediaType.APPLICATION_JSON_VALUE)
-    public Result<Page<ServiceResourceVo>> serviceResourcePage(Searchable searchable) {
-        Page<ServiceResourceDTO> page = iResourceFacade.serviceResourcePage(searchable.toSearchDTO());
-        List<ServiceResourceVo> vos = new ArrayList<>();
-        List<ServiceResourceDTO> content = page.getContent();
-        for (ServiceResourceDTO dto : content) {
-            ServiceResourceVo vo = new ServiceResourceVo();
-            BeanUtils.copyProperties(dto, vo);
-            vos.add(vo);
-        }
-        Pageable newPageable = new PageRequest(page.getNumber(), page.getSize());
-        PageImpl<ServiceResourceVo> pageResult = new PageImpl<>(vos, newPageable, page.getTotalElements());
-        return Result.success(pageResult);
-    }
 }

+ 5 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ListingParam.java

@@ -1,5 +1,7 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.app.vo;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
@@ -10,15 +12,18 @@ import java.util.List;
  * @date 2020/11/26
  */
 @Data
+@ApiModel(value = "应用服务资源获取参数封装类")
 public class ListingParam {
 
     /**
      * 资源枚举类ResourceTypeEnum 资源id 表示想要获取哪一类的资源
      */
+    @ApiModelProperty(value = "资源枚举类ResourceTypeEnum 资源id 表示想要获取哪一类的资源")
     private String resourceId;
 
     /**
      * 想要获取该类资源哪些页码的数据
      */
+    @ApiModelProperty(value = "想要获取该类资源的页码数集合")
     private List<Integer> pageNo;
 }

+ 7 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ResourceRequestParam.java

@@ -1,5 +1,7 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.app.vo;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
@@ -10,27 +12,32 @@ import java.util.List;
  * @date 2020/11/26
  */
 @Data
+@ApiModel(value = "获取资源数据请求数据封装对象")
 public class ResourceRequestParam {
 
     /**
      * 是否获取全量应用和服务资源数据
      */
+    @ApiModelProperty(value = "是否获取全量应用和服务资源数据")
     private boolean listingAll;
 
     /**
      * 不全量获取时,获取资源数据参数封装集合
      * 当listingAll为false时有用
      */
+    @ApiModelProperty(value = "不全量获取时,获取资源数据参数封装集合,当listingAll为false时有用")
     private List<ListingParam> listingParams;
 
     /**
      * 获取每页的数量
      */
+    @ApiModelProperty(value = "获取每页的数量")
     private Integer pageSize;
 
     /**
      * 全量获取时有用
      * 从currentPageNo页开始获取
      */
+    @ApiModelProperty(value = "从currentPageNo页开始获取,当listingAll为true时有用,默认为1")
     private Integer currentPageNo;
 }

+ 7 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ResourceRequestResult.java

@@ -1,5 +1,7 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.app.vo;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
@@ -10,26 +12,31 @@ import java.util.List;
  * @date 2020/11/26
  */
 @Data
+@ApiModel(value = "资源获取结果")
 public class ResourceRequestResult {
 
     /**
      * 资源枚举类ResourceTypeEnum 资源id
      */
+    @ApiModelProperty(value = "资源枚举类资源id")
     private String resourceId;
 
     /**
      * 当获取失败时,失败的页码集合
      */
+    @ApiModelProperty(value = "当获取失败时,失败的页码集合")
     private List<Integer> pageNos;
 
     /**
      * 总页码数量
      */
+    @ApiModelProperty(value = "总页码数量")
     private Integer totalPages;
 
     /**
      * 是否获取成功
      */
+    @ApiModelProperty(value = "是否获取成功")
     private String success;
 
     public ResourceRequestResult() {

+ 12 - 25
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ResourceVo.java

@@ -1,5 +1,7 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.app.vo;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 /**
@@ -9,70 +11,55 @@ import lombok.Data;
  * @create 2020-11-25 14:21
  */
 @Data
+@ApiModel(value = "资源展示对象父类")
 public class ResourceVo {
 
+    @ApiModelProperty(value = "id")
     private String id;
     /**
      * 资源枚举类-资源id
      */
+    @ApiModelProperty(value = "资源枚举类-资源id")
     private String resourceId;
 
     /**
      * 资源枚举类-资源类型
      */
+    @ApiModelProperty(value = "资源枚举类-资源类型")
     private String resourceType;
 
     /**
      * 资源枚举类-资源提供方
      */
+    @ApiModelProperty(value = "资源枚举类-资源提供方")
     private String resourceProvider;
     /**
      * 建设单位id(orgId)
      */
+    @ApiModelProperty(value = "建设单位id(orgId)")
     private String buildUnitId;
 
     /**
      * 建设单位编码(orgCode)
      */
+    @ApiModelProperty(value = "建设单位编码(orgCode)")
     private String buildUnitCode;
 
     /**
      * 建设单位名称
      */
+    @ApiModelProperty(value = "建设单位名称")
     private String buildUnit;
 
     /**
      * 建设单位负责人
      */
+    @ApiModelProperty(value = "建设单位负责人")
     private String buildPrincipal;
 
     /**
      * 建设单位负责人电话
      */
+    @ApiModelProperty(value = "建设单位负责人电话")
     private String buildPrincipalPhone;
-
-    /**
-     * 承建单位id(ManufacturerId)
-     */
-    private String contractUnitId;
-
-    /**
-     * 承建单位编码(ManufacturerCode)
-     */
-    private String contractUnitCode;
-
-    /**
-     * 承建单位名称
-     */
-    private String contractUnit;
-
-    /**
-     * 承建单位负责人
-     */
-    private String contractPrincipal;
-
-    /**
-     * 承建单位负责人电话
-     */
-    private String contractPrincipalPhone;
 }

+ 36 - 4
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ServiceAuthFlowVo.java

@@ -1,6 +1,8 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.app.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -14,68 +16,98 @@ import java.util.List;
  * @create 2020-11-25 14:21
  */
 @Data
+@ApiModel(value = "服务授权工单vo")
 public class ServiceAuthFlowVo {
 
+    @ApiModelProperty(value = "id")
     private String id;
     /**
      * 申请人身份证号
      */
+    @ApiModelProperty(value = "申请人身份证号")
     private String applicantIdcard;
 
     /**
      * 申请人姓名
      */
+    @ApiModelProperty(value = "申请人姓名")
     private String applicantName;
 
     /**
      * 申请机构code
      */
+    @ApiModelProperty(value = "申请机构code")
     private String applicantOrgCode;
 
     /**
      * 申请机构名称
      */
+    @ApiModelProperty(value = "申请机构名称")
     private String applicantOrgName;
     /**
      * 应用代码
      */
+    @ApiModelProperty(value = "应用代码")
     private String appCode;
 
     /**
      * 应用名称
      */
+    @ApiModelProperty(value = "应用名称")
     private String appName;
     /**
-     * 工作单类型
+     * 申请单类型
      * SERVICE_AUTH-服务授权工作单 SERVICE_CANCEL-服务权限撤销工作单
      */
+    @ApiModelProperty(value = "申请单类型,SERVICE_AUTH-服务授权工作单 SERVICE_CANCEL-服务权限撤销工作单")
     private String flowType;
 
     /**
-     * 工作状态
+     * 工作状态
      * 根据审批服务工作流状态确定
      */
+    @ApiModelProperty(value = "工作流状态")
     private String flowStatus;
 
     /**
-     * 工单号
+     * 工作流id
      */
-    private String orderNo;
+    @ApiModelProperty(value = "工作流id")
+    private String flowId;
 
     /**
      * 需要操作的服务编码集合
      */
+    @ApiModelProperty(value = "服务编码集合")
     private List<String> serviceCodes;
 
     /**
      * 服务资源名称集合
      */
+    @ApiModelProperty(value = "服务名称集合")
     private List<String> serviceNames;
 
     /**
      * 申请时间
      */
+    @ApiModelProperty(value = "id")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date applyTime;
+
+    /**
+     * 申请时间
+     */
+    @ApiModelProperty(value = "id")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    /**
+     * 申请时间
+     */
+    @ApiModelProperty(value = "id")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
 }

+ 6 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/vo/ServiceResourceVo.java

@@ -1,5 +1,7 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.app.vo;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 /**
@@ -9,18 +11,22 @@ import lombok.Data;
  * @create 2020-11-25 14:21
  */
 @Data
+@ApiModel(value = "服务资源Vo")
 public class ServiceResourceVo extends ResourceVo {
 
     /**
      * 服务在用状态
      */
+    @ApiModelProperty(value = "服务在用状态")
     private String serviceStatus;
     /**
      * 服务编码
      */
+    @ApiModelProperty(value = "服务编码")
     private String serviceCode;
     /**
      * 服务名称
      */
+    @ApiModelProperty(value = "服务名称")
     private String serviceName;
 }

+ 17 - 16
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/audit/MgeAuditRptController.java

@@ -40,10 +40,10 @@ public class MgeAuditRptController {
 
     @ApiImplicitParam(name = "SearchDTO", value = "查询条件")
     @PostMapping(value = "audits")
-    public Result<List<UserMgeLogRptVo>> getMgeAuditRpt(SearchDTO searchDTO){
+    public Result<List<UserMgeLogRptVo>> getMgeAuditRpt(SearchDTO searchDTO) {
         searchDTO.setSort("");
         Searchable searchable = Searchable.toSearchable(searchDTO);
-        searchable.addSort(Sort.Direction.DESC,"operate_time");
+        searchable.addSort(Sort.Direction.DESC, "operate_time");
         Page<com.dragoninfo.dcuc.user.user.vo.UserMgeLogRptVo> userMgeLogSummary = iMgeLogFacade.findUserMgeLogSummary(searchDTO);
         List<UserMgeLogRptVo> vos = new ArrayList<>();
         for (com.dragoninfo.dcuc.user.user.vo.UserMgeLogRptVo userMgeLogRptVo : userMgeLogSummary) {
@@ -51,20 +51,20 @@ public class MgeAuditRptController {
             BeanUtils.copyProperties(userMgeLogRptVo, vo);
             vos.add(vo);
         }
-        Result result = Result.success(userMgeLogSummary.getTotalElements(),vos);
+        Result result = Result.success(userMgeLogSummary.getTotalElements(), vos);
         return result;
     }
 
     @ApiOperation(value = "查询管理员审计详情")
     @ApiImplicitParam(name = "id", value = "id")
     @GetMapping(value = "/detail/{id}")
-    public Result<MgeLogVo> orgAuditDetail(@PathVariable("id") String id){
+    public Result<MgeLogVo> orgAuditDetail(@PathVariable("id") String id) {
         MgeLog mgeLog = iMgeLogFacade.getMgeLog(id);
         List<MgeLog> mgeLogList = new ArrayList<MgeLog>();
         mgeLogList.add(mgeLog);
-        formatMgeLog(mgeLogList,"rpt");
+        formatMgeLog(mgeLogList, "rpt");
         MgeLogVo mgeLogVo = new MgeLogVo();
-        BeanUtils.copyProperties(mgeLog,mgeLogVo);
+        BeanUtils.copyProperties(mgeLog, mgeLogVo);
         return Result.success(mgeLogVo);
     }
 
@@ -89,11 +89,11 @@ public class MgeAuditRptController {
     @GetMapping(value = "auditList/{type}/{userId}")
     public Result<List<MgeLogVo>> auditList(@PathVariable("type") String type, @PathVariable("userId") String userId) {
         List<MgeLog> mgeLogList = iMgeLogFacade.queryList(type, userId);
-        mgeLogList = formatMgeLog(mgeLogList,"list");
+        mgeLogList = formatMgeLog(mgeLogList, "list");
         List<MgeLogVo> vos = new ArrayList<>();
         for (MgeLog mgeLog : mgeLogList) {
             MgeLogVo vo = new MgeLogVo();
-            BeanUtils.copyProperties(mgeLog,vo);
+            BeanUtils.copyProperties(mgeLog, vo);
             vos.add(vo);
         }
         return Result.success(vos);
@@ -101,22 +101,23 @@ public class MgeAuditRptController {
 
     /**
      * 格式化审计Log
+     *
      * @param mgeLogList
      * @return
      */
-    private List<MgeLog> formatMgeLog(List<MgeLog> mgeLogList,String listOrRpt){
-        for(MgeLog mgeLog : mgeLogList){
+    private List<MgeLog> formatMgeLog(List<MgeLog> mgeLogList, String listOrRpt) {
+        for (MgeLog mgeLog : mgeLogList) {
             String type = mgeLog.getObjectType();//操作对象类型
             String ids = mgeLog.getObjectId();
             ids = StringUtils.isEmpty(ids) ? "" : ids;
-            if (!AdminObjectTypeEnum.GLY.getValue().equals(type) && !AdminObjectTypeEnum.PTCD.getValue().equals(type)){
+            if (!AdminObjectTypeEnum.GLY.getValue().equals(type) && !AdminObjectTypeEnum.PTCD.getValue().equals(type)) {
                 if (AdminObjectTypeEnum.JGGL.getValue().equals(type) || AdminObjectTypeEnum.RYGL.getValue().equals(type) || AdminObjectTypeEnum.SQGL.getValue().equals(type) || AdminObjectTypeEnum.GLYGL.getValue().equals(type)) {
                     ids = iOrgInfoFacade.changeIdsToNames(ids);
                     ids = ids.replace(":-1", "(及其下属机构)").replace(":0", "").replace(":1", "").replace(":2", "(及其下属机构)");
                     mgeLog.setObjectName(ids);
                 }
 
-            }else if(type.equals(AdminObjectTypeEnum.PTCD.getValue())){
+            } else if (type.equals(AdminObjectTypeEnum.PTCD.getValue())) {
                 Map<String, MgeLog> resultMap = new TreeMap<String, MgeLog>(new Comparator<String>() {
                     @Override
                     public int compare(String o1, String o2) {
@@ -127,9 +128,9 @@ public class MgeAuditRptController {
                 mgeLogListTemp.add(mgeLog);
                 String s = JsonUtils.toJSONString(mgeLogListTemp);
                 Map<Object, Object> mgeLogMap = new HashMap<>();
-                mgeLogMap.put("mgeLogMap",s);
+                mgeLogMap.put("mgeLogMap", s);
                 mgeLogListTemp = iMenuMtAuthFacade.convertIdsToNames(mgeLogMap);
-                if(listOrRpt.equals("list")){
+                if (listOrRpt.equals("list")) {
                     mgeLog = mgeLogListTemp.get(0);
                     String key = mgeLog.getOperateTime().toString() + mgeLog.getOperateUserId();
                     if (resultMap.containsKey(key)) {
@@ -145,8 +146,8 @@ public class MgeAuditRptController {
                         mgeLogListTemp.add(entry.getValue());
                     }
                     mgeLog = mgeLogListTemp.get(0);
-                }else{
-                    if(CollectionUtils.isNotEmpty(mgeLogListTemp)){
+                } else {
+                    if (CollectionUtils.isNotEmpty(mgeLogListTemp)) {
                         mgeLog.setObjectName(mgeLogListTemp.get(0).getObjectName());
                     }
                 }

+ 0 - 56
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/ServiceAuthController.java

@@ -1,56 +0,0 @@
-package com.dragoninfo.dcuc.authweb.restcontroller.auth;
-
-import com.dragoninfo.dcuc.app.facade.IResourceFacade;
-import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthFlowDTO;
-import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthFacade;
-import com.dragoninfo.dcuc.auth.power.facade.IAppFunInfoFacade;
-import com.dragoninfo.dcuc.authweb.restcontroller.auth.vo.ServiceAuthVo;
-import com.dragoninfo.duceap.core.response.Result;
-import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import com.dragonsoft.duceap.commons.util.string.StringUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @Author yica
- * @Date 2021/2/20 17:17
- **/
-@Api(tags = {"服务授权管理接口"})
-@RestController
-@RequestMapping(value = "/authsvr/v2/service/")
-public class ServiceAuthController {
-
-    @Autowired
-    private IServiceAuthFacade serviceAuthFacade;
-
-
-
-
-    @ApiOperation(value = "服务授权列表")
-    @ApiImplicitParam(name = "searchDTO", value = "查询条件")
-    @PostMapping(value = "search")
-    public Result page(SearchDTO searchDTO){
-        Page<ServiceAuthFlowDTO> serviceAuthFlowDTOS = serviceAuthFacade.serviceAuthFlowPage(searchDTO);
-        List<ServiceAuthVo> vos=new ArrayList<>();
-        serviceAuthFlowDTOS.getContent().forEach(item->{
-            ServiceAuthVo vo=new ServiceAuthVo();
-            vo.setApplicantName(item.getApplicantName());
-            vo.setAppName(item.getAppName());
-            vo.setApprovalOrgName(item.getApplicantOrgName());
-            vo.setOrderNo(item.getDesc());
-            vo.setServiceCodes(item.getServiceCodes());
-            vo.setApplyTime(item.getApplyTime());
-            vos.add(vo);
-        });
-        return Result.success(serviceAuthFlowDTOS.getTotalElements(),vos);
-    }
-}

+ 118 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/ServiceAuthResultController.java

@@ -0,0 +1,118 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.auth;
+
+import com.dragoninfo.dcuc.app.entity.ApplyInfo;
+import com.dragoninfo.dcuc.app.entity.ServiceResource;
+import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
+import com.dragoninfo.dcuc.app.facade.IServiceResourceFacade;
+import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthResultDTO;
+import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthResultFacade;
+import com.dragoninfo.dcuc.authweb.restcontroller.auth.vo.ServiceAuthVo;
+import com.dragoninfo.dcuc.authweb.util.VersionUtils;
+import com.dragoninfo.duceap.core.response.Result;
+import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
+import com.dragonsoft.duceap.base.entity.search.SearchDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author yica
+ * @Date 2021/2/20 17:17
+ **/
+@Api(tags = {"服务授权管理接口"})
+@RestController
+@RequestMapping(value = "/authsvr/" + VersionUtils.VERSION_UID + "/service/")
+public class ServiceAuthResultController {
+
+
+    @Autowired
+    private IServiceAuthResultFacade serviceAuthResultFacade;
+
+    @Autowired
+    private IApplyInfoFacade applyInfoFacade;
+
+    @Autowired
+    private IServiceResourceFacade serviceResourceFacade;
+
+
+    @ApiOperation(value = "服务授权列表")
+    @ApiImplicitParam(name = "searchDTO", value = "查询条件")
+    @PostMapping(value = "search")
+    public Result page(SearchDTO searchDTO) {
+        Page<ServiceAuthResultDTO> serviceAuthResultDTOS = serviceAuthResultFacade.serviceAuthResultPage(searchDTO);
+        List<ServiceAuthVo> list = new ArrayList<>();
+        serviceAuthResultDTOS.forEach(item -> {
+            ServiceAuthVo serviceAuthVo = new ServiceAuthVo();
+            BeanUtils.copyProperties(item, serviceAuthVo);
+            list.add(serviceAuthVo);
+        });
+        return Result.success(serviceAuthResultDTOS.getTotalElements(), list);
+    }
+
+
+    @ApiOperation(value = "服务授权修改")
+    @ApiImplicitParam(name = "ServiceAuthVo", value = "服务授权vo")
+    @PutMapping(value = "auth/{id}")
+    public Result updateService(@RequestBody ServiceAuthVo vo) {
+        ServiceAuthResultDTO dto = new ServiceAuthResultDTO();
+        BeanUtils.copyProperties(vo, dto);
+        ResponseDTO responseDTO = serviceAuthResultFacade.updateServiceAuthResult(dto);
+        if (ResponseDTO.SUCCESS_CODE.equals(responseDTO.getStatusCode())) {
+            return Result.success(responseDTO.getMessage());
+        }
+        return Result.fail(responseDTO.getMessage());
+
+    }
+
+    @ApiOperation(value = "服务授权保存")
+    @ApiImplicitParam(name = "ServiceAuthVo", value = "服务授权vo")
+    @PostMapping(value = "auth")
+    public Result saveService(@RequestBody ServiceAuthVo vo) {
+        ServiceAuthResultDTO dto = new ServiceAuthResultDTO();
+        BeanUtils.copyProperties(vo, dto);
+        ResponseDTO responseDTO = serviceAuthResultFacade.saveServiceAuthResult(dto);
+        if (ResponseDTO.SUCCESS_CODE.equals(responseDTO.getStatusCode())) {
+            return Result.success(responseDTO.getMessage());
+        }
+        return Result.fail(responseDTO.getMessage());
+    }
+
+
+    @ApiOperation(value = "服务授权删除")
+    @ApiImplicitParam(name = "searchDTO", value = "服务授权vo")
+    @DeleteMapping(value = "auth/{id}")
+    public Result delService(@PathVariable("id") String id) {
+        ResponseDTO responseDTO = serviceAuthResultFacade.delServiceAuthResult(id);
+        if (ResponseDTO.SUCCESS_CODE.equals(responseDTO.getStatusCode())) {
+            return Result.success(responseDTO.getMessage());
+        }
+        return Result.fail(responseDTO.getMessage());
+    }
+
+
+    @ApiOperation(value = "服务授权详情")
+    @ApiImplicitParam(name = "ServiceAuthVo", value = "服务授权vo")
+    @GetMapping(value = "auth/{id}")
+    public Result getService(@PathVariable("id") String id) {
+        ServiceAuthResultDTO dto = serviceAuthResultFacade.getDetail(id);
+        ServiceAuthVo vo = new ServiceAuthVo();
+        BeanUtils.copyProperties(dto, vo);
+        ApplyInfo applyInfo = applyInfoFacade.applyDetail(dto.getAppId());
+        if (applyInfo != null) {
+            vo.setAppName(applyInfo.getApplyName());
+        }
+        ServiceResource serviceResource = serviceResourceFacade.detailByCode(dto.getServiceCode());
+        if (serviceResource != null) {
+            vo.setServiceName(serviceResource.getServiceName());
+        }
+        return Result.success(vo);
+    }
+
+}

+ 54 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/ServiceResourceController.java

@@ -0,0 +1,54 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.auth;
+
+import com.dragoninfo.dcuc.app.entity.ServiceResource;
+import com.dragoninfo.dcuc.app.facade.IServiceResourceFacade;
+import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.ServiceResourceVo;
+import com.dragoninfo.dcuc.authweb.util.VersionUtils;
+import com.dragoninfo.duceap.core.response.Result;
+import com.dragonsoft.duceap.base.entity.search.SearchDTO;
+import com.dragonsoft.duceap.core.search.Searchable;
+import com.dragonsoft.duceap.core.search.enums.SearchOperator;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+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 java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author yica
+ * @Date 2021/3/11 13:33
+ **/
+@Api(tags = {"服务资源管理接口"})
+@RestController
+@RequestMapping(value = "/authsvr/" + VersionUtils.VERSION_UID + "/resource/")
+public class ServiceResourceController {
+    @Autowired
+    private IServiceResourceFacade serviceResourceFacade;
+
+    @ApiOperation(value = "服务资源列表")
+    @ApiImplicitParam(name = "serviceName", value = "查询条件")
+    @PostMapping(value = "search/drop")
+    public Result droplist(@RequestBody ServiceResourceVo vo) {
+        SearchDTO searchDTO = new SearchDTO();
+        searchDTO.setSize("100");
+        searchDTO.setPage("0");
+        Searchable searchable = Searchable.toSearchable(searchDTO);
+        searchable.addSearchFilter("serviceName", SearchOperator.like, vo.getServiceName());
+        Page<ServiceResource> serviceResources = serviceResourceFacade.resourcePages(searchable.toSearchDTO());
+        List<ServiceResourceVo> list = new ArrayList<>();
+        serviceResources.getContent().forEach(item -> {
+            ServiceResourceVo resourceVo = new ServiceResourceVo();
+            BeanUtils.copyProperties(item, resourceVo);
+            list.add(resourceVo);
+        });
+        return Result.success(list);
+    }
+}

+ 12 - 12
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/vo/ServiceAuthVo.java

@@ -17,26 +17,26 @@ public class ServiceAuthVo {
     @ApiModelProperty(value = "id",required = true)
     private String id;
 
-    @ApiModelProperty(value = "申请人",required = true)
-    private String applicantName;
+    @ApiModelProperty(value = "应用id", required = true)
+    private String appId;
 
-    @ApiModelProperty(value = "申请单位",required = true)
-    private String approvalOrgName;
-
-    @ApiModelProperty(value = "工单号",required = true)
-    private String orderNo;
+    @ApiModelProperty(value = "应用code", required = true)
+    private String appCode;
 
     @ApiModelProperty(value = "应用名称",required = true)
     private String appName;
 
+
+    @ApiModelProperty(value = "服务id", required = true)
+    private String serviceId;
+
     @ApiModelProperty(value = "服务code",required = true)
-    private String serviceCodes;
+    private String serviceCode;
 
     @ApiModelProperty(value = "服务名称",required = true)
-    private String serviceNames;
-
+    private String serviceName;
 
-    @ApiModelProperty(value = "申请时间",required = true)
+    @ApiModelProperty(value = "创建时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private Date applyTime;
+    private Date createTime;
 }

+ 47 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/vo/ServiceResourceBackVo.java

@@ -0,0 +1,47 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.auth.vo;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @Author yica
+ * @Date 2021/3/11 13:37
+ **/
+@Data
+@Api(value = "服务资源vo")
+public class ServiceResourceBackVo {
+
+    @ApiModelProperty(value = "id", required = true)
+    private String id;
+
+
+    @ApiModelProperty(value = "资源枚举类-资源类型", required = true)
+    private String resourceType;
+
+    /**
+     * 服务编码
+     */
+    @ApiModelProperty(value = "服务编码", required = true)
+    private String serviceCode;
+
+    /**
+     * 服务名称
+     */
+    @ApiModelProperty(value = "服务名称")
+    private String serviceName;
+
+    /**
+     * 服务资源状态代码 0:未激活;1:启用;2:停止;3:撤销;
+     */
+    @ApiModelProperty(value = "服务资源状态代码 0:未激活;1:启用;2:停止;3:撤销")
+    private String serviceStatus;
+
+    /**
+     * 服务访问地址
+     */
+    @ApiModelProperty(value = "服务访问地址")
+    private String serviceUrl;
+
+
+}

+ 17 - 7
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/login/DcucLoginController.java

@@ -3,17 +3,18 @@ package com.dragoninfo.dcuc.authweb.restcontroller.login;
 
 import com.dragoninfo.dcuc.auth.auth.facade.IRoleFacade;
 import com.dragoninfo.dcuc.authweb.config.DcucAuthWebConfig;
-import com.dragoninfo.dcuc.org.entity.OrgInfo;
 import com.dragoninfo.dcuc.org.facade.IOrgInfoFacade;
 import com.dragoninfo.dcuc.user.admin.facade.IManageInfoFacade;
 import com.dragoninfo.dcuc.user.admin.facade.IMenuMtAuthFacade;
 import com.dragoninfo.dcuc.user.user.entity.UserInfo;
 import com.dragoninfo.dcuc.user.user.enumresources.UserTypeEnum;
+import com.dragoninfo.dcuc.user.user.facade.IUserFacade;
 import com.dragoninfo.dcuc.user.user.facade.IUserInfoFacade;
 import com.dragonsoft.duceap.base.entity.security.SecurityRight;
 import com.dragonsoft.duceap.base.entity.security.SecurityUser;
 import com.dragonsoft.duceap.base.utils.UserContextUtils;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
+import com.dragonsoft.duceap.web.SecurityProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,6 +41,10 @@ public class DcucLoginController {
     private IOrgInfoFacade iOrgInfoFacade;
     @Autowired
     private DcucAuthWebConfig dcucAuthWebConfig;
+    @Autowired
+    private IUserFacade userFacade;
+    @Autowired
+    private SecurityProperties securityProperties;
 
     public static final Logger logger = LoggerFactory.getLogger(DcucLoginController.class);
 
@@ -48,10 +53,18 @@ public class DcucLoginController {
 
     @GetMapping(value = "/info")
     public SecurityUser info() {
-        UserInfo userInfo;
+        UserInfo userInfo = new UserInfo();
         try {
             SecurityUser securityUser = (SecurityUser) UserContextUtils.getCurrentUser();
-            userInfo = iUserInfoFacade.userDetail(securityUser.getId());
+            if("dids".equals(securityProperties.getType())){
+                userInfo = userFacade.detailBySfzh(securityUser.getIdcard());
+                securityUser.setName(userInfo.getName());
+                securityUser.setUserName(userInfo.getName());
+            }
+            if("dcuc".equals(securityProperties.getType())){
+                userInfo = iUserInfoFacade.userDetail(securityUser.getId());
+            }
+            securityUser.setId(userInfo.getId());
             List<SecurityRight> authmenu = getAuthmenu(securityUser, userInfo);
             securityUser.setSecurityRightList(authmenu);
             //todo 因为数据库不同  后续不需要下面代码
@@ -62,13 +75,10 @@ public class DcucLoginController {
             if (iUserInfoFacade.isRootUser(securityUser.getId()) && StringUtils.isEmpty(rootOrgid)) {
                 rootOrgid = iOrgInfoFacade.getRootOrgId();
             }
-            OrgInfo orgInfo = iOrgInfoFacade.detail(userInfo.getOrgId());
-            securityUser.setSecurityOrg(orgInfo.getId());
-            securityUser.setSecurityOrgName(orgInfo.getFullName());
             securityUser.setSecurityOrg(rootOrgid);
             return securityUser;
         } catch (Exception var3) {
-            logger.error("获取用户信息异常", var3.getMessage());
+            logger.error("获取用户信息异常", var3);
             throw new SecurityException("获取用户信息异常", var3);
         }
     }

+ 74 - 0
src/main/resources/application-base.yml

@@ -0,0 +1,74 @@
+spring:
+  application:
+    name: dcuc-auth-back
+  cloud:
+    nacos:
+      discovery:
+        # 配置nacos地址
+        server-addr: 127.0.0.1:8848
+  servlet:
+    multipart:
+      # 设置文件上传大小,springboot默认的最大上传大小是1MB
+      max-file-size: 150MB
+      max-request-size: 150MB
+server:
+  port: 8861
+  servlet:
+    context-path: /dcucauth
+    jsp:
+      init-parameters:
+        development: true
+management:
+  endpoints:
+    web:
+      exposure:
+        include: '*'
+duceap:
+  swagger:
+    enabled: true
+    package-path: com.dragoninfo.dcuc.authweb
+  license:
+    #配置用来指定license对接的后端项目地址(格式:ip:port/context,如http://10.10.10.10:8080/ctx),
+    #默认使用HttpServletRequest.getLocalAddr()方法获取ip地址,
+    #应用在docker部署环境中无法获取机子的真实ip地址 考虑以配置参数的形式传入
+    address: http://127.0.0.1:8861/auth
+  apollo:
+    client:
+      host: http://10.201.3.20:8070
+  security:
+    type: dcuc
+    dcuc:
+      cas-server-url-prefix: http://10.11.1.142:8877/dcucserver
+      server-name: 10.11.0.240:8871
+      ignore-pattern: '/js/*|/img/*|/css/*|/api/*|/*.png|/rest/*|/webSocket/*|/oauthLogin/*|/authorizationPage.html|/importAuthorizationFile.html|/license/LicenseManagerServlet|/authorizationFile/'
+      app-code: QXXT0000000000000001
+      api-url: http://127.0.0.1:8861/dcucauth
+    dids2:
+      appCode: YHZX0000000000000001
+      SSOLoginUrl: http://192.168.6.128:9995/didsserver/login
+      #单点登录服务接口地址
+      SSOValidateUrl:  http://192.168.6.128:9995/didsserver/serviceValidate
+      #跳转前端地址
+      SSOServiceUrl: http://10.11.0.240:18871/dcuc/login
+      #单点登录服务接口地址
+      webServiceUrl: http://192.168.6.128:9995/didsserver/webservices/
+      noFilterUrl: services,hessian,commons,install.action,.xml,/install,/widgets-src/,/authorizationPage.html,/importAuthorizationFile.html,/license/LicenseManagerServlet,/authorizationFile/,/api/,/js/,/png/,/rest/
+hystrix:
+  command:
+    default:
+      execution:
+        timeout:
+          #hystrix熔断器开关
+          enabled: true
+        isolation:
+          thread:
+            #hystrix熔断器熔断时间
+            timeoutInMilliseconds: 30000
+ribbon:
+  ReadTimeout: 30000
+  ConnectTimeout: 30000
+dcuc:
+  authweb:
+    app-code: QXXT0000000000000001
+    auth-access: true
+    enable-api-check: false

+ 9 - 72
src/main/resources/application.yml

@@ -1,77 +1,14 @@
 spring:
-  application:
-    name: dcuc-auth-back
-  cloud:
-    nacos:
-      discovery:
-        # 配置nacos地址
-        server-addr: 127.0.0.1:8848
-  servlet:
-    multipart:
-      # 设置文件上传大小,springboot默认的最大上传大小是1MB
-      max-file-size: 150MB
-      max-request-size: 150MB
-server:
-  port: 8861
-  servlet:
-    context-path: /dcucauth
-    jsp:
-      init-parameters:
-        development: true
-management:
-  endpoints:
-    web:
-      exposure:
-        include: '*'
-duceap:
-  swagger:
-    enabled: true
-    package-path: com.dragoninfo.dcuc.authweb
-  license:
-    #配置用来指定license对接的后端项目地址(格式:ip:port/context,如http://10.10.10.10:8080/ctx),
-    #默认使用HttpServletRequest.getLocalAddr()方法获取ip地址,
-    #应用在docker部署环境中无法获取机子的真实ip地址 考虑以配置参数的形式传入
-    address: http://127.0.0.1:8861/auth
-    enabled: false
-  apollo:
-    client:
-      host: http://10.201.3.20:8070
-  security:
-    type: dcuc
-    dcuc:
-      cas-server-url-prefix: http://10.11.1.142:8877/dcucserver
-      server-name: 10.11.0.240:8871
-      ignore-pattern: '/js/*|/img/*|/css/*|/api/*|/*.png|/rest/*|/webSocket/*|/oauthLogin/*|/authorizationPage.html|/importAuthorizationFile.html|/license/LicenseManagerServlet|/authorizationFile/'
-      app-code: QXXT0000000000000001
-      api-url: http://127.0.0.1:8861/dcucauth
+  profiles:
+    include: base
+#apollo配置
 apollo:
-  # 配置中心地址(服务端)
-  meta: http://192.168.6.123:8080
+  autoUpdateInjectedSpringProperties: false
   bootstrap:
-    # 命名空间,支持多个逗号隔开。按命名空间顺序依次加载,可用于公共配置
-    namespaces: application,dragonsoft.dcuc
-    # 是否启用apollo
     enabled: false
-  # 集群,默认default
+    namespaces: application,dragonsoft.dcuc
   cluster: default
-  # 取消placeholder的自动更新功能(默认true)
-  autoUpdateInjectedSpringProperties: false
-hystrix:
-  command:
-    default:
-      execution:
-        timeout:
-          #hystrix熔断器开关
-          enabled: true
-        isolation:
-          thread:
-            #hystrix熔断器熔断时间
-            timeoutInMilliseconds: 30000
-ribbon:
-  ReadTimeout: 30000
-  ConnectTimeout: 30000
-dcuc:
-  authweb:
-    app-code: QXXT0000000000000001
-    auth-access: true
-    enable-api-check: false
+  meta: http://192.168.10.80:8081
+duceap:
+  license:
+    enabled: false