|
@ -6,6 +6,7 @@ import java.util.Map;
|
|
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
|
|
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
|
|
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
|
|
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
|
|
import com.yihu.wlyy.service.common.account.DoctorService;
|
|
import com.yihu.wlyy.service.common.account.DoctorService;
|
|
|
|
import com.yihu.wlyy.util.MessageType;
|
|
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;
|
|
@ -552,5 +553,66 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
return error(-1, "回复失败!");
|
|
return error(-1, "回复失败!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 名医咨询添加接口
|
|
|
|
* @param when 发病时间
|
|
|
|
* @param symptoms 主要症状
|
|
|
|
* @param images 图片URL地址,多图以逗号分隔
|
|
|
|
* @param voice 语音URL地址
|
|
|
|
* @param doctorCode 名医的code
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "famousAdd")
|
|
|
|
@ResponseBody
|
|
|
|
public String famousAdd(
|
|
|
|
@RequestParam(required = false)String when,
|
|
|
|
String symptoms,
|
|
|
|
@RequestParam(required = false) String doctorCode,
|
|
|
|
@RequestParam(required = false) String images,
|
|
|
|
@RequestParam(required = false) String voice) {
|
|
|
|
try {
|
|
|
|
//判断医生是否是在工作时间
|
|
|
|
JSONObject jo=doctorWorkTimeService.isFamousDoctorWorking(doctorCode);
|
|
|
|
if(!jo.get("status").equals("1")){
|
|
|
|
return error(-1, jo.get("msg").toString());
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(images)) {
|
|
|
|
images = fetchWxImages();
|
|
|
|
}
|
|
|
|
// 将临时图片拷贝到正式存储路径下
|
|
|
|
if (StringUtils.isNotEmpty(images)) {
|
|
|
|
images = CommonUtil.copyTempImage(images);
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(voice)) {
|
|
|
|
voice = fetchWxVoices();
|
|
|
|
}
|
|
|
|
if (StringUtils.isNotEmpty(voice)) {
|
|
|
|
voice = CommonUtil.copyTempVoice(voice);
|
|
|
|
}
|
|
|
|
//判断是否已经存在还没有关闭的名医咨询
|
|
|
|
// if(consultTeamService.isExistFamousConsult(getUID())){
|
|
|
|
// return error(-1, "已经存在名医咨询!");
|
|
|
|
// }
|
|
|
|
ConsultTeam consult = new ConsultTeam();
|
|
|
|
// 设置咨询类型:1三师咨询,2家庭医生咨询 6.患者发起名医咨询 7医生发起的名医咨询
|
|
|
|
consult.setType(7);
|
|
|
|
// 设置发病时间
|
|
|
|
consult.setWhen(when);
|
|
|
|
// 设置主要症状
|
|
|
|
consult.setSymptoms(symptoms);
|
|
|
|
// 设置咨询图片URL
|
|
|
|
consult.setImages(images);
|
|
|
|
// 设置咨询语音URL
|
|
|
|
consult.setVoice(voice);
|
|
|
|
consult.setDoctor(doctorCode);//设置专科医生
|
|
|
|
// 保存到数据库
|
|
|
|
consultTeamService.addFamousTeamConsult(consult, getUID(),"2");
|
|
|
|
// 推送消息给医生
|
|
|
|
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("提交成功");
|
|
|
|
} catch (Exception ex) {
|
|
|
|
error(ex);
|
|
|
|
return invalidUserException(ex, -1, "提交失败!");
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|