2021与蓝度共同重构项目,服务端
liuhaonan
2022-07-22 d9a9d8a2dad1d1e57b184bf8f972a03d654d883a
ximon-admin/src/main/java/com/sandu/ximon/admin/service/InterphoneHostSubService.java
@@ -5,6 +5,7 @@
import com.sandu.common.execption.BusinessException;
import com.sandu.common.service.impl.BaseServiceImpl;
import com.sandu.common.util.SpringContextHolder;
import com.sandu.ximon.admin.security.SecurityUtils;
import com.sandu.ximon.dao.domain.InterphoneHost;
import com.sandu.ximon.dao.domain.InterphoneHostSubPole;
import com.sandu.ximon.dao.mapper.InterphoneHostSubPoleMapper;
@@ -22,6 +23,9 @@
    public boolean bindHostSub(Integer hostId, Integer subId) {
        if (hostId == null || subId == null) {
            throw new BusinessException("主设备id或子设备id不能为空");
        }
        if (SecurityUtils.getClientId() != null) {
            throw new BusinessException("只有管理员才能进行此操作");
        }
        InterphoneHostSubPole pole = new InterphoneHostSubPole();
        InterphoneHost host = SpringContextHolder.getBean(InterphoneHostService.class).getById(hostId);
@@ -46,6 +50,9 @@
        if (subId == null) {
            throw new BusinessException("子设备id不能为空");
        }
        if (SecurityUtils.getClientId() != null) {
            throw new BusinessException("只有管理员才能进行此操作");
        }
        LambdaQueryWrapper<InterphoneHostSubPole> eq = Wrappers.lambdaQuery(InterphoneHostSubPole.class).eq(InterphoneHostSubPole::getSubId, subId);
        InterphoneHostSubPole one = getOne(eq);
        if (one == null) {