| 
					
				 | 
			
			
				@ -8,6 +8,7 @@ import com.yihu.jw.entity.base.im.ConsultTeamDo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.BasePatientDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.wx.WxWechatDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.message.SystemMessageDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.file_upload.FileUploadService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.prescription.service.PrescriptionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.im.service.ImService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -20,6 +21,7 @@ import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.base.BaseRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.patient.PatientRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.FileUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.IdCardUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.WechatDao; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -33,6 +35,7 @@ import org.apache.axis.utils.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.slf4j.Logger; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.slf4j.LoggerFactory; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.net.URLEncoder; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -80,6 +83,14 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					private BasePatientDao basePatientDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					FileUploadService fileUploadService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public FileUtil fileUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@Value("${fastDFS.fastdfs_file_url}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					private String fastdfs_file_url; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@GetMapping(value = BaseHospitalRequestMapping.PatientIM.records) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "患者咨询记录查询") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop records( 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -214,11 +225,30 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "type",required = true) Integer type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "times", value = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "times",required = false) Integer times, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "wechat_appid", value = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "wechat_appid", value = "来源:xm_ihealth_wx厦门i健康,xm_zsyy_wx中山医院") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "wechat_appid",required = false) String wechat_appid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@ApiParam(name = "patientCode", value = "居民CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							@RequestParam(value = "patientCode",required = false) String patientCode) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						List<String> failed = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//处理语音文件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(!org.springframework.util.StringUtils.isEmpty(wechat_appid)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							String path = imService.fetchWxVoices(wechat_appid); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							JSONObject obj = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							// 将临时语音拷贝到正式存储路径下 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							if (org.apache.commons.lang3.StringUtils.isNotEmpty(path)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								if("xm_ihealth_wx".equals(wechat_appid)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									content = fileUploadService.uploadWxVoice(path); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//					uploadVO.setFullUri(map.get("accessory").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								}else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
									content = fileUtil.copyTempVoice(path,fastdfs_file_url); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								obj.put("path", path); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								obj.put("times", times); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
								content = obj.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						failed = imService.append(consult,content,type,times,patientCode,wechat_appid); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return success(failed); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -228,7 +258,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public ListEnvelop findDoctorByHospitalAndDiseaseAndDept(@ApiParam(name = "iswork", value = "机构code") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
																				 @RequestParam(value = "iswork", required = false)String iswork, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							                                       @ApiParam(name = "orgCode", value = "机构code") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                               @RequestParam(value = "orgCode", required = false,defaultValue = "350211A1002")String orgCode, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                               @RequestParam(value = "orgCode", required = false)String orgCode, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                               @ApiParam(name = "dept", value = "部门code") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                               @RequestParam(value = "dept", required = false)String dept, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                               @ApiParam(name = "diseaseKey", value = "疾病名称关键字") 
			 |