| 
					
				 | 
			
			
				@ -22,6 +22,7 @@ import com.yihu.jw.entity.hospital.prescription.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.order.BusinessOrderDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.es.service.StatisticsEsService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.file_upload.FileUploadService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -53,6 +54,7 @@ import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.patient.PatientRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.sms.service.YkyyINSMSService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.FileUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.XMLUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.BasePatientWechatDao; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -195,6 +197,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private SystemMessageService systemMessageService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private ConsultDao consultDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    FileUploadService fileUploadService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private FileUtil fileUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${fastDFS.fastdfs_file_url}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String fastdfs_file_url; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1602,4 +1610,68 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                      @RequestParam(value = "idCard", required = false)String idCard) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success(prescriptionService.findByIdCard(idCard)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @PostMapping(value = "updateChannelId") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "保存云信channelId", notes = "保存云信channelId") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop updateChannelId(@ApiParam(name = "id", value = "outpatientId") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                      @RequestParam(value = "id", required = false)String id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                      @ApiParam(name = "channelId", value = "渠道id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                      @RequestParam(value = "channelId", required = false)String channelId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        prescriptionService.updateChannelId(id,channelId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success("保存成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @PostMapping(value = "uploadFileToWx") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "上传语音文件或者视频") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop append( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "type", value = "追问内容类型:1文字,2图片,3语音  ... (im消息类型)") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "type",required = true) Integer type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "times", value = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "times",required = false) Integer times) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject object = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //处理语音文件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!org.springframework.util.StringUtils.isEmpty(wxId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//			imService.getInputStream("1",wechat_appid); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(3 == type){//语音文件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String voicepath = imService.fetchWxVoices(wxId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("voice_path:"+voicepath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject obj = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String voiceurl = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                // 将临时语音拷贝到正式存储路径下 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (org.apache.commons.lang3.StringUtils.isNotEmpty(voicepath)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if("xm_ihealth_wx".equals(wxId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("voice_wx_type:"+wxId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        voiceurl = fileUploadService.uploadWxVoice(voicepath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					uploadVO.setFullUri(map.get("accessory").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        voiceurl = fileUtil.copyTempVoice(voicepath,fastdfs_file_url); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    obj.put("path", voiceurl); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    obj.put("times", times); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                object.put("path",voiceurl); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if(2 == type){//图片文件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String imagepath = imService.fetchWxImages(wxId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("image_path:"+imagepath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject obj = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String imgeUrl = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                // 将临时语音拷贝到正式存储路径下 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (org.apache.commons.lang3.StringUtils.isNotEmpty(imagepath)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if("xm_ihealth_wx".equals(wxId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("imge_wx_type:"+wxId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        imgeUrl = fileUploadService.uploadWxImage(imagepath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					uploadVO.setFullUri(map.get("accessory").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        imgeUrl = fileUtil.copyTempVoice(imagepath,fastdfs_file_url); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    object.put("path",imgeUrl); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else{} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success(object); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |