|
@ -11,6 +11,7 @@ import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
|
|
|
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
|
|
|
import com.yihu.wlyy.service.app.talk.TalkGroupService;
|
|
|
import com.yihu.wlyy.service.common.account.DoctorService;
|
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
|
import com.yihu.wlyy.util.MessageType;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@ -82,9 +83,9 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
|
@RequestParam(required = false) String patient,
|
|
|
@RequestParam(required = false) String title) {
|
|
|
try {
|
|
|
Page<ConsultTeam> list = consultTeamService.findByDoctor(getUID(), type, id, pagesize,patient, title);
|
|
|
Page<ConsultTeam> list = consultTeamService.findByDoctor(getUID(), type, id, pagesize, patient, title);
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
if(list != null) {
|
|
|
if (list != null) {
|
|
|
for (ConsultTeam consult : list) {
|
|
|
if (consult == null) {
|
|
|
continue;
|
|
@ -111,12 +112,13 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
|
json.put("doctorPhoto", doctor.getPhoto());
|
|
|
// 设置医生sex
|
|
|
json.put("doctorSex", doctor.getSex());
|
|
|
Patient p = patientService.findByCode(consult.getPatient());
|
|
|
// 设置患者头像
|
|
|
json.put("photo", consult.getPhoto());
|
|
|
json.put("photo", p.getPhoto());
|
|
|
// 设置咨询标识
|
|
|
json.put("title", consult.getSymptoms());
|
|
|
// 设置患者年龄
|
|
|
json.put("age", DateUtil.getAgeByBirthday(consult.getBirthday()));
|
|
|
json.put("age", IdCardUtil.getAgeForIdcard(p.getIdcard()));
|
|
|
// 设置评价内容
|
|
|
json.put("comment", consult.getCommentContent());
|
|
|
// 设置评价星级
|
|
@ -128,7 +130,7 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
|
// 咨询状态
|
|
|
json.put("status", consult.getStatus());
|
|
|
// 设置性别
|
|
|
json.put("sex", consult.getSex());
|
|
|
json.put("sex", p.getSex());
|
|
|
// 未读消息
|
|
|
json.put("doctorRead", consult.getDoctorRead());
|
|
|
// 设置关联指导
|
|
@ -169,6 +171,8 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
Patient p = patientService.findByCode(consult.getPatient());
|
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("id", consult.getId());
|
|
|
// 设置咨询标识
|
|
@ -176,13 +180,13 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
|
// 设置患者标识
|
|
|
json.put("patient", consult.getPatient());
|
|
|
// 设置患者头像
|
|
|
json.put("photo", consult.getPhoto());
|
|
|
json.put("photo", p.getPhoto());
|
|
|
// 设置咨询标识
|
|
|
json.put("title", consult.getSymptoms());
|
|
|
// 设置患者姓名
|
|
|
json.put("name", consult.getName());
|
|
|
// 设置患者年龄
|
|
|
json.put("age", DateUtil.getAgeByBirthday(consult.getBirthday()));
|
|
|
json.put("age", IdCardUtil.getAgeForIdcard(p.getIdcard()));
|
|
|
// 设置评价内容
|
|
|
json.put("comment", consult.getCommentContent());
|
|
|
// 设置评价星级
|
|
@ -194,7 +198,7 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
|
// 咨询状态
|
|
|
json.put("status", consult.getStatus());
|
|
|
// 设置性别
|
|
|
json.put("sex", consult.getSex());
|
|
|
json.put("sex", p.getSex());
|
|
|
// 未读消息
|
|
|
json.put("doctorRead", consult.getDoctorRead());
|
|
|
// 设置关联指导
|
|
@ -494,7 +498,7 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
|
json.put("replycontent", replycontent);
|
|
|
json.put("doctorName", doctor.getName());
|
|
|
json.put("remark", "医生已为您提供问诊方案");
|
|
|
// PushMsgTask.getInstance().putWxMsg(getAccessToken(), 3, p.getOpenid(), p.getName(), json);
|
|
|
// PushMsgTask.getInstance().putWxMsg(getAccessToken(), 3, p.getOpenid(), p.getName(), json);
|
|
|
}
|
|
|
if (type == 2) {
|
|
|
return write(200, "回复成功!", "data", content);
|
|
@ -638,9 +642,9 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
|
consultTeamService.addFamousTeamConsult(consult, getUID(), "2");
|
|
|
// 推送消息给医生
|
|
|
PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.D_CT_04.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.您有新的名医咨询.name(), consult.getConsult());
|
|
|
if(StringUtils.isNotEmpty(images)){
|
|
|
if (StringUtils.isNotEmpty(images)) {
|
|
|
String[] arr = images.split(",");
|
|
|
for(String img : arr) {
|
|
|
for (String img : arr) {
|
|
|
PushMsgTask.getInstance().put(consult.getDoctor(), "2", MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.您有新的名医咨询.name(), img);
|
|
|
}
|
|
|
}
|