提交 11ce9257 authored 作者: whydesc's avatar whydesc

--计划增加多个执行字段

上级 64611719
...@@ -424,7 +424,10 @@ ...@@ -424,7 +424,10 @@
let formValues = resData.formValues; let formValues = resData.formValues;
let formUrlparval = formValues.dataId; let formUrlparval = formValues.dataId;
let formUrlpar = formValues.dataName; let formUrlpar = formValues.dataName;
formUrl.value = flowForm.formUrl + '?' + formUrlpar + '=' + formUrlparval; const connector = flowForm.formUrl.includes('?') ? '&' : '?';
formUrl.value = flowForm.formUrl + connector + formUrlpar + '=' + formUrlparval;
//formUrl.value = flowForm.formUrl + '?' + formUrlpar + '=' + formUrlparval;
console.error('表单url:', formUrl.value);
} }
formError.value = false; formError.value = false;
} catch (error) { } catch (error) {
......
...@@ -65,6 +65,8 @@ ...@@ -65,6 +65,8 @@
const resetForm = () => { const resetForm = () => {
formRef.value.resetFields(); formRef.value.resetFields();
}; };
// 1 接收 id 2 保存调用 StPlanMan.api 的 saveOrUpdate
</script> </script>
<style scoped></style> <style scoped></style>
package org.jeecg.modules.flowable.service; package org.jeecg.modules.flowable.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.flowable.bpmn.model.UserTask;
import org.flowable.engine.repository.ProcessDefinition; import org.flowable.engine.repository.ProcessDefinition;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.flowable.domain.dto.FlowProcDefDto; import org.jeecg.modules.flowable.domain.dto.FlowProcDefDto;
...@@ -8,6 +9,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -8,6 +9,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -105,4 +107,5 @@ public interface IFlowDefinitionService { ...@@ -105,4 +107,5 @@ public interface IFlowDefinitionService {
* @return * @return
*/ */
public Result startProcessInstanceByDeployId(String DeployId, Map<String, Object> variables); public Result startProcessInstanceByDeployId(String DeployId, Map<String, Object> variables);
public List<UserTask> taskList(String deployId);
} }
...@@ -7,8 +7,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -7,8 +7,7 @@ import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.flowable.bpmn.model.BpmnModel; import org.flowable.bpmn.model.*;
import org.flowable.bpmn.model.UserTask;
import org.flowable.engine.ProcessEngineConfiguration; import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.RepositoryService; import org.flowable.engine.RepositoryService;
import org.flowable.engine.history.HistoricActivityInstance; import org.flowable.engine.history.HistoricActivityInstance;
...@@ -620,4 +619,238 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl ...@@ -620,4 +619,238 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
/**
* 流程所有节点信息
*
* @param deployId
* @return
*/
@Override
public List<UserTask> taskList(String deployId) {
// 4. 分类收集各种节点
List<UserTask> userTasks = new ArrayList<>();
List<String> propertyuserTasks = new ArrayList<>();
List<String> userTypeuserTasks = new ArrayList<>();
// 1. 第一步:根据部署ID查询流程定义
List<ProcessDefinition> processDefinitions = repositoryService
.createProcessDefinitionQuery()
.deploymentId(deployId)
.list();
if (processDefinitions == null || processDefinitions.isEmpty()) {
return null;
}
// 2. 遍历该部署下的所有流程定义(一个部署可能包含多个流程定义)
for (ProcessDefinition processDefinition : processDefinitions) {
/**
System.out.println("===== 流程定义基本信息 =====");
System.out.println("流程定义ID: " + processDefinition.getId());
System.out.println("流程定义Key: " + processDefinition.getKey());
System.out.println("流程名称: " + processDefinition.getName());
System.out.println("版本号: " + processDefinition.getVersion());
System.out.println("部署ID: " + processDefinition.getDeploymentId());
System.out.println("BPMN资源名称: " + processDefinition.getResourceName());
System.out.println();
*/
// 3. 第二步:获取BPMN模型并解析节点
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
if (bpmnModel == null) {
System.out.println("无法获取BPMN模型");
continue;
}
// 获取所有流程元素
Collection<FlowElement> flowElements = bpmnModel.getMainProcess().getFlowElements();
// 4. 分类收集各种节点
//List<UserTask> userTasks = new ArrayList<>();
/**
List<ServiceTask> serviceTasks = new ArrayList<>();
List<ScriptTask> scriptTasks = new ArrayList<>();
List<BusinessRuleTask> businessRuleTasks = new ArrayList<>();
List<ReceiveTask> receiveTasks = new ArrayList<>();
List<ManualTask> manualTasks = new ArrayList<>();
List<SendTask> sendTasks = new ArrayList<>();
*/
List<StartEvent> startEvents = new ArrayList<>();
List<EndEvent> endEvents = new ArrayList<>();
/**
List<ExclusiveGateway> exclusiveGateways = new ArrayList<>();
List<ParallelGateway> parallelGateways = new ArrayList<>();
List<InclusiveGateway> inclusiveGateways = new ArrayList<>();
List<SubProcess> subProcesses = new ArrayList<>();
List<CallActivity> callActivities = new ArrayList<>();
*/
// 5. 遍历所有流程元素,按类型分类
for (FlowElement element : flowElements) {
if (element instanceof UserTask) {
// 获取 flowable:userType
String userType = element.getAttributeValue(
"http://flowable.org/bpmn",
"userType"
);
// 获取 flowable:assignee
String assignee = element.getAttributeValue("http://flowable.org/bpmn", "assignee");
// 获取 flowable:candidateGroups
String candidateGroups = element.getAttributeValue("http://flowable.org/bpmn", "candidateGroups");
String propertyname="";
String propertyvalue="";
//获得属性
// 获取 extensionElements
Map<String, List<ExtensionElement>> extensionElements = element.getExtensionElements();
if (extensionElements != null && extensionElements.containsKey("properties")) {
List<ExtensionElement> properties = extensionElements.get("properties");
for (ExtensionElement property : properties) {
// 获取 property 元素下的子元素
List<ExtensionElement> propertyElements = property.getChildElements().get("property");
for (ExtensionElement propertyElement : propertyElements) {
propertyname = propertyElement.getAttributeValue(null, "name");
propertyvalue= propertyElement.getAttributeValue(null, "value");
// System.out.println("Property Name: " + name + ", Value: " + value);
}
}
}
userTasks.add((UserTask) element);
if(propertyname.equals("")){
propertyuserTasks.add(propertyname);
}else{
propertyuserTasks.add(propertyname+";"+propertyvalue);
}
if(userType.equals("")){
userTypeuserTasks.add(userType);
}else{
userTypeuserTasks.add(userType);
}
}/** else if (element instanceof ServiceTask) {
serviceTasks.add((ServiceTask) element);
} else if (element instanceof ScriptTask) {
scriptTasks.add((ScriptTask) element);
} else if (element instanceof BusinessRuleTask) {
businessRuleTasks.add((BusinessRuleTask) element);
} else if (element instanceof ReceiveTask) {
receiveTasks.add((ReceiveTask) element);
} else if (element instanceof ManualTask) {
manualTasks.add((ManualTask) element);
} else if (element instanceof SendTask) {
sendTasks.add((SendTask) element);
} */ else if (element instanceof StartEvent) {
startEvents.add((StartEvent) element);
} else if (element instanceof EndEvent) {
endEvents.add((EndEvent) element);
} /** else if (element instanceof ExclusiveGateway) {
exclusiveGateways.add((ExclusiveGateway) element);
} else if (element instanceof ParallelGateway) {
parallelGateways.add((ParallelGateway) element);
} else if (element instanceof InclusiveGateway) {
inclusiveGateways.add((InclusiveGateway) element);
} else if (element instanceof SubProcess) {
subProcesses.add((SubProcess) element);
} else if (element instanceof CallActivity) {
callActivities.add((CallActivity) element);
} */
}
// 6. 输出各节点详细信息
/**
printNodeInfo("开始事件", startEvents);
printNodeInfo("用户任务", userTasks);
printNodeInfo("服务任务", serviceTasks);
printNodeInfo("脚本任务", scriptTasks);
printNodeInfo("业务规则任务", businessRuleTasks);
printNodeInfo("接收任务", receiveTasks);
printNodeInfo("手动任务", manualTasks);
printNodeInfo("发送任务", sendTasks);
printNodeInfo("排他网关", exclusiveGateways);
printNodeInfo("并行网关", parallelGateways);
printNodeInfo("包容网关", inclusiveGateways);
printNodeInfo("子流程", subProcesses);
printNodeInfo("调用活动", callActivities);
printNodeInfo("结束事件", endEvents);
*/
}
propertyuserTasks.size();
userTypeuserTasks.size();
return userTasks;
}
/**
* 打印节点信息
*/
private void printNodeInfo(String nodeType, List<? extends FlowElement> nodes) {
if (nodes == null || nodes.isEmpty()) {
return;
}
System.out.println("========== " + nodeType + " (" + nodes.size() + "个) ==========");
for (FlowElement node : nodes) {
System.out.println("节点ID: " + node.getId());
System.out.println("节点名称: " + node.getName());
// 输出节点特有的详细信息
if (node instanceof UserTask) {
UserTask userTask = (UserTask) node;
System.out.println(" 候选人: " + userTask.getCandidateUsers());
System.out.println(" 候选组: " + userTask.getCandidateGroups());
System.out.println(" 指派人: " + userTask.getAssignee());
System.out.println(" 表单Key: " + userTask.getFormKey());
System.out.println(" 任务监听器: " + (userTask.getTaskListeners() != null ? userTask.getTaskListeners().size() : 0));
} else if (node instanceof ServiceTask) {
ServiceTask serviceTask = (ServiceTask) node;
System.out.println(" 实现类型: " + serviceTask.getImplementationType());
System.out.println(" 实现: " + serviceTask.getImplementation());
System.out.println(" 类: " + serviceTask.getImplementation());
} else if (node instanceof ExclusiveGateway) {
ExclusiveGateway gateway = (ExclusiveGateway) node;
System.out.println(" 默认流: " + gateway.getDefaultFlow());
} else if (node instanceof SubProcess) {
SubProcess subProcess = (SubProcess) node;
System.out.println(" 子流程内元素数量: " + subProcess.getFlowElements().size());
} else if (node instanceof CallActivity) {
CallActivity callActivity = (CallActivity) node;
System.out.println(" 调用的流程Key: " + callActivity.getCalledElement());
}
// 输出所有节点的通用扩展属性
Map<String, List<ExtensionElement>> extensionElements = node.getExtensionElements();
if (extensionElements != null && !extensionElements.isEmpty()) {
System.out.println(" 扩展属性: " + extensionElements.keySet());
}
System.out.println();
}
}
} }
...@@ -170,7 +170,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -170,7 +170,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
myTask.setUid(approvalId); myTask.setUid(approvalId);
myTask.setTp(5); myTask.setTp(5);
myTask.setTarget(nextTask.getName()); myTask.setTarget(nextTask.getName());
if(zdval!=null&&!zdval.equals("")){
myTask.setTargetId(zdval); //zdval myTask.setTargetId(zdval); //zdval
}
myTask.setStTime(new Date()); myTask.setStTime(new Date());
myTask.setTaskName("待处理"); myTask.setTaskName("待处理");
myTask.setName(nextTask.getName()); myTask.setName(nextTask.getName());
...@@ -178,7 +181,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -178,7 +181,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
myTask.setPriority("M"); myTask.setPriority("M");
myTask.setDes(""); myTask.setDes("");
//myTask.setLinkAddr("/project/plan/StPlanManList?"+zdmc+"="+zdval); //myTask.setLinkAddr("/project/plan/StPlanManList?"+zdmc+"="+zdval);
if(sysForm!=null){
myTask.setLinkAddr(sysForm.getFormListurl()); myTask.setLinkAddr(sysForm.getFormListurl());
}
myTaskService.save(myTask); myTaskService.save(myTask);
// 4. 根据流程定义ID查询流程定义对象 // 4. 根据流程定义ID查询流程定义对象
...@@ -197,7 +203,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -197,7 +203,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskFlow.setProcDefId(nextTask.getProcessDefinitionId()); taskFlow.setProcDefId(nextTask.getProcessDefinitionId());
taskFlow.setProcInsId(nextTask.getProcessInstanceId()); taskFlow.setProcInsId(nextTask.getProcessInstanceId());
taskFlow.setExecutionId(nextTask.getExecutionId()); taskFlow.setExecutionId(nextTask.getExecutionId());
if(zdval!=null&&!zdval.equals("")){
taskFlow.setTargetId(zdval); taskFlow.setTargetId(zdval);
}
taskFlow.setDeployId(deploymentId); taskFlow.setDeployId(deploymentId);
taskFlow.setFormTableName(sysForm.getFormTableName()); taskFlow.setFormTableName(sysForm.getFormTableName());
taskFlow.setUid(approvalId); taskFlow.setUid(approvalId);
......
...@@ -150,5 +150,35 @@ public class StPlanMan implements Serializable { ...@@ -150,5 +150,35 @@ public class StPlanMan implements Serializable {
/**处理人id*/ /**处理人id*/
private java.lang.String uid; private java.lang.String uid;
/**执行人*/
@Excel(name = "执行人", width = 15)
private java.lang.String exeUid;
/**执行操作时间*/
@Excel(name = "执行操作时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date exeTime;
/**执行状态*/
@Excel(name = "执行状态", width = 15)
private java.lang.String executeStatus;
/**实际开始时间*/
@Excel(name = "实际开始时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date actualStartTime;
/**实际结束时间*/
@Excel(name = "实际结束时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date actualEndTime;
/**执行记录*/
@Excel(name = "执行记录", width = 15)
private java.lang.String executeEcord;
/**执行附件*/
@Excel(name = "执行附件", width = 15)
private java.lang.String attachments;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论