|
@ -400,6 +400,39 @@ public class WeiXinEventProcess {
|
|
|
setUrlItems(articles, systemConf);
|
|
|
|
|
|
setWifi(message.get("FromUserName"),articles,systemConf);
|
|
|
// 构建回复消息XML
|
|
|
result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
|
|
|
}else if (StringUtils.isNotEmpty(eventKey) && (("wechat_draw").equals(eventKey)) ||
|
|
|
eventKey.startsWith("qrscene_wechat_draw")){
|
|
|
// 配置信息
|
|
|
Properties systemConf = SystemConf.getInstance().getSystemProperties();
|
|
|
// 图文信息
|
|
|
List<Map<String, String>> articles = new ArrayList<>();
|
|
|
|
|
|
Map<String, String> article = new HashMap<>();
|
|
|
// 图文URL
|
|
|
String url = systemConf.getProperty("doctor_subscribe_url");
|
|
|
// 图文消息图片URL
|
|
|
String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
|
|
|
// URL设置服务器URL、AppId
|
|
|
url = url.replace("{server}", wechat_base_url)
|
|
|
.replace("{appId}", appId);
|
|
|
//图片地址
|
|
|
picUrl = picUrl.replace("{server}", serverUrl);
|
|
|
|
|
|
article.put("Url", url);
|
|
|
article.put("Title", "欢迎关注厦门i健康,快来签约家庭医生吧~");
|
|
|
article.put("Description", "请点击查看家庭签约");
|
|
|
article.put("PicUrl", picUrl);
|
|
|
|
|
|
articles.add(article);
|
|
|
|
|
|
//设置共有的图文消息
|
|
|
setUrlItems(articles, systemConf);
|
|
|
|
|
|
//设置抽奖
|
|
|
setDraw(articles,systemConf);
|
|
|
|
|
|
// 构建回复消息XML
|
|
|
result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
|
|
|
}else {
|
|
@ -480,10 +513,37 @@ public class WeiXinEventProcess {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void setDraw(List<Map<String, String>> articles, Properties systemConf){
|
|
|
|
|
|
Map<String, String> articleConsult = new HashMap<>();
|
|
|
// 图文URL
|
|
|
String urlConsult = getSystemCodeByName("PATIENT_DRAW_URL");
|
|
|
|
|
|
// URL设置服务器URL、AppId
|
|
|
urlConsult = urlConsult.replace("{server}", wechat_base_url)
|
|
|
.replace("{appId}", appId);
|
|
|
logger.info("pstient_Draw_url:"+urlConsult);
|
|
|
|
|
|
// 图文消息图片URL
|
|
|
String picUrlConsult = systemConf.getProperty("patient_draw_pic_url");
|
|
|
picUrlConsult = picUrlConsult.replace("{server}", serverUrl);
|
|
|
|
|
|
articleConsult.put("Url", urlConsult);
|
|
|
articleConsult.put("Title", "健康宣传回访,电影票等你来拿~");
|
|
|
articleConsult.put("Description", "外来流动人口健康宣传回访,快来参加抽取电影票~");
|
|
|
articleConsult.put("PicUrl", picUrlConsult);
|
|
|
|
|
|
articles.add(articleConsult);
|
|
|
}
|
|
|
|
|
|
public String getSystemWifiUrl(){
|
|
|
List<SystemDict> systemDicts = systemDictDao.findByDictName("HSLQ_WIFI");
|
|
|
return systemDicts.get(0).getCode();
|
|
|
}
|
|
|
public String getSystemCodeByName(String name){
|
|
|
List<SystemDict> systemDicts = systemDictDao.findByDictName(name);
|
|
|
return systemDicts.get(0).getCode();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置微信公共的图文消息
|
|
@ -725,6 +785,38 @@ public class WeiXinEventProcess {
|
|
|
setWifi(message.get("FromUserName"),articles,systemConf);
|
|
|
// 构建回复消息XML
|
|
|
result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
|
|
|
}else if (StringUtils.isNotEmpty(eventKey) && (("wechat_draw").equals(eventKey)) ||
|
|
|
eventKey.startsWith("qrscene_wechat_draw")) {
|
|
|
// 配置信息
|
|
|
Properties systemConf = SystemConf.getInstance().getSystemProperties();
|
|
|
// 图文信息
|
|
|
List<Map<String, String>> articles = new ArrayList<>();
|
|
|
|
|
|
Map<String, String> article = new HashMap<>();
|
|
|
// 图文URL
|
|
|
String url = systemConf.getProperty("doctor_subscribe_url");
|
|
|
// 图文消息图片URL
|
|
|
String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
|
|
|
// URL设置服务器URL、AppId
|
|
|
url = url.replace("{server}", wechat_base_url)
|
|
|
.replace("{appId}", appId);
|
|
|
//图片地址
|
|
|
picUrl = picUrl.replace("{server}", serverUrl);
|
|
|
|
|
|
article.put("Url", url);
|
|
|
article.put("Title", "欢迎关注厦门i健康,快来签约家庭医生吧~");
|
|
|
article.put("Description", "请点击查看家庭签约");
|
|
|
article.put("PicUrl", picUrl);
|
|
|
|
|
|
articles.add(article);
|
|
|
|
|
|
//设置共有的图文消息
|
|
|
setUrlItems(articles, systemConf);
|
|
|
|
|
|
//设置抽奖
|
|
|
setDraw(articles,systemConf);
|
|
|
// 构建回复消息XML
|
|
|
result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
|
|
|
}
|
|
|
|
|
|
return result;
|