|
@ -760,7 +760,7 @@ public class ConsultTeamService extends ConsultService {
|
|
|
messages.put("senderId",patient);
|
|
|
messages.put("senderName",tempPatient.getName());
|
|
|
users.put(patient,0);
|
|
|
JSONObject obj = createTopics(patient,consult.getCode(),"咨询问题:"+consult.getSymptoms(),users,messages);
|
|
|
JSONObject obj = createTopics(UUID.randomUUID().toString(),consult.getCode(),"咨询问题:"+consult.getSymptoms(),users,messages,"1");
|
|
|
if(obj==null){
|
|
|
throw new RuntimeException("IM消息结束异常!");
|
|
|
}
|
|
@ -771,6 +771,8 @@ public class ConsultTeamService extends ConsultService {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 发送消息给IM
|
|
|
*
|
|
@ -797,14 +799,15 @@ public class ConsultTeamService extends ConsultService {
|
|
|
* @param topicName 议题名称
|
|
|
* @param participants 成员
|
|
|
*/
|
|
|
private JSONObject createTopics(String sessionId, String topicId,String topicName, JSONObject participants,JSONObject messages) {
|
|
|
private JSONObject createTopics(String sessionId, String topicId,String topicName, JSONObject participants,JSONObject messages,String sessionType) {
|
|
|
String imAddr = SystemConf.getInstance().getImListGet() + "api/v2/sessions/"+sessionId+"/topics";
|
|
|
JSONObject params = new JSONObject();
|
|
|
params.put("topicId", topicId);
|
|
|
params.put("topicName", topicName);
|
|
|
params.put("topic_id", topicId);
|
|
|
params.put("topic_name", topicName);
|
|
|
params.put("participants", participants.toString());
|
|
|
params.put("messages", messages.toString());
|
|
|
params.put("sessionId", sessionId);;
|
|
|
params.put("session_id", sessionId);
|
|
|
params.put("session_type", sessionType);
|
|
|
String ret = HttpClientUtil.postBody(imAddr,params);
|
|
|
JSONObject obj = null;
|
|
|
try{
|
|
@ -1286,7 +1289,7 @@ public class ConsultTeamService extends ConsultService {
|
|
|
messages.put("description",consult.getSymptoms());
|
|
|
messages.put("title",consult.getTitle());
|
|
|
messages.put("img",consult.getImages());
|
|
|
JSONObject obj = createTopics(String.valueOf(jsonObject.hashCode()),consult.getCode(),consult.getSymptoms(),jsonObject,messages);
|
|
|
JSONObject obj = createTopics(String.valueOf(jsonObject.hashCode()),consult.getCode(),consult.getSymptoms(),jsonObject,messages,"2");
|
|
|
if(obj==null){
|
|
|
throw new RuntimeException("im消息创建异常!");
|
|
|
}
|
|
@ -1403,7 +1406,7 @@ public class ConsultTeamService extends ConsultService {
|
|
|
jsonObject.put(ct.getPatient(),0);
|
|
|
jsonObject.put(ct.getDoctor(),0);
|
|
|
//设置消息ID
|
|
|
JSONObject obj = createTopics(String.valueOf(jsonObject.hashCode()),consult.getCode(),"咨询求助:"+doctorTemp.getName(),jsonObject,messages);
|
|
|
JSONObject obj = createTopics(String.valueOf(jsonObject.hashCode()),consult.getCode(),"咨询求助:"+doctorTemp.getName(),jsonObject,messages,"2");
|
|
|
if(obj==null){
|
|
|
throw new RuntimeException("im消息创建异常!");
|
|
|
}
|