[新增] 批量发起完成任务
This commit is contained in:
+36
@@ -313,6 +313,42 @@ public class TodoTaskController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量完成任务", notes = "流程单个节点任务,直接完成任务")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "taskId", value = "任务id"),
|
||||
@ApiImplicitParam(name = "userId", value = "完成任务用户Id")})
|
||||
@PostMapping("/batchCompleteTask")
|
||||
public Wrapper<String> batchCompleteTask(@RequestBody List<ApproveDataVO> busMesList) {
|
||||
for (ApproveDataVO busMes : busMesList) {
|
||||
log.info("!!!!!!!!!!!!!TaskId!!!!!!!!!!!!!!!"+busMes.getTaskId());
|
||||
String dataJson = busMes.getDataJson();
|
||||
String reportId = busMes.getReportId();
|
||||
if (busMes.getTaskId() != null && !busMes.getTaskId().equals("")) {
|
||||
Task task = taskService.createTaskQuery().taskId(busMes.getTaskId()).singleResult();
|
||||
if(task!=null){
|
||||
if (StrUtil.isEmpty(task.getAssignee())) {
|
||||
taskService.claim(busMes.getTaskId(), busMes.getUserId());
|
||||
}
|
||||
BusProcessApprove busProcessApprove = new BusProcessApprove();
|
||||
busProcessApprove.setTaskId(busMes.getTaskId());
|
||||
busProcessApprove.setCreateUserId(UserUtils.getUserId());
|
||||
busProcessApprove.setPrcId(task.getProcessInstanceId());
|
||||
busProcessApprove.setCreateDate(new Date());
|
||||
busProcessApprove.setFromValsJson(busMes.getSubmitJson());
|
||||
ibusProcessApproveService.save(busProcessApprove);
|
||||
if (StringUtils.isNotEmpty(dataJson)){
|
||||
//根据业务情况 对业务数据进行saveOrupdate
|
||||
activitDefineService.saveOrUpdateDate(busMes.getPrcType(),dataJson, task.getId(),
|
||||
task.getProcessInstanceId(),reportId);
|
||||
}
|
||||
taskService.complete(busMes.getTaskId());
|
||||
}
|
||||
} else {
|
||||
throw new AdcDaBaseException("缺少任务id,无法完成任务");
|
||||
}
|
||||
}
|
||||
return WrapMapper.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询流程编号", notes = "根据流程实例ID查询流程编号")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "pId", value = "流程id")})
|
||||
@GetMapping("/findPrcNumByPid")
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user