增加摄像机和大屏
This commit is contained in:
parent
aa2d5d8578
commit
1ccddf3c1f
6
pom.xml
6
pom.xml
@ -213,6 +213,12 @@
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.kingbase8</groupId>
|
||||
<artifactId>kingbase8</artifactId>
|
||||
<version>8.6.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
package com.xmgl.recognition.modules.admin.controller;
|
||||
|
||||
import cn.xuyanwu.spring.file.storage.FileInfo;
|
||||
import cn.xuyanwu.spring.file.storage.FileStorageService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xmgl.recognition.annotation.OperLog;
|
||||
import com.xmgl.recognition.jeecg.common.api.vo.Result;
|
||||
import com.xmgl.recognition.modules.admin.entity.VideoConfig;
|
||||
import com.xmgl.recognition.modules.admin.service.IVideoConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author pengj
|
||||
* @date 2023/4/15 10:13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/video")
|
||||
@Slf4j
|
||||
@Api(tags = "视频操作公共接口")
|
||||
public class VideoOpController {
|
||||
|
||||
@Autowired
|
||||
private IVideoConfigService videoConfigService;
|
||||
|
||||
/**
|
||||
* 获取监控点预览取流
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "视频操作管理", operType = "查询", operDesc = "获取配置信息")
|
||||
@ApiOperation(value = " 获取配置信息", notes = "获取配置信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/getConfig")
|
||||
public Result<VideoConfig> getConfig() {
|
||||
return Result.success(videoConfigService.getOne(null));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xmgl.recognition.modules.admin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 视频配置
|
||||
* @author: pengj
|
||||
* @date: 2023-06-01
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("video_config")
|
||||
@ApiModel(value = "VideoConfig实体类", description = "VideoConfig")
|
||||
public class VideoConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
@Excel(name = "ip地址", width = 15)
|
||||
@ApiModelProperty(value = "ip地址")
|
||||
private String ip;
|
||||
/**
|
||||
* 端口号
|
||||
*/
|
||||
@Excel(name = "端口号", width = 15)
|
||||
@ApiModelProperty(value = "端口号")
|
||||
private String port;
|
||||
/**
|
||||
* app_key
|
||||
*/
|
||||
@Excel(name = "app_key", width = 15)
|
||||
@ApiModelProperty(value = "app_key")
|
||||
private String appKey;
|
||||
/**
|
||||
* app_secret
|
||||
*/
|
||||
@Excel(name = "app_secret", width = 15)
|
||||
@ApiModelProperty(value = "app_secret")
|
||||
private String appSecret;
|
||||
/**
|
||||
* sn
|
||||
*/
|
||||
@Excel(name = "sn", width = 15)
|
||||
@ApiModelProperty(value = "sn")
|
||||
private String sn;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.xmgl.recognition.modules.admin.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xmgl.recognition.annotation.DataScope;
|
||||
import com.xmgl.recognition.modules.admin.entity.VideoConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Description: 视频配置
|
||||
* @author: pengj
|
||||
* @date: 2023-06-01
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope
|
||||
public interface VideoConfigMapper extends BaseMapper<VideoConfig> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xmgl.recognition.modules.enterprise.mapper.MonitorDevMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xmgl.recognition.modules.admin.mapper.VideoConfigMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,14 @@
|
||||
package com.xmgl.recognition.modules.admin.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xmgl.recognition.modules.admin.entity.VideoConfig;
|
||||
|
||||
/**
|
||||
* @Description: 视频配置
|
||||
* @author: pengj
|
||||
* @date: 2023-06-01
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IVideoConfigService extends IService<VideoConfig> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.xmgl.recognition.modules.admin.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xmgl.recognition.modules.admin.entity.VideoConfig;
|
||||
import com.xmgl.recognition.modules.admin.mapper.VideoConfigMapper;
|
||||
import com.xmgl.recognition.modules.admin.service.IVideoConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 视频配置
|
||||
* @author: pengj
|
||||
* @date: 2023-06-01
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class VideoConfigServiceImpl extends ServiceImpl<VideoConfigMapper, VideoConfig> implements IVideoConfigService {
|
||||
|
||||
}
|
||||
@ -1,18 +1,26 @@
|
||||
package com.xmgl.recognition.modules.enterprise.controller;
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xmgl.recognition.annotation.OperLog;
|
||||
import com.xmgl.recognition.jeecg.common.util.PageUtil;
|
||||
import com.xmgl.recognition.modules.admin.entity.SystemDictData;
|
||||
import com.xmgl.recognition.modules.admin.service.ISystemDictDataService;
|
||||
import com.xmgl.recognition.util.CommonUtil;
|
||||
import com.xmgl.recognition.util.ParamEnum;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@ -58,6 +66,9 @@ public class DeviceAlarmController {
|
||||
@Autowired
|
||||
private IDeviceAlarmService deviceAlarmService;
|
||||
|
||||
@Autowired
|
||||
private ISystemDictDataService systemDictDataService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@ -100,4 +111,129 @@ public class DeviceAlarmController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备报警统计
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "设备报警管理", operType = "查询", operDesc = "设备报警统计")
|
||||
@ApiOperation(value = "设备报警统计", notes = "设备报警统计", httpMethod = "GET")
|
||||
@GetMapping(value = "/queryStat")
|
||||
public Result<Map<String, Object>> queryStat() {
|
||||
Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<DeviceAlarm> deviceAlarmList = deviceAlarmService.getList(Wrappers.<DeviceAlarm>lambdaQuery()
|
||||
.between(DeviceAlarm::getReportTime, DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date())));
|
||||
List<SystemDictData> systemDictData = systemDictDataService.getByType(ParamEnum.SysDictType.AI_ALARM_TYPE.getValue());
|
||||
deviceAlarmList.stream().forEach(d -> {
|
||||
d.setTypeName(CommonUtil.getDictValue(systemDictData, d.getType()));
|
||||
});
|
||||
resultMap.put("deviceAlarmList", deviceAlarmList);
|
||||
resultMap.put("todayAlarm", deviceAlarmService.count(Wrappers.<DeviceAlarm>lambdaQuery()
|
||||
.between(DeviceAlarm::getReportTime, DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()))));
|
||||
resultMap.put("weekAlarm", deviceAlarmService.count(Wrappers.<DeviceAlarm>lambdaQuery()
|
||||
.between(DeviceAlarm::getReportTime, DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -7)), DateUtil.endOfDay(new Date()))));
|
||||
resultMap.put("monthAlarm", deviceAlarmService.count(Wrappers.<DeviceAlarm>lambdaQuery()
|
||||
.between(DeviceAlarm::getReportTime, DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -30)), DateUtil.endOfDay(new Date()))));
|
||||
result.setResult(resultMap);
|
||||
result.setSuccess(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备报警统计
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "设备报警管理", operType = "查询", operDesc = "设备报警类型统计")
|
||||
@ApiOperation(value = "设备报警类型统计", notes = "设备报警类型统计", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "day", value = "天数范围", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryByType")
|
||||
public Result<List<Map<String, Object>>> queryByType(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
|
||||
Integer day = MapUtils.getInteger(map, "day");
|
||||
List<DeviceAlarm> list = deviceAlarmService.list(Wrappers.<DeviceAlarm>lambdaQuery()
|
||||
.between(DeviceAlarm::getReportTime, DateUtil.offsetDay(new Date(), -day), DateUtil.endOfDay(new Date())));
|
||||
Map<Integer, List<DeviceAlarm>> collect = list.stream().collect(Collectors.groupingBy(l -> l.getType()));
|
||||
Map<Integer, Integer> resultMap = collect.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().size()));
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
List<SystemDictData> systemDictData = systemDictDataService.getByType(ParamEnum.SysDictType.AI_ALARM_TYPE.getValue());
|
||||
systemDictData.stream().forEach(s -> {
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("type", s.getDictValue());
|
||||
map1.put("num", resultMap.get(s.getDictLabel()));
|
||||
resultList.add(map1);
|
||||
});
|
||||
/*resultMap.entrySet().stream().forEach(r -> {
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("type", CommonUtil.getDictValue(systemDictData, r.getKey()));
|
||||
map1.put("num", r.getValue());
|
||||
resultList.add(map1);
|
||||
});*/
|
||||
result.setSuccess(true);
|
||||
result.setResult(resultList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备报警统计
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "设备报警管理", operType = "查询", operDesc = "设备报警时间范围统计")
|
||||
@ApiOperation(value = "设备报警时间范围统计", notes = "设备报警时间范围统计", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "type", value = "查询类型(1:今日;2:24小时;3:7天;4:30天;)", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryByTime")
|
||||
public Result<List<Map<String, Object>>> queryByTime(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
|
||||
Integer type = MapUtils.getInteger(map, "type");
|
||||
List<DeviceAlarm> list = new ArrayList<>();
|
||||
int day = 1;
|
||||
Date beginTime = new Date();
|
||||
if (type == 1) {
|
||||
beginTime = DateUtil.beginOfDay(new Date());
|
||||
list = deviceAlarmService.list(Wrappers.<DeviceAlarm>lambdaQuery()
|
||||
.between(DeviceAlarm::getReportTime, beginTime, new Date()));
|
||||
} else {
|
||||
if (type == 2) {
|
||||
day = 1;
|
||||
} else if (type == 3) {
|
||||
day = 7;
|
||||
} else if (type == 4) {
|
||||
day = 30;
|
||||
}
|
||||
beginTime = DateUtil.offsetDay(new Date(), -day);
|
||||
list = deviceAlarmService.list(Wrappers.<DeviceAlarm>lambdaQuery()
|
||||
.between(DeviceAlarm::getReportTime, beginTime, new Date()));
|
||||
}
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
if (type <= 2) {
|
||||
for (int i = 0; i < 30; i++) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
DateTime dateTime = DateUtil.offsetHour(beginTime, i);
|
||||
if (type == 1 && DateUtil.compare(dateTime, DateUtil.endOfDay(new Date())) >= 0) {
|
||||
break;
|
||||
}
|
||||
if (type == 2 && DateUtil.compare(dateTime, new Date()) >= 0) {
|
||||
break;
|
||||
}
|
||||
DateTime dateTime1 = DateUtil.offsetHour(dateTime, 1);
|
||||
resultMap.put("time", dateTime.toString("HH:mm"));
|
||||
resultMap.put("num", list.stream().filter(l -> DateUtil.compare(l.getReportTime(), dateTime) >= 0 && DateUtil.compare(dateTime1, l.getReportTime()) > 0).count());
|
||||
resultList.add(resultMap);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < 31; i++) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
DateTime dateTime = DateUtil.offsetDay(beginTime, i);
|
||||
if (DateUtil.compare(dateTime, new Date()) >= 0) {
|
||||
break;
|
||||
}
|
||||
resultMap.put("time", dateTime.toDateStr());
|
||||
resultMap.put("num", list.stream().filter(l -> new SimpleDateFormat("yyyy-MM-dd").format(l.getReportTime()).equals(dateTime.toDateStr())).count());
|
||||
resultList.add(resultMap);
|
||||
}
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(resultList);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,201 @@
|
||||
package com.xmgl.recognition.modules.enterprise.controller;
|
||||
|
||||
import com.xmgl.recognition.annotation.OperLog;
|
||||
import com.xmgl.recognition.jeecg.common.util.PageUtil;
|
||||
import com.xmgl.recognition.security.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xmgl.recognition.jeecg.common.api.vo.Result;
|
||||
import com.xmgl.recognition.jeecg.common.system.query.QueryGenerator;
|
||||
import com.xmgl.recognition.jeecg.common.util.oConvertUtils;
|
||||
import com.xmgl.recognition.modules.enterprise.entity.MonitorDev;
|
||||
import com.xmgl.recognition.modules.enterprise.service.IMonitorDevService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 摄像机
|
||||
* @author: pengj
|
||||
* @date: 2023-12-18
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ent/monitorDev")
|
||||
@Slf4j
|
||||
@Api(tags = "摄像机管理")
|
||||
public class MonitorDevController {
|
||||
@Autowired
|
||||
private IMonitorDevService monitorDevService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "摄像机管理", operType = "分页查询", operDesc = "分页列表查询摄像机信息")
|
||||
@ApiOperation(value = " 分页列表查询摄像机信息", notes = "分页列表查询摄像机信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "query", required = true, defaultValue = "1", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query", required = true, defaultValue = "10", dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<IPage<MonitorDev>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<MonitorDev> queryWrapper = QueryGenerator.initPageQueryWrapper(MonitorDev.class, map);
|
||||
Page<MonitorDev> page = PageUtil.getPage(map);
|
||||
IPage<MonitorDev> pageList = monitorDevService.page(page, queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param monitorDev
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "摄像机管理", operType = "列表查询", operDesc = "列表查询摄像机信息")
|
||||
@ApiOperation(value = " 列表查询摄像机信息", notes = "列表查询摄像机信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<MonitorDev>> queryList(@RequestBody MonitorDev monitorDev) {
|
||||
QueryWrapper<MonitorDev> queryWrapper = QueryGenerator.initQueryWrapper(monitorDev);
|
||||
List<MonitorDev> list = monitorDevService.list(queryWrapper);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param monitorDev
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "摄像机管理", operType = "新增", operDesc = "添加摄像机信息")
|
||||
@ApiOperation(value = " 添加摄像机信息", notes = "添加摄像机信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody MonitorDev monitorDev) {
|
||||
monitorDev.setSn(SecurityUtil.getUser().getSn());
|
||||
monitorDevService.save(monitorDev);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param monitorDev
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "摄像机管理", operType = "修改", operDesc = "编辑摄像机信息")
|
||||
@ApiOperation(value = "编辑摄像机信息", notes = "编辑摄像机信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<MonitorDev> edit(@RequestBody MonitorDev monitorDev) {
|
||||
Result<MonitorDev> result = new Result<MonitorDev>();
|
||||
MonitorDev monitorDevEntity = monitorDevService.getById(monitorDev.getMonitorId());
|
||||
if (monitorDevEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = monitorDevService.updateById(monitorDev);
|
||||
if (ok) {
|
||||
result.success("修改成功!");
|
||||
} else {
|
||||
result.success("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "摄像机管理", operType = "删除", operDesc = "删除摄像机信息")
|
||||
@ApiOperation(value = "删除摄像机信息", notes = "删除摄像机信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "摄像机ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<MonitorDev> delete(@RequestBody MonitorDev monitorDev) {
|
||||
Result<MonitorDev> result = new Result<MonitorDev>();
|
||||
MonitorDev monitorDevEntity = monitorDevService.getById(monitorDev.getMonitorId());
|
||||
if (monitorDevEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = monitorDevService.removeById(monitorDev.getMonitorId());
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
} else {
|
||||
result.success("操作失败!");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "摄像机管理", operType = "批量删除", operDesc = "批量删除摄像机信息")
|
||||
@ApiOperation(value = "批量删除摄像机信息", notes = "批量删除摄像机信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "ids", value = "摄像机ID字符串", paramType = "query", required = true, dataType = "String")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<MonitorDev> deleteBatch(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
Result<MonitorDev> result = new Result<MonitorDev>();
|
||||
String ids = MapUtils.getString(map, "ids");
|
||||
if (ids == null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
} else {
|
||||
this.monitorDevService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "摄像机管理", operType = "查询", operDesc = "通过id查询摄像机信息")
|
||||
@ApiOperation(value = "通过id查询摄像机信息", notes = "通过id查询摄像机信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "摄像机ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<MonitorDev> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
Result<MonitorDev> result = new Result<MonitorDev>();
|
||||
MonitorDev monitorDev = monitorDevService.getById(MapUtils.getString(map, "id"));
|
||||
if (monitorDev == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(monitorDev);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -99,4 +99,11 @@ public class DeviceAlarm implements Serializable {
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
}
|
||||
|
||||
@ -0,0 +1,76 @@
|
||||
package com.xmgl.recognition.modules.enterprise.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 摄像机
|
||||
* @author: pengj
|
||||
* @date: 2023-12-18
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("monitor_dev")
|
||||
@ApiModel(value = "MonitorDev实体类", description = "MonitorDev")
|
||||
public class MonitorDev implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 监控ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "监控ID")
|
||||
private Long monitorId;
|
||||
/**
|
||||
* 项目sn
|
||||
*/
|
||||
@Excel(name = "项目sn", width = 15)
|
||||
@ApiModelProperty(value = "项目sn")
|
||||
private String sn;
|
||||
/**
|
||||
* 视频名称
|
||||
*/
|
||||
@Excel(name = "视频名称", width = 15)
|
||||
@ApiModelProperty(value = "视频名称")
|
||||
private String name;
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@Excel(name = "设备编码", width = 15)
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
private String code;
|
||||
/**
|
||||
* 设备状态(0:离线;1:在线;)
|
||||
*/
|
||||
@Excel(name = "设备状态(0:离线;1:在线;)", width = 15)
|
||||
@ApiModelProperty(value = "设备状态(0:离线;1:在线;)")
|
||||
private Integer state;
|
||||
/**
|
||||
* 绑定时间
|
||||
*/
|
||||
@Excel(name = "绑定时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "绑定时间")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 显示排序 越小越靠前(排序字段)
|
||||
*/
|
||||
@Excel(name = "显示排序 越小越靠前(排序字段)", width = 15)
|
||||
@ApiModelProperty(value = "显示排序 越小越靠前(排序字段)")
|
||||
private Integer priority;
|
||||
/**
|
||||
* AI盒子设备ID
|
||||
*/
|
||||
@Excel(name = "AI盒子设备ID", width = 15)
|
||||
@ApiModelProperty(value = "AI盒子设备ID")
|
||||
private Long deviceId;
|
||||
}
|
||||
@ -24,4 +24,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
public interface DeviceAlarmMapper extends BaseMapper<DeviceAlarm> {
|
||||
|
||||
Page<DeviceAlarm> pageList(Page page, @Param(Constants.WRAPPER) Wrapper<DeviceAlarm> wrapper);
|
||||
|
||||
List<DeviceAlarm> pageList(@Param(Constants.WRAPPER) Wrapper<DeviceAlarm> wrapper);
|
||||
}
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
package com.xmgl.recognition.modules.enterprise.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.xmgl.recognition.annotation.DataScope;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.xmgl.recognition.modules.enterprise.entity.MonitorDev;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 摄像机
|
||||
* @author: pengj
|
||||
* @date: 2023-12-18
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope
|
||||
public interface MonitorDevMapper extends BaseMapper<MonitorDev> {
|
||||
|
||||
}
|
||||
@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.xmgl.recognition.modules.enterprise.mapper.DeviceAlarmMapper">
|
||||
|
||||
<select id="pageList" resultType="com.xmgl.recognition.modules.enterprise.entity.DeviceAlarm">
|
||||
SELECT a.* FROM device_alarm a LEFT JOIN device d ON a.device_code = d.`code`
|
||||
SELECT a.*, d.code as deviceName FROM device_alarm a LEFT JOIN device d ON a.device_code = d.`code`
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xmgl.recognition.modules.enterprise.mapper.MonitorDevMapper">
|
||||
|
||||
</mapper>
|
||||
@ -1,9 +1,13 @@
|
||||
package com.xmgl.recognition.modules.enterprise.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xmgl.recognition.modules.enterprise.entity.DeviceAlarm;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -15,4 +19,6 @@ import java.util.Map;
|
||||
public interface IDeviceAlarmService extends IService<DeviceAlarm> {
|
||||
|
||||
Page<DeviceAlarm> pageList(Map<String, Object> map);
|
||||
|
||||
List<DeviceAlarm> getList(Wrapper<DeviceAlarm> wrapper);
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.xmgl.recognition.modules.enterprise.service;
|
||||
|
||||
import com.xmgl.recognition.modules.enterprise.entity.MonitorDev;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 摄像机
|
||||
* @author: pengj
|
||||
* @date: 2023-12-18
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IMonitorDevService extends IService<MonitorDev> {
|
||||
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xmgl.recognition.modules.enterprise.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -50,4 +52,9 @@ public class DeviceAlarmServiceImpl extends ServiceImpl<DeviceAlarmMapper, Devic
|
||||
}
|
||||
return baseMapper.pageList(page, wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceAlarm> getList(Wrapper<DeviceAlarm> wrapper) {
|
||||
return baseMapper.pageList(wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.xmgl.recognition.modules.enterprise.service.impl;
|
||||
|
||||
import com.xmgl.recognition.modules.enterprise.entity.MonitorDev;
|
||||
import com.xmgl.recognition.modules.enterprise.mapper.MonitorDevMapper;
|
||||
import com.xmgl.recognition.modules.enterprise.service.IMonitorDevService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 摄像机
|
||||
* @author: pengj
|
||||
* @date: 2023-12-18
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class MonitorDevServiceImpl extends ServiceImpl<MonitorDevMapper, MonitorDev> implements IMonitorDevService {
|
||||
|
||||
}
|
||||
@ -38,4 +38,26 @@ public class ParamEnum {
|
||||
this.topic = topic;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
public enum SysDictType {
|
||||
AI_ALARM_TYPE("ai_alarm_type", "AI预警类型");
|
||||
private String value;
|
||||
private String desc;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
SysDictType(String value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
18
src/main/resources/application-dev.properties
Normal file
18
src/main/resources/application-dev.properties
Normal file
@ -0,0 +1,18 @@
|
||||
# 数据库配置
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/airecognition?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
# 数据库驱动类
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
# 数据库连接池配置
|
||||
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
||||
spring.datasource.hikari.minimum-idle=20
|
||||
spring.datasource.hikari.maximum-pool-size=500
|
||||
spring.datasource.hikari.auto-commit=true
|
||||
spring.datasource.hikari.idle-timeout=40000
|
||||
spring.datasource.hikari.pool-name=DatebookHikariCP
|
||||
spring.datasource.hikari.max-lifetime=1800000
|
||||
spring.datasource.hikari.validation-timeout=3000
|
||||
#(wait_timeout-30)*1000
|
||||
spring.datasource.hikari.connection-timeout=50000
|
||||
spring.datasource.hikari.connection-test-query=SELECT 1
|
||||
4
src/main/resources/application-king.properties
Normal file
4
src/main/resources/application-king.properties
Normal file
@ -0,0 +1,4 @@
|
||||
spring.datasource.url=jdbc:kingbase8://127.0.0.1:54321/airecognition
|
||||
spring.datasource.username=airecognition
|
||||
spring.datasource.password=123456
|
||||
spring.datasource.driver-class-name=com.kingbase8.Driver
|
||||
@ -1,24 +1,6 @@
|
||||
server.port=5566
|
||||
|
||||
# 数据库配置
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/airecognition?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
# 数据库驱动类
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
# 数据库连接池配置
|
||||
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
||||
spring.datasource.hikari.minimum-idle=20
|
||||
spring.datasource.hikari.maximum-pool-size=500
|
||||
spring.datasource.hikari.auto-commit=true
|
||||
spring.datasource.hikari.idle-timeout=40000
|
||||
spring.datasource.hikari.pool-name=DatebookHikariCP
|
||||
spring.datasource.hikari.max-lifetime=1800000
|
||||
spring.datasource.hikari.validation-timeout=3000
|
||||
#(wait_timeout-30)*1000
|
||||
spring.datasource.hikari.connection-timeout=50000
|
||||
spring.datasource.hikari.connection-test-query=SELECT 1
|
||||
|
||||
#环境选择
|
||||
spring.profiles.active=dev
|
||||
# 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,会不会映射这个字段
|
||||
mybatis-plus.configuration.call-setters-on-nulls=true
|
||||
# 序列化配置
|
||||
@ -52,7 +34,7 @@ spring.file-storage.minio[0].domain=http://182.90.224.147:9000/airecognition/
|
||||
spring.file-storage.minio[0].base-path=
|
||||
|
||||
# mqtt服务器配置
|
||||
mqtt.host=tcp://182.90.224.147:1883
|
||||
mqtt.host=tcp://jxjzw.zhgdyun.com:1883
|
||||
mqtt.clientId=mqttx_recognition1
|
||||
mqtt.username=admin
|
||||
mqtt.password=JXJ@admin
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user