|
@ -703,7 +703,7 @@ public class ConsultTeamService extends ConsultService {
|
|
|
DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findDoctorJiating2ByTeam(doctorTeam.getCode(), 2);
|
|
|
if (doctorTeamMemberHealthy == null) {
|
|
|
ct.setDoctor(doctorTeamMember.getMemberCode());
|
|
|
users.put(doctorTeamMemberHealthy.getMemberCode(),0);
|
|
|
users.put(doctorTeamMember.getMemberCode(),0);
|
|
|
}else{
|
|
|
users.put(doctorTeamMemberHealthy.getMemberCode(),0);
|
|
|
if(doctorTeamMember!=null){
|
|
@ -1492,6 +1492,7 @@ public class ConsultTeamService extends ConsultService {
|
|
|
// 设置患者信息
|
|
|
ct.setPatient(uid);
|
|
|
Doctor doctorTemp = doctorDao.findByCode(uid);
|
|
|
Doctor doctor = doctorDao.findByCode(ct.getDoctor());
|
|
|
// 设置医生姓名
|
|
|
ct.setName(doctorTemp.getName());
|
|
|
// 设置医生生日
|
|
@ -1520,28 +1521,45 @@ public class ConsultTeamService extends ConsultService {
|
|
|
cd.setTo(ct.getDoctor());
|
|
|
// 添加医生咨询日志
|
|
|
String content = addLogs(ct);
|
|
|
JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(),doctorTemp.getName(),consult.getTitle(),content,consult.getImages());
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put(ct.getPatient(),0);
|
|
|
jsonObject.put(ct.getDoctor(),0);
|
|
|
//设置消息ID
|
|
|
JSONObject obj = ImUtill.createTopics(null,consult.getCode(),doctorTemp.getName(),jsonObject,messages,"2");
|
|
|
if(obj==null||obj.getInt("status")==-1){
|
|
|
throw new RuntimeException("im消息创建异常!"+obj==null?"":obj.getString("message"));
|
|
|
}
|
|
|
ct.setStartMsgId(obj.get("start_msg_id").toString());
|
|
|
//转发咨询问题
|
|
|
if(StringUtils.isNotBlank(oldConsultCode)){
|
|
|
if(StringUtils.isBlank(oldConsultCode)) {
|
|
|
JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(), doctorTemp.getName(), consult.getTitle(), content, consult.getImages());
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put(ct.getPatient(), 0);
|
|
|
jsonObject.put(ct.getDoctor(), 0);
|
|
|
//设置消息ID
|
|
|
JSONObject obj = ImUtill.createTopics(null, consult.getCode(), doctorTemp.getName(), jsonObject, messages, "2");
|
|
|
if (obj == null || obj.getInt("status") == -1) {
|
|
|
throw new RuntimeException("im消息创建异常!" + obj == null ? "" : obj.getString("message"));
|
|
|
}
|
|
|
ct.setStartMsgId(obj.get("start_msg_id").toString());
|
|
|
}else{
|
|
|
//转发咨询问题
|
|
|
Consult oldConsult = consultDao.findByCode(oldConsultCode);
|
|
|
ct.setTeam(oldConsultCode);
|
|
|
if(oldConsult!=null&&isSend==1){
|
|
|
ImUtill.sendTopicIM(doctorTemp.getCode(),doctorTemp.getName(),consult.getCode(),"6",oldConsult.getSymptoms());
|
|
|
if(StringUtils.isNotBlank(oldConsult.getImages())){
|
|
|
String imgs[] = oldConsult.getImages().split(",");
|
|
|
JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(), doctorTemp.getName(), consult.getTitle(), oldConsult.getSymptoms(), oldConsult.getImages());
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put(ct.getPatient(), 0);
|
|
|
jsonObject.put(ct.getDoctor(), 0);
|
|
|
JSONObject obj = ImUtill.createTopics(null, consult.getCode(), doctorTemp.getName(), jsonObject, messages, "2");
|
|
|
if (obj == null || obj.getInt("status") == -1) {
|
|
|
throw new RuntimeException("im消息创建异常!" + obj == null ? "" : obj.getString("message"));
|
|
|
}
|
|
|
ct.setStartMsgId(obj.get("start_msg_id").toString());
|
|
|
ImUtill.sendTopicIM(doctorTemp.getCode(),doctorTemp.getName(),consult.getCode(),"6",content);
|
|
|
if(StringUtils.isNotBlank(consult.getImages())){
|
|
|
String imgs[] = consult.getImages().split(",");
|
|
|
for(String url :imgs)
|
|
|
ImUtill.sendTopicIM(doctorTemp.getCode(),doctorTemp.getName(),consult.getCode(),"2",url);
|
|
|
}
|
|
|
}
|
|
|
JSONObject qiuzuObj = new JSONObject();
|
|
|
qiuzuObj.put("session_id",oldConsult.getPatient()+"_consult_"+consult.getType());
|
|
|
qiuzuObj.put("patient",ct.getPatient());
|
|
|
qiuzuObj.put("old_consult_code",oldConsultCode);
|
|
|
qiuzuObj.put("doctor",ct.getDoctor());
|
|
|
qiuzuObj.put("doctor_name",doctor.getName());
|
|
|
ImUtill.sendTopicIM(doctorTemp.getCode(),doctorTemp.getName(),oldConsultCode,"5",qiuzuObj.toString());
|
|
|
}
|
|
|
consultTeamDao.save(ct); // 保存医生咨询信息
|
|
|
consultTeamDoctorDao.save(cd);
|
|
@ -1567,7 +1585,7 @@ public class ConsultTeamService extends ConsultService {
|
|
|
throw new RuntimeException("IM消息结束异常!");
|
|
|
}
|
|
|
if(obj.getInt("status")==-1){
|
|
|
throw new RuntimeException(obj.getString("message"));
|
|
|
throw new RuntimeException(String.valueOf(obj.get("message")));
|
|
|
}
|
|
|
consultTeam.setType(endType);
|
|
|
consultTeam.setEndMsgId(obj.getString("id"));
|