Forráskód Böngészése

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

liubing 4 éve
szülő
commit
5809edd2a7

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

@ -4194,6 +4194,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        String first = "";
        String remark = "";
        if ("doctorRefuseRemind".equalsIgnoreCase(titelType)) {
            //医生拒绝接诊
            if ("9".equals(type)) {
                contentMsg = "医生已取消您的复诊申请,取消原因:"+remindMsg;
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已取消";
@ -4213,11 +4214,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            logger.info("doctorRefuseRemind医生拒诊入参:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if("outPatientTimeOutRemind".equalsIgnoreCase(titelType)) {
            //医生未接诊时患者等待时间过长的模板提示
            contentMsg = "您邀请的医师暂无应答,您可以选择继续等待或者取消邀请。";
            first = outpatientDO.getConsumerName() + ",您好!";
            logger.info("outPatientTimeOutRemind:outpatientId="+outpatientId+"contentMsg"+contentMsg);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        }else if("systemCancelRemind".equalsIgnoreCase(titelType)){
            //超过24小时未接诊,系统取消
            if ("9".equals(type)) {
                contentMsg = "图文咨询因超时自动取消。您可重新发起。由于订单取消将不做扣费处理。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊因超时未接诊已取消";
@ -4229,7 +4232,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            logger.info("系统取消接诊入参:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if ("payRemind".equalsIgnoreCase(titelType)) {
            //患者发起时提醒患者支付诊费消息
            if ("9".equals(type)) {
                contentMsg = "请您先完成预交金充值发起在线问诊,点击详情进行预交金充值,如您已完成请忽略本条信息。";//您有一个图文复诊订单待支付,点击完成支付,如您已支付请忽略本条信息
                first = outpatientDO.getConsumerName() + ",您好!您有一笔未完成的在线问诊订单,请及时处理。";//您有一个图文复诊订单待支付,请及时支付。
@ -4243,68 +4246,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            if ("1".equals(type)) {
                contentMsg = "您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
                if (StringUtils.isNotBlank(outpatientId)){
                    msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
                    first = outpatientDO.getConsumerName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
                }else{
                    msgUrl="/ims-wx/index.html#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
                    first = consPatientDO.getName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
                }
                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
                first = outpatientDO.getConsumerName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
                logger.info("图文咨询订单待支付微信消息模板推送开始");
            } else if ("17".equals(type)) {
                contentMsg = "您有一个视频咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
                if (StringUtils.isNotBlank(outpatientId)){
                    msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
                    first =  outpatientDO.getConsumerName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
                }else{
                    msgUrl="/ims-wx/index.html#/chatRoom?type=1&consultCode="+consultTeam.getConsult();
                    first =  consPatientDO.getName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
                }
                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
                first =  outpatientDO.getConsumerName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
                logger.info("视频咨询订单待支付微信消息模板推送开始");
            }
        } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
            //开具处方后向患者发送支付提醒
            first = outpatientDO.getConsumerName() + ",您好! 医生已为您开具处方,请及时支付。";
            contentMsg = "医生已为您开具处方,请及时支付。";
            remark = "点击完成支付,如您已支付请忽略本条信息";
            msgUrl="/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientId+"&id="+remindMsg;
            logger.info("处方支付微信消息模板推送开始");
        } else if ("msgRemind".equalsIgnoreCase(titelType)) {
            first = outpatientDO.getConsumerName() + ",您好!";
            contentMsg = "" + remindMsg;
            remark = "请您尽快回复";
        } else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
              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 ("17".equals(type)) {
                  first = doctorDO.getName() + doctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
                  contentMsg = "您的视频咨询已开始,错过将重新排队";
                  remark = "点击消息进入视频诊室接听视频通话,开始视频复诊。";
                  if (StringUtils.isNotEmpty(outpatientId)){
                      msgUrl="/ims-wx/index.html#/returnVisit/preChat?type=17&outpatientId="+outpatientId;
                  }else{
                      msgUrl="/ims-wx/index.html#/zx/prechat?consultCode="+consultTeam.getConsult();
                  }
                  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)) {
                msgUrl="/ims-wx/index.html#/returnVisit/preChat?type=16&outpatientId="+outpatientId;
                if (StringUtils.isNoneBlank(outpatientDO.getDoctorName())){
@ -4336,6 +4295,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            remark = "咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
        } else if ("evaluateRemind".equalsIgnoreCase(titelType)) {
            //服务评价提醒
            if (consultTeam.getType()!=null&&1==consultTeam.getType()){
                first = consultTeam.getName() + ",您好!您有1条图文咨询已结束,请及时对咨询医生进行评价。";
                logger.info("图文咨询服务评价微信消息模板推送开始");
@ -4355,8 +4315,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            contentMsg = "请对" + consDoctorDO.getName() + "医生的服务进行评价";
            msgUrl="/ims-wx/index.html#/fuwupingjia?consultCode="+consultTeam.getConsult();
        }
        if ("xm_ykyy_wx".equalsIgnoreCase(wxId)||"sd_tnzyy_wx".equalsIgnoreCase(wxId)) {
            List<BasePatientWechatDo> ps = new ArrayList<BasePatientWechatDo>();
            if (StringUtils.isNotEmpty(outpatientId)){
@ -4373,6 +4331,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            String scene = "";
            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
            if ("doctorRefuseRemind".equalsIgnoreCase(titelType)) {
                //医生拒绝接诊
                scene = "ysqxjz";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_doctor_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
@ -4396,55 +4355,35 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("就诊等待过长提示");
            } else if ("payRemind".equalsIgnoreCase(titelType)) {
                //诊费支付提示
                scene = "zxzfts";
                //就诊支付
                if (StringUtils.isNotEmpty(outpatientId)){
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_pay_notice_jz", scene, 1);
                    BeanUtils.copyProperties(config, newConfig);
                    newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                    if ("9".equals(type)) {
                        newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                        newConfig.setKeyword1( "图文复诊支付");
                    } else if ("16".equals(type)) {
                        newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
                        newConfig.setKeyword1( "视频复诊支付");
                    }
                    if ("1".equals(type)) {
                        newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
                        newConfig.setKeyword1("图文咨询支付");
                    } else if ("17".equals(type)) {
                        newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
                        newConfig.setKeyword1("视频咨询支付");
                    }
                    newConfig.setKeyword2(outpatientDO.getHospitalName());
                    newConfig.setKeyword3(outpatientDO.getDoctorName());
                    //发起微信消息模板推送
                    newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                    logger.info("眼科微信消息模板推送 就诊支付提醒开始");
                }else {
                    //咨询支付
                    if (consultTeam!=null){
                        WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_pay_notice_zx", scene, 1);
                        BeanUtils.copyProperties(config, newConfig);
                        newConfig.setFirst(config.getFirst().replace("key1", consPatientDO.getName()));
                        if ("1".equals(type)) {
                            newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
                            newConfig.setKeyword1("图文咨询支付");
                        } else if ("17".equals(type)) {
                            newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
                            newConfig.setKeyword1("视频咨询支付");
                        }
                        newConfig.setKeyword2( hospitalDO.getOrgName());
                        newConfig.setKeyword3( consDoctorDO.getName());
                        //发起微信消息模板推送
                        newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                        logger.info("眼科微信消息模板推送 咨询支付提醒开始");
                    }
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_pay_notice_jz", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                if ("9".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                    newConfig.setKeyword1( "图文复诊支付");
                } else if ("16".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
                    newConfig.setKeyword1( "视频复诊支付");
                }
                if ("1".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
                    newConfig.setKeyword1("图文咨询支付");
                } else if ("17".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
                    newConfig.setKeyword1("视频咨询支付");
                }
                newConfig.setKeyword2(outpatientDO.getHospitalName());
                newConfig.setKeyword3(outpatientDO.getDoctorName());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 就诊支付提醒开始");
            } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
                //处方开具支付提醒
                scene = "cfzfts";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_prescription_pay_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                newConfig.setKeyword1( "处方支付");
@ -4453,94 +4392,27 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //发起微信消息模板推送
                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);
            }else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
                //视频问诊预约提醒
                scene = "spwzyytx";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                newConfig.setKeyword1( remindMsg);
                newConfig.setKeyword2( DateUtil.getStringDate());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
            } else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
                scene = "spthtx";
                if (StringUtils.isNotEmpty(outpatientId)){
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_consult_notice", scene, 1);
                    BeanUtils.copyProperties(config, newConfig);
                    String jobtitleCode = StringUtils.isNoneBlank(doctorDO.getJobTitleName())?doctorDO.getJobTitleName():"";
                    newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getDoctorName()+jobtitleCode));
                    newConfig.setKeyword1( outpatientDO.getDoctorName());
                    newConfig.setKeyword2(DateUtil.dateToStrLong(outpatientDO.getCreateTime()));
                    newConfig.setKeyword3(outpatientDO.getDeptName());
                    newConfig.setKeyword4( outpatientDO.getDescription());
                    if ("16".equals(type)) {
                        newConfig.setRemark(config.getRemark());
                        newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                    } else if ("17".equals(type)) {
                        newConfig.setRemark(config.getRemark());
                        newConfig.setUrl(newConfig.getUrl().replace("type=16","type=17") + "" + outpatientDO.getId());
                    }
                    //发起微信消息模板推送
                    logger.info("眼科微信消息模板推送 视频问诊接诊提醒开始");
                }else {
                    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()).replace("key2", consDoctorDO.getJobTitleName()));
                        newConfig.setKeyword1( consDoctorDO.getName());
                        newConfig.setKeyword2(DateUtil.dateToStrLong(consultTeam.getCzrq()));//咨询暂无挂号时间
                        newConfig.setKeyword3( hospitalDO.getDeptName());
                        newConfig.setKeyword4( consultTeam.getSymptoms());
                        if ("16".equals(type)) {
                            newConfig.setRemark(config.getRemark().replace("key1", "视频复诊"));
                        } else if ("17".equals(type)) {
                            newConfig.setRemark(config.getRemark().replace("key1", "视频咨询"));
                        }
                        //发起微信消息模板推送
                        newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                        logger.info("眼科微信消息模板推送 视频咨询接诊提醒开始");
                    }
                if ("16".equals(type)) {
                    newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频复诊"));
                }
            } else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
                scene = "spwzyytx";
                if (StringUtils.isNotEmpty(outpatientId)){
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice", scene, 1);
                    BeanUtils.copyProperties(config, newConfig);
                    if ("16".equals(type)) {
                        newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频复诊"));
                    }
                    if ("17".equals(type)) {
                        newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频咨询"));
                    }
                    newConfig.setKeyword1( outpatientDO.getConsumerName());
                    newConfig.setKeyword2( outpatientDO.getDeptName());
                    newConfig.setKeyword3( outpatientDO.getDoctorName());
                    newConfig.setKeyword4(DateUtil.dateToStrLong(outpatientDO.getRegisterDate()));
                    newConfig.setKeyword5(generalDoctorWaitingNumber(doctorDO.getId(), wxId, outpatientId));
                    //发起微信消息模板推送
                    newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                    logger.info("眼科微信消息模板推送 视频问诊预约提醒开始");
                }else {
                    if (consultTeam!=null){
                        WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_video_notice", scene, 1);
                        BeanUtils.copyProperties(config, newConfig);
                        if ("17".equals(type)) {
                            newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频咨询"));
                        }
                        newConfig.setKeyword1(consPatientDO.getName());
                        newConfig.setKeyword2(hospitalDO.getDeptName());
                        newConfig.setKeyword3(consDoctorDO.getName());
                        newConfig.setKeyword4(DateUtil.dateToStrLong(consultTeam.getCzrq()));
                        newConfig.setKeyword5(generalDoctorWaitingNumber(consDoctorDO.getId(), wxId, outpatientId));
                        //发起微信消息模板推送
                        newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                        logger.info("眼科微信消息模板推送 视频咨询预约提醒开始");
                    }
                if ("17".equals(type)) {
                    newConfig.setFirst(config.getFirst().replaceFirst("key1", "视频咨询"));
                }
                newConfig.setKeyword1( outpatientDO.getConsumerName());
                newConfig.setKeyword2( outpatientDO.getDeptName());
                newConfig.setKeyword3( outpatientDO.getDoctorName());
                newConfig.setKeyword4(DateUtil.dateToStrLong(outpatientDO.getRegisterDate()));
                newConfig.setKeyword5(generalDoctorWaitingNumber(doctorDO.getId(), wxId, outpatientId));
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 视频问诊预约提醒开始");
            } else if ("evaluateRemind".equalsIgnoreCase(titelType)) {
                //服务评价提醒
                scene = "fwqjtx";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_evaluate_notice", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
@ -4551,6 +4423,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                logger.info("眼科微信消息模板推送 服务评价提醒开始");
            } else if ("systemCancelRemind".equalsIgnoreCase(titelType)) {
                //系统24小时取消复诊提醒
                scene = "xtqxfz";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_system_cancel", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
@ -4571,8 +4444,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 系统拒诊开始");
            }
            logger.info("=======setUrl========" + newConfig.getUrl());
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
            for (BasePatientWechatDo one : ps) {
@ -4598,7 +4469,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
        } else if ("xm_xzzx_wx".equalsIgnoreCase(wxId)) {
            String responseMsg="";
            //String prefix="https://www.xmheart.com";
            String prefix = "https://ih.xmheart.com/hlwyy";
@ -4611,7 +4481,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        remark,
                        prefix+msgUrl);
            }
            if (consultTeam!=null&&consPatientDO!=null){
                responseMsg = xzzxEntranceService.sendMes(wxId,
                        consPatientDO.getId(),
@ -4627,7 +4496,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            logger.info("XZZX_Msg_" + titelType + "=" + responseMsg);
        } else if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
            String responseMsg="";
            String prefix="https://hlwyy.xmzsh.com";
            if(StringUtils.isNotEmpty(outpatientId)){

+ 10 - 8
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/TnyyEntranceService.java

@ -64,7 +64,7 @@ public class TnyyEntranceService {
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private YkDictIcd10Dao ykDictIcd10Dao;
    private final static String orgCode ="350211A5004";
    private final static String orgCode ="350211A1002";
    @Autowired
    private PatientMappingDao patientMappingDao;
@ -73,7 +73,7 @@ public class TnyyEntranceService {
    //同步科室
    public String updateTnyyDept() throws Exception {
        String sql = "select KSDM,KSMC,PYDM,PLSX,JGBM from GY_KSDM ";
        String sql = "select KSDM,KSMC,PYDM,PLSX,JGBM from GY_KSDM  ";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("updateTnyyDept:"+sql);
@ -90,7 +90,7 @@ public class TnyyEntranceService {
                String ksdm = deptObj.getString("KSDM");
                String jgbm = deptObj.getString("JGBM");
                String ksmc = deptObj.getString("KSMC");
                List<DictHospitalDeptDO> list = hospitalDeptDao.findByOrgCodeAndCode(jgbm,ksdm);
                List<DictHospitalDeptDO> list = hospitalDeptDao.findByOrgCodeAndCode(orgCode,ksdm);
                if (list!=null&&list.size()!=0){
                    DictHospitalDeptDO dictHospitalDeptDO = list.get(0);
                    dictHospitalDeptDO.setCode(ksdm);
@ -114,7 +114,7 @@ public class TnyyEntranceService {
    //更新泰安医生信息
    public String updateTnyyDoctor(String idCard)throws Exception{
        String sql ="select sfzh,LXDH,YGDM,KSDM,YGXM,YGXB,CSNY,YSJJ from GY_YGDM where ZFPB=1 and sfzh is not null ";
        String sql ="select sfzh,LXDH,YGDM,KSDM,YGXM,YGXB,CSNY,YSJJ from GY_YGDM where ZFPB=0 and sfzh is not null and len(ygbh) =3 and ksyq >0 and ksdm <> '2118' ";
        if (StringUtils.isNoneBlank(idCard)){
            sql +=" and sfzh ='"+idCard+"' ";
        }
@ -142,16 +142,17 @@ public class TnyyEntranceService {
                            BaseDoctorDO doctor = doctorDOs.get(0);
                            String salt = randomString(5);
                            /*String salt = randomString(5);
                            String pw = idcard.substring(idcard.length() - 6);
                            doctor.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                            doctor.setSalt(salt);
                            doctor.setSalt(salt);*/
                            /*doctor.setJobTitleCode(doctorJson.getString("jobtitlecode"));
                            doctor.setJobTitleName(doctorJson.getString("jobTitleName"));*/
//                            doctor.setExpertise(doctorJson.getString("expertise"));
//                            doctor.setIntroduce(doctorJson.getString("introduce"));
//                            doctor.setMobile(doctorJson.getString("mobile"));
                            doctor.setMobile(doctorJson.getString("LXDH"));
                            BaseDoctorDO temp = baseDoctorDao.save(doctor);
@ -173,6 +174,7 @@ public class TnyyEntranceService {
                            doctor.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)));
                            doctor.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
                            doctor.setMobile(doctorJson.getString("LXDH"));
                            doctor.setProvinceCode("370000");
                            doctor.setProvinceName("山东省");
@ -202,7 +204,7 @@ public class TnyyEntranceService {
                            BaseDoctorHospitalDO hospitalDO = new BaseDoctorHospitalDO();
                            hospitalDO.setDoctorCode(temp.getId());
                            hospitalDO.setOrgCode(orgCode);
                            hospitalDO.setOrgName("泰安中医院");
                            hospitalDO.setOrgName("泰安市中医医院");
                            hospitalDO.setDeptCode(doctorJson.getString("KSDM"));
                            hospitalDO.setDel("1");
                            baseDoctorHospitalDao.save(hospitalDO);
@ -220,7 +222,7 @@ public class TnyyEntranceService {
                            mappingDO.setDoctorName(temp.getName());
                            mappingDO.setOrgCode(orgCode);
                            mappingDO.setOrgName("泰安中医院");
                            mappingDO.setOrgName("泰安市中医医院");
                            mappingDO.setMappingCode(doctorJson.getString("YGDM"));
                            mappingDO.setMappingName(temp.getName());

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -562,6 +562,8 @@ public class YkyyEntranceService {
                ",h.KSDM,h.KSMC,h.ZDMC,h.JZXH from V_ZKSG_HZCX_HIS h WHERE h.BRID = "+brid+" ";
        if(!StringUtil.isBlank(conNo)){
            sql += " and h.JZXH = " + conNo;
        }else if (StringUtil.isBlank(ksdm)&&StringUtil.isBlank(conNo)){
            return new JSONArray();
        }
        if(!StringUtil.isBlank(startTime)){
            sql += " and h.KSSJ >= to_date('"+startTime+"', 'YYYY-MM-DD HH24:MI:SS')";

+ 1 - 0
svr/svr-door-serivce/sql/初始sql.sql

@ -794,6 +794,7 @@ CREATE TABLE `wlyy_followup` (
) ENGINE=InnoDB AUTO_INCREMENT=1889415 DEFAULT CHARSET=utf8mb4 COMMENT='随访计划表';
ALTER TABLE wlyy_door_service_order ADD followup_date varchar(50) COMMENT '随访时间' ;
ALTER TABLE wlyy_door_fee_detail ADD pay_status TINYINT(1) COMMENT '付款状态:0未付款 1已付款' ;
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('29', NULL, 'FOLLOWUP_PROJECT', '1', '1', '症状', NULL, NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('30', NULL, 'FOLLOWUP_PROJECT', '2', '1', '体征', NULL, NULL);

+ 1 - 3
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.netflix.discovery.converters.Auto;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.door.dao.*;
@ -1765,10 +1764,9 @@ public class DoorOrderService {
       JSONObject json = new JSONObject();
       String orderId = orderDO.getId();
       String payTypeName = "上门服务";
       BasePatientDO patientDO = patientInfoService.findById(orderDO.getPatient());
       List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wxId,orderDO.getPatient());
       String openId = basePatientWechatDos.get(0).getOpenid();
       String patientName = patientDO.getName();
       String patientName = orderDO.getPatientName();
       BaseDoctorDO doctorDO = baseDoctorDao.findById(doctorId);
       String doctorName = doctorDO.getName();
       String deptName = "";

+ 1 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -2959,7 +2959,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        List<WlyyDoorFeeDetailDO> feeDetailDOs = wlyyDoorFeeDetailDao.findByOrderIdAndPayStatus(orderId, 0);
        BigDecimal sum = new BigDecimal(0);
        for (WlyyDoorFeeDetailDO feeDetailDO: feeDetailDOs){
            sum.add(feeDetailDO.getFee().multiply(new BigDecimal(feeDetailDO.getNumber())));
            sum = sum.add(feeDetailDO.getFee().multiply(new BigDecimal(feeDetailDO.getNumber())));
        }
        sum = sum.setScale(1, BigDecimal.ROUND_DOWN);
        json.put("orderId",orderId);

+ 1 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/ServerPackageService.java

@ -91,7 +91,7 @@ public class ServerPackageService  {
                //上门护理
                sql = "SELECT code,value title,'' unit,0 expense   from base_system_dict_entry WHERE dict_code = 'door_service_door_dict' ORDER BY sort";
            }else{
                sql = "SELECT a.FYXH code,a.FYMC title,a.FYDW unit,a.FYDJ expense from gy_ylsf a ";
                sql = "SELECT DISTINCT a.FYXH code,a.FYMC title,a.FYDW unit,a.FYDJ expense from gy_ylsf a ";
                if("used".equals(type)){
                    sql += " JOIN wlyy_door_order_item i on i.code = a.FYXH and (i.patient = '"+patient+"' or i.doctor='"+doctor+"') ";
                }else if("other".equals(type)){

+ 2 - 2
svr/svr-door-serivce/src/main/resources/application.yml

@ -306,11 +306,11 @@ spring:
    port: 6380 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: https://365q88j171.oicp.vip/fastdfs/
  fastdfs_file_url: https://zyy.jkta.com.cn/fastdfs/
fast-dfs:
  tracker-server: 10.9.1.247:22122
  public-server: https://365q88j171.oicp.vip/fastdfs/
  public-server: https://zyy.jkta.com.cn/fastdfs/
neiwang:
  enable: true

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

@ -364,9 +364,6 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
				if("2".equalsIgnoreCase(outpatientDO.getType())){
					consult.setType(16);//视频复诊
					if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
						prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
					}
				}else{
					consult.setType(9);//图文复诊
				}
@ -375,9 +372,6 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			}else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())){
				if("2".equalsIgnoreCase(outpatientDO.getType())){
					consult.setType(17);//视频咨询
					if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
						prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"17","outpatientMsgRemind","");
					}
				}else if ("1".equalsIgnoreCase(outpatientDO.getType())){
					consult.setType(1);//图文咨询
				}

+ 1 - 16
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -10,7 +10,6 @@ import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
@ -402,7 +401,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
     */
    @RequestMapping(value = "/getOpenidByCode", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public Envelop getOpenidByCode(String code,String patientId) throws Exception {
    public Envelop getOpenidByCode(String code) throws Exception {
        //通过redis获取openid, 获取不到,则调用微信接口去取
        String key = wxId+":code";
        String openid = redisTemplate.opsForValue().get(key);
@ -410,20 +409,6 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            return success(PatientRequestMapping.Wechat.api_success,openid);
        }
        openid = wechatInfoService.getOpenidByCode(code, wxId);
        List<BasePatientWechatDo> patientWechatDoList =  patientWechatDao.findByWechatIdAndPatientId(wxId,patientId);
        if (patientWechatDoList!=null&&patientWechatDoList.size()!=0){
            BasePatientWechatDo patientWechatDo = patientWechatDoList.get(0);
            patientWechatDo.setOpenid(openid);
            patientWechatDao.save(patientWechatDo);
        }else {
            BasePatientWechatDo patientWechatDo = new BasePatientWechatDo();
            patientWechatDo.setCreateTime(new Date());
            patientWechatDo.setOpenid(openid);
            patientWechatDo.setWechatId(wxId);
            patientWechatDo.setPatientId(patientId);
            patientWechatDo.setSaasId("dev");
            patientWechatDao.save(patientWechatDo);
        }
        redisTemplate.opsForValue().set(key,openid);
        redisTemplate.expire(key,10, TimeUnit.SECONDS);
        return success(PatientRequestMapping.Wechat.api_success,openid);