Lawrence
2021-01-15 1b200bcc904d088b31ceaf1e9261b5433d9322a6
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
@@ -82,7 +82,8 @@
        }
        // TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册
        ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId());
        // ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId());
        ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId());
        boolean updateResult = storager.updateParentPlatform(parentPlatform);
@@ -151,15 +152,21 @@
    @RequestMapping("/platforms/channelList")
    @ResponseBody
    public PageInfo<ChannelReduce> channelList(int page, int count,
                                              @RequestParam(required = false) String platformId,
                                              @RequestParam(required = false) String query,
                                              @RequestParam(required = false) Boolean online,
                                              @RequestParam(required = false) Boolean choosed,
                                              @RequestParam(required = false) Boolean channelType){
        if (logger.isDebugEnabled()) {
            logger.debug("查询所有所有通道API调用");
        }
        PageInfo<ChannelReduce> channelReduces = storager.queryChannelListInAll(page, count, query, online, channelType, null);
        PageInfo<ChannelReduce> channelReduces = null;
        if (platformId != null ) {
            channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, platformId, choosed);
        }else {
            channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, null, false);
        }
        return channelReduces;
    }
@@ -177,5 +184,17 @@
        return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK);
    }
    @RequestMapping("/platforms/delChannelForGB")
    @ResponseBody
    public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){
        if (logger.isDebugEnabled()) {
            logger.debug("给上级平台添加国标通道API调用");
        }
        int result = storager.delChannelForGB(param.getPlatformId(), param.getChannelReduces());
        return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK);
    }
}