|
@ -676,13 +676,13 @@ public class ConsultTeamService extends ConsultService {
|
|
|
cd.setDel("1");
|
|
|
cd.setCzrq(new Date());
|
|
|
cd.setTo(ct.getDoctor());
|
|
|
consultDao.save(consult);
|
|
|
consultTeamDoctorDao.save(cd);
|
|
|
// 添加医生咨询日志
|
|
|
String content = addLogs(ct);
|
|
|
|
|
|
//推送给IM文字消息
|
|
|
sendIM(ct.getPatient(), ct.getDoctor(), "1", content);
|
|
|
String returnJson= sendIM(ct.getPatient(), ct.getDoctor(), "1", content);
|
|
|
JSONObject jo=new JSONObject(returnJson);
|
|
|
//设置消息ID
|
|
|
consult.setStartMsgId(jo.getInt("msg_id"));
|
|
|
//推送给IM图片
|
|
|
if (StringUtils.isNotEmpty(ct.getImages())) {
|
|
|
String[] images = ct.getImages().split(",");
|
|
@ -692,6 +692,8 @@ public class ConsultTeamService extends ConsultService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
consultDao.save(consult);
|
|
|
consultTeamDoctorDao.save(cd);
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
@ -702,7 +704,7 @@ public class ConsultTeamService extends ConsultService {
|
|
|
* @param contentType 1文字 2图片消息
|
|
|
* @param content 内容
|
|
|
*/
|
|
|
private void sendIM(String from, String to, String contentType, String content) {
|
|
|
private String sendIM(String from, String to, String contentType, String content) {
|
|
|
String imAddr = SystemConf.getInstance().getImListGet() + "api/v1/chats/pm";
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("from", from));
|
|
@ -710,6 +712,7 @@ public class ConsultTeamService extends ConsultService {
|
|
|
params.add(new BasicNameValuePair("contentType", contentType));
|
|
|
params.add(new BasicNameValuePair("content", content));
|
|
|
String response = HttpClientUtil.post(imAddr, params, "UTF-8");
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -847,6 +850,14 @@ public class ConsultTeamService extends ConsultService {
|
|
|
* @return
|
|
|
*/
|
|
|
public int finish(String consult) {
|
|
|
|
|
|
Consult consultObj=consultDao.findByCode(consult);
|
|
|
ConsultTeam consultTeam=consultTeamDao.findByConsult(consult);
|
|
|
//推送给IM文字消息
|
|
|
String returnJson= sendIM(consultTeam.getPatient(), consultTeam.getDoctor(), "1", "本次咨询结束");;
|
|
|
JSONObject jo=new JSONObject(returnJson);
|
|
|
//设置消息ID
|
|
|
consultObj.setEndMsgId(jo.getInt("msg_id"));
|
|
|
return consultTeamDao.updateStatusByConsult(consult);
|
|
|
}
|
|
|
|
|
@ -1089,11 +1100,13 @@ public class ConsultTeamService extends ConsultService {
|
|
|
cd.setDel("1");
|
|
|
cd.setCzrq(new Date());
|
|
|
cd.setTo(ct.getDoctor());
|
|
|
consultTeamDoctorDao.save(cd);
|
|
|
// 添加医生咨询日志
|
|
|
String content=addLogs(ct);
|
|
|
//推送给IM文字消息
|
|
|
sendIM(ct.getPatient(), ct.getDoctor(), "1", content);
|
|
|
String returnJson= sendIM(ct.getPatient(), ct.getDoctor(), "1", content);;
|
|
|
JSONObject jo=new JSONObject(returnJson);
|
|
|
//设置消息ID
|
|
|
consult.setStartMsgId(jo.getInt("msg_id"));
|
|
|
//推送给IM图片
|
|
|
if (StringUtils.isNotEmpty(ct.getImages())) {
|
|
|
String[] images = ct.getImages().split(",");
|
|
@ -1103,6 +1116,9 @@ public class ConsultTeamService extends ConsultService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
consultTeamDoctorDao.save(cd);
|
|
|
consultDao.save(consult);
|
|
|
}
|
|
|
|
|
|
/**
|