AA пре 7 месеци
родитељ
комит
e63cbcfe75
35 измењених фајлова са 617 додато и 101 уклоњено
  1. 4 0
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/api/vo/zerotrust/authticate/AppAuthReqVO.java
  2. 2 0
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/api/vo/zerotrust/authticate/DataAuthReqVO.java
  3. 4 0
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/api/vo/zerotrust/authticate/FunctionAuthReqVO.java
  4. 2 1
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/api/vo/zerotrust/authticate/ServiceAuthReqVO.java
  5. 13 13
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/audit/dto/AuthenticationLogDto.java
  6. 59 0
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/audit/dto/v2/AuthenticationLogDtoV2.java
  7. 13 3
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/audit/enums/AuthResultEnum.java
  8. 15 5
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/audit/enums/AuthenticationTypeEnum.java
  9. 3 0
      dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/vo/ApiAppAuthVo.java
  10. 8 6
      dcuc-auth-service/pom.xml
  11. 26 0
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/entity/AuthenticationLog.java
  12. 10 8
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/listener/AuthenticationLogListener.java
  13. 22 1
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/LogSendService.java
  14. 59 3
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/AppAuthLogHandler.java
  15. 63 2
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/DataAuthLogHandler.java
  16. 58 2
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/FunAuthLogHandler.java
  17. 72 8
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/LogInfoFillService.java
  18. 54 5
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/QmAuditPushService.java
  19. 62 3
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/ServiceAuthLogHandler.java
  20. 2 2
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/RoleInfoBPO.java
  21. 3 2
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/zerotrust/ZeroTrustAppAuthBusiness.java
  22. 11 7
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/zerotrust/ZeroTrustDataAuthBusiness.java
  23. 13 9
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/zerotrust/ZeroTrustFunAuthBusiness.java
  24. 13 9
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/zerotrust/ZeroTrustServiceAuthBusiness.java
  25. 1 1
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/RoleFacade.java
  26. 2 1
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/ServiceAuthFlowFacade.java
  27. 2 1
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/api/ApiDataAuthFacade.java
  28. 3 1
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IRoleService.java
  29. 3 1
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IServiceAuthResultService.java
  30. 1 1
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/DataAuthServiceImpl.java
  31. 9 2
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/RoleService.java
  32. 3 2
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/ServiceAuthResultServiceImpl.java
  33. 1 1
      dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/StaffAssignAuthInfoService.java
  34. BIN
      dcuc-auth-service/src/main/lib/auditlog-qm-tj-1.0.3-SNAPSHOT.jar
  35. 1 1
      dcuc-auth-service/src/test/java/com/dragoninfo/dcuc/auth/auth/service/QmAuditPushServiceTest.java

+ 4 - 0
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/api/vo/zerotrust/authticate/AppAuthReqVO.java

@@ -20,5 +20,9 @@ public class AppAuthReqVO {
     @ApiModelProperty(value = "用户令牌标识")
     private String userTokenId;
 
+    @ApiModelProperty(value = "任务编码")
+    private String taskId;
+    @ApiModelProperty(value = "任务名称")
+    private String taskName;
 
 }

+ 2 - 0
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/api/vo/zerotrust/authticate/DataAuthReqVO.java

@@ -33,6 +33,8 @@ public class DataAuthReqVO {
     @ApiModelProperty(value = "资源标识符")
     private String resourceId;
 
+    @ApiModelProperty(value = "任务名称")
+    private String taskName;
 
 
 }

+ 4 - 0
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/api/vo/zerotrust/authticate/FunctionAuthReqVO.java

@@ -27,6 +27,10 @@ public class FunctionAuthReqVO {
     @ApiModelProperty(value = "任务编码")
     private String taskId;
 
+    
+    @ApiModelProperty(value = "任务名称")
+    private String taskName;
+
 
 
 }

+ 2 - 1
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/api/vo/zerotrust/authticate/ServiceAuthReqVO.java

@@ -26,6 +26,7 @@ public class ServiceAuthReqVO {
      */
     @ApiModelProperty(value = "任务编码")
     private String taskId;
-
+    @ApiModelProperty(value = "任务名称")
+    private String taskName;
 
 }

+ 13 - 13
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/audit/dto/AuthenticationLogDto.java

@@ -12,21 +12,21 @@ import java.util.List;
  */
 @Data
 public class AuthenticationLogDto {
-    private String userId;
-    private String userName;
-    private String userIdcard;
-    private String requesterName;
-    private String requesterId;
-    private Date createTime;
-    private String terminalId;
-    private String tokens;
-    private String authenticationType;
-    private String state;
-    private List<AuthenticationContentDto> content;
+    private String userId; // 操作人ID
+    private String userName; // 操作人名称
+    private String userIdcard; //操作人身份证号
+    private String requesterName; // 应用名称
+    private String requesterId; // 应用标识
+    private Date createTime; // 鉴权时间
+    private String terminalId; // 终端标识
+    private String tokens; //
+    private String authenticationType;// 鉴权类型
+    private String state; // 鉴权结果
+    private List<AuthenticationContentDto> content; // 
     private String errContent;
     private String authTaskId;
-    private String userOrgCode;
-    private String userOrgName;
+    private String userOrgCode;// 操作人组织机构编码
+    private String userOrgName;// 操作人组织机构名称
     private String userToken;
     private String appToken;
 }

+ 59 - 0
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/audit/dto/v2/AuthenticationLogDtoV2.java

@@ -0,0 +1,59 @@
+package com.dragoninfo.dcuc.auth.audit.dto.v2;
+
+import com.dragoninfo.dcuc.auth.audit.dto.AuthenticationLogDto;
+
+import lombok.Data;
+
+/**
+ * V2版本
+ * @author julong
+ *
+ */
+public class AuthenticationLogDtoV2 extends AuthenticationLogDto{
+    
+	private String terminalType;//终端类型
+	private String terminalIp;//终端IP
+	private String taskId;//任务ID
+	private String taskName;//任务名称
+	private String authCode;//鉴权结果
+	private String authResponse;//返回内容
+	public String getTerminalType() {
+		return terminalType;
+	}
+	public void setTerminalType(String terminalType) {
+		this.terminalType = terminalType;
+	}
+	public String getTerminalIp() {
+		return terminalIp;
+	}
+	public void setTerminalIp(String terminalIp) {
+		this.terminalIp = terminalIp;
+	}
+	public String getTaskId() {
+		return taskId;
+	}
+	public void setTaskId(String taskId) {
+		this.taskId = taskId;
+	}
+	public String getTaskName() {
+		return taskName;
+	}
+	public void setTaskName(String taskName) {
+		this.taskName = taskName;
+	}
+	public String getAuthResponse() {
+		return authResponse;
+	}
+	public void setAuthResponse(String authResponse) {
+		this.authResponse = authResponse;
+	}
+	public String getAuthCode() {
+		return authCode;
+	}
+	public void setAuthCode(String authCode) {
+		this.authCode = authCode;
+	}
+	
+	
+	
+}

+ 13 - 3
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/audit/enums/AuthResultEnum.java

@@ -9,16 +9,18 @@ import com.dragonsoft.duceap.base.enums.ICodeEnum;
  */
 public enum AuthResultEnum implements ICodeEnum {
 
-    SUC("1","成功"),
-    FAIL("0","失败"),
+    SUC("1","成功", "001"),
+    FAIL("0","失败" , "002"),
     ;
 
     private String value;
     private String label;
+    private String code;
 
-    AuthResultEnum(String value, String label) {
+    AuthResultEnum(String value, String label, String code) {
         this.value = value;
         this.label = label;
+        this.code = code;
     }
 
     @Override
@@ -30,4 +32,12 @@ public enum AuthResultEnum implements ICodeEnum {
     public String getLabel() {
         return this.label;
     }
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
 }

+ 15 - 5
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/audit/enums/AuthenticationTypeEnum.java

@@ -11,18 +11,20 @@ public enum AuthenticationTypeEnum implements ICodeEnum {
     /**
      * 鉴权类型枚举类
      */
-    FWJJQ("FWJJQ","服务级鉴权"),
-    GNJJQ("GNJJQ","功能级鉴权"),
-    YYJJQ("YYJJQ","应用级鉴权"),
-    SJJJQ("SJJJQ","数据级鉴权"),
+    FWJJQ("FWJJQ","服务级鉴权", "04"),
+    GNJJQ("GNJJQ","功能级鉴权", "03"),
+    YYJJQ("YYJJQ","应用级鉴权", "02"),
+    SJJJQ("SJJJQ","数据级鉴权", "01"),
     ;
 
     private String value;
     private String label;
+    private String code;
 
-    AuthenticationTypeEnum(String value, String label) {
+    AuthenticationTypeEnum(String value, String label, String code) {
         this.value = value;
         this.label = label;
+        this.code = code;
     }
 
     @Override
@@ -44,5 +46,13 @@ public enum AuthenticationTypeEnum implements ICodeEnum {
         return null;
     }
 
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
 
 }

+ 3 - 0
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/vo/ApiAppAuthVo.java

@@ -30,5 +30,8 @@ public class ApiAppAuthVo {
 
     @NotNull
     private AuthUserVo userInfo;
+    
+    private String taskId;
+    private String taskName;
 
 }

+ 8 - 6
dcuc-auth-service/pom.xml

@@ -154,12 +154,14 @@
         <dependency>
             <groupId>com.dragonsoft</groupId>
             <artifactId>auditlog-qm-tj</artifactId>
-            <exclusions>
-                <exclusion>
-                    <artifactId>joda-time</artifactId>
-                    <groupId>joda-time</groupId>
-                </exclusion>
-            </exclusions>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/lib/auditlog-qm-tj-1.0.3-SNAPSHOT.jar</systemPath>
+            <!-- <exclusions> -->
+            <!--     <exclusion> -->
+            <!--         <artifactId>joda-time</artifactId> -->
+            <!--         <groupId>joda-time</groupId> -->
+            <!--     </exclusion> -->
+            <!-- </exclusions> -->
         </dependency>
 
         <!-- 分布式锁 -->

+ 26 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/entity/AuthenticationLog.java

@@ -91,6 +91,16 @@ public class AuthenticationLog implements Serializable {
      */
     @Column(name = "err_content")
     private String errContent;
+    /**
+     * 任务ID
+     */
+    @Column(name = "task_id")
+    private String taskId;
+    /**
+     * 任务名称
+     */
+    @Column(name = "task_name")
+    private String taskName;
 
     public Long getId() {
         return this.id;
@@ -193,4 +203,20 @@ public class AuthenticationLog implements Serializable {
         BeanUtils.copyProperties(authenticationLog, authenticationLogVo);
         return authenticationLogVo;
     }
+
+	public String getTaskId() {
+		return taskId;
+	}
+
+	public void setTaskId(String taskId) {
+		this.taskId = taskId;
+	}
+
+	public String getTaskName() {
+		return taskName;
+	}
+
+	public void setTaskName(String taskName) {
+		this.taskName = taskName;
+	}
 }

+ 10 - 8
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/listener/AuthenticationLogListener.java

@@ -2,6 +2,7 @@ package com.dragoninfo.dcuc.auth.audit.listener;
 
 import com.alibaba.fastjson.JSON;
 import com.dragoninfo.dcuc.auth.audit.dto.AuthenticationLogDto;
+import com.dragoninfo.dcuc.auth.audit.dto.v2.AuthenticationLogDtoV2;
 import com.dragoninfo.dcuc.auth.audit.entity.AuthenticationContent;
 import com.dragoninfo.dcuc.auth.audit.entity.AuthenticationLog;
 import com.dragoninfo.dcuc.auth.audit.service.AuthenticationLogService;
@@ -58,20 +59,21 @@ public class AuthenticationLogListener {
                 return;
             }
             AuthenticationLogDto authenticationLogDto = JSON.parseObject(content, AuthenticationLogDto.class);
+            AuthenticationLogDtoV2 authenticationLogDtoV2 = JSON.parseObject(content, AuthenticationLogDtoV2.class);
 
-            saveLog(authenticationLogDto);
+            saveLog(authenticationLogDtoV2);
 
-            detectLogService.checkShorttimeFrequentRule(authenticationLogDto);
+            detectLogService.checkShorttimeFrequentRule(authenticationLogDtoV2);
 
-            detectLogService.checkUltraVires(authenticationLogDto);
+            detectLogService.checkUltraVires(authenticationLogDtoV2);
 
-            detectLogService.checkExceptionIp(authenticationLogDto);
+            detectLogService.checkExceptionIp(authenticationLogDtoV2);
 
-            detectLogService.checkConditionsIncomplete(authenticationLogDto);
+            detectLogService.checkConditionsIncomplete(authenticationLogDtoV2);
 
-            detectLogService.checkExceptionTime(authenticationLogDto);
+            detectLogService.checkExceptionTime(authenticationLogDtoV2);
 
-            pushService.pushAuthenticationLog(authenticationLogDto);
+            pushService.pushAuthenticationLog(authenticationLogDtoV2);
         } catch (Exception e) {
             logger.error("receiveMessage error.", e);
         }
@@ -82,7 +84,7 @@ public class AuthenticationLogListener {
      *
      * @param authenticationLogDto
      */
-    private void saveLog(AuthenticationLogDto authenticationLogDto) {
+    private void saveLog(AuthenticationLogDtoV2 authenticationLogDto) {
         AuthenticationLog authenticationLog = new AuthenticationLog();
         BeanUtils.copyProperties(authenticationLogDto, authenticationLog);
         authenticationLog.setContent(

+ 22 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/LogSendService.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.dragoninfo.dcuc.auth.audit.config.AuditConfig;
 import com.dragoninfo.dcuc.auth.audit.dto.AuthenticationLogDto;
 import com.dragoninfo.dcuc.auth.audit.dto.AuthorizeLogDto;
+import com.dragoninfo.dcuc.auth.audit.dto.v2.AuthenticationLogDtoV2;
 import com.dragoninfo.dcuc.auth.config.DcucAuthKafkaConfig;
 import com.dragoninfo.duceap.commons.util.kafka.KafkaServer;
 import com.dragonsoft.duceap.base.entity.security.SecurityUser;
@@ -59,7 +60,27 @@ public class LogSendService {
     /**
      * 推送鉴权日志
      */
-    public void sendAuthenticationLog(AuthenticationLogDto log) {
+//    public void sendAuthenticationLog(AuthenticationLogDto log) {
+//        String title = "推送鉴权日志";
+//        String content = "推送鉴权日志";
+//        SecurityUser securityUser = UserContextUtils.getCurrentUser();
+//        MessageInfoVo messages = getMessageVo(securityUser, title, content, auditConfig.getAuthenticationTopic());
+//        messages.setContent(JSON.toJSONString(log));
+//        List<MessageInfoVo> msg = new ArrayList<>();
+//        msg.add(messages);
+//
+//        MessageInfoReqVo requestVo = new MessageInfoReqVo();
+//        requestVo.setTopic(auditConfig.getAuthenticationTopic());
+//        requestVo.setAppKey(dcucAuthKafkaConfig.getAppkey());
+//        requestVo.setAppSecret(dcucAuthKafkaConfig.getAppSecret());
+//        requestVo.setMessages(msg);
+//        ResponseResult result = kafkaServer.send(requestVo, dcucAuthKafkaConfig.getKafkaServers());
+//    }
+    
+    /**
+     * 推送鉴权日志 V2
+     */
+    public void sendAuthenticationLogV2(AuthenticationLogDtoV2 log) {
         String title = "推送鉴权日志";
         String content = "推送鉴权日志";
         SecurityUser securityUser = UserContextUtils.getCurrentUser();

+ 59 - 3
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/AppAuthLogHandler.java

@@ -4,6 +4,7 @@ import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
 import com.dragoninfo.dcuc.auth.audit.dto.AuthenticationContentDto;
 import com.dragoninfo.dcuc.auth.audit.dto.AuthenticationLogDto;
+import com.dragoninfo.dcuc.auth.audit.dto.v2.AuthenticationLogDtoV2;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthenticationTypeEnum;
 import com.dragoninfo.dcuc.auth.audit.service.LogSendService;
@@ -13,6 +14,7 @@ import com.dragoninfo.dcuc.auth.sub.vo.AuthUserVo;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -43,7 +45,50 @@ public class AppAuthLogHandler {
      * @param appLitByUserId 有权限的应用
      * @param resultEnum 鉴权结果
      */
-    public void sendAuthenticationLog(ApiAppAuthVo apiAppAuthVo, List<AppDataSensitiveLevelDTO> appLitByUserId, AuthResultEnum resultEnum) {
+//    public void sendAuthenticationLog(ApiAppAuthVo apiAppAuthVo, List<AppDataSensitiveLevelDTO> appLitByUserId, AuthResultEnum resultEnum) {
+//        AuthUserVo userInfo = apiAppAuthVo.getUserInfo();
+//
+//        List<AuthenticationContentDto> contentDtos = appLitByUserId.stream().map(e -> {
+//            AuthenticationContentDto authenticationContentDto = new AuthenticationContentDto();
+//            authenticationContentDto.setContentId(e.getCode());
+//            authenticationContentDto.setContentName(e.getName());
+//            return authenticationContentDto;
+//        }).collect(Collectors.toList());
+//
+//        AuthenticationLogDto authenticationLogDto = new AuthenticationLogDto();
+//        authenticationLogDto.setUserId(userInfo.getId());
+//        authenticationLogDto.setUserName(userInfo.getName());
+//        authenticationLogDto.setUserIdcard(userInfo.getIdcard());
+//        authenticationLogDto.setCreateTime(new Date());
+//        authenticationLogDto.setAuthenticationType(AuthenticationTypeEnum.YYJJQ.getValue());
+//        authenticationLogDto.setState(resultEnum.getValue());
+//        authenticationLogDto.setContent(contentDtos);
+//
+//        String requestAppCode = apiAppAuthVo.getRequestAppCode();
+//        if (StringUtils.isNotBlank(requestAppCode)) {
+//            ApplyInfo applyInfo = applyInfoFacade.getAppByCode(requestAppCode);
+//            if (null != applyInfo) {
+//                authenticationLogDto.setRequesterId(applyInfo.getApplyCode());
+//                authenticationLogDto.setRequesterName(applyInfo.getApplyName());
+//            }
+//        }
+//
+//        authenticationLogDto.setTerminalId(apiAppAuthVo.getTerminalIp());
+//        authenticationLogDto.setUserToken(apiAppAuthVo.getUserToken());
+//        authenticationLogDto.setUserOrgCode(userInfo.getOrgCode());
+//        authenticationLogDto.setUserOrgName(userInfo.getOrgName());
+//        authenticationLogDto.setAppToken(apiAppAuthVo.getAppToken());
+//        
+//        logSendService.sendAuthenticationLog(authenticationLogDto);
+//    }
+    /**
+     * 2024-8-21 BU对接新规范
+     * @param apiAppAuthVo
+     * @param appLitByUserId
+     * @param resultEnum
+     * @param message 
+     */
+    public void sendAuthenticationLogV2(ApiAppAuthVo apiAppAuthVo, List<AppDataSensitiveLevelDTO> appLitByUserId, AuthResultEnum resultEnum, String message) {
         AuthUserVo userInfo = apiAppAuthVo.getUserInfo();
 
         List<AuthenticationContentDto> contentDtos = appLitByUserId.stream().map(e -> {
@@ -76,7 +121,18 @@ public class AppAuthLogHandler {
         authenticationLogDto.setUserOrgCode(userInfo.getOrgCode());
         authenticationLogDto.setUserOrgName(userInfo.getOrgName());
         authenticationLogDto.setAppToken(apiAppAuthVo.getAppToken());
-
-        logSendService.sendAuthenticationLog(authenticationLogDto);
+        
+        //2024-8-21 根据BU要求新增参数
+        AuthenticationLogDtoV2 authenticationLogDtoV2 = new AuthenticationLogDtoV2();
+        BeanUtils.copyProperties(authenticationLogDto, authenticationLogDtoV2);
+        
+        authenticationLogDtoV2.setTerminalType(apiAppAuthVo.getTerminalIp());
+        authenticationLogDtoV2.setTerminalIp(apiAppAuthVo.getTerminalIp());
+        authenticationLogDtoV2.setTaskId(apiAppAuthVo.getTaskId());
+        authenticationLogDtoV2.setTaskName(apiAppAuthVo.getTaskName());
+        authenticationLogDtoV2.setAuthResponse(message);
+        authenticationLogDtoV2.setAuthenticationType(AuthenticationTypeEnum.YYJJQ.getCode());
+        authenticationLogDtoV2.setAuthCode(resultEnum.getCode());
+        logSendService.sendAuthenticationLogV2(authenticationLogDtoV2);
     }
 }

+ 63 - 2
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/DataAuthLogHandler.java

@@ -5,7 +5,9 @@ import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
 import com.dragoninfo.dcuc.app.facade.IDataResourceFacade;
 import com.dragoninfo.dcuc.app.vo.DataLevelVo;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.DataAuthReqVO;
 import com.dragoninfo.dcuc.auth.audit.dto.*;
+import com.dragoninfo.dcuc.auth.audit.dto.v2.AuthenticationLogDtoV2;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthenticationTypeEnum;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthorizeTypeEnum;
@@ -26,6 +28,7 @@ import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
 import com.google.common.collect.Lists;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -187,7 +190,51 @@ public class DataAuthLogHandler {
      * @param appToken
      * @param userToken
      */
-    public void sendAuthenticationLog(AuthResultEnum state, DataItemsCheckDto dataItemsCheckDto, String ip, String appToken, String userToken) {
+//    public void sendAuthenticationLog(AuthResultEnum state, DataItemsCheckDto dataItemsCheckDto, String ip, String appToken, String userToken) {
+//        AuthUserInfo userInfo = authUserInfoService.findByIdcard(dataItemsCheckDto.getIdcard());
+//        ApplyInfo app = applyInfoFacade.getAppByCode(dataItemsCheckDto.getCurrentAppCode());
+//
+//        List<AuthenticationContentDto> contentDtos = dataItemsCheckDto.getDataItemsDtoList().stream().map(e -> {
+//            AuthenticationContentDto authenticationContentDto = new AuthenticationContentDto();
+//            authenticationContentDto.setContentId(e.getDataItemCode());
+//            authenticationContentDto.setContentName(e.getResourceCode());
+//            return authenticationContentDto;
+//        }).collect(Collectors.toList());
+//
+//        AuthenticationLogDto authenticationLogDto = new AuthenticationLogDto();
+//
+//        authenticationLogDto.setUserIdcard(dataItemsCheckDto.getIdcard());
+//        authenticationLogDto.setCreateTime(new Date());
+//        authenticationLogDto.setAuthenticationType(AuthenticationTypeEnum.SJJJQ.getValue());
+//        authenticationLogDto.setState(state.getValue());
+//        authenticationLogDto.setContent(contentDtos);
+//        authenticationLogDto.setRequesterId(dataItemsCheckDto.getCurrentAppCode());
+//        authenticationLogDto.setRequesterName(app.getApplyName());
+//        authenticationLogDto.setTerminalId(ip);
+//        authenticationLogDto.setUserToken(userToken);
+//        authenticationLogDto.setAppToken(appToken);
+//
+//        if (null != userInfo) {
+//            authenticationLogDto.setUserId(userInfo.getId());
+//            authenticationLogDto.setUserName(userInfo.getName());
+//            authenticationLogDto.setUserOrgCode(userInfo.getOrgCode());
+//            authenticationLogDto.setUserOrgName(userInfo.getOrgName());
+//        }
+//
+//        logSendService.sendAuthenticationLog(authenticationLogDto);
+//    }
+    
+    /**
+     * 数据鉴权日志
+     * @param state
+     * @param dataItemsCheckDto
+     * @param ip
+     * @param appToken
+     * @param userToken
+     * @param dataAuthReqVO 
+     */
+    public void sendAuthenticationLogV2(AuthResultEnum state, DataItemsCheckDto dataItemsCheckDto, String ip, String appToken, 
+    		String userToken, DataAuthReqVO dataAuthReqVO, String message) {
         AuthUserInfo userInfo = authUserInfoService.findByIdcard(dataItemsCheckDto.getIdcard());
         ApplyInfo app = applyInfoFacade.getAppByCode(dataItemsCheckDto.getCurrentAppCode());
 
@@ -218,6 +265,20 @@ public class DataAuthLogHandler {
             authenticationLogDto.setUserOrgName(userInfo.getOrgName());
         }
 
-        logSendService.sendAuthenticationLog(authenticationLogDto);
+      //2024-8-21 根据BU要求新增参数
+        AuthenticationLogDtoV2 authenticationLogDtoV2 = new AuthenticationLogDtoV2();
+        BeanUtils.copyProperties(authenticationLogDto, authenticationLogDtoV2);
+        
+        authenticationLogDtoV2.setTerminalType(ip);
+        authenticationLogDtoV2.setTerminalIp(ip);
+        if(dataAuthReqVO!= null) {
+        	authenticationLogDtoV2.setTaskId(dataAuthReqVO.getTaskId());
+            authenticationLogDtoV2.setTaskName(dataAuthReqVO.getTaskName());
+        }
+        
+        authenticationLogDtoV2.setAuthResponse(message);
+        authenticationLogDtoV2.setAuthenticationType(AuthenticationTypeEnum.SJJJQ.getCode());
+        authenticationLogDtoV2.setAuthCode(state.getCode());
+        logSendService.sendAuthenticationLogV2(authenticationLogDtoV2);
     }
 }

+ 58 - 2
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/FunAuthLogHandler.java

@@ -2,8 +2,10 @@ package com.dragoninfo.dcuc.auth.audit.service.log;
 
 import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.FunctionAuthReqVO;
 import com.dragoninfo.dcuc.auth.audit.dto.AuthenticationContentDto;
 import com.dragoninfo.dcuc.auth.audit.dto.AuthenticationLogDto;
+import com.dragoninfo.dcuc.auth.audit.dto.v2.AuthenticationLogDtoV2;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthenticationTypeEnum;
 import com.dragoninfo.dcuc.auth.audit.service.LogSendService;
@@ -13,6 +15,7 @@ import com.dragoninfo.dcuc.auth.sub.entity.AuthUserInfo;
 import com.dragoninfo.dcuc.auth.sub.service.IAuthUserInfoService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -42,7 +45,48 @@ public class FunAuthLogHandler {
     /**
      * 发送功能鉴权日志
      */
-    public void sendAuthenticationLog(AuthResultEnum state, RoleApiDto dto, List<AppFunInfoDTO> funs, String ip, String userToken, String appToken) {
+//    public void sendAuthenticationLog(AuthResultEnum state, RoleApiDto dto, List<AppFunInfoDTO> funs, String ip, String userToken, String appToken) {
+//        logger.info("FunAuthLogHandler sendAuthenticationLog client ip :{}", ip);
+//
+//        AuthUserInfo userInfo = authUserInfoService.findByIdcard(dto.getIdcard());
+//        ApplyInfo app = applyInfoFacade.getAppByCode(dto.getAppCode());
+//
+//        List<AuthenticationContentDto> contentDtos = funs.stream().map(e -> {
+//            AuthenticationContentDto authenticationContentDto = new AuthenticationContentDto();
+//            authenticationContentDto.setContentId(e.getCode());
+//            authenticationContentDto.setContentName(e.getName());
+//            return authenticationContentDto;
+//        }).collect(Collectors.toList());
+//
+//        AuthenticationLogDto authenticationLogDto = new AuthenticationLogDto();
+//        authenticationLogDto.setUserIdcard(dto.getIdcard());
+//        authenticationLogDto.setRequesterName(app.getApplyName());
+//        authenticationLogDto.setRequesterId(dto.getAppCode());
+//        authenticationLogDto.setCreateTime(new Date());
+//        authenticationLogDto.setAuthenticationType(AuthenticationTypeEnum.GNJJQ.getValue());
+//        authenticationLogDto.setState(state.getValue());
+//        authenticationLogDto.setContent(contentDtos);
+//        authenticationLogDto.setTerminalId(ip);
+//        authenticationLogDto.setUserToken(userToken);
+//        if (userInfo != null) {
+//            authenticationLogDto.setUserId(userInfo.getId());
+//            authenticationLogDto.setUserName(userInfo.getName());
+//            authenticationLogDto.setUserOrgCode(userInfo.getOrgCode());
+//            authenticationLogDto.setUserOrgName(userInfo.getOrgName());
+//        }
+//
+//        authenticationLogDto.setAppToken(appToken);
+//        logSendService.sendAuthenticationLog(authenticationLogDto);
+//
+//    }
+    
+    /**
+     * 发送功能鉴权日志 v2
+     * @param message 
+     * @param functionAuthReqVO 
+     */
+    public void sendAuthenticationLogV2(AuthResultEnum state, RoleApiDto dto, List<AppFunInfoDTO> funs, String ip, 
+    		String userToken, String appToken, FunctionAuthReqVO functionAuthReqVO, String message) {
         logger.info("FunAuthLogHandler sendAuthenticationLog client ip :{}", ip);
 
         AuthUserInfo userInfo = authUserInfoService.findByIdcard(dto.getIdcard());
@@ -73,7 +117,19 @@ public class FunAuthLogHandler {
         }
 
         authenticationLogDto.setAppToken(appToken);
-        logSendService.sendAuthenticationLog(authenticationLogDto);
+        
+      //2024-8-21 根据BU要求新增参数
+        AuthenticationLogDtoV2 authenticationLogDtoV2 = new AuthenticationLogDtoV2();
+        BeanUtils.copyProperties(authenticationLogDto, authenticationLogDtoV2);
+        
+        authenticationLogDtoV2.setTerminalType(ip);
+        authenticationLogDtoV2.setTerminalIp(ip);
+        authenticationLogDtoV2.setTaskId(functionAuthReqVO.getTaskId());
+        authenticationLogDtoV2.setTaskName(functionAuthReqVO.getTaskName());
+        authenticationLogDtoV2.setAuthResponse(message);
+        authenticationLogDtoV2.setAuthenticationType(AuthenticationTypeEnum.GNJJQ.getCode());
+        authenticationLogDtoV2.setAuthCode(state.getCode());
+        logSendService.sendAuthenticationLogV2(authenticationLogDtoV2);
 
     }
 }

+ 72 - 8
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/LogInfoFillService.java

@@ -1,5 +1,8 @@
 package com.dragoninfo.dcuc.auth.audit.service.log;
 
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.DataAuthReqVO;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.FunctionAuthReqVO;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.ServiceAuthReqVO;
 import com.dragoninfo.dcuc.auth.audit.config.AuditConfig;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.auth.dto.*;
@@ -89,12 +92,30 @@ public class LogInfoFillService {
      * @param userToken
      * @param appToken
      */
+//    @Async
+//    public void sendFunAuthenticationLog(AuthResultEnum suc, RoleApiDto dto, List<AppFunInfoDTO> funs, String ip, String userToken, String appToken) {
+//        if (!auditConfig.getKafka()) {
+//            return;
+//        }
+//        funAuthLogHandler.sendAuthenticationLog(suc, dto, funs, ip, userToken, appToken);
+//    }
+    /**
+     * 2024-8-21 BU对接新规范
+     * @param suc
+     * @param dto
+     * @param funs
+     * @param ip
+     * @param userToken
+     * @param appToken
+     * @param message 
+     * @param functionAuthReqVO 
+     */
     @Async
-    public void sendFunAuthenticationLog(AuthResultEnum suc, RoleApiDto dto, List<AppFunInfoDTO> funs, String ip, String userToken, String appToken) {
+    public void sendFunAuthenticationLogV2(AuthResultEnum suc, RoleApiDto dto, List<AppFunInfoDTO> funs, String ip, String userToken, String appToken, FunctionAuthReqVO functionAuthReqVO, String message) {
         if (!auditConfig.getKafka()) {
             return;
         }
-        funAuthLogHandler.sendAuthenticationLog(suc, dto, funs, ip, userToken, appToken);
+        funAuthLogHandler.sendAuthenticationLogV2(suc, dto, funs, ip, userToken, appToken, functionAuthReqVO, message);
     }
 
     /**
@@ -116,12 +137,25 @@ public class LogInfoFillService {
     /**
      * 发送服务鉴权日志
      */
+//    @Async
+//    public void sendServiceAuthenticationLog(AuthResultEnum state, String idcard, String appCode, String userToken, String appToken, List<ServiceAuthResult> results, String ip) {
+//        if (!auditConfig.getKafka()) {
+//            return;
+//        }
+//        serviceAuthLogHandler.sendAuthenticationLog(state, idcard, appCode, userToken, appToken, results, ip);
+//    }
+    
+    /**
+     * 发送服务鉴权日志V2
+     * @param message 
+     * @param serviceAuthReqVO 
+     */
     @Async
-    public void sendServiceAuthenticationLog(AuthResultEnum state, String idcard, String appCode, String userToken, String appToken, List<ServiceAuthResult> results, String ip) {
+    public void sendServiceAuthenticationLogV2(AuthResultEnum state, String idcard, String appCode, String userToken, String appToken, List<ServiceAuthResult> results, String ip, ServiceAuthReqVO serviceAuthReqVO, String message) {
         if (!auditConfig.getKafka()) {
             return;
         }
-        serviceAuthLogHandler.sendAuthenticationLog(state, idcard, appCode, userToken, appToken, results, ip);
+        serviceAuthLogHandler.sendAuthenticationLogV2(state, idcard, appCode, userToken, appToken, results, ip, serviceAuthReqVO, message);
     }
 
     /**
@@ -237,16 +271,46 @@ public class LogInfoFillService {
      * @param appToken
      * @param userToken
      */
+//    @Async
+//    public void sendDataAuthenticationLog(AuthResultEnum state, DataItemsCheckDto dataItemsCheckDto, String ip, String appToken, String userToken) {
+//        if (!auditConfig.getKafka()) {
+//            return;
+//        }
+//        dataAuthLogHandler.sendAuthenticationLog(state, dataItemsCheckDto, ip, appToken, userToken);
+//    }
+    
+    /**
+     * 2024-8-21 BU对接新规范
+     * @param state
+     * @param dataItemsCheckDto
+     * @param ip
+     * @param appToken
+     * @param userToken
+     * @param dataAuthReqVO
+     * @param message
+     */
     @Async
-    public void sendDataAuthenticationLog(AuthResultEnum state, DataItemsCheckDto dataItemsCheckDto, String ip, String appToken, String userToken) {
+    public void sendDataAuthenticationLogV2(AuthResultEnum state, DataItemsCheckDto dataItemsCheckDto, String ip, String appToken, String userToken, DataAuthReqVO dataAuthReqVO, String message) {
         if (!auditConfig.getKafka()) {
             return;
         }
-        dataAuthLogHandler.sendAuthenticationLog(state, dataItemsCheckDto, ip, appToken, userToken);
+        dataAuthLogHandler.sendAuthenticationLogV2(state, dataItemsCheckDto, ip, appToken, userToken, dataAuthReqVO, message);
     }
 
+
+//    @Async
+//    public void sendAppAuthenticationLog(ApiAppAuthVo apiAppAuthVo, List<AppDataSensitiveLevelDTO> appLitByUserId, AuthResultEnum resultEnum) {
+//        appAuthLogHandler.sendAuthenticationLog(apiAppAuthVo, appLitByUserId, resultEnum);
+//    }
+    
+    /**
+     * 2024-8-21 BU对接新规范
+     * @param apiAppAuthVo
+     * @param appLitByUserId
+     * @param resultEnum
+     */
     @Async
-    public void sendAppAuthenticationLog(ApiAppAuthVo apiAppAuthVo, List<AppDataSensitiveLevelDTO> appLitByUserId, AuthResultEnum resultEnum) {
-        appAuthLogHandler.sendAuthenticationLog(apiAppAuthVo, appLitByUserId, resultEnum);
+    public void sendAppAuthenticationLogV2(ApiAppAuthVo apiAppAuthVo, List<AppDataSensitiveLevelDTO> appLitByUserId, AuthResultEnum resultEnum, String message) {
+        appAuthLogHandler.sendAuthenticationLogV2(apiAppAuthVo, appLitByUserId, resultEnum, message);
     }
 }

+ 54 - 5
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/QmAuditPushService.java

@@ -1,9 +1,14 @@
 package com.dragoninfo.dcuc.auth.audit.service.log;
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.dragoninfo.dcuc.auth.audit.config.AuditConfig;
 import com.dragoninfo.dcuc.auth.audit.constance.AuditConstance;
 import com.dragoninfo.dcuc.auth.audit.dto.*;
+import com.dragoninfo.dcuc.auth.audit.dto.v2.AuthenticationLogDtoV2;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthenticationTypeEnum;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthorizeTypeEnum;
@@ -11,8 +16,11 @@ import com.dragoninfo.dcuc.auth.audit.enums.RiskProgrammeTypeEnum;
 import com.dragonsoft.auditlog.collection.qmtj.LogSendComponent;
 import com.dragonsoft.auditlog.collection.qmtj.pojo.req.AuthBusLog;
 import com.dragonsoft.auditlog.collection.qmtj.pojo.req.AuthenticationBusLog;
+import com.dragonsoft.auditlog.collection.qmtj.pojo.req.AuthenticationBusLogV2;
 import com.dragonsoft.auditlog.collection.qmtj.pojo.req.AuthenticationRiskLog;
 import com.dragonsoft.auditlog.collection.qmtj.pojo.req.TokenOperationLog;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
@@ -119,7 +127,7 @@ public class QmAuditPushService {
      *
      * @param authenticationLogDto
      */
-    public void pushAuthenticationLog(AuthenticationLogDto authenticationLogDto) {
+    public void pushAuthenticationLog(AuthenticationLogDtoV2 authenticationLogDto) {
         Boolean qmEnabled = config.getQmEnabled();
         if (null == qmEnabled || !qmEnabled) {
             return;
@@ -247,13 +255,22 @@ public class QmAuditPushService {
     }
 
 
-    private void pushAuthenticationLogToAudit(AuthenticationLogDto authenticationLogDto) {
+    private void pushAuthenticationLogToAudit(AuthenticationLogDtoV2 authenticationLogDto) {
         String sysId = config.getSysId();
         String logType = AuditConstance.AUDIT_LOG_TYPE_JQ;
-        List<AuthenticationBusLog> busLogs = getAuthenticationBusLog(authenticationLogDto);
+        List<AuthenticationBusLogV2> busLogs = constructAuthenticationBusLogsV2(authenticationLogDto);
         if (CollectionUtils.isNotEmpty(busLogs)) {
-            log.info("=========推送审计鉴权日志=======");
-            logSendComponent.sendAuthenticationBusLog(sysId, logType, busLogs);
+        	ObjectMapper mapper = new ObjectMapper();
+        	try {
+				String writeValueAsString = mapper.writeValueAsString(busLogs);
+				JSONArray jsonArray = JSONObject.parseArray(writeValueAsString);
+				log.info("=========推送审计鉴权日志=======");
+	            logSendComponent.sendAuthenticationBusLogV2(sysId, logType, jsonArray);
+			} catch (JsonProcessingException e) {
+				e.printStackTrace();
+			}
+        	
+           
         }
     }
 
@@ -298,6 +315,38 @@ public class QmAuditPushService {
         list.add(busLog);
         return list;
     }
+    /**
+     * 对接BU新规范
+     * @param dto
+     * @return
+     */
+    private List<AuthenticationBusLogV2> constructAuthenticationBusLogsV2(AuthenticationLogDtoV2 dto) {
+        List<AuthenticationBusLogV2> list = new ArrayList<>();
+        if (StringUtils.isBlank(dto.getAuthenticationType())) {
+            return list;
+        }
+        AuthenticationBusLogV2 busLog = new AuthenticationBusLogV2();
+        
+        Map<String,Object> baseStandardInfo = new HashMap<>();
+        baseStandardInfo.put("appName", dto.getRequesterName());
+        baseStandardInfo.put("operatorCertNo", dto.getUserIdcard());
+        baseStandardInfo.put("operatorName", dto.getUserName());
+        baseStandardInfo.put("operatorOrgName", dto.getUserOrgName());
+        baseStandardInfo.put("operatorOrgCode", dto.getUserOrgCode());
+//        baseStandardInfo.put("terminalId", dto.getTerminalId());
+//        baseStandardInfo.put("terminalIp", dto.getTerminalIp());
+//        baseStandardInfo.put("terminalType", dto.getTerminalType());
+        busLog.setBaseStandardInfo(baseStandardInfo);
+//        busLog.setAuthCode(dto.getAuthCode());
+//        busLog.setAuthResponse(dto.getAuthResponse());
+        busLog.setTaskId(dto.getTaskId());
+        busLog.setTaskName(dto.getTaskName());
+        busLog.setOperateTime(DateUtil.format(dto.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
+//        busLog.setOperateType(dto.getAuthenticationType());
+        busLog.setOperateType("15");
+        list.add(busLog);
+        return list;
+    }
 
     private void getAuthenticationContent(String authType, AuthenticationBusLog busLog, List<AuthenticationContentDto> content) {
         String codes = "";

+ 62 - 3
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/audit/service/log/ServiceAuthLogHandler.java

@@ -5,8 +5,10 @@ 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.api.vo.zerotrust.authticate.ServiceAuthReqVO;
 import com.dragoninfo.dcuc.auth.audit.constance.AuditConstance;
 import com.dragoninfo.dcuc.auth.audit.dto.*;
+import com.dragoninfo.dcuc.auth.audit.dto.v2.AuthenticationLogDtoV2;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthenticationTypeEnum;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthorizeTypeEnum;
@@ -22,6 +24,7 @@ import com.google.common.base.Joiner;
 import com.google.common.collect.Lists;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -87,7 +90,49 @@ public class ServiceAuthLogHandler {
     /**
      * 发送服务鉴权日志
      */
-    public void sendAuthenticationLog(AuthResultEnum state, String idcard, String appCode, String userToken, String appToken, List<ServiceAuthResult> results, String ip) {
+//    public void sendAuthenticationLog(AuthResultEnum state, String idcard, String appCode, String userToken, String appToken, List<ServiceAuthResult> results, String ip) {
+//        logger.info("ServiceAuthLogHandler sendAuthenticationLog client ip :{}", ip);
+//
+//        AuthUserInfo userInfo = authUserInfoService.findByIdcard(idcard);
+//        ApplyInfo app = applyInfoFacade.getAppByCode(appCode);
+//
+//        List<AuthenticationContentDto> contentDtos = results.stream().map(e -> {
+//            AuthenticationContentDto authenticationContentDto = new AuthenticationContentDto();
+//            authenticationContentDto.setContentId(e.getServiceCode());
+//            authenticationContentDto.setContentName(e.getServiceCode());
+//            return authenticationContentDto;
+//        }).collect(Collectors.toList());
+//
+//        AuthenticationLogDto authenticationLogDto = new AuthenticationLogDto();
+//        authenticationLogDto.setUserIdcard(idcard);
+//        authenticationLogDto.setRequesterName(app.getApplyName());
+//        authenticationLogDto.setRequesterId(appCode);
+//        authenticationLogDto.setCreateTime(new Date());
+//        authenticationLogDto.setTokens(Joiner.on("、").skipNulls().join(userToken, appToken));
+//        authenticationLogDto.setAuthenticationType(AuthenticationTypeEnum.FWJJQ.getValue());
+//        authenticationLogDto.setState(state.getValue());
+//        authenticationLogDto.setContent(contentDtos);
+//        authenticationLogDto.setTerminalId(ip);
+//        authenticationLogDto.setUserToken(userToken);
+//        authenticationLogDto.setAppToken(appToken);
+//
+//        if (userInfo != null) {
+//            authenticationLogDto.setUserId(userInfo.getId());
+//            authenticationLogDto.setUserName(userInfo.getName());
+//            authenticationLogDto.setUserOrgCode(userInfo.getOrgCode());
+//            authenticationLogDto.setUserOrgName(userInfo.getOrgName());
+//        }
+//
+//        logSendService.sendAuthenticationLog(authenticationLogDto);
+//    }
+    
+    /**
+     * 发送服务鉴权日志V2
+     * @param message 
+     * @param serviceAuthReqVO 
+     */
+    public void sendAuthenticationLogV2(AuthResultEnum state, String idcard, String appCode, String userToken, 
+    		String appToken, List<ServiceAuthResult> results, String ip, ServiceAuthReqVO serviceAuthReqVO, String message) {
         logger.info("ServiceAuthLogHandler sendAuthenticationLog client ip :{}", ip);
 
         AuthUserInfo userInfo = authUserInfoService.findByIdcard(idcard);
@@ -119,8 +164,22 @@ public class ServiceAuthLogHandler {
             authenticationLogDto.setUserOrgCode(userInfo.getOrgCode());
             authenticationLogDto.setUserOrgName(userInfo.getOrgName());
         }
-
-        logSendService.sendAuthenticationLog(authenticationLogDto);
+        
+      //2024-8-21 根据BU要求新增参数
+        AuthenticationLogDtoV2 authenticationLogDtoV2 = new AuthenticationLogDtoV2();
+        BeanUtils.copyProperties(authenticationLogDto, authenticationLogDtoV2);
+        
+        authenticationLogDtoV2.setTerminalType(ip);
+        authenticationLogDtoV2.setTerminalIp(ip);
+        if(serviceAuthReqVO!= null) {
+        	authenticationLogDtoV2.setTaskId(serviceAuthReqVO.getTaskId());
+            authenticationLogDtoV2.setTaskName(serviceAuthReqVO.getTaskName());
+        }
+        
+        authenticationLogDtoV2.setAuthResponse(message);
+        authenticationLogDtoV2.setAuthenticationType(AuthenticationTypeEnum.FWJJQ.getCode());
+        authenticationLogDtoV2.setAuthCode(state.getCode());
+        logSendService.sendAuthenticationLogV2(authenticationLogDtoV2);
     }
 
     /**

+ 2 - 2
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/bpo/RoleInfoBPO.java

@@ -138,8 +138,8 @@ public class RoleInfoBPO extends BaseBPO<RoleInfo, String> {
         PersistentFactory.getHibernateDao().bulkUpdate(hql, new Object[]{roleId});
 
         //员工授权信息表
-        hql = "delete from StaffAssignAuthLog where roleId=?";
-        PersistentFactory.getHibernateDao().bulkUpdate(hql, new Object[]{roleId});
+//        hql = "delete from StaffAssignAuthLog where roleId=?";
+//        PersistentFactory.getHibernateDao().bulkUpdate(hql, new Object[]{roleId});
     }
 
     /**

+ 3 - 2
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/zerotrust/ZeroTrustAppAuthBusiness.java

@@ -103,10 +103,11 @@ public class ZeroTrustAppAuthBusiness implements IZeroTrustAppAuthBusiness {
             log.error("查询不到用户信息:{}", pId);
             ApiAppAuthVo appAuthVo = ApiAppAuthVo.builder()
                     .terminalIp(IpUtils.getRealIpAdrress(RequestUtils.getRequest()))
-                    .userToken(userTokenId)
+                    .userToken(userTokenId).taskId(appAuthReqVO.getTaskId()).taskName(appAuthReqVO.getTaskName())
                     .build();
             // 发送鉴权失败日志
-            logInfoFillService.sendAppAuthenticationLog(appAuthVo, Collections.emptyList(), AuthResultEnum.FAIL);
+            String message = String.format("查询不到用户信息:%s", pId);
+            logInfoFillService.sendAppAuthenticationLogV2(appAuthVo, Collections.emptyList(), AuthResultEnum.FAIL, message);
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.OPERATE_FAIL);
         }
 

+ 11 - 7
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/zerotrust/ZeroTrustDataAuthBusiness.java

@@ -84,9 +84,9 @@ public class ZeroTrustDataAuthBusiness implements IZeroTrustDataAuthBusiness {
         AuthUserVo userInfo = tokenInfo.getUserInfo();
         if (null == userInfo) {
             log.error("查询不到用户信息:{}", tokenInfo.getUserToken().getPid());
-
+            String message = String.format("查询不到用户信息:%s", tokenInfo.getUserToken().getPid());
             // 发送鉴权失败日志
-            logInfoFillService.sendDataAuthenticationLog(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId());
+            logInfoFillService.sendDataAuthenticationLogV2(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId(), dataAuthReqVO, message);
 
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.TOKEN_FAIL);
         }
@@ -97,8 +97,9 @@ public class ZeroTrustDataAuthBusiness implements IZeroTrustDataAuthBusiness {
         if (!checkTaskIdMessage.isRespSuccess()) {
             log.error("==============任务信息校验失败:{}===========", taskId);
 
+            String message = String.format("任务信息校验失败:%s", taskId);
             // 发送鉴权失败日志
-            logInfoFillService.sendDataAuthenticationLog(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId());
+            logInfoFillService.sendDataAuthenticationLogV2(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId(), dataAuthReqVO, message);
 
             return checkTaskIdMessage.toDataRespVO();
         }
@@ -107,13 +108,15 @@ public class ZeroTrustDataAuthBusiness implements IZeroTrustDataAuthBusiness {
         if (ObjectUtils.isEmpty(applyInfo)) {
             log.error("应用不存在:{}", tokenInfo.getAppToken().getAppId());
             // 发送鉴权失败日志
-            logInfoFillService.sendDataAuthenticationLog(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId());
+            String message = String.format("应用不存在:%s", tokenInfo.getAppToken().getAppId());
+            logInfoFillService.sendDataAuthenticationLogV2(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId(), dataAuthReqVO, message);
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.OPERATE_FAIL);
         }
         if (BooleanEnum.TRUE.getValue().equals(applyInfo.getApplyStatus())) {
             log.error("应用已停用:{},状态:{}", applyInfo.getApplyCode(), applyInfo.getApplyStatus());
             // 发送鉴权失败日志
-            logInfoFillService.sendDataAuthenticationLog(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId());
+            String message = String.format("应用已停用:%s,状态:%s", applyInfo.getApplyCode(), applyInfo.getApplyStatus());
+            logInfoFillService.sendDataAuthenticationLogV2(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId(), dataAuthReqVO, message);
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.OPERATE_FAIL);
         }
 
@@ -128,7 +131,8 @@ public class ZeroTrustDataAuthBusiness implements IZeroTrustDataAuthBusiness {
         if (ResponseUtil.isFail(responseDTO)) {
             log.error("数据鉴权失败:{}", responseDTO.getMessage());
             // 发送鉴权失败日志
-            logInfoFillService.sendDataAuthenticationLog(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId());
+            String message = String.format("数据鉴权失败:%s", responseDTO.getMessage());
+            logInfoFillService.sendDataAuthenticationLogV2(AuthResultEnum.FAIL, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId(), dataAuthReqVO, message);
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.OPERATE_FAIL);
         }
 
@@ -148,7 +152,7 @@ public class ZeroTrustDataAuthBusiness implements IZeroTrustDataAuthBusiness {
         dto.setDataItemsDtoList(itemsDtos);
 
         // 发送成功日志
-        logInfoFillService.sendDataAuthenticationLog(AuthResultEnum.SUC, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId());
+        logInfoFillService.sendDataAuthenticationLogV2(AuthResultEnum.SUC, dto, IpUtils.getIp(), appTokenId, tokenInfo.getUserToken().getUserTokenId(), dataAuthReqVO, "鉴权成功");
 
         return ZeroTrustDataRespVO.success(respVO);
 

+ 13 - 9
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/zerotrust/ZeroTrustFunAuthBusiness.java

@@ -82,9 +82,10 @@ public class ZeroTrustFunAuthBusiness implements IZeroTrustFunAuthBusiness {
         if (userInfo == null) {
             log.error("查询不到用户信息:{}", tokenInfo.getUserToken().getPid());
             // 发送鉴权失败日志
-            logInfoFillService.sendFunAuthenticationLog(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
+            String message = String.format("查询不到用户信息:%s", tokenInfo.getUserToken().getPid());
+            logInfoFillService.sendFunAuthenticationLogV2(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
                     IpUtils.getRealIpAdrress(RequestUtils.getRequest()),
-                    tokenInfo.getUserToken().getUserTokenId(), appTokenId);
+                    tokenInfo.getUserToken().getUserTokenId(), appTokenId, functionAuthReqVO, message);
 
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.TOKEN_FAIL);
         }
@@ -99,9 +100,10 @@ public class ZeroTrustFunAuthBusiness implements IZeroTrustFunAuthBusiness {
             log.error("==============任务信息校验失败:{}===========", taskId);
 
             // 发送鉴权失败日志
-            logInfoFillService.sendFunAuthenticationLog(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
+            String message = String.format("任务信息校验失败:%s", taskId);
+            logInfoFillService.sendFunAuthenticationLogV2(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
                     IpUtils.getRealIpAdrress(RequestUtils.getRequest()),
-                    tokenInfo.getUserToken().getUserTokenId(), appTokenId);
+                    tokenInfo.getUserToken().getUserTokenId(), appTokenId, functionAuthReqVO, message);
             return checkTaskIdMessage.toDataRespVO();
         }
 
@@ -109,21 +111,23 @@ public class ZeroTrustFunAuthBusiness implements IZeroTrustFunAuthBusiness {
         if (ObjectUtils.isEmpty(applyInfo)) {
             log.error("应用不存在:{}", tokenInfo.getAppToken().getAppId());
             // 发送鉴权失败日志
-            logInfoFillService.sendFunAuthenticationLog(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
+            String message = String.format("应用不存在:%s", tokenInfo.getAppToken().getAppId());
+            logInfoFillService.sendFunAuthenticationLogV2(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
                     IpUtils.getRealIpAdrress(RequestUtils.getRequest()),
-                    tokenInfo.getUserToken().getUserTokenId(), appTokenId);
+                    tokenInfo.getUserToken().getUserTokenId(), appTokenId, functionAuthReqVO, message);
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.OPERATE_FAIL);
         }
         if (BooleanEnum.TRUE.getValue().equals(applyInfo.getApplyStatus())) {
             log.error("应用已停用:{},状态:{}", applyInfo.getApplyCode(), applyInfo.getApplyStatus());
             // 发送鉴权失败日志
-            logInfoFillService.sendFunAuthenticationLog(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
+            String message = String.format("应用已停用:%s,状态:%s", applyInfo.getApplyCode(), applyInfo.getApplyStatus());
+            logInfoFillService.sendFunAuthenticationLogV2(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
                     IpUtils.getRealIpAdrress(RequestUtils.getRequest()),
-                    tokenInfo.getUserToken().getUserTokenId(), appTokenId);
+                    tokenInfo.getUserToken().getUserTokenId(), appTokenId, functionAuthReqVO, message);
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.OPERATE_FAIL);
         }
 
-        ResponseDTO<List<AppFunInfoDTO>> menus = roleService.getMenus(roleApiDto);
+        ResponseDTO<List<AppFunInfoDTO>> menus = roleService.getMenus(roleApiDto, functionAuthReqVO);
         List<AppFunInfoDTO> authFunInfos = ResponseUtil.getResult(menus);
         String collect = authFunInfos.stream().map(AppFunInfoDTO::getCode)
                 .filter(StringUtils::isNotBlank)

+ 13 - 9
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/zerotrust/ZeroTrustServiceAuthBusiness.java

@@ -77,9 +77,10 @@ public class ZeroTrustServiceAuthBusiness implements IZeroTrustServiceAuthBusine
             log.error("查询不到用户信息:{}", tokenInfo.getUserToken().getPid());
 
             //发送鉴权失败日志
-            logInfoFillService.sendServiceAuthenticationLog(AuthResultEnum.FAIL, null, tokenInfo.getAppToken().getAppId(),
+            String message = String.format("查询不到用户信息:%s", tokenInfo.getUserToken().getPid());
+            logInfoFillService.sendServiceAuthenticationLogV2(AuthResultEnum.FAIL, null, tokenInfo.getAppToken().getAppId(),
                     tokenInfo.getUserToken().getUserTokenId(), appTokenId, Collections.emptyList(),
-                    IpUtils.getRealIpAdrress(RequestUtils.getRequest()));
+                    IpUtils.getRealIpAdrress(RequestUtils.getRequest()), serviceAuthReqVO , message);
 
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.TOKEN_FAIL);
         }
@@ -88,17 +89,19 @@ public class ZeroTrustServiceAuthBusiness implements IZeroTrustServiceAuthBusine
         if (ObjectUtils.isEmpty(applyInfo)) {
             log.error("应用不存在:{}", tokenInfo.getAppToken().getAppId());
             // 发送鉴权失败日志
-            logInfoFillService.sendServiceAuthenticationLog(AuthResultEnum.FAIL, userInfo.getIdcard(), tokenInfo.getAppToken().getAppId(),
+            String message = String.format("应用不存在:%s", tokenInfo.getAppToken().getAppId());
+            logInfoFillService.sendServiceAuthenticationLogV2(AuthResultEnum.FAIL, userInfo.getIdcard(), tokenInfo.getAppToken().getAppId(),
                     tokenInfo.getUserToken().getUserTokenId(), appTokenId, Collections.emptyList(),
-                    IpUtils.getRealIpAdrress(RequestUtils.getRequest()));
+                    IpUtils.getRealIpAdrress(RequestUtils.getRequest()), serviceAuthReqVO, message);
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.OPERATE_FAIL);
         }
         if (BooleanEnum.TRUE.getValue().equals(applyInfo.getApplyStatus())) {
             log.error("应用已停用:{},状态:{}", applyInfo.getApplyCode(), applyInfo.getApplyStatus());
             // 发送鉴权失败日志
-            logInfoFillService.sendServiceAuthenticationLog(AuthResultEnum.FAIL, userInfo.getIdcard(), tokenInfo.getAppToken().getAppId(),
+            String message = String.format("应用已停用:%s,状态:%s", applyInfo.getApplyCode(), applyInfo.getApplyStatus());
+            logInfoFillService.sendServiceAuthenticationLogV2(AuthResultEnum.FAIL, userInfo.getIdcard(), tokenInfo.getAppToken().getAppId(),
                     tokenInfo.getUserToken().getUserTokenId(), appTokenId, Collections.emptyList(),
-                    IpUtils.getRealIpAdrress(RequestUtils.getRequest()));
+                    IpUtils.getRealIpAdrress(RequestUtils.getRequest()), serviceAuthReqVO, message);
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.OPERATE_FAIL);
         }
 
@@ -109,9 +112,10 @@ public class ZeroTrustServiceAuthBusiness implements IZeroTrustServiceAuthBusine
             log.error("==============任务信息校验失败:{}===========", taskId);
 
             // 发送鉴权失败日志
-            logInfoFillService.sendServiceAuthenticationLog(AuthResultEnum.FAIL, userInfo.getIdcard(), tokenInfo.getAppToken().getAppId(),
+            String message = String.format("任务信息校验失败:%s", taskId);
+            logInfoFillService.sendServiceAuthenticationLogV2(AuthResultEnum.FAIL, userInfo.getIdcard(), tokenInfo.getAppToken().getAppId(),
                     tokenInfo.getUserToken().getUserTokenId(), appTokenId, Collections.emptyList(),
-                    IpUtils.getRealIpAdrress(RequestUtils.getRequest()));
+                    IpUtils.getRealIpAdrress(RequestUtils.getRequest()), serviceAuthReqVO, message);
 
             return checkTaskIdMessage.toDataRespVO();
         }
@@ -119,7 +123,7 @@ public class ZeroTrustServiceAuthBusiness implements IZeroTrustServiceAuthBusine
         String appCode = tokenInfo.getAppToken().getAppId();
         String userTokenId = tokenInfo.getUserToken().getUserTokenId();
 
-        List<ServiceAuthenticationResVO> resVos = serviceAuthResultService.serviceAuthentication(userInfo.getIdcard(), appCode, userTokenId, appTokenId);
+        List<ServiceAuthenticationResVO> resVos = serviceAuthResultService.serviceAuthentication(userInfo.getIdcard(), appCode, userTokenId, appTokenId, serviceAuthReqVO);
         String serviceAuth = resVos.stream()
                 .map(ServiceAuthenticationResVO::getServiceCode)
                 .filter(StringUtils::isNotBlank).distinct()

+ 1 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/RoleFacade.java

@@ -151,7 +151,7 @@ public class RoleFacade implements IRoleFacade {
      */
     @Override
     public List<AppFunInfoDTO> getMenus(RoleApiDto dto){
-        ResponseDTO menus = roleService.getMenus(dto);
+        ResponseDTO menus = roleService.getMenus(dto, null);
         return (List<AppFunInfoDTO>) menus.getResult();
     }
 

+ 2 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/ServiceAuthFlowFacade.java

@@ -109,7 +109,8 @@ public class ServiceAuthFlowFacade implements IServiceAuthFlowFacade {
      */
     @Override
     public List<ServiceAuthenticationResVO> serviceAuthentication(String idcard, String appCode, String userToken, String appToken) {
-        return authResultService.serviceAuthentication(idcard, appCode, userToken, appToken);
+//        return authResultService.serviceAuthentication(idcard, appCode, userToken, appToken);
+        return authResultService.serviceAuthentication(idcard, appCode, userToken, appToken, null);
     }
 
     @Override

+ 2 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/api/ApiDataAuthFacade.java

@@ -77,7 +77,8 @@ public class ApiDataAuthFacade implements IApiDataAuthFacade {
         }).collect(Collectors.toList());
 
         dto.setDataItemsDtoList(collect);
-        logInfoFillService.sendDataAuthenticationLog(AuthResultEnum.SUC, dto, IpUtils.getIp(), authV2ReqDTO.getAppToken(), authV2ReqDTO.getUserToken());
+//        logInfoFillService.sendDataAuthenticationLog(AuthResultEnum.SUC, dto, IpUtils.getIp(), authV2ReqDTO.getAppToken(), authV2ReqDTO.getUserToken());
+        logInfoFillService.sendDataAuthenticationLogV2(AuthResultEnum.SUC, dto, IpUtils.getIp(), authV2ReqDTO.getAppToken(), authV2ReqDTO.getUserToken(), null,"");
 
         return ResponseUtil.newInstance(dataAuthV2RespVO);
     }

+ 3 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IRoleService.java

@@ -1,5 +1,6 @@
 package com.dragoninfo.dcuc.auth.auth.service;
 
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.FunctionAuthReqVO;
 import com.dragoninfo.dcuc.auth.auth.dto.AppFunInfoDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.RoleApiDto;
 import com.dragoninfo.dcuc.auth.auth.entity.RoleInfo;
@@ -64,9 +65,10 @@ public interface IRoleService {
     /**
      * 获取列表
      * @param dto
+     * @param functionAuthReqVO 
      * @return
      */
-    ResponseDTO<List<AppFunInfoDTO>> getMenus(RoleApiDto dto);
+    ResponseDTO<List<AppFunInfoDTO>> getMenus(RoleApiDto dto, FunctionAuthReqVO functionAuthReqVO);
 
     /**
      * 根据身份证ID找到这个赋予的应用

+ 3 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/IServiceAuthResultService.java

@@ -1,6 +1,7 @@
 package com.dragoninfo.dcuc.auth.auth.service;
 
 
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.ServiceAuthReqVO;
 import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthResultDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowResutlAcceptDTO;
 import com.dragoninfo.dcuc.auth.auth.entity.ServiceAuthResult;
@@ -59,8 +60,9 @@ public interface IServiceAuthResultService {
      * @param idcard
      * @param userToken
      * @param appToken
+     * @param serviceAuthReqVO 
      */
-    List<ServiceAuthenticationResVO> serviceAuthentication(String idcard, String appCode, String userToken, String appToken);
+    List<ServiceAuthenticationResVO> serviceAuthentication(String idcard, String appCode, String userToken, String appToken, ServiceAuthReqVO serviceAuthReqVO);
 
     /**
      * 保存

+ 1 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/DataAuthServiceImpl.java

@@ -259,7 +259,7 @@ public class DataAuthServiceImpl implements IDataAuthService {
         HttpServletRequest request = RequestUtils.getRequest();
         String appToken = request.getHeader(Constants.APP_TOKEN);
         String userToken = request.getHeader(Constants.USER_TOKEN);
-        logInfoFillService.sendDataAuthenticationLog(AuthResultEnum.SUC, dataItemsCheckDto, ip, appToken, userToken);
+        logInfoFillService.sendDataAuthenticationLogV2(AuthResultEnum.SUC, dataItemsCheckDto, ip, appToken, userToken , null, "");
 
         return ResponseDTO.newInstance(dataItemsCheckDto.getDataItemsDtoList());
     }

+ 9 - 2
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/RoleService.java

@@ -2,6 +2,7 @@ package com.dragoninfo.dcuc.auth.auth.service.impl;
 
 import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.FunctionAuthReqVO;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.service.log.LogInfoFillService;
 import com.dragoninfo.dcuc.auth.auth.bpo.RoleInfoBPO;
@@ -521,7 +522,7 @@ public class RoleService implements IRoleService {
      * @return
      */
     @Override
-    public ResponseDTO<List<AppFunInfoDTO>> getMenus(RoleApiDto dto) {
+    public ResponseDTO<List<AppFunInfoDTO>> getMenus(RoleApiDto dto, FunctionAuthReqVO functionAuthReqVO) {
 
         String appCode = dto.getAppCode();
         String appId = applyInfoFacade.codeConvertToId(appCode);
@@ -578,7 +579,13 @@ public class RoleService implements IRoleService {
                 logger.info("授权查询耗时:{}", (System.currentTimeMillis() - startTime) / 1000);
             }
 
-            logInfoFillService.sendFunAuthenticationLog(AuthResultEnum.SUC, dto, results, ip, userToken, appToken);
+            if(functionAuthReqVO == null) {
+            	
+            	logInfoFillService.sendFunAuthenticationLogV2(AuthResultEnum.SUC, dto, results, ip, userToken, appToken, null , "鉴权成功");
+            }else {
+            	
+            	logInfoFillService.sendFunAuthenticationLogV2(AuthResultEnum.SUC, dto, results, ip, userToken, appToken, functionAuthReqVO, "鉴权成功");
+            }
 
         }
 

+ 3 - 2
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/ServiceAuthResultServiceImpl.java

@@ -8,6 +8,7 @@ import com.dragoninfo.dcuc.app.enumresources.ResourceTypeEnum;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
 import com.dragoninfo.dcuc.app.facade.IServiceResourceFacade;
 import com.dragoninfo.dcuc.app.vo.ServiceResourceVo;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.ServiceAuthReqVO;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.service.log.LogInfoFillService;
 import com.dragoninfo.dcuc.auth.auth.async.PermssionServiceUpdateEventBus;
@@ -298,7 +299,7 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
      * @param appToken
      */
     @Override
-    public List<ServiceAuthenticationResVO> serviceAuthentication(String idcard, String appCode, String userToken, String appToken) {
+    public List<ServiceAuthenticationResVO> serviceAuthentication(String idcard, String appCode, String userToken, String appToken, ServiceAuthReqVO serviceAuthReqVO) {
         List<ServiceAuthResult> results = serviceAuthResultBPO.serviceAuthResultList(appCode);
         List<ServiceAuthenticationResVO> list = new ArrayList<>();
         for (ServiceAuthResult result : results) {
@@ -308,7 +309,7 @@ public class ServiceAuthResultServiceImpl implements IServiceAuthResultService {
         }
 
         String ip = IpUtils.getRealIpAdrress(RequestUtils.getRequest());
-        logInfoFillService.sendServiceAuthenticationLog(AuthResultEnum.SUC, idcard, appCode, userToken, appToken, results, ip);
+        logInfoFillService.sendServiceAuthenticationLogV2(AuthResultEnum.SUC, idcard, appCode, userToken, appToken, results, ip, serviceAuthReqVO, "鉴权成功");
 
         return list;
 

+ 1 - 1
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/StaffAssignAuthInfoService.java

@@ -520,7 +520,7 @@ public class StaffAssignAuthInfoService implements IStaffAssignAuthInfoService {
         logger.info("人员角色授权结果:{}, 机构授权结果:{}", roleAuthCode, orgAuthCode);
 
         if (needSendLog) {
-            logInfoFillService.sendAppAuthenticationLog(apiAppAuthVo, list, AuthResultEnum.SUC);
+            logInfoFillService.sendAppAuthenticationLogV2(apiAppAuthVo, list, AuthResultEnum.SUC, "鉴权成功");
         }
         return list;
     }

BIN
dcuc-auth-service/src/main/lib/auditlog-qm-tj-1.0.3-SNAPSHOT.jar


+ 1 - 1
dcuc-auth-service/src/test/java/com/dragoninfo/dcuc/auth/auth/service/QmAuditPushServiceTest.java

@@ -106,7 +106,7 @@ public class QmAuditPushServiceTest {
         authenticationLogDto.setAppToken("appToken");
         authenticationLogDto.setAuthTaskId("logId");
 
-        qmAuditPushService.pushAuthenticationLog(authenticationLogDto);
+        // qmAuditPushService.pushAuthenticationLog(authenticationLogDto);
 
 
     }