From f61093b6d75aded6ec744e9a993985b801336de0 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Wed, 25 May 2022 18:05:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=82=B9=E6=92=AD=E5=B7=A1?= =?UTF-8?q?=E6=A3=80=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/service/MonitorService.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/service/MonitorService.java b/src/main/java/com/hisense/monitormanage/service/MonitorService.java index 9a3a6aa..86a9695 100644 --- a/src/main/java/com/hisense/monitormanage/service/MonitorService.java +++ b/src/main/java/com/hisense/monitormanage/service/MonitorService.java @@ -530,7 +530,7 @@ public class MonitorService { log.info("[monitor-capture]: start capture1"); - List labels = cameraChannelMapper.selectLabelAndChannel("'',1008"); + List labels = cameraChannelMapper.selectLabelAndChannel("1009,1008"); labels.forEach(label -> { String channelCode = label.getChannelCode(); try { @@ -759,9 +759,9 @@ public class MonitorService { Boolean isParent = (Boolean) result.get("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")); }else { @@ -777,7 +777,7 @@ public class MonitorService { cameraChannel.setParentId(id); - cameraChannelMapper.insert(cameraChannel); + //cameraChannelMapper.insert(cameraChannel); } @@ -791,11 +791,11 @@ public class MonitorService { //获取当前时间和前一天的UTC时间 Map condition = new HashMap<>(); ZonedDateTime endUTC = ZonedDateTime.now(ZoneOffset.UTC); - ZonedDateTime startUTC = endUTC.minusDays(100); + ZonedDateTime startUTC = endUTC.minusDays(30); DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd'T'HHmmss'Z'"); - condition.put("checkStatus",1); - condition.put("startTime",startUTC); - condition.put("endTime",endUTC); + condition.put("checkStatus",0); + condition.put("startTime",dateTimeFormatter.format(startUTC)); + condition.put("endTime",dateTimeFormatter.format(endUTC)); //组装查询条件,经过验证pageSize设置过大也没效果,最大512 Map map = new HashMap<>(); map.put("condition",condition); @@ -825,9 +825,9 @@ public class MonitorService { for(int i = 2;i<=pageCount;i++){ map.put("page",i); HttpEntity> request2 = new HttpEntity<>(map,headers); - ResponseEntity responseEntity2 = restTemplate.exchange(url, HttpMethod.POST, request, JSONObject.class ); - JSONObject entityBody2 = responseEntity.getBody(); - List results2 = (List) entityBody.get("results"); + ResponseEntity responseEntity2 = restTemplate.exchange(url, HttpMethod.POST, request2, JSONObject.class ); + JSONObject entityBody2 = responseEntity2.getBody(); + List results2 = (List) entityBody2.get("results"); if(!results2.isEmpty()){ list.addAll(results); }