|  | @ -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.patient.BasePatientDO;
 | 
												
													
														
															|  | import com.yihu.jw.entity.base.wx.WxWechatDO;
 |  | import com.yihu.jw.entity.base.wx.WxWechatDO;
 | 
												
													
														
															|  | import com.yihu.jw.entity.hospital.message.SystemMessageDO;
 |  | 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.prescription.service.PrescriptionService;
 | 
												
													
														
															|  | import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
 |  | import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
 | 
												
													
														
															|  | import com.yihu.jw.im.service.ImService;
 |  | 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.base.BaseRequestMapping;
 | 
												
													
														
															|  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
												
													
														
															|  | import com.yihu.jw.rm.patient.PatientRequestMapping;
 |  | 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.common.IdCardUtil;
 | 
												
													
														
															|  | import com.yihu.jw.util.date.DateUtil;
 |  | import com.yihu.jw.util.date.DateUtil;
 | 
												
													
														
															|  | import com.yihu.jw.wechat.dao.WechatDao;
 |  | import com.yihu.jw.wechat.dao.WechatDao;
 | 
												
											
												
													
														
															|  | @ -33,6 +35,7 @@ import org.apache.axis.utils.StringUtils;
 | 
												
													
														
															|  | import org.slf4j.Logger;
 |  | import org.slf4j.Logger;
 | 
												
													
														
															|  | import org.slf4j.LoggerFactory;
 |  | import org.slf4j.LoggerFactory;
 | 
												
													
														
															|  | import org.springframework.beans.factory.annotation.Autowired;
 |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
												
													
														
															|  | 
 |  | import org.springframework.beans.factory.annotation.Value;
 | 
												
													
														
															|  | import org.springframework.web.bind.annotation.*;
 |  | import org.springframework.web.bind.annotation.*;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | import java.net.URLEncoder;
 |  | import java.net.URLEncoder;
 | 
												
											
												
													
														
															|  | @ -80,6 +83,14 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  | 	@Autowired
 |  | 	@Autowired
 | 
												
													
														
															|  | 	private BasePatientDao basePatientDao;
 |  | 	private BasePatientDao basePatientDao;
 | 
												
													
														
															|  | 	
 |  | 	
 | 
												
													
														
															|  | 
 |  | 	@Autowired
 | 
												
													
														
															|  | 
 |  | 	FileUploadService fileUploadService;
 | 
												
													
														
															|  | 
 |  | 	
 | 
												
													
														
															|  | 
 |  | 	public FileUtil fileUtil;
 | 
												
													
														
															|  | 
 |  | 	
 | 
												
													
														
															|  | 
 |  | 	@Value("${fastDFS.fastdfs_file_url}")
 | 
												
													
														
															|  | 
 |  | 	private String fastdfs_file_url;
 | 
												
													
														
															|  | 
 |  | 	
 | 
												
													
														
															|  | 	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.records)
 |  | 	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.records)
 | 
												
													
														
															|  | 	@ApiOperation(value = "患者咨询记录查询")
 |  | 	@ApiOperation(value = "患者咨询记录查询")
 | 
												
													
														
															|  | 	public Envelop records(
 |  | 	public Envelop records(
 | 
												
											
												
													
														
															|  | @ -214,11 +225,30 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
 | 
												
													
														
															|  | 			@RequestParam(value = "type",required = true) Integer type,
 |  | 			@RequestParam(value = "type",required = true) Integer type,
 | 
												
													
														
															|  | 			@ApiParam(name = "times", value = "")
 |  | 			@ApiParam(name = "times", value = "")
 | 
												
													
														
															|  | 			@RequestParam(value = "times",required = false) Integer times,
 |  | 			@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,
 |  | 			@RequestParam(value = "wechat_appid",required = false) String wechat_appid,
 | 
												
													
														
															|  | 			@ApiParam(name = "patientCode", value = "居民CODE")
 |  | 			@ApiParam(name = "patientCode", value = "居民CODE")
 | 
												
													
														
															|  | 			@RequestParam(value = "patientCode",required = false) String patientCode) throws Exception {
 |  | 			@RequestParam(value = "patientCode",required = false) String patientCode) throws Exception {
 | 
												
													
														
															|  | 		List<String> failed = new ArrayList<>();
 |  | 		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);
 |  | 		failed = imService.append(consult,content,type,times,patientCode,wechat_appid);
 | 
												
													
														
															|  | 		return success(failed);
 |  | 		return success(failed);
 | 
												
													
														
															|  | 	}
 |  | 	}
 |