Browse Source

完善加签功能,增加加签人审批意见

master
fanzongzhe 2 years ago
parent
commit
d17f5ca04e
  1. 5
      anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableMapper.java
  2. 4
      anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableMapper.xml
  3. 6
      anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableService.java
  4. 3
      anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowService.java
  5. 529
      anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java

5
anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableMapper.java

@ -5,9 +5,11 @@ import com.yxt.anrui.flowable.api.flow.FlowListVo;
import com.yxt.anrui.flowable.api.flow.FlowProcinst;
import com.yxt.anrui.flowable.api.flow.FlowSelectVo;
import com.yxt.anrui.flowable.api.flow.Flowable;
import com.yxt.anrui.flowable.api.flowcomment.FlowCommentDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.flowable.engine.task.Comment;
import java.util.List;
import java.util.Map;
@ -30,4 +32,7 @@ public interface FlowableMapper extends BaseMapper<Flowable> {
List<FlowListVo> selectFlowList();
FlowSelectVo selectFlows(@Param("proDefId") String proDefId, @Param("proInsId") String proInsId);
FlowCommentDto selectComment(@Param("type") String type, @Param("taskId") String taskId, @Param("processInstanceId") String processInstanceId,@Param("id") String id);
}

4
anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableMapper.xml

@ -32,6 +32,10 @@
FROM ACT_HI_PROCINST ahpi
where ahpi.PROC_DEF_ID_ = #{proDefId} and ahpi.PROC_INST_ID_ = #{proInsId}
</select>
<select id="selectComment" resultType="com.yxt.anrui.flowable.api.flowcomment.FlowCommentDto">
select TYPE_ type,MESSAGE_ comment from act_hi_comment where TYPE_ = #{type} and TASK_ID_ = #{taskId} and PROC_INST_ID_ = #{processInstanceId} and ID_ = #{id}
order by TIME_ asc
</select>
<!--
<insert id="insetFlowableTask">
insert into `act_ru_task` (`REV`, `EXECUTION_ID`, `PROC_INST_ID`, `PROC_DEF_ID`,

6
anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableService.java

@ -2,6 +2,7 @@ package com.yxt.anrui.flowable.biz.flow;
import cn.hutool.core.bean.BeanUtil;
import com.yxt.anrui.flowable.api.flow.*;
import com.yxt.anrui.flowable.api.flowcomment.FlowCommentDto;
import com.yxt.anrui.flowable.api.flowtask.FlowTask;
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo;
import com.yxt.anrui.flowable.api.utils.ProcessStateEnum;
@ -16,6 +17,7 @@ import com.yxt.common.base.utils.StringUtils;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import org.flowable.engine.TaskService;
import org.flowable.engine.task.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -287,4 +289,8 @@ public class FlowableService extends MybatisBaseService<FlowableMapper, Flowable
}
return rb.success().setData(flowSelectVo);
}
public FlowCommentDto selectComment(String type, String taskId, String processInstanceId,String id) {
return baseMapper.selectComment(type,taskId,processInstanceId,id);
}
}

3
anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowService.java

@ -40,6 +40,7 @@ import org.flowable.bpmn.model.*;
import org.flowable.bpmn.model.Process;
import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.*;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.history.HistoricActivityInstance;
@ -479,7 +480,9 @@ public class FlowService extends MybatisBaseService<FlowMapper, Flowable> {
}
if (DelegationState.PENDING.equals(task.getDelegationState())) {
adminContains = false;
//加签
Authentication.setAuthenticatedUserId(userSid);
taskService.addComment(taskId, instanceId,
FlowComment.DELEGATE.getType(), comment);
taskService.resolveTask(taskId, formVariables);

529
anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java

File diff suppressed because it is too large
Loading…
Cancel
Save