视频点播巡检接口优化
This commit is contained in:
parent
cf39870b9e
commit
f61093b6d7
|
@ -530,7 +530,7 @@ public class MonitorService {
|
||||||
|
|
||||||
log.info("[monitor-capture]: start capture1");
|
log.info("[monitor-capture]: start capture1");
|
||||||
|
|
||||||
List<ChannelLabelDto> labels = cameraChannelMapper.selectLabelAndChannel("'',1008");
|
List<ChannelLabelDto> labels = cameraChannelMapper.selectLabelAndChannel("1009,1008");
|
||||||
labels.forEach(label -> {
|
labels.forEach(label -> {
|
||||||
String channelCode = label.getChannelCode();
|
String channelCode = label.getChannelCode();
|
||||||
try {
|
try {
|
||||||
|
@ -759,9 +759,9 @@ public class MonitorService {
|
||||||
Boolean isParent = (Boolean) result.get("isParent");
|
Boolean isParent = (Boolean) result.get("isParent");
|
||||||
|
|
||||||
if (isParent){
|
if (isParent){
|
||||||
/*CameraOrganization cameraOrganization = JSONObject.parseObject(JSONObject.toJSONString(result), CameraOrganization.class);
|
CameraOrganization cameraOrganization = JSONObject.parseObject(JSONObject.toJSONString(result), CameraOrganization.class);
|
||||||
|
|
||||||
cameraOrgenMapper.insert(cameraOrganization);*/
|
cameraOrgenMapper.insert(cameraOrganization);
|
||||||
|
|
||||||
videoService((String) result.get("id"),path + sep + result.get("name"));
|
videoService((String) result.get("id"),path + sep + result.get("name"));
|
||||||
}else {
|
}else {
|
||||||
|
@ -777,7 +777,7 @@ public class MonitorService {
|
||||||
|
|
||||||
cameraChannel.setParentId(id);
|
cameraChannel.setParentId(id);
|
||||||
|
|
||||||
cameraChannelMapper.insert(cameraChannel);
|
//cameraChannelMapper.insert(cameraChannel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -791,11 +791,11 @@ public class MonitorService {
|
||||||
//获取当前时间和前一天的UTC时间
|
//获取当前时间和前一天的UTC时间
|
||||||
Map<String,Object> condition = new HashMap<>();
|
Map<String,Object> condition = new HashMap<>();
|
||||||
ZonedDateTime endUTC = ZonedDateTime.now(ZoneOffset.UTC);
|
ZonedDateTime endUTC = ZonedDateTime.now(ZoneOffset.UTC);
|
||||||
ZonedDateTime startUTC = endUTC.minusDays(100);
|
ZonedDateTime startUTC = endUTC.minusDays(30);
|
||||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd'T'HHmmss'Z'");
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd'T'HHmmss'Z'");
|
||||||
condition.put("checkStatus",1);
|
condition.put("checkStatus",0);
|
||||||
condition.put("startTime",startUTC);
|
condition.put("startTime",dateTimeFormatter.format(startUTC));
|
||||||
condition.put("endTime",endUTC);
|
condition.put("endTime",dateTimeFormatter.format(endUTC));
|
||||||
//组装查询条件,经过验证pageSize设置过大也没效果,最大512
|
//组装查询条件,经过验证pageSize设置过大也没效果,最大512
|
||||||
Map<String,Object> map = new HashMap<>();
|
Map<String,Object> map = new HashMap<>();
|
||||||
map.put("condition",condition);
|
map.put("condition",condition);
|
||||||
|
@ -825,9 +825,9 @@ public class MonitorService {
|
||||||
for(int i = 2;i<=pageCount;i++){
|
for(int i = 2;i<=pageCount;i++){
|
||||||
map.put("page",i);
|
map.put("page",i);
|
||||||
HttpEntity<Map<String,Object>> request2 = new HttpEntity<>(map,headers);
|
HttpEntity<Map<String,Object>> request2 = new HttpEntity<>(map,headers);
|
||||||
ResponseEntity<JSONObject> responseEntity2 = restTemplate.exchange(url, HttpMethod.POST, request, JSONObject.class );
|
ResponseEntity<JSONObject> responseEntity2 = restTemplate.exchange(url, HttpMethod.POST, request2, JSONObject.class );
|
||||||
JSONObject entityBody2 = responseEntity.getBody();
|
JSONObject entityBody2 = responseEntity2.getBody();
|
||||||
List<Map> results2 = (List<Map>) entityBody.get("results");
|
List<Map> results2 = (List<Map>) entityBody2.get("results");
|
||||||
if(!results2.isEmpty()){
|
if(!results2.isEmpty()){
|
||||||
list.addAll(results);
|
list.addAll(results);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue