|
@@ -27,6 +27,7 @@ import com.ozs.vo.ReqMsgAlarmVo;
|
|
|
import com.ozs.vo.RespGeoHazardMonitorVo;
|
|
|
import com.ozs.vo.RespMsgAlarmVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import okhttp3.Response;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -385,23 +386,29 @@ public class GeoHazardMonitorTokenController {
|
|
|
} catch (InterruptedException e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
- String result;
|
|
|
String url = bakUrl + "/gb28181/api/invite?id=" + cameraCode + "&channel=" + channel + "&startTime=" + seconds + "&endTime=" + second;
|
|
|
try {
|
|
|
- result = HttpClientUtil.get(url);
|
|
|
- if ("200".equals(result)) {
|
|
|
- String path = apiSummary(cameraCode + "/" + channel + "/" + seconds + "-" + second);
|
|
|
- if (org.apache.commons.lang3.StringUtils.isNotEmpty(path)) {
|
|
|
- String codes = HttpUtils.sendGet(startRecording(cameraCode + "/" + channel + "/" + seconds + "-" + second));
|
|
|
- log.info("codes------>" + codes);
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
-
|
|
|
- String formattedDate = sdf.format(alarmDate);
|
|
|
- log.info("-----formattedDate-----------" + formattedDate);
|
|
|
- String records = getQueryRecords(cameraCode + "/" + channel + "/" + seconds + "-" + second, formattedDate, "mp4");
|
|
|
- log.info("-----records-----------" + records);
|
|
|
- return records;
|
|
|
+ Response response = HttpClientUtil.get(url);
|
|
|
+ if (response != null) {
|
|
|
+ log.info("-----alarmHistoryPlay----code--" + cameraCode + "---" + response.code());
|
|
|
+ log.info("-----alarmHistoryPlay----message--" + cameraCode + "---" + response.message());
|
|
|
+ log.info("-----alarmHistoryPlay----body--" + cameraCode + "---" + response.body());
|
|
|
+ if (200 == response.code()) {
|
|
|
+ String path = apiSummary(cameraCode + "/" + channel + "/" + seconds + "-" + second);
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotEmpty(path)) {
|
|
|
+ String codes = HttpUtils.sendGet(startRecording(cameraCode + "/" + channel + "/" + seconds + "-" + second));
|
|
|
+ log.info("codes------>" + codes);
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ String formattedDate = sdf.format(alarmDate);
|
|
|
+ log.info("-----formattedDate-----------" + formattedDate);
|
|
|
+ String records = getQueryRecords(cameraCode + "/" + channel + "/" + seconds + "-" + second, formattedDate, "mp4");
|
|
|
+ log.info("-----records-----------" + records);
|
|
|
+ return records;
|
|
|
+ }
|
|
|
}
|
|
|
+ }else {
|
|
|
+ return null;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.info(e.getMessage());
|