From 4789a3cb60828698434b448471601eb0012dff29 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 2 Dec 2022 15:14:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AE=A1=E6=A0=B8=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ActTaskController.java | 19 ++++++++++++++++++ .../activiti/dto/BatchCompleteDTO.java | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 renren-admin/src/main/java/io/renren/modules/activiti/dto/BatchCompleteDTO.java diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java index 043d8b6f..81f9f2e6 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java @@ -7,6 +7,7 @@ import io.renren.common.constant.Constant; import io.renren.common.exception.ErrorCode; import io.renren.common.page.PageData; import io.renren.common.utils.Result; +import io.renren.modules.activiti.dto.BatchCompleteDTO; import io.renren.modules.activiti.dto.TaskDTO; import io.renren.modules.activiti.service.ActTaskService; import io.renren.modules.security.user.SecurityUser; @@ -232,6 +233,24 @@ public class ActTaskController { return new Result(); } + /** + * 批量通过 + * + * @param batchCompleteDTO + * @return + */ + @PostMapping("batchComplete") + @ApiOperation("批量任务处理(完成任务)") + @LogOperation("批量任务处理(完成任务)") + public Result completeTaskBatch(@RequestBody BatchCompleteDTO batchCompleteDTO) { + batchCompleteDTO.getTaskIds().stream() + .filter(index -> org.apache.commons.lang3.StringUtils.isNotEmpty(index)) + .forEach(taskId -> { + actTaskService.completeTask(taskId, batchCompleteDTO.getComment()); + }); + return new Result().ok("批量通过成功"); + } + /** * 带参数的任务处理 */ diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/dto/BatchCompleteDTO.java b/renren-admin/src/main/java/io/renren/modules/activiti/dto/BatchCompleteDTO.java new file mode 100644 index 00000000..ab7374c2 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/activiti/dto/BatchCompleteDTO.java @@ -0,0 +1,20 @@ +package io.renren.modules.activiti.dto; + + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +@Api(tags = "批量审核表单dto") +public class BatchCompleteDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "审批意见") + private String comment; + @ApiModelProperty(value = "任务ID列表") + private List taskIds; +}