|
@@ -1,34 +1,37 @@
|
|
|
package com.dragonsoft.dcuc.approve.business.impl;
|
|
|
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
+import com.dragoninfo.dcuc.common.Constants;
|
|
|
import com.dragoninfo.dcuc.common.utils.LangUtil;
|
|
|
+import com.dragoninfo.dcuc.common.utils.ResponseUtil;
|
|
|
import com.dragoninfo.dcuc.duceap.enums.ManageDisposeTypeEnum;
|
|
|
import com.dragoninfo.dcuc.duceap.enums.OperateDisposeTypeEnum;
|
|
|
import com.dragoninfo.dcuc.duceap.enums.RequestDisposeTypeEnum;
|
|
|
import com.dragoninfo.dcuc.duceap.enums.SchemeTypeEnum;
|
|
|
-import com.dragoninfo.duceap.commons.util.kafka.KafkaServer;
|
|
|
import com.dragonsoft.dcuc.approve.business.IApproveLogBusiness;
|
|
|
import com.dragonsoft.dcuc.approve.business.IDcucBusiness;
|
|
|
+import com.dragonsoft.dcuc.approve.business.IRiskBusiness;
|
|
|
import com.dragonsoft.dcuc.approve.constants.ApproveConstants;
|
|
|
+import com.dragonsoft.dcuc.approve.dto.ApproveLogDTO;
|
|
|
import com.dragonsoft.dcuc.approve.enumresources.*;
|
|
|
import com.dragonsoft.dcuc.approve.event.ApproveEventPublish;
|
|
|
import com.dragonsoft.dcuc.approve.model.*;
|
|
|
import com.dragonsoft.dcuc.approve.model.resp.OperateRespVO;
|
|
|
-import com.dragonsoft.dcuc.approve.model.vo.*;
|
|
|
+import com.dragonsoft.dcuc.approve.model.vo.LogDto;
|
|
|
+import com.dragonsoft.dcuc.approve.model.vo.LogInfoMetaDTO;
|
|
|
+import com.dragonsoft.dcuc.approve.model.vo.ProcessInstanceInfoDTO;
|
|
|
+import com.dragonsoft.dcuc.approve.model.vo.QmOperateLogDTO;
|
|
|
+import com.dragonsoft.dcuc.approve.model.vo.dcuc.OauthUserVO;
|
|
|
import com.dragonsoft.dcuc.approve.properties.ApproveProperties;
|
|
|
-import com.dragonsoft.dcuc.approve.properties.KafkaProperties;
|
|
|
import com.dragonsoft.dcuc.approve.service.*;
|
|
|
import com.dragonsoft.dcuc.approve.utils.ProofsUtil;
|
|
|
+import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
|
import com.dragonsoft.duceap.base.entity.security.BaseSecurityUser;
|
|
|
import com.dragonsoft.duceap.base.exception.ApplicationException;
|
|
|
import com.dragonsoft.duceap.base.utils.UserContextUtils;
|
|
|
-import com.dragonsoft.duceap.commons.util.UUIDUtils;
|
|
|
-import com.dragonsoft.duceap.commons.util.date.DateConst;
|
|
|
-import com.dragonsoft.duceap.commons.util.date.DateUtils;
|
|
|
import com.dragonsoft.duceap.commons.util.enums.EnumUtils;
|
|
|
import com.dragonsoft.duceap.commons.util.ip.IpUtils;
|
|
|
import com.dragonsoft.duceap.commons.util.json.JsonUtils;
|
|
@@ -36,9 +39,6 @@ import com.dragonsoft.duceap.duwf.api.model.OutgoingVo;
|
|
|
import com.dragonsoft.duceap.duwf.api.model.ProcessInstanceVO;
|
|
|
import com.dragonsoft.duceap.duwf.api.model.TaskDefinitionVo;
|
|
|
import com.dragonsoft.duceap.workflow.client.WorkflowClientFactory;
|
|
|
-import com.dragonsoft.mq.client.model.entity.MessageInfoDTO;
|
|
|
-import com.dragonsoft.mq.client.model.vo.MessageInfoReqVo;
|
|
|
-import com.dragonsoft.mq.client.model.vo.MessageInfoVo;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -63,38 +63,80 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ApproveLogBusinessImpl.class);
|
|
|
|
|
|
+ private IFlowManageLogService flowManageLogService;
|
|
|
+ private IRequestLogService requestLogService;
|
|
|
+ private IOperateLogService operateLogService;
|
|
|
+
|
|
|
+ private WorkflowClientFactory workflowClientFactory;
|
|
|
+
|
|
|
+ private ApproveProperties approveProperties;
|
|
|
+
|
|
|
+ private IRiskLogService riskLogService;
|
|
|
+
|
|
|
+ private IApproveCirculationService approveCirculationService;
|
|
|
+
|
|
|
+ private ApproveEventPublish approveEventPublish;
|
|
|
+
|
|
|
+ private IRiskSchemeService riskSchemeService;
|
|
|
+
|
|
|
+ private IDcucBusiness dcucBusiness;
|
|
|
+
|
|
|
+ private IRiskBusiness riskBusiness;
|
|
|
+
|
|
|
@Autowired
|
|
|
- private KafkaServer kafkaServer;
|
|
|
- @Autowired
|
|
|
- private KafkaProperties kafkaProperties;
|
|
|
+ public void setRiskBusiness(IRiskBusiness riskBusiness) {
|
|
|
+ this.riskBusiness = riskBusiness;
|
|
|
+ }
|
|
|
|
|
|
@Autowired
|
|
|
- private IFlowManageLogService flowManageLogService;
|
|
|
+ public void setFlowManageLogService(IFlowManageLogService flowManageLogService) {
|
|
|
+ this.flowManageLogService = flowManageLogService;
|
|
|
+ }
|
|
|
+
|
|
|
@Autowired
|
|
|
- private IRequestLogService requestLogService;
|
|
|
+ public void setRequestLogService(IRequestLogService requestLogService) {
|
|
|
+ this.requestLogService = requestLogService;
|
|
|
+ }
|
|
|
+
|
|
|
@Autowired
|
|
|
- private IOperateLogService operateLogService;
|
|
|
+ public void setOperateLogService(IOperateLogService operateLogService) {
|
|
|
+ this.operateLogService = operateLogService;
|
|
|
+ }
|
|
|
|
|
|
@Autowired
|
|
|
- private WorkflowClientFactory workflowClientFactory;
|
|
|
+ public void setWorkflowClientFactory(WorkflowClientFactory workflowClientFactory) {
|
|
|
+ this.workflowClientFactory = workflowClientFactory;
|
|
|
+ }
|
|
|
|
|
|
@Autowired
|
|
|
- private ApproveProperties approveProperties;
|
|
|
+ public void setApproveProperties(ApproveProperties approveProperties) {
|
|
|
+ this.approveProperties = approveProperties;
|
|
|
+ }
|
|
|
|
|
|
@Autowired
|
|
|
- private IRiskLogService riskLogService;
|
|
|
+ public void setRiskLogService(IRiskLogService riskLogService) {
|
|
|
+ this.riskLogService = riskLogService;
|
|
|
+ }
|
|
|
|
|
|
@Autowired
|
|
|
- private IApproveCirculationService approveCirculationService;
|
|
|
+ public void setApproveCirculationService(IApproveCirculationService approveCirculationService) {
|
|
|
+ this.approveCirculationService = approveCirculationService;
|
|
|
+ }
|
|
|
|
|
|
@Autowired
|
|
|
- private ApproveEventPublish approveEventPublish;
|
|
|
+ public void setApproveEventPublish(ApproveEventPublish approveEventPublish) {
|
|
|
+ this.approveEventPublish = approveEventPublish;
|
|
|
+ }
|
|
|
|
|
|
@Autowired
|
|
|
- private IRiskSchemeService riskSchemeService;
|
|
|
+ public void setRiskSchemeService(IRiskSchemeService riskSchemeService) {
|
|
|
+ this.riskSchemeService = riskSchemeService;
|
|
|
+ }
|
|
|
|
|
|
@Autowired
|
|
|
- private IDcucBusiness dcucBusiness;
|
|
|
+ public void setDcucBusiness(IDcucBusiness dcucBusiness) {
|
|
|
+ this.dcucBusiness = dcucBusiness;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -127,7 +169,7 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
break;
|
|
|
case RECALL:
|
|
|
//审批请求日志
|
|
|
- buildRequestLog(RequestDisposeTypeEnum.RECALL.getValue(), logDto, flowNodeCode, flowNodeName, taskKey, flowKey, processInstanceId);
|
|
|
+ buildRequestLog(RequestDisposeTypeEnum.RECALL.getValue(), logDto, flowNodeCode, flowNodeName, taskKey, flowKey, processInstanceId, "22");
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -145,7 +187,7 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
* @param flowKey 流程key
|
|
|
*/
|
|
|
private void buildRequestLog(String disposeType, LogDto logDto, String flowNodeCode, String flowNodeName,
|
|
|
- String taskKey, String flowKey, String processInstanceId) {
|
|
|
+ String taskKey, String flowKey, String processInstanceId, String businessCode) {
|
|
|
|
|
|
ApprovalInfo approvalInfo = logDto.getApprovalInfo();
|
|
|
RequestLog requestLog = new RequestLog();
|
|
@@ -169,7 +211,7 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
requestLog.setProcessInstanceId(processInstanceId);
|
|
|
requestLog.setApproveNo(approvalInfo.getApproveNo());
|
|
|
//发送审批请求日志到消息中心
|
|
|
- logger.info("=====发送批申请请求日志-发起消息,消息体为:{}====", JSON.toJSONString(requestLog));
|
|
|
+ logger.info("=====发送审批申请请求日志-发起消息,消息体为:{}====", JSON.toJSONString(requestLog));
|
|
|
LogInfoMetaDTO logInfoMetaDTO = new LogInfoMetaDTO();
|
|
|
logInfoMetaDTO.setLogType(LogTypeEnum.REQUEST_LOG.getValue());
|
|
|
logInfoMetaDTO.setTaskKey(taskKey);
|
|
@@ -177,7 +219,7 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
logInfoMetaDTO.setProcessInstanceId(processInstanceId);
|
|
|
logInfoMetaDTO.setTerminalIp(logDto.getCreateIp());
|
|
|
// 请求发起
|
|
|
- logInfoMetaDTO.setBusinessType("21");
|
|
|
+ logInfoMetaDTO.setBusinessType(businessCode);
|
|
|
|
|
|
sendInfo(JSON.toJSONString(requestLog), "审批请求日志", logInfoMetaDTO);
|
|
|
}
|
|
@@ -245,25 +287,20 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
buildFlowManageLogAndSend(logDto, ManageDisposeTypeEnum.DELETED);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 处理接收到的日志消息
|
|
|
- *
|
|
|
- * @param map 内容
|
|
|
- * @param messageInfoDTO 内容
|
|
|
- */
|
|
|
@Override
|
|
|
- public void saveLog(Map<String, String> map, MessageInfoDTO messageInfoDTO) {
|
|
|
- LogInfoMetaDTO logInfoMetaDTO = BeanUtil.mapToBean(map, LogInfoMetaDTO.class, false);
|
|
|
+ public void saveLog(ApproveLogDTO approveLogDTO) {
|
|
|
+ String content = approveLogDTO.getContent();
|
|
|
+ LogInfoMetaDTO logInfoMetaDTO = approveLogDTO.getLogInfoMetaDTO();
|
|
|
String logType = logInfoMetaDTO.getLogType();
|
|
|
switch (EnumUtils.enumOf(LogTypeEnum.class, logType)) {
|
|
|
case MANAGE_LOG:
|
|
|
- saveManageLog(messageInfoDTO.getContent(), logInfoMetaDTO);
|
|
|
+ saveManageLog(content, logInfoMetaDTO);
|
|
|
break;
|
|
|
case REQUEST_LOG:
|
|
|
- saveRequestLog(messageInfoDTO.getContent(), logInfoMetaDTO);
|
|
|
+ saveRequestLog(content, logInfoMetaDTO);
|
|
|
break;
|
|
|
case OPERATE_LOG:
|
|
|
- saveOperateLog(messageInfoDTO.getContent(), logInfoMetaDTO);
|
|
|
+ saveOperateLog(content, logInfoMetaDTO);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -313,7 +350,6 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
logIdList.add(operateLogId);
|
|
|
//流程出口信息
|
|
|
OutgoingVo outgoingVo = workflowClientFactory.getWorkflowTaskClient().queryStartOutgoing(flowKey);
|
|
|
- String riskContent;
|
|
|
if (outgoingVo != null) {
|
|
|
boolean needSaveRiskLog = true;
|
|
|
//跳过第一个节点
|
|
@@ -325,59 +361,41 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
}
|
|
|
|
|
|
if (needSaveRiskLog) {
|
|
|
- // 提交人、审批人重复风险判断,跳过第一个节点,只有操作日志才分析提交、审批人风险
|
|
|
if (logTypeEnum.equals(LogTypeEnum.OPERATE_LOG)) {
|
|
|
+ // 提交人、审批人重复风险判断,跳过第一个节点,只有操作日志才分析提交、审批人风险
|
|
|
+ ResponseStatus commitApproveResponseStatus = riskBusiness.commitApproveRepetitionRisk(applyIdcard, operateIdcard, createUserName);
|
|
|
+ if (ResponseUtil.isFail(commitApproveResponseStatus)) {
|
|
|
+ String commitRiskContent = commitApproveResponseStatus.getMessage();
|
|
|
|
|
|
- if (applyIdcard.equals(operateIdcard)) {
|
|
|
-
|
|
|
- RiskScheme riskScheme = riskSchemeService.selectEnableSchemeByType(SchemeTypeEnum.COMMIT_APPROVE_REPETITION_RISK);
|
|
|
- if (riskScheme != null) {
|
|
|
- riskContent = "审批流程中,提交人与审批人都是:" + createUserName + "(" + operateIdcard + ")。";
|
|
|
- //除第一个节点外,审请人和处理人同为一个人,产生《提交人与审批人重复风险》
|
|
|
-
|
|
|
- saveRiskLog(businessCode, riskIp, riskContent,
|
|
|
- title, operateIdcard, createUserName,
|
|
|
- applyIdcard, orgName, orgCode,
|
|
|
- createTime, riskScheme.getSchemeType(),
|
|
|
- approveRecordId, processInstanceId, processNo, Collections.singletonList(operateLogId));
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //获取单人连续审批风险方案详情
|
|
|
- RiskScheme riskScheme = riskSchemeService.selectEnableSchemeByType(SchemeTypeEnum.SINGLE_APPROVE_RISK);
|
|
|
- if (riskScheme != null) {
|
|
|
-
|
|
|
- int continuousApproveNum = Integer.parseInt(StringUtils.isEmpty(riskScheme.getContinuousApproveNum())
|
|
|
- ? "0" : riskScheme.getContinuousApproveNum());
|
|
|
- //查询该流程单最近风险范围条数的审批记录
|
|
|
- List<ApproveCirculationInfo> list = approveCirculationService.getListByApproveRecordIdAndAgree(approveRecordId);
|
|
|
- // 过滤是当前审批人,去除重复节点,且是同意的条数
|
|
|
- long count = list.stream()
|
|
|
- .filter(item -> item.getOperateUserId().equalsIgnoreCase(operateIdcard))
|
|
|
- .map(ApproveCirculationInfo::getNodeName)
|
|
|
- .distinct()
|
|
|
- .count();
|
|
|
- // 需去除申请人节点
|
|
|
- int realCount = (int) (count - 1);
|
|
|
- if (realCount >= continuousApproveNum) {
|
|
|
- riskContent = "审批流程流转过程中,连续" + continuousApproveNum + "个节点审批人相同,审批人都是:"
|
|
|
- + createUserName + "(" + operateIdcard + ")。";
|
|
|
-
|
|
|
- //产生《单人连续审批风险》
|
|
|
- saveRiskLog(businessCode, riskIp, riskContent,
|
|
|
+ saveRiskLog(businessCode, riskIp, commitRiskContent,
|
|
|
title, operateIdcard, createUserName,
|
|
|
applyIdcard, orgName, orgCode,
|
|
|
- createTime, riskScheme.getSchemeType(),
|
|
|
- approveRecordId, processInstanceId, processNo, logIdList);
|
|
|
+ createTime, SchemeTypeEnum.COMMIT_APPROVE_REPETITION_RISK.value,
|
|
|
+ approveRecordId, processInstanceId, processNo, Collections.singletonList(operateLogId));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ ResponseStatus singleApproveRiskStatus = riskBusiness.singleApproveRisk(approveRecordId, operateIdcard, createUserName);
|
|
|
+ if (ResponseUtil.isFail(singleApproveRiskStatus)) {
|
|
|
+ String singleApproveRiskContent = singleApproveRiskStatus.getMessage();
|
|
|
+ //产生《单人连续审批风险》
|
|
|
+ saveRiskLog(businessCode, riskIp, singleApproveRiskContent,
|
|
|
+ title, operateIdcard, createUserName,
|
|
|
+ applyIdcard, orgName, orgCode,
|
|
|
+ createTime, SchemeTypeEnum.SINGLE_APPROVE_RISK.value,
|
|
|
+ approveRecordId, processInstanceId, processNo, logIdList);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Boolean needSendRedListRisk = logInfoMetaDTO.getNeedSendRedListRisk();
|
|
|
+ if (ObjectUtil.isNull(needSendRedListRisk)) {
|
|
|
+ needSendRedListRisk = false;
|
|
|
+ }
|
|
|
String redListOperateRespString = logInfoMetaDTO.getRedListOperateRespVO();
|
|
|
+ if (StrUtil.isBlank(redListOperateRespString)) {
|
|
|
+ redListOperateRespString = "";
|
|
|
+ }
|
|
|
if (needSendRedListRisk && (StrUtil.isNotBlank(redListOperateRespString))) {
|
|
|
OperateRespVO redListOperateRespVO = JsonUtils.parseObject(redListOperateRespString, OperateRespVO.class);
|
|
|
RiskScheme riskScheme = riskSchemeService.selectEnableSchemeByType(SchemeTypeEnum.RED_WHITE_RISK);
|
|
@@ -392,7 +410,7 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
- logger.info("====================构建风险日志异常==============", e);
|
|
|
+ logger.error("====================构建风险日志异常==============", e);
|
|
|
throw new ApplicationException(e.getMessage());
|
|
|
}
|
|
|
}
|
|
@@ -461,7 +479,7 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
* @param logInfoMetaDTO 日志信息
|
|
|
*/
|
|
|
private void saveOperateLog(String content, LogInfoMetaDTO logInfoMetaDTO) {
|
|
|
-
|
|
|
+ String appToken = logInfoMetaDTO.getAppToken();
|
|
|
String processInstanceId = logInfoMetaDTO.getProcessInstanceId();
|
|
|
String businessType = logInfoMetaDTO.getBusinessType();
|
|
|
Boolean flowFinish = logInfoMetaDTO.getFlowFinish();
|
|
@@ -498,6 +516,7 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
entity.getCreateTime(), processInstanceId, approveNo, id, logInfoMetaDTO);
|
|
|
|
|
|
QmOperateLogDTO qmOperateLogDTO = QmOperateLogDTO.builder()
|
|
|
+ .appToken(appToken)
|
|
|
.qmApproveTypeEnum(QmApproveTypeEnum.OPERATE)
|
|
|
.approveId(approveRecordId)
|
|
|
.approveNo(approveNo)
|
|
@@ -634,7 +653,7 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
String flowKey = processInstanceInfoDTO.getFlowKey();
|
|
|
String processInstanceId = processInstanceInfoDTO.getProcessInstanceId();
|
|
|
//如果是保存并提交,则需要构建(申请请求日志-发起)对象
|
|
|
- buildRequestLog(RequestDisposeTypeEnum.START.getValue(), logDto, "start", "开始", "start", flowKey, processInstanceId);
|
|
|
+ buildRequestLog(RequestDisposeTypeEnum.START.getValue(), logDto, "start", "开始", "start", flowKey, processInstanceId, "21");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -712,44 +731,23 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
* @param logInfoMetaDTO 日志元信息
|
|
|
*/
|
|
|
public void sendInfo(String content, String title, LogInfoMetaDTO logInfoMetaDTO) {
|
|
|
- String appCode = approveProperties.getAppCode();
|
|
|
- Date date = DateUtils.getDate();
|
|
|
- String dateFormat = DateUtils.getDateFormat(date, DateConst.DB_STORE_TIME);
|
|
|
- MessageInfoVo messageInfoVo = new MessageInfoVo();
|
|
|
- messageInfoVo.setTitle(title);
|
|
|
- messageInfoVo.setCreateTime(dateFormat);
|
|
|
- messageInfoVo.setContent(content);
|
|
|
- messageInfoVo.setUserSystem("审批系统");
|
|
|
- messageInfoVo.setUserSystemCode(appCode);
|
|
|
- messageInfoVo.setUserName("审批系统");
|
|
|
- messageInfoVo.setMessageId(UUIDUtils.getUUID());
|
|
|
-
|
|
|
- Map<String, Object> stringObjectMap = BeanUtil.beanToMap(logInfoMetaDTO);
|
|
|
- Set<Map.Entry<String, Object>> entries = stringObjectMap.entrySet();
|
|
|
- Map<String, String> map = new HashMap<>(stringObjectMap.size());
|
|
|
- for (Map.Entry<String, Object> entry : entries) {
|
|
|
- String key = entry.getKey();
|
|
|
- Object value = entry.getValue();
|
|
|
- String stringValue = "";
|
|
|
- if (value != null) {
|
|
|
- stringValue = value.toString();
|
|
|
+ String appToken = logInfoMetaDTO.getAppToken();
|
|
|
+ if (StrUtil.isBlank(appToken)) {
|
|
|
+ ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
|
|
+ if (servletRequestAttributes != null) {
|
|
|
+ HttpServletRequest request = servletRequestAttributes.getRequest();
|
|
|
+ String appTokenId = request.getHeader(Constants.RZZX_APPTOKEN);
|
|
|
+ logger.info("从请求头获取到应用令牌信息:{}", appTokenId);
|
|
|
+ logInfoMetaDTO.setAppToken(appTokenId);
|
|
|
}
|
|
|
- map.put(key, stringValue);
|
|
|
}
|
|
|
- List<Map<String, String>> infoSet = new ArrayList<>();
|
|
|
- infoSet.add(map);
|
|
|
- messageInfoVo.setInfoSet(infoSet);
|
|
|
-
|
|
|
- List<MessageInfoVo> messageInfoVos = new ArrayList<>();
|
|
|
- messageInfoVos.add(messageInfoVo);
|
|
|
- MessageInfoReqVo requestVo = new MessageInfoReqVo();
|
|
|
- //设置消息
|
|
|
- requestVo.setMessages(messageInfoVos);
|
|
|
- requestVo.setTopic(kafkaProperties.getApproveLogTopic());
|
|
|
- requestVo.setAppKey(kafkaProperties.getAppKey());
|
|
|
- requestVo.setAppSecret(kafkaProperties.getAppSecret());
|
|
|
- logger.info("====kafka开始推送结果,消息体为:{}", JSON.toJSONString(requestVo));
|
|
|
- kafkaServer.send(requestVo, kafkaProperties.getKafkaServers());
|
|
|
+
|
|
|
+ ApproveLogDTO approveLogDTO = ApproveLogDTO.builder()
|
|
|
+ .content(content)
|
|
|
+ .title(title)
|
|
|
+ .logInfoMetaDTO(logInfoMetaDTO).build();
|
|
|
+
|
|
|
+ approveEventPublish.publishApproveLogEvent(approveLogDTO);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -770,7 +768,7 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
String realIpAdrress = IpUtils.getRealIpAdrress(request);
|
|
|
|
|
|
String createUser;
|
|
|
- String createUserName;
|
|
|
+ String createUserName = "";
|
|
|
BaseSecurityUser currentUser = UserContextUtils.getCurrentUser();
|
|
|
if (currentUser != null) {
|
|
|
createUser = currentUser.getIdcard();
|
|
@@ -780,7 +778,9 @@ public class ApproveLogBusinessImpl implements IApproveLogBusiness {
|
|
|
String idcard = ProofsUtil.getIdcard();
|
|
|
createUser = idcard;
|
|
|
OauthUserVO oauthUserInfoByIdcard = dcucBusiness.getOauthUserInfoByIdcard(idcard);
|
|
|
- createUserName = oauthUserInfoByIdcard.getName();
|
|
|
+ if (ObjectUtil.isNotNull(oauthUserInfoByIdcard)) {
|
|
|
+ createUserName = oauthUserInfoByIdcard.getName();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
LogDto logDto = new LogDto();
|