1
This commit is contained in:
1 parent
1639b1e5fd
commit
7883a39de8
4 files changed
+292
No files matched your search
@@ -74,6 +74,8 @@ public interface IEcDeviceService extends IService<EcDevicePlus> {
|
||||
|
||||
String snapshop(String deviceCode) throws Exception;
|
||||
|
||||
String MjpegSnapshop(String deviceCode) throws Exception;
|
||||
|
||||
Map<Long, EcDevicePlus> getMapByIds(List<Long> ids, SFunction<EcDevicePlus, ?>... columns);
|
||||
|
||||
List<EcDevicePlus> getByIds(List<Long> ids);
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.luqj.ec.domain.dto.EcDeviceHeartbeatDto;
|
||||
import com.luqj.ec.domain.dto.EcDeviceReportDto;
|
||||
import com.luqj.ec.mapper.EcDeviceMapper;
|
||||
import com.luqj.ec.service.IEcDeviceService;
|
||||
import com.luqj.javacv.utils.MjpegUtil;
|
||||
import com.luqj.javacv.utils.RtspUtil;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
@@ -72,6 +73,19 @@ public class EcDeviceServiceImpl extends ServiceImpl<EcDeviceMapper, EcDevicePlu
|
||||
return ruoYiConfig.getReqUrl() + "/ec/" + deviceCode + "/" + fileName;
|
||||
}
|
||||
|
||||
public String MjpegSnapshop(String deviceCode) throws Exception {
|
||||
EcDevicePlus device = selectEcDeviceByDeviceCode(deviceCode);
|
||||
if (device == null || device.getStatus() == null || device.getStatus() == 0) {
|
||||
return ruoYiConfig.getReqUrl() + "/ec/default/offline.png";
|
||||
}
|
||||
File file = new File(RuoYiConfig.getProfile() + "/ec/" + deviceCode + "/");
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
String fileName = MjpegUtil.snapshot("http://" + device.getIpAddress() + ":8080/stream.mjpeg?clientId=" + deviceCode, RuoYiConfig.getProfile() + "/ec/" + deviceCode + "/");
|
||||
return ruoYiConfig.getReqUrl() + "/ec/" + deviceCode + "/" + fileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EcDevicePlus getById(Long id, SFunction<EcDevicePlus, ?>... columns) {
|
||||
LambdaQueryWrapper<EcDevicePlus> lambdaQueryWrapper = new LambdaQueryWrapper<EcDevicePlus>()
|
||||
|
||||
Reference in new issue
Block a user