diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java
index 7a98e62d..9021afbd 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java
@@ -20,7 +20,6 @@ import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
-import org.assertj.core.util.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -680,6 +679,11 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
@Override
public void removeFromGroup(UpdateCommonChannelToGroup params) {
- commonGbChannelMapper.removeFromGroup(params);
+ if (!params.getCommonGbIds().isEmpty()) {
+ commonGbChannelMapper.removeFromGroupByIds(params.getCommonGbIds());
+ }
+ if (!ObjectUtils.isEmpty(params.getCommonGbBusinessGroupID().trim())){
+ commonGbChannelMapper.removeFromGroupByGroupId(params.getCommonGbBusinessGroupID());
+ }
}
}
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonGbChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonGbChannelMapper.java
index 4db3d1af..2179d185 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonGbChannelMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonGbChannelMapper.java
@@ -383,12 +383,20 @@ public interface CommonGbChannelMapper {
void updateChannelToGroup(@Param("commonGbChannel") UpdateCommonChannelToGroup commonGbChannel);
@Update({""})
- void removeFromGroup(@Param("commonGbChannel") UpdateCommonChannelToGroup commonGbChannel);
+ void removeFromGroupByIds(@Param("commonGbIds") List commonGbIds);
+
+ @Update({""})
+ void removeFromGroupByGroupId(@Param("commonGbBusinessGroupID") String commonGbBusinessGroupID);
}
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java
index 5b280747..4a085efc 100755
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java
@@ -171,11 +171,11 @@ public class CommonChannelController {
commonGbChannelService.updateChannelToGroup(params);
}
- @Operation(summary = "为通道添加分组")
+ @Operation(summary = "从分组中移除通道")
@ResponseBody
@PostMapping("/group/remove")
public void removeFromGroup(@RequestBody UpdateCommonChannelToGroup params){
- assert params.getCommonGbBusinessGroupID() != null;
+ assert params.getCommonGbBusinessGroupID() != null || !params.getCommonGbIds().isEmpty();
commonGbChannelService.removeFromGroup(params);
}