Browse Source

代码修改

LAPTOP-KB9HII50\70708 1 year ago
parent
commit
02303045bd

+ 1 - 8
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -921,16 +921,11 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@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{
	){
		try {
			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);
@ -941,7 +936,6 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
						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);
@ -962,7 +956,6 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
						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);
						}

+ 32 - 25
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/PatientDeviceService.java

@ -625,31 +625,38 @@ public class PatientDeviceService  {
     * @param type 1同意解绑,2不同意
     */
    public void sendWxMessage(DevicePatientDevice patientDevice, int type) {
        BasePatientDO patient = patientDao.findById(patientDevice.getUser()).orElse(null);
        WxTemplateConfigDO templateConfig = null;
        //判断是同意解绑还是拒绝解绑
        if(type == 1){
            templateConfig = wxMessageUtil.findByWechatIdAndTemplateNameAndSceneAndStatus(null,"template_process_feedback","unbind",1);
        }else if(type == 2) {
            templateConfig = wxMessageUtil.findByWechatIdAndTemplateNameAndSceneAndStatus(null,"template_process_feedback", "refuse",1);
        }
        WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
        BeanUtils.copyProperties(templateConfig,newConfig);
        String first = newConfig.getFirst();
        first = first.replace("key1", patientDevice.getDeviceName());
        String keyword2 = newConfig.getKeyword2();
        if(keyword2.contains("key2")){
            keyword2 = keyword2.replace("key2", patientDevice.getRefuseReason());
        }
        newConfig.setFirst(first);
        newConfig.setKeyword2(keyword2);
        newConfig.setKeyword1(DateUtil.dateToStrShort(new Date()));
        com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
        json.put("deviceId", patientDevice.getCategoryCode());
        json.put("id", patientDevice.getId());
        if(patient != null && StringUtils.isNotBlank(patient.getOpenid())) {
            wxMessageUtil.putWxMsg(null,  patient.getOpenid(),newConfig, 33, json);
        try {
            BasePatientDO patient = patientDao.findById(patientDevice.getUser()).orElse(null);
            WxTemplateConfigDO templateConfig = null;
            //判断是同意解绑还是拒绝解绑
            if(type == 1){
                templateConfig = wxMessageUtil.findByWechatIdAndTemplateNameAndSceneAndStatus(null,"template_process_feedback","unbind",1);
            }else if(type == 2) {
                templateConfig = wxMessageUtil.findByWechatIdAndTemplateNameAndSceneAndStatus(null,"template_process_feedback", "refuse",1);
            }
            if(templateConfig==null){
                return;
            }
            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
            BeanUtils.copyProperties(templateConfig,newConfig);
            String first = newConfig.getFirst();
            first = first.replace("key1", patientDevice.getDeviceName());
            String keyword2 = newConfig.getKeyword2();
            if(keyword2.contains("key2")){
                keyword2 = keyword2.replace("key2", patientDevice.getRefuseReason());
            }
            newConfig.setFirst(first);
            newConfig.setKeyword2(keyword2);
            newConfig.setKeyword1(DateUtil.dateToStrShort(new Date()));
            com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
            json.put("deviceId", patientDevice.getCategoryCode());
            json.put("id", patientDevice.getId());
            if(patient != null && StringUtils.isNotBlank(patient.getOpenid())) {
                wxMessageUtil.putWxMsg(null,  patient.getOpenid(),newConfig, 33, json);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }