|
@@ -33,7 +33,7 @@ public class MySqlUtil {
|
|
public static String mysql_driver = "com.mysql.cj.jdbc.Driver";
|
|
public static String mysql_driver = "com.mysql.cj.jdbc.Driver";
|
|
// 采集数据,结构:遥测最低,遥测最高;电度最低,电度最高
|
|
// 采集数据,结构:遥测最低,遥测最高;电度最低,电度最高
|
|
public static String remote_config = "REMOTE_CONFIG";
|
|
public static String remote_config = "REMOTE_CONFIG";
|
|
- public static int remote_config_measure_min = 16400;
|
|
|
|
|
|
+ public static int remote_config_measure_min = 16385;
|
|
public static int remote_config_measure_max = 18101;
|
|
public static int remote_config_measure_max = 18101;
|
|
public static int remote_config_degree_min = 25601;
|
|
public static int remote_config_degree_min = 25601;
|
|
public static int remote_config_degree_max = 25712;
|
|
public static int remote_config_degree_max = 25712;
|
|
@@ -113,8 +113,9 @@ public class MySqlUtil {
|
|
String updateSql = "";
|
|
String updateSql = "";
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
MessageInfo messageInfo = list.get(i);
|
|
MessageInfo messageInfo = list.get(i);
|
|
- updateSql = "update t_remote_measure set result='" + ByteUtil.byteArrayToHexString(messageInfo.getMessageInfos()) +
|
|
|
|
|
|
+ updateSql = "update t_remote_measure set result='" + ByteUtil.byteArrayToShort(messageInfo.getMessageInfos()) +
|
|
"', update_time='" + DateUtils.dateToString(time, DateUtils.PATTERN_YMD_HMS) +
|
|
"', update_time='" + DateUtils.dateToString(time, DateUtils.PATTERN_YMD_HMS) +
|
|
|
|
+ "', info='" + JSON.toJSONString(messageInfo) +
|
|
"' where position_num = " + messageInfo.getMessageAddress();
|
|
"' where position_num = " + messageInfo.getMessageAddress();
|
|
stmt.addBatch(updateSql);
|
|
stmt.addBatch(updateSql);
|
|
}
|
|
}
|
|
@@ -160,7 +161,7 @@ public class MySqlUtil {
|
|
public static void addBatch(List<MessageInfo> list, LocalDateTime time, Integer year, Integer month, Integer day, Integer hour, Integer minute) {
|
|
public static void addBatch(List<MessageInfo> list, LocalDateTime time, Integer year, Integer month, Integer day, Integer hour, Integer minute) {
|
|
PreparedStatement ps = null;
|
|
PreparedStatement ps = null;
|
|
try {
|
|
try {
|
|
- String sql = "insert into t_remote_degree_log (id,position_num,year,month,day,hour,minute,result,remark,created_time,created_user_id) values (?,?,?,?,?,?,?,?,?,?,?)";
|
|
|
|
|
|
+ String sql = "insert into t_remote_degree_log (id,position_num,year,month,day,hour,minute,result,info,created_time,created_user_id) values (?,?,?,?,?,?,?,?,?,?,?)";
|
|
conn = getConnection();
|
|
conn = getConnection();
|
|
ps = conn.prepareStatement(sql);
|
|
ps = conn.prepareStatement(sql);
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
@@ -172,7 +173,7 @@ public class MySqlUtil {
|
|
ps.setObject(5, day);
|
|
ps.setObject(5, day);
|
|
ps.setObject(6, hour);
|
|
ps.setObject(6, hour);
|
|
ps.setObject(7, minute);
|
|
ps.setObject(7, minute);
|
|
- ps.setObject(8, ByteUtil.byteArrayToHexString(messageInfo.getMessageInfos()));
|
|
|
|
|
|
+ ps.setObject(8, ByteUtil.byteArrayToInt(messageInfo.getMessageInfos()) + "");
|
|
ps.setObject(9, JSON.toJSONString(messageInfo));
|
|
ps.setObject(9, JSON.toJSONString(messageInfo));
|
|
ps.setObject(10, DateUtils.dateToString(time, DateUtils.PATTERN_YMD_HMS));
|
|
ps.setObject(10, DateUtils.dateToString(time, DateUtils.PATTERN_YMD_HMS));
|
|
ps.setObject(11, "1");
|
|
ps.setObject(11, "1");
|