|  | @ -118,7 +118,6 @@ public class ImService {
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     public ImUtil imUtil;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public FileUtil fileUtil;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     protected HttpServletRequest request;
 | 
	
	
		
			
				|  | @ -3225,13 +3224,18 @@ public class ImService {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             String msg2 = "医生已接诊,该候诊将自动结束";
 | 
	
		
			
				|  |  | //            String msg2 = "医生已完成接诊,您可以点击右上角的【结束咨询】按钮,结束当前候诊";
 | 
	
		
			
				|  |  |             //踢出非客服的医生
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             if (imUtil.sessionIsExist(session_id26)) {
 | 
	
		
			
				|  |  |                 imUtil.sendImMsg(sender_id, sender_name, session_id26, "51", json.toJSONString(), "1", null);
 | 
	
		
			
				|  |  |                 imUtil.sendImMsg(sender_id, sender_name, session_id26, "52", msg2, "1", null);
 | 
	
		
			
				|  |  |                 sendDaozhenWaicengMessage(session_id26,sender_id);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if (imUtil.sessionIsExist(session_id27)) {
 | 
	
		
			
				|  |  |                 imUtil.sendImMsg(sender_id, sender_name, session_id27, "51", json.toJSONString(), "1", null);
 | 
	
		
			
				|  |  |                 imUtil.sendImMsg(sender_id, sender_name, session_id27, "52", msg2, "1", null);
 | 
	
		
			
				|  |  |                 sendDaozhenWaicengMessage(session_id27,sender_id);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
	
		
			
				|  | @ -3239,6 +3243,25 @@ public class ImService {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 发送外层导诊消息
 | 
	
		
			
				|  |  |      * @param session_id
 | 
	
		
			
				|  |  |      * @param sender_id
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void sendDaozhenWaicengMessage(String session_id,String sender_id){
 | 
	
		
			
				|  |  |         String participantsSql = "SELECT p.participant_id from im.participants p,base_doctor d " +
 | 
	
		
			
				|  |  |                 "WHERE p.session_id='"+session_id+"' and p.participant_id=d.id and p.participant_id!='customer'";
 | 
	
		
			
				|  |  |         List<Map<String,Object>> participantsList = jdbcTemplate.queryForList(participantsSql);
 | 
	
		
			
				|  |  |         for (Map<String,Object> participants:participantsList){
 | 
	
		
			
				|  |  |             System.out.println("发送外层SOCKET消息:协同门诊医生抢单之后,通知全科医生修改状态");
 | 
	
		
			
				|  |  |             JSONObject object = new JSONObject();
 | 
	
		
			
				|  |  |             object.put("socket_sms_type",15);
 | 
	
		
			
				|  |  |             object.put("relation_code",session_id);
 | 
	
		
			
				|  |  |             sendWaiSocketMessage(sender_id,participants.get("participant_id")+"",object.toString(),"1");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 导诊的咨询对话
 | 
	
		
			
				|  |  |      *
 | 
	
	
		
			
				|  | @ -4570,7 +4593,7 @@ public class ImService {
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public MixEnvelop recordByDoctor(String doctor, String id, String type, Integer status, String title, String start_time, String end_time, String patient) { //
 | 
	
		
			
				|  |  |     public MixEnvelop recordByDoctor(String doctor, String id, String type, Integer status, String title, String start_time, String end_time, String patient,String dept) { //
 | 
	
		
			
				|  |  |         String sql = "";
 | 
	
		
			
				|  |  |         sql = "SELECT\n" +
 | 
	
		
			
				|  |  |                 "\ta.patient_name AS \"pname\",\n" +
 | 
	
	
		
			
				|  | @ -4663,6 +4686,10 @@ public class ImService {
 | 
	
		
			
				|  |  |         if (!StringUtils.isEmpty(id)) {
 | 
	
		
			
				|  |  |             sql += " and a.id = '" + id + "'";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if (!StringUtils.isEmpty(dept)) {
 | 
	
		
			
				|  |  |             sql += " and a.dept = '" + dept + "'";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         sql = sql + "\tORDER BY a.create_time desc ";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(sql);
 |