Browse Source

极光消息推送接诊提醒

wangjun 4 năm trước cách đây
mục cha
commit
8c96e7b740

+ 47 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -149,6 +149,7 @@ import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Collectors;
/**
/**
@ -12338,6 +12339,52 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            jsonObject.put("type",32);
            jsonObject.put("type",32);
            jsonObject.put("id",prescriptionId);
            jsonObject.put("id",prescriptionId);
            jsonObject.put("outpatientId",wlyyOutpatientDO.getId());
            jsonObject.put("outpatientId",wlyyOutpatientDO.getId());
        }else if("remind_doctor_pickup".equalsIgnoreCase(templateCode)){//物流消息提醒
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","图文复诊").replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","图文复诊接诊提醒");
                    jsonObject.put("type",51);
                    jsonObject.put("patientName",wlyyOutpatientDO.getPatientName());
                }else if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","视频复诊").replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
                    content+= "视频复诊预约时间为:"+wlyyOutpatientDO.getRegisterDate();
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","视频复诊接诊提醒");
                    jsonObject.put("type",52);
                    jsonObject.put("patientName",wlyyOutpatientDO.getPatientName());
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","图文咨询").replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","图文咨询接诊提醒");
                    jsonObject.put("type",58);
                    jsonObject.put("patientName",wlyyOutpatientDO.getPatientName());
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","视频咨询").replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","视频咨询接诊提醒");
                    content+= "视频咨询预约时间为:"+wlyyOutpatientDO.getRegisterDate();
                    jsonObject.put("type",57);
                    jsonObject.put("patientName",wlyyOutpatientDO.getPatientName());
                }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","协同复诊").replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","协同复诊接诊提醒");
                    jsonObject.put("type",53);
                    jsonObject.put("patientName",wlyyOutpatientDO.getPatientName());
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","家医咨询").replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","家医咨询接诊提醒");
                    jsonObject.put("type",55);
                    jsonObject.put("patientName",wlyyOutpatientDO.getPatientName());
                }
                String sex = IdCardUtil.getSexNameForIdcard_new(wlyyOutpatientDO.getIdcard());
                Integer age = IdCardUtil.getAgeForIdcard(wlyyOutpatientDO.getIdcard());
                Long createTime = wlyyOutpatientDO.getCreateTime().getTime();
                Long nowTime = new Date().getTime();
                Long minusts = TimeUnit.MILLISECONDS.toMinutes(nowTime - createTime);
                content = content.replace("{{性别年龄}}",sex+age+"岁").replace("{{等待时间}}",minusts.toString());
            }
            userId = wlyyOutpatientDO.getDoctor();
            jsonObject.put("id",wlyyOutpatientDO.getId());
            isDoctor="1";
        }
        }
        return jPushMessage(isDoctor,userId,content,title,jsonObject);
        return jPushMessage(isDoctor,userId,content,title,jsonObject);

+ 9 - 6
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/RemindDoctorService.java

@ -73,20 +73,20 @@ public class RemindDoctorService {
                    SystemMessageDO systemMessageDO = new SystemMessageDO();
                    SystemMessageDO systemMessageDO = new SystemMessageDO();
                    if ("2".equals(wlyyOutpatientDO.getOutpatientType())) {
                    if ("2".equals(wlyyOutpatientDO.getOutpatientType())) {
                        systemMessageDO.setTitle("协同门诊消息提醒");
                        systemMessageDO.setTitle("协同门诊消息提醒");
                        systemMessageDO.setType("3");
                        systemMessageDO.setType("63");
                    } else if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {//专家咨询
                    } else if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {//专家咨询
                        //1.图文 2.视频 3家医
                        //1.图文 2.视频 3家医
                        if ("1".equals(wlyyOutpatientDO.getType())) {
                        if ("1".equals(wlyyOutpatientDO.getType())) {
                            systemMessageDO.setTitle("图文咨询消息提醒");
                            systemMessageDO.setTitle("图文咨询消息提醒");
                            systemMessageDO.setType("18");
                            systemMessageDO.setType("68");
                            title = "图文咨询消息提醒";
                            title = "图文咨询消息提醒";
                            msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文咨询,已等待"+minusts+"分钟。点击接诊";
                            msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文咨询,已等待"+minusts+"分钟。点击接诊";
                        } else if ("3".equals(wlyyOutpatientDO.getType())) {
                        } else if ("3".equals(wlyyOutpatientDO.getType())) {
                            systemMessageDO.setTitle("家医咨询消息提醒");
                            systemMessageDO.setTitle("家医咨询消息提醒");
                            systemMessageDO.setType("15");
                            systemMessageDO.setType("65");
                        } else {
                        } else {
                            systemMessageDO.setTitle("视频咨询消息提醒");
                            systemMessageDO.setTitle("视频咨询消息提醒");
                            systemMessageDO.setType("17");
                            systemMessageDO.setType("67");
                            title = "视频咨询消息提醒";
                            title = "视频咨询消息提醒";
                            date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate());
                            date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate());
                            msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频咨询,点击查看";
                            msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频咨询,点击查看";
@ -95,12 +95,12 @@ public class RemindDoctorService {
                        //1.图文 2.视频
                        //1.图文 2.视频
                        if ("1".equals(wlyyOutpatientDO.getType())) {
                        if ("1".equals(wlyyOutpatientDO.getType())) {
                            systemMessageDO.setTitle("图文复诊消息提醒");
                            systemMessageDO.setTitle("图文复诊消息提醒");
                            systemMessageDO.setType("1");
                            systemMessageDO.setType("61");
                            title = "图文复诊消息提醒";
                            title = "图文复诊消息提醒";
                            msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文复诊,已等待"+minusts+"分钟。点击接诊";
                            msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文复诊,已等待"+minusts+"分钟。点击接诊";
                        } else {
                        } else {
                            systemMessageDO.setTitle("视频复诊消息提醒");
                            systemMessageDO.setTitle("视频复诊消息提醒");
                            systemMessageDO.setType("2");
                            systemMessageDO.setType("62");
                            title = "视频复诊消息提醒";
                            title = "视频复诊消息提醒";
                            date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate());
                            date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate());
                            msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                            msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
@ -142,6 +142,9 @@ public class RemindDoctorService {
                    }
                    }
                    wlyyOutpatientDO.setLastRemindTime(new Date());
                    wlyyOutpatientDO.setLastRemindTime(new Date());
                    outpatientDao.save(wlyyOutpatientDO);
                    outpatientDao.save(wlyyOutpatientDO);
                    if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                        prescriptionService.wxTempalteJPush("remind_doctor_pickup",wlyyOutpatientDO,null,"","","","");
                    }
                }
                }
            }
            }