|
@ -187,6 +187,55 @@ public class TaskService {
|
|
params.put("taskPatientDetail",object.toJSONString());
|
|
params.put("taskPatientDetail",object.toJSONString());
|
|
try {
|
|
try {
|
|
response = httpClientUtil.httpPost(url,params);
|
|
response = httpClientUtil.httpPost(url,params);
|
|
|
|
JSONObject result = JSONObject.parseObject(response);
|
|
|
|
String status = result.getString("status");
|
|
|
|
/* if (status.equalsIgnoreCase("200")){
|
|
|
|
try {
|
|
|
|
//@TODO 获取积分调用发送微信模板接口
|
|
|
|
String openId = patient.getOpenid();
|
|
|
|
String name = patient.getName();
|
|
|
|
|
|
|
|
org.json.JSONObject sendJson = new org.json.JSONObject();
|
|
|
|
String first = "";
|
|
|
|
String remark = "";
|
|
|
|
String urlresult = "";
|
|
|
|
|
|
|
|
WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_healthbank_activity","bmcgtx");
|
|
|
|
first = templateConfig.getFirst();
|
|
|
|
remark = templateConfig.getRemark();
|
|
|
|
// String keyword1 = templateConfig.getKeyword1();
|
|
|
|
|
|
|
|
sendJson.put("keyword1", integrateresult);
|
|
|
|
sendJson.put("keyword2", DateUtil.getStringDate());
|
|
|
|
sendJson.put("keyword3", total);
|
|
|
|
sendJson.put("first", first);
|
|
|
|
sendJson.put("remark", remark);
|
|
|
|
urlresult = templateConfig.getUrl();
|
|
|
|
urlresult = urlresult.replace("key1",(integrateresult==null?"":integrateresult));
|
|
|
|
sendJson.put("url", urlresult);//带参数的模板跳转链接
|
|
|
|
System.out.println(sendJson.toString());
|
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 23, openId, name, sendJson);
|
|
|
|
// //发送代理人
|
|
|
|
// jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient, openId);
|
|
|
|
// if (jsonArray != null && jsonArray.length() > 0) {
|
|
|
|
// for (int i = 0; i < jsonArray.length(); i++) {
|
|
|
|
// org.json.JSONObject j = jsonArray.getJSONObject(i);
|
|
|
|
// Patient member = (Patient) j.get("member");
|
|
|
|
// int start = url.indexOf("&toUser=");
|
|
|
|
// int end = url.indexOf("&", start + 1);
|
|
|
|
// String touser = url.substring(start, end);
|
|
|
|
// url = url.replace(touser, "&toUser=" + member.getCode());
|
|
|
|
// //name患者姓名
|
|
|
|
// sendJson.put("first", weiXinOpenIdUtils.getTitleMes(people, (int) j.get("relation"), name) + first);
|
|
|
|
// sendJson.put("url", url);
|
|
|
|
// pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 19, member.getOpenid(), name, sendJson);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}catch (Exception e){
|
|
|
|
logger.info("健康银行居民新增积分,微信模板消息发送失败:"+e.getMessage());
|
|
|
|
// e.printStackTrace();
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|