|
@ -15,6 +15,7 @@ import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONException;
|
|
|
import org.json.JSONObject;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@ -286,26 +287,34 @@ public class ManagerQuestionnaireService extends BaseService {
|
|
|
}
|
|
|
// });
|
|
|
}*/
|
|
|
WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_change","qkxz");
|
|
|
WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_survey","survey");
|
|
|
String remark = templateConfig.getRemark();
|
|
|
String keyword1 = templateConfig.getKeyword1();
|
|
|
|
|
|
new Thread() {
|
|
|
public void run() {
|
|
|
for (String c : codes) {
|
|
|
Patient p = patientDao.findByCode(c);
|
|
|
String name = p.getName();
|
|
|
String openId = p.getOpenid();
|
|
|
json.put("keyword2", sdf.format(new Date()));
|
|
|
json.put("toUser", c);
|
|
|
json.put("represented", c);
|
|
|
json.put("survey_id", surveyCode);
|
|
|
Patient p = null;
|
|
|
String name = null;
|
|
|
String openId = null;
|
|
|
String first = null;
|
|
|
try {
|
|
|
p = patientDao.findByCode(c);
|
|
|
name = p.getName();
|
|
|
openId = p.getOpenid();
|
|
|
json.put("keyword2", sdf.format(new Date()));
|
|
|
json.put("toUser", c);
|
|
|
json.put("represented", c);
|
|
|
json.put("survey_id", surveyCode);
|
|
|
// String first = name + ",您好!为了给您提供更好的家庭医生健康服务,现有一份问卷需要您填写。";
|
|
|
String first = templateConfig.getFirst();
|
|
|
first = first.replace("key1",(name==null?"":name));
|
|
|
json.put("first", first);
|
|
|
json.put("remark", remark);
|
|
|
json.put("keyword1", keyword1);
|
|
|
first = templateConfig.getFirst();
|
|
|
first = first.replace("key1",(name==null?"":name));
|
|
|
json.put("first", first);
|
|
|
json.put("remark", remark);
|
|
|
json.put("keyword1", keyword1);
|
|
|
} catch (JSONException e) {
|
|
|
continue;
|
|
|
}
|
|
|
//判断是否判定openId,有没有发则查找家人发送
|
|
|
if (StringUtils.isNotBlank(p.getOpenid())) {
|
|
|
// 添加到发送队列
|