xxx
This commit is contained in:
parent
c988bf4c91
commit
cba061e177
@ -2,7 +2,7 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2022-04-22 10:53:49
|
* @Date: 2022-04-22 10:53:49
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2022-05-12 09:51:13
|
* @LastEditTime: 2022-12-16 15:51:36
|
||||||
* @FilePath: \DisasterWarning\src\main\java\com\cpic\xim\wechat\officalAccount\sendMessage.java
|
* @FilePath: \DisasterWarning\src\main\java\com\cpic\xim\wechat\officalAccount\sendMessage.java
|
||||||
* @Description: 用来推送公众号消息的程序库。
|
* @Description: 用来推送公众号消息的程序库。
|
||||||
*
|
*
|
||||||
@ -37,13 +37,13 @@ public class sendMessage
|
|||||||
{
|
{
|
||||||
private static HashMap<String, String> warningLevel;
|
private static HashMap<String, String> warningLevel;
|
||||||
|
|
||||||
/**
|
/*****************************************************
|
||||||
* 推送天气灾害预警!接口文档参考 彭奕洁 编写《消息发送接口调用文档》
|
* 推送天气灾害预警!接口文档参考 彭奕洁 编写《消息发送接口调用文档》
|
||||||
* 使用 post 方式,请求体内容以最基础的 post 格式。
|
* 使用 post 方式,请求体内容以最基础的 post 格式。
|
||||||
*
|
*
|
||||||
* @param officalAccountURL 产险厦门分公司公众号接口网址
|
* @param officalAccountURL 产险厦门分公司公众号接口网址
|
||||||
* @param warningItem 灾害预警对象
|
* @param warningItem 灾害预警对象
|
||||||
*/
|
*****************************************************/
|
||||||
public static void sendWeatherDisasterWarning( String officalAccountURL,
|
public static void sendWeatherDisasterWarning( String officalAccountURL,
|
||||||
QWeatherDisasterWarningItem warningItem )
|
QWeatherDisasterWarningItem warningItem )
|
||||||
{
|
{
|
||||||
@ -119,7 +119,7 @@ public class sendMessage
|
|||||||
|
|
||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
|
|
||||||
if ( rs.next() && rs.getInt( 1 ) == 0 )
|
if ( rs.next() && rs.getInt( 1 ) == 0)
|
||||||
{
|
{
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ public class sendMessage
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( rs != null )
|
if ( rs != null)
|
||||||
{
|
{
|
||||||
rs.close();
|
rs.close();
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ public class sendMessage
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( stmt != null )
|
if ( stmt != null)
|
||||||
{
|
{
|
||||||
stmt.close();
|
stmt.close();
|
||||||
}
|
}
|
||||||
@ -152,7 +152,7 @@ public class sendMessage
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( conn != null )
|
if ( conn != null)
|
||||||
{
|
{
|
||||||
conn.close();
|
conn.close();
|
||||||
}
|
}
|
||||||
@ -184,10 +184,10 @@ public class sendMessage
|
|||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement stmt = null;
|
PreparedStatement stmt = null;
|
||||||
|
|
||||||
String sql = new StringBuilder().append( "insert into weather_disaster_notify(notify_id, sender, city," )
|
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( "warning_level, warning_type_code, warning_type_name, title," )
|
||||||
.append( "text, pub_time) values( ?,?,?,?,?,?,?,?,?)" )
|
.append( "text, pub_time) values( ?,?,?,?,?,?,?,?,?)" ).toString();
|
||||||
.toString();
|
|
||||||
|
|
||||||
OracleConfig dbConfig = OracleConfigManager.getOracleConfig();
|
OracleConfig dbConfig = OracleConfigManager.getOracleConfig();
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ public class sendMessage
|
|||||||
catch ( SQLException error )
|
catch ( SQLException error )
|
||||||
{
|
{
|
||||||
// 出现sql错误,就回滚!
|
// 出现sql错误,就回滚!
|
||||||
if ( conn != null )
|
if ( conn != null)
|
||||||
{
|
{
|
||||||
conn.rollback();
|
conn.rollback();
|
||||||
}
|
}
|
||||||
@ -235,7 +235,7 @@ public class sendMessage
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( stmt != null )
|
if ( stmt != null)
|
||||||
{
|
{
|
||||||
stmt.close();
|
stmt.close();
|
||||||
}
|
}
|
||||||
@ -247,7 +247,7 @@ public class sendMessage
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( conn != null )
|
if ( conn != null)
|
||||||
{
|
{
|
||||||
conn.close();
|
conn.close();
|
||||||
}
|
}
|
||||||
@ -271,6 +271,7 @@ public class sendMessage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class WechatOfficalAccountMessageParameter
|
class WechatOfficalAccountMessageParameter
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -280,40 +281,40 @@ class WechatOfficalAccountMessageParameter
|
|||||||
groupID = 1;
|
groupID = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonProperty("tplid")
|
@JsonProperty( "tplid")
|
||||||
private int tplID;
|
private int tplID;
|
||||||
|
|
||||||
@JsonProperty("groupid")
|
@JsonProperty( "groupid")
|
||||||
private int groupID;
|
private int groupID;
|
||||||
|
|
||||||
@JsonProperty("first")
|
@JsonProperty( "first")
|
||||||
private String first;
|
private String first;
|
||||||
|
|
||||||
@JsonProperty("keyword1")
|
@JsonProperty( "keyword1")
|
||||||
private String keyword1;
|
private String keyword1;
|
||||||
|
|
||||||
@JsonProperty("keyword1color")
|
@JsonProperty( "keyword1color")
|
||||||
private String keyword1Color;
|
private String keyword1Color;
|
||||||
|
|
||||||
@JsonProperty("keyword2")
|
@JsonProperty( "keyword2")
|
||||||
private String keyword2;
|
private String keyword2;
|
||||||
|
|
||||||
@JsonProperty("keyword2color")
|
@JsonProperty( "keyword2color")
|
||||||
private String keyword2Color;
|
private String keyword2Color;
|
||||||
|
|
||||||
@JsonProperty("remark")
|
@JsonProperty( "remark")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
@JsonProperty("remarkcolor")
|
@JsonProperty( "remarkcolor")
|
||||||
private String remarkColor;
|
private String remarkColor;
|
||||||
|
|
||||||
@JsonProperty("url")
|
@JsonProperty( "url")
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
@JsonProperty("appid")
|
@JsonProperty( "appid")
|
||||||
private String appid;
|
private String appid;
|
||||||
|
|
||||||
@JsonProperty("pagepath")
|
@JsonProperty( "pagepath")
|
||||||
private String pagePath;
|
private String pagePath;
|
||||||
|
|
||||||
public int getTplID()
|
public int getTplID()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user