Parcourir la source

演示环境 数据改造

mengkang il y a 4 ans
Parent
commit
e0fc2d9309

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

@ -3379,12 +3379,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                    data.put("type", "9");
                    msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个图文复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuse", "");
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuseRemind", "");
                }
                if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                    data.put("type", "16");
                    msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个视频复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuse", "");
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuseRemind", "");
                }
                data.put("msg", msg);
                messageDO.setData(data.toString());
@ -3470,74 +3470,96 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                contentMsg = "您的视频复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
                first = outpatientDO.getPatientName() + ",您好!您的视频复诊已取消";
            }
            msgUrl="/ims-wx/#/returnVisit/record?outpatientId="+outpatientId;
            logger.info("doctorRefuseRemind医生拒诊入参:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if ("payRemind".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "您有一个图文复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first = outpatientDO.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。";
                msgUrl="/ims-wx/#/returnVisit/record?outpatientId="+outpatientId;
                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
                logger.info("图文复诊订单待支付微信消息模板推送开始");
            } else if ("16".equals(type)) {
                contentMsg = "您有一个视频复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first = outpatientDO.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。";
                msgUrl="/ims-wx/#/returnVisit/record?outpatientId="+outpatientId;
                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
                logger.info("视频复诊订单待支付微信消息模板推送开始");
            }
            if ("1".equals(type)) {
                contentMsg = "您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first = consPatientDO.getName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
                msgUrl="/ims-wx/#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
                msgUrl="/ims-wx/index.html#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
                logger.info("图文咨询订单待支付微信消息模板推送开始");
            } else if ("17".equals(type)) {
                contentMsg = "您有一个视频咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first =  consPatientDO.getName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
                msgUrl="/ims-wx/#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
                msgUrl="/ims-wx/index.html#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
                logger.info("视频咨询订单待支付微信消息模板推送开始");
            }
        } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
            first = outpatientDO.getPatientName() + ",您好! 医生已为您开具处方,请及时支付。";
            contentMsg = "医生已为您开具处方,请及时支付。";
            remark = "点击完成支付,如您已支付请忽略本条信息";
            msgUrl="/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientId;
            logger.info("处方支付微信消息模板推送开始");
        } else if ("msgRemind".equalsIgnoreCase(titelType)) {
            first = outpatientDO.getPatientName() + ",您好!";
            contentMsg = "" + remindMsg;
            remark = "请您尽快回复";
        } else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
            first = doctorDO.getName() + doctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
            if ("16".equals(type)) {
                contentMsg = "您的视频复诊已开始,错过将重新排队";
                remark = "点击消息进入视频诊室接听视频通话,开始视频咨询。";
            } else if ("17".equals(type)) {
                contentMsg = "您的视频咨询已开始,错过将重新排队";
                remark = "点击消息进入视频诊室接听视频通话,开始视频复诊。";
            }
            msgUrl="/ims-wx/#/returnVisit/prescriptionDetail?outpatientId="+outpatientId;
          if (StringUtils.isNotEmpty(outpatientId)){
              if ("16".equals(type)) {
                  first = doctorDO.getName() + doctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
                  contentMsg = "您的视频复诊已开始,错过将重新排队";
                  remark = "点击消息进入视频诊室接听视频通话,开始视频咨询。";
                  msgUrl="/ims-wx/index.html#/returnVisit/preChat?type=16&outpatientId="+outpatientId;
                  logger.info("视频问诊已接诊提醒微信模板消息发送开始");
              }
          }
          if (consultTeam!=null){
              if ("17".equals(type)) {
                  first = consDoctorDO.getName() + consDoctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
                  contentMsg = "您的视频咨询已开始,错过将重新排队";
                  remark = "点击消息进入视频诊室接听视频通话,开始视频复诊。";
                  msgUrl="/ims-wx/index.html#/zx/prechat?consultCode="+consultTeam.getConsult();
                  logger.info("视频咨询已接诊提醒微信模板消息发送开始");
              }
          }
        } else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
            if ("16".equals(type)) {
                first = "您的视频复诊已预约成功。";
                contentMsg = "预计" + outpatientDO.getDoctorName() + "医生将于" + DateUtil.dateToStrLong(outpatientDO.getRegisterDate()) + " 与您进行视频复诊。请留意微信公众号消息。";
                msgUrl="/ims-wx/#/returnVisit/preChat?type=16&outpatientId="+outpatientId;
                msgUrl="/ims-wx/index.html#/returnVisit/preChat?type=16&outpatientId="+outpatientId;
                logger.info("视频复诊已预约成功微信消息模板推送开始");
            } else if ("17".equals(type)) {
                first = "您的视频咨询已预约成功。";
                contentMsg = "预计" + consDoctorDO.getName() + "医生将于" + DateUtil.dateToStrLong(consultTeam.getCzrq()) + " 与您进行视频咨询。请留意微信公众号消息。";
                msgUrl="/ims-wx/#/zx/prechat?consultCode="+consultTeam.getConsult();
                msgUrl="/ims-wx/index.html#/zx/prechat?consultCode="+consultTeam.getConsult();
                logger.info("视频咨询已预约成功微信消息模板推送开始");
            }
            remark = "咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
        } else if ("evaluateRemind".equalsIgnoreCase(titelType)) {
            if (consultTeam.getType()!=null&&1==consultTeam.getType()){
                first = consultTeam.getName() + ",您好!您有1条图文咨询已结束,请及时对咨询医生进行评价。";
                logger.info("图文咨询服务评价微信消息模板推送开始");
            }
            if (consultTeam.getType()!=null&&9==consultTeam.getType()){
                first = consultTeam.getName() + ",您好!您有1条图文复诊已结束,请及时对咨询医生进行评价。";
                logger.info("图文复诊服务评价微信消息模板推送开始");
            }
            if (consultTeam.getType()!=null&&16==consultTeam.getType()){
                first = consultTeam.getName() + ",您好!您有1条视频复诊已结束,请及时对咨询医生进行评价。";
                logger.info("视频复诊服务评价微信消息模板推送开始");
            }
            if (consultTeam.getType()!=null&&17==consultTeam.getType()){
                first = consultTeam.getName() + ",您好!您有1条视频咨询已结束,请及时对咨询医生进行评价。";
                logger.info("视频咨询服务评价微信消息模板推送开始");
            }
            contentMsg = "请对" + consDoctorDO.getName() + "医生的服务进行评价";
            msgUrl="/ims-wx/#/fuwupingjia?consultCode="+consultTeam.getConsult();
            msgUrl="/ims-wx/index.html#/fuwupingjia?consultCode="+consultTeam.getConsult();
        }
@ -3569,11 +3591,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setKeyword1(config.getKeyword1() + outpatientDO.getHospitalName());
                newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getDoctorName());
                newConfig.setKeyword3(config.getKeyword3() + doctorDO.getFee());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 医生拒诊开始");
            } else if ("payRemind".equalsIgnoreCase(titelType)) {
                scene = "zxzfts";
                //就诊支付
@ -3592,6 +3612,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDoctorName());
                    //发起微信消息模板推送
                    newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                    logger.info("眼科微信消息模板推送 就诊支付提醒开始");
                }
                //咨询支付
                if (consultTeam!=null){
@ -3609,6 +3630,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    newConfig.setKeyword3(config.getKeyword3() + consDoctorDO.getName());
                    //发起微信消息模板推送
                    newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                    logger.info("眼科微信消息模板推送 咨询支付提醒开始");
                }
            } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
@ -3622,6 +3644,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDoctorName());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 处方支付提醒开始");
            } else if ("msgRemind".equalsIgnoreCase(titelType)) {
                scene = "zxxxtx";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_msg_notice", scene, 1);
@ -3633,22 +3656,49 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
            } else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
                scene = "mzxxtx";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_msg_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
                newConfig.setFirst(config.getFirst().replace("key2", doctorDO.getJobTitleName()));
                newConfig.setKeyword1(config.getKeyword1() + outpatientDO.getDoctorName());
                newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getAdmDate());
                newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDeptName());
                newConfig.setKeyword4(config.getKeyword4() + outpatientDO.getIcd10Name());
                if ("16".equals(type)) {
                    newConfig.setRemark(config.getRemark().replaceFirst("key1", "视频复诊"));
                } else if ("17".equals(type)) {
                    newConfig.setRemark(config.getRemark().replaceFirst("key1", "视频咨询"));
                if (StringUtils.isNotEmpty(outpatientId)){
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_msg_notice_jz", scene, 1);
                    BeanUtils.copyProperties(config, newConfig);
                    newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getPatientName()));
                    newConfig.setFirst(config.getFirst().replace("key2", doctorDO.getJobTitleName()));
                    newConfig.setKeyword1(config.getKeyword1() + outpatientDO.getDoctorName());
                    newConfig.setKeyword2(config.getKeyword2() + outpatientDO.getAdmDate());
                    newConfig.setKeyword3(config.getKeyword3() + outpatientDO.getDeptName());
                    newConfig.setKeyword4(config.getKeyword4() + outpatientDO.getIcd10Name());
                    if ("16".equals(type)) {
                        newConfig.setRemark(config.getRemark().replaceFirst("key1", "视频复诊"));
                    } else if ("17".equals(type)) {
                        newConfig.setRemark(config.getRemark().replaceFirst("key1", "视频咨询"));
                    }
                    //发起微信消息模板推送
                    newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                    logger.info("眼科微信消息模板推送 视频问诊接诊提醒开始");
                }
                if (consultTeam!=null){
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_msg_notice_zx", scene, 1);
                    BeanUtils.copyProperties(config, newConfig);
                    newConfig.setFirst(config.getFirst().replace("key1", consPatientDO.getName()));
                    newConfig.setFirst(config.getFirst().replace("key2", consDoctorDO.getJobTitleName()));
                    newConfig.setKeyword1(config.getKeyword1() + consDoctorDO.getName());
                    newConfig.setKeyword2(config.getKeyword2() + consultTeam.getCzrq());//咨询暂无挂号时间
                    newConfig.setKeyword3(config.getKeyword3() + hospitalDO.getDeptName());
                    newConfig.setKeyword4(config.getKeyword4() + consultTeam.getSymptoms());
                    if ("16".equals(type)) {
                        newConfig.setRemark(config.getRemark().replaceFirst("key1", "视频复诊"));
                    } else if ("17".equals(type)) {
                        newConfig.setRemark(config.getRemark().replaceFirst("key1", "视频咨询"));
                    }
                    //发起微信消息模板推送
                    newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                    logger.info("眼科微信消息模板推送 视频咨询接诊提醒开始");
                }
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
            } else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
                scene = "spwzyytx";
@ -3666,6 +3716,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    newConfig.setKeyword5(config.getKeyword5() + generalDoctorWaitingNumber(doctorDO.getId(), wxId, outpatientId));
                    //发起微信消息模板推送
                    newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                    logger.info("眼科微信消息模板推送 视频问诊预约提醒开始");
                }
                if (consultTeam!=null){
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice_zx", scene, 1);
@ -3680,6 +3731,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    newConfig.setKeyword5(config.getKeyword5() + generalDoctorWaitingNumber(consDoctorDO.getId(), wxId, outpatientId));
                    //发起微信消息模板推送
                    newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                    logger.info("眼科微信消息模板推送 视频咨询预约提醒开始");
                }
@ -3692,6 +3744,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setKeyword2(config.getKeyword2() + consDoctorDO.getName());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                logger.info("眼科微信消息模板推送 服务评价提醒开始");
            }
@ -3745,7 +3798,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        "wx53f6bb4ac081d840");
            }
            logger.info("url="+(prefix+msgUrl));
            logger.info("url="+prefix+msgUrl);
            String msg="first:"+first+"contentMsg:"+contentMsg+"remark:"+remark;
            logger.info("发送的信息="+msg);
            logger.info("XZZX_Msg_" + titelType + "=" + responseMsg);
@ -3775,8 +3828,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        remark
                );
            }
            logger.info("url="+(prefix+msgUrl));
            String msg="first:"+first+"contentMsg:"+contentMsg+"remark:"+remark;
            logger.info("url="+prefix+msgUrl);
            String msg="first:"+first+"-----contentMsg:"+contentMsg+"-----remark:"+remark;
            logger.info("发送的信息="+msg);
            logger.info("ZSYY_Msg" + titelType + "=" + responseMsg);
        }

+ 3 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -194,6 +194,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
						JSONObject res = xzyyPrescriptionService.registerOutPatient(outpatientCode,doctorCode);
						rsCode = res.getString("@RESULT");
						mes = res.getString("@MSG");
						if (type==2){
							prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
						}
					}else {
						if (demoFlag.equalsIgnoreCase("true")){
							rsCode="0";