Browse Source

Merge branch 'dev' of linzhuo/patient-co-management into dev

linzhuo 8 years ago
parent
commit
2905f9cec4

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultService.java

@ -127,9 +127,9 @@ public class ConsultService extends BaseService {
			type=0;
		}
		if(type!=0){
			SendPatientUtil.sendToPatient(doctor,doctorName,patient, contentType, content,title,type+"");
			new SendPatientUtil(doctor,doctorName,patient, contentType, content,title,type+"").start();
		}else{
			SendPatientUtil.sendToPatient(doctor,doctorName,patient, contentType, content,title,"2");
			new SendPatientUtil(doctor,doctorName,patient, contentType, content,title,"2").start();
		}
	}
}

+ 25 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SendPatientUtil.java

@ -9,8 +9,27 @@ import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class SendPatientUtil {
	public static String sendToPatient(String from,String fromName,String to,String contentType,String content,String title,String type){
public class SendPatientUtil extends  Thread {
	private String from;
	private String fromName;
	private String to;
	private String contentType;
	private String content;
	private String title;
	private String type;
	public SendPatientUtil(String from,String fromName,String to,String contentType,String content,String title,String type){
		this.from = from;
		this.fromName = fromName;
		this.to = to;
		this.contentType = contentType;
		this.content = content;
		this.title = title;
		this.type = type;
	}
	public String sendToPatient(String from,String fromName,String to,String contentType,String content,String title,String type){
		JSONObject participants = new JSONObject();
		participants.put(from,2);
		participants.put(to,0);
@ -24,4 +43,8 @@ public class SendPatientUtil {
		JSONObject session = sessionJson.getJSONObject("data");
		return ImUtill.sendImMsg(from,fromName,session.getString("id"),contentType,content,"1");
	}
	public void run(){
		this.sendToPatient(from,fromName,to,contentType,content,title,type);
	}
}