保存进度!
This commit is contained in:
		@@ -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")
 | 
			
		||||
 
 | 
			
		||||
@@ -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,21 +172,22 @@ public class sendMessage
 | 
			
		||||
     * 保存的数据用来判断预警是否已经推送过,以防止反复推送数据。
 | 
			
		||||
     *
 | 
			
		||||
     * @param city     城市名称
 | 
			
		||||
     * @param warnings 预警数据,为 QWeatherDisasterWarningItem 对象。
 | 
			
		||||
     * @param warning 预警数据,为 QWeatherDisasterWarningItem 对象。
 | 
			
		||||
     * @throws SQLException           执行sql时可能抛出的异常。出现sql异常,就回滚事务。
 | 
			
		||||
     * @throws IOException            读取数据库配置文件时可能抛出的异常。
 | 
			
		||||
     * @throws ClassNotFoundException 加载oracle jdbc驱动时可能抛出的异常。
 | 
			
		||||
     */
 | 
			
		||||
    public static void saveWeatherDisasterWarning( String city,
 | 
			
		||||
            QWeatherDisasterWarningItem warning )
 | 
			
		||||
                                                   QWeatherDisasterWarningItem warning )
 | 
			
		||||
            throws SQLException, IOException, ClassNotFoundException
 | 
			
		||||
    {
 | 
			
		||||
        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
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user