|
@@ -3,18 +3,13 @@ package com.ozs.web.controller.accountmanagment;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.ozs.common.annotation.Log;
|
|
import com.ozs.common.annotation.Log;
|
|
-import com.ozs.common.config.BaseConfig;
|
|
|
|
import com.ozs.common.core.controller.BaseController;
|
|
import com.ozs.common.core.controller.BaseController;
|
|
import com.ozs.common.core.domain.AjaxResult;
|
|
import com.ozs.common.core.domain.AjaxResult;
|
|
import com.ozs.common.core.domain.entity.SysDept;
|
|
import com.ozs.common.core.domain.entity.SysDept;
|
|
-import com.ozs.common.core.domain.entity.SysUser;
|
|
|
|
-import com.ozs.common.core.domain.model.LoginUser;
|
|
|
|
import com.ozs.common.core.redis.RedisCache;
|
|
import com.ozs.common.core.redis.RedisCache;
|
|
import com.ozs.common.enums.BusinessType;
|
|
import com.ozs.common.enums.BusinessType;
|
|
import com.ozs.common.exception.base.BaseException;
|
|
import com.ozs.common.exception.base.BaseException;
|
|
-import com.ozs.common.utils.ApiTokenUtils;
|
|
|
|
import com.ozs.common.utils.AppendUtils;
|
|
import com.ozs.common.utils.AppendUtils;
|
|
import com.ozs.common.utils.ChineseToPingyin;
|
|
import com.ozs.common.utils.ChineseToPingyin;
|
|
import com.ozs.common.utils.IdempotenceUtils;
|
|
import com.ozs.common.utils.IdempotenceUtils;
|
|
@@ -62,12 +57,8 @@ import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.NotNull;
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
-import java.text.Collator;
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
-import java.util.stream.Stream;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -105,6 +96,7 @@ public class BaseCameraManagementController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private RedisCache redisCache;
|
|
private RedisCache redisCache;
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 所有相机列表+权限
|
|
* 所有相机列表+权限
|
|
*/
|
|
*/
|
|
@@ -820,7 +812,7 @@ public class BaseCameraManagementController extends BaseController {
|
|
log.info("publish--------" + objects);
|
|
log.info("publish--------" + objects);
|
|
msgAlarmResp.setImageUrls(objects);
|
|
msgAlarmResp.setImageUrls(objects);
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
msgAlarmResp.setFailureToAlarm(2);
|
|
msgAlarmResp.setFailureToAlarm(2);
|
|
}
|
|
}
|
|
BeanUtils.copyProperties(baseCameraManagement, msgAlarmResp);
|
|
BeanUtils.copyProperties(baseCameraManagement, msgAlarmResp);
|
|
@@ -860,11 +852,11 @@ public class BaseCameraManagementController extends BaseController {
|
|
@GetMapping("/api/getRecordByAlarmId")
|
|
@GetMapping("/api/getRecordByAlarmId")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult getRecordByAlarmId(@RequestParam("alarmId") String alarmId) {
|
|
public AjaxResult getRecordByAlarmId(@RequestParam("alarmId") String alarmId) {
|
|
|
|
+
|
|
LambdaQueryWrapper<MsgAlarm> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<MsgAlarm> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(MsgAlarm::getAlarmId, alarmId);
|
|
wrapper.eq(MsgAlarm::getAlarmId, alarmId);
|
|
MsgAlarm msgAlarm = msgAlarmService.getOne(wrapper);
|
|
MsgAlarm msgAlarm = msgAlarmService.getOne(wrapper);
|
|
if (ObjectUtils.isEmpty(msgAlarm.getReleasedUrl())) {
|
|
if (ObjectUtils.isEmpty(msgAlarm.getReleasedUrl())) {
|
|
- // 表示已经超过报警时间20分钟,可以合成视频
|
|
|
|
Map<String, Object> map = baseCameraManagementService.getCameraChannelByAlarmId(alarmId);
|
|
Map<String, Object> map = baseCameraManagementService.getCameraChannelByAlarmId(alarmId);
|
|
if (!ObjectUtils.isEmpty(map)
|
|
if (!ObjectUtils.isEmpty(map)
|
|
&& map.size() > 0
|
|
&& map.size() > 0
|
|
@@ -877,19 +869,14 @@ public class BaseCameraManagementController extends BaseController {
|
|
true);
|
|
true);
|
|
msgAlarm.setReleasedUrl(url);
|
|
msgAlarm.setReleasedUrl(url);
|
|
msgAlarmService.updateById(msgAlarm);
|
|
msgAlarmService.updateById(msgAlarm);
|
|
- } else {
|
|
|
|
- url = com.ozs.web.core.util.CameraUtil.historyPlayListStr(map.get("channel").toString(),
|
|
|
|
- (Date) map.get("alarmTime"),
|
|
|
|
- new Date(),
|
|
|
|
- false);
|
|
|
|
}
|
|
}
|
|
- return new AjaxResult(200, "ok",serverConfig.getUrl()+url);
|
|
|
|
|
|
+ return error("报警ID为:【" + alarmId + "】的相机信息还未生成报警回放视频");
|
|
} else {
|
|
} else {
|
|
return error("报警ID为:【" + alarmId + "】的相机信息不存在");
|
|
return error("报警ID为:【" + alarmId + "】的相机信息不存在");
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- return new AjaxResult(200, "ok", serverConfig.getUrl()+msgAlarm.getReleasedUrl());
|
|
|
|
|
|
+ return new AjaxResult(200, "ok", serverConfig.getUrl() + msgAlarm.getReleasedUrl());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|