|
@ -651,7 +651,7 @@ public class FamilyMemberService extends BaseService {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@Transactional
|
|
|
public int addMenberByWXTemp(Long id, String state) throws Exception {
|
|
|
public int addMenberByWXTemp(Long id, String state,String access_token) throws Exception {
|
|
|
if (StringUtils.isNotBlank(state)) {
|
|
|
//同意添加
|
|
|
if ("1".equals(state)) {
|
|
@ -663,6 +663,8 @@ public class FamilyMemberService extends BaseService {
|
|
|
|
|
|
Patient p = patientDao.findByCode(temp.getPatient());
|
|
|
Patient m = patientDao.findByCode(temp.getFamilyMember());
|
|
|
|
|
|
System.out.println("----:openId "+p.getOpenid());
|
|
|
if (p == null) {
|
|
|
return -1;
|
|
|
}
|
|
@ -677,6 +679,23 @@ public class FamilyMemberService extends BaseService {
|
|
|
//保存
|
|
|
temp.setState("1");
|
|
|
patientFamilyTempDao.save(temp);
|
|
|
|
|
|
if(StringUtils.isNotBlank(p.getOpenid())){
|
|
|
//发送添加成功消息模板
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("first", p.getName() + ",您好!添加家人"+m.getName()+"申请成功。");
|
|
|
json.put("keyword1", "添加家人申请成功");
|
|
|
json.put("keyword2", DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
|
|
|
// json.put("keyword3", m.getName());
|
|
|
// json.put("keyword4", relations.get(temp.getFamilyRelation()));
|
|
|
json.put("remark",
|
|
|
"家人:"+m.getName()+"\n"+
|
|
|
"家庭关系:"+relations.get(temp.getFamilyRelation())+"\n"+
|
|
|
"点击查看家人。");
|
|
|
System.out.println("-----sendMes----:openId "+p.getOpenid()+"-----access_token-----:"+access_token+"--json--");
|
|
|
//此消息为定向推送,无需家人代收
|
|
|
PushMsgTask.getInstance().putWxMsg(access_token, 13, p.getOpenid(), p.getName(), json);
|
|
|
}
|
|
|
}
|
|
|
return st;
|
|
|
//不同意添加
|
|
@ -783,9 +802,11 @@ public class FamilyMemberService extends BaseService {
|
|
|
json.put("first", m.getName() + ",您好!" + p.getName() + "向您发起添加家人申请,添加成功后,对方可使用您的账号,为您处理各类健康服务。");
|
|
|
json.put("keyword1", "添加家人申请");
|
|
|
json.put("keyword2", DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
|
|
|
json.put("keyword3", p.getName());
|
|
|
json.put("keyword4", relations.get(relation));
|
|
|
json.put("remark", "点击立即处理。");
|
|
|
// json.put("keyword3", p.getName());
|
|
|
// json.put("keyword4", relations.get(relation));
|
|
|
json.put("remark", "申请人:"+p.getName()+"\n"+
|
|
|
"家庭关系:"+relations.get(relation)+"\n"+
|
|
|
"点击立即处理。");
|
|
|
json.put("member", member);
|
|
|
//此消息为定向推送,无需家人代收
|
|
|
PushMsgTask.getInstance().putWxMsg(access_token, 12, m.getOpenid(), p.getName(), json);
|