|
@ -6,12 +6,17 @@ import com.yihu.wlyy.aop.ObserverRequired;
|
|
|
import com.yihu.wlyy.entity.device.PatientDevice;
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.wechat.WechatTemplateConfig;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
|
|
|
import com.yihu.wlyy.service.app.device.WlyyDeviceDetailService;
|
|
|
import com.yihu.wlyy.service.app.device.PatientDeviceService;
|
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
|
import com.yihu.wlyy.service.common.account.PatientService;
|
|
|
import com.yihu.wlyy.service.third.health.bank.CreditLogService;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
@ -51,6 +56,14 @@ public class DoctorDeviceController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private PatientService patientService;
|
|
|
@Autowired
|
|
|
private WechatTemplateConfigDao templateConfigDao;
|
|
|
@Autowired
|
|
|
private PushMsgTask pushMsgTask;
|
|
|
@Autowired
|
|
|
private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
|
|
|
@Autowired
|
|
|
private PatientDao patientDao;
|
|
|
|
|
|
private ObjectMapper objectMapper=new ObjectMapper();
|
|
|
|
|
@ -107,7 +120,45 @@ public class DoctorDeviceController extends BaseController {
|
|
|
if (list!=null && list.size()>0){
|
|
|
String integrate = String.valueOf(list.get(0).get("integrate"));
|
|
|
String flagType = String.valueOf(list.get(0).get("flag"));
|
|
|
|
|
|
//@TODO 调用发送微信模板接口
|
|
|
// Patient people = patientDao.findByCode(device.getUser());
|
|
|
// String openId = people.getOpenid();
|
|
|
// String name = people.getName();
|
|
|
//
|
|
|
// org.json.JSONObject sendJson = new org.json.JSONObject();
|
|
|
// String first = "";
|
|
|
// String remark = "";
|
|
|
// String deviceName = device.getDeviceName();
|
|
|
// WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_patient_bind_device","bdsb");
|
|
|
// first = templateConfig.getFirst();
|
|
|
// first = first.replace("key1",(deviceName==null?"":deviceName));
|
|
|
// remark = templateConfig.getRemark();
|
|
|
// String keyword1 = templateConfig.getKeyword1();
|
|
|
//
|
|
|
// sendJson.put("keyword1", keyword1);
|
|
|
// sendJson.put("keyword2", device.getCzrq());
|
|
|
// sendJson.put("first", first);
|
|
|
// sendJson.put("remark", remark);
|
|
|
// sendJson.put("url", templateConfig.getUrl());//带参数的模板跳转链接
|
|
|
// pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 22, 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);
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|