保存进度!

This commit is contained in:
Kane Wang 2022-05-17 10:39:53 +08:00
parent 4c0cb3c76e
commit db8f9e9c05
2 changed files with 8 additions and 10 deletions

View File

@ -74,7 +74,7 @@ public class QWeatherDisasterWarning
private String code;
@JsonProperty( "updateTime")
@JsonFormat( pattern = "yyyy-MM-dd\'T\'HH:mmXXX")
@JsonFormat( pattern = "yyyy-MM-dd'T'HH:mmXXX")
private Date updateTime;
@JsonProperty( "fxLink")

View File

@ -62,7 +62,7 @@ public class sendMessage
// 拼接消息内容
String title = warningItem.getTitle();
String text = warningItem.getText();
String color = warningLevel.keySet().contains( warningItem.getLevel() )
String color = warningLevel.containsKey( warningItem.getLevel() )
? warningLevel.get( warningItem.getLevel() )
: "#000000";
requestBody = new StringBuilder();
@ -97,7 +97,6 @@ public class sendMessage
boolean result = false;
OracleConfig dbConfig = OracleConfigManager.getOracleConfig();
;
Connection conn = null;
PreparedStatement stmt = null;
@ -173,7 +172,7 @@ public class sendMessage
* 保存的数据用来判断预警是否已经推送过以防止反复推送数据
*
* @param city 城市名称
* @param warnings 预警数据 QWeatherDisasterWarningItem 对象
* @param warning 预警数据 QWeatherDisasterWarningItem 对象
* @throws SQLException 执行sql时可能抛出的异常出现sql异常就回滚事务
* @throws IOException 读取数据库配置文件时可能抛出的异常
* @throws ClassNotFoundException 加载oracle jdbc驱动时可能抛出的异常
@ -185,9 +184,10 @@ public class sendMessage
Connection conn = null;
PreparedStatement stmt = null;
String sql = "insert into weather_disaster_notify(notify_id, sender, city,"
+ "warning_level, warning_type_code, warning_type_name, title,"
+ "text, pub_time) values( ?,?,?,?,?,?,?,?,?)";
String sql = new StringBuilder().append( "insert into weather_disaster_notify(notify_id, sender, city," )
.append( "warning_level, warning_type_code, warning_type_name, title," )
.append( "text, pub_time) values( ?,?,?,?,?,?,?,?,?)" )
.toString();
OracleConfig dbConfig = OracleConfigManager.getOracleConfig();
@ -259,7 +259,6 @@ public class sendMessage
}
}
static
{
// 预警级别色彩
@ -272,7 +271,6 @@ public class sendMessage
}
}
class WechatOfficalAccountMessageParameter
{