2021与蓝度共同重构项目,服务端
liuhaonan
2022-09-09 6d9a70bde328683464b594e01444355b98db7713
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -716,9 +716,10 @@
            if (pole == null) {
                throw new BusinessException("灯杆不存在");
            }
            pole.setUserId(clientId);
            if (!clientService.findClientId(clientId)) {
                pole.setClientId(clientService.getClientId(clientId));
            pole.setClientId(clientId);
            if (clientService.findClientId(clientId)) {
                pole.setUserId(clientService.getClientId(clientId));
            }
            r = updateById(pole);
@@ -730,6 +731,31 @@
        return r;
    }
    /**
     * 用户解绑灯杆
     *
     * @param clientId
     * @param poleIds
     * @return
     */
    public boolean ClientUnBindingPole(long clientId, int[] poleIds) {
        boolean r = false;
        for (int poleId : poleIds) {
            Pole pole = getById(poleId);
            if (pole == null) {
                throw new BusinessException("灯杆不存在");
            }
            pole.setClientId(-1L);
            r = updateById(pole);
            if (!r) {
                throw new BusinessException("灯杆ID为" + poleId + "设置失败,自动停止");
            }
        }
        return r;
    }
    public List<Pole> getOwnerPole(BaseConditionVO baseConditionVO, String keyword, Long cilentId) {
        LambdaQueryWrapper<Pole> eq;