2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2021-12-28 7abc2e222ce399ffc724c485142e5c42ff3da3b2
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java
@@ -20,6 +20,13 @@
    private final LightReportDataService lightReportDataService;
    /**
     * 灯杆绑定设备
     *
     * @param poleId
     * @param param
     * @return
     */
    public boolean bindPole(Long poleId, PoleBindingParam param) {
        Integer deviceType = param.getDeviceType();
//        if (PoleBindingEnums.LIGHT.getCode().equals(deviceType)) {
@@ -36,9 +43,20 @@
        } else {
            throw new BusinessException("该设备已绑定过");
        }
    }
    /**
     * 灯杆解绑设备,删除设备前需要解绑
     *
     * @param deviceCode
     */
    public void unBindPole(String deviceCode) {
        if (deviceCode == null)
            throw new BusinessException("设备编号不能为空");
//        return false;
        PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode));
        if (one != null) {
            removeById(one.getId());
        }
    }
}