|
@ -53,16 +53,20 @@ public class ConsultController extends WeixinBaseController {
|
|
|
|
|
|
/**
|
|
|
* 患者咨询记录查询
|
|
|
* @param title 咨询标题
|
|
|
* @param id
|
|
|
* @param pagesize 分页大小
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "records")
|
|
|
@ResponseBody
|
|
|
public String consultRecords(long id, int pagesize) {
|
|
|
public String consultRecords(
|
|
|
@RequestParam(required = false) String title,
|
|
|
long id,
|
|
|
int pagesize) {
|
|
|
try {
|
|
|
JSONArray array = new JSONArray();
|
|
|
Page<Object> data = consultTeamService.findConsultRecordByPatient(getUID(), id, pagesize);
|
|
|
Page<Object> data = consultTeamService.findConsultRecordByPatient(getUID(), id, pagesize,title);
|
|
|
if (data != null) {
|
|
|
for (Object consult : data.getContent()) {
|
|
|
if (consult == null) {
|
|
@ -291,7 +295,7 @@ public class ConsultController extends WeixinBaseController {
|
|
|
voice = CommonUtil.copyTempVoice(voice);
|
|
|
}
|
|
|
ConsultTeam consult = new ConsultTeam();
|
|
|
// 设置咨询类型:1三师咨询,2家庭医生咨询
|
|
|
// 设置咨询类型:1三师咨询,2家庭医生咨询 6.名医咨询
|
|
|
consult.setType(type);
|
|
|
// 设置发病时间
|
|
|
consult.setWhen(when);
|
|
@ -319,7 +323,12 @@ public class ConsultController extends WeixinBaseController {
|
|
|
DoctorStatisticsTask.getInstance(doctorStatisticsService).put(consult.getDoctor(), 1, 1, 0);
|
|
|
}
|
|
|
// 推送消息给医生
|
|
|
PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.指定咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.您有新的指定咨询.name(), consult.getConsult());
|
|
|
if(type==6){
|
|
|
// 推送消息给医生
|
|
|
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());
|
|
|
}else{
|
|
|
PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.指定咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.您有新的指定咨询.name(), consult.getConsult());
|
|
|
}
|
|
|
return success("提交成功");
|
|
|
} catch (Exception ex) {
|
|
|
error(ex);
|
|
@ -345,6 +354,9 @@ public class ConsultController extends WeixinBaseController {
|
|
|
@RequestParam(required = false) String images,
|
|
|
@RequestParam(required = false) String voice) {
|
|
|
try {
|
|
|
//判断医生是否剩下咨询次数
|
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(images)) {
|
|
|
images = fetchWxImages();
|
|
|
}
|
|
@ -363,8 +375,8 @@ public class ConsultController extends WeixinBaseController {
|
|
|
return error(-1, "已经存在名医咨询!");
|
|
|
}
|
|
|
ConsultTeam consult = new ConsultTeam();
|
|
|
// 设置咨询类型:1三师咨询,2家庭医生咨询 3.名医咨询
|
|
|
consult.setType(3);
|
|
|
// 设置咨询类型:1三师咨询,2家庭医生咨询 6.名医咨询
|
|
|
consult.setType(6);
|
|
|
// 设置发病时间
|
|
|
consult.setWhen(when);
|
|
|
// 设置主要症状
|
|
@ -386,7 +398,104 @@ public class ConsultController extends WeixinBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 名医列表
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "famousDoctorList")
|
|
|
@ResponseBody
|
|
|
public String famousDoctorList(
|
|
|
@RequestParam(required = false) String name,
|
|
|
long id,
|
|
|
int pagesize) {
|
|
|
try {
|
|
|
JSONArray array = new JSONArray();
|
|
|
Page<Doctor>list = doctorService.famousDoctorList(name, id, pagesize);
|
|
|
if (list != null) {
|
|
|
for (Doctor doctor : list) {
|
|
|
if (doctor == null) {
|
|
|
continue;
|
|
|
}
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("id", doctor.getId());
|
|
|
// 医生标识
|
|
|
json.put("code", doctor.getCode());
|
|
|
// 医生姓名
|
|
|
json.put("name", doctor.getName());
|
|
|
// 所在医院名称
|
|
|
json.put("hospital", doctor.getHospital());
|
|
|
// 所在医院名称
|
|
|
json.put("hospital_name", doctor.getHosptialName());
|
|
|
// 科室名称
|
|
|
json.put("dept_name", (doctor.getDeptName() == null ||
|
|
|
StringUtils.isEmpty(doctor.getDeptName().toString())) ? " " : doctor.getDeptName());
|
|
|
// 职称名称
|
|
|
json.put("job_name", (doctor.getJobName() == null ||
|
|
|
StringUtils.isEmpty(doctor.getJobName().toString())) ? " " : doctor.getJobName());
|
|
|
// 头像
|
|
|
json.put("photo", doctor.getPhoto());
|
|
|
// 简介
|
|
|
json.put("introduce", doctor.getIntroduce());
|
|
|
// 专长
|
|
|
json.put("expertise", doctor.getExpertise());
|
|
|
// 剩余咨询次数
|
|
|
//json.put("num", doctor.getExpertise());
|
|
|
array.put(json);
|
|
|
}
|
|
|
}
|
|
|
return write(200, "获取医院医生列表成功!", "list", array);
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "获取医院医生列表失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 名医主页
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "famousDoctorPage")
|
|
|
@ResponseBody
|
|
|
public String famousDoctorPage(
|
|
|
String doctorCode) {
|
|
|
try {
|
|
|
Doctor temp = doctorService.findDoctorByCode(doctorCode);
|
|
|
if (temp != null) {
|
|
|
JSONObject json = new JSONObject();
|
|
|
// 设置医生手机号码
|
|
|
json.put("mobile", temp.getMobile());
|
|
|
// 设置医生标识
|
|
|
json.put("code", temp.getCode());
|
|
|
// 设置医生姓名
|
|
|
json.put("name", temp.getName());
|
|
|
// 设置医生头像
|
|
|
json.put("photo", CommonUtil.getPhoneUrl(temp.getPhoto()));
|
|
|
// 设置医生性别
|
|
|
json.put("sex", temp.getSex());
|
|
|
// 设置省名称
|
|
|
json.put("provinceName", temp.getProvinceName());
|
|
|
// 设置城市名称
|
|
|
json.put("cityName", temp.getCityName());
|
|
|
// 设置医院名称
|
|
|
json.put("hospitalName", temp.getHosptialName());
|
|
|
// 设置部门名称
|
|
|
json.put("deptName", StringUtils.isNotEmpty(temp.getDeptName()) ? temp.getDeptName() : "");
|
|
|
// 设置职称
|
|
|
json.put("jobName", StringUtils.isNotEmpty(temp.getJobName()) ? temp.getJobName() : "");
|
|
|
// 设置医生专长
|
|
|
json.put("expertise", StringUtils.isNotEmpty(temp.getExpertise()) ? temp.getExpertise() : "");
|
|
|
// 设置医生简介
|
|
|
json.put("introduce", StringUtils.isNotEmpty(temp.getIntroduce()) ? temp.getIntroduce() : "");
|
|
|
|
|
|
return write(200, "医生信息查询成功!", "data", json);
|
|
|
} else {
|
|
|
return error(-1, "医生信息查询失败!");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "医生信息查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "status")
|
|
|
@ResponseBody
|
|
@ -545,7 +654,6 @@ public class ConsultController extends WeixinBaseController {
|
|
|
/**
|
|
|
* 网络咨询咨询日志查询
|
|
|
* @param consult 咨询标识
|
|
|
* @param patient 患者标识
|
|
|
* @param pagesize 每页显示数,默认为10
|
|
|
* @return
|
|
|
*/
|