Compare commits
3 Commits
bf0996d750
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f064c2e3e | ||
| 98c2aeaa9b | |||
| 98042b237c |
@@ -19,8 +19,9 @@
|
||||
<div class="card" @click="handleVideoCameraFilled(item)" v-for="item in deviceList" :key="item.deviceId">
|
||||
<el-row>
|
||||
<el-col :span="16">
|
||||
<h3 style="display: flex; align-items: center;"><img :src="DeviceImage" alt="" style="width: 20px; height: 20px; margin-right: 10px;"> {{ item.ip }}</h3>
|
||||
<h3 style="display: flex; align-items: center;"><img :src="DeviceImage" alt="" style="width: 20px; height: 20px; margin-right: 10px;"> {{ item.deviceName }}</h3>
|
||||
<div class="li" style="display: flex; align-items: center;">设备分类:<dict-tag :options="device_type" :value="item.type" /></div>
|
||||
<div class="li" style="display: flex; align-items: center;">设备IP:{{ item.ip }}</div>
|
||||
<div class="li" style="display: flex; align-items: center;">用户名:{{ item.username ?? '-' }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="设备ID" align="center" prop="deviceId" />-->
|
||||
<el-table-column label="IP地址" align="center" prop="ip" width="150" fixed />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" width="150" />
|
||||
<el-table-column label="设备类型" align="center" prop="type" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="device_type" :value="scope.row.type"/>
|
||||
@@ -103,6 +104,9 @@
|
||||
<el-form-item label="IP地址" prop="ip">
|
||||
<el-input v-model="form.ip" placeholder="请输入IP地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称">
|
||||
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择设备类型">
|
||||
<el-option
|
||||
@@ -218,6 +222,7 @@ function reset() {
|
||||
form.value = {
|
||||
deviceId: null,
|
||||
ip: null,
|
||||
deviceName: null,
|
||||
type: null,
|
||||
userName: null,
|
||||
password: null,
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务名称" align="center" prop="taskName" />
|
||||
<el-table-column label="设备IP" align="center" prop="deviceIp" />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
<el-table-column label="Cron表达式" align="center" prop="cronExpression" />
|
||||
<el-table-column label="巡检时长(秒)" align="center" prop="duration" />
|
||||
|
||||
@@ -14,6 +14,8 @@ public class Device extends BaseEntity {
|
||||
private Long deviceId;
|
||||
@Excel(name = "IP地址")
|
||||
private String ip;
|
||||
@Excel(name = "设备名称")
|
||||
private String deviceName;
|
||||
@Excel(
|
||||
name = "设备类型(1=haikan,2=dahua)"
|
||||
)
|
||||
@@ -51,7 +53,7 @@ public class Device extends BaseEntity {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Device{deviceId=" + this.deviceId + ", ip='" + this.ip + "', type='" + this.type + "', mediaKey='" + this.mediaKey + "', userName='" + this.userName + "', password='" + this.password + "', url='" + this.url + "', enabledFlv='" + this.enabledFlv + "', enabledHls='" + this.enabledHls + "', mode='" + this.mode + "'}";
|
||||
return "Device{deviceId=" + this.deviceId + ", deviceName='" + this.deviceName + "', ip='" + this.ip + "', type='" + this.type + "', mediaKey='" + this.mediaKey + "', userName='" + this.userName + "', password='" + this.password + "', url='" + this.url + "', enabledFlv='" + this.enabledFlv + "', enabledHls='" + this.enabledHls + "', mode='" + this.mode + "'}";
|
||||
}
|
||||
|
||||
public Long getDeviceId() {
|
||||
@@ -62,6 +64,14 @@ public class Device extends BaseEntity {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceName() {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return this.ip;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.Date;
|
||||
|
||||
/**
|
||||
* 巡检任务对象 v_inspection_task
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-27
|
||||
*/
|
||||
@@ -22,9 +22,12 @@ public class InspectionTask extends BaseEntity {
|
||||
/** 设备ID */
|
||||
private Long deviceId;
|
||||
|
||||
/** 设备名称 */
|
||||
/** 设备名称(联查返回) */
|
||||
private String deviceName;
|
||||
|
||||
/** 设备IP(联查返回) */
|
||||
private String deviceIp;
|
||||
|
||||
/** Cron表达式 */
|
||||
private String cronExpression;
|
||||
|
||||
@@ -57,11 +60,11 @@ public class InspectionTask extends BaseEntity {
|
||||
public void setModelName(String modelName) {
|
||||
this.modelName = modelName;
|
||||
}
|
||||
|
||||
public String getModelName() {
|
||||
return modelName;
|
||||
}
|
||||
|
||||
|
||||
public void setTaskId(Long taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
@@ -94,6 +97,14 @@ public class InspectionTask extends BaseEntity {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public String getDeviceIp() {
|
||||
return deviceIp;
|
||||
}
|
||||
|
||||
public void setDeviceIp(String deviceIp) {
|
||||
this.deviceIp = deviceIp;
|
||||
}
|
||||
|
||||
public void setCronExpression(String cronExpression) {
|
||||
this.cronExpression = cronExpression;
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ public class InspectionTaskServiceImpl implements InspectionTaskService {
|
||||
inspectionTask.setAlarmCount(0L);
|
||||
|
||||
// 获取设备信息
|
||||
Device device = deviceService.selectDeviceByDeviceId(inspectionTask.getDeviceId());
|
||||
|
||||
if (device != null) {
|
||||
inspectionTask.setDeviceName(device.getIp());
|
||||
}
|
||||
// Device device = deviceService.selectDeviceByDeviceId(inspectionTask.getDeviceId());
|
||||
//
|
||||
// if (device != null) {
|
||||
// inspectionTask.setDeviceName(device.getIp());
|
||||
// }
|
||||
|
||||
return inspectionTaskMapper.insertInspectionTask(inspectionTask);
|
||||
}
|
||||
@@ -457,7 +457,7 @@ public class InspectionTaskServiceImpl implements InspectionTaskService {
|
||||
alarm.setTaskId(task.getTaskId());
|
||||
alarm.setTaskName(task.getTaskName());
|
||||
alarm.setDeviceId(task.getDeviceId());
|
||||
alarm.setDeviceName(task.getDeviceName());
|
||||
// alarm.setDeviceName(task.getDeviceName());
|
||||
alarm.setAlarmType(best.getLabel());
|
||||
// 这里需要转换double为float
|
||||
alarm.setAlarmLevel(getAlarmLevel((float)best.getConfidence()));
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
<resultMap type="Device" id="DeviceResult">
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="ip" column="ip" />
|
||||
<result property="type" column="type" />
|
||||
<result property="userName" column="user_name" />
|
||||
@@ -23,12 +24,13 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeviceVo">
|
||||
select device_id, ip, type, user_name, password, url, mediaKey, enabledFlv, enabledHls, mode, create_by, create_time, update_by, update_time, remark from v_device
|
||||
select device_id, device_name, ip, type, user_name, password, url, mediaKey, enabledFlv, enabledHls, mode, create_by, create_time, update_by, update_time, remark from v_device
|
||||
</sql>
|
||||
|
||||
<select id="selectDeviceList" parameterType="Device" resultMap="DeviceResult">
|
||||
<include refid="selectDeviceVo"/>
|
||||
<where>
|
||||
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="ip != null and ip != ''"> and ip = #{ip}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
@@ -49,6 +51,7 @@
|
||||
<insert id="insertDevice" parameterType="Device" useGeneratedKeys="true" keyProperty="deviceId">
|
||||
insert into v_device
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">device_name,</if>
|
||||
<if test="ip != null and ip != ''">ip,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
@@ -65,6 +68,7 @@
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
<if test="ip != null and ip != ''">#{ip},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
@@ -85,6 +89,7 @@
|
||||
<update id="updateDevice" parameterType="Device">
|
||||
update v_device
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
|
||||
<if test="ip != null and ip != ''">ip = #{ip},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="deviceIp" column="device_ip" />
|
||||
<result property="cronExpression" column="cron_expression" />
|
||||
<result property="duration" column="duration" />
|
||||
<result property="threshold" column="threshold" />
|
||||
@@ -26,10 +27,15 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInspectionTaskVo">
|
||||
select task_id, task_name, device_id, device_name, cron_expression, duration,
|
||||
threshold, enable_detection, status, execute_count, alarm_count,
|
||||
last_execute_time, model_name, remark, create_by, create_time, update_by, update_time
|
||||
from v_inspection_task
|
||||
select
|
||||
t.task_id, t.task_name, t.device_id,
|
||||
t.cron_expression, t.duration,
|
||||
t.threshold, t.enable_detection, t.status, t.execute_count, t.alarm_count,
|
||||
t.last_execute_time, t.model_name, t.remark, t.create_by, t.create_time, t.update_by, t.update_time,
|
||||
d.device_name as device_name,
|
||||
d.ip as device_ip
|
||||
from v_inspection_task t
|
||||
left join v_device d on t.device_id = d.device_id
|
||||
</sql>
|
||||
|
||||
<select id="selectInspectionTaskList" parameterType="InspectionTask" resultMap="InspectionTaskResult">
|
||||
@@ -37,7 +43,7 @@
|
||||
<where>
|
||||
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="deviceId != null"> and device_id = #{deviceId}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and d.device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="enableDetection != null and enableDetection != ''"> and enable_detection = #{enableDetection}</if>
|
||||
<if test="modelName != null and modelName != ''"> and model_name = #{modelName}</if>
|
||||
@@ -61,7 +67,6 @@
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">task_name,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="deviceName != null">device_name,</if>
|
||||
<if test="cronExpression != null and cronExpression != ''">cron_expression,</if>
|
||||
<if test="duration != null">duration,</if>
|
||||
<if test="threshold != null">threshold,</if>
|
||||
@@ -78,7 +83,6 @@
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">#{taskName},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="deviceName != null">#{deviceName},</if>
|
||||
<if test="cronExpression != null and cronExpression != ''">#{cronExpression},</if>
|
||||
<if test="duration != null">#{duration},</if>
|
||||
<if test="threshold != null">#{threshold},</if>
|
||||
@@ -99,7 +103,6 @@
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||||
<if test="cronExpression != null and cronExpression != ''">cron_expression = #{cronExpression},</if>
|
||||
<if test="duration != null">duration = #{duration},</if>
|
||||
<if test="threshold != null">threshold = #{threshold},</if>
|
||||
|
||||
Reference in New Issue
Block a user