当前位置:网站首页>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;
}
三、实例代码
代办:
已办:
审核代办:
查代办看是否完成:
查已办是否存在:
边栏推荐
- How to generate six digit verification code
- Solr word segmentation analysis
- 7-8 likes (need to continue to improve)
- 100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021
- Conception du système de thermomètre numérique DS18B20
- ~78 radial gradient
- Solr new core
- After the subscript is used to assign a value to the string type, the cout output variable is empty.
- LeetCode 1560. The sector with the most passes on the circular track
- GCC error: terminate called after throwing an instance of 'std:: regex_ error‘ what(): regex
猜你喜欢
One hundred questions of image processing (1-10)
Which is more important for programming, practice or theory [there are some things recently, I don't have time to write an article, so I'll post an article on hydrology, and I'll fill in later]
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.
Solr new core
Solve the single thread scheduling problem of intel12 generation core CPU (II)
数据传送指令
字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
亮相Google I/O,字节跳动是这样应用Flutter的
Soft music -js find the number of times that character appears in the string - Feng Hao's blog
Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
随机推荐
数据传送指令
~78 radial gradient
100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021
~81 long table
Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here
Tencent interview algorithm question
Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
LeetCode 1638. Count the number of substrings with only one character difference
亮相Google I/O,字节跳动是这样应用Flutter的
Data config problem: the reference to entity 'useunicode' must end with ';' delimiter.
~87 animation
Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.
Alibaba cloud server builds SVN version Library
汇编语言段定义
Shell_ 04_ Shell script
Mongodb在node中的使用
Eureka high availability
[unsolved] 7-15 shout mountain
Li Kou leetcode 280 weekly match
Fdog series (III): use Tencent cloud SMS interface to send SMS, write database, deploy to server, web finale.