|
@ -8,9 +8,11 @@ import com.yihu.wlyy.entity.discussion.WlyyTalkGroup;
|
|
import com.yihu.wlyy.entity.discussion.WlyyTalkGroupMember;
|
|
import com.yihu.wlyy.entity.discussion.WlyyTalkGroupMember;
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
import com.yihu.wlyy.entity.patient.SignFamilyServer;
|
|
import com.yihu.wlyy.entity.patient.SignFamilyServer;
|
|
import com.yihu.wlyy.entity.patient.prescription.Prescription;
|
|
import com.yihu.wlyy.entity.patient.prescription.Prescription;
|
|
import com.yihu.wlyy.repository.consult.ConsultDao;
|
|
import com.yihu.wlyy.repository.consult.ConsultDao;
|
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
import com.yihu.wlyy.repository.patient.SignFamilyServerDao;
|
|
import com.yihu.wlyy.repository.patient.SignFamilyServerDao;
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
|
|
import com.yihu.wlyy.service.app.account.DoctorInfoService;
|
|
import com.yihu.wlyy.service.app.account.DoctorInfoService;
|
|
@ -34,11 +36,7 @@ import org.json.JSONObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
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;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@ -48,7 +46,7 @@ import java.util.Map;
|
|
*
|
|
*
|
|
* @author George
|
|
* @author George
|
|
*/
|
|
*/
|
|
@Controller
|
|
|
|
|
|
@RestController
|
|
@RequestMapping(value = "/doctor/consult", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
@RequestMapping(value = "/doctor/consult", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
@Api(description = "三师咨询")
|
|
@Api(description = "三师咨询")
|
|
public class DoctorConsultController extends WeixinBaseController {
|
|
public class DoctorConsultController extends WeixinBaseController {
|
|
@ -70,7 +68,7 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private CommonUtil CommonUtil;
|
|
private CommonUtil CommonUtil;
|
|
@Autowired
|
|
@Autowired
|
|
private ImUtill ImUtill;
|
|
|
|
|
|
private ImUtill imUtill;
|
|
@Autowired
|
|
@Autowired
|
|
private PushMsgTask pushMsgTask;
|
|
private PushMsgTask pushMsgTask;
|
|
@Autowired
|
|
@Autowired
|
|
@ -83,6 +81,8 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
private PrescriptionDiagnosisService prescriptionDiagnosisService;
|
|
private PrescriptionDiagnosisService prescriptionDiagnosisService;
|
|
@Autowired
|
|
@Autowired
|
|
private FollowUpService followUpService;
|
|
private FollowUpService followUpService;
|
|
|
|
@Autowired
|
|
|
|
private SignFamilyDao signFamilyDao;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 三师咨询列表查询
|
|
* 三师咨询列表查询
|
|
@ -1113,7 +1113,7 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
if (consultModel == null) {
|
|
if (consultModel == null) {
|
|
return error(-1, "咨询记录不存在!");
|
|
return error(-1, "咨询记录不存在!");
|
|
}
|
|
}
|
|
JSONObject messageObj = ImUtill.getTopicMessage(consultModel.getConsult(), consultModel.getStartMsgId(), consultModel.getEndMsgId(), page, pagesize, getUID());
|
|
|
|
|
|
JSONObject messageObj = imUtill.getTopicMessage(consultModel.getConsult(), consultModel.getStartMsgId(), consultModel.getEndMsgId(), page, pagesize, getUID());
|
|
return write(200, "查询成功", "list", messageObj);
|
|
return write(200, "查询成功", "list", messageObj);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
error(e);
|
|
error(e);
|
|
@ -1215,4 +1215,60 @@ public class DoctorConsultController extends WeixinBaseController {
|
|
return error(-1,"获取失败");
|
|
return error(-1,"获取失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "sendBusinessCard",method = RequestMethod.POST)
|
|
|
|
@ApiOperation("发送居民的名片")
|
|
|
|
public String sendBusinessCard(@ApiParam(name = "patient", value = "居民code", defaultValue = "")
|
|
|
|
@RequestParam(value = "patient", required = true) String patient,
|
|
|
|
@ApiParam(name = "sessionId", value = "会话id", defaultValue = "")
|
|
|
|
@RequestParam(value = "sessionId", required = true) String sessionId,
|
|
|
|
@ApiParam(name = "businessType", value = "businessType", defaultValue = "1")
|
|
|
|
@RequestParam(value = "businessType", required = true) String businessType){
|
|
|
|
try {
|
|
|
|
String doctorCode = getUID();
|
|
|
|
Doctor doctor = doctorService.findDoctorByCode(doctorCode);
|
|
|
|
Patient p = patientService.findByCode(patient);
|
|
|
|
com.alibaba.fastjson.JSONObject content = new com.alibaba.fastjson.JSONObject();
|
|
|
|
content.put("name",p.getName());
|
|
|
|
content.put("patient",patient);
|
|
|
|
content.put("photo",p.getPhoto());
|
|
|
|
content.put("age",IdCardUtil.getAgeForIdcard(p.getIdcard()));
|
|
|
|
content.put("sex",IdCardUtil.getSexForIdcard(p.getIdcard()));
|
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patient);
|
|
|
|
if(signFamily!=null){
|
|
|
|
content.put("hospitalName",signFamily.getHospitalName());
|
|
|
|
}
|
|
|
|
imUtill.sendImMsg(doctorCode,doctor.getName(),sessionId,ImUtill.ContentType.personalCard.getValue(),content.toString(),businessType);
|
|
|
|
return success("发送成功");
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
return error(-1,"发送失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "messageForward",method = RequestMethod.POST)
|
|
|
|
@ApiOperation("请求转发消息")
|
|
|
|
public String messageForward(@ApiParam(name = "senderId", value = "发送者id", defaultValue = "")
|
|
|
|
@RequestParam(value = "senderId", required = true) String senderId,
|
|
|
|
@ApiParam(name = "senderName", value = "发送者姓名", defaultValue = "")
|
|
|
|
@RequestParam(value = "senderName", required = true) String senderName,
|
|
|
|
@ApiParam(name = "sessionId", value = "会话id", defaultValue = "")
|
|
|
|
@RequestParam(value = "sessionId", required = true) String sessionId,
|
|
|
|
@ApiParam(name = "content", value = "会话内容", defaultValue = "")
|
|
|
|
@RequestParam(value = "content", required = true) String content,
|
|
|
|
@ApiParam(name = "title", value = "会话标题", defaultValue = "")
|
|
|
|
@RequestParam(value = "title", required = true) String title,
|
|
|
|
@ApiParam(name = "sessionType", value = "原会话的会话类型", defaultValue = "")
|
|
|
|
@RequestParam(value = "sessionType", required = true) String sessionType,
|
|
|
|
@ApiParam(name = "businessType", value = "businessType", defaultValue = "1")
|
|
|
|
@RequestParam(value = "businessType", required = true) String businessType){
|
|
|
|
try{
|
|
|
|
String message = consultTeamService.getMessageById(sessionType,content,title);
|
|
|
|
imUtill.sendImMsg(senderId,senderName,sessionId,ImUtill.ContentType.messageForward.getValue(),message,businessType);
|
|
|
|
return success("发送成功");
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
return error(-1,"发送失败");
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|