2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-04-22 d170546ea4498d282c9cfef6258e4498aed7835e
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java
@@ -4,12 +4,15 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sandu.common.execption.BusinessException;
import com.sandu.common.service.impl.BaseServiceImpl;
import com.sandu.common.util.SpringContextHolder;
import com.sandu.ximon.admin.param.PoleBindingParam;
import com.sandu.ximon.dao.domain.Pole;
import com.sandu.ximon.dao.domain.PoleBinding;
import com.sandu.ximon.dao.mapper.PoleBindingMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import javax.swing.*;
import java.util.List;
/**
@@ -53,6 +56,14 @@
            poleBinding.setDeviceCode(param.getDeviceCode());
            return save(poleBinding);
        } else {
            //删除灯杆的devicescode
            PoleService poleService = SpringContextHolder.getBean(PoleService.class);
            Pole pole = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, one.getPoleId()));
            if (pole != null) {
                pole.setDeviceCode(null);
                poleService.updateById(pole);
            }
            one.setPoleId(poleId);
            one.setDeviceType(param.getDeviceType());
            one.setDeviceName(param.getDeviceName());