소스 검색

发送消息修改标题提示

8 년 전
부모
커밋
dc2ba4f398

+ 13 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java

@ -286,7 +286,7 @@ public class CommonUtil {
        video.setSize(new VideoSize(600, 500));
        EncodingAttributes attrs = new EncodingAttributes();
        attrs.setFormat("image2");//转图片
        attrs.setOffset(3f);//设置偏移位置,即开始转码位置(3秒)
        attrs.setOffset(1f);//设置偏移位置,即开始转码位置(3秒)
        attrs.setDuration(0.01f);//设置转码持续时间(1秒)
        attrs.setVideoAttributes(video);
        encoder.encode(source, target, attrs);
@ -334,11 +334,21 @@ public class CommonUtil {
    }
    public static void main(String args[]) throws  Exception{
        getVideoTimeAndImg("E://mp4/5.mov","e://mp4/7.png");
        System.out.print("中文".length());
        System.out.print("中文".substring(0,30));
    }
    public static String getSubString(String content,int min,int max){
        if(StringUtils.isBlank(content)){
            return "";
        }else if(content.length()<=max){
            return content;
        }else{
            return content.substring(min,max);
        }
    }
    public static String  saveVoiceToDisk(InputStream inputStream,String newFileName) throws Exception {
        // 文件保存的临时路径
        String tempPath = SystemConf.getInstance().getTempPath() + File.separator;

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -385,7 +385,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                    // 行政团队
                    heap.setAdminTeamCode(signFamily.getAdminTeamId());
                    list.add(heap);
                    consultService.sendMucMessageBySingnType(doctor.getCode(), doctor.getName(), p, "{\"title\":\"" + temp.getTitle() + "\",\"id\":\"" + temp.getCode() + "\",\"img\":\"" + temp.getUrl() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patientTemp.getName());
                    consultService.sendMucMessageBySingnType(doctor.getCode(), doctor.getName(), p, "{\"title\":\"" + temp.getTitle()+ "\",\"type\":0,\"id\":\"" + temp.getCode() + "\",\"img\":\"" + temp.getUrl() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patientTemp.getName());
                    if (StringUtils.isNotEmpty(patientTemp.getOpenid())) {
                        // 推送消息给微信端
                        JSONObject json = new JSONObject();

+ 4 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthGuidanceController.java

@ -150,7 +150,8 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
				// 保存
				if (patientHealthGuidanceService.add(guidance, getAccessToken()) != null) {
					Patient p = patientService.findByCode(patient);
					consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, content, "1", p.getName());
					String imcotent  = "{\"title\":\"健康指导\",\"type\":1,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\""+CommonUtil.getSubString(guidance.getContent(),0,30)+"\"}";
					consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, imcotent, "4", p.getName());
					BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
					return success("保存成功!");
				} else {
@ -188,7 +189,8 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
				// 保存
				if (patientHealthGuidanceService.add(guidance, getAccessToken()) != null) {
					Patient p = patientService.findByCode(patient);
					consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, content, "1", p.getName());
					String imcotent  = "{\"title\":\"健康指导\",\"type\":1,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\""+CommonUtil.getSubString(guidance.getContent(),0,30)+"\"}";
					consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, imcotent, "4", p.getName());
					BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
					//发送成功记录模板发送次数
					doctorGuidanceTempService.countSend(modelCode);