当前位置:网站首页>Activiti目录(四)查询代办/已办、审核
Activiti目录(四)查询代办/已办、审核
2022-07-06 09:30:00 【爱机车的程序猿】
把Activiti打入你的脑袋,通过查询代办/已办、审核快速打入
目录
一、审核代办/已办
功能 | 思路 |
---|---|
1.查询当前用户 | |
代办 | 2.根据当前用户ID获取待审核任务 |
3.返回待审核任务信息 | |
– | – |
1.查询当前用户 | |
已办 | 2.根据当前用户ID获取历史审核任务 |
3.返回历史审核任务信息 |
/** * 审核列表 * TODO 1:查询用户及权限 * TODO 2:查询用户审核状态 * TODO 3:获取当前用户待办任务流程 * TODO 4:根据任务实例ID查询业务表信息 * TODO 5:返回业务信息 * @return */
public DataGridPojo ingProessList(String applyState,String userId) {
// 当前登录用户信息
// User user = (User) this.session.getAttribute("currentLoginUser");
// Long userId = Long.valueOf(user.getUserId());
// Object userIds1 = runtimeService.getVariable(task.getProcessInstanceId() + "", "userIds1"); //查看variable常量表
List Result = new ArrayList();
if(applyState.equals("待审核")){
// 查看当前用户待审核记录
List<Task> tasks = taskService.createTaskQuery().taskInvolvedUser(userId)
.orderByTaskCreateTime().desc()
.list();// 代办列表
Result = tasks;
}else if(applyState.equals("已审核") || applyState.equals("审核通过")){
// 已办审核记录
List<HistoricTaskInstance> histTaskList = historyService.createHistoricTaskInstanceQuery().taskInvolvedUser(userId)
.orderByHistoricTaskInstanceStartTime().desc()
.list();// 已办列表
// 审核过记录ssss
List<HistoricTaskInstance> histTaskApproveds = histTaskList.stream().filter(h -> "epidemicGroup".equals(h.getName()) && null != h.getEndTime()).collect(Collectors.toList());
Result = applyState.equals("已审核")
? histTaskList : histTaskApproveds;
}
DataGridPojo dataGridPojo = new DataGridPojo();
dataGridPojo.setRows(Result);
return dataGridPojo;
}
二、签收代办(审核)
思路 | |
---|---|
根据流程实例ID和当前用户ID查询流程任务是否存在 | |
存在 | 1.根据当前人员设置审核节点状态 |
2.通过节点状态完成审核任务 | |
– | – |
不存在 | 返回不成功状态码 |
/** * 审核 * @param user 用户信息 * @param apply 业务信息 */
public int aduit(User user,Apply apply){
// 用户ID
if(null == user) return -1;
//查询当前审批节点
Task task = taskService.createTaskQuery().processInstanceId(apply.getProcessInstanceId()).taskInvolvedUser(user.getUserId()+"").singleResult();
int state = -1;
if(null != task) {
//设置流程参数:审批ID
Map<String, Object> args = new HashMap<>();
switch (task.getName()){
case "teacher":
state = Constants.EPIDEMIC_APPLY_STATE_LSSH;
break;
case "academy":
state=Constants.EPIDEMIC_APPLY_STATE_XSCSH;
break;
case "epidemicGroup":
state=Constants.EPIDEMIC_APPLY_STATE_GZXZSH;
break;
}
args.put("applyState", state);//设置流程参数
// 设置审批任务的执行人
taskService.setAssignee(task.getId(),user.getUserId() + "");
try {
//完成审批任务
taskService.complete(task.getId(), args);
} catch (Exception e) {
log.error(e.getMessage());
return -1;
}
}
return state;
}
三、实例代码
代办:
已办:
审核代办:
查代办看是否完成:
查已办是否存在:
边栏推荐
- Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
- JS time function Daquan detailed explanation ----- AHAO blog
- Saw local status change event StatusChangeEvent [timestamp=1644048792587, current=DOWN, previous=UP]
- ByteDance new programmer's growth secret: those glittering treasures mentors
- Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.
- DS18B20数字温度计系统设计
- LeetCode 1640. Can I connect to form an array
- 汇编语言基础知识
- Tencent interview algorithm question
- Two weeks' experience of intermediate software designer in the crash soft exam
猜你喜欢
LeetCode 1584. Minimum cost of connecting all points
Some instructions on whether to call destructor when QT window closes and application stops
~87 animation
原型链继承
I'm "fixing movies" in ByteDance
[unsolved]7-14 calculation diagram
~85 transition
字节跳动多篇论文入选 CVPR 2021,精选干货都在这里了
Two weeks' experience of intermediate software designer in the crash soft exam
Basic principles of video compression coding and audio compression coding
随机推荐
GCC error: terminate called after throwing an instance of 'std:: regex_ error‘ what(): regex
字节跳动2022校招研发提前批宣讲会,同学们最关心的10个问题
Usage of insert() in vector
7-10 punch in strategy
Shell_ 06_ Judgment and circulation
JS time function Daquan detailed explanation ----- AHAO blog
ByteDance new programmer's growth secret: those glittering treasures mentors
SQL quick start
~Introduction to form 80
数据传送指令
汇编语言段定义
How to configure hosts when setting up Eureka
Erlang installation
~69 other ways to use icon fonts
8086 分段技术
姚班智班齐上阵,竞赛高手聚一堂,这是什么神仙编程大赛?
Shell_ 01_ data processing
Record the error reason
Audio and video development interview questions
~70 row high