|  | @ -2236,11 +2236,34 @@ public class ConsultTeamService extends ConsultService {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         String endName = "";
 |  |         String endName = "";
 | 
												
													
														
															|  |         String endId = "";
 |  |         String endId = "";
 | 
												
													
														
															|  |         //推送给IM文字消息
 |  | 
 | 
												
													
														
															|  | 
 |  |         //结束咨询才发送推送给IM文字消息
 | 
												
													
														
															|  |         if (endType == 1) {
 |  |         if (endType == 1) {
 | 
												
													
														
															|  |             Patient p = patientDao.findByCode(endOperator);
 |  |             Patient p = patientDao.findByCode(endOperator);
 | 
												
													
														
															|  |             endName = p.getName();
 |  |             endName = p.getName();
 | 
												
													
														
															|  |             endId = p.getCode();
 |  |             endId = p.getCode();
 | 
												
													
														
															|  | 
 |  |         } else {
 | 
												
													
														
															|  | 
 |  |             if (endOperator.equals("admin")) {
 | 
												
													
														
															|  | 
 |  |                 endId = "system";
 | 
												
													
														
															|  | 
 |  |                 endName = "咨询超时未回复,系统自动";
 | 
												
													
														
															|  | 
 |  |             } else {
 | 
												
													
														
															|  | 
 |  |                 Doctor d = doctorDao.findByCode(endOperator);
 | 
												
													
														
															|  | 
 |  |                 endId = d.getCode();
 | 
												
													
														
															|  | 
 |  |                 endName = d.getName();
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         JSONObject obj = ImUtill.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
 | 
												
													
														
															|  | 
 |  |         if (obj == null) {
 | 
												
													
														
															|  | 
 |  |             throw new RuntimeException("IM消息结束异常!");
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         if (obj.getInt("status") == -1) {
 | 
												
													
														
															|  | 
 |  |             throw new RuntimeException(String.valueOf(obj.get("message")));
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         //结束咨询才发送推送给IM文字消息
 | 
												
													
														
															|  | 
 |  |         if (endType == 1) {
 | 
												
													
														
															|  | 
 |  |             Patient p = patientDao.findByCode(endOperator);
 | 
												
													
														
															|  | 
 |  |             endName = p.getName();
 | 
												
													
														
															|  |             if (consultTeam.getType() == 2||consultTeam.getType()==8) {
 |  |             if (consultTeam.getType() == 2||consultTeam.getType()==8) {
 | 
												
													
														
															|  |                 String openId = p.getOpenid();
 |  |                 String openId = p.getOpenid();
 | 
												
													
														
															|  |                 JSONObject json = new JSONObject();
 |  |                 JSONObject json = new JSONObject();
 | 
												
											
												
													
														
															|  | @ -2277,14 +2300,6 @@ public class ConsultTeamService extends ConsultService {
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |         } else {
 |  |         } else {
 | 
												
													
														
															|  |             if (endOperator.equals("admin")) {
 |  | 
 | 
												
													
														
															|  |                 endId = "system";
 |  | 
 | 
												
													
														
															|  |                 endName = "咨询超时未回复,系统自动";
 |  | 
 | 
												
													
														
															|  |             } else {
 |  | 
 | 
												
													
														
															|  |                 Doctor d = doctorDao.findByCode(endOperator);
 |  | 
 | 
												
													
														
															|  |                 endId = d.getCode();
 |  | 
 | 
												
													
														
															|  |                 endName = d.getName();
 |  | 
 | 
												
													
														
															|  |             }
 |  | 
 | 
												
													
														
															|  |             if (consultTeam.getType() == 2||consultTeam.getType()==8) {
 |  |             if (consultTeam.getType() == 2||consultTeam.getType()==8) {
 | 
												
													
														
															|  |                 Patient p = patientDao.findByCode(consultTeam.getPatient());
 |  |                 Patient p = patientDao.findByCode(consultTeam.getPatient());
 | 
												
													
														
															|  |                 String name = p.getName();
 |  |                 String name = p.getName();
 | 
												
											
												
													
														
															|  | @ -2328,13 +2343,7 @@ public class ConsultTeamService extends ConsultService {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         JSONObject obj = ImUtill.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
 |  | 
 | 
												
													
														
															|  |         if (obj == null) {
 |  | 
 | 
												
													
														
															|  |             throw new RuntimeException("IM消息结束异常!");
 |  | 
 | 
												
													
														
															|  |         }
 |  | 
 | 
												
													
														
															|  |         if (obj.getInt("status") == -1) {
 |  | 
 | 
												
													
														
															|  |             throw new RuntimeException(String.valueOf(obj.get("message")));
 |  | 
 | 
												
													
														
															|  |         }
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         consultTeam.setEndMsgId(obj.getString("id"));
 |  |         consultTeam.setEndMsgId(obj.getString("id"));
 | 
												
													
														
															|  |         cons.setEndTime(new Date());
 |  |         cons.setEndTime(new Date());
 | 
												
													
														
															|  |         consultTeam.setEndTime(new Date());
 |  |         consultTeam.setEndTime(new Date());
 |