From 62c59caf8eff4c09207acfff0bee0cff801cf18a Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 19 Aug 2024 18:43:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD=E6=9D=A1=E4=BB=B6=E5=88=86=E6=B5=81=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E7=9A=84=E6=B5=81=E8=BD=AC=E8=A7=84=E5=88=99=E4=B8=AD=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=8F=82=E6=95=B0=E6=89=A9=E5=85=85=EF=BC=88?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8A=E6=8A=A5=E4=BA=BA=E9=9B=86=E5=9B=A2?= =?UTF-8?q?=E3=80=81=E4=B8=8A=E6=8A=A5=E4=BA=BA=E4=B8=AD=E5=BF=83=E5=92=8C?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E4=BA=BA=E7=BB=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1223216863870976]流程中条件分流节点的流转规则中自定义参数扩充(添加上报人集团、上报人中心和上报人组) http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1223216863870976 --- .../ProcessTaskOwnerCenterCondition.java | 171 ++++++++++++++++++ .../ProcessTaskOwnerCompanyCondition.java | 15 ++ .../ProcessTaskOwnerGroupCondition.java | 171 ++++++++++++++++++ .../ProcessTaskOwnerTeamCondition.java | 171 ++++++++++++++++++ 4 files changed, 528 insertions(+) create mode 100644 src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerCenterCondition.java create mode 100644 src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerGroupCondition.java create mode 100644 src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerTeamCondition.java diff --git a/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerCenterCondition.java b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerCenterCondition.java new file mode 100644 index 000000000..bb5e8d9eb --- /dev/null +++ b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerCenterCondition.java @@ -0,0 +1,171 @@ +/*Copyright (C) $today.year 深圳极向量科技有限公司 All Rights Reserved. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +package neatlogic.module.process.condition.handler; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.common.constvalue.FormHandlerType; +import neatlogic.framework.common.constvalue.ParamType; +import neatlogic.framework.common.constvalue.TeamLevel; +import neatlogic.framework.dao.mapper.TeamMapper; +import neatlogic.framework.dto.TeamVo; +import neatlogic.framework.form.constvalue.FormConditionModel; +import neatlogic.framework.process.condition.core.IProcessTaskCondition; +import neatlogic.framework.process.condition.core.ProcessTaskConditionBase; +import neatlogic.framework.process.constvalue.ConditionConfigType; +import neatlogic.framework.process.constvalue.ProcessFieldType; +import neatlogic.framework.process.dto.ProcessTaskStepVo; +import neatlogic.framework.process.dto.ProcessTaskVo; +import neatlogic.module.process.dao.mapper.processtask.ProcessTaskMapper; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +@Component +public class ProcessTaskOwnerCenterCondition extends ProcessTaskConditionBase implements IProcessTaskCondition { + + @Resource + private ProcessTaskMapper processTaskMapper; + + @Resource + private TeamMapper teamMapper; + + @Override + public String getName() { + return "ownercenter"; + } + + @Override + public String getDisplayName() { + return "上报人中心"; + } + + @Override + public String getHandler(FormConditionModel processWorkcenterConditionType) { + return FormHandlerType.SELECT.toString(); + } + + @Override + public String getType() { + return ProcessFieldType.COMMON.getValue(); + } + + @Override + public JSONObject getConfig(ConditionConfigType type) { + JSONObject config = new JSONObject(); + config.put("type", FormHandlerType.SELECT.toString()); + config.put("search", true); + config.put("dynamicUrl", "/api/rest/team/list/forselect?level=center"); + config.put("rootName", "tbodyList"); + config.put("valueName", "uuid"); + config.put("textName", "name"); + config.put("multiple", true); + config.put("value", ""); + config.put("defaultValue", ""); + /** 以下代码是为了兼容旧数据结构,前端有些地方还在用 **/ + config.put("isMultiple", true); + JSONObject mappingObj = new JSONObject(); + mappingObj.put("value", "uuid"); + mappingObj.put("text", "name"); + config.put("mapping", mappingObj); + return config; + } + + @Override + public Integer getSort() { + return 11; + } + + @Override + public ParamType getParamType() { + return ParamType.ARRAY; + } + + @Override + public Object valueConversionText(Object value, JSONObject config) { + if (value != null) { + if (value instanceof String) { + TeamVo teamVo = teamMapper.getTeamByUuid((String) value); + if (teamVo != null) { + return teamVo.getName(); + } + } else if (value instanceof List) { + List valueList = JSON.parseArray(JSON.toJSONString(value), String.class); + List textList = new ArrayList<>(); + for (String valueStr : valueList) { + TeamVo teamVo = teamMapper.getTeamByUuid(valueStr); + if (teamVo != null) { + textList.add(teamVo.getName()); + } else { + textList.add(valueStr); + } + } + return String.join("、", textList); + } + } + return value; + } + + @Override + public Object getConditionParamData(ProcessTaskStepVo processTaskStepVo) { + ProcessTaskVo processTaskVo = processTaskMapper.getProcessTaskById(processTaskStepVo.getProcessTaskId()); + if (processTaskVo == null) { + return null; + } + List teamUuidList = teamMapper.getTeamUuidListByUserUuid(processTaskVo.getOwner()); + if (CollectionUtils.isNotEmpty(teamUuidList)) { + Set upwardUuidSet = new HashSet<>(); + List teamList = teamMapper.getTeamByUuidList(teamUuidList); + for (TeamVo teamVo : teamList) { + String upwardUuidPath = teamVo.getUpwardUuidPath(); + if (StringUtils.isNotBlank(upwardUuidPath)) { + String[] upwardUuidArray = upwardUuidPath.split(","); + for (String upwardUuid : upwardUuidArray) { + upwardUuidSet.add(upwardUuid); + } + } + } + if (CollectionUtils.isNotEmpty(upwardUuidSet)) { + List upwardTeamList = teamMapper.getTeamByUuidList(new ArrayList<>(upwardUuidSet)); + List centerUuidList = new ArrayList<>(); + for (TeamVo teamVo : upwardTeamList) { + if (TeamLevel.CENTER.getValue().equals(teamVo.getLevel())) { + centerUuidList.add(teamVo.getUuid()); + } + } + return centerUuidList; + } + } + return null; + } + + @Override + public Object getConditionParamDataForHumanization(ProcessTaskStepVo processTaskStepVo) { + List centerUuidList = (List) getConditionParamData(processTaskStepVo); + if (CollectionUtils.isEmpty(centerUuidList)) { + return null; + } + List teamList = teamMapper.getTeamByUuidList(centerUuidList); + return teamList.stream().map(TeamVo::getName).collect(Collectors.toList()); + } +} diff --git a/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerCompanyCondition.java b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerCompanyCondition.java index d87b8c4de..bbc754b49 100644 --- a/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerCompanyCondition.java +++ b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerCompanyCondition.java @@ -1,3 +1,18 @@ +/*Copyright (C) $today.year 深圳极向量科技有限公司 All Rights Reserved. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + package neatlogic.module.process.condition.handler; import com.alibaba.fastjson.JSON; diff --git a/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerGroupCondition.java b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerGroupCondition.java new file mode 100644 index 000000000..af6ecf854 --- /dev/null +++ b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerGroupCondition.java @@ -0,0 +1,171 @@ +/*Copyright (C) $today.year 深圳极向量科技有限公司 All Rights Reserved. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +package neatlogic.module.process.condition.handler; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.common.constvalue.FormHandlerType; +import neatlogic.framework.common.constvalue.ParamType; +import neatlogic.framework.common.constvalue.TeamLevel; +import neatlogic.framework.dao.mapper.TeamMapper; +import neatlogic.framework.dto.TeamVo; +import neatlogic.framework.form.constvalue.FormConditionModel; +import neatlogic.framework.process.condition.core.IProcessTaskCondition; +import neatlogic.framework.process.condition.core.ProcessTaskConditionBase; +import neatlogic.framework.process.constvalue.ConditionConfigType; +import neatlogic.framework.process.constvalue.ProcessFieldType; +import neatlogic.framework.process.dto.ProcessTaskStepVo; +import neatlogic.framework.process.dto.ProcessTaskVo; +import neatlogic.module.process.dao.mapper.processtask.ProcessTaskMapper; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +@Component +public class ProcessTaskOwnerGroupCondition extends ProcessTaskConditionBase implements IProcessTaskCondition { + + @Resource + private ProcessTaskMapper processTaskMapper; + + @Resource + private TeamMapper teamMapper; + + @Override + public String getName() { + return "ownergroup"; + } + + @Override + public String getDisplayName() { + return "上报人集团"; + } + + @Override + public String getHandler(FormConditionModel processWorkcenterConditionType) { + return FormHandlerType.SELECT.toString(); + } + + @Override + public String getType() { + return ProcessFieldType.COMMON.getValue(); + } + + @Override + public JSONObject getConfig(ConditionConfigType type) { + JSONObject config = new JSONObject(); + config.put("type", FormHandlerType.SELECT.toString()); + config.put("search", true); + config.put("dynamicUrl", "/api/rest/team/list/forselect?level=group"); + config.put("rootName", "tbodyList"); + config.put("valueName", "uuid"); + config.put("textName", "name"); + config.put("multiple", true); + config.put("value", ""); + config.put("defaultValue", ""); + /** 以下代码是为了兼容旧数据结构,前端有些地方还在用 **/ + config.put("isMultiple", true); + JSONObject mappingObj = new JSONObject(); + mappingObj.put("value", "uuid"); + mappingObj.put("text", "name"); + config.put("mapping", mappingObj); + return config; + } + + @Override + public Integer getSort() { + return 11; + } + + @Override + public ParamType getParamType() { + return ParamType.ARRAY; + } + + @Override + public Object valueConversionText(Object value, JSONObject config) { + if (value != null) { + if (value instanceof String) { + TeamVo teamVo = teamMapper.getTeamByUuid((String) value); + if (teamVo != null) { + return teamVo.getName(); + } + } else if (value instanceof List) { + List valueList = JSON.parseArray(JSON.toJSONString(value), String.class); + List textList = new ArrayList<>(); + for (String valueStr : valueList) { + TeamVo teamVo = teamMapper.getTeamByUuid(valueStr); + if (teamVo != null) { + textList.add(teamVo.getName()); + } else { + textList.add(valueStr); + } + } + return String.join("、", textList); + } + } + return value; + } + + @Override + public Object getConditionParamData(ProcessTaskStepVo processTaskStepVo) { + ProcessTaskVo processTaskVo = processTaskMapper.getProcessTaskById(processTaskStepVo.getProcessTaskId()); + if (processTaskVo == null) { + return null; + } + List teamUuidList = teamMapper.getTeamUuidListByUserUuid(processTaskVo.getOwner()); + if (CollectionUtils.isNotEmpty(teamUuidList)) { + Set upwardUuidSet = new HashSet<>(); + List teamList = teamMapper.getTeamByUuidList(teamUuidList); + for (TeamVo teamVo : teamList) { + String upwardUuidPath = teamVo.getUpwardUuidPath(); + if (StringUtils.isNotBlank(upwardUuidPath)) { + String[] upwardUuidArray = upwardUuidPath.split(","); + for (String upwardUuid : upwardUuidArray) { + upwardUuidSet.add(upwardUuid); + } + } + } + if (CollectionUtils.isNotEmpty(upwardUuidSet)) { + List upwardTeamList = teamMapper.getTeamByUuidList(new ArrayList<>(upwardUuidSet)); + List groupUuidList = new ArrayList<>(); + for (TeamVo teamVo : upwardTeamList) { + if (TeamLevel.GROUP.getValue().equals(teamVo.getLevel())) { + groupUuidList.add(teamVo.getUuid()); + } + } + return groupUuidList; + } + } + return null; + } + + @Override + public Object getConditionParamDataForHumanization(ProcessTaskStepVo processTaskStepVo) { + List groupUuidList = (List) getConditionParamData(processTaskStepVo); + if (CollectionUtils.isEmpty(groupUuidList)) { + return null; + } + List teamList = teamMapper.getTeamByUuidList(groupUuidList); + return teamList.stream().map(TeamVo::getName).collect(Collectors.toList()); + } +} diff --git a/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerTeamCondition.java b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerTeamCondition.java new file mode 100644 index 000000000..9461db265 --- /dev/null +++ b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerTeamCondition.java @@ -0,0 +1,171 @@ +/*Copyright (C) $today.year 深圳极向量科技有限公司 All Rights Reserved. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +package neatlogic.module.process.condition.handler; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.common.constvalue.FormHandlerType; +import neatlogic.framework.common.constvalue.ParamType; +import neatlogic.framework.common.constvalue.TeamLevel; +import neatlogic.framework.dao.mapper.TeamMapper; +import neatlogic.framework.dto.TeamVo; +import neatlogic.framework.form.constvalue.FormConditionModel; +import neatlogic.framework.process.condition.core.IProcessTaskCondition; +import neatlogic.framework.process.condition.core.ProcessTaskConditionBase; +import neatlogic.framework.process.constvalue.ConditionConfigType; +import neatlogic.framework.process.constvalue.ProcessFieldType; +import neatlogic.framework.process.dto.ProcessTaskStepVo; +import neatlogic.framework.process.dto.ProcessTaskVo; +import neatlogic.module.process.dao.mapper.processtask.ProcessTaskMapper; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +@Component +public class ProcessTaskOwnerTeamCondition extends ProcessTaskConditionBase implements IProcessTaskCondition { + + @Resource + private ProcessTaskMapper processTaskMapper; + + @Resource + private TeamMapper teamMapper; + + @Override + public String getName() { + return "ownerteam"; + } + + @Override + public String getDisplayName() { + return "上报人组"; + } + + @Override + public String getHandler(FormConditionModel processWorkcenterConditionType) { + return FormHandlerType.SELECT.toString(); + } + + @Override + public String getType() { + return ProcessFieldType.COMMON.getValue(); + } + + @Override + public JSONObject getConfig(ConditionConfigType type) { + JSONObject config = new JSONObject(); + config.put("type", FormHandlerType.SELECT.toString()); + config.put("search", true); + config.put("dynamicUrl", "/api/rest/team/list/forselect?level=team"); + config.put("rootName", "tbodyList"); + config.put("valueName", "uuid"); + config.put("textName", "name"); + config.put("multiple", true); + config.put("value", ""); + config.put("defaultValue", ""); + /** 以下代码是为了兼容旧数据结构,前端有些地方还在用 **/ + config.put("isMultiple", true); + JSONObject mappingObj = new JSONObject(); + mappingObj.put("value", "uuid"); + mappingObj.put("text", "name"); + config.put("mapping", mappingObj); + return config; + } + + @Override + public Integer getSort() { + return 11; + } + + @Override + public ParamType getParamType() { + return ParamType.ARRAY; + } + + @Override + public Object valueConversionText(Object value, JSONObject config) { + if (value != null) { + if (value instanceof String) { + TeamVo teamVo = teamMapper.getTeamByUuid((String) value); + if (teamVo != null) { + return teamVo.getName(); + } + } else if (value instanceof List) { + List valueList = JSON.parseArray(JSON.toJSONString(value), String.class); + List textList = new ArrayList<>(); + for (String valueStr : valueList) { + TeamVo teamVo = teamMapper.getTeamByUuid(valueStr); + if (teamVo != null) { + textList.add(teamVo.getName()); + } else { + textList.add(valueStr); + } + } + return String.join("、", textList); + } + } + return value; + } + + @Override + public Object getConditionParamData(ProcessTaskStepVo processTaskStepVo) { + ProcessTaskVo processTaskVo = processTaskMapper.getProcessTaskById(processTaskStepVo.getProcessTaskId()); + if (processTaskVo == null) { + return null; + } + List teamUuidList = teamMapper.getTeamUuidListByUserUuid(processTaskVo.getOwner()); + if (CollectionUtils.isNotEmpty(teamUuidList)) { + Set upwardUuidSet = new HashSet<>(); +// List teamList = teamMapper.getTeamByUuidList(teamUuidList); +// for (TeamVo teamVo : teamList) { +// String upwardUuidPath = teamVo.getUpwardUuidPath(); +// if (StringUtils.isNotBlank(upwardUuidPath)) { +// String[] upwardUuidArray = upwardUuidPath.split(","); +// for (String upwardUuid : upwardUuidArray) { +// upwardUuidSet.add(upwardUuid); +// } +// } +// } + upwardUuidSet.addAll(teamUuidList); + if (CollectionUtils.isNotEmpty(upwardUuidSet)) { + List upwardTeamList = teamMapper.getTeamByUuidList(new ArrayList<>(upwardUuidSet)); + List uuidList = new ArrayList<>(); + for (TeamVo teamVo : upwardTeamList) { + if (TeamLevel.TEAM.getValue().equals(teamVo.getLevel())) { + uuidList.add(teamVo.getUuid()); + } + } + return uuidList; + } + } + return null; + } + + @Override + public Object getConditionParamDataForHumanization(ProcessTaskStepVo processTaskStepVo) { + List teamUuidList = (List) getConditionParamData(processTaskStepVo); + if (CollectionUtils.isEmpty(teamUuidList)) { + return null; + } + List teamList = teamMapper.getTeamByUuidList(teamUuidList); + return teamList.stream().map(TeamVo::getName).collect(Collectors.toList()); + } +} -- Gitee From 227f8ed5c74844a5c6ddde1505098f56ab6a79f0 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Tue, 20 Aug 2024 14:51:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD=E6=9D=A1=E4=BB=B6=E5=88=86=E6=B5=81=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E7=9A=84=E6=B5=81=E8=BD=AC=E8=A7=84=E5=88=99=E4=B8=AD=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=8F=82=E6=95=B0=E6=89=A9=E5=85=85=EF=BC=88?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8A=E6=8A=A5=E4=BA=BA=E9=9B=86=E5=9B=A2?= =?UTF-8?q?=E3=80=81=E4=B8=8A=E6=8A=A5=E4=BA=BA=E4=B8=AD=E5=BF=83=E5=92=8C?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E4=BA=BA=E7=BB=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1223216863870976]流程中条件分流节点的流转规则中自定义参数扩充(添加上报人集团、上报人中心和上报人组) http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1223216863870976 --- .../ProcessTaskOwnerTeamCondition.java | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerTeamCondition.java b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerTeamCondition.java index 9461db265..6ea1412ee 100644 --- a/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerTeamCondition.java +++ b/src/main/java/neatlogic/module/process/condition/handler/ProcessTaskOwnerTeamCondition.java @@ -35,9 +35,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; import java.util.stream.Collectors; @Component @@ -133,28 +131,14 @@ public class ProcessTaskOwnerTeamCondition extends ProcessTaskConditionBase impl } List teamUuidList = teamMapper.getTeamUuidListByUserUuid(processTaskVo.getOwner()); if (CollectionUtils.isNotEmpty(teamUuidList)) { - Set upwardUuidSet = new HashSet<>(); -// List teamList = teamMapper.getTeamByUuidList(teamUuidList); -// for (TeamVo teamVo : teamList) { -// String upwardUuidPath = teamVo.getUpwardUuidPath(); -// if (StringUtils.isNotBlank(upwardUuidPath)) { -// String[] upwardUuidArray = upwardUuidPath.split(","); -// for (String upwardUuid : upwardUuidArray) { -// upwardUuidSet.add(upwardUuid); -// } -// } -// } - upwardUuidSet.addAll(teamUuidList); - if (CollectionUtils.isNotEmpty(upwardUuidSet)) { - List upwardTeamList = teamMapper.getTeamByUuidList(new ArrayList<>(upwardUuidSet)); - List uuidList = new ArrayList<>(); - for (TeamVo teamVo : upwardTeamList) { - if (TeamLevel.TEAM.getValue().equals(teamVo.getLevel())) { - uuidList.add(teamVo.getUuid()); - } + List teamList = teamMapper.getTeamByUuidList(teamUuidList); + List uuidList = new ArrayList<>(); + for (TeamVo teamVo : teamList) { + if (teamVo.getLevel() == null || TeamLevel.TEAM.getValue().equals(teamVo.getLevel())) { + uuidList.add(teamVo.getUuid()); } - return uuidList; } + return uuidList; } return null; } -- Gitee