Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 1 year ago
parent
commit
c90c78bb9b
  1. 21
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java
  2. 8
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/WorkflowOperationLog.java
  3. 1
      hzims-service/hzims-middle/src/main/resources/db/1.0.1.sql

21
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java

@ -1,5 +1,6 @@
package com.hnac.hzims.middle.processflow.consumer;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
@ -41,6 +42,21 @@ public class StandardWorkTicketConsumer implements IQueueConsume {
log.info("监听到数据:{}", message);
ProcessWorkFlowResponse response = JSONObject.parseObject(message, ProcessWorkFlowResponse.class);
String taskDefinitionKey = response.getProcessDefinitionKey();
//记录操作日志
WorkflowOperationLog regularWorkflowOperationLog = new WorkflowOperationLog();
BeanUtils.copyProperties(response,regularWorkflowOperationLog);
if (ObjectUtils.isNotEmpty(regularWorkflowOperationLog)) {
regularWorkflowOperationLog.setVariables(JSON.toJSONString(response.getVariables()));
regularWorkflowOperationLog.setTakeId(response.getTaskId());
regularWorkflowOperationLog.setTakeName(response.getTaskName());
regularWorkflowOperationLog.setIsOperationLog(true);
regularWorkflowOperationLog.setProcessInstanceKey(response.getProcessInstanceId());
log.info("正在记录操作日志WorkflowOperationLog.... :{}", regularWorkflowOperationLog);
workflowOperationLogService.save(regularWorkflowOperationLog);
}
WorkflowQueue ticker = new WorkflowQueue();
ticker.setProcessDefinitionKey(taskDefinitionKey);
//判断执行具体的实现类
@ -58,6 +74,11 @@ public class StandardWorkTicketConsumer implements IQueueConsume {
WorkflowOperationLog workflowOperationLog = new WorkflowOperationLog();
BeanUtils.copyProperties(response,workflowOperationLog);
if (ObjectUtils.isNotEmpty(workflowOperationLog)) {
regularWorkflowOperationLog.setVariables(JSON.toJSONString(response.getVariables()));
regularWorkflowOperationLog.setTakeId(response.getTaskId());
regularWorkflowOperationLog.setTakeName(response.getTaskName());
regularWorkflowOperationLog.setIsOperationLog(false);
regularWorkflowOperationLog.setProcessInstanceKey(response.getProcessInstanceId());
log.info("正在保存到hzims_workflow_operation_log.... :{}", workflowOperationLog);
workflowOperationLogService.save(workflowOperationLog);
}

8
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/WorkflowOperationLog.java

@ -68,7 +68,7 @@ public class WorkflowOperationLog implements Serializable {
/**
* 用户Id
*/
@TableField("variables")
@TableField("user_id")
private String userId;
@ -92,4 +92,10 @@ public class WorkflowOperationLog implements Serializable {
private Boolean Deleted;
/**
* 记录正常日志 或错误日志
*/
private Boolean isOperationLog;
}

1
hzims-service/hzims-middle/src/main/resources/db/1.0.1.sql

@ -0,0 +1 @@
alter table hzims_workflow_operation_log add is_operation_log tinyint(1) comment '1 正常日志 0 错误日志';
Loading…
Cancel
Save