|
@ -3,7 +3,10 @@ package com.yihu.wlyy.web.doctor.consult;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.service.app.account.DoctorInfoService;
|
|
import com.yihu.wlyy.service.app.account.DoctorInfoService;
|
|
|
|
import com.yihu.wlyy.service.common.account.PatientService;
|
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
@ -41,6 +44,12 @@ public class DoctorConsultPublicController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private DoctorInfoService doctorInfoService;
|
|
private DoctorInfoService doctorInfoService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
PatientService patientService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
WeiXinAccessTokenUtils weiXinAccessTokenUtils;
|
|
/**
|
|
/**
|
|
* 查询公共咨询记录
|
|
* 查询公共咨询记录
|
|
* @param type 查询类型:0全部,1我的回答
|
|
* @param type 查询类型:0全部,1我的回答
|
|
@ -219,8 +228,20 @@ public class DoctorConsultPublicController extends BaseController {
|
|
}
|
|
}
|
|
reply.setImages(images);
|
|
reply.setImages(images);
|
|
if (consultPublicService.addDoctorReply(reply) != null) {
|
|
if (consultPublicService.addDoctorReply(reply) != null) {
|
|
|
|
Patient p = patientService.findByCode(cp.getPatient());
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
json.put("first", "您的公共咨询有新的回复");
|
|
|
|
json.put("toUser", p.getCode());
|
|
|
|
json.put("consultcontent", cp.getContent());
|
|
|
|
String replycontent = content.length() > 15 ? content.substring(0, 15) + "..." : content;
|
|
|
|
json.put("consult", consult);
|
|
|
|
json.put("replycontent", replycontent);
|
|
|
|
json.put("doctorName", doctor.getName());
|
|
|
|
json.put("remark", "");
|
|
|
|
|
|
|
|
PushMsgTask.getInstance().putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 3, p.getOpenid(), p.getName(), json);
|
|
// 推送消息给患者
|
|
// 推送消息给患者
|
|
PushMsgTask.getInstance().put(cp.getPatient(), MessageType.MESSAGE_TYPE_PATIENT_CONSULT_PUBLIC_REPLY.P_CP_01.name(), MessageType.MESSAGE_TYPE_PATIENT_CONSULT_PUBLIC_REPLY.公共咨询.name(), MessageType.MESSAGE_TYPE_PATIENT_CONSULT_PUBLIC_REPLY.医生回复了您.name(), consult);
|
|
|
|
|
|
//PushMsgTask.getInstance().put(cp.getPatient(), MessageType.MESSAGE_TYPE_PATIENT_CONSULT_PUBLIC_REPLY.P_CP_01.name(), MessageType.MESSAGE_TYPE_PATIENT_CONSULT_PUBLIC_REPLY.公共咨询.name(), MessageType.MESSAGE_TYPE_PATIENT_CONSULT_PUBLIC_REPLY.医生回复了您.name(), consult);
|
|
return success("回复成功!");
|
|
return success("回复成功!");
|
|
} else {
|
|
} else {
|
|
return error(-1, "回复失败!");
|
|
return error(-1, "回复失败!");
|