|
@ -543,11 +543,18 @@ public class ConsultTeamService extends ConsultService {
|
|
|
* @param logs
|
|
|
* @return
|
|
|
*/
|
|
|
public void reply(List<ConsultTeamLog> logs, String patient) {
|
|
|
public void reply(List<ConsultTeamLog> logs, String patient) throws Exception{
|
|
|
ConsultTeam consultTeam=consultTeamDao.findByConsult(logs.get(0).getConsult());
|
|
|
WlyyTalkGroup wlyyTalkGroup=talkGroupService.findConsultTalkGroupByType(logs.get(0).getConsult(),2);
|
|
|
for (ConsultTeamLog log : logs) {
|
|
|
reply(log, patient, null, log.getType());
|
|
|
//推送给IM
|
|
|
sendIM(patient, log.getDoctor(), log.getChatType()+"", log.getContent());
|
|
|
//判断当前咨询是否创建讨论租
|
|
|
if(wlyyTalkGroup!=null){
|
|
|
sendGroupIM(patient, wlyyTalkGroup.getCode(), log.getChatType()+"", log.getContent());
|
|
|
}else{
|
|
|
//推送给IM
|
|
|
sendIM(patient, consultTeam.getDoctor(), log.getChatType()+"", log.getContent());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -721,7 +728,24 @@ public class ConsultTeamService extends ConsultService {
|
|
|
String response = HttpClientUtil.post(imAddr, params, "UTF-8");
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发送消息给IM
|
|
|
* @param from 来自
|
|
|
* @param groupCode
|
|
|
* @param contentType 1文字 2图片消息
|
|
|
* @param content 内容
|
|
|
*/
|
|
|
private String sendGroupIM(String from, String groupCode, String contentType, String content) {
|
|
|
String imAddr = SystemConf.getInstance().getImListGet() + "api/v1/chats/gm";
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("from", from));
|
|
|
params.add(new BasicNameValuePair("group", groupCode));
|
|
|
params.add(new BasicNameValuePair("groupType","1"));
|
|
|
params.add(new BasicNameValuePair("contentType", contentType));
|
|
|
params.add(new BasicNameValuePair("content", content));
|
|
|
String response = HttpClientUtil.post(imAddr, params, "UTF-8");
|
|
|
return response;
|
|
|
}
|
|
|
/**
|
|
|
* 添加三师咨询日志
|
|
|
*
|