|
@ -1,15 +1,9 @@
|
|
|
package com.yihu.wlyy.util;
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.http.NameValuePair;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
public class SendPatientUtil extends Thread {
|
|
|
private String from;
|
|
|
private String fromName;
|
|
@ -51,12 +45,16 @@ public class SendPatientUtil extends Thread {
|
|
|
if(!"4".equals(contentType)){
|
|
|
contentType = "0";
|
|
|
}
|
|
|
JSONObject sessionJson = imUtill.createSession(participants,ImUtill.SESSION_TYPE_MUC,title,to+"_"+teamCode+"_"+type);
|
|
|
if(sessionJson.getInt("status")==-1){
|
|
|
throw new RuntimeException(sessionJson.getString("message"));
|
|
|
|
|
|
String sessionId = to+"_"+teamCode+"_"+type;
|
|
|
Boolean flag = imUtill.sessionIsExist(sessionId);
|
|
|
if(!flag){
|
|
|
JSONObject sessionJson = imUtill.createSession(participants,ImUtill.SESSION_TYPE_MUC,title,sessionId);
|
|
|
if(sessionJson.getInt("status")==-1){
|
|
|
throw new RuntimeException(sessionJson.getString("message"));
|
|
|
}
|
|
|
}
|
|
|
JSONObject session = sessionJson.getJSONObject("data");
|
|
|
return imUtill.sendImMsg(from,fromName,session.getString("id"),contentType,content,"1");
|
|
|
return imUtill.sendImMsg(from,fromName,sessionId,contentType,content,"1");
|
|
|
}
|
|
|
|
|
|
public void run(){
|