|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
+import com.middle.platform.common.core.constant.Global;
|
|
|
import com.middle.platform.common.core.exception.BusinessException;
|
|
import com.middle.platform.common.core.exception.BusinessException;
|
|
|
import com.middle.platform.common.core.modle.BasePara;
|
|
import com.middle.platform.common.core.modle.BasePara;
|
|
|
import com.middle.platform.manage.api.feign.DeviceApi;
|
|
import com.middle.platform.manage.api.feign.DeviceApi;
|
|
@@ -25,7 +26,6 @@ import com.middle.platform.stream.biz.properties.StreamMediaProperties;
|
|
|
import com.middle.platform.stream.biz.util.VideoPathUtil;
|
|
import com.middle.platform.stream.biz.util.VideoPathUtil;
|
|
|
import com.middle.platform.system.api.enums.DictType;
|
|
import com.middle.platform.system.api.enums.DictType;
|
|
|
import com.middle.platform.system.api.feign.DictApi;
|
|
import com.middle.platform.system.api.feign.DictApi;
|
|
|
-import jakarta.annotation.Resource;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -34,6 +34,7 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author xucaiqin
|
|
* @author xucaiqin
|
|
@@ -47,9 +48,8 @@ public class SDeviceService extends ServiceImpl<SDeviceMapper, SDevice> {
|
|
|
private final StreamMediaProperties streamMediaProperties;
|
|
private final StreamMediaProperties streamMediaProperties;
|
|
|
private final ApiProxy apiProxy;
|
|
private final ApiProxy apiProxy;
|
|
|
|
|
|
|
|
- @Resource
|
|
|
|
|
- private DeviceApi deviceApi;
|
|
|
|
|
- private DictApi dictApi;
|
|
|
|
|
|
|
+ private final DeviceApi deviceApi;
|
|
|
|
|
+ private final DictApi dictApi;
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -72,6 +72,7 @@ public class SDeviceService extends ServiceImpl<SDeviceMapper, SDevice> {
|
|
|
}
|
|
}
|
|
|
PageHelper.startPage(basePara.getPage(), basePara.getPageSize());
|
|
PageHelper.startPage(basePara.getPage(), basePara.getPageSize());
|
|
|
List<SDevice> sDevices = sDeviceMapper.selectList(new LambdaQueryWrapper<SDevice>()
|
|
List<SDevice> sDevices = sDeviceMapper.selectList(new LambdaQueryWrapper<SDevice>()
|
|
|
|
|
+ .eq(SDevice::getDelFlag, Global.UN_DEL)
|
|
|
.in(CollUtil.isNotEmpty(ids), SDevice::getDeviceId, ids));
|
|
.in(CollUtil.isNotEmpty(ids), SDevice::getDeviceId, ids));
|
|
|
|
|
|
|
|
if (Objects.isNull(sDevices)) {
|
|
if (Objects.isNull(sDevices)) {
|
|
@@ -209,6 +210,7 @@ public class SDeviceService extends ServiceImpl<SDeviceMapper, SDevice> {
|
|
|
PageHelper.startPage(videoPage.getPage(), videoPage.getPageSize());
|
|
PageHelper.startPage(videoPage.getPage(), videoPage.getPageSize());
|
|
|
List<SDevice> sDevices = sDeviceMapper.selectList(new LambdaQueryWrapper<SDevice>()
|
|
List<SDevice> sDevices = sDeviceMapper.selectList(new LambdaQueryWrapper<SDevice>()
|
|
|
.eq(SDevice::getType, videoPage.getType())
|
|
.eq(SDevice::getType, videoPage.getType())
|
|
|
|
|
+ .eq(SDevice::getDelFlag, Global.UN_DEL)
|
|
|
.in(CollUtil.isNotEmpty(ids), SDevice::getDeviceId, ids));
|
|
.in(CollUtil.isNotEmpty(ids), SDevice::getDeviceId, ids));
|
|
|
|
|
|
|
|
if (Objects.isNull(sDevices)) {
|
|
if (Objects.isNull(sDevices)) {
|
|
@@ -232,4 +234,15 @@ public class SDeviceService extends ServiceImpl<SDeviceMapper, SDevice> {
|
|
|
|
|
|
|
|
return PageRes.build(pageInfo, streamPageRes2);
|
|
return PageRes.build(pageInfo, streamPageRes2);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public Object dropdown(String name) {
|
|
|
|
|
+ DevicesNameVo devicesNameVo = new DevicesNameVo();
|
|
|
|
|
+ devicesNameVo.setKeywords(name);
|
|
|
|
|
+ List<DevicesVo> devicesVos = deviceApi.devicesQuery(devicesNameVo);
|
|
|
|
|
+ if (CollUtil.isEmpty(devicesVos)) {
|
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+ List<SDevice> sDevices = sDeviceMapper.selectList(new LambdaQueryWrapper<SDevice>().eq(SDevice::getDelFlag, Global.UN_DEL));
|
|
|
|
|
+ return devicesVos.stream().filter(d -> sDevices.stream().noneMatch(d2 -> Objects.equals(d2.getDeviceId(), d.getId()))).collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|