|
@@ -2,11 +2,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.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.ozs.common.annotation.Log;
|
|
import com.ozs.common.annotation.Log;
|
|
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.SysDictData;
|
|
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;
|
|
@@ -33,9 +35,9 @@ import com.ozs.service.service.BaseUserService;
|
|
import com.ozs.service.service.MsgAlarmService;
|
|
import com.ozs.service.service.MsgAlarmService;
|
|
import com.ozs.system.service.DataScoreUtil;
|
|
import com.ozs.system.service.DataScoreUtil;
|
|
import com.ozs.system.service.ISysDeptService;
|
|
import com.ozs.system.service.ISysDeptService;
|
|
|
|
+import com.ozs.system.service.ISysDictTypeService;
|
|
import com.ozs.web.core.config.CaneraConfig;
|
|
import com.ozs.web.core.config.CaneraConfig;
|
|
import com.ozs.web.core.util.CameraUtil;
|
|
import com.ozs.web.core.util.CameraUtil;
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -43,11 +45,9 @@ import org.springframework.http.MediaType;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
-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.PathVariable;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
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.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -58,6 +58,7 @@ 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.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -96,12 +97,13 @@ public class BaseCameraManagementController extends BaseController {
|
|
private BaseUserService baseUserService;
|
|
private BaseUserService baseUserService;
|
|
@Autowired
|
|
@Autowired
|
|
private RedisCache redisCache;
|
|
private RedisCache redisCache;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISysDictTypeService dictTypeService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 所有相机列表+权限
|
|
* 所有相机列表+权限
|
|
*/
|
|
*/
|
|
- @ApiOperation(value = "相机台账管理")
|
|
|
|
@GetMapping("/selectCameraAll")
|
|
@GetMapping("/selectCameraAll")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.SELECT)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.SELECT)
|
|
public AjaxResult selectCameraAll() {
|
|
public AjaxResult selectCameraAll() {
|
|
@@ -111,7 +113,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping(value = "/homeGetInfo")
|
|
@PostMapping(value = "/homeGetInfo")
|
|
- @ApiOperation("根据相机ID、是否解除 获取相机信息、未解除信息")
|
|
|
|
@Log(title = "相机台账管理", businessType = BusinessType.SELECT)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.SELECT)
|
|
public AjaxResult homeGetInfo(@RequestBody BaseCameraManagementHomeVo baseCameraManagementHomeVo) {
|
|
public AjaxResult homeGetInfo(@RequestBody BaseCameraManagementHomeVo baseCameraManagementHomeVo) {
|
|
Integer isLock = baseCameraManagementHomeVo.getIsLock();
|
|
Integer isLock = baseCameraManagementHomeVo.getIsLock();
|
|
@@ -130,10 +131,14 @@ public class BaseCameraManagementController extends BaseController {
|
|
baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
baseCameraManagement.setInstallMiles(mils);
|
|
baseCameraManagement.setInstallMiles(mils);
|
|
- String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
- baseCameraManagement.setEndMiles(end);
|
|
|
|
- String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
- baseCameraManagement.setBeginMiles(begin);
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())) {
|
|
|
|
+ String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
+ baseCameraManagement.setEndMiles(end);
|
|
|
|
+ }
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
|
|
|
|
+ String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
+ baseCameraManagement.setBeginMiles(begin);
|
|
|
|
+ }
|
|
return AjaxResult.success(baseCameraManagement);
|
|
return AjaxResult.success(baseCameraManagement);
|
|
} else if (!StringUtils.isEmpty(isLock) && isLock == 2 && !StringUtils.isEmpty(cameraCode)) {
|
|
} else if (!StringUtils.isEmpty(isLock) && isLock == 2 && !StringUtils.isEmpty(cameraCode)) {
|
|
MsgAlarm msgAlarm = msgAlarmService.selectByCameraCode(cameraCode);
|
|
MsgAlarm msgAlarm = msgAlarmService.selectByCameraCode(cameraCode);
|
|
@@ -151,10 +156,12 @@ public class BaseCameraManagementController extends BaseController {
|
|
BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
|
|
BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
|
|
msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
|
|
msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
|
|
- String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
- String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
- String endMile = begin + "-" + end;
|
|
|
|
- msgAlarmResp.setBeginMile(endMile);
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile()) && !ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
|
|
|
|
+ String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
+ String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
+ String endMile = begin + "-" + end;
|
|
|
|
+ msgAlarmResp.setBeginMile(endMile);
|
|
|
|
+ }
|
|
String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
msgAlarmResp.setAlarmMile(mile);
|
|
msgAlarmResp.setAlarmMile(mile);
|
|
msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
|
|
msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
|
|
@@ -172,7 +179,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
* @param baseCameraManagementVo
|
|
* @param baseCameraManagementVo
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @ApiOperation(value = "相机台账管理分页")
|
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.SELECT)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.SELECT)
|
|
public AjaxResult selectBaseAccountManagement(@RequestBody BaseCameraManagementVo baseCameraManagementVo) {
|
|
public AjaxResult selectBaseAccountManagement(@RequestBody BaseCameraManagementVo baseCameraManagementVo) {
|
|
@@ -201,13 +207,19 @@ public class BaseCameraManagementController extends BaseController {
|
|
BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
|
|
BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
|
|
SysDept sysDept = deptService.selectDeptById(o.getDeptId());
|
|
SysDept sysDept = deptService.selectDeptById(o.getDeptId());
|
|
o.setDeptName(sysDept.getDeptName());
|
|
o.setDeptName(sysDept.getDeptName());
|
|
- o.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
|
|
|
|
+ if (!StringUtils.isEmptySunhh(baseRailwayManagement) && !StringUtils.isEmptySunhh(baseRailwayManagement.getRailwayName())) {
|
|
|
|
+ o.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
|
|
+ }
|
|
String mils = AppendUtils.stringAppend(o.getInstallMile());
|
|
String mils = AppendUtils.stringAppend(o.getInstallMile());
|
|
o.setInstallMiles(mils);
|
|
o.setInstallMiles(mils);
|
|
- String end = AppendUtils.stringAppend(o.getEndMile());
|
|
|
|
- o.setEndMiles(end);
|
|
|
|
- String begin = AppendUtils.stringAppend(o.getBeginMile());
|
|
|
|
- o.setBeginMiles(begin);
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(o.getEndMile())) {
|
|
|
|
+ String end = AppendUtils.stringAppend(o.getEndMile());
|
|
|
|
+ o.setEndMiles(end);
|
|
|
|
+ }
|
|
|
|
+ if (!ObjectUtils.isEmpty(o.getBeginMile())) {
|
|
|
|
+ String begin = AppendUtils.stringAppend(o.getBeginMile());
|
|
|
|
+ o.setBeginMiles(begin);
|
|
|
|
+ }
|
|
if (roleKey.size() > 0 || "admin".equals(baseUser.getUserName())) {
|
|
if (roleKey.size() > 0 || "admin".equals(baseUser.getUserName())) {
|
|
o.setIsStartRecording(1);
|
|
o.setIsStartRecording(1);
|
|
for (String s : roleKey) {
|
|
for (String s : roleKey) {
|
|
@@ -232,8 +244,7 @@ public class BaseCameraManagementController extends BaseController {
|
|
* @param accountManagementIds
|
|
* @param accountManagementIds
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @DeleteMapping("/{accountManagementIds}")
|
|
|
|
- @ApiOperation("删除相机台账管理信息")
|
|
|
|
|
|
+ @RequestMapping("/remove/{accountManagementIds}")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.DELETE)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.DELETE)
|
|
@Transactional
|
|
@Transactional
|
|
public AjaxResult removeAccountManagement(@PathVariable List<Long> accountManagementIds) {
|
|
public AjaxResult removeAccountManagement(@PathVariable List<Long> accountManagementIds) {
|
|
@@ -256,7 +267,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("/saveAccountManagement")
|
|
@PostMapping("/saveAccountManagement")
|
|
- @ApiOperation("新增相机台账管理信息")
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Log(title = "相机台账管理", businessType = BusinessType.INSERT)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.INSERT)
|
|
public AjaxResult saveAccountManagement(@RequestBody BaseCameraManagement baseCameraManagement) {
|
|
public AjaxResult saveAccountManagement(@RequestBody BaseCameraManagement baseCameraManagement) {
|
|
@@ -282,26 +292,27 @@ public class BaseCameraManagementController extends BaseController {
|
|
if (!ObjectUtils.isEmpty(one)) {
|
|
if (!ObjectUtils.isEmpty(one)) {
|
|
return error("设备动态管理表该相机编码已存在,不能重复添加");
|
|
return error("设备动态管理表该相机编码已存在,不能重复添加");
|
|
}
|
|
}
|
|
- if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
|
|
|
|
- return error("监控范围开始里程位置填写格式不正确");
|
|
|
|
- } else {
|
|
|
|
- double begin = Double.parseDouble(baseCameraManagement.getBeginMiles());
|
|
|
|
- baseCameraManagement.setBeginMile((int) (begin * 1000));
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMiles())) {
|
|
|
|
+ if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
|
|
|
|
+ return error("监控范围开始里程位置填写格式不正确");
|
|
|
|
+ } else {
|
|
|
|
+ BigDecimal begin = new BigDecimal(baseCameraManagement.getBeginMiles());
|
|
|
|
+ baseCameraManagement.setBeginMile(begin.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (!baseCameraManagement.getInstallMiles().matches(PATTERN)) {
|
|
if (!baseCameraManagement.getInstallMiles().matches(PATTERN)) {
|
|
return error("监控相机安装里程位置填写格式不正确");
|
|
return error("监控相机安装里程位置填写格式不正确");
|
|
} else {
|
|
} else {
|
|
- double install = Double.parseDouble(baseCameraManagement.getInstallMiles());
|
|
|
|
- baseCameraManagement.setInstallMile((int) (install * 1000));
|
|
|
|
- }
|
|
|
|
- if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
|
|
|
|
- return error("监控范围结束里程位置填写格式不正确");
|
|
|
|
- } else {
|
|
|
|
- double end = Double.parseDouble(baseCameraManagement.getEndMiles());
|
|
|
|
- baseCameraManagement.setEndMile((int) (end * 1000));
|
|
|
|
|
|
+ BigDecimal install = new BigDecimal(baseCameraManagement.getInstallMiles());
|
|
|
|
+ baseCameraManagement.setInstallMile(install.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
}
|
|
}
|
|
- if (baseCameraManagement.getBeginMile() > baseCameraManagement.getEndMile()) {
|
|
|
|
- return error("监控范围开始里程位置不能大于监控范围结束里程位置");
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMiles())) {
|
|
|
|
+ if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
|
|
|
|
+ return error("监控范围结束里程位置填写格式不正确");
|
|
|
|
+ } else {
|
|
|
|
+ BigDecimal end = new BigDecimal(baseCameraManagement.getEndMiles());
|
|
|
|
+ baseCameraManagement.setEndMile(end.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
baseCameraManagement.setCreateBy(getUserId());
|
|
baseCameraManagement.setCreateBy(getUserId());
|
|
baseCameraManagement.setUpdateBy(getUserId());
|
|
baseCameraManagement.setUpdateBy(getUserId());
|
|
@@ -309,12 +320,15 @@ public class BaseCameraManagementController extends BaseController {
|
|
baseDynamicManagement.setCameraCode(baseCameraManagement.getCameraCode());
|
|
baseDynamicManagement.setCameraCode(baseCameraManagement.getCameraCode());
|
|
baseDynamicManagement.setUpdateBy(getUserId());
|
|
baseDynamicManagement.setUpdateBy(getUserId());
|
|
baseDynamicManagement.setCreateBy(getUserId());
|
|
baseDynamicManagement.setCreateBy(getUserId());
|
|
- String start = HttpUtils.sendGet(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
|
|
|
|
- if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
|
|
|
|
- baseCameraManagement.setStartRecording(1);
|
|
|
|
- baseCameraManagement.setTaskId(start);
|
|
|
|
- } else {
|
|
|
|
- baseCameraManagement.setStartRecording(2);
|
|
|
|
|
|
+ List<SysDictData> data = dictTypeService.selectDictDataByType("management_transcribe_switch");
|
|
|
|
+ if (data.get(0).getDictValue().equals("true")) {
|
|
|
|
+ String start = HttpUtils.sendGet(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
|
|
|
|
+ if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
|
|
|
|
+ baseCameraManagement.setStartRecording(1);
|
|
|
|
+ baseCameraManagement.setTaskId(start);
|
|
|
|
+ } else {
|
|
|
|
+ baseCameraManagement.setStartRecording(2);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (baseCameraManagementService.save(baseCameraManagement) && baseDeviceDynamicManagementService.save(baseDynamicManagement)) {
|
|
if (baseCameraManagementService.save(baseCameraManagement) && baseDeviceDynamicManagementService.save(baseDynamicManagement)) {
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
@@ -335,8 +349,7 @@ public class BaseCameraManagementController extends BaseController {
|
|
* @param baseCameraManagement
|
|
* @param baseCameraManagement
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @PutMapping("/editAccountManagement")
|
|
|
|
- @ApiOperation("修改相机台账管理信息")
|
|
|
|
|
|
+ @PostMapping("/editAccountManagement")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.UPDATE)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.UPDATE)
|
|
public AjaxResult editAccountManagement(@RequestBody BaseCameraManagement baseCameraManagement) {
|
|
public AjaxResult editAccountManagement(@RequestBody BaseCameraManagement baseCameraManagement) {
|
|
LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
@@ -347,26 +360,31 @@ public class BaseCameraManagementController extends BaseController {
|
|
if (!ObjectUtils.isEmpty(cameraManagement) && !cameraManagement.getId().equals(baseCameraManagement.getId())) {
|
|
if (!ObjectUtils.isEmpty(cameraManagement) && !cameraManagement.getId().equals(baseCameraManagement.getId())) {
|
|
return error("相机编码已存在,不能进行修改操作");
|
|
return error("相机编码已存在,不能进行修改操作");
|
|
}
|
|
}
|
|
- if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
|
|
|
|
- return error("监控范围开始里程位置填写格式不正确");
|
|
|
|
- } else {
|
|
|
|
- double begin = Double.parseDouble(baseCameraManagement.getBeginMiles());
|
|
|
|
- baseCameraManagement.setBeginMile((int) (begin * 1000));
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMiles())) {
|
|
|
|
+ if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
|
|
|
|
+ return error("监控范围开始里程位置填写格式不正确");
|
|
|
|
+ } else {
|
|
|
|
+ BigDecimal begin = new BigDecimal(baseCameraManagement.getBeginMiles());
|
|
|
|
+ baseCameraManagement.setBeginMile(begin.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ baseCameraManagement.setBeginMile(null);
|
|
}
|
|
}
|
|
if (!baseCameraManagement.getInstallMiles().matches(PATTERN)) {
|
|
if (!baseCameraManagement.getInstallMiles().matches(PATTERN)) {
|
|
return error("监控相机安装里程位置填写格式不正确");
|
|
return error("监控相机安装里程位置填写格式不正确");
|
|
} else {
|
|
} else {
|
|
- double install = Double.parseDouble(baseCameraManagement.getInstallMiles());
|
|
|
|
- baseCameraManagement.setInstallMile((int) (install * 1000));
|
|
|
|
- }
|
|
|
|
- if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
|
|
|
|
- return error("监控范围结束里程位置填写格式不正确");
|
|
|
|
- } else {
|
|
|
|
- double end = Double.parseDouble(baseCameraManagement.getEndMiles());
|
|
|
|
- baseCameraManagement.setEndMile((int) (end * 1000));
|
|
|
|
|
|
+ BigDecimal install = new BigDecimal(baseCameraManagement.getInstallMiles());
|
|
|
|
+ baseCameraManagement.setInstallMile(install.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
}
|
|
}
|
|
- if (baseCameraManagement.getBeginMile() > baseCameraManagement.getEndMile()) {
|
|
|
|
- return error("监控范围开始里程位置不能大于监控范围结束里程位置");
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMiles())) {
|
|
|
|
+ if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
|
|
|
|
+ return error("监控范围结束里程位置填写格式不正确");
|
|
|
|
+ } else {
|
|
|
|
+ BigDecimal end = new BigDecimal(baseCameraManagement.getEndMiles());
|
|
|
|
+ baseCameraManagement.setEndMile(end.multiply(BigDecimal.valueOf(1000)).intValue());
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ baseCameraManagement.setEndMile(null);
|
|
}
|
|
}
|
|
BaseCameraManagement management = baseCameraManagementService.getById(baseCameraManagement.getId());
|
|
BaseCameraManagement management = baseCameraManagementService.getById(baseCameraManagement.getId());
|
|
baseCameraManagement.setUpdateBy(getUserId());
|
|
baseCameraManagement.setUpdateBy(getUserId());
|
|
@@ -381,14 +399,15 @@ public class BaseCameraManagementController extends BaseController {
|
|
return error("设备动态管理表没有该相机编码");
|
|
return error("设备动态管理表没有该相机编码");
|
|
}
|
|
}
|
|
one.setCameraCode(baseCameraManagement.getCameraCode());
|
|
one.setCameraCode(baseCameraManagement.getCameraCode());
|
|
- if (baseCameraManagementService.updateById(baseCameraManagement) && baseDeviceDynamicManagementService.updateById(one)) {
|
|
|
|
|
|
+ LambdaUpdateWrapper<BaseCameraManagement> wrapper = new LambdaUpdateWrapper<>();
|
|
|
|
+ wrapper.eq(BaseCameraManagement::getId,baseCameraManagement.getId());
|
|
|
|
+ if (baseCameraManagementService.update(baseCameraManagement,wrapper) && baseDeviceDynamicManagementService.updateById(one)) {
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
return AjaxResult.error();
|
|
return AjaxResult.error();
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping(value = "/{id}")
|
|
@GetMapping(value = "/{id}")
|
|
- @ApiOperation("根据相机ID获取相机台账管理信息")
|
|
|
|
@Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
|
|
public AjaxResult getInfo(@PathVariable Long id) {
|
|
public AjaxResult getInfo(@PathVariable Long id) {
|
|
BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
|
|
BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
|
|
@@ -402,8 +421,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
|
|
|
|
Double install = (double) baseCameraManagement.getInstallMile() / 1000;
|
|
Double install = (double) baseCameraManagement.getInstallMile() / 1000;
|
|
- Double end = (double) baseCameraManagement.getEndMile() / 1000;
|
|
|
|
- Double begin = (double) baseCameraManagement.getBeginMile() / 1000;
|
|
|
|
String[] split = install.toString().split("\\.");
|
|
String[] split = install.toString().split("\\.");
|
|
int number = Integer.parseInt(split[1]);
|
|
int number = Integer.parseInt(split[1]);
|
|
if (number == 0) {
|
|
if (number == 0) {
|
|
@@ -411,25 +428,35 @@ public class BaseCameraManagementController extends BaseController {
|
|
} else {
|
|
} else {
|
|
baseCameraManagement.setInstallMiles(install.toString());
|
|
baseCameraManagement.setInstallMiles(install.toString());
|
|
}
|
|
}
|
|
- String[] ends = end.toString().split("\\.");
|
|
|
|
- int numbers = Integer.parseInt(ends[1]);
|
|
|
|
- if (numbers == 0) {
|
|
|
|
- baseCameraManagement.setEndMiles(ends[0]);
|
|
|
|
- } else {
|
|
|
|
- baseCameraManagement.setEndMiles(end.toString());
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())) {
|
|
|
|
+ Double end = (double) baseCameraManagement.getEndMile() / 1000;
|
|
|
|
+ String[] ends = end.toString().split("\\.");
|
|
|
|
+ int numbers = Integer.parseInt(ends[1]);
|
|
|
|
+ if (numbers == 0) {
|
|
|
|
+ baseCameraManagement.setEndMiles(ends[0]);
|
|
|
|
+ } else {
|
|
|
|
+ baseCameraManagement.setEndMiles(end.toString());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- String[] begins = begin.toString().split("\\.");
|
|
|
|
- int numberss = Integer.parseInt(begins[1]);
|
|
|
|
- if (numberss == 0) {
|
|
|
|
- baseCameraManagement.setBeginMiles(begins[0]);
|
|
|
|
- } else {
|
|
|
|
- baseCameraManagement.setBeginMiles(begin.toString());
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
|
|
|
|
+ Double begin = (double) baseCameraManagement.getBeginMile() / 1000;
|
|
|
|
+ String[] begins = begin.toString().split("\\.");
|
|
|
|
+ int numberss = Integer.parseInt(begins[1]);
|
|
|
|
+ if (numberss == 0) {
|
|
|
|
+ baseCameraManagement.setBeginMiles(begins[0]);
|
|
|
|
+ } else {
|
|
|
|
+ baseCameraManagement.setBeginMiles(begin.toString());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
baseCameraManagement.setInstalls(mils);
|
|
baseCameraManagement.setInstalls(mils);
|
|
- String en = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
- String beg = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
- baseCameraManagement.setBegins(beg + "~" + en);
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())&&!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
|
|
|
|
+ String en = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
+ String beg = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
+ baseCameraManagement.setBeginString(beg);
|
|
|
|
+ baseCameraManagement.setEndString(en);
|
|
|
|
+ baseCameraManagement.setBegins(beg + "~" + en);
|
|
|
|
+ }
|
|
BaseUser baseUser = baseUserService.getUser(baseCameraManagement.getCreateBy());
|
|
BaseUser baseUser = baseUserService.getUser(baseCameraManagement.getCreateBy());
|
|
baseCameraManagement.setCreateBy(baseUser.getUserName());
|
|
baseCameraManagement.setCreateBy(baseUser.getUserName());
|
|
BaseUser user = baseUserService.getUser(baseCameraManagement.getUpdateBy());
|
|
BaseUser user = baseUserService.getUser(baseCameraManagement.getUpdateBy());
|
|
@@ -438,7 +465,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping("/getDate/{cameraCode}")
|
|
@GetMapping("/getDate/{cameraCode}")
|
|
- @ApiOperation("视频上方显示的数据")
|
|
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult getDate(@PathVariable String cameraCode) {
|
|
public AjaxResult getDate(@PathVariable String cameraCode) {
|
|
LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
@@ -474,6 +500,7 @@ public class BaseCameraManagementController extends BaseController {
|
|
list.add(baseCameraManagement.getLineDir());
|
|
list.add(baseCameraManagement.getLineDir());
|
|
list.add(baseCameraManagement.getCameraCode());
|
|
list.add(baseCameraManagement.getCameraCode());
|
|
list.add(baseDeviceDynamicManagement.getElectricity());
|
|
list.add(baseDeviceDynamicManagement.getElectricity());
|
|
|
|
+ list.add(baseCameraManagement.getMeasurePointName());
|
|
if (list1.size() <= 0) {
|
|
if (list1.size() <= 0) {
|
|
list.add(1);
|
|
list.add(1);
|
|
} else {
|
|
} else {
|
|
@@ -491,14 +518,28 @@ public class BaseCameraManagementController extends BaseController {
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
- @ApiOperation("相机台账管理信息导入")
|
|
|
|
@PostMapping("/importBaseAccountManagement")
|
|
@PostMapping("/importBaseAccountManagement")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.IMPORT)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.IMPORT)
|
|
public AjaxResult importBaseAccountManagement(MultipartFile file, boolean updateSupport) throws Exception {
|
|
public AjaxResult importBaseAccountManagement(MultipartFile file, boolean updateSupport) throws Exception {
|
|
- ExcelUtil<BaseCameraManagementVos> util = new ExcelUtil<BaseCameraManagementVos>(BaseCameraManagementVos.class);
|
|
|
|
- List<BaseCameraManagementVos> accountManageList = util.importExcel(file.getInputStream());
|
|
|
|
- String message = baseCameraManagementService.importBaseAccountManagement(accountManageList, updateSupport, getUserId());
|
|
|
|
- return AjaxResult.success(message);
|
|
|
|
|
|
+ try {
|
|
|
|
+ List<BaseCameraManagementVos> accountManageList;
|
|
|
|
+ ExcelUtil<BaseCameraManagementVos> util = new ExcelUtil<BaseCameraManagementVos>(BaseCameraManagementVos.class);
|
|
|
|
+ ExcelUtil<String> utils = new ExcelUtil<String>(String.class);
|
|
|
|
+ InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/baseCameraManagement.xlsx");
|
|
|
|
+ List<String> accountManage = utils.importExcels(StringUtils.EMPTY, file.getInputStream(),0);
|
|
|
|
+ List<String> accountManageLists = utils.importExcels(StringUtils.EMPTY, resourceAsStream,0);
|
|
|
|
+ boolean stats = accountManage.stream().sorted().collect(Collectors.joining())
|
|
|
|
+ .equals(accountManageLists.stream().sorted().collect(Collectors.joining()));
|
|
|
|
+ if (stats) {
|
|
|
|
+ accountManageList = util.importExcel(file.getInputStream());
|
|
|
|
+ }else {
|
|
|
|
+ return AjaxResult.error("表头格式不正确,请按照模板样式编写");
|
|
|
|
+ }
|
|
|
|
+ String message = baseCameraManagementService.importBaseAccountManagement(accountManageList, updateSupport, getUserId());
|
|
|
|
+ return AjaxResult.success(message);
|
|
|
|
+ } catch (Exception exception) {
|
|
|
|
+ return AjaxResult.error(exception.getMessage());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -506,7 +547,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
*
|
|
*
|
|
* @param response
|
|
* @param response
|
|
*/
|
|
*/
|
|
- @ApiOperation("导出相机台账管理信息")
|
|
|
|
@PostMapping("/exportBaseAccountManagement")
|
|
@PostMapping("/exportBaseAccountManagement")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.EXPORT)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.EXPORT)
|
|
public void exportBaseAccountManagement(HttpServletResponse response, @RequestBody BaseCameraManagementVo baseCameraManagementVo) {
|
|
public void exportBaseAccountManagement(HttpServletResponse response, @RequestBody BaseCameraManagementVo baseCameraManagementVo) {
|
|
@@ -529,17 +569,34 @@ public class BaseCameraManagementController extends BaseController {
|
|
baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
baseCameraManagement.setInstallMiles(mils);
|
|
baseCameraManagement.setInstallMiles(mils);
|
|
- String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
- baseCameraManagement.setEndMiles(end);
|
|
|
|
- String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
- baseCameraManagement.setBeginMiles(begin);
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())) {
|
|
|
|
+ String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
+ baseCameraManagement.setEndMiles(end);
|
|
|
|
+ }
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
|
|
|
|
+ String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
+ baseCameraManagement.setBeginMiles(begin);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ baseCameraManagementList.sort(new Comparator<BaseCameraManagement>() {
|
|
|
|
+ @Override
|
|
|
|
+ public int compare(BaseCameraManagement o1, BaseCameraManagement o2) {
|
|
|
|
+ String name1 = ChineseToPingyin.convertHanziToPinyin(o1.getRailwayName());
|
|
|
|
+ String substring1 = name1.substring(0, 1);
|
|
|
|
+ String name2 = ChineseToPingyin.convertHanziToPinyin(o2.getRailwayName());
|
|
|
|
+ String substring2 = name2.substring(0, 1);
|
|
|
|
+ int i = substring1.compareTo(substring2);
|
|
|
|
+ if (i == 0) {
|
|
|
|
+ return o1.getInstallMile() - o2.getInstallMile();
|
|
|
|
+ }
|
|
|
|
+ return i;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
ExcelUtil<BaseCameraManagement> util = new ExcelUtil<>(BaseCameraManagement.class);
|
|
ExcelUtil<BaseCameraManagement> util = new ExcelUtil<>(BaseCameraManagement.class);
|
|
util.exportExcel(response, baseCameraManagementList, "台账管理相机数据");
|
|
util.exportExcel(response, baseCameraManagementList, "台账管理相机数据");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @ApiOperation("相机台账管理信息模板下载")
|
|
|
|
@GetMapping("/downloaExcel")
|
|
@GetMapping("/downloaExcel")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public void downloadZip(HttpServletResponse response) {
|
|
public void downloadZip(HttpServletResponse response) {
|
|
@@ -553,7 +610,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("查询录像")
|
|
|
|
@GetMapping("/api/records/{cameraCode}")
|
|
@GetMapping("/api/records/{cameraCode}")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode) {
|
|
public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode) {
|
|
@@ -566,7 +622,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel()));
|
|
return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel()));
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("查询录像")
|
|
|
|
@GetMapping("/api/records/{cameraCode}/{flay}")
|
|
@GetMapping("/api/records/{cameraCode}/{flay}")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode,
|
|
public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode,
|
|
@@ -580,7 +635,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel(), flay));
|
|
return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel(), flay));
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("查询录像")
|
|
|
|
@GetMapping("/api/records/{cameraCode}/{flay}/{format}")
|
|
@GetMapping("/api/records/{cameraCode}/{flay}/{format}")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode,
|
|
public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode,
|
|
@@ -595,7 +649,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel(), flay, format));
|
|
return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel(), flay, format));
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("批量查询录像")
|
|
|
|
@GetMapping("/api/recordsList")
|
|
@GetMapping("/api/recordsList")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult apiRecordsList(@RequestBody
|
|
public AjaxResult apiRecordsList(@RequestBody
|
|
@@ -622,7 +675,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @ApiOperation("播放回放-废弃")
|
|
|
|
@PostMapping("/api/invite")
|
|
@PostMapping("/api/invite")
|
|
public AjaxResult apiInvite(@Validated @RequestBody BaseCameraResVo vo) {
|
|
public AjaxResult apiInvite(@Validated @RequestBody BaseCameraResVo vo) {
|
|
LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
@@ -635,7 +687,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
return success();
|
|
return success();
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("播放回放")
|
|
|
|
@PostMapping("/api/play")
|
|
@PostMapping("/api/play")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult play(@Validated @RequestBody BaseCameraResVo vo) {
|
|
public AjaxResult play(@Validated @RequestBody BaseCameraResVo vo) {
|
|
@@ -653,7 +704,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
// return success(CameraUtil.historyPlayList(one.getChannel(), vo.getStartTime(), vo.getEntTime()));
|
|
// return success(CameraUtil.historyPlayList(one.getChannel(), vo.getStartTime(), vo.getEntTime()));
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("视频服务设备数量")
|
|
|
|
@GetMapping("/totalNumberOfDevices")
|
|
@GetMapping("/totalNumberOfDevices")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult totalNumberOfDevices() {
|
|
public AjaxResult totalNumberOfDevices() {
|
|
@@ -669,7 +719,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
* @param
|
|
* @param
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @ApiOperation("视频服务树形结构")
|
|
|
|
@PostMapping("/cameraTree")
|
|
@PostMapping("/cameraTree")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult cameraTree(@RequestBody CameraTreeVo cameraTreeVo) {
|
|
public AjaxResult cameraTree(@RequestBody CameraTreeVo cameraTreeVo) {
|
|
@@ -690,8 +739,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
return substring1.compareTo(substring2);
|
|
return substring1.compareTo(substring2);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
-
|
|
|
|
for (CameraTree child : children) {
|
|
for (CameraTree child : children) {
|
|
List<CameraTree> children1 = child.getChildren();
|
|
List<CameraTree> children1 = child.getChildren();
|
|
children1.sort(new Comparator<CameraTree>() {
|
|
children1.sort(new Comparator<CameraTree>() {
|
|
@@ -724,64 +771,71 @@ public class BaseCameraManagementController extends BaseController {
|
|
return success(cameraTree);
|
|
return success(cameraTree);
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("关闭视频录制")
|
|
|
|
@GetMapping("/endRecording/{id}")
|
|
@GetMapping("/endRecording/{id}")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult endRecording(@PathVariable Long id) {
|
|
public AjaxResult endRecording(@PathVariable Long id) {
|
|
- BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
|
|
|
|
- if (ObjectUtils.isEmpty(baseCameraManagement)) {
|
|
|
|
- return error("查不到该ID的相机台账数据!!!");
|
|
|
|
- }
|
|
|
|
- log.info("endRecording------------" + baseCameraManagement.getTaskId());
|
|
|
|
- String start = HttpUtils.sendGet(CameraUtil.endRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
|
|
|
|
- log.info("endRecording------------" + start);
|
|
|
|
- if ("success".equals(start)) {
|
|
|
|
- baseCameraManagement.setStartRecording(2);
|
|
|
|
- baseCameraManagement.setTaskId("");
|
|
|
|
- baseCameraManagement.setUpdateBy(getUserId());
|
|
|
|
- } else {
|
|
|
|
- baseCameraManagement.setStartRecording(2);
|
|
|
|
- baseCameraManagement.setTaskId("");
|
|
|
|
- baseCameraManagement.setUpdateBy(getUserId());
|
|
|
|
- log.error("关闭视频录制异常日志如下:" + start);
|
|
|
|
- }
|
|
|
|
- if (baseCameraManagementService.updateById(baseCameraManagement)) {
|
|
|
|
- return success();
|
|
|
|
|
|
+ List<SysDictData> data = dictTypeService.selectDictDataByType("management_transcribe_switch");
|
|
|
|
+ if (data.get(0).getDictValue().equals("true")) {
|
|
|
|
+ BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
|
|
|
|
+ if (ObjectUtils.isEmpty(baseCameraManagement)) {
|
|
|
|
+ return error("查不到该ID的相机台账数据!!!");
|
|
|
|
+ }
|
|
|
|
+ log.info("endRecording------------" + baseCameraManagement.getTaskId());
|
|
|
|
+ String start = HttpUtils.sendGet(CameraUtil.endRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
|
|
|
|
+ log.info("endRecording------------" + start);
|
|
|
|
+ if ("success".equals(start)) {
|
|
|
|
+ baseCameraManagement.setStartRecording(2);
|
|
|
|
+ baseCameraManagement.setTaskId("");
|
|
|
|
+ baseCameraManagement.setUpdateBy(getUserId());
|
|
|
|
+ } else {
|
|
|
|
+ baseCameraManagement.setStartRecording(2);
|
|
|
|
+ baseCameraManagement.setTaskId("");
|
|
|
|
+ baseCameraManagement.setUpdateBy(getUserId());
|
|
|
|
+ log.error("关闭视频录制异常日志如下:" + start);
|
|
|
|
+ }
|
|
|
|
+ if (baseCameraManagementService.updateById(baseCameraManagement)) {
|
|
|
|
+ return success();
|
|
|
|
+ }
|
|
|
|
+ return error();
|
|
|
|
+ }else {
|
|
|
|
+ return error("已自动开启录制,关闭按钮已失效");
|
|
}
|
|
}
|
|
- return error();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @ApiOperation("开启视频录制")
|
|
|
|
@GetMapping("/startRecording/{id}")
|
|
@GetMapping("/startRecording/{id}")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult startRecording(@PathVariable Long id) throws Exception {
|
|
public AjaxResult startRecording(@PathVariable Long id) throws Exception {
|
|
- BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
|
|
|
|
- log.info("startRecording------CameraCode------" + baseCameraManagement.getCameraCode());
|
|
|
|
- log.info("startRecording------Channel------" + baseCameraManagement.getChannel());
|
|
|
|
- String start = HttpClientUtil.gets(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
|
|
|
|
- log.info("startRecording------------" + start);
|
|
|
|
- if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
|
|
|
|
- log.info("startRecording 返回成功!!1");
|
|
|
|
- baseCameraManagement.setStartRecording(1);
|
|
|
|
- baseCameraManagement.setTaskId(start);
|
|
|
|
- baseCameraManagement.setUpdateBy(getUserId());
|
|
|
|
- } else if (start.startsWith("recorder")) {
|
|
|
|
- baseCameraManagement.setStartRecording(1);
|
|
|
|
- baseCameraManagement.setTaskId(baseCameraManagement.getCameraCode()+"/"+baseCameraManagement.getChannel()+"/flv");
|
|
|
|
- baseCameraManagementService.updateById(baseCameraManagement);
|
|
|
|
- } else if (start.startsWith("Stream")) {
|
|
|
|
- return error("开启视频录制失败:流不存在");
|
|
|
|
- }
|
|
|
|
- if (baseCameraManagementService.updateById(baseCameraManagement)) {
|
|
|
|
- return success();
|
|
|
|
- } else {
|
|
|
|
- return error("开启视频录制失败");
|
|
|
|
|
|
+ List<SysDictData> data = dictTypeService.selectDictDataByType("management_transcribe_switch");
|
|
|
|
+ if (data.get(0).getDictValue().equals("true")) {
|
|
|
|
+ BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
|
|
|
|
+ log.info("startRecording------CameraCode------" + baseCameraManagement.getCameraCode());
|
|
|
|
+ log.info("startRecording------Channel------" + baseCameraManagement.getChannel());
|
|
|
|
+ String start = HttpClientUtil.gets(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
|
|
|
|
+ log.info("startRecording------------" + start);
|
|
|
|
+ if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
|
|
|
|
+ log.info("startRecording 返回成功!!1");
|
|
|
|
+ baseCameraManagement.setStartRecording(1);
|
|
|
|
+ baseCameraManagement.setTaskId(start);
|
|
|
|
+ baseCameraManagement.setUpdateBy(getUserId());
|
|
|
|
+ } else if (start.startsWith("recorder")) {
|
|
|
|
+ baseCameraManagement.setStartRecording(1);
|
|
|
|
+ baseCameraManagement.setTaskId(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel() + "/flv");
|
|
|
|
+ baseCameraManagementService.updateById(baseCameraManagement);
|
|
|
|
+ } else if (start.startsWith("Stream")) {
|
|
|
|
+ return error("开启视频录制失败:流不存在");
|
|
|
|
+ }
|
|
|
|
+ if (baseCameraManagementService.updateById(baseCameraManagement)) {
|
|
|
|
+ return success();
|
|
|
|
+ } else {
|
|
|
|
+ return error("开启视频录制失败");
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ return error("已自动开启录制,无需按钮再次开启录制");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping(value = "/getAlarm/{cameraCode}")
|
|
@GetMapping(value = "/getAlarm/{cameraCode}")
|
|
- @ApiOperation("根据视频ID获取详细信息")
|
|
|
|
@Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
|
|
public AjaxResult getAlarm(@PathVariable String cameraCode) {
|
|
public AjaxResult getAlarm(@PathVariable String cameraCode) {
|
|
LambdaQueryWrapper<BaseCameraManagement> queryWrapper = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
LambdaQueryWrapper<BaseCameraManagement> queryWrapper = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
@@ -839,16 +893,24 @@ public class BaseCameraManagementController extends BaseController {
|
|
BeanUtils.copyProperties(baseCameraManagement, msgAlarmResp);
|
|
BeanUtils.copyProperties(baseCameraManagement, msgAlarmResp);
|
|
msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
|
|
msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
|
|
- String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
- String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
- String endMile = "[" + begin + "]-[" + end + "]";
|
|
|
|
- msgAlarmResp.setBeginMile(endMile);
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())&&!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
|
|
|
|
+ String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
|
+ String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
|
+ String endMile = begin + "~" + end ;
|
|
|
|
+ msgAlarmResp.setBeginMile(endMile);
|
|
|
|
+ }
|
|
String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
msgAlarmResp.setAlarmMile(mile);
|
|
msgAlarmResp.setAlarmMile(mile);
|
|
- msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(baseCameraManagement.getInstallLongitude())&&!ObjectUtils.isEmpty(baseCameraManagement.getInstallLatitude())) {
|
|
|
|
+ msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
|
|
|
|
+ }else {
|
|
|
|
+ msgAlarmResp.setInstallLongitude(null);
|
|
|
|
+ }
|
|
msgAlarmResp.setLineDir(baseCameraManagement.getLineDir());
|
|
msgAlarmResp.setLineDir(baseCameraManagement.getLineDir());
|
|
SysDept sysDept = deptService.selectDeptById(baseCameraManagement.getDeptId());
|
|
SysDept sysDept = deptService.selectDeptById(baseCameraManagement.getDeptId());
|
|
msgAlarmResp.setDeptName(sysDept.getDeptName());
|
|
msgAlarmResp.setDeptName(sysDept.getDeptName());
|
|
|
|
+ msgAlarmResp.setCardNum(baseCameraManagement.getCardNum());
|
|
|
|
+ msgAlarmResp.setCameraSn(baseCameraManagement.getCameraSn());
|
|
return AjaxResult.success(msgAlarmResp);
|
|
return AjaxResult.success(msgAlarmResp);
|
|
} else {
|
|
} else {
|
|
return error("该相机编码在相机台账表中不存在");
|
|
return error("该相机编码在相机台账表中不存在");
|
|
@@ -856,7 +918,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @ApiOperation("播放回放-new")
|
|
|
|
@PostMapping("/api/record")
|
|
@PostMapping("/api/record")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.OTHER)
|
|
public AjaxResult record(@Validated @RequestBody BaseCameraResVo vo) {
|
|
public AjaxResult record(@Validated @RequestBody BaseCameraResVo vo) {
|
|
@@ -869,7 +930,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
return new AjaxResult(200, "ok", CameraUtil.getRecordList(one.getChannel(), vo.getStartTime(), vo.getEntTime()));
|
|
return new AjaxResult(200, "ok", CameraUtil.getRecordList(one.getChannel(), vo.getStartTime(), vo.getEntTime()));
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("查询回放视频根据报警ID")
|
|
|
|
@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) {
|