|
@ -98,19 +98,21 @@ public class ConsultService {
|
|
* @param reciver_id 接收者ID
|
|
* @param reciver_id 接收者ID
|
|
* @param session_id 会话ID
|
|
* @param session_id 会话ID
|
|
*/
|
|
*/
|
|
public String sendWeTempMesMiniProgram(String sender_id, String reciver_id, String session_id)throws Exception {
|
|
|
|
|
|
public String sendWeTempMesMiniProgram(String sender_id, String reciver_id, String session_id,String token,String channelName)throws Exception {
|
|
BasePatientDO patient = basePatientDao.findById(reciver_id);
|
|
BasePatientDO patient = basePatientDao.findById(reciver_id);
|
|
if(patient!=null){
|
|
if(patient!=null){
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(sender_id);
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(sender_id);
|
|
JSONObject json = new JSONObject();
|
|
JSONObject json = new JSONObject();
|
|
json.put("id", reciver_id);
|
|
|
|
|
|
json.put("nickName", patient.getName());
|
|
|
|
json.put("token", token);
|
|
|
|
json.put("channelName", channelName);
|
|
String first = "【key1】您好!【key2】向您发起了视频请求";
|
|
String first = "【key1】您好!【key2】向您发起了视频请求";
|
|
first = first.replace("key1",patient.getName());
|
|
first = first.replace("key1",patient.getName());
|
|
first = first.replace("key2", doctorDO.getName());
|
|
first = first.replace("key2", doctorDO.getName());
|
|
List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wechatId,patient.getId());
|
|
List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wechatId,patient.getId());
|
|
if (basePatientWechatDos.size()>0){
|
|
if (basePatientWechatDos.size()>0){
|
|
String openId = basePatientWechatDos.get(0).getOpenid();
|
|
String openId = basePatientWechatDos.get(0).getOpenid();
|
|
messageUtil.putTemplateWxMessage(wechatId,"template_consult_notice","spthtx",openId,first,null,null,2,json, DateUtil.dateToChineseDate(new Date()),"视频请求","点击接收");
|
|
|
|
|
|
messageUtil.putTemplateWxMessage(wechatId,"template_consult_notice","spthtx",openId,first,null,null,28,json, DateUtil.dateToChineseDate(new Date()),"视频请求","点击接收");
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
throw new Exception("接收者ID错误,无法找到该账号");
|
|
throw new Exception("接收者ID错误,无法找到该账号");
|