|
@ -290,9 +290,16 @@ public class ConsultController extends WeixinBaseController {
|
|
|
@RequestParam(required = false) String images,
|
|
|
@RequestParam(required = false) String voice) {
|
|
|
try {
|
|
|
//判断医生是否是在工作时间
|
|
|
JSONObject jo=doctorWorkTimeService.isDoctorWorking(doctorCode);
|
|
|
if(!jo.get("status").equals("1")){
|
|
|
return error(-1, jo.get("msg").toString());
|
|
|
}
|
|
|
//判断医生是否剩下咨询次数
|
|
|
|
|
|
|
|
|
int result = doctorWorkTimeService.getDoctorConsultTimesRemain(doctorCode);
|
|
|
if(result==0){
|
|
|
return error(-1, "没有次数");
|
|
|
}
|
|
|
if (StringUtils.isEmpty(images)) {
|
|
|
images = fetchWxImages();
|
|
|
}
|
|
@ -324,7 +331,8 @@ public class ConsultController extends WeixinBaseController {
|
|
|
consult.setDoctor(doctorCode);//设置专科医生
|
|
|
// 保存到数据库
|
|
|
consultTeamService.addFamousTeamConsult(consult, getUID());
|
|
|
|
|
|
//名医咨询次数减一
|
|
|
doctorWorkTimeService.setDoctorCurrentConsultTimesRemain(doctorCode);
|
|
|
// 推送消息给医生
|
|
|
PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.您有新的名医咨询.name(), consult.getConsult());
|
|
|
return success("提交成功");
|
|
@ -375,7 +383,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
// 专长
|
|
|
json.put("expertise", doctor.getExpertise());
|
|
|
// 剩余咨询次数
|
|
|
//json.put("num", doctor.getExpertise());
|
|
|
json.put("num", doctorWorkTimeService.getDoctorConsultTimesRemain(doctor.getCode()));
|
|
|
array.put(json);
|
|
|
}
|
|
|
}
|
|
@ -422,7 +430,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
json.put("expertise", StringUtils.isNotEmpty(temp.getExpertise()) ? temp.getExpertise() : "");
|
|
|
// 设置医生简介
|
|
|
json.put("introduce", StringUtils.isNotEmpty(temp.getIntroduce()) ? temp.getIntroduce() : "");
|
|
|
|
|
|
//doctorWorkTimeService.findDoctorWeekWorkTime()
|
|
|
return write(200, "医生信息查询成功!", "data", json);
|
|
|
} else {
|
|
|
return error(-1, "医生信息查询失败!");
|