Explorar o código

修改体征上传没有医生助手推送

zd_123 %!s(int64=7) %!d(string=hai) anos
pai
achega
8384d6e681

+ 7 - 13
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/AsyncService.java

@ -241,25 +241,16 @@ public class AsyncService extends BaseService{
        logger.info("签约对象--全科医生code===="+signFamily.getDoctor());
        logger.info("签约对象--全科医生code===="+signFamily.getDoctor());
        String healthDoctorFamily = "";
        String healthDoctorFamily = "";
        String doctorFamily = "";
        String doctorFamily = "";
        String doctorName = "";
        String doctorOpenID = "";
        if (signFamily != null) {
        if (signFamily != null) {
            healthDoctorFamily = signFamily.getDoctorHealth();
            healthDoctorFamily = signFamily.getDoctorHealth();
            doctorFamily = signFamily.getDoctor();
            doctorFamily = signFamily.getDoctor();
            logger.info("全科医生code======"+doctorFamily);
            if (StringUtils.isNotEmpty(healthDoctorFamily)) {
            if (StringUtils.isNotEmpty(healthDoctorFamily)) {
                // 添加到消息接收人列表
                // 添加到消息接收人列表
                receivers.add(healthDoctorFamily);
                receivers.add(healthDoctorFamily);
                Doctor doctor = doctorDao.findByCode(healthDoctorFamily);
                doctorName = doctor.getName();
                doctorOpenID = doctor.getOpenid();
            }
            }
            if (StringUtils.isNotEmpty(doctorFamily)){
            if (StringUtils.isNotEmpty(doctorFamily)){
                // 添加到消息接收人列表
                // 添加到消息接收人列表
                receivers.add(doctorFamily);
                receivers.add(doctorFamily);
                Doctor doctor = doctorDao.findByCode(signFamily.getDoctor());
                doctorName = doctor.getName();
                doctorOpenID = doctor.getOpenid();
            }
            }
        }
        }
        // 查询病人三师签约中的健康管理师
        // 查询病人三师签约中的健康管理师
@ -326,15 +317,17 @@ public class AsyncService extends BaseService{
            }
            }
            if(messageService.getMessageNoticeSettingByMessageType(receiver,"1", MessageNoticeSetting.MessageTypeEnum.healthSignSwitch.getValue())){
            if(messageService.getMessageNoticeSettingByMessageType(receiver,"1", MessageNoticeSetting.MessageTypeEnum.healthSignSwitch.getValue())){
                //            新增发送医生助手模板消息 v1.4.0 by wujunjie
                //            新增发送医生助手模板消息 v1.4.0 by wujunjie
                if (StringUtils.isNotEmpty(doctorOpenID)) {
                Doctor doctor = doctorDao.findByCode(receiver);
                if (doctor!=null && StringUtils.isNotEmpty(doctor.getOpenid())) {
                    List<Message> messagesList = messageDao.findUnreadHealthIndex(patientCode, receiver);
                    List<Message> messagesList = messageDao.findUnreadHealthIndex(patientCode, receiver);
                    if (messagesList != null && messagesList.size()>0){
                    if (messagesList != null && messagesList.size()>0){
                        logger.info("发送医生助手------start");
                        String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                        String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                        List<NameValuePair> params = new ArrayList<>();
                        List<NameValuePair> params = new ArrayList<>();
                        params.add(new BasicNameValuePair("type", "3"));
                        params.add(new BasicNameValuePair("type", "3"));
                        params.add(new BasicNameValuePair("openId", doctorOpenID));
                        params.add(new BasicNameValuePair("openId", doctor.getOpenid()));
                        params.add(new BasicNameValuePair("url", targetUrl));
                        params.add(new BasicNameValuePair("url", targetUrl));
                        params.add(new BasicNameValuePair("first", doctorName + "医生,您的签约居民" + patientName +
                        params.add(new BasicNameValuePair("first", doctor.getName() + "医生,您的签约居民" + patientName +
                                "有" + messagesList.size() + "条未读的体征异常消息"));
                                "有" + messagesList.size() + "条未读的体征异常消息"));
                        params.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                        params.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
@ -342,7 +335,8 @@ public class AsyncService extends BaseService{
                        String keywords = date + "," + patientName;
                        String keywords = date + "," + patientName;
                        params.add(new BasicNameValuePair("keywords", keywords));
                        params.add(new BasicNameValuePair("keywords", keywords));
                        httpClientUtil.post(url, params, "UTF-8");
                        String result = httpClientUtil.post(url, params, "UTF-8");
                        logger.info("医生助手推送结果========"+result);
                    }
                    }
                }
                }
            }
            }

+ 11 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -308,24 +308,24 @@ public class PatientHealthIndexService extends BaseService {
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patientCode);
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patientCode);
        String healthDoctorFamily = "";
        String healthDoctorFamily = "";
        String doctotFamily = "";
        String doctotFamily = "";
        String doctorName = "";
        String doctorOpenID = "";
        /*String doctorName = "";
        String doctorOpenID = "";*/
        if (signFamily != null) {
        if (signFamily != null) {
            healthDoctorFamily = signFamily.getDoctorHealth();
            healthDoctorFamily = signFamily.getDoctorHealth();
            doctotFamily = signFamily.getDoctor();
            doctotFamily = signFamily.getDoctor();
            if (StringUtils.isNotEmpty(healthDoctorFamily)) {
            if (StringUtils.isNotEmpty(healthDoctorFamily)) {
                // 添加到消息接收人列表
                // 添加到消息接收人列表
                receivers.add(healthDoctorFamily);
                receivers.add(healthDoctorFamily);
                Doctor doctor = doctorDao.findByCode(healthDoctorFamily);
               /* Doctor doctor = doctorDao.findByCode(healthDoctorFamily);
                doctorName = doctor.getName();
                doctorName = doctor.getName();
                doctorOpenID = doctor.getOpenid();
                doctorOpenID = doctor.getOpenid();*/
            }
            }
            if (StringUtils.isNotEmpty(doctotFamily)){
            if (StringUtils.isNotEmpty(doctotFamily)){
                // 添加到消息接收人列表
                // 添加到消息接收人列表
                receivers.add(signFamily.getDoctor());
                receivers.add(signFamily.getDoctor());
                Doctor doctor = doctorDao.findByCode(signFamily.getDoctor());
                /*Doctor doctor = doctorDao.findByCode(signFamily.getDoctor());
                doctorName = doctor.getName();
                doctorName = doctor.getName();
                doctorOpenID = doctor.getOpenid();
                doctorOpenID = doctor.getOpenid();*/
            }
            }
        }
        }
@ -390,15 +390,17 @@ public class PatientHealthIndexService extends BaseService {
            }
            }
            if(messageService.getMessageNoticeSettingByMessageType(receiver,"1", MessageNoticeSetting.MessageTypeEnum.healthSignSwitch.getValue())){
            if(messageService.getMessageNoticeSettingByMessageType(receiver,"1", MessageNoticeSetting.MessageTypeEnum.healthSignSwitch.getValue())){
                //            新增发送医生助手模板消息 v1.4.0 by wujunjie
                //            新增发送医生助手模板消息 v1.4.0 by wujunjie
                if (StringUtils.isNotEmpty(doctorOpenID)) {
                Doctor doctor = doctorDao.findByCode(receiver);
                if (doctor!=null && StringUtils.isNotEmpty(doctor.getOpenid())) {
                    List<Message> messagesList = messageDao.findUnreadHealthIndex(patientCode, receiver);
                    List<Message> messagesList = messageDao.findUnreadHealthIndex(patientCode, receiver);
                    if (messagesList != null && messagesList.size()>0){
                    if (messagesList != null && messagesList.size()>0){
                        String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                        String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                        System.out.println("医生助手url======"+url);
                        List<NameValuePair> params = new ArrayList<>();
                        List<NameValuePair> params = new ArrayList<>();
                        params.add(new BasicNameValuePair("type", "3"));
                        params.add(new BasicNameValuePair("type", "3"));
                        params.add(new BasicNameValuePair("openId", doctorOpenID));
                        params.add(new BasicNameValuePair("openId", doctor.getOpenid()));
                        params.add(new BasicNameValuePair("url", targetUrl));
                        params.add(new BasicNameValuePair("url", targetUrl));
                        params.add(new BasicNameValuePair("first", doctorName + "医生,您的签约居民" + patientName +
                        params.add(new BasicNameValuePair("first", doctor.getName() + "医生,您的签约居民" + patientName +
                                "有" + messagesList.size() + "条未读的体征异常消息"));
                                "有" + messagesList.size() + "条未读的体征异常消息"));
                        params.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                        params.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");