当前位置:网站首页>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;
}
三、实例代码
代办:
已办:
审核代办:
查代办看是否完成:
查已办是否存在:
边栏推荐
- SQL quick start
- 7-8 likes (need to continue to improve)
- LeetCode 1550. There are three consecutive arrays of odd numbers
- ~71 abbreviation attribute of font
- Soft music -js find the number of times that character appears in the string - Feng Hao's blog
- Cartesian tree (modified)
- DS18B20数字温度计系统设计
- 汇编语言寻址方式
- 谢邀,人在工区,刚交代码,在下字节跳动实习生
- 这116名学生,用3天时间复刻了字节跳动内部真实技术项目
猜你喜欢
Shell_ 02_ Text three swordsman
Business system compatible database oracle/postgresql (opengauss) /mysql Trivia
~81 long table
字节跳动2022校招研发提前批宣讲会,同学们最关心的10个问题
Solve the single thread scheduling problem of intel12 generation core CPU (II)
Shell_ 07_ Functions and regular expressions
~84 form supplement
koa中间件
ByteDance new programmer's growth secret: those glittering treasures mentors
Fdog series (VI): use QT to communicate between the client and the client through the server (less information, recommended Collection)
随机推荐
LeetCode 1636. Sort the array in ascending order by frequency
Shell_ 06_ Judgment and circulation
7-7 ring the stupid bell
Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
汇编语言段定义
Ffmpeg command line use
数据传送指令
Error occurred during initialization of VM Could not reserve enough space for object heap
One hundred questions of image processing (11-20)
LeetCode 1562. Find the latest group of size M
我在字节跳动「修电影」
Shell_ 03_ environment variable
Some instructions on whether to call destructor when QT window closes and application stops
@RequestMapping、@GetMapping
100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021
~Introduction to form 80
7-5 blessing arrived
~71 abbreviation attribute of font
LeetCode 1557. The minimum number of points that can reach all points
LeetCode 1550. There are three consecutive arrays of odd numbers