2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-05-10 56d8ffd22d0fd65c6a582de2e57286f9f37f4883
ximon-admin/src/main/java/com/sandu/ximon/admin/service/InterphoneSubService.java
@@ -2,15 +2,20 @@
import com.sandu.common.service.impl.BaseServiceImpl;
import com.sandu.ximon.admin.param.InterphoneSubParam;
import com.sandu.ximon.admin.security.SecurityUtils;
import com.sandu.ximon.dao.bo.InterphoneHostBo;
import com.sandu.ximon.dao.bo.InterphoneSubBo;
import com.sandu.ximon.dao.domain.InterphoneSub;
import com.sandu.ximon.dao.mapper.InterphoneSubMapper;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@AllArgsConstructor
public class InterphoneSubService  extends BaseServiceImpl<InterphoneSubMapper, InterphoneSub> {
public class InterphoneSubService extends BaseServiceImpl<InterphoneSubMapper, InterphoneSub> {
    private final InterphoneSubMapper interphoneSubMapper;
@@ -26,7 +31,7 @@
    /**
     * 修改子设备
     */
    public boolean updateSub(Integer id,InterphoneSubParam interphoneSubParam) {
    public boolean updateSub(Integer id, InterphoneSubParam interphoneSubParam) {
        InterphoneSub byId = getById(id);
        if (byId == null) {
            return false;
@@ -58,4 +63,17 @@
        }
        return byId;
    }
    /**
     * 查询主机列表
     */
    public List<InterphoneSubBo> getInterphoneSubList(String keyword) {
        List<InterphoneSubBo> list;
        if (SecurityUtils.getClientId() == null) {
            list = interphoneSubMapper.getInterphoneSubList(keyword, null);
        } else {
            list = interphoneSubMapper.getInterphoneSubList(keyword, SecurityUtils.getUserId());
        }
        return list;
    }
}