2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-04-20 25e3153ff1256c321d4985070b5f07db930026ec
ximon-admin/src/main/java/com/sandu/ximon/admin/service/C3ChargingService.java
@@ -108,23 +108,23 @@
                c3mChargingChargeService.initCharge((c3mCharging1.getC3Id()).intValue());
            }
        }
        /**
         * 添加绑定关系开始
         */
        Pole pole = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getDeviceCode, deviceName));
        if (pole == null) {
            Pole pole1 = new Pole();
            pole1.setDeviceCode(deviceName);
            pole1.setPoleName(deviceName);
            pole1.setPoleCode(poleService.generatePoleCode());
            poleService.save(pole1);
        }
        Long poleId = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getDeviceCode, deviceName)).getId();
        PoleBindingParam poleBindingParam = new PoleBindingParam();
        poleBindingParam.setDeviceType(2);
        poleBindingParam.setDeviceCode(mcuUdid);
        bindingService.bindPole(poleId, poleBindingParam);
//        /**
//         * 添加绑定关系开始
//         */
//        Pole pole = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getDeviceCode, deviceName));
//        if (pole == null) {
//            Pole pole1 = new Pole();
//            pole1.setDeviceCode(deviceName);
//            pole1.setPoleName(deviceName);
//            pole1.setPoleCode(poleService.generatePoleCode());
//            poleService.save(pole1);
//        }
//
//        Long poleId = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getDeviceCode, deviceName)).getId();
//        PoleBindingParam poleBindingParam = new PoleBindingParam();
//        poleBindingParam.setDeviceType(2);
//        poleBindingParam.setDeviceCode(mcuUdid);
//        bindingService.bindPole(poleId, poleBindingParam);
        /**
         * 添加绑定关系结束
@@ -807,7 +807,7 @@
        if (one == null) {
            throw new BusinessException("未找到绑定关系");
        }
        return getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, one.getDeviceCode()));
        return getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, one.getDeviceCode()));
    }