| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | 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.mapper.InterphoneHostMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | public class InterphoneHostService extends BaseServiceImpl<InterphoneHostMapper, InterphoneHost> { |
| | | |
| | | private final InterphoneHostMapper interphoneHostMapper; |
| | | |
| | | private final InterphoneHostSubService interphoneHostSubService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | public boolean deleteHost(Integer id) { |
| | | InterphoneHost byId = getById(id); |
| | | |
| | | InterphoneHostSubPole one = interphoneHostSubService.getOne(Wrappers.lambdaQuery(InterphoneHostSubPole.class).eq(InterphoneHostSubPole::getHostId, id)); |
| | | if(one!=null){ |
| | | throw new RuntimeException("该主机存在绑定关系,不能删除"); |
| | | } |
| | | if (byId == null) { |
| | | return false; |
| | | } |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |