2021与蓝度共同重构项目,服务端
liuhaonan
2022-05-11 ebecb50ecf3c53428fac4f3bd09d98110d6bc8d7
ximon-admin/src/main/java/com/sandu/ximon/admin/service/InterphoneHostService.java
@@ -4,11 +4,13 @@
import com.github.pagehelper.PageHelper;
import com.sandu.common.object.BaseConditionVO;
import com.sandu.common.service.impl.BaseServiceImpl;
import com.sandu.common.util.SpringContextHolder;
import com.sandu.ximon.admin.param.InterphoneHostParam;
import com.sandu.ximon.admin.security.SecurityUtils;
import com.sandu.ximon.dao.bo.InterphoneHostBo;
import com.sandu.ximon.dao.domain.InterphoneHost;
import com.sandu.ximon.dao.domain.InterphoneHostSubPole;
import com.sandu.ximon.dao.enums.PoleBindingEnums;
import com.sandu.ximon.dao.mapper.InterphoneHostMapper;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
@@ -42,6 +44,11 @@
        if (byId == null) {
            return false;
        }
        boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getHostMac(), PoleBindingEnums.FOR_HELP);
        if (!belong) {
            throw new RuntimeException("该设备不属于您,不能修改设备信息");
        }
        InterphoneHost interphoneHost = new InterphoneHost();
        interphoneHost.setHostId(id);
        BeanUtils.copyProperties(interphoneHostParam, interphoneHost);
@@ -58,7 +65,7 @@
        InterphoneHost byId = getById(id);
        InterphoneHostSubPole one = interphoneHostSubService.getOne(Wrappers.lambdaQuery(InterphoneHostSubPole.class).eq(InterphoneHostSubPole::getHostId, id));
        if(one!=null){
        if (one != null) {
            throw new RuntimeException("该主机存在绑定关系,不能删除");
        }
        if (byId == null) {