|
@ -1,11 +1,13 @@
|
|
|
package com.yihu.wlyy.web.patient.consult;
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
@ -23,6 +25,7 @@ import com.yihu.wlyy.web.WeixinBaseController;
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping(value = "/patient/consult_movi")
|
|
|
@Api(description = "视频咨询")
|
|
|
public class ConsultMoviController extends WeixinBaseController {
|
|
|
|
|
|
@Autowired
|
|
@ -34,51 +37,11 @@ public class ConsultMoviController extends WeixinBaseController {
|
|
|
* 视频咨询三师医生查询接口
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "doctors")
|
|
|
@RequestMapping(value = "doctors", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public String doctors() {
|
|
|
try {
|
|
|
// // 查询签约信息
|
|
|
// SignContract signContract = signContractService.findByPatient(getUID());
|
|
|
// if (signContract == null) {
|
|
|
// return error(-1, "查询失败,签约信息无效或已过期!");
|
|
|
// }
|
|
|
// // 查询三师医生信息
|
|
|
// List<Object> doctors = doctorTeamService.findDoctorsInTeam(signContract.getTeam());
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
// if (doctors != null) {
|
|
|
// for (Object obj : doctors) {
|
|
|
// Object[] temp = (Object[]) obj;
|
|
|
// if (temp == null || temp.length != 8) {
|
|
|
// continue;
|
|
|
// }
|
|
|
// JSONObject json = new JSONObject();
|
|
|
// // 设置医生标识
|
|
|
// json.put("code", temp[0]);
|
|
|
// // 设置医生姓名
|
|
|
// json.put("name", temp[1]);
|
|
|
// // 设置医生头像
|
|
|
// json.put("photo", CommonUtil.getPhoneUrl((String) temp[2]));
|
|
|
// // 设置医生所在医院
|
|
|
// json.put("hospitalName", temp[3]);
|
|
|
// // 设置医生科室
|
|
|
// json.put("deptName", temp[4]);
|
|
|
// // 设置医生专长
|
|
|
// json.put("expertise", temp[6]);
|
|
|
// // 设置医生类型
|
|
|
// int type = (Integer) temp[7];
|
|
|
// if (type == 1) {
|
|
|
// json.put("typename", "专科医生");
|
|
|
// } else if (type == 2) {
|
|
|
// json.put("typename", "全科医生");
|
|
|
// } else if (type == 3) {
|
|
|
// json.put("typename", "健康管理师");
|
|
|
// } else {
|
|
|
// json.put("typename", "");
|
|
|
// }
|
|
|
// jsonArray.put(json);
|
|
|
// }
|
|
|
// }
|
|
|
return write(200, "查询成功!", "list", jsonArray);
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
@ -101,105 +64,10 @@ public class ConsultMoviController extends WeixinBaseController {
|
|
|
* @param imageUrls 图片URL,多图逗号分隔
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "add")
|
|
|
@RequestMapping(value = "add", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public String add(@RequestParam(required = false) Integer target, @RequestParam(required = false) Integer type, @RequestParam(required = false) String family, @RequestParam(required = false) String doctor, String scheduling, String appo_date, int appo_week, String hour_begin, String hour_end, String content, @RequestParam(required = false) String images) {
|
|
|
try {
|
|
|
// Patient patient = patientInfoService.findByCode(getUID());
|
|
|
// // 默认为三师预约
|
|
|
// if (target == null || target == 0) {
|
|
|
// target = 2;
|
|
|
// }
|
|
|
// // 默认为视频咨询
|
|
|
// if (type == null || type == 0) {
|
|
|
// type = 2;
|
|
|
// }
|
|
|
// ConsultMoVi movi = new ConsultMoVi();
|
|
|
// movi.setTarget(target);
|
|
|
// movi.setType(type);
|
|
|
// // 指定医生咨询
|
|
|
// if (target == 1 && StringUtils.isNotEmpty(doctor)) {
|
|
|
// // 查询医生信息
|
|
|
// Doctor d = doctorService.findDoctorByCode(doctor);
|
|
|
// movi.setDoctor(d.getCode());
|
|
|
// movi.setDoctorName(d.getName());
|
|
|
// }
|
|
|
// // 查询三师团队标识
|
|
|
// if (target == 2) {
|
|
|
// SignContract sc = doctorTeamService.findBySignContractUser(getUID());
|
|
|
// if (sc == null) {
|
|
|
// return error(-1, "三师签约信息不存在或已过期,无法进行三师咨询!");
|
|
|
// }
|
|
|
// DoctorTeam team = doctorTeamService.findByCode(sc.getTeam());
|
|
|
// movi.setTeam(team.getCode());
|
|
|
// movi.setTeamName(team.getName());
|
|
|
// }
|
|
|
// // 设置家人标识
|
|
|
// if (StringUtils.isNoneEmpty(family)) {
|
|
|
// movi.setFamily(family);
|
|
|
// }
|
|
|
// // 设置备注
|
|
|
// movi.setContent(content);
|
|
|
// // 设置预约患者
|
|
|
// movi.setPatient(patient.getCode());
|
|
|
// movi.setName(patient.getName());
|
|
|
// movi.setSex(patient.getSex());
|
|
|
// movi.setBirthday(patient.getBirthday());
|
|
|
// movi.setPhoto(patient.getPhoto());
|
|
|
// // 设置排班标识
|
|
|
// movi.setScheduling(scheduling);
|
|
|
// // 设置预约日期
|
|
|
// movi.setAppoDate(DateUtil.strToDateAppendNowTime(appo_date, DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
|
// // 设置预约星期
|
|
|
// movi.setAppoWeek(appo_week);
|
|
|
// // 设置预约时段
|
|
|
// movi.setHourBegin(Time.valueOf(hour_begin));
|
|
|
// movi.setHourEnd(Time.valueOf(hour_end));
|
|
|
// // 设置图片
|
|
|
// if(StringUtils.isEmpty(images)){
|
|
|
// images = fetchWxImages();
|
|
|
// }
|
|
|
// if(StringUtils.isNotEmpty(images)){
|
|
|
// images = CommonUtil.copyTempImage(images);
|
|
|
// }
|
|
|
// movi.setImages(images);
|
|
|
// movi.setStatus(0);
|
|
|
// // 默认转诊给健康管理师
|
|
|
// ConsultMoViReferral cmr = null;
|
|
|
// if (target == 2) {
|
|
|
// cmr = new ConsultMoViReferral();
|
|
|
// cmr.setCzrq(new Date());
|
|
|
// cmr.setFlag(0);
|
|
|
// if (target == 2 && StringUtils.isNotEmpty(doctor)) {
|
|
|
// // 已指定医生
|
|
|
// cmr.setTo(doctor);
|
|
|
// } else {
|
|
|
// // 未指定医生,查询患者所在三师团队的健康管理师
|
|
|
// cmr.setTo(doctorTeamService.findHealthDoctorByTeam(movi.getTeam()));
|
|
|
// }
|
|
|
// // 设置排班标识
|
|
|
// cmr.setScheduling(scheduling);
|
|
|
// // 设置预约日期
|
|
|
// cmr.setAppoDate(DateUtil.strToDate(appo_date, DateUtil.YYYY_MM_DD));
|
|
|
// // 设置预约星期
|
|
|
// cmr.setAppoWeek(appo_week);
|
|
|
// // 设置预约时段
|
|
|
// cmr.setHourBegin(Time.valueOf(hour_begin));
|
|
|
// cmr.setHourEnd(Time.valueOf(hour_end));
|
|
|
// }
|
|
|
// // 保存预约信息
|
|
|
// ConsultMoVi temp = consultMoviService.addMoVi(movi, cmr);
|
|
|
// if (temp != null) {
|
|
|
// // 添加到统计队列
|
|
|
// if (target == 2) {
|
|
|
// DoctorStatisticsTask.getInstance(doctorStatisticsService).put(temp.getDoctor(), 1, 2, 0);
|
|
|
// }
|
|
|
// // 推送消息给医生
|
|
|
// PushMsgTask.getInstance().put(movi.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_CONSULT_VIDEO.D_CV_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_CONSULT_VIDEO.视频咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_CONSULT_VIDEO.您有新的视频咨询.name(), temp.getConsult());
|
|
|
// return success("预约成功!");
|
|
|
// } else {
|
|
|
// return error(-1, "预约失败!");
|
|
|
// }
|
|
|
return success("预约成功!");
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
@ -207,58 +75,6 @@ public class ConsultMoviController extends WeixinBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// /**
|
|
|
// * 电话视频咨询列表查询
|
|
|
// * @param page 查询页码,默认为1
|
|
|
// * @param pagesize 每页显示数,默认为10
|
|
|
// * @return
|
|
|
// */
|
|
|
// @RequestMapping(value = "list")
|
|
|
// @ResponseBody
|
|
|
// public String list(String appoDate, int pagesize) {
|
|
|
// try {
|
|
|
// Page<ConsultMoVi> list = consultMoviService.findByPatient(getUID(), DateUtil.strToDateLong(appoDate), pagesize);
|
|
|
// if (list != null) {
|
|
|
// JSONArray jsonArray = new JSONArray();
|
|
|
// for (ConsultMoVi consult : list) {
|
|
|
// if (consult == null) {
|
|
|
// continue;
|
|
|
// }
|
|
|
// JSONObject json = new JSONObject();
|
|
|
// json.put("id", consult.getId());
|
|
|
// // 设置咨询标识
|
|
|
// json.put("code", consult.getConsult());
|
|
|
// // 咨询类型,1电话咨询,2视频咨询
|
|
|
// // json.put("type", consult.getType());
|
|
|
// // 预约类型:1指定医生,2三师预约
|
|
|
// // json.put("target", consult.getTarget());
|
|
|
// // 医生姓名(暂时没有指定医生咨询)
|
|
|
// // json.put("doctor", consult.getDoctor().getName());
|
|
|
// // 三师团队名称
|
|
|
// json.put("team", consult.getTeamName());
|
|
|
// // 预约时间
|
|
|
// json.put("date", DateUtil.dateToStrLong(consult.getAppoDate()));
|
|
|
// // 预约星期
|
|
|
// json.put("week", consult.getAppoWeek());
|
|
|
// // 预约时间段
|
|
|
// json.put("begin", DateUtil.dateToStr(consult.getHourBegin(), DateUtil.HH_MM));
|
|
|
// json.put("end", DateUtil.dateToStr(consult.getHourEnd(), DateUtil.HH_MM));
|
|
|
// // 咨询状态:0待医生同意,-1医生拒绝,1医生同意,2咨询完成
|
|
|
// json.put("status", consult.getStatus());
|
|
|
// // 设置评价标识,未空表示未评价
|
|
|
// json.put("comment", consult.getComment());
|
|
|
// jsonArray.put(json);
|
|
|
// }
|
|
|
// return write(200, "查询成功", list.isFirst(), list.isLast(), list.getTotalElements(), list.getTotalPages(), "list", jsonArray);
|
|
|
// } else {
|
|
|
// return success("查询成功");
|
|
|
// }
|
|
|
// } catch (Exception e) {
|
|
|
// error(e);
|
|
|
// return error(-1, "查询失败!");
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
/**
|
|
|
* 视频咨询评论
|
|
|
* @param consult 视频咨询标识
|
|
@ -266,7 +82,7 @@ public class ConsultMoviController extends WeixinBaseController {
|
|
|
* @param star 星级
|
|
|
* @return 操作结果
|
|
|
*/
|
|
|
@RequestMapping(value = "comment")
|
|
|
@RequestMapping(value = "comment", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
public String comment(String consult, String content, int star) {
|
|
|
try {
|
|
@ -290,7 +106,5 @@ public class ConsultMoviController extends WeixinBaseController {
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "评价失败!");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|