增加告警分类修改 优化告警列表查询 优化主动拍照
parent
e2fb29ed11
commit
d03730cf7a
@ -0,0 +1,55 @@
|
|||||||
|
package com.shxy.xymanager_admin.test;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.mysql.cj.xdevapi.JsonArray;
|
||||||
|
|
||||||
|
import java.sql.*;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Testbatch {
|
||||||
|
|
||||||
|
private static Connection con;
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
String driver = "com.mysql.jdbc.Driver";
|
||||||
|
//这里我的数据库是cgjr
|
||||||
|
String url = "jdbc:mysql://47.96.238.157:3306/xymp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
|
||||||
|
String user = "xymp";
|
||||||
|
String password = "Xymp@2023";
|
||||||
|
try {
|
||||||
|
Class.forName(driver);
|
||||||
|
con = DriverManager.getConnection(url, user, password);
|
||||||
|
if (!con.isClosed()) {
|
||||||
|
System.out.println("数据库连接成功");
|
||||||
|
}
|
||||||
|
String sql = "insert into terminal_img_alarms (term_id,channel_id,preset_id,photo_org_id,alarm_time,alarm_info,create_time) values(?,?,?,?,?,?,?)";
|
||||||
|
|
||||||
|
PreparedStatement preparedStatement = con.prepareStatement(sql);
|
||||||
|
Date date = new Date(1686118807);
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
preparedStatement.setInt(1, 10002);
|
||||||
|
preparedStatement.setInt(2, 1);
|
||||||
|
preparedStatement.setInt(3, 255);
|
||||||
|
preparedStatement.setLong(4, 1962967140);
|
||||||
|
preparedStatement.setLong(5, 1686118807);
|
||||||
|
preparedStatement.setString(6, "{info}");
|
||||||
|
preparedStatement.setDate(7, date);
|
||||||
|
preparedStatement.addBatch();
|
||||||
|
}
|
||||||
|
preparedStatement.executeBatch();
|
||||||
|
con.commit();
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
System.out.println("数据库驱动没有安装");
|
||||||
|
} catch (SQLException e) {
|
||||||
|
System.out.println("数据库连接失败");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
con.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1 +1 @@
|
|||||||
org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor
|
#org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.shxy.xymanager_common.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "装置编号和通道编号对象", description = "装置编号和通道编号对象")
|
||||||
|
public class TermIdAndChannelIdVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "装置编号", example = "123455")
|
||||||
|
private Integer termId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "通道编号", example = "123455")
|
||||||
|
private Integer channelId;
|
||||||
|
|
||||||
|
@Min(value = 1, message = "分页位置最小从1开始")
|
||||||
|
@ApiModelProperty(value = "分页位置从1开始", required = true, example = "1")
|
||||||
|
private int pageindex;
|
||||||
|
|
||||||
|
@Min(value = 1, message = "分页大小最小为1")
|
||||||
|
@ApiModelProperty(value = "分页大小", required = true, example = "1")
|
||||||
|
private int pagesize;
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.shxy.xymanager_common.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "修改告警类型", description = "修改告警类型信息")
|
||||||
|
public class UpdateTerminalAlarmParamsVo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改告警类型列表", example = "[]")
|
||||||
|
private List<AlarmParamBean> list;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class AlarmParamBean {
|
||||||
|
@ApiModelProperty(value = "编号", example = "123456")
|
||||||
|
private Integer id;
|
||||||
|
@ApiModelProperty(value = "告警编号", example = "123456")
|
||||||
|
private Integer label;
|
||||||
|
@ApiModelProperty(value = "告警名称", example = "123456")
|
||||||
|
private String name;
|
||||||
|
@ApiModelProperty(value = "可信度", example = "123456")
|
||||||
|
private Float prob;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue