|  | @ -17,6 +17,7 @@ import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.ykyy.service.YkyyService;
 | 
	
		
			
				|  |  | import com.yihu.jw.im.dao.ConsultDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.im.service.ImService;
 | 
	
		
			
				|  |  | import com.yihu.jw.im.util.ImUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.order.BusinessOrderService;
 | 
	
		
			
				|  |  | import com.yihu.jw.patient.dao.BasePatientDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.patient.service.BasePatientService;
 | 
	
	
		
			
				|  | @ -101,6 +102,9 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 	@Autowired
 | 
	
		
			
				|  |  | 	private YkyyService ykyyService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 	@Autowired
 | 
	
		
			
				|  |  | 	public ImUtil imUtil;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 	@Value("${fastDFS.fastdfs_file_url}")
 | 
	
		
			
				|  |  | 	private String fastdfs_file_url;
 | 
	
	
		
			
				|  | @ -716,11 +720,27 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "导诊的咨询对话", notes = "导诊的咨询对话")
 | 
	
		
			
				|  |  | 	public Envelop getPatientGuaidenceConsult(@ApiParam(name = "patientCode", value = "居民CODE")
 | 
	
		
			
				|  |  | 	                       @RequestParam(value = "patientCode", required = true)String patientCode) throws Exception {
 | 
	
		
			
				|  |  | 		String session_id = patientCode+"_guidance_14";
 | 
	
		
			
				|  |  | 		session_id = imService.getPatientGuaidenceConsult(patientCode,session_id);
 | 
	
		
			
				|  |  | 		String session_id = session_id = patientCode+"_guidance_14";
 | 
	
		
			
				|  |  | 		session_id = imService.getPatientGuaidenceConsult(patientCode,session_id,null);
 | 
	
		
			
				|  |  | 		return success(session_id);
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.sessionIsExist)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "判断导诊sessionId是否存在", notes = "判断导诊sessionId是否存在")
 | 
	
		
			
				|  |  | 	public Envelop sessionIsExist(@ApiParam(name = "patientCode", value = "居民CODE")
 | 
	
		
			
				|  |  | 											  @RequestParam(value = "patientCode", required = true)String patientCode,
 | 
	
		
			
				|  |  | 											  @ApiParam(name = "type", value = "type")
 | 
	
		
			
				|  |  | 											  @RequestParam(value = "type", required = false)String type) throws Exception {
 | 
	
		
			
				|  |  | 		String session_id = null;
 | 
	
		
			
				|  |  | 		if (org.apache.commons.lang3.StringUtils.isNoneBlank(type)){
 | 
	
		
			
				|  |  | 			session_id = patientCode+"_guidance_"+type;
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 		Boolean re = imUtil.sessionIsExist(session_id);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 		return success(re);
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.updateConsultParticipant)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "更新会话成员(新增或删除)", notes = "更新会话成员(新增或删除)")
 | 
	
	
		
			
				|  | @ -742,12 +762,15 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 			@ApiParam(name = "sender_name", value = "发送者姓名", defaultValue = "")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "sender_name", required = true) String sender_name,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "session_id", value = "session_id", defaultValue = "")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "session_id", required = true) String session_id,
 | 
	
		
			
				|  |  | 			@RequestParam(value = "session_id", required = false) String session_id,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "content_type", value = "内容类型", defaultValue = "")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "content_type", required = true) String content_type,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "content", value = "消息内容", defaultValue = "")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "content", required = true) String content
 | 
	
		
			
				|  |  | 	)throws Exception{
 | 
	
		
			
				|  |  | 		if (!org.apache.commons.lang3.StringUtils.isNoneBlank(session_id)){
 | 
	
		
			
				|  |  | 			session_id = imService.getPatientGuaidenceConsult(sender_id,session_id,content_type);
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 		String result = imService.patientGuaidenceAppend(sender_id,sender_name,session_id,content_type,content,"1");
 | 
	
		
			
				|  |  | 		return success(result);
 | 
	
		
			
				|  |  | 	}
 |