提交代码
parent
5fb316b69f
commit
2fbf85a62b
|
@ -41,6 +41,11 @@
|
|||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Transmittable ThreadLocal -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
|
|
|
@ -78,5 +78,10 @@ public class CacheConstants
|
|||
*/
|
||||
public static final String PRO_PROJECT = "pro_project:";
|
||||
|
||||
/**
|
||||
* Ai视频配置 cache key
|
||||
*/
|
||||
public static final String DEV_AI_CONFIG = "dev_ai_config:";
|
||||
|
||||
public static final String UNI_AUTH = "pro_project_uni_auth3:";
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.yanzhu.common.core.utils.file;
|
||||
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* JiangYuQi
|
||||
*/
|
||||
public class MultipartFileUtils {
|
||||
|
||||
/**
|
||||
* 换为Base64为文件
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public static MultipartFile base64ToMultipartFile(String base64) throws IOException {
|
||||
String[] parts = base64.split(",");
|
||||
if(parts.length>1){
|
||||
String contentType = parts[0].split(";")[0].split(":")[1];
|
||||
byte[] bytes = Base64.getDecoder().decode(parts[1]);
|
||||
return new MockMultipartFile("file","file."+contentType.split("/")[1], contentType, bytes);
|
||||
}else{
|
||||
//默认格式为jpeg
|
||||
String contentType = "image/jpeg";
|
||||
byte[] bytes = Base64.getDecoder().decode(base64);
|
||||
return new MockMultipartFile("file", "file"+contentType.split("/")[1], contentType, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,164 @@
|
|||
package com.yanzhu.manage.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* AI设备配置对象 dev_ai_project_config
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public class DevAiProjectConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 公司主键 */
|
||||
@Excel(name = "公司主键")
|
||||
private Long comId;
|
||||
|
||||
/** 公司名称 */
|
||||
@Excel(name = "公司名称")
|
||||
private String comName;
|
||||
|
||||
/** 项目主键 */
|
||||
@Excel(name = "项目主键")
|
||||
private Long projectId;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/** 设备序列号 */
|
||||
@Excel(name = "设备序列号")
|
||||
private String serialNumber;
|
||||
|
||||
/** 厂商名称 */
|
||||
@Excel(name = "厂商名称")
|
||||
private String manufacturer;
|
||||
|
||||
/** 通道类型 */
|
||||
@Excel(name = "通道类型")
|
||||
private String passageType;
|
||||
|
||||
/** 数据状态 */
|
||||
@Excel(name = "数据状态")
|
||||
private Long isDel;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setComId(Long comId)
|
||||
{
|
||||
this.comId = comId;
|
||||
}
|
||||
|
||||
public Long getComId()
|
||||
{
|
||||
return comId;
|
||||
}
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setDeviceName(String deviceName)
|
||||
{
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public String getDeviceName()
|
||||
{
|
||||
return deviceName;
|
||||
}
|
||||
public void setSerialNumber(String serialNumber)
|
||||
{
|
||||
this.serialNumber = serialNumber;
|
||||
}
|
||||
|
||||
public String getSerialNumber()
|
||||
{
|
||||
return serialNumber;
|
||||
}
|
||||
public void setManufacturer(String manufacturer)
|
||||
{
|
||||
this.manufacturer = manufacturer;
|
||||
}
|
||||
|
||||
public String getManufacturer()
|
||||
{
|
||||
return manufacturer;
|
||||
}
|
||||
public void setPassageType(String passageType)
|
||||
{
|
||||
this.passageType = passageType;
|
||||
}
|
||||
|
||||
public String getPassageType()
|
||||
{
|
||||
return passageType;
|
||||
}
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getComName() {
|
||||
return comName;
|
||||
}
|
||||
|
||||
public void setComName(String comName) {
|
||||
this.comName = comName;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("comId", getComId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("deviceName", getDeviceName())
|
||||
.append("serialNumber", getSerialNumber())
|
||||
.append("manufacturer", getManufacturer())
|
||||
.append("passageType", getPassageType())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,401 @@
|
|||
package com.yanzhu.manage.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* AI设备数据对象 dev_ai_project_data
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public class DevAiProjectData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 公司主键 */
|
||||
@Excel(name = "公司主键")
|
||||
private Long comId;
|
||||
|
||||
/** 公司名称 */
|
||||
@Excel(name = "公司名称")
|
||||
private String comName;
|
||||
|
||||
/** 项目主键 */
|
||||
@Excel(name = "项目主键")
|
||||
private Long projectId;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private Long deviceId;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/** 设备的序列号 */
|
||||
@Excel(name = "设备的序列号")
|
||||
private String serialNumber;
|
||||
|
||||
/** 相机的序列号 */
|
||||
@Excel(name = "相机的序列号")
|
||||
private String ipcSerialNum;
|
||||
|
||||
/** 行为分析图片地址 */
|
||||
@Excel(name = "行为分析图片地址")
|
||||
private String imageUrl;
|
||||
|
||||
/** 通道号,用来唯一标识任务 ID */
|
||||
@Excel(name = "通道号,用来唯一标识任务 ID")
|
||||
private Long channelId;
|
||||
|
||||
/** 通道名称 */
|
||||
@Excel(name = "通道名称")
|
||||
private String channelName;
|
||||
|
||||
/** 报警类型 */
|
||||
@Excel(name = "报警类型")
|
||||
private Long alarmType;
|
||||
|
||||
/** 告警 ID */
|
||||
@Excel(name = "告警 ID")
|
||||
private Long alarmId;
|
||||
|
||||
/** 左上角 X 坐标 */
|
||||
@Excel(name = "左上角 X 坐标")
|
||||
private String leftTopX;
|
||||
|
||||
/** 左上角 Y 坐标 */
|
||||
@Excel(name = "左上角 Y 坐标")
|
||||
private String leftTopY;
|
||||
|
||||
/** 右下角 X 坐标 */
|
||||
@Excel(name = "右下角 X 坐标")
|
||||
private String rightBtmX;
|
||||
|
||||
/** 右下角 Y 坐标 */
|
||||
@Excel(name = "右下角 Y 坐标")
|
||||
private String rightBtmY;
|
||||
|
||||
/** 当前告警区域人数 */
|
||||
@Excel(name = "当前告警区域人数")
|
||||
private Long personNum;
|
||||
|
||||
/** 绊线进入人数数量 */
|
||||
@Excel(name = "绊线进入人数数量")
|
||||
private Long inNum;
|
||||
|
||||
/** 绊线离开人数数量 */
|
||||
@Excel(name = "绊线离开人数数量")
|
||||
private Long outNum;
|
||||
|
||||
/** 车牌号 */
|
||||
@Excel(name = "车牌号")
|
||||
private Long plateNo;
|
||||
|
||||
/** ValueType 为 1 时,代表明火检测;ValueType 为 2 时,代表烟雾检测; */
|
||||
@Excel(name = "ValueType 为 1 时,代表明火检测;ValueType 为 2 时,代表烟雾检测;")
|
||||
private String valueType;
|
||||
|
||||
/** 告警短视频的地址 */
|
||||
@Excel(name = "告警短视频的地址")
|
||||
private String alarmVideourl;
|
||||
|
||||
/** 告警短视频的名称 */
|
||||
@Excel(name = "告警短视频的名称")
|
||||
private String alarmVideoName;
|
||||
|
||||
/** 人脸比对结果 */
|
||||
@Excel(name = "人脸比对结果")
|
||||
private String compareResult;
|
||||
|
||||
/** 数据状态 */
|
||||
@Excel(name = "数据状态")
|
||||
private Long isDel;
|
||||
|
||||
public String getComName() {
|
||||
return comName;
|
||||
}
|
||||
|
||||
public void setComName(String comName) {
|
||||
this.comName = comName;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setComId(Long comId)
|
||||
{
|
||||
this.comId = comId;
|
||||
}
|
||||
|
||||
public Long getComId()
|
||||
{
|
||||
return comId;
|
||||
}
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setDeviceId(Long deviceId)
|
||||
{
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public Long getDeviceId()
|
||||
{
|
||||
return deviceId;
|
||||
}
|
||||
public void setDeviceName(String deviceName)
|
||||
{
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public String getDeviceName()
|
||||
{
|
||||
return deviceName;
|
||||
}
|
||||
public void setSerialNumber(String serialNumber)
|
||||
{
|
||||
this.serialNumber = serialNumber;
|
||||
}
|
||||
|
||||
public String getSerialNumber()
|
||||
{
|
||||
return serialNumber;
|
||||
}
|
||||
public void setIpcSerialNum(String ipcSerialNum)
|
||||
{
|
||||
this.ipcSerialNum = ipcSerialNum;
|
||||
}
|
||||
|
||||
public String getIpcSerialNum()
|
||||
{
|
||||
return ipcSerialNum;
|
||||
}
|
||||
public void setImageUrl(String imageUrl)
|
||||
{
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getImageUrl()
|
||||
{
|
||||
return imageUrl;
|
||||
}
|
||||
public void setChannelId(Long channelId)
|
||||
{
|
||||
this.channelId = channelId;
|
||||
}
|
||||
|
||||
public Long getChannelId()
|
||||
{
|
||||
return channelId;
|
||||
}
|
||||
public void setChannelName(String channelName)
|
||||
{
|
||||
this.channelName = channelName;
|
||||
}
|
||||
|
||||
public String getChannelName()
|
||||
{
|
||||
return channelName;
|
||||
}
|
||||
public void setAlarmType(Long alarmType)
|
||||
{
|
||||
this.alarmType = alarmType;
|
||||
}
|
||||
|
||||
public Long getAlarmType()
|
||||
{
|
||||
return alarmType;
|
||||
}
|
||||
public void setAlarmId(Long alarmId)
|
||||
{
|
||||
this.alarmId = alarmId;
|
||||
}
|
||||
|
||||
public Long getAlarmId()
|
||||
{
|
||||
return alarmId;
|
||||
}
|
||||
public void setLeftTopX(String leftTopX)
|
||||
{
|
||||
this.leftTopX = leftTopX;
|
||||
}
|
||||
|
||||
public String getLeftTopX()
|
||||
{
|
||||
return leftTopX;
|
||||
}
|
||||
public void setLeftTopY(String leftTopY)
|
||||
{
|
||||
this.leftTopY = leftTopY;
|
||||
}
|
||||
|
||||
public String getLeftTopY()
|
||||
{
|
||||
return leftTopY;
|
||||
}
|
||||
public void setRightBtmX(String rightBtmX)
|
||||
{
|
||||
this.rightBtmX = rightBtmX;
|
||||
}
|
||||
|
||||
public String getRightBtmX()
|
||||
{
|
||||
return rightBtmX;
|
||||
}
|
||||
public void setRightBtmY(String rightBtmY)
|
||||
{
|
||||
this.rightBtmY = rightBtmY;
|
||||
}
|
||||
|
||||
public String getRightBtmY()
|
||||
{
|
||||
return rightBtmY;
|
||||
}
|
||||
public void setPersonNum(Long personNum)
|
||||
{
|
||||
this.personNum = personNum;
|
||||
}
|
||||
|
||||
public Long getPersonNum()
|
||||
{
|
||||
return personNum;
|
||||
}
|
||||
public void setInNum(Long inNum)
|
||||
{
|
||||
this.inNum = inNum;
|
||||
}
|
||||
|
||||
public Long getInNum()
|
||||
{
|
||||
return inNum;
|
||||
}
|
||||
public void setOutNum(Long outNum)
|
||||
{
|
||||
this.outNum = outNum;
|
||||
}
|
||||
|
||||
public Long getOutNum()
|
||||
{
|
||||
return outNum;
|
||||
}
|
||||
public void setPlateNo(Long plateNo)
|
||||
{
|
||||
this.plateNo = plateNo;
|
||||
}
|
||||
|
||||
public Long getPlateNo()
|
||||
{
|
||||
return plateNo;
|
||||
}
|
||||
public void setValueType(String valueType)
|
||||
{
|
||||
this.valueType = valueType;
|
||||
}
|
||||
|
||||
public String getValueType()
|
||||
{
|
||||
return valueType;
|
||||
}
|
||||
public void setAlarmVideourl(String alarmVideourl)
|
||||
{
|
||||
this.alarmVideourl = alarmVideourl;
|
||||
}
|
||||
|
||||
public String getAlarmVideourl()
|
||||
{
|
||||
return alarmVideourl;
|
||||
}
|
||||
public void setAlarmVideoName(String alarmVideoName)
|
||||
{
|
||||
this.alarmVideoName = alarmVideoName;
|
||||
}
|
||||
|
||||
public String getAlarmVideoName()
|
||||
{
|
||||
return alarmVideoName;
|
||||
}
|
||||
public void setCompareResult(String compareResult)
|
||||
{
|
||||
this.compareResult = compareResult;
|
||||
}
|
||||
|
||||
public String getCompareResult()
|
||||
{
|
||||
return compareResult;
|
||||
}
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("comId", getComId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("deviceName", getDeviceName())
|
||||
.append("serialNumber", getSerialNumber())
|
||||
.append("ipcSerialNum", getIpcSerialNum())
|
||||
.append("imageUrl", getImageUrl())
|
||||
.append("channelId", getChannelId())
|
||||
.append("channelName", getChannelName())
|
||||
.append("alarmType", getAlarmType())
|
||||
.append("alarmId", getAlarmId())
|
||||
.append("leftTopX", getLeftTopX())
|
||||
.append("leftTopY", getLeftTopY())
|
||||
.append("rightBtmX", getRightBtmX())
|
||||
.append("rightBtmY", getRightBtmY())
|
||||
.append("personNum", getPersonNum())
|
||||
.append("inNum", getInNum())
|
||||
.append("outNum", getOutNum())
|
||||
.append("plateNo", getPlateNo())
|
||||
.append("valueType", getValueType())
|
||||
.append("alarmVideourl", getAlarmVideourl())
|
||||
.append("alarmVideoName", getAlarmVideoName())
|
||||
.append("compareResult", getCompareResult())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("isDel", getIsDel())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.yanzhu.manage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.manage.domain.DevAiProjectConfig;
|
||||
|
||||
/**
|
||||
* AI设备配置Mapper接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface DevAiProjectConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询AI设备配置
|
||||
*
|
||||
* @param id AI设备配置主键
|
||||
* @return AI设备配置
|
||||
*/
|
||||
public DevAiProjectConfig selectDevAiProjectConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询AI设备配置列表
|
||||
*
|
||||
* @param devAiProjectConfig AI设备配置
|
||||
* @return AI设备配置集合
|
||||
*/
|
||||
public List<DevAiProjectConfig> selectDevAiProjectConfigList(DevAiProjectConfig devAiProjectConfig);
|
||||
|
||||
/**
|
||||
* 新增AI设备配置
|
||||
*
|
||||
* @param devAiProjectConfig AI设备配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDevAiProjectConfig(DevAiProjectConfig devAiProjectConfig);
|
||||
|
||||
/**
|
||||
* 修改AI设备配置
|
||||
*
|
||||
* @param devAiProjectConfig AI设备配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDevAiProjectConfig(DevAiProjectConfig devAiProjectConfig);
|
||||
|
||||
/**
|
||||
* 删除AI设备配置
|
||||
*
|
||||
* @param id AI设备配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除AI设备配置
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectConfigByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.yanzhu.manage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.manage.domain.DevAiProjectData;
|
||||
|
||||
/**
|
||||
* AI设备数据Mapper接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface DevAiProjectDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询AI设备数据
|
||||
*
|
||||
* @param id AI设备数据主键
|
||||
* @return AI设备数据
|
||||
*/
|
||||
public DevAiProjectData selectDevAiProjectDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询AI设备数据列表
|
||||
*
|
||||
* @param devAiProjectData AI设备数据
|
||||
* @return AI设备数据集合
|
||||
*/
|
||||
public List<DevAiProjectData> selectDevAiProjectDataList(DevAiProjectData devAiProjectData);
|
||||
|
||||
/**
|
||||
* 新增AI设备数据
|
||||
*
|
||||
* @param devAiProjectData AI设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDevAiProjectData(DevAiProjectData devAiProjectData);
|
||||
|
||||
/**
|
||||
* 修改AI设备数据
|
||||
*
|
||||
* @param devAiProjectData AI设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDevAiProjectData(DevAiProjectData devAiProjectData);
|
||||
|
||||
/**
|
||||
* 删除AI设备数据
|
||||
*
|
||||
* @param id AI设备数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除AI设备数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectDataByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
<?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.yanzhu.manage.mapper.DevAiProjectConfigMapper">
|
||||
|
||||
<resultMap type="DevAiProjectConfig" id="DevAiProjectConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="comId" column="com_id" />
|
||||
<result property="comName" column="com_name" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="serialNumber" column="serial_number" />
|
||||
<result property="manufacturer" column="manufacturer" />
|
||||
<result property="passageType" column="passage_type" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDevAiProjectConfigVo">
|
||||
select dac.id, dac.com_id, sd.dept_name as com_name, dac.project_id, pi.project_name, dac.device_name, dac.serial_number, dac.manufacturer, dac.passage_type, dac.is_del, dac.create_by, dac.create_time, dac.update_by, dac.update_time, dac.remark from dev_ai_project_config dac
|
||||
left join pro_project_info pi on pi.id = dac.project_id
|
||||
left join sys_dept sd on sd.dept_id = dac.com_id
|
||||
</sql>
|
||||
|
||||
<select id="selectDevAiProjectConfigList" parameterType="DevAiProjectConfig" resultMap="DevAiProjectConfigResult">
|
||||
<include refid="selectDevAiProjectConfigVo"/>
|
||||
<where>
|
||||
<if test="comId != null "> and dac.com_id = #{comId}</if>
|
||||
<if test="projectId != null "> and dac.project_id = #{projectId}</if>
|
||||
<if test="activeComId != null "> and dac.com_id = #{activeComId}</if>
|
||||
<if test="activeProjectId != null "> and dac.project_id = #{activeProjectId}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and (dac.device_name like concat('%', #{deviceName}, '%') or dac.serial_number = #{serialNumber})</if>
|
||||
<if test="serialNumber != null and serialNumber != ''"> and dac.serial_number = #{serialNumber}</if>
|
||||
<if test="manufacturer != null and manufacturer != ''"> and dac.manufacturer = #{manufacturer}</if>
|
||||
<if test="passageType != null and passageType != ''"> and dac.passage_type = #{passageType}</if>
|
||||
<if test="isDel != null and isDel != ''"> and dac.is_del = #{isDel}</if>
|
||||
and dac.is_del != 2
|
||||
</where>
|
||||
order by dac.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectDevAiProjectConfigById" parameterType="Long" resultMap="DevAiProjectConfigResult">
|
||||
<include refid="selectDevAiProjectConfigVo"/>
|
||||
where dac.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevAiProjectConfig" parameterType="DevAiProjectConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_ai_project_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">com_id,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deviceName != null">device_name,</if>
|
||||
<if test="serialNumber != null">serial_number,</if>
|
||||
<if test="manufacturer != null">manufacturer,</if>
|
||||
<if test="passageType != null">passage_type,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">#{comId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deviceName != null">#{deviceName},</if>
|
||||
<if test="serialNumber != null">#{serialNumber},</if>
|
||||
<if test="manufacturer != null">#{manufacturer},</if>
|
||||
<if test="passageType != null">#{passageType},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDevAiProjectConfig" parameterType="DevAiProjectConfig">
|
||||
update dev_ai_project_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="comId != null">com_id = #{comId},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||||
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
||||
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
|
||||
<if test="passageType != null">passage_type = #{passageType},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteDevAiProjectConfigById" parameterType="Long">
|
||||
update dev_ai_project_config set is_del = 2 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteDevAiProjectConfigByIds" parameterType="String">
|
||||
update dev_ai_project_config set is_del = 2 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
|
@ -0,0 +1,167 @@
|
|||
<?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.yanzhu.manage.mapper.DevAiProjectDataMapper">
|
||||
|
||||
<resultMap type="DevAiProjectData" id="DevAiProjectDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="comId" column="com_id" />
|
||||
<result property="comName" column="com_name" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="serialNumber" column="serial_number" />
|
||||
<result property="ipcSerialNum" column="IPC_serial_num" />
|
||||
<result property="imageUrl" column="image_url" />
|
||||
<result property="channelId" column="channel_id" />
|
||||
<result property="channelName" column="channel_name" />
|
||||
<result property="alarmType" column="alarm_type" />
|
||||
<result property="alarmId" column="alarm_id" />
|
||||
<result property="leftTopX" column="left_top_x" />
|
||||
<result property="leftTopY" column="left_top_y" />
|
||||
<result property="rightBtmX" column="right_btm_x" />
|
||||
<result property="rightBtmY" column="right_btm_y" />
|
||||
<result property="personNum" column="person_num" />
|
||||
<result property="inNum" column="in_num" />
|
||||
<result property="outNum" column="out_num" />
|
||||
<result property="plateNo" column="plate_no" />
|
||||
<result property="valueType" column="value_type" />
|
||||
<result property="alarmVideourl" column="alarm_videoURL" />
|
||||
<result property="alarmVideoName" column="alarm_video_name" />
|
||||
<result property="compareResult" column="compare_result" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="isDel" column="is_del" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDevAiProjectDataVo">
|
||||
select dapd.id, dapd.com_id, sd.dept_name as com_name, dapd.project_id, pi.project_name, dapd.device_id, dapd.device_name, dapd.serial_number, dapd.IPC_serial_num, dapd.image_url, dapd.channel_id, dapd.channel_name, dapd.alarm_type, dapd.alarm_id, dapd.left_top_x, dapd.left_top_y, dapd.right_btm_x, dapd.right_btm_y, dapd.person_num, dapd.in_num, dapd.out_num, dapd.plate_no, dapd.value_type, dapd.alarm_videoURL, dapd.alarm_video_name, dapd.compare_result, dapd.create_time, dapd.is_del from dev_ai_project_data dapd
|
||||
left join pro_project_info pi on pi.id = dapd.project_id
|
||||
left join sys_dept sd on sd.dept_id = dapd.com_id
|
||||
</sql>
|
||||
|
||||
<select id="selectDevAiProjectDataList" parameterType="DevAiProjectData" resultMap="DevAiProjectDataResult">
|
||||
<include refid="selectDevAiProjectDataVo"/>
|
||||
<where>
|
||||
<if test="comId != null "> and dapd.com_id = #{comId}</if>
|
||||
<if test="projectId != null "> and dapd.project_id = #{projectId}</if>
|
||||
<if test="activeComId != null "> and dapd.com_id = #{activeComId}</if>
|
||||
<if test="activeProjectId != null "> and dapd.project_id = #{activeProjectId}</if>
|
||||
<if test="deviceId != null "> and dapd.device_id = #{deviceId}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and (dapd.device_name like concat('%', #{deviceName}, '%') or dapd.serial_number like concat('%', #{deviceName}, '%'))</if>
|
||||
<if test="channelName != null and channelName != ''"> and dapd.channel_name like concat('%', #{channelName}, '%')</if>
|
||||
<if test="alarmType != null "> and dapd.alarm_type = #{alarmType}</if>
|
||||
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and dapd.create_time between #{params.beginTime} and #{params.endTime}</if>
|
||||
<if test="isDel != null and isDel != ''"> and dapd.is_del = #{isDel}</if>
|
||||
and dapd.is_del != 2
|
||||
</where>
|
||||
order by dapd.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectDevAiProjectDataById" parameterType="Long" resultMap="DevAiProjectDataResult">
|
||||
<include refid="selectDevAiProjectDataVo"/>
|
||||
where dapd.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevAiProjectData" parameterType="DevAiProjectData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_ai_project_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">com_id,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="deviceName != null">device_name,</if>
|
||||
<if test="serialNumber != null">serial_number,</if>
|
||||
<if test="ipcSerialNum != null">IPC_serial_num,</if>
|
||||
<if test="imageUrl != null">image_url,</if>
|
||||
<if test="channelId != null">channel_id,</if>
|
||||
<if test="channelName != null">channel_name,</if>
|
||||
<if test="alarmType != null">alarm_type,</if>
|
||||
<if test="alarmId != null">alarm_id,</if>
|
||||
<if test="leftTopX != null">left_top_x,</if>
|
||||
<if test="leftTopY != null">left_top_y,</if>
|
||||
<if test="rightBtmX != null">right_btm_x,</if>
|
||||
<if test="rightBtmY != null">right_btm_y,</if>
|
||||
<if test="personNum != null">person_num,</if>
|
||||
<if test="inNum != null">in_num,</if>
|
||||
<if test="outNum != null">out_num,</if>
|
||||
<if test="plateNo != null">plate_no,</if>
|
||||
<if test="valueType != null">value_type,</if>
|
||||
<if test="alarmVideourl != null">alarm_videoURL,</if>
|
||||
<if test="alarmVideoName != null">alarm_video_name,</if>
|
||||
<if test="compareResult != null">compare_result,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">#{comId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="deviceName != null">#{deviceName},</if>
|
||||
<if test="serialNumber != null">#{serialNumber},</if>
|
||||
<if test="ipcSerialNum != null">#{ipcSerialNum},</if>
|
||||
<if test="imageUrl != null">#{imageUrl},</if>
|
||||
<if test="channelId != null">#{channelId},</if>
|
||||
<if test="channelName != null">#{channelName},</if>
|
||||
<if test="alarmType != null">#{alarmType},</if>
|
||||
<if test="alarmId != null">#{alarmId},</if>
|
||||
<if test="leftTopX != null">#{leftTopX},</if>
|
||||
<if test="leftTopY != null">#{leftTopY},</if>
|
||||
<if test="rightBtmX != null">#{rightBtmX},</if>
|
||||
<if test="rightBtmY != null">#{rightBtmY},</if>
|
||||
<if test="personNum != null">#{personNum},</if>
|
||||
<if test="inNum != null">#{inNum},</if>
|
||||
<if test="outNum != null">#{outNum},</if>
|
||||
<if test="plateNo != null">#{plateNo},</if>
|
||||
<if test="valueType != null">#{valueType},</if>
|
||||
<if test="alarmVideourl != null">#{alarmVideourl},</if>
|
||||
<if test="alarmVideoName != null">#{alarmVideoName},</if>
|
||||
<if test="compareResult != null">#{compareResult},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDevAiProjectData" parameterType="DevAiProjectData">
|
||||
update dev_ai_project_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="comId != null">com_id = #{comId},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||||
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
||||
<if test="ipcSerialNum != null">IPC_serial_num = #{ipcSerialNum},</if>
|
||||
<if test="imageUrl != null">image_url = #{imageUrl},</if>
|
||||
<if test="channelId != null">channel_id = #{channelId},</if>
|
||||
<if test="channelName != null">channel_name = #{channelName},</if>
|
||||
<if test="alarmType != null">alarm_type = #{alarmType},</if>
|
||||
<if test="alarmId != null">alarm_id = #{alarmId},</if>
|
||||
<if test="leftTopX != null">left_top_x = #{leftTopX},</if>
|
||||
<if test="leftTopY != null">left_top_y = #{leftTopY},</if>
|
||||
<if test="rightBtmX != null">right_btm_x = #{rightBtmX},</if>
|
||||
<if test="rightBtmY != null">right_btm_y = #{rightBtmY},</if>
|
||||
<if test="personNum != null">person_num = #{personNum},</if>
|
||||
<if test="inNum != null">in_num = #{inNum},</if>
|
||||
<if test="outNum != null">out_num = #{outNum},</if>
|
||||
<if test="plateNo != null">plate_no = #{plateNo},</if>
|
||||
<if test="valueType != null">value_type = #{valueType},</if>
|
||||
<if test="alarmVideourl != null">alarm_videoURL = #{alarmVideourl},</if>
|
||||
<if test="alarmVideoName != null">alarm_video_name = #{alarmVideoName},</if>
|
||||
<if test="compareResult != null">compare_result = #{compareResult},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteDevAiProjectDataById" parameterType="Long">
|
||||
update dev_ai_project_data set is_del = 2 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteDevAiProjectDataByIds" parameterType="String">
|
||||
update dev_ai_project_data set is_del = 2 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
|
@ -0,0 +1,98 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.manage.domain.DevAiProjectConfig;
|
||||
import com.yanzhu.manage.service.IDevAiProjectConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AI设备配置Controller
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/devAiProjectConfig")
|
||||
public class DevAiProjectConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDevAiProjectConfigService devAiProjectConfigService;
|
||||
|
||||
/**
|
||||
* 查询AI设备配置列表
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectConfig:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
startPage();
|
||||
List<DevAiProjectConfig> list = devAiProjectConfigService.selectDevAiProjectConfigList(devAiProjectConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出AI设备配置列表
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectConfig:export")
|
||||
@Log(title = "AI设备配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
List<DevAiProjectConfig> list = devAiProjectConfigService.selectDevAiProjectConfigList(devAiProjectConfig);
|
||||
ExcelUtil<DevAiProjectConfig> util = new ExcelUtil<DevAiProjectConfig>(DevAiProjectConfig.class);
|
||||
util.exportExcel(response, list, "AI设备配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取AI设备配置详细信息
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectConfig:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(devAiProjectConfigService.selectDevAiProjectConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AI设备配置
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectConfig:add")
|
||||
@Log(title = "AI设备配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
return toAjax(devAiProjectConfigService.insertDevAiProjectConfig(devAiProjectConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AI设备配置
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectConfig:edit")
|
||||
@Log(title = "AI设备配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
return toAjax(devAiProjectConfigService.updateDevAiProjectConfig(devAiProjectConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除AI设备配置
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectConfig:remove")
|
||||
@Log(title = "AI设备配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(devAiProjectConfigService.deleteDevAiProjectConfigByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.manage.domain.DevAiProjectData;
|
||||
import com.yanzhu.manage.service.IDevAiProjectDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AI设备数据Controller
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/devAiProjectData")
|
||||
public class DevAiProjectDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDevAiProjectDataService devAiProjectDataService;
|
||||
|
||||
/**
|
||||
* 查询AI设备数据列表
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectData:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DevAiProjectData devAiProjectData)
|
||||
{
|
||||
startPage();
|
||||
List<DevAiProjectData> list = devAiProjectDataService.selectDevAiProjectDataList(devAiProjectData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出AI设备数据列表
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectData:export")
|
||||
@Log(title = "AI设备数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DevAiProjectData devAiProjectData)
|
||||
{
|
||||
List<DevAiProjectData> list = devAiProjectDataService.selectDevAiProjectDataList(devAiProjectData);
|
||||
ExcelUtil<DevAiProjectData> util = new ExcelUtil<DevAiProjectData>(DevAiProjectData.class);
|
||||
util.exportExcel(response, list, "AI设备数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取AI设备数据详细信息
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectData:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(devAiProjectDataService.selectDevAiProjectDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AI设备数据
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectData:add")
|
||||
@Log(title = "AI设备数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DevAiProjectData devAiProjectData)
|
||||
{
|
||||
return toAjax(devAiProjectDataService.insertDevAiProjectData(devAiProjectData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AI设备数据
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectData:edit")
|
||||
@Log(title = "AI设备数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DevAiProjectData devAiProjectData)
|
||||
{
|
||||
return toAjax(devAiProjectDataService.updateDevAiProjectData(devAiProjectData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除AI设备数据
|
||||
*/
|
||||
@RequiresPermissions("manage:devAiProjectData:remove")
|
||||
@Log(title = "AI设备数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(devAiProjectDataService.deleteDevAiProjectDataByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.yanzhu.manage.controller.wechat;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yanzhu.common.core.annotation.RateLimiter;
|
||||
import com.yanzhu.common.core.enums.LimitType;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.manage.domain.DevAiProjectDataVO;
|
||||
import com.yanzhu.manage.domain.DevBwAiProjectDataVO;
|
||||
import com.yanzhu.manage.service.IDevAiProjectDataService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 项目信息Controller
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-08-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/devApi")
|
||||
public class DevAiBoxController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDevAiProjectDataService devAiProjectDataService;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("DevAiBoxController");
|
||||
|
||||
/**
|
||||
* aibox推送预警数据【博观】
|
||||
*/
|
||||
@PostMapping("/v1/push")
|
||||
@RateLimiter(count = 10, limitType = LimitType.IP)
|
||||
public void boGuanPush(@RequestBody Map<String,Object> dataMap)
|
||||
{
|
||||
try{
|
||||
List<Map<String,Object>> list = (List<Map<String,Object>>)dataMap.get("BehaviorResults");
|
||||
if(list!=null && list.size()>0){
|
||||
DevAiProjectDataVO devAiProjectDataVO = JSON.parseObject(JSONObject.toJSONString(list.get(0)), DevAiProjectDataVO.class);
|
||||
devAiProjectDataService.insertHttpDevAiProjectData(devAiProjectDataVO);
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("BG...AiBox解析参数失败!!!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* aibox推送预警数据【博瓦】
|
||||
*/
|
||||
@PostMapping("/v2/push")
|
||||
public void boWaPush(@RequestBody DevBwAiProjectDataVO data)
|
||||
{
|
||||
try{
|
||||
devAiProjectDataService.insertHttpBwDevAiProjectData(data);
|
||||
}catch (Exception e){
|
||||
logger.info("BW...AiBox解析参数失败!!!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,294 @@
|
|||
package com.yanzhu.manage.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
public class DevAiProjectDataVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备ID */
|
||||
private Long DeviceId;
|
||||
|
||||
/** 设备名称 */
|
||||
private String DeviceName;
|
||||
|
||||
/** 设备网口 0 IP 地址 */
|
||||
private String DeviceAddr0;
|
||||
|
||||
/** 设备网口 1 IP 地址 */
|
||||
private String DeviceAddr1;
|
||||
|
||||
/** 设备的序列号 */
|
||||
private String SerialNumber;
|
||||
|
||||
/** 相机的序列号 */
|
||||
private String IPCSerialNum;
|
||||
|
||||
/** 相机的 IP 地址 */
|
||||
private String IPCAddr;
|
||||
|
||||
/** 通道号,用来唯一标识任务 ID */
|
||||
private Long ChannelId;
|
||||
|
||||
/** 通道名称 */
|
||||
private String ChannelName;
|
||||
|
||||
/** 报警类型 */
|
||||
private Long AlarmType;
|
||||
|
||||
/** 告警 ID */
|
||||
private Long AlarmId;
|
||||
|
||||
/** 上报间隔 */
|
||||
private String ReportRate;
|
||||
|
||||
/** 采集时间 */
|
||||
private Long Timestamp;
|
||||
|
||||
/** 左上角 X 坐标 */
|
||||
private String LeftTopX;
|
||||
|
||||
/** 左上角 Y 坐标 */
|
||||
private String LeftTopY;
|
||||
|
||||
/** 右下角 X 坐标 */
|
||||
private String RightBtmX;
|
||||
|
||||
/** 右下角 Y 坐标 */
|
||||
private String RightBtmY;
|
||||
|
||||
/** 当前告警区域人数 */
|
||||
private Long PersonNum;
|
||||
|
||||
/** 绊线进入人数数量 */
|
||||
private Long InNum;
|
||||
|
||||
/** 绊线离开人数数量 */
|
||||
private Long OutNum;
|
||||
|
||||
/** 车牌号 */
|
||||
private Long PlateNo;
|
||||
|
||||
/** ValueType 为 1 时,代表明火检测;ValueType 为 2 时,代表烟雾检测; */
|
||||
private String ValueType;
|
||||
|
||||
/** 告警短视频的地址 */
|
||||
private String AlarmVideourl;
|
||||
|
||||
/** 告警短视频的名称 */
|
||||
private String AlarmVideoName;
|
||||
|
||||
/** 人脸比对结果 */
|
||||
private String CompareResult;
|
||||
|
||||
private Map<String, Object> BigImage;
|
||||
|
||||
public Long getDeviceId() {
|
||||
return DeviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(Long deviceId) {
|
||||
DeviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceName() {
|
||||
return DeviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
DeviceName = deviceName;
|
||||
}
|
||||
|
||||
public String getDeviceAddr0() {
|
||||
return DeviceAddr0;
|
||||
}
|
||||
|
||||
public void setDeviceAddr0(String deviceAddr0) {
|
||||
DeviceAddr0 = deviceAddr0;
|
||||
}
|
||||
|
||||
public String getDeviceAddr1() {
|
||||
return DeviceAddr1;
|
||||
}
|
||||
|
||||
public void setDeviceAddr1(String deviceAddr1) {
|
||||
DeviceAddr1 = deviceAddr1;
|
||||
}
|
||||
|
||||
public String getSerialNumber() {
|
||||
return SerialNumber;
|
||||
}
|
||||
|
||||
public void setSerialNumber(String serialNumber) {
|
||||
SerialNumber = serialNumber;
|
||||
}
|
||||
|
||||
public String getIPCSerialNum() {
|
||||
return IPCSerialNum;
|
||||
}
|
||||
|
||||
public void setIPCSerialNum(String IPCSerialNum) {
|
||||
this.IPCSerialNum = IPCSerialNum;
|
||||
}
|
||||
|
||||
public String getIPCAddr() {
|
||||
return IPCAddr;
|
||||
}
|
||||
|
||||
public void setIPCAddr(String IPCAddr) {
|
||||
this.IPCAddr = IPCAddr;
|
||||
}
|
||||
|
||||
public Long getChannelId() {
|
||||
return ChannelId;
|
||||
}
|
||||
|
||||
public void setChannelId(Long channelId) {
|
||||
ChannelId = channelId;
|
||||
}
|
||||
|
||||
public String getChannelName() {
|
||||
return ChannelName;
|
||||
}
|
||||
|
||||
public void setChannelName(String channelName) {
|
||||
ChannelName = channelName;
|
||||
}
|
||||
|
||||
public Long getAlarmType() {
|
||||
return AlarmType;
|
||||
}
|
||||
|
||||
public void setAlarmType(Long alarmType) {
|
||||
AlarmType = alarmType;
|
||||
}
|
||||
|
||||
public Long getAlarmId() {
|
||||
return AlarmId;
|
||||
}
|
||||
|
||||
public void setAlarmId(Long alarmId) {
|
||||
AlarmId = alarmId;
|
||||
}
|
||||
|
||||
public String getReportRate() {
|
||||
return ReportRate;
|
||||
}
|
||||
|
||||
public void setReportRate(String reportRate) {
|
||||
ReportRate = reportRate;
|
||||
}
|
||||
|
||||
public Long getTimestamp() {
|
||||
return Timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(Long timestamp) {
|
||||
Timestamp = timestamp;
|
||||
}
|
||||
|
||||
public String getLeftTopX() {
|
||||
return LeftTopX;
|
||||
}
|
||||
|
||||
public void setLeftTopX(String leftTopX) {
|
||||
LeftTopX = leftTopX;
|
||||
}
|
||||
|
||||
public String getLeftTopY() {
|
||||
return LeftTopY;
|
||||
}
|
||||
|
||||
public void setLeftTopY(String leftTopY) {
|
||||
LeftTopY = leftTopY;
|
||||
}
|
||||
|
||||
public String getRightBtmX() {
|
||||
return RightBtmX;
|
||||
}
|
||||
|
||||
public void setRightBtmX(String rightBtmX) {
|
||||
RightBtmX = rightBtmX;
|
||||
}
|
||||
|
||||
public String getRightBtmY() {
|
||||
return RightBtmY;
|
||||
}
|
||||
|
||||
public void setRightBtmY(String rightBtmY) {
|
||||
RightBtmY = rightBtmY;
|
||||
}
|
||||
|
||||
public Long getPersonNum() {
|
||||
return PersonNum;
|
||||
}
|
||||
|
||||
public void setPersonNum(Long personNum) {
|
||||
PersonNum = personNum;
|
||||
}
|
||||
|
||||
public Long getInNum() {
|
||||
return InNum;
|
||||
}
|
||||
|
||||
public void setInNum(Long inNum) {
|
||||
InNum = inNum;
|
||||
}
|
||||
|
||||
public Long getOutNum() {
|
||||
return OutNum;
|
||||
}
|
||||
|
||||
public void setOutNum(Long outNum) {
|
||||
OutNum = outNum;
|
||||
}
|
||||
|
||||
public Long getPlateNo() {
|
||||
return PlateNo;
|
||||
}
|
||||
|
||||
public void setPlateNo(Long plateNo) {
|
||||
PlateNo = plateNo;
|
||||
}
|
||||
|
||||
public String getValueType() {
|
||||
return ValueType;
|
||||
}
|
||||
|
||||
public void setValueType(String valueType) {
|
||||
ValueType = valueType;
|
||||
}
|
||||
|
||||
public String getAlarmVideourl() {
|
||||
return AlarmVideourl;
|
||||
}
|
||||
|
||||
public void setAlarmVideourl(String alarmVideourl) {
|
||||
AlarmVideourl = alarmVideourl;
|
||||
}
|
||||
|
||||
public String getAlarmVideoName() {
|
||||
return AlarmVideoName;
|
||||
}
|
||||
|
||||
public void setAlarmVideoName(String alarmVideoName) {
|
||||
AlarmVideoName = alarmVideoName;
|
||||
}
|
||||
|
||||
public String getCompareResult() {
|
||||
return CompareResult;
|
||||
}
|
||||
|
||||
public void setCompareResult(String compareResult) {
|
||||
CompareResult = compareResult;
|
||||
}
|
||||
|
||||
public Map<String, Object> getBigImage() {
|
||||
return BigImage;
|
||||
}
|
||||
|
||||
public void setBigImage(Map<String, Object> bigImage) {
|
||||
BigImage = bigImage;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.yanzhu.manage.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 博瓦盒子数据集
|
||||
*/
|
||||
@Data
|
||||
public class DevBwAiProjectDataVO {
|
||||
|
||||
private String device_sn;
|
||||
private String device_version;
|
||||
private String date;
|
||||
private Long timestamp;
|
||||
private String label;
|
||||
private String alias;
|
||||
private String count;
|
||||
private String img;
|
||||
private Map<String, Object> extend;
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.yanzhu.manage.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.manage.domain.DevAiProjectConfig;
|
||||
|
||||
/**
|
||||
* AI设备配置Service接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface IDevAiProjectConfigService
|
||||
{
|
||||
/**
|
||||
* 查询AI设备配置
|
||||
*
|
||||
* @param id AI设备配置主键
|
||||
* @return AI设备配置
|
||||
*/
|
||||
public DevAiProjectConfig selectDevAiProjectConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询AI设备配置列表
|
||||
*
|
||||
* @param devAiProjectConfig AI设备配置
|
||||
* @return AI设备配置集合
|
||||
*/
|
||||
public List<DevAiProjectConfig> selectDevAiProjectConfigList(DevAiProjectConfig devAiProjectConfig);
|
||||
|
||||
/**
|
||||
* 新增AI设备配置
|
||||
*
|
||||
* @param devAiProjectConfig AI设备配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDevAiProjectConfig(DevAiProjectConfig devAiProjectConfig);
|
||||
|
||||
/**
|
||||
* 修改AI设备配置
|
||||
*
|
||||
* @param devAiProjectConfig AI设备配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDevAiProjectConfig(DevAiProjectConfig devAiProjectConfig);
|
||||
|
||||
/**
|
||||
* 批量删除AI设备配置
|
||||
*
|
||||
* @param ids 需要删除的AI设备配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除AI设备配置信息
|
||||
*
|
||||
* @param id AI设备配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 加载配置信息到缓存
|
||||
*/
|
||||
public void loadingConfigsCache();
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package com.yanzhu.manage.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.manage.domain.DevAiProjectData;
|
||||
import com.yanzhu.manage.domain.DevAiProjectDataVO;
|
||||
import com.yanzhu.manage.domain.DevBwAiProjectDataVO;
|
||||
|
||||
/**
|
||||
* AI设备数据Service接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface IDevAiProjectDataService
|
||||
{
|
||||
/**
|
||||
* 查询AI设备数据
|
||||
*
|
||||
* @param id AI设备数据主键
|
||||
* @return AI设备数据
|
||||
*/
|
||||
public DevAiProjectData selectDevAiProjectDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询AI设备数据列表
|
||||
*
|
||||
* @param devAiProjectData AI设备数据
|
||||
* @return AI设备数据集合
|
||||
*/
|
||||
public List<DevAiProjectData> selectDevAiProjectDataList(DevAiProjectData devAiProjectData);
|
||||
|
||||
/**
|
||||
* 新增AI设备数据
|
||||
*
|
||||
* @param devAiProjectData AI设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDevAiProjectData(DevAiProjectData devAiProjectData);
|
||||
|
||||
/**
|
||||
* 新增设备数据
|
||||
*
|
||||
* @param devAiProjectDataVO 设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
public void insertHttpDevAiProjectData(DevAiProjectDataVO devAiProjectDataVO);
|
||||
|
||||
/**
|
||||
* 新增设备数据
|
||||
*
|
||||
* @param devBwAiProjectDataVo 设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
public void insertHttpBwDevAiProjectData(DevBwAiProjectDataVO devBwAiProjectDataVo);
|
||||
|
||||
/**
|
||||
* 修改AI设备数据
|
||||
*
|
||||
* @param devAiProjectData AI设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDevAiProjectData(DevAiProjectData devAiProjectData);
|
||||
|
||||
/**
|
||||
* 批量删除AI设备数据
|
||||
*
|
||||
* @param ids 需要删除的AI设备数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除AI设备数据信息
|
||||
*
|
||||
* @param id AI设备数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectDataById(Long id);
|
||||
}
|
|
@ -71,5 +71,10 @@ public interface IProProjectInfoService
|
|||
*/
|
||||
public void loadingProjectsCache();
|
||||
|
||||
/**
|
||||
* 查询我的项目列表
|
||||
* @param proProjectInfo
|
||||
* @return
|
||||
*/
|
||||
public List<ProProjectInfo> selectMyProjectList(com.yanzhu.manage.domain.ProProjectInfo proProjectInfo);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,153 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.constant.CacheConstants;
|
||||
import com.yanzhu.common.core.enums.IsDelEnums;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.manage.domain.DevAiProjectConfig;
|
||||
import com.yanzhu.manage.domain.ProProjectInfo;
|
||||
import com.yanzhu.manage.mapper.DevAiProjectConfigMapper;
|
||||
import com.yanzhu.manage.service.IDevAiProjectConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AI设备配置Service业务层处理
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@Service
|
||||
public class DevAiProjectConfigServiceImpl implements IDevAiProjectConfigService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private DevAiProjectConfigMapper devAiProjectConfigMapper;
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化参数到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init()
|
||||
{
|
||||
loadingConfigsCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载地址信息到缓存
|
||||
*/
|
||||
@Override
|
||||
public void loadingConfigsCache(){
|
||||
DevAiProjectConfig query = new DevAiProjectConfig();
|
||||
query.setIsDel(IsDelEnums.NO.getCode());
|
||||
List<DevAiProjectConfig> list = devAiProjectConfigMapper.selectDevAiProjectConfigList(query);
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
for(DevAiProjectConfig config:list){
|
||||
redisService.setCacheObject(CacheConstants.DEV_AI_CONFIG+config.getSerialNumber(),config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询AI设备配置
|
||||
*
|
||||
* @param id AI设备配置主键
|
||||
* @return AI设备配置
|
||||
*/
|
||||
@Override
|
||||
public DevAiProjectConfig selectDevAiProjectConfigById(Long id)
|
||||
{
|
||||
return devAiProjectConfigMapper.selectDevAiProjectConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询AI设备配置列表
|
||||
*
|
||||
* @param devAiProjectConfig AI设备配置
|
||||
* @return AI设备配置
|
||||
*/
|
||||
@Override
|
||||
public List<DevAiProjectConfig> selectDevAiProjectConfigList(DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
devAiProjectConfig.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
|
||||
devAiProjectConfig.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId());
|
||||
return devAiProjectConfigMapper.selectDevAiProjectConfigList(devAiProjectConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AI设备配置
|
||||
*
|
||||
* @param devAiProjectConfig AI设备配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDevAiProjectConfig(DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
devAiProjectConfig.setIsDel(IsDelEnums.NO.getCode());
|
||||
devAiProjectConfig.setCreateBy(SecurityUtils.getUsername());
|
||||
devAiProjectConfig.setCreateTime(DateUtils.getNowDate());
|
||||
int res = devAiProjectConfigMapper.insertDevAiProjectConfig(devAiProjectConfig);
|
||||
if(res>0){
|
||||
this.loadingConfigsCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AI设备配置
|
||||
*
|
||||
* @param devAiProjectConfig AI设备配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDevAiProjectConfig(DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
devAiProjectConfig.setUpdateBy(SecurityUtils.getUsername());
|
||||
devAiProjectConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
int res = devAiProjectConfigMapper.updateDevAiProjectConfig(devAiProjectConfig);
|
||||
if(res>0){
|
||||
this.loadingConfigsCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除AI设备配置
|
||||
*
|
||||
* @param ids 需要删除的AI设备配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDevAiProjectConfigByIds(Long[] ids)
|
||||
{
|
||||
int res = devAiProjectConfigMapper.deleteDevAiProjectConfigByIds(ids);
|
||||
if(res>0){
|
||||
this.loadingConfigsCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除AI设备配置信息
|
||||
*
|
||||
* @param id AI设备配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDevAiProjectConfigById(Long id)
|
||||
{
|
||||
int res = devAiProjectConfigMapper.deleteDevAiProjectConfigById(id);
|
||||
if(res>0){
|
||||
this.loadingConfigsCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,282 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.constant.CacheConstants;
|
||||
import com.yanzhu.common.core.enums.IsDelEnums;
|
||||
import com.yanzhu.common.core.exception.ServiceException;
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.file.MultipartFileUtils;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.manage.domain.DevAiProjectConfig;
|
||||
import com.yanzhu.manage.domain.DevAiProjectData;
|
||||
import com.yanzhu.manage.domain.DevAiProjectDataVO;
|
||||
import com.yanzhu.manage.domain.DevBwAiProjectDataVO;
|
||||
import com.yanzhu.manage.mapper.DevAiProjectDataMapper;
|
||||
import com.yanzhu.manage.service.IDevAiProjectDataService;
|
||||
import com.yanzhu.system.api.RemoteFileService;
|
||||
import com.yanzhu.system.api.domain.SysFile;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* AI设备数据Service业务层处理
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@Service
|
||||
public class DevAiProjectDataServiceImpl implements IDevAiProjectDataService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
@Autowired
|
||||
private DevAiProjectDataMapper devAiProjectDataMapper;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("DevAiProjectDataServiceImpl");
|
||||
|
||||
/**
|
||||
* 查询AI设备数据
|
||||
*
|
||||
* @param id AI设备数据主键
|
||||
* @return AI设备数据
|
||||
*/
|
||||
@Override
|
||||
public DevAiProjectData selectDevAiProjectDataById(Long id)
|
||||
{
|
||||
return devAiProjectDataMapper.selectDevAiProjectDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询AI设备数据列表
|
||||
*
|
||||
* @param devAiProjectData AI设备数据
|
||||
* @return AI设备数据
|
||||
*/
|
||||
@Override
|
||||
public List<DevAiProjectData> selectDevAiProjectDataList(DevAiProjectData devAiProjectData)
|
||||
{
|
||||
devAiProjectData.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
|
||||
devAiProjectData.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId());
|
||||
return devAiProjectDataMapper.selectDevAiProjectDataList(devAiProjectData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AI设备数据
|
||||
*
|
||||
* @param devAiProjectData AI设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDevAiProjectData(DevAiProjectData devAiProjectData)
|
||||
{
|
||||
devAiProjectData.setCreateTime(DateUtils.getNowDate());
|
||||
return devAiProjectDataMapper.insertDevAiProjectData(devAiProjectData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备数据
|
||||
*
|
||||
* @param data 设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void insertHttpDevAiProjectData(DevAiProjectDataVO data)
|
||||
{
|
||||
//根据设备配置查询设备绑定的项目和单位信息
|
||||
DevAiProjectConfig config = redisService.getCacheObject(CacheConstants.DEV_AI_CONFIG+data.getSerialNumber());
|
||||
if(Objects.isNull(config)){
|
||||
throw new ServiceException("设备信息未注册...");
|
||||
}
|
||||
logger.info("AiBox消息解析成功!!开始转换实体!!!");
|
||||
DevAiProjectData devAiProjectData = new DevAiProjectData();
|
||||
devAiProjectData.setDeviceId(data.getDeviceId());
|
||||
/** 设备名称 */
|
||||
devAiProjectData.setDeviceName(data.getDeviceName());
|
||||
/** 设备的序列号 */
|
||||
devAiProjectData.setSerialNumber(data.getSerialNumber());
|
||||
/** 相机的序列号 */
|
||||
devAiProjectData.setIpcSerialNum(data.getIPCSerialNum());
|
||||
/** 通道号,用来唯一标识任务 ID */
|
||||
devAiProjectData.setChannelId(data.getChannelId());
|
||||
/** 通道名称 */
|
||||
devAiProjectData.setChannelName(data.getChannelName());
|
||||
/** 报警类型 */
|
||||
devAiProjectData.setAlarmType(data.getAlarmType());
|
||||
/** 告警 ID */
|
||||
devAiProjectData.setAlarmId(data.getAlarmId());
|
||||
/** 左上角 X 坐标 */
|
||||
devAiProjectData.setLeftTopX(data.getLeftTopX());
|
||||
/** 左上角 Y 坐标 */
|
||||
devAiProjectData.setLeftTopY(data.getLeftTopY());
|
||||
/** 右下角 X 坐标 */
|
||||
devAiProjectData.setRightBtmX(data.getRightBtmX());
|
||||
/** 右下角 Y 坐标 */
|
||||
devAiProjectData.setRightBtmY(data.getRightBtmY());
|
||||
/** 当前告警区域人数 */
|
||||
devAiProjectData.setPersonNum(data.getPersonNum());
|
||||
/** 绊线进入人数数量 */
|
||||
devAiProjectData.setInNum(data.getInNum());
|
||||
/** 绊线离开人数数量 */
|
||||
devAiProjectData.setOutNum(data.getOutNum());
|
||||
/** 车牌号 */
|
||||
devAiProjectData.setPlateNo(data.getPlateNo());
|
||||
/** ValueType 为 1 时,代表明火检测;ValueType 为 2 时,代表烟雾检测; */
|
||||
devAiProjectData.setValueType(data.getValueType());
|
||||
/** 告警短视频的地址 */
|
||||
devAiProjectData.setAlarmVideourl(data.getAlarmVideourl());
|
||||
/** 告警短视频的名称 */
|
||||
devAiProjectData.setAlarmVideoName(data.getAlarmVideoName());
|
||||
/** 人脸比对结果 */
|
||||
devAiProjectData.setCompareResult(data.getCompareResult());
|
||||
logger.info("实体转换成功!!Base64开始转换图片!!!");
|
||||
String objImg64 = data.getBigImage().get("Image").toString();
|
||||
try {
|
||||
MultipartFile file = MultipartFileUtils.base64ToMultipartFile("data:image/png;base64,"+objImg64);
|
||||
SysFile sysFile = remoteFileService.upload(file).getData();
|
||||
devAiProjectData.setImageUrl(sysFile.getUrl());
|
||||
logger.info("Base64上传图片成功!!!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
devAiProjectData.setComId(config.getComId());
|
||||
devAiProjectData.setProjectId(config.getProjectId());
|
||||
devAiProjectData.setIsDel(IsDelEnums.NO.getCode());
|
||||
devAiProjectData.setCreateTime(DateUtils.getNowDate());
|
||||
logger.info("新增AI设备数据成功");
|
||||
devAiProjectDataMapper.insertDevAiProjectData(devAiProjectData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备数据
|
||||
*
|
||||
* @param data 设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void insertHttpBwDevAiProjectData(DevBwAiProjectDataVO data){
|
||||
//根据设备配置查询设备绑定的项目和单位信息
|
||||
DevAiProjectConfig config = redisService.getCacheObject(CacheConstants.DEV_AI_CONFIG+data.getDevice_sn());
|
||||
if(Objects.isNull(config)){
|
||||
throw new ServiceException("设备信息未注册...");
|
||||
}
|
||||
Map<String, Object> extendMap = data.getExtend();
|
||||
logger.info("AiBox消息解析成功!!开始转换实体!!!");
|
||||
DevAiProjectData devAiProjectData = new DevAiProjectData();
|
||||
devAiProjectData.setDeviceName(config.getDeviceName());
|
||||
/** 设备的序列号 */
|
||||
devAiProjectData.setSerialNumber(data.getDevice_sn());
|
||||
/** 相机的序列号 */
|
||||
devAiProjectData.setIpcSerialNum(data.getDevice_sn());
|
||||
if(Objects.nonNull(extendMap)){
|
||||
devAiProjectData.setChannelId(Convert.toLong(extendMap.get("ch")));
|
||||
devAiProjectData.setChannelName(Convert.toStr(extendMap.get("source_name")));
|
||||
}
|
||||
/** 报警类型 */
|
||||
String type = this.switchAlarmType(data.getLabel());
|
||||
if(!type.equals("-1")){
|
||||
devAiProjectData.setAlarmType(Convert.toLong(type));
|
||||
logger.info("实体转换成功!!Base64开始转换图片!!!");
|
||||
String objImg64 = data.getImg();
|
||||
try {
|
||||
MultipartFile file = MultipartFileUtils.base64ToMultipartFile("data:image/png;base64,"+objImg64);
|
||||
SysFile sysFile = remoteFileService.upload(file).getData();
|
||||
devAiProjectData.setImageUrl(sysFile.getUrl());
|
||||
logger.info("Base64上传图片成功!!!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
devAiProjectData.setComId(config.getComId());
|
||||
devAiProjectData.setProjectId(config.getProjectId());
|
||||
devAiProjectData.setIsDel(IsDelEnums.NO.getCode());
|
||||
devAiProjectData.setCreateTime(DateUtils.getNowDate());
|
||||
logger.info("新增AI设备数据成功");
|
||||
devAiProjectDataMapper.insertDevAiProjectData(devAiProjectData);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换博瓦预警类型
|
||||
* @return
|
||||
*/
|
||||
private String switchAlarmType(String aliasLabel){
|
||||
String alarmType;
|
||||
switch (aliasLabel){
|
||||
case "nohelmet" : alarmType="4";break;
|
||||
case "head" : alarmType="4";break;
|
||||
case "helmet" : alarmType="4";break;
|
||||
case "fire" : alarmType="8";break;
|
||||
case "vest" : alarmType="65";break;
|
||||
case "smoke" : alarmType="7";break;
|
||||
case "smoking" : alarmType="8";break;
|
||||
case "calling" : alarmType="6";break;
|
||||
case "face" : alarmType="face";break;
|
||||
case "mask" : alarmType="mask";break;
|
||||
case "garbage" : alarmType="garbage";break;
|
||||
case "tricycle" : alarmType="tricycle";break;
|
||||
case "person" : alarmType="person";break;
|
||||
case "clothes" : alarmType="65";break;
|
||||
case "down" : alarmType="62";break;
|
||||
case "phone" : alarmType="6";break;
|
||||
case "body" : alarmType="body";break;
|
||||
case "ponding" : alarmType="ponding";break;
|
||||
case "car" : alarmType="car";break;
|
||||
case "bicycle" : alarmType="bicycle";break;
|
||||
case "motorcycle" : alarmType="motorcycle";break;
|
||||
case "bus" : alarmType="bus";break;
|
||||
case "truck" : alarmType="truck";break;
|
||||
case "van" : alarmType="van";break;
|
||||
default : alarmType="0";
|
||||
}
|
||||
return alarmType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AI设备数据
|
||||
*
|
||||
* @param devAiProjectData AI设备数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDevAiProjectData(DevAiProjectData devAiProjectData)
|
||||
{
|
||||
return devAiProjectDataMapper.updateDevAiProjectData(devAiProjectData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除AI设备数据
|
||||
*
|
||||
* @param ids 需要删除的AI设备数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDevAiProjectDataByIds(Long[] ids)
|
||||
{
|
||||
return devAiProjectDataMapper.deleteDevAiProjectDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除AI设备数据信息
|
||||
*
|
||||
* @param id AI设备数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDevAiProjectDataById(Long id)
|
||||
{
|
||||
return devAiProjectDataMapper.deleteDevAiProjectDataById(id);
|
||||
}
|
||||
}
|
|
@ -354,7 +354,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
GroupQuery.setProjectId(parUsers.getProjectId());
|
||||
GroupQuery.setSubDeptId(parUsers.getSubDeptId());
|
||||
GroupQuery.setGroupCode(DeptGroupEnums.SPECIAL.getCode());
|
||||
List<ProProjectInfoSubdeptsGroup> specialGroups = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupList(query);
|
||||
List<ProProjectInfoSubdeptsGroup> specialGroups = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupList(GroupQuery);
|
||||
|
||||
if(StringUtils.isNotEmpty(specialGroups)){
|
||||
ProProjectInfoSubdeptsGroup specialGroup = specialGroups.get(0);
|
||||
|
@ -651,7 +651,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
GroupQuery.setProjectId(parUsers.getProjectId());
|
||||
GroupQuery.setSubDeptId(parUsers.getSubDeptId());
|
||||
GroupQuery.setGroupCode(DeptGroupEnums.SPECIAL.getCode());
|
||||
List<ProProjectInfoSubdeptsGroup> specialGroups = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupList(query);
|
||||
List<ProProjectInfoSubdeptsGroup> specialGroups = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupList(GroupQuery);
|
||||
|
||||
if(StringUtils.isNotEmpty(specialGroups)){
|
||||
ProProjectInfoSubdeptsGroup specialGroup = specialGroups.get(0);
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询AI设备配置列表
|
||||
export function listDevAiProjectConfig(query) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询AI设备配置详细
|
||||
export function getDevAiProjectConfig(id) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectConfig/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增AI设备配置
|
||||
export function addDevAiProjectConfig(data) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改AI设备配置
|
||||
export function updateDevAiProjectConfig(data) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除AI设备配置
|
||||
export function delDevAiProjectConfig(id) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectConfig/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询AI设备数据列表
|
||||
export function listDevAiProjectData(query) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectData/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询AI设备数据详细
|
||||
export function getDevAiProjectData(id) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectData/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增AI设备数据
|
||||
export function addDevAiProjectData(data) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改AI设备数据
|
||||
export function updateDevAiProjectData(data) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectData',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除AI设备数据
|
||||
export function delDevAiProjectData(id) {
|
||||
return request({
|
||||
url: '/manage/devAiProjectData/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -20,9 +20,7 @@
|
|||
>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="unmatch && showValue">
|
||||
{{ unmatchArray | handleArray }}
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -47,6 +45,10 @@ const props = defineProps({
|
|||
|
||||
const values = computed(() => {
|
||||
if (props.value !== null && typeof props.value !== "undefined") {
|
||||
console.log("sssssssssssss1==>",Array.isArray(props.value))
|
||||
console.log("sssssssssssss2==>",props.value)
|
||||
console.log("sssssssssssss3==>",String(props.value))
|
||||
console.log("sssssssssssss4==>",[String(props.value)])
|
||||
return Array.isArray(props.value) ? props.value : [String(props.value)];
|
||||
} else {
|
||||
return [];
|
||||
|
|
|
@ -0,0 +1,356 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentPrjId">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input
|
||||
v-model="queryParams.deviceName"
|
||||
placeholder="请输入设备名称/序列号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:devAiProjectConfig:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['manage:devAiProjectConfig:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['manage:devAiProjectConfig:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['manage:devAiProjectConfig:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="devAiProjectConfigList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="所属公司" align="center" prop="comName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
<el-table-column label="设备序列号" align="center" prop="serialNumber" />
|
||||
<el-table-column label="厂商名称" align="center" prop="manufacturer" />
|
||||
<el-table-column label="预警类型" align="center" prop="passageType" width="280">
|
||||
<template #default="scope">
|
||||
<div class="flex gap-2">
|
||||
<dict-tag :options="aibox_alarm_type" :value="scope.row.passageType" :showValue="false"/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" align="center" prop="isDel" width="100">
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="scope.row.isDel == 0 ? '启用' : '停用'" placement="top">
|
||||
<el-switch
|
||||
:active-value="parseInt(0)"
|
||||
:inactive-value="parseInt(1)"
|
||||
v-model="scope.row.isDel"
|
||||
@change="setStatus($event, scope.row)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="配置时间" align="center" prop="createTime" width="150">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:devAiProjectConfig:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:devAiProjectConfig:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改AI设备配置对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||
<el-form ref="devAiProjectConfigRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="项目名称" v-if="form.projectId">
|
||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="serialNumber">
|
||||
<el-input v-model="form.serialNumber" placeholder="请输入设备序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂商名称" prop="manufacturer">
|
||||
<el-input v-model="form.manufacturer" placeholder="请输入厂商名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预警类型" prop="passageType">
|
||||
<el-select v-model="form.passageType" multiple placeholder="请选择预警类型" style="width:100%">
|
||||
<el-option
|
||||
v-for="dict in aibox_alarm_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DevAiProjectConfig">
|
||||
import { listDevAiProjectConfig, getDevAiProjectConfig, delDevAiProjectConfig, addDevAiProjectConfig, updateDevAiProjectConfig } from "@/api/manage/devAiProjectConfig";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { aibox_alarm_type } = proxy.useDict('aibox_alarm_type');
|
||||
|
||||
const userStore = useUserStore()
|
||||
const devAiProjectConfigList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceName: null,
|
||||
serialNumber: null,
|
||||
manufacturer: null,
|
||||
passageType: null,
|
||||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
deviceName: [
|
||||
{ required: true, message: "设备名称不能为空", trigger: "blur" },
|
||||
],
|
||||
serialNumber: [
|
||||
{ required: true, message: "设备序列号不能为空", trigger: "blur" },
|
||||
],
|
||||
厂商名称: [
|
||||
{ required: true, message: "厂商名称不能为空", trigger: "blur" },
|
||||
],
|
||||
passageType: [{ required: true, message: "预警类型不能为空", trigger: "change" }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询AI设备配置列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listDevAiProjectConfig(queryParams.value).then(response => {
|
||||
response.rows.forEach(row => {
|
||||
if(row.passageType){
|
||||
row.passageType = row.passageType.split(',');
|
||||
}
|
||||
})
|
||||
devAiProjectConfigList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceName: null,
|
||||
serialNumber: null,
|
||||
manufacturer: null,
|
||||
passageType: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
proxy.resetForm("devAiProjectConfigRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
if(!userStore.currentPrjId){
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
return false;
|
||||
}
|
||||
reset();
|
||||
form.value.comId = userStore.currentComId;
|
||||
form.value.projectId = userStore.currentPrjId;
|
||||
form.value.projectName = userStore.currentProName;
|
||||
open.value = true;
|
||||
title.value = "添加AI设备配置";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getDevAiProjectConfig(_id).then(response => {
|
||||
if(response.data.passageType){
|
||||
response.data.passageType = response.data.passageType.split(',');
|
||||
}
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改AI设备配置";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["devAiProjectConfigRef"].validate(valid => {
|
||||
if (valid) {
|
||||
form.value.passageType = form.value.passageType.toString();
|
||||
if (form.value.id != null) {
|
||||
updateDevAiProjectConfig(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addDevAiProjectConfig(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除AI设备配置编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delDevAiProjectConfig(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 启用状态滑块控制 */
|
||||
function setStatus(val, row) {
|
||||
proxy.$modal
|
||||
.confirm(`是否确认${val == 0 ? "启用" : "停用"}当前数据项?`)
|
||||
.then(function () {
|
||||
let param = {'id': row.id, 'isDel': val};
|
||||
return updateDevAiProjectConfig(param);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
})
|
||||
.catch(() => {
|
||||
// 取消时恢复原始开关状态
|
||||
if (val == 0) {
|
||||
row.isDel = 1;
|
||||
} else {
|
||||
row.isDel = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/devAiProjectConfig/export', {
|
||||
...queryParams.value
|
||||
}, `devAiProjectConfig_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.gap-2{
|
||||
.el-tag--default{
|
||||
margin:2px 3px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,392 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentPrjId">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input
|
||||
v-model="queryParams.deviceName"
|
||||
placeholder="请输入设备名称/序列号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上报时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="daterangeTimes"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row v-if="false" :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:devAiProjectData:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['manage:devAiProjectData:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['manage:devAiProjectData:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['manage:devAiProjectData:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="devAiProjectDataList">
|
||||
<el-table-column label="所属公司" align="center" prop="comName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
<el-table-column label="设备的序列号" align="center" prop="serialNumber" />
|
||||
<el-table-column label="报警图片" align="center" prop="imageUrl" width="230">
|
||||
<template #default="scope">
|
||||
<image-preview v-if="scope.row.imageUrl" :src="scope.row.imageUrl" :width="200" :height="100" />
|
||||
<span v-if="!scope.row.imageUrl"> - </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报警类型" align="center" prop="alarmType" >
|
||||
<template #default="scope">
|
||||
<div class="flex gap-2">
|
||||
<dict-tag :options="aibox_alarm_type" :value="scope.row.alarmType"/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="通道名称" align="center" prop="channelName" />
|
||||
<el-table-column label="数据状态" align="center" prop="isDel" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_is_del" :value="scope.row.isDel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上报时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button v-if="false" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:devAiProjectData:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:devAiProjectData:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改AI设备数据对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="devAiProjectDataRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="公司主键" prop="comId">
|
||||
<el-input v-model="form.comId" placeholder="请输入公司主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目主键" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备ID" prop="deviceId">
|
||||
<el-input v-model="form.deviceId" placeholder="请输入设备ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备的序列号" prop="serialNumber">
|
||||
<el-input v-model="form.serialNumber" placeholder="请输入设备的序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="相机的序列号" prop="ipcSerialNum">
|
||||
<el-input v-model="form.ipcSerialNum" placeholder="请输入相机的序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="行为分析图片地址" prop="imageUrl">
|
||||
<el-input v-model="form.imageUrl" placeholder="请输入行为分析图片地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通道号,用来唯一标识任务 ID" prop="channelId">
|
||||
<el-input v-model="form.channelId" placeholder="请输入通道号,用来唯一标识任务 ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通道名称" prop="channelName">
|
||||
<el-input v-model="form.channelName" placeholder="请输入通道名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="告警 ID" prop="alarmId">
|
||||
<el-input v-model="form.alarmId" placeholder="请输入告警 ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上报间隔" prop="reportRate">
|
||||
<el-input v-model="form.reportRate" placeholder="请输入上报间隔" />
|
||||
</el-form-item>
|
||||
<el-form-item label="采集时间" prop="timestamp">
|
||||
<el-date-picker clearable
|
||||
v-model="form.timestamp"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择采集时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="左上角 X 坐标" prop="leftTopX">
|
||||
<el-input v-model="form.leftTopX" placeholder="请输入左上角 X 坐标" />
|
||||
</el-form-item>
|
||||
<el-form-item label="左上角 Y 坐标" prop="leftTopY">
|
||||
<el-input v-model="form.leftTopY" placeholder="请输入左上角 Y 坐标" />
|
||||
</el-form-item>
|
||||
<el-form-item label="右下角 X 坐标" prop="rightBtmX">
|
||||
<el-input v-model="form.rightBtmX" placeholder="请输入右下角 X 坐标" />
|
||||
</el-form-item>
|
||||
<el-form-item label="右下角 Y 坐标" prop="rightBtmY">
|
||||
<el-input v-model="form.rightBtmY" placeholder="请输入右下角 Y 坐标" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前告警区域人数" prop="personNum">
|
||||
<el-input v-model="form.personNum" placeholder="请输入当前告警区域人数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="绊线进入人数数量" prop="inNum">
|
||||
<el-input v-model="form.inNum" placeholder="请输入绊线进入人数数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="绊线离开人数数量" prop="outNum">
|
||||
<el-input v-model="form.outNum" placeholder="请输入绊线离开人数数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌号" prop="plateNo">
|
||||
<el-input v-model="form.plateNo" placeholder="请输入车牌号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="告警短视频的地址" prop="alarmVideourl">
|
||||
<el-input v-model="form.alarmVideourl" placeholder="请输入告警短视频的地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="告警短视频的名称" prop="alarmVideoName">
|
||||
<el-input v-model="form.alarmVideoName" placeholder="请输入告警短视频的名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="人脸比对结果" prop="compareResult">
|
||||
<el-input v-model="form.compareResult" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据状态" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入数据状态" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DevAiProjectData">
|
||||
import { listDevAiProjectData, getDevAiProjectData, delDevAiProjectData, addDevAiProjectData, updateDevAiProjectData } from "@/api/manage/devAiProjectData";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { aibox_alarm_type, sys_is_del } = proxy.useDict('aibox_alarm_type', 'sys_is_del');
|
||||
|
||||
const userStore = useUserStore()
|
||||
const devAiProjectDataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const daterangeTimes = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceId: null,
|
||||
deviceName: null,
|
||||
channelName: null,
|
||||
alarmType: null,
|
||||
isDel: null
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询AI设备数据列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.params = {};
|
||||
if (null != daterangeTimes && '' != daterangeTimes) {
|
||||
queryParams.value.params["beginTime"] = daterangeTimes.value[0];
|
||||
queryParams.value.params["endTime"] = daterangeTimes.value[1];
|
||||
}
|
||||
listDevAiProjectData(queryParams.value).then(response => {
|
||||
devAiProjectDataList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceId: null,
|
||||
deviceName: null,
|
||||
serialNumber: null,
|
||||
ipcSerialNum: null,
|
||||
imageUrl: null,
|
||||
channelId: null,
|
||||
channelName: null,
|
||||
alarmType: null,
|
||||
alarmId: null,
|
||||
leftTopX: null,
|
||||
leftTopY: null,
|
||||
rightBtmX: null,
|
||||
rightBtmY: null,
|
||||
personNum: null,
|
||||
inNum: null,
|
||||
outNum: null,
|
||||
plateNo: null,
|
||||
valueType: null,
|
||||
alarmVideourl: null,
|
||||
alarmVideoName: null,
|
||||
compareResult: null,
|
||||
createTime: null,
|
||||
isDel: null
|
||||
};
|
||||
proxy.resetForm("devAiProjectDataRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
daterangeTimes.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加AI设备数据";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getDevAiProjectData(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改AI设备数据";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["devAiProjectDataRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateDevAiProjectData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addDevAiProjectData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除AI设备数据编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delDevAiProjectData(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/devAiProjectData/export', {
|
||||
...queryParams.value
|
||||
}, `devAiProjectData_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.gap-2{
|
||||
.el-tag--default{
|
||||
margin:2px 3px;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue