2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-05-17 31e798604209979bb9e93652dc0b0ac8d4d61538
fix
已修改1个文件
10 ■■■■■ 文件已修改
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java
@@ -159,6 +159,11 @@
        if (deviceCode == null) {
            throw new BusinessException("设备编号不能为空");
        }
        //查灯杆归属关系
        boolean belong = isBelong(deviceCode, null);
        if(!belong){
            throw  new BusinessException("该灯杆不属于您,无法解绑!");
        }
        //直接删除设备不需要灯杆ID
        PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode));
@@ -179,12 +184,9 @@
     *
     * @param deviceCode 设备编号
     * @param type       设备类型
     * @return 已绑定返回true,未绑定返回false
     * @return 属于该用户返回true,不是返回false
     */
    public boolean isBelong(String deviceCode, String type) {
        if (type.isEmpty() || deviceCode.isEmpty()) {
            throw new BusinessException("设备编号或类型不能为空");
        }
        Long userId = SecurityUtils.getClientId();
        Pole binding = baseMapper.getPoleByBinding(type, deviceCode, userId);
        if (binding != null) {