You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ke...@apache.org on 2022/01/17 02:30:45 UTC

[dolphinscheduler] branch dev updated: [Fix-8056] Rectify this issue about failing to edit worker groups for an environment. (#8072)

This is an automated email from the ASF dual-hosted git repository.

kerwin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 7391cc2  [Fix-8056] Rectify this issue about failing to edit worker groups for an environment. (#8072)
7391cc2 is described below

commit 7391cc20f01bef62b9a30f7b6b7f54fb41bdab03
Author: calvin <ji...@163.com>
AuthorDate: Mon Jan 17 10:30:40 2022 +0800

    [Fix-8056] Rectify this issue about failing to edit worker groups for an environment. (#8072)
---
 .../api/service/impl/EnvironmentServiceImpl.java                 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java
index 7689777..61fee25 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java
@@ -367,17 +367,18 @@ public class EnvironmentServiceImpl extends BaseServiceImpl implements Environme
         env.setOperator(loginUser.getId());
         env.setUpdateTime(new Date());
 
-        int update = environmentMapper.update(env, new UpdateWrapper<Environment>().lambda().eq(Environment::getCode,code));
+        int update = environmentMapper.update(env, new UpdateWrapper<Environment>().lambda().eq(Environment::getCode, code));
         if (update > 0) {
             deleteWorkerGroupSet.stream().forEach(key -> {
-                if (!StringUtils.isEmpty(key)) {
+                if (StringUtils.isNotEmpty(key)) {
                     relationMapper.delete(new QueryWrapper<EnvironmentWorkerGroupRelation>()
                             .lambda()
-                            .eq(EnvironmentWorkerGroupRelation::getEnvironmentCode,code));
+                            .eq(EnvironmentWorkerGroupRelation::getEnvironmentCode, code)
+                            .eq(EnvironmentWorkerGroupRelation::getWorkerGroup, key));
                 }
             });
             addWorkerGroupSet.stream().forEach(key -> {
-                if (!StringUtils.isEmpty(key)) {
+                if (StringUtils.isNotEmpty(key)) {
                     EnvironmentWorkerGroupRelation relation = new EnvironmentWorkerGroupRelation();
                     relation.setEnvironmentCode(code);
                     relation.setWorkerGroup(key);