提交 5005736e authored 作者: zhoushaopan's avatar zhoushaopan

[工作流模块]去除了hutool

上级 9f9acd61
......@@ -64,11 +64,7 @@
<version>6.6.0</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.5.8</version>
</dependency>
<!--fastjson-->
<dependency>
......
package com.tykj.workflowcore.model_layer.entity.vo;
import cn.hutool.core.bean.BeanUtil;
import com.tykj.workflowcore.model_layer.entity.Aggregation;
import com.tykj.workflowcore.model_layer.entity.TableInfoEx;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import java.util.List;
......@@ -38,7 +39,7 @@ public class AggregationVO {
public TableInfoEx getTableInfoEx(){
TableInfoEx tableInfoEx = new TableInfoEx();
BeanUtil.copyProperties(this,tableInfoEx);
BeanUtils.copyProperties(this,tableInfoEx);
return tableInfoEx;
}
}
package com.tykj.workflowcore.workflow_editer.entity.vo;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tykj.workflowcore.workflow_editer.entity.FlowsInfo;
import com.tykj.workflowcore.workflow_editer.entity.NodeInfo;
......@@ -9,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import java.util.Date;
......@@ -51,10 +51,10 @@ public class FlowsInfoVo {
}
public FlowsInfo toEntity(FlowsInfo oldFlowsInfo){
if (!StrUtil.isEmpty(flowName)){
if (!StringUtils.isEmpty(flowName)){
oldFlowsInfo.setFlowName(flowName);
}
if (!StrUtil.isEmpty(flowDescribe)){
if (!StringUtils.isEmpty(flowDescribe)){
oldFlowsInfo.setFlowDescribe(flowDescribe);
}
return oldFlowsInfo;
......
......@@ -53,6 +53,9 @@ public class ProcessEndListener extends AbstractFlowableEngineEventListener {
@Autowired
RepositoryService repositoryService;
@Autowired
FormService formService;
@Autowired
VariableStorageService variableStorageService;
......@@ -128,26 +131,31 @@ public class ProcessEndListener extends AbstractFlowableEngineEventListener {
if (execution.getCurrentFlowElement() instanceof StartEvent){
DataHistory dataHistory = new DataHistory();
StartEvent startEvent = (StartEvent) execution.getCurrentFlowElement();
//实例id
String processInstanceId = execution.getProcessInstanceId();
String processInstanceBusinessKey = execution.getProcessInstanceBusinessKey();
System.out.println(processInstanceBusinessKey);
String nodeId = execution.getCurrentActivityId();
String formKey = startEvent.getFormKey();
//通过formKey查询出页面
}
if (execution.getCurrentFlowElement() instanceof UserTask){
//查询任务
Task task = taskService.createTaskQuery().singleResult();
Map<String, Object> variables = taskService.getVariables(task.getId());
DataHistory dataHistory = new DataHistory();
UserTask userTask = (UserTask) execution.getCurrentFlowElement();
String taskId = userTask.getId();
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String datas = JSON.toJSONString(variables);
//流程实例id
String processInstanceId = task.getProcessInstanceId();
//当前节点id
String nodeId = task.getTaskDefinitionKey();
String flowKey = task.getProcessDefinitionId();
Map<String, Object> variables = taskService.getVariables(taskId);
String datas = JSON.toJSONString(variables);
dataHistory.setTaskId(taskId);
// dataHistory.setTaskId(taskId);
dataHistory.setDatas(datas);
dataHistory.setNodeId(nodeId);
dataHistory.setProcessInstanceId(processInstanceId);
dataHistory.setFlowKey(flowKey);
dataHistoryService.saveData(dataHistory);
}
}
......
package com.tykj.workflowcore.workflow_editer.service.impl;
import cn.hutool.core.util.StrUtil;
import com.tykj.workflowcore.api.service.SpringBeanService;
import com.tykj.workflowcore.base.result.ApiException;
import com.tykj.workflowcore.base.util.FileUtil;
......@@ -17,6 +16,7 @@ import com.tykj.workflowcore.workflow_editer.service.WorkFlowService;
import com.tykj.workflowcore.workflow_editer.util.UserServiceBeanUtil;
import io.swagger.annotations.Api;
import liquibase.pro.packaged.E;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.*;
import org.dom4j.io.SAXReader;
import org.flowable.bpmn.converter.BpmnXMLConverter;
......@@ -24,7 +24,6 @@ import org.flowable.bpmn.model.*;
import org.flowable.bpmn.model.Process;
import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.*;
import org.flowable.engine.history.HistoricDetail;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.repository.Deployment;
import org.flowable.engine.runtime.ProcessInstance;
......@@ -33,19 +32,16 @@ import org.flowable.task.api.TaskQuery;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.flowable.validation.ProcessValidator;
import org.flowable.validation.ValidationError;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
......@@ -211,7 +207,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
String flowXmlResourceName = flowKey + "bpmn20.xml";
String CustomFlowXmlResourceName = flowKey + "bpmnCustom20.xml";
//从数据库里查处来
if (StrUtil.isEmpty(flowsInfo.getFilePath())){
if (StringUtils.isEmpty(flowsInfo.getFilePath())){
//生成xml文件
flowsInfo = flowsInfoVo.toEntity(flowsInfo);
flowsInfo.setResourceName(flowXmlResourceName);
......@@ -321,7 +317,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
//设置流程发起人
WorkFlowUser currentUser = userService.getCurrentUser();
Authentication.setAuthenticatedUserId(currentUser.getId() + "");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(startFlowVo.getFlowKey(),
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(startFlowVo.getFlowKey(),startFlowVo.getFlowKey(),
startFlowVo.getMap());
// 存储流程实例id
// 根据flowKey查询出一个FlowInfo
......@@ -376,7 +372,8 @@ public class WorkFlowServiceImpl implements WorkFlowService {
}
@Override
public Map<String, Object> findTaskDetail(String taskId) {Map<String, Object> variables = new HashMap<>();
public Map<String, Object> findTaskDetail(String taskId) {
Map<String, Object> variables = new HashMap<>();
//流程还在运行
if (taskId != null) {
variables = taskService.getVariables(taskId);
......
......@@ -91,6 +91,7 @@ public class FlowEventValidator extends ProcessLevelValidator {
if (incomingFlows.size() == 0 || incomingFlows.equals("")){
errors.add(createValidationErrorProblem("缺少连接网关的输出流"));
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论