|
@ -772,8 +772,60 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
|
|
@ApiParam(name = "content", value = "消息内容", defaultValue = "")
|
|
@ApiParam(name = "content", value = "消息内容", defaultValue = "")
|
|
@RequestParam(value = "content", required = true) String content,
|
|
@RequestParam(value = "content", required = true) String content,
|
|
@ApiParam(name = "type", value = "咨询type", defaultValue = "")
|
|
@ApiParam(name = "type", value = "咨询type", defaultValue = "")
|
|
@RequestParam(value = "type", required = false) String type
|
|
|
|
|
|
@RequestParam(value = "type", required = false) String type,
|
|
|
|
@ApiParam(name = "times", value = "times", defaultValue = "")
|
|
|
|
@RequestParam(value = "times", required = false) Integer times,
|
|
|
|
@ApiParam(name = "wechat_appid", value = "wechat_appid", defaultValue = "")
|
|
|
|
@RequestParam(value = "wechat_appid", required = false) String wechat_appid
|
|
)throws Exception{
|
|
)throws Exception{
|
|
|
|
List<String> failed = new ArrayList<>();
|
|
|
|
|
|
|
|
//处理语音文件
|
|
|
|
if(!org.springframework.util.StringUtils.isEmpty(wechat_appid)){
|
|
|
|
|
|
|
|
// imService.getInputStream("1",wechat_appid);
|
|
|
|
|
|
|
|
if("3".equalsIgnoreCase(content_type)){//语音文件
|
|
|
|
String voicepath = imService.fetchWxVoices(wechat_appid);
|
|
|
|
logger.info("voice_path:"+voicepath);
|
|
|
|
JSONObject obj = new JSONObject();
|
|
|
|
String voiceurl = "";
|
|
|
|
// 将临时语音拷贝到正式存储路径下
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotEmpty(voicepath)) {
|
|
|
|
if("xm_ihealth_wx".equals(wechat_appid)){
|
|
|
|
logger.info("voice_wx_type:"+wechat_appid);
|
|
|
|
voiceurl = fileUploadService.uploadWxVoice(voicepath);
|
|
|
|
// uploadVO.setFullUri(map.get("accessory").toString());
|
|
|
|
}else if ("xm_xzzx_wx".equalsIgnoreCase(wechat_appid)){
|
|
|
|
voiceurl = fileUploadService.uploadWxVoiceToEntrance(remote_inner_url,voicepath);
|
|
|
|
logger.info(voiceurl);
|
|
|
|
}else {
|
|
|
|
voiceurl = fileUtil.copyTempVoice(voicepath,fastdfs_file_url);
|
|
|
|
}
|
|
|
|
obj.put("path", voiceurl);
|
|
|
|
obj.put("times", times);
|
|
|
|
content = obj.toString();
|
|
|
|
}
|
|
|
|
}else if("2".equalsIgnoreCase(content_type)){//图片文件
|
|
|
|
String imagepath = imService.fetchWxImages(wechat_appid);
|
|
|
|
logger.info("image_path:"+imagepath);
|
|
|
|
JSONObject obj = new JSONObject();
|
|
|
|
String imgeUrl = "";
|
|
|
|
// 将临时语音拷贝到正式存储路径下
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotEmpty(imagepath)) {
|
|
|
|
if("xm_ihealth_wx".equals(wechat_appid)){
|
|
|
|
logger.info("imge_wx_type:"+wechat_appid);
|
|
|
|
imgeUrl = fileUploadService.uploadWxImage(imagepath);
|
|
|
|
// uploadVO.setFullUri(map.get("accessory").toString());
|
|
|
|
}else{
|
|
|
|
imgeUrl = fileUtil.copyTempVoice(imagepath,fastdfs_file_url);
|
|
|
|
}
|
|
|
|
content = imgeUrl;
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
session_id = imService.getPatientGuaidenceConsult(sender_id,session_id,type);
|
|
session_id = imService.getPatientGuaidenceConsult(sender_id,session_id,type);
|
|
String result = imService.patientGuaidenceAppend(sender_id,sender_name,session_id,content_type,content,"1");
|
|
String result = imService.patientGuaidenceAppend(sender_id,sender_name,session_id,content_type,content,"1");
|
|
return success(result);
|
|
return success(result);
|