From b37a535d20870871de6928f508c886a4ea51da85 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 8 Jul 2022 01:40:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=9B=9E=E9=80=80=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E6=8E=A8=E6=96=AD=E7=9A=84=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpm/convert/task/BpmTaskConvert.java | 35 +++---------------- .../bpm/dal/dataobject/task/BpmTaskExtDO.java | 4 --- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmTaskConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmTaskConvert.java index 007ff2609..91d405925 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmTaskConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmTaskConvert.java @@ -1,17 +1,14 @@ package cn.iocoder.yudao.module.bpm.convert.task; -import cn.hutool.core.util.BooleanUtil; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.number.NumberUtils; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskDonePageItemRespVO; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskTodoPageItemRespVO; import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO; -import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenTaskCreatedReqDTO; import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; - import org.flowable.common.engine.impl.db.SuspensionState; import org.flowable.engine.history.HistoricProcessInstance; import org.flowable.engine.runtime.ProcessInstance; @@ -21,7 +18,9 @@ import org.mapstruct.*; import org.mapstruct.factory.Mappers; import org.springframework.beans.BeanUtils; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -149,7 +148,7 @@ public interface BpmTaskConvert { AdminUserRespDTO startUser); default BpmTaskExtDO convert2TaskExt(Task task) { - BpmTaskExtDO taskExtDO = new BpmTaskExtDO().setTaskId(task.getId()).setTaskDefKey(task.getTaskDefinitionKey()) + BpmTaskExtDO taskExtDO = new BpmTaskExtDO().setTaskId(task.getId()) .setAssigneeUserId(NumberUtils.parseLong(task.getAssignee())).setName(task.getName()) .setProcessDefinitionId(task.getProcessDefinitionId()).setProcessInstanceId(task.getProcessInstanceId()); taskExtDO.setCreateTime(task.getCreateTime()); @@ -166,30 +165,4 @@ public interface BpmTaskConvert { return reqDTO; } - /** - * bpmTaskExtDo 类数据去重 - * - * @param bpmTaskExtDOList bpmTaskExtDo 类列表 - * - * @return 返回新的list - */ - default List distinct(List bpmTaskExtDOList) { - HashMap tmpMap = new HashMap<>(50); - List result = new ArrayList<>(); - for (BpmTaskExtDO bpmTaskExtDO : bpmTaskExtDOList) { - boolean containsResult = tmpMap.containsKey(bpmTaskExtDO.getTaskDefKey()); - if (BooleanUtil.isFalse(containsResult)) { - tmpMap.put(bpmTaskExtDO.getTaskDefKey(), bpmTaskExtDO); - } - BpmTaskExtDO tmpBpmTaskExtDO = tmpMap.get(bpmTaskExtDO.getTaskDefKey()); - if (bpmTaskExtDO.getTaskDefKey().equals(tmpBpmTaskExtDO.getTaskDefKey())) { - if (!bpmTaskExtDO.getResult().equals(BpmProcessInstanceResultEnum.PROCESS.getResult())) { - tmpMap.remove(bpmTaskExtDO.getTaskDefKey()); - tmpMap.put(bpmTaskExtDO.getTaskDefKey(), bpmTaskExtDO); - } - } - } - tmpMap.forEach((key, var) -> result.add(var)); - return result; - } } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmTaskExtDO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmTaskExtDO.java index fe71a1b77..925b19b7b 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmTaskExtDO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/task/BpmTaskExtDO.java @@ -28,10 +28,6 @@ public class BpmTaskExtDO extends BaseDO { @TableId private Long id; - /** - * 流程任务key TODO 芋艿,看看这个字段的作用 - */ - private String taskDefKey; /** * 任务的审批人 *