2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-04-22 d170546ea4498d282c9cfef6258e4498aed7835e
fix
已修改2个文件
14 ■■■■ 文件已修改
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java
@@ -124,8 +124,7 @@
            switch (param.getDeviceType()) {
                case 0:
                    Pole pole = poleService.getById(poleId);
                    if (!param.getDeviceCode().equals(pole.getDeviceCode())) {
//                    if (!pole.getDeviceCode().equals(param.getDeviceCode())) {
                    if (pole != null) {
                        pole.setPoleName(param.getDeviceName());
                        pole.setDeviceCode(param.getDeviceCode());
                        poleService.updateById(pole);
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());