Browse Source

feat:1.历史回放接口,2.台账接口修改

yanyuan
wangguangyuan 1 month ago
parent
commit
c9a56d778a
14 changed files with 402 additions and 28 deletions
  1. +85
    -3
      inspect-base/inspect-base-core/src/main/java/com/inspect/base/core/utils/HttpClientUtils.java
  2. +5
    -0
      inspect-ivs/src/main/java/com/inspect/ivs/constant/IvsConst.java
  3. +45
    -1
      inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsPlaybackController.java
  4. +69
    -0
      inspect-ivs/src/main/java/com/inspect/ivs/service/HlsPlaybackComponent.java
  5. +3
    -0
      inspect-ivs/src/main/resources/bootstrap.yml
  6. +6
    -0
      inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/contants/AccessApiConstant.java
  7. +73
    -0
      inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolVideotapeController.java
  8. +14
    -0
      inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/model/HlsControlModel.java
  9. +20
    -0
      inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/model/HlsSessionModel.java
  10. +15
    -0
      inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/model/HlsUiControlModel.java
  11. +15
    -0
      inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/model/HlsUiSessionModel.java
  12. +0
    -9
      inspect-metadata/src/main/java/com/inspect/metadata/eqpbook/controller/BasedataEqpBookChannelController.java
  13. +6
    -0
      inspect-metadata/src/main/java/com/inspect/metadata/eqpbook/domain/BasedataEqpBookChannel.java
  14. +46
    -15
      inspect-metadata/src/main/resources/mapper/eqpbook/BasedataEqpBookChannelMapper.xml

+ 85
- 3
inspect-base/inspect-base-core/src/main/java/com/inspect/base/core/utils/HttpClientUtils.java View File

@ -126,6 +126,76 @@ public class HttpClientUtils {
return result.toString(); return result.toString();
} }
public static String get(String url) throws Exception {
StringBuilder result = new StringBuilder();
BufferedReader in = null;
try {
URL realUrl = new URL(url);
URLConnection connection = realUrl.openConnection();
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
connection.connect();
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result.append(line);
}
} catch (Exception e) {
throw e;
} finally {
if (null != in) {
in.close();
}
}
return result.toString();
}
public static String delete(String url) throws Exception {
StringBuilder result = new StringBuilder();
BufferedReader in = null;
HttpURLConnection connection = null;
try {
URL realUrl = new URL(url);
connection = (HttpURLConnection) realUrl.openConnection();
connection.setRequestMethod("DELETE");
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
connection.connect();
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result.append(line);
}
} catch (Exception e) {
try {
if (connection != null && connection.getErrorStream() != null) {
BufferedReader errorReader = new BufferedReader(new InputStreamReader(connection.getErrorStream(), "UTF-8"));
String line;
while ((line = errorReader.readLine()) != null) {
result.append(line);
}
errorReader.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
} finally {
if (null != in) {
in.close();
}
if (null != connection) {
connection.disconnect();
}
}
return result.toString();
}
public static String postJson(String requestUrl, String requestPram, String tokenKey, String accessToken) { public static String postJson(String requestUrl, String requestPram, String tokenKey, String accessToken) {
OutputStreamWriter outputStreamWriter = null; OutputStreamWriter outputStreamWriter = null;
BufferedReader bufferedReader = null; BufferedReader bufferedReader = null;
@ -155,11 +225,23 @@ public class HttpClientUtils {
bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream(), "utf-8")); bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream(), "utf-8"));
String line; String line;
while ((line = bufferedReader.readLine()) != null) {
responseResult.append(line);
}
while ((line = bufferedReader.readLine()) != null) {
responseResult.append(line);
}
} catch (Exception var18) { } catch (Exception var18) {
var18.printStackTrace(); var18.printStackTrace();
try {
if (httpURLConnection != null && httpURLConnection.getErrorStream() != null) {
BufferedReader errorReader = new BufferedReader(new InputStreamReader(httpURLConnection.getErrorStream(), "utf-8"));
String line;
while ((line = errorReader.readLine()) != null) {
responseResult.append(line);
}
errorReader.close();
}
} catch (IOException var19) {
var19.printStackTrace();
}
} finally { } finally {
httpURLConnection.disconnect(); httpURLConnection.disconnect();


+ 5
- 0
inspect-ivs/src/main/java/com/inspect/ivs/constant/IvsConst.java View File

@ -21,6 +21,11 @@ public class IvsConst {
public static final String URI_CONTROL_RESUME_RECORD = "/playback/resume/v1.0/{playHandle}"; public static final String URI_CONTROL_RESUME_RECORD = "/playback/resume/v1.0/{playHandle}";
public static final String URI_PLAYBACK_START = "/playback/startplatformplaybackbyip"; public static final String URI_PLAYBACK_START = "/playback/startplatformplaybackbyip";
public static final String URI_PLAYBACK_STOP = "/playback/stopplatformplaybackbyip/{handle}"; public static final String URI_PLAYBACK_STOP = "/playback/stopplatformplaybackbyip/{handle}";
public static final String URI_HLS_SESSIONS = "/hik/nvr/playback/hls/sessions";
public static final String URI_HLS_SESSION = "/hik/nvr/playback/hls/sessions/%s";
public static final String URI_HLS_SESSION_CONTROL = "/hik/nvr/playback/hls/sessions/%s/controls";
public static final String URI_HLS_UI_SESSIONS = "/hik/nvr/playback/hls/ui/sessions";
public static final String URI_HLS_UI_SESSION_CONTROL = "/hik/nvr/playback/hls/ui/sessions/%s/controls";
public static final String URI_PRESET_REMOVE = "/ptz/presetposition/{cameraCode}/{domainCode}/{presetIndex}/v1.0"; public static final String URI_PRESET_REMOVE = "/ptz/presetposition/{cameraCode}/{domainCode}/{presetIndex}/v1.0";
public static final String URI_PRESET_LIST = "/device/ptzpresetlist/{cameraCode}/{domainCode}"; public static final String URI_PRESET_LIST = "/device/ptzpresetlist/{cameraCode}/{domainCode}";
public static final String IVS_TOKEN = "IVS_TOKEN"; public static final String IVS_TOKEN = "IVS_TOKEN";


+ 45
- 1
inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsPlaybackController.java View File

@ -7,6 +7,7 @@ import com.inspect.base.redis.service.RedisService;
import com.inspect.ivs.constant.IvsConst; import com.inspect.ivs.constant.IvsConst;
import com.inspect.ivs.domain.CameraCodeAndEndTime; import com.inspect.ivs.domain.CameraCodeAndEndTime;
import com.inspect.ivs.enums.RtspType; import com.inspect.ivs.enums.RtspType;
import com.inspect.ivs.service.HlsPlaybackComponent;
import com.inspect.ivs.service.IvsCommonService; import com.inspect.ivs.service.IvsCommonService;
import com.inspect.ivs.service.PlaybackComponent; import com.inspect.ivs.service.PlaybackComponent;
import com.inspect.ivs.service.XinTongComponent; import com.inspect.ivs.service.XinTongComponent;
@ -32,7 +33,12 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.reactive.function.client.WebClient.RequestBodySpec; import org.springframework.web.reactive.function.client.WebClient.RequestBodySpec;
@ -45,15 +51,17 @@ public class IvsPlaybackController {
private final ZlMediaComponent zlmediaComponent; private final ZlMediaComponent zlmediaComponent;
private final RedisService redisService; private final RedisService redisService;
private final PlaybackComponent playbackComponent; private final PlaybackComponent playbackComponent;
private final HlsPlaybackComponent hlsPlaybackComponent;
@Value("${rtsp.type:xintong}") @Value("${rtsp.type:xintong}")
private RtspType rtspType; private RtspType rtspType;
private final XinTongComponent xinTongComponent; private final XinTongComponent xinTongComponent;
public IvsPlaybackController(IvsCommonService ivsCommonService, ZlMediaComponent zlmediaComponent, RedisService redisService, PlaybackComponent playbackComponent, XinTongComponent xinTongComponent) {
public IvsPlaybackController(IvsCommonService ivsCommonService, ZlMediaComponent zlmediaComponent, RedisService redisService, PlaybackComponent playbackComponent, HlsPlaybackComponent hlsPlaybackComponent, XinTongComponent xinTongComponent) {
this.ivsCommonService = ivsCommonService; this.ivsCommonService = ivsCommonService;
this.zlmediaComponent = zlmediaComponent; this.zlmediaComponent = zlmediaComponent;
this.redisService = redisService; this.redisService = redisService;
this.playbackComponent = playbackComponent; this.playbackComponent = playbackComponent;
this.hlsPlaybackComponent = hlsPlaybackComponent;
this.xinTongComponent = xinTongComponent; this.xinTongComponent = xinTongComponent;
} }
@ -116,6 +124,42 @@ public class IvsPlaybackController {
return Response.ok(); return Response.ok();
} }
@PostMapping({"hls/sessions"})
public ResponseEntity<JSONObject> hlsCreateSession(@RequestBody JSONObject request) {
log.debug("[PLAYBACK] hls create session param:{}", request);
return this.hlsPlaybackComponent.post(IvsConst.URI_HLS_SESSIONS, request);
}
@DeleteMapping({"hls/sessions/{sessionId}"})
public ResponseEntity<JSONObject> hlsDeleteSession(@PathVariable String sessionId) {
log.debug("[PLAYBACK] hls delete session sessionId:{}", sessionId);
return this.hlsPlaybackComponent.delete(String.format(IvsConst.URI_HLS_SESSION, sessionId));
}
@GetMapping({"hls/sessions/{sessionId}"})
public ResponseEntity<JSONObject> hlsGetSession(@PathVariable String sessionId) {
log.debug("[PLAYBACK] hls query session sessionId:{}", sessionId);
return this.hlsPlaybackComponent.get(String.format(IvsConst.URI_HLS_SESSION, sessionId));
}
@PostMapping({"hls/sessions/{sessionId}/controls"})
public ResponseEntity<JSONObject> hlsControlSession(@PathVariable String sessionId, @RequestBody JSONObject request) {
log.debug("[PLAYBACK] hls control session sessionId:{}, param:{}", sessionId, request);
return this.hlsPlaybackComponent.post(String.format(IvsConst.URI_HLS_SESSION_CONTROL, sessionId), request);
}
@PostMapping({"hls/ui/sessions"})
public ResponseEntity<JSONObject> hlsCreateUiSession(@RequestBody JSONObject request) {
log.debug("[PLAYBACK] hls ui create session param:{}", request);
return this.hlsPlaybackComponent.post(IvsConst.URI_HLS_UI_SESSIONS, request);
}
@PostMapping({"hls/ui/sessions/{sessionId}/controls"})
public ResponseEntity<JSONObject> hlsControlUiSession(@PathVariable String sessionId, @RequestBody JSONObject request) {
log.debug("[PLAYBACK] hls ui control session sessionId:{}, param:{}", sessionId, request);
return this.hlsPlaybackComponent.post(String.format(IvsConst.URI_HLS_UI_SESSION_CONTROL, sessionId), request);
}
public String getLabel() { public String getLabel() {
return UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); return UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY);
} }


+ 69
- 0
inspect-ivs/src/main/java/com/inspect/ivs/service/HlsPlaybackComponent.java View File

@ -0,0 +1,69 @@
package com.inspect.ivs.service;
import com.alibaba.fastjson.JSONObject;
import com.inspect.ivs.util.WebClientUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.WebClientException;
@Component
public class HlsPlaybackComponent {
private static final Logger log = LoggerFactory.getLogger(HlsPlaybackComponent.class);
@Value("${ivs.nvr.hls.url:http://192.168.1.86:28081}")
private String url;
private final WebClient webClient = WebClientUtils.create();
public ResponseEntity<JSONObject> get(String uri) {
log.info("[NVR HLS] GET url: {}", url.concat(uri));
return exchange(webClient.get().uri(url.concat(uri)));
}
public ResponseEntity<JSONObject> post(String uri, Object body) {
log.info("[NVR HLS] POST url: {}, body: {}", url.concat(uri), JSONObject.toJSONString(body));
return exchange(webClient.post().uri(url.concat(uri))
.contentType(MediaType.APPLICATION_JSON)
.bodyValue(body));
}
public ResponseEntity<JSONObject> delete(String uri) {
log.info("[NVR HLS] DELETE url: {}", url.concat(uri));
return exchange(webClient.delete().uri(url.concat(uri)));
}
private ResponseEntity<JSONObject> exchange(WebClient.RequestHeadersSpec<?> spec) {
assert webClient != null;
try {
return spec.exchangeToMono(response ->
response.bodyToMono(String.class)
.defaultIfEmpty("")
.map(body -> {
int status = response.statusCode().value();
ResponseEntity<JSONObject> entity;
if (body == null || body.trim().isEmpty()) {
entity = new ResponseEntity<>((JSONObject) null, HttpStatus.valueOf(status));
} else {
entity = ResponseEntity.status(status)
.contentType(MediaType.APPLICATION_JSON)
.body(JSONObject.parseObject(body));
}
return entity;
}))
.block();
} catch (WebClientException e) {
log.error("[NVR HLS] request failed, url: {}", url, e);
JSONObject error = new JSONObject();
error.put("code", HttpStatus.BAD_GATEWAY.value());
error.put("message", "NVR HLS服务不可用");
return ResponseEntity.status(HttpStatus.BAD_GATEWAY).body(error);
}
}
}

+ 3
- 0
inspect-ivs/src/main/resources/bootstrap.yml View File

@ -25,3 +25,6 @@ ivs:
password: Huawei@1234 password: Huawei@1234
newPassword: Huawei@12345 newPassword: Huawei@12345
address: http://172.21.101.227:18530 address: http://172.21.101.227:18530
nvr:
hls:
url: http://192.168.1.86:28081

+ 6
- 0
inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/contants/AccessApiConstant.java View File

@ -13,5 +13,11 @@ public class AccessApiConstant {
public static final String PLAYBACK_START = "/api/v1/playback/start"; public static final String PLAYBACK_START = "/api/v1/playback/start";
public static final String PLAYBACK_STOP = "/api/v1/playback/stop"; public static final String PLAYBACK_STOP = "/api/v1/playback/stop";
public static final String PLAYBACK_CONTROL = "/api/v1/playback/control"; public static final String PLAYBACK_CONTROL = "/api/v1/playback/control";
public static final String HLS_SESSION_CREATE = "/api/v1/playback/hls/sessions";
public static final String HLS_SESSION_DELETE = "/api/v1/playback/hls/sessions/%s";
public static final String HLS_SESSION_QUERY = "/api/v1/playback/hls/sessions/%s";
public static final String HLS_SESSION_CONTROL = "/api/v1/playback/hls/sessions/%s/controls";
public static final String HLS_UI_SESSION_CREATE = "/api/v1/playback/hls/ui/sessions";
public static final String HLS_UI_SESSION_CONTROL = "/api/v1/playback/hls/ui/sessions/%s/controls";
public static final String PTZ_LIST = "/api/v1/control/presetList"; public static final String PTZ_LIST = "/api/v1/control/presetList";
} }

+ 73
- 0
inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolVideotapeController.java View File

@ -9,6 +9,10 @@ import com.inspect.base.core.web.domain.AjaxResult;
import com.inspect.base.redis.service.RedisService; import com.inspect.base.redis.service.RedisService;
import com.inspect.patrol.contants.AccessApiConstant; import com.inspect.patrol.contants.AccessApiConstant;
import com.inspect.patrol.linkage.util.JsonUtil; import com.inspect.patrol.linkage.util.JsonUtil;
import com.inspect.patrol.model.HlsControlModel;
import com.inspect.patrol.model.HlsSessionModel;
import com.inspect.patrol.model.HlsUiControlModel;
import com.inspect.patrol.model.HlsUiSessionModel;
import com.inspect.patrol.model.PtzFiModel; import com.inspect.patrol.model.PtzFiModel;
import com.inspect.patrol.model.PtzModel; import com.inspect.patrol.model.PtzModel;
import com.inspect.patrol.model.RecordListModel; import com.inspect.patrol.model.RecordListModel;
@ -28,7 +32,11 @@ import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
@ -154,6 +162,71 @@ public class PatrolVideotapeController extends BaseController {
return AjaxResult.success(JSONObject.parseObject(result)); return AjaxResult.success(JSONObject.parseObject(result));
} }
@PostMapping({"/hls/session/create"})
public AjaxResult hlsCreateSession(@RequestBody HlsSessionModel hlsSessionModel) throws Exception {
log.info("hls session create param: {}", JSONObject.toJSONString(hlsSessionModel));
String params = JSONObject.toJSONString(hlsSessionModel);
String result = HttpClientUtils.postJson(this.deviceUrl + AccessApiConstant.HLS_SESSION_CREATE, params, "");
return parseHlsResult(result);
}
@DeleteMapping({"/hls/session/delete/{sessionId}"})
public AjaxResult hlsDeleteSession(@PathVariable String sessionId) throws Exception {
log.info("hls session delete sessionId: {}", sessionId);
String result = HttpClientUtils.delete(this.deviceUrl + String.format(AccessApiConstant.HLS_SESSION_DELETE, sessionId));
if (result == null || result.trim().isEmpty()) {
return AjaxResult.success();
}
return parseHlsResult(result);
}
@GetMapping({"/hls/session/query/{sessionId}"})
public AjaxResult hlsGetSession(@PathVariable String sessionId) throws Exception {
log.info("hls session query sessionId: {}", sessionId);
String result = HttpClientUtils.get(this.deviceUrl + String.format(AccessApiConstant.HLS_SESSION_QUERY, sessionId));
return parseHlsResult(result);
}
@PostMapping({"/hls/session/control/{sessionId}"})
public AjaxResult hlsControlSession(@PathVariable String sessionId, @RequestBody HlsControlModel hlsControlModel) throws Exception {
log.info("hls session control sessionId: {}, param: {}", sessionId, JSONObject.toJSONString(hlsControlModel));
String params = JSONObject.toJSONString(hlsControlModel);
String result = HttpClientUtils.postJson(this.deviceUrl + String.format(AccessApiConstant.HLS_SESSION_CONTROL, sessionId), params, "");
return parseHlsResult(result);
}
@PostMapping({"/hls/ui/session/create"})
public AjaxResult hlsCreateUiSession(@RequestBody HlsUiSessionModel hlsUiSessionModel) throws Exception {
log.info("hls ui session create param: {}", JSONObject.toJSONString(hlsUiSessionModel));
String params = JSONObject.toJSONString(hlsUiSessionModel);
String result = HttpClientUtils.postJson(this.deviceUrl + AccessApiConstant.HLS_UI_SESSION_CREATE, params, "");
return parseHlsResult(result);
}
@PostMapping({"/hls/ui/session/control/{sessionId}"})
public AjaxResult hlsControlUiSession(@PathVariable String sessionId, @RequestBody HlsUiControlModel hlsUiControlModel) throws Exception {
log.info("hls ui session control sessionId: {}, param: {}", sessionId, JSONObject.toJSONString(hlsUiControlModel));
String params = JSONObject.toJSONString(hlsUiControlModel);
String result = HttpClientUtils.postJson(this.deviceUrl + String.format(AccessApiConstant.HLS_UI_SESSION_CONTROL, sessionId), params, "");
return parseHlsResult(result);
}
private AjaxResult parseHlsResult(String result) {
if (result == null || result.trim().isEmpty()) {
return AjaxResult.error("接入层返回异常");
}
try {
JSONObject jsonObject = JSONObject.parseObject(result);
if (jsonObject.containsKey("code") && !Constants.SUCCESS.equals(jsonObject.getInteger("code"))) {
return AjaxResult.error(jsonObject.getString("message"));
}
return AjaxResult.success(jsonObject);
} catch (Exception e) {
log.error("hls response parse error, result: {}", result, e);
return AjaxResult.error("接入层返回异常");
}
}
public static void main(String[] args) { public static void main(String[] args) {
String str = "{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"SnapURL\":\"\",\"RTMP\":\"rtmp://10.10.18.201:11935/hls/010010000103010001_010010000103010001_1010000002\",\"SourceVideoFrameRate\":0,\"RTPLostCount\":0,\"PlaybackDuration\":26638,\"CDN\":\"\",\"HLS\":\"http://10.10.18.201:20000/sms/34020000002020000001/hls/010010000103010001_010010000103010001_1010000002/010010000103010001_010010000103010001_1010000002_live.m3u8\",\"InBytes\":0,\"FLV\":\"http://10.10.18.201:20000/sms/34020000002020000001/flv/hls/010010000103010001_010010000103010001_1010000002.flv\",\"ChannelCustomName\":\"\",\"SourceAudioSampleRate\":0,\"SourceVideoHeight\":0,\"SourceVideoWidth\":0,\"Ondemand\":true,\"VideoFrameCount\":0,\"NumOutputs\":0,\"InBitRate\":0,\"WS_FLV\":\"ws://10.10.18.201:20000/sms/34020000002020000001/ws-flv/hls/010010000103010001_010010000103010001_1010000002.flv\",\"AudioEnable\":false,\"OutBytes\":0,\"SMSID\":\"34020000002020000001\",\"Progress\":0,\"RTPLostRate\":0,\"StreamID\":\"playback:010010000103010001:010010000103010001:1010000002\",\"DeviceID\":\"010010000103010001\",\"SourceVideoCodecName\":\"\",\"Duration\":0,\"SourceAudioCodecName\":\"\",\"TimestampSec\":0,\"ChannelID\":\"010010000103010001\",\"WEBRTC\":\"\",\"CascadeSize\":0,\"PlaybackFileURL\":\"\",\"RecordStartAt\":\"\",\"RTPCount\":0,\"ChannelName\":\"Camera 01\",\"StartAt\":\"2022-05-06 08:32:49\",\"RTSP\":\"\",\"Transport\":\"UDP\"}}"; String str = "{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"SnapURL\":\"\",\"RTMP\":\"rtmp://10.10.18.201:11935/hls/010010000103010001_010010000103010001_1010000002\",\"SourceVideoFrameRate\":0,\"RTPLostCount\":0,\"PlaybackDuration\":26638,\"CDN\":\"\",\"HLS\":\"http://10.10.18.201:20000/sms/34020000002020000001/hls/010010000103010001_010010000103010001_1010000002/010010000103010001_010010000103010001_1010000002_live.m3u8\",\"InBytes\":0,\"FLV\":\"http://10.10.18.201:20000/sms/34020000002020000001/flv/hls/010010000103010001_010010000103010001_1010000002.flv\",\"ChannelCustomName\":\"\",\"SourceAudioSampleRate\":0,\"SourceVideoHeight\":0,\"SourceVideoWidth\":0,\"Ondemand\":true,\"VideoFrameCount\":0,\"NumOutputs\":0,\"InBitRate\":0,\"WS_FLV\":\"ws://10.10.18.201:20000/sms/34020000002020000001/ws-flv/hls/010010000103010001_010010000103010001_1010000002.flv\",\"AudioEnable\":false,\"OutBytes\":0,\"SMSID\":\"34020000002020000001\",\"Progress\":0,\"RTPLostRate\":0,\"StreamID\":\"playback:010010000103010001:010010000103010001:1010000002\",\"DeviceID\":\"010010000103010001\",\"SourceVideoCodecName\":\"\",\"Duration\":0,\"SourceAudioCodecName\":\"\",\"TimestampSec\":0,\"ChannelID\":\"010010000103010001\",\"WEBRTC\":\"\",\"CascadeSize\":0,\"PlaybackFileURL\":\"\",\"RecordStartAt\":\"\",\"RTPCount\":0,\"ChannelName\":\"Camera 01\",\"StartAt\":\"2022-05-06 08:32:49\",\"RTSP\":\"\",\"Transport\":\"UDP\"}}";
JSONObject jsonObject = JSONObject.parseObject(str); JSONObject jsonObject = JSONObject.parseObject(str);


+ 14
- 0
inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/model/HlsControlModel.java View File

@ -0,0 +1,14 @@
package com.inspect.patrol.model;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Setter
@Getter
public class HlsControlModel implements Serializable {
private String action;
private Integer speed;
private String seekTime;
}

+ 20
- 0
inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/model/HlsSessionModel.java View File

@ -0,0 +1,20 @@
package com.inspect.patrol.model;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Setter
@Getter
public class HlsSessionModel implements Serializable {
private String nvrIp;
private Integer sdkPort;
private Integer rtspPort;
private Integer channel;
private Integer streamType;
private String username;
private String password;
private String startTime;
private String endTime;
}

+ 15
- 0
inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/model/HlsUiControlModel.java View File

@ -0,0 +1,15 @@
package com.inspect.patrol.model;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Setter
@Getter
public class HlsUiControlModel implements Serializable {
private String cameraCode;
private String action;
private Integer speed;
private String seekTime;
}

+ 15
- 0
inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/model/HlsUiSessionModel.java View File

@ -0,0 +1,15 @@
package com.inspect.patrol.model;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Setter
@Getter
public class HlsUiSessionModel implements Serializable {
private String cameraCode;
private Integer streamType;
private String startTime;
private String endTime;
}

+ 0
- 9
inspect-metadata/src/main/java/com/inspect/metadata/eqpbook/controller/BasedataEqpBookChannelController.java View File

@ -40,15 +40,6 @@ public class BasedataEqpBookChannelController extends BaseController {
this.startPage(); this.startPage();
List<BasedataEqpBookChannel> list = this.basedataEqpBookChannelService.selectBasedataEqpBookChannelList(basedataEqpbookChannel); List<BasedataEqpBookChannel> list = this.basedataEqpBookChannelService.selectBasedataEqpBookChannelList(basedataEqpbookChannel);
for (BasedataEqpBookChannel channel : list) {
BasedataEqpBook basedataEqp = this.baseDataEqpBookService.selectBasedataEqpBookByEqpBookId(channel.getEqpBookId());
if (basedataEqp == null) {
return this.getDataTable(list);
}
channel.setEqpBookName(basedataEqp.getPatrolDeviceName());
}
return this.getDataTable(list); return this.getDataTable(list);
} }


+ 6
- 0
inspect-metadata/src/main/java/com/inspect/metadata/eqpbook/domain/BasedataEqpBookChannel.java View File

@ -87,6 +87,12 @@ public class BasedataEqpBookChannel extends BaseEntity {
private String deviceSource; private String deviceSource;
private String stationName;
private String stationCode;
private String areaName;
public String toString() { public String toString() {
return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)).append("channelId", this.getChannelId()).append("channelCode", this.getChannelCode()).append("channelName", this.getChannelName()).append("parentChannelId", this.getParentChannelId()).append("eqpbookId", this.getEqpBookId()).append("channelType", this.getChannelType()).append("onlineState", this.getOnlineState()).append("channelContent", this.getChannelContent()).append("provider", this.getProvider()).append("address", this.getAddress()).append("host", this.getHost()).append("port", this.getPort()).append("createBy", this.getCreateBy()).append("createTime", this.getCreateTime()).append("updateBy", this.getUpdateBy()).append("updateTime", this.getUpdateTime()).append("deleteFlag", this.getDeleteFlag()).append("patroldeviceCode", this.getPatrolDeviceCode()).append("username", this.getUsername()).append("password", this.getPassword()).toString(); return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)).append("channelId", this.getChannelId()).append("channelCode", this.getChannelCode()).append("channelName", this.getChannelName()).append("parentChannelId", this.getParentChannelId()).append("eqpbookId", this.getEqpBookId()).append("channelType", this.getChannelType()).append("onlineState", this.getOnlineState()).append("channelContent", this.getChannelContent()).append("provider", this.getProvider()).append("address", this.getAddress()).append("host", this.getHost()).append("port", this.getPort()).append("createBy", this.getCreateBy()).append("createTime", this.getCreateTime()).append("updateBy", this.getUpdateBy()).append("updateTime", this.getUpdateTime()).append("deleteFlag", this.getDeleteFlag()).append("patroldeviceCode", this.getPatrolDeviceCode()).append("username", this.getUsername()).append("password", this.getPassword()).toString();
} }


+ 46
- 15
inspect-metadata/src/main/resources/mapper/eqpbook/BasedataEqpBookChannelMapper.xml View File

@ -57,27 +57,58 @@
<select id="selectBasedataEqpBookChannelList" parameterType="BasedataEqpBookChannel" <select id="selectBasedataEqpBookChannelList" parameterType="BasedataEqpBookChannel"
resultMap="BasedataEqpBookChannelResult"> resultMap="BasedataEqpBookChannelResult">
<include refid="selectBasedataEqpBookChannelVo"/>
select
bec.channel_id,
bec.channel_code,
bec.up_system_device_code,
bec.channel_name,
bec.parent_channel_id,
bec.eqp_book_id,
bec.channel_type,
bec.online_state,
bec.channel_content,
bec.provider,
bec.address,
bec.host,
bec.port,
bec.create_by,
bec.create_time,
bec.update_by,
bec.update_time,
bec.delete_flag,
bec.patrol_device_code,
bec.username,
bec.password,
bec.device_source
from basedata_eqpbook_channel bec left join basedata_eqpbook be on bec.eqp_book_id = be.eqp_book_id
<where> <where>
<if test="channelCode != null and channelCode != ''">and channel_code = #{channelCode}</if>
<if test="channelName != null and channelName != ''">and channel_name like concat('%', #{channelName},
<if test="channelCode != null and channelCode != ''">and bec.channel_code = #{channelCode}</if>
<if test="stationCode != null and stationCode != ''">and be.station_code = #{channelCode}</if>
<if test="deviceSource != null and deviceSource != ''">and be.device_source = #{deviceSource}</if>
<if test="channelName != null and channelName != ''">and bec.channel_name like concat('%', #{channelName},
'%')
</if>
<if test="deviceCode != null and deviceCode != ''">and bec.patrol_device_code like concat('%', #{deviceCode},
'%')
</if>
<if test="deviceName != null and deviceName != ''">and bec.channel_name like concat('%', #{deviceName},
'%') '%')
</if> </if>
<if test="parentChannelId != null and parentChannelId != ''">and parent_channel_id = #{parentChannelId}
<if test="parentChannelId != null and parentChannelId != ''">and bec.parent_channel_id = #{parentChannelId}
</if> </if>
<if test="eqpBookId != null">and eqp_book_id = #{eqpBookId}</if>
<if test="channelType != null and channelType != ''">and channel_type = #{channelType}</if>
<if test="onlineState != null and onlineState != ''">and online_state = #{onlineState}</if>
<if test="channelContent != null and channelContent != ''">and channel_content = #{channelContent}</if>
<if test="provider != null and provider != ''">and provider = #{provider}</if>
<if test="address != null and address != ''">and address = #{address}</if>
<if test="host != null and host != ''">and host = #{host}</if>
<if test="port != null and port != ''">and port = #{port}</if>
<if test="patrolDeviceCode != null and patrolDeviceCode != ''">and patrol_device_code =
<if test="eqpBookId != null">and bec.eqp_book_id = #{eqpBookId}</if>
<if test="channelType != null and channelType != ''">and bec.channel_type = #{channelType}</if>
<if test="onlineState != null and onlineState != ''">and bec.online_state = #{onlineState}</if>
<if test="channelContent != null and channelContent != ''">and bec.channel_content = #{channelContent}</if>
<if test="provider != null and provider != ''">and bec.provider = #{provider}</if>
<if test="address != null and address != ''">and bec.address = #{address}</if>
<if test="host != null and host != ''">and bec.host = #{host}</if>
<if test="port != null and port != ''">and bec.port = #{port}</if>
<if test="patrolDeviceCode != null and patrolDeviceCode != ''">and bec.patrol_device_code =
#{patrolDeviceCode} #{patrolDeviceCode}
</if> </if>
<if test="username != null and username != ''">and username = #{username}</if>
<if test="password != null and password != ''">and password = #{password}</if>
<if test="username != null and username != ''">and bec.username = #{username}</if>
<if test="password != null and password != ''">and bec.password = #{password}</if>
</where> </where>
</select> </select>


Loading…
Cancel
Save