提交 fd70c7aa authored 作者: whydesc's avatar whydesc

--计划管理增加待办,流程增加待办任务节点信息表

上级 8e4b2db8
......@@ -139,5 +139,14 @@ export function getNextFlowNodeType(query) {
}
// 得到业务部署流程的节点的流程信息
export function getMyTaskFlow(data) {
return defHttp.post({
url: '/flowable/task/getMyTaskFlow',
data: data
})
}
......@@ -216,7 +216,7 @@
// API
import { flowRecord } from '/@/components/Process/api/finished';
import { flowXmlAndNode } from '/@/components/Process/api/definition';
import { complete, flowTaskForm, getNextFlowNode } from '/@/components/Process/api/todo';
import { complete, flowTaskForm, getNextFlowNode,getMyTaskFlow} from '/@/components/Process/api/todo';
import { flowTaskInfo } from '/@/components/Process/api/process';
// 组件
......@@ -632,6 +632,7 @@ console.log("执行发送 ",submitData);
try {
// 设置工作流数据
workFlowData.value = data;
console.log("why iniData",data);
// 更新任务表单
Object.assign(taskForm, {
......
......@@ -115,7 +115,7 @@
import { useRoute } from 'vue-router';
// 引入待办任务组件
import TodoIndex from '../../flowable/task/todo/components/TodoIndex.vue';
import { todoList } from '/@/components/Process/api/todo';
import { todoList,getMyTaskFlow } from '/@/components/Process/api/todo';
const refTodoIndex = ref();
const isShowDrawer = ref(false);
const startUser = ref<string>('');
......@@ -246,7 +246,7 @@
return base || {};
}
// 待办任务:点击后若流程未启动则先启动,再在抽屉中完成流程操作
// 发起任务:点击后若流程未启动则先启动,再在抽屉中完成流程操作
async function handleTodo(record: Recordable) {
const dataId = record.id || record.dataId || record.businessId;
if (!dataId) {
......@@ -341,6 +341,23 @@ console.log("流程已启动:优先使用 record.taskId,否则尝试用 proc
message.error('获取任务信息失败');
}
}
// 待办任务:
async function handleTodoDb(record: Recordable) {
const dataId = record.id;
const deployId = record.deployId;
if (!dataId||!deployId) {
message.error('未找到业务数据标识');
return;
}
const myTaskFlow = await getMyTaskFlow({ deploymentId: record.deployId,dataId: record.id});
console.log('获取流程任务信息:', myTaskFlow);
}
async function handleSubmit(record) {
if (record.approveDepCode == '' || record.approveUser == '') {
message.warning('请选择审核部门与审核人后进行提交');
......@@ -381,6 +398,14 @@ console.log("流程已启动:优先使用 record.taskId,否则尝试用 proc
},
onClick: handleTodo.bind(null, record),
},
{
label: '待办',
ifShow: () => {
if (record['bpmStatus'] == '2') return true;
else return false;
},
onClick: handleTodoDb.bind(null, record),
},
{
label: '修改',
onClick: handleEdit.bind(null, record),
......
package org.jeecg.modules.flowable.apithird.business.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: my_task_flow
* @Author: jeecg-boot
* @Date: 2026-03-19
* @Version: V1.0
*/
@Data
@TableName("my_task_flow")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="my_task_flow")
public class MyTaskFlow implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.AUTO)
@Schema(description = "id")
private java.lang.Integer id;
/**formTableName*/
@Excel(name = "formTableName", width = 15)
@Schema(description = "formTableName")
private java.lang.String formTableName;
/**targetId*/
@Excel(name = "targetId", width = 15)
@Schema(description = "targetId")
private java.lang.String targetId;
/**deployId*/
@Excel(name = "deployId", width = 15)
@Schema(description = "deployId")
private java.lang.String deployId;
/**taskId*/
@Excel(name = "taskId", width = 15)
@Schema(description = "taskId")
private java.lang.String taskId;
/**procInsId*/
@Excel(name = "procInsId", width = 15)
@Schema(description = "procInsId")
private java.lang.String procInsId;
/**executionId*/
@Excel(name = "executionId", width = 15)
@Schema(description = "executionId")
private java.lang.String executionId;
/**procDefId*/
@Excel(name = "procDefId", width = 15)
@Schema(description = "procDefId")
private java.lang.String procDefId;
}
package org.jeecg.modules.flowable.apithird.business.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.flowable.apithird.business.entity.MyTaskFlow;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: my_task_flow
* @Author: jeecg-boot
* @Date: 2026-03-19
* @Version: V1.0
*/
public interface MyTaskFlowMapper extends BaseMapper<MyTaskFlow> {
MyTaskFlow selectMyTaskFlowByDeployId(String deployId,String targetId);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.flowable.apithird.business.mapper.MyTaskFlowMapper">
<select id="selectMyTaskFlowByDeployId" resultType="org.jeecg.modules.flowable.apithird.business.entity.MyTaskFlow">
SELECT t.deploy_id,t.task_id,t.proc_ins_id,t.execution_id,t.proc_def_id,t.target_id
FROM my_task_flow t
WHERE t.deploy_id=#{deployId} AND t.target_id=#{targetId}
ORDER BY t.id DESC
LIMIT 1
</select>
</mapper>
\ No newline at end of file
package org.jeecg.modules.flowable.apithird.business.service;
import org.jeecg.modules.flowable.apithird.business.entity.MyTaskFlow;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: my_task_flow
* @Author: jeecg-boot
* @Date: 2026-03-19
* @Version: V1.0
*/
public interface IMyTaskFlowService extends IService<MyTaskFlow> {
public MyTaskFlow selectMyTaskFlowByDeployId(String deployId,String targetId) ;
}
package org.jeecg.modules.flowable.apithird.business.service.impl;
import org.jeecg.modules.flowable.apithird.business.entity.FlowForm;
import org.jeecg.modules.flowable.apithird.business.entity.MyTaskFlow;
import org.jeecg.modules.flowable.apithird.business.mapper.MyTaskFlowMapper;
import org.jeecg.modules.flowable.apithird.business.mapper.SysDeployFormMapper;
import org.jeecg.modules.flowable.apithird.business.service.IMyTaskFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: my_task_flow
* @Author: jeecg-boot
* @Date: 2026-03-19
* @Version: V1.0
*/
@Service
public class MyTaskFlowServiceImpl extends ServiceImpl<MyTaskFlowMapper, MyTaskFlow> implements IMyTaskFlowService {
@Autowired
private MyTaskFlowMapper myTaskFlowMapper;
@Override
public MyTaskFlow selectMyTaskFlowByDeployId(String deployId,String targetId) {
return myTaskFlowMapper.selectMyTaskFlowByDeployId(deployId,targetId);
}
}
......@@ -264,4 +264,9 @@ public class FlowTaskController {
return flowTaskFormService.flowTaskForm(taskId);
}
@PostMapping(value = "/getMyTaskFlow")
public Result getMyTaskFlow(@RequestBody FlowTaskVo flowTaskVo) {
return flowTaskService.getMyTaskFlow(flowTaskVo);
}
}
......@@ -174,6 +174,7 @@ public interface IFlowTaskService {
public Result getNextFlowNodeType(String taskId);
public FlowNextDto getFlowNodeType(String taskId);
public Result flowFormAllData(String deployId,String taskId);
public Result getMyTaskFlow(FlowTaskVo flowTaskVo);
......
......@@ -41,7 +41,9 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.modules.flowable.apithird.business.entity.FlowForm;
import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness;
import org.jeecg.modules.flowable.apithird.business.entity.MyTaskFlow;
import org.jeecg.modules.flowable.apithird.business.service.IFlowFormService;
import org.jeecg.modules.flowable.apithird.business.service.IMyTaskFlowService;
import org.jeecg.modules.flowable.apithird.business.service.ISysDeployFormService;
import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl;
import org.jeecg.modules.flowable.apithird.entity.ActStatus;
......@@ -97,6 +99,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
private ISysDeployFormService sysDeployFormService;
@Autowired
private IMyTaskService myTaskService;
@Autowired
private IMyTaskFlowService myTaskFlowService;
/**
* 完成任务
......@@ -177,6 +181,30 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
myTask.setLinkAddr(sysForm.getFormListurl());
myTaskService.save(myTask);
// 4. 根据流程定义ID查询流程定义对象
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(task.getProcessDefinitionId())
.singleResult();
String deploymentId ="";
if (processDefinition != null) {
// 获取部署ID - 这就是你想要的deployId
deploymentId = processDefinition.getDeploymentId();
}
//有了以上信息,可以向相关表写入 相关信息了
MyTaskFlow taskFlow=new MyTaskFlow();
taskFlow.setTaskId(nextTask.getId());
taskFlow.setProcDefId(nextTask.getProcessDefinitionId());
taskFlow.setProcInsId(nextTask.getProcessInstanceId());
taskFlow.setExecutionId(nextTask.getExecutionId());
taskFlow.setTargetId(zdval);
taskFlow.setDeployId(deploymentId);
taskFlow.setFormTableName(sysForm.getFormTableName());
myTaskFlowService.save(taskFlow);
}
}
......@@ -2613,4 +2641,14 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Override
public Result getMyTaskFlow(FlowTaskVo flowTaskVo) {
//flowTaskVo.getDeploymentId()
//flowTaskVo.getDataId()
MyTaskFlow myTaskFlow= myTaskFlowService.selectMyTaskFlowByDeployId(flowTaskVo.getDeploymentId(),flowTaskVo.getDataId());
return Result.OK(myTaskFlow);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论