Explorar o código

Merge branch 'dev' of wangjun/wlyy2.0 into dev

wangzhinan %!s(int64=4) %!d(string=hai) anos
pai
achega
391379b68b
Modificáronse 15 ficheiros con 388 adicións e 43 borrados
  1. 23 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java
  2. 167 14
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  4. 2 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  5. 18 6
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
  6. 7 4
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  7. 27 3
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  8. 1 1
      business/base-service/src/mqConfig/mqdata/MS53001.json
  9. 94 0
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  10. 9 0
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  11. 7 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  12. 8 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  13. 1 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java
  14. 5 9
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  15. 18 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

+ 23 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java

@ -88,6 +88,8 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
    @Autowired
    private PrescriptionLogDao prescriptionLogDao;
    @Autowired
    PrescriptionService prescriptionService;
    @Autowired
    private SfConfigDao sfConfigDao;
@ -591,7 +593,8 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
            if(!newroutinfolist.isEmpty()){
                prescriptionExpressageLogDao.save(newroutinfolist);
            }
            //向患者微信推送模板写消息
            pushRouteLogToPatient(newroutinfolist);
            //如果路由信息节点包含了"已收件"节点,则修改处方状态为完成,增加物流派送日志为完成
            if(isContainEndRoutInfo){
                //修改处方状态为完成
@ -643,7 +646,26 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
    }
    //发送微信模板消息
    public void pushRouteLogToPatient(List<WlyyPrescriptionExpressageLogDO> routinfolist){
        boolean isSend = true;//防止80和8000同时存在多向患者端多发一条消息
        for (WlyyPrescriptionExpressageLogDO wlyyPrescriptionExpressageLogDO:routinfolist){
            if ("50".equalsIgnoreCase(wlyyPrescriptionExpressageLogDO.getOpCode())||
                    "204".equalsIgnoreCase(wlyyPrescriptionExpressageLogDO.getOpCode())||
            "80".equalsIgnoreCase(wlyyPrescriptionExpressageLogDO.getOpCode())||"8000".equalsIgnoreCase(wlyyPrescriptionExpressageLogDO.getOpCode())){
                if ("80".equalsIgnoreCase(wlyyPrescriptionExpressageLogDO.getOpCode())||"8000".equalsIgnoreCase(wlyyPrescriptionExpressageLogDO.getOpCode())){
                    if (isSend){
                        prescriptionService.sendSFWxTemplate(wlyyPrescriptionExpressageLogDO.getOutpatientId(),wlyyPrescriptionExpressageLogDO.getPrescriptionId(),wlyyPrescriptionExpressageLogDO.getOpCode());
                        isSend= false;
                    }
                }else {
                    prescriptionService.sendSFWxTemplate(wlyyPrescriptionExpressageLogDO.getOutpatientId(),wlyyPrescriptionExpressageLogDO.getPrescriptionId(),wlyyPrescriptionExpressageLogDO.getOpCode());
                }
            }
        }
    }
    /**
     * 根据收寄地址获取快递费用
     * @param d_province 省份名称

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

@ -3036,13 +3036,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        String sql = "SELECT  ";
        if ("xm_ykyy_wx".equals(wxId)) {
            if (flag){
                sql = sql + "date_format(e.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"createTime\",";
                sql = sql + "date_format(e.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"expressCreateTime\",";
            }else {
                sql = sql + "to_char(e.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"createTime\",";
                sql = sql + "to_char(e.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"expressCreateTime\",";
            }
        } else {
            sql = sql + "date_format(e.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"createTime\",";
            sql = sql + "date_format(e.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"expressCreateTime\",";
        }
        if ("xm_ykyy_wx".equals(wxId)) {
            if (flag){
                sql = sql + "date_format(p.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"createTime\",";
            }else {
                sql = sql + "to_char(p.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"createTime\",";
            }
        } else {
            sql = sql + "date_format(p.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"createTime\",";
        }
        if ("xm_ykyy_wx".equals(wxId)) {
            if (flag){
@ -4347,7 +4357,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
        if ("xm_ykyy_wx".equalsIgnoreCase(wxId)||"sd_tnzyy_wx".equalsIgnoreCase(wxId)) {
            List<BasePatientWechatDo> ps = new ArrayList<BasePatientWechatDo>();
            if (StringUtils.isNotEmpty(outpatientId)){
                ps = basePatientWechatDao.findByWechatIdAndPatientId(wxId, outpatientDO.getConsumer());
@ -4453,22 +4463,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
            } else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
                scene = "mzxxtx";
                scene = "spthtx";
                if (StringUtils.isNotEmpty(outpatientId)){
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_msg_notice_jz", scene, 1);
                    WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_consult_notice", scene, 1);
                    BeanUtils.copyProperties(config, newConfig);
                    newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getDoctorName()).replace("key2", StringUtils.isNoneBlank(doctorDO.getJobTitleName())?doctorDO.getJobTitleName():""));
                    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.getAdmDate()));
                    newConfig.setKeyword2(DateUtil.dateToStrLong(outpatientDO.getCreateTime()));
                    newConfig.setKeyword3(outpatientDO.getDeptName());
                    newConfig.setKeyword4( outpatientDO.getIcd10Name());
                    newConfig.setKeyword4( outpatientDO.getDescription());
                    if ("16".equals(type)) {
                        newConfig.setRemark(config.getRemark().replace("key1", "视频复诊"));
                        newConfig.setRemark(config.getRemark());
                        newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                    } else if ("17".equals(type)) {
                        newConfig.setRemark(config.getRemark().replace("key1", "视频咨询"));
                        newConfig.setRemark(config.getRemark());
                        newConfig.setUrl(newConfig.getUrl().replace("type=16","type=17") + "" + outpatientDO.getId());
                    }
                    //发起微信消息模板推送
@ -4550,6 +4559,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                } else if ("16".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
                }else if ("1".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
                } else if ("17".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
                }
                newConfig.setKeyword1( outpatientDO.getHospitalName());
                newConfig.setKeyword2(outpatientDO.getDoctorName());
@ -4647,6 +4660,147 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
    }
    /**
     * 发送顺丰物流提醒模板消息
     * @param outpatientId
     */
    public void sendSFWxTemplate(String outpatientId,String prescriptionId,String routeCode){
        String contentMsg = "";
        String first = "";
        String remark = "";
        String patientId = "";
        String drugName = "";
        String remindMsg="";
        String patienName = "";
        String mailNo ="";
        String msgUrl ="";
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
        List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId,1);
        if (wlyyOutpatientDO!=null){
            patientId = wlyyOutpatientDO.getConsumer();
        }
        if (wlyyPrescriptionInfoDOS!=null&&wlyyPrescriptionInfoDOS.size()>0){
            drugName = wlyyPrescriptionInfoDOS.get(0).getDrugName();
        }
        List<WlyyPrescriptionExpressageDO> wlyyPrescriptionExpressageDOS =prescriptionExpressageDao.findByOutpatientId(outpatientId);
        if (wlyyPrescriptionExpressageDOS!=null&&wlyyPrescriptionExpressageDOS.size()>0){
            mailNo = wlyyPrescriptionExpressageDOS.get(0).getMailno();
        }
        switch (routeCode) {
            case "50":
                remindMsg = "已发出";
                break;
            case "204":
                remindMsg = "已在派件";
                break;
            case "80":
                remindMsg = "已签收";
                break;
            case "8000":
                remindMsg = "已签收";
                break;
        }
        BasePatientDO basePatientDO = basePatientDao.findById(patientId);
        if (basePatientDO!=null){
            patienName = basePatientDO.getName();
        }
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            List<BasePatientWechatDo> ps = new ArrayList<BasePatientWechatDo>();
            if (StringUtils.isNotEmpty(outpatientId)){
                ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
            }
            if (ps.isEmpty()) {
                logger.info("该用户" + patienName + "没有openid,无法推送模版消息,用户ID:" + patientId + "wechatId:" + wechatId);
                return;
            }
            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
            String scene = "sfxxtx";
            WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_sf_msg_notice", scene, 1);
            BeanUtils.copyProperties(config, newConfig);
            newConfig.setFirst(config.getFirst().replace("key1",remindMsg));
            newConfig.setKeyword1(config.getKeyword1().replace("key1",patienName).replace("key2",drugName));
            newConfig.setKeyword2("顺丰快递");
            newConfig.setKeyword3(mailNo);
            newConfig.setKeyword4(remindMsg);
            newConfig.setRemark(config.getRemark());
            newConfig.setUrl(newConfig.getUrl().replace("key1",outpatientId).replace("key2",prescriptionId));
            logger.info("=======setUrl========" + newConfig.getUrl());
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
            for (BasePatientWechatDo one : ps) {
                logger.info("发送的消息="+ com.alibaba.fastjson.JSONObject.toJSONString(newConfig));
                try {
                    logger.info("调用眼科微信模板消息接口的入参:AccessToken="+wxAccessTokenDO.getAccessToken()+"---Openid="+one.getOpenid());
                    weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), one.getOpenid(), newConfig);
                    logger.info("发送成功");
                } catch (Exception e) {
                    e.printStackTrace();
                    logger.info("发送失败,error="+e.getMessage());
                }
                //保存发送模板记录,
                WxPushLogDO wxPushLogDO = new WxPushLogDO();
                wxPushLogDO.setCreateTime(new Date());
                wxPushLogDO.setOpenid(one.getOpenid());
                wxPushLogDO.setReceiver(patientId);
                wxPushLogDO.setWechatId(wechatId);
                wxPushLogDO.setReceiverName(patienName);
                wxPushLogDO.setScene(scene);
                wxPushLogDao.save(wxPushLogDO);
            }
        }else {
            first = "您好,您的处方订单物流"+remindMsg;
            contentMsg = "患者"+patienName+"的处方药品订单,"+drugName+"等,当前"+remindMsg+"。物流方:「顺丰快递」,物流单号:"+mailNo+"。";
            logger.info("推送物流模板消息参数first:"+first+"====contentMsg:"+contentMsg);
            msgUrl="/ims-wx/index.html#/returnVisit/logistics?outpatientId="+outpatientId+"&prescriptionCode="+prescriptionId;
            String responseMsg = "";
            if ("xm_xzzx_wx".equalsIgnoreCase(wechatId)) {
                //String prefix="https://www.xmheart.com";
                String prefix = "https://ih.xmheart.com/hlwyy";
                if(StringUtils.isNotEmpty(outpatientId)){
                    responseMsg = xzzxEntranceService.sendMes(wechatId,
                            patientId,
                            basePatientDO.getIdcard(),
                            first,
                            contentMsg,
                            remark,
                            prefix+msgUrl);
                }
                logger.info("url="+prefix+msgUrl);
                String msg="first:"+first+"contentMsg:"+contentMsg+"remark:"+remark;
                logger.info("发送的信息="+msg);
                logger.info("心脏模板消息发送返回结果:"+responseMsg);
            } else if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)) {
                String prefix = "https://hlwyy.xmzsh.com";
                if (StringUtils.isNotEmpty(outpatientId)) {
                    responseMsg = entranceService.ehospitalNotice(
                            patienName,
                            basePatientDO.getIdcard(),
                            basePatientDO.getMobile(),
                            first,
                            prefix + msgUrl,
                            contentMsg,
                            remark
                    );
                    logger.info("中山发送模板消息返回结果="+responseMsg);
                    System.out.println("结束发送模板消息");
                }
            }
            //保存发送模板记录,
            WxPushLogDO wxPushLogDO = new WxPushLogDO();
            wxPushLogDO.setCreateTime(new Date());
            wxPushLogDO.setReceiver(patientId);
            wxPushLogDO.setWechatId(wechatId);
            wxPushLogDO.setReceiverName(patienName);
            wxPushLogDO.setRequest(first+contentMsg+msgUrl);
            wxPushLogDO.setResponse(responseMsg);
            wxPushLogDO.setTempName("顺丰推送的物流消息");
            wxPushLogDao.save(wxPushLogDO);
        }
    }
    public List<WlyyHospitalSysDictDO> findCancelReasonList() {
        return sysDictDao.findByDictName("PatientCancel");
@ -10297,7 +10451,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
               }
           }
       }catch (Exception e){
           e.printStackTrace();
           return doorServiceCount;
       }
       return doorServiceCount;

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -277,7 +277,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     *
     */
    public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn,String patient,String realOrder,String admNo,boolean demoFlag)throws Exception{
        String patNo =patientMappingService.findHisPatNoByPatient(patient,null);
        String patNo =patientMappingService.findYkyyPatNoByPatient(patient,demoFlag);
        if(StringUtils.isBlank(patNo)){
            return null;
        }

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

@ -596,6 +596,7 @@ public class EntranceService {
            if (StringUtils.isNotBlank(ksdm)) {
                sbs.append("<query compy=\"=\" item=\"ADM_SPEC\" splice=\"and\" value=\"'" + ksdm + "'\"/>");
            }
            sbs.append("<query compy=\"\" item=\"icd_name\" splice=\"and\" value=\"is not null\"/>");
            sbs.append("<order item=\"CON_DATE\" sort=\"desc\"/>");
            //查询信息结束
            sbs.append("</MsgInfo></ESBEntry>");
@ -1479,9 +1480,7 @@ public class EntranceService {
            if (StringUtils.isNotBlank(now)) {
                sbs.append("<query compy=\"&lt;\" item=\"ADM_DAT\" splice=\"and\" value=\"'" + now + "'\"/>");
            }
            if (StringUtils.isNotBlank(preday)) {
                sbs.append("<query compy=\"\" item=\"icd_name\" splice=\"and\" value=\"is not null\"/>");
            }
            sbs.append("<query compy=\"\" item=\"icd_name\" splice=\"and\" value=\"is not null\"/>");
            sbs.append("<order item=\"ADM_DAT\" sort=\"desc\"/>");
            //查询信息结束
            sbs.append("</MsgInfo></ESBEntry>");

+ 18 - 6
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -340,9 +340,15 @@ public class XzzxEntranceService{
                            doctor.setTownName("思明区");
                            doctor.setCityCode("350200");
                            doctor.setCityName("厦门市");
                            doctor.setExpertise(doctorJson.getString("expertise"));
                            doctor.setIntroduce(doctorJson.getString("introduce"));
                            doctor.setPhoto(doctorJson.getString("photo"));
                            if (!"[]".equalsIgnoreCase(doctorJson.getString("expertise"))&&StringUtils.isNoneBlank(doctorJson.getString("expertise"))){
                                doctor.setExpertise(doctorJson.getString("expertise"));
                            }
                            if (!"[]".equalsIgnoreCase(doctorJson.getString("introduce"))&&StringUtils.isNoneBlank(doctorJson.getString("introduce"))){
                                doctor.setIntroduce(doctorJson.getString("introduce"));
                            }
                            if (!"[]".equalsIgnoreCase(doctorJson.getString("photo"))&&StringUtils.isNoneBlank(doctorJson.getString("photo"))){
                                doctor.setPhoto(doctorJson.getString("photo"));
                            }
                            doctor.setIscertified(doctorJson.getString("iscertified"));
                            doctor.setSpell(doctorJson.getString("spell"));
//                                String salt = randomString(5);
@ -415,9 +421,15 @@ public class XzzxEntranceService{
                            doctor.setTownName("思明区");
                            doctor.setCityCode("350200");
                            doctor.setCityName("厦门市");
                            doctor.setExpertise(doctorJson.getString("expertise"));
                            doctor.setIntroduce(doctorJson.getString("introduce"));
                            doctor.setPhoto(doctorJson.getString("photo"));
                            if (!"[]".equalsIgnoreCase(doctorJson.getString("expertise"))&&StringUtils.isNoneBlank(doctorJson.getString("expertise"))){
                                doctor.setExpertise(doctorJson.getString("expertise"));
                            }
                            if (!"[]".equalsIgnoreCase(doctorJson.getString("introduce"))&&StringUtils.isNoneBlank(doctorJson.getString("introduce"))){
                                doctor.setIntroduce(doctorJson.getString("introduce"));
                            }
                            if (!"[]".equalsIgnoreCase(doctorJson.getString("photo"))&&StringUtils.isNoneBlank(doctorJson.getString("photo"))){
                                doctor.setPhoto(doctorJson.getString("photo"));
                            }
                            doctor.setIscertified(doctorJson.getString("iscertified"));
                            doctor.setSpell(doctorJson.getString("spell"));
                            doctor.setOutpatientType("zj");

+ 7 - 4
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -1544,8 +1544,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                " base_evaluate_score a " +
                " JOIN base_evaluate e ON a.id = e.relation_code " +
                " JOIN base_doctor d ON d.id = a.doctor " +
                " WHERE " +
                " e.score_type = '4'";
                " JOIN wlyy_consult m ON m.id = a.relation_code  " +
                "WHERE " +
                " e.score_type = '4' and m.id != '' and m.id is not null ";
        if(StringUtils.isNotBlank(startDate)){
            yypjSql =  yypjSql + "  and a.create_time >=:startDate ";
@ -1596,7 +1597,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                "      join base_doctor b on b.id = a.doctor" +
                "      join base_patient c on c.id = a.patient" +
                " where a.register_no is NOT NULL and a.dept is not null " +
                " and a.register_date is not null " ;
                " and a.register_date is not null " +
                " and a.doctor not in ('402803816babc778016babd0dee21112')" +
                " and a.patient not in ('2c9081aa6c2f1892016c6a26a8c102ca','39686349deff487d8f3372fc253b8417') " ;
        if(StringUtils.isNotBlank(startDate)){
            wlzlSql =  wlzlSql + "  and a.create_time >=:startDate ";
        }
@ -1640,7 +1643,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                "  from wlyy_prescription_info a " +
                "     JOIN wlyy_prescription b " +
                "     on b.id = a.prescription_id" +
                "  where  a.dosage is not null and b.real_order is not null";
                "  where  a.dosage is not null and b.real_order is not null and a.del=1 ";
        if(StringUtils.isNotBlank(startDate)){
            infosql =  infosql + "  and b.create_time >=:startDate ";

+ 27 - 3
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1510,6 +1510,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        }
        WlyyHospitalSysDictDO hospitalSysDictDO =hospitalSysDictDao.findById("YLZ_NOTIFY_URL");
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(code);
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(code);
        if (businessOrderDO!=null){
            BasePatientDO patientDO = patientDao.findById(businessOrderDO.getPatient());
            String idcard = "";
@ -1522,9 +1523,32 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            if (StringUtils.isNoneBlank(businessOrderDO.getDoctor())){
                BaseDoctorDO doctorDO = doctorDao.findById(businessOrderDO.getDoctor());
                String fee = null;
                if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                    WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getChargeType(),"6");
                    fee = chargeDictDO.getReqFee()+"";
                if (wechatId.equalsIgnoreCase("xm_zsyy_wx")||wechatId.equalsIgnoreCase("xm_xzzx_wx")){
                    if (wlyyOutpatientDO!=null){
                        if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getTwfzChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getSpfzChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getTwzxChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getSpzxChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getXtfzChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getJyzxChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }else {
                            WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getChargeType(),"6");
                            fee = chargeDictDO.getReqFee()+"";
                        }
                    }
                }else {
                    WlyyChargeDictDO chargeDictDO = chargeDictDao.findByChargeType(doctorDO.getChargeType());
                    fee = chargeDictDO.getReqFee()+"";

+ 1 - 1
business/base-service/src/mqConfig/mqdata/MS53001.json

@ -22,7 +22,7 @@
				"specification": "10mgx10片/盒",
				"retprice": "1.5726",
				"pack_retprice": "15.726",
				"stock_amount": "0",
				"stock_amount": "1",
				"visible_flag": "0",
				"drug_flag": "0",
				"py_code": "BNPLP   ",

+ 94 - 0
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -4478,6 +4478,7 @@ public class StatisticsEsService {
    public JSONObject getPrescriptionLineBy(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
        String[] indexes = index.split(",");
        String index3 = indexes.length>=3?indexes[2]:"20";
        JSONArray resultArray = new JSONArray();
        //问诊量
        JSONObject object = new JSONObject();
@ -4511,8 +4512,11 @@ public class StatisticsEsService {
            //开具处方数量
            Double preNum = 0.0;
            Double outNum = 0.0;
            Double isPayNum = 0.0;//已支付的处方数量
            String prescriptionRate ="";
            String prescriptionPayRate = "";
            List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"","",level2_type);
            List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL,"1","",level2_type);
            if(SaveModel.OrgLevel.equals(level2_type)){
                for(SaveModel saveModel:precriptionList){
@ -4531,6 +4535,16 @@ public class StatisticsEsService {
                            break;
                        }
                    }
                    for (SaveModel saveModel2:precriptionIsPayList){
                        String isPay=saveModel2.getHospital()==null?"":saveModel2.getHospital();
                        String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
                        if(isPay.equalsIgnoreCase(pre)){
                            isPayNum = saveModel2.getResult1();
                            prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
                            jsonObject.put("prescriptionPayRate",prescriptionPayRate);
                            break;
                        }
                    }
                    if(null==saveModel.getHospital()){
                        resultArray =new JSONArray();
                    }else {
@ -4565,6 +4579,16 @@ public class StatisticsEsService {
                            break;
                        }
                    }
                    for (SaveModel saveModel2:precriptionIsPayList){
                        String isPay=saveModel2.getDoctor()==null?"":saveModel2.getDoctor();
                        String pre=saveModel.getDoctor()==null?"":saveModel.getDoctor();
                        if(isPay.equalsIgnoreCase(pre)){
                            isPayNum = saveModel2.getResult1();
                            prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
                            jsonObject.put("prescriptionPayRate",prescriptionPayRate);
                            break;
                        }
                    }
                    if(null==saveModel.getDoctor()){
                        resultArray =new JSONArray();
                    }else {
@ -4592,6 +4616,16 @@ public class StatisticsEsService {
                            break;
                        }
                    }
                    for (SaveModel saveModel2:precriptionIsPayList){
                        String isPay=saveModel2.getDept()==null?"":saveModel2.getDept();
                        String pre=saveModel.getDept()==null?"":saveModel.getDept();
                        if(isPay.equalsIgnoreCase(pre)){
                            isPayNum = saveModel2.getResult1();
                            prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
                            jsonObject.put("prescriptionPayRate",prescriptionPayRate);
                            break;
                        }
                    }
                    if(null==saveModel.getDept()){
                        resultArray =new JSONArray();
                    }else {
@ -4606,8 +4640,11 @@ public class StatisticsEsService {
            //开具处方数量
            Double preNum = 0.0;
            Double outNum = 0.0;
            Double isPayNum = 0.0;//已支付的处方数量
            String prescriptionRate ="";
            String prescriptionPayRate = "";
            List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"","","4");
            List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL,"1","","4");
            for(SaveModel saveModel:precriptionList){
                preNum = saveModel.getResult1();
                JSONObject jsonObject = new JSONObject();
@ -4628,6 +4665,16 @@ public class StatisticsEsService {
                        break;
                    }
                }
                for (SaveModel saveModel2:precriptionIsPayList){
                    String isPay=saveModel2.getHospital()==null?"":saveModel2.getHospital();
                    String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
                    if(isPay.equalsIgnoreCase(pre)){
                        isPayNum = saveModel2.getResult1();
                        prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
                        jsonObject.put("prescriptionPayRate",prescriptionPayRate);
                        break;
                    }
                }
                if(null==saveModel.getHospital()){
                    resultArray =new JSONArray();
                }else {
@ -4670,6 +4717,7 @@ public class StatisticsEsService {
    public JSONObject getPrescriptionLineByType(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
        String[] indexes = index.split(",");
        String index3 = indexes.length>=3?indexes[2]:"20";
        JSONArray resultArray = new JSONArray();
        //问诊量
        JSONObject object = new JSONObject();
@ -4702,8 +4750,11 @@ public class StatisticsEsService {
            //开具处方数量
            Double preNum = 0.0;
            Double outNum = 0.0;
            Double isPayNum = 0.0;//已支付的处方数量
            String prescriptionRate = "";
            String prescriptionPayRate = "";
            List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL, "", "", level2_type);
            List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL,"1","",level2_type);
            if (SaveModel.OrgLevel.equals(level2_type)) {
                //问诊量表格
                for (SaveModel saveModel : precriptionList) {
@ -4722,6 +4773,16 @@ public class StatisticsEsService {
                            break;
                        }
                    }
                    for (SaveModel saveModel2:precriptionIsPayList){
                        String isPay=saveModel2.getHospital()==null?"":saveModel2.getHospital();
                        String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
                        if(isPay.equalsIgnoreCase(pre)){
                            isPayNum = saveModel2.getResult1();
                            prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
                            jsonObject.put("prescriptionPayRate",prescriptionPayRate);
                            break;
                        }
                    }
                    if(null==saveModel.getHospital()){
                        resultArray =new JSONArray();
                    }else {
@ -4750,6 +4811,16 @@ public class StatisticsEsService {
                            break;
                        }
                    }
                    for (SaveModel saveModel2:precriptionIsPayList){
                        String isPay=saveModel2.getDoctor()==null?"":saveModel2.getDoctor();
                        String pre=saveModel.getDoctor()==null?"":saveModel.getDoctor();
                        if(isPay.equalsIgnoreCase(pre)){
                            isPayNum = saveModel2.getResult1();
                            prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
                            jsonObject.put("prescriptionPayRate",prescriptionPayRate);
                            break;
                        }
                    }
                    if(null==saveModel.getDoctor()){
                        resultArray =new JSONArray();
                    }else {
@ -4778,6 +4849,16 @@ public class StatisticsEsService {
                            break;
                        }
                    }
                    for (SaveModel saveModel2:precriptionIsPayList){
                        String isPay=saveModel2.getDept()==null?"":saveModel2.getDept();
                        String pre=saveModel.getDept()==null?"":saveModel.getDept();
                        if(isPay.equalsIgnoreCase(pre)){
                            isPayNum = saveModel2.getResult1();
                            prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
                            jsonObject.put("prescriptionPayRate",prescriptionPayRate);
                            break;
                        }
                    }
                    if(null==saveModel.getDept()){
                        resultArray =new JSONArray();
                    }else {
@ -4791,8 +4872,11 @@ public class StatisticsEsService {
            //开具处方数量
            Double preNum = 0.0;
            Double outNum = 0.0;
            Double isPayNum = 0.0;//已支付的处方数量
            String prescriptionRate = "";
            String prescriptionPayRate = "";
            List<SaveModel> precriptionList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL, "", "", "4");
            List<SaveModel> precriptionIsPayList = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, index3, SaveModel.timeLevel_ZL,"1","","4");
            for (SaveModel saveModel : precriptionList) {
                preNum = saveModel.getResult1();
                JSONObject jsonObject = new JSONObject();
@ -4813,6 +4897,16 @@ public class StatisticsEsService {
                        break;
                    }
                }
                for (SaveModel saveModel2:precriptionIsPayList){
                    String isPay=saveModel2.getHospital()==null?"":saveModel2.getHospital();
                    String pre=saveModel.getHospital()==null?"":saveModel.getHospital();
                    if(isPay.equalsIgnoreCase(pre)){
                        isPayNum = saveModel2.getResult1();
                        prescriptionPayRate = getRange(isPayNum.intValue(),preNum.intValue(),0);
                        jsonObject.put("prescriptionPayRate",prescriptionPayRate);
                        break;
                    }
                }
                if(null==saveModel.getHospital()){
                    resultArray =new JSONArray();
                }else {

+ 9 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -55,6 +55,7 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.jw.wechat.service.WxTemplateService;
import com.ylzinfo.onepay.sdk.domain.ext.WaitPayDetailVO;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
import org.slf4j.LoggerFactory;
@ -151,6 +152,8 @@ public class ImService {
	@Value("${demo.flag}")
	private boolean demoFlag;
	@Autowired
	private WxTemplateService wxTemplateService;
	@Autowired
	private JdbcTemplate jdbcTemplate;
@ -1360,6 +1363,10 @@ public class ImService {
				// 添加咨询转发记录
				// 添加医生咨询日志
				addLogs(ct);
				//只有勾选同同时发起视频邀请的时候才发送模板消息
				if("2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
					wxTemplateService.sendWeTempMesMiniProgram(wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getDoctorName(),wlyyOutpatientDO.getConsumer(),wlyyOutpatientDO.getConsumerName(),consult.getId());
				}
			}
			String sessionIds = patient + "_" + outpatientCode + "_" + ct.getType();
			JSONObject result = imUtil.getSingleSessionInfo(sessionIds,doctorCode);
@ -1380,6 +1387,8 @@ public class ImService {
				}
			}
			//发送外层SOCKET消息 在线复诊
			if("1".equals(wlyyOutpatientDO.getOutpatientType())){
				System.out.println("发送外层SOCKET消息:在线复诊");

+ 7 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -672,6 +672,13 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @RequestMapping(value = "/oauth/sendCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
        String wxId = parameters.get("wxId");
        String key = parameters.get("key");
        String text = parameters.get("text");
        if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
            if(!verifyCaptcha(key,text)){
                throw new ImgCaptchaException("img_captcha error");
            }
        }
        if("xm_ykyy_wx".equals(wxId)){
           return sendYKCaptcha(parameters);
        }else if("xm_zsyy_wx".equals(wxId)){

+ 8 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -562,6 +562,14 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        try {
            baseDoctorDO = objectMapper.readValue(doctor.toJSONString(),BaseDoctorDO.class);
            BaseDoctorDO oldDoctor = baseDoctorDao.findOne(baseDoctorDO.getId());
            if (oldDoctor!=null&&!oldDoctor.getIdcard().equalsIgnoreCase(baseDoctorDO.getIdcard())){
              List<BaseDoctorDO> isExist =  baseDoctorDao.findByIdcard(baseDoctorDO.getIdcard());
              if (isExist!=null&&isExist.size()>0){
                  result.put("msg","当前身份证号已存在,请检查身份证号是否正确");
                  result.put("response", ConstantUtils.FAIL);
                  return result.toJSONString();
              }
            }
            baseDoctorDO.setPassword(oldDoctor.getPassword());
            baseDoctorDO.setEnabled(baseDoctorDO.getDel().equalsIgnoreCase("1")?1:0);
        } catch (IOException e) {

+ 1 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java

@ -27,7 +27,7 @@ import java.util.List;
@EnableScheduling
public class OverdueJob implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(OverdueJob.class);
    private static String cron = "0 */5 * * * ?";//"0 0 0 * * ?";
    private static String cron = "0 */5 * * * ?";//"0 0 0 * * ?";0 */5 * * * ?
    public OverdueJob(){
        cron="0 */5 * * * ?";
        System.out.println("初始化时的corn"+cron);

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

@ -208,9 +208,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);//图文复诊
					}
@ -219,9 +216,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);//图文咨询
					}
@ -252,7 +246,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
							rsCode="0";
							mes="已挂号";
						}
						if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
						/*if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
							if ("2".equalsIgnoreCase(outpatientDO.getType())){
								prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
							}
@ -261,7 +255,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
							if ("2".equalsIgnoreCase(outpatientDO.getType())){
								prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"17","outpatientMsgRemind","");
							}
						}
						}*/
					}else {
						if (demoFlag.equalsIgnoreCase("true")){
@ -917,7 +911,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		result.put("imgConsultCount",prescriptionService.getWaitVideoCount(doctor,"1","3",wxId));//图文咨询数量
		result.put("videoConsultCount",prescriptionService.getWaitVideoCount(doctor,"2","3",wxId));//视频咨询数量
		result.put("homeConsultCount",prescriptionService.getWaitVideoCount(doctor,"3","3",wxId));//家医咨询数量
		result.put("doorServiceCount",prescriptionService.waitUpdoorCount(doctor));//上门服务数量
		if ("sd_tnzyy_wx".equalsIgnoreCase(wxId)){
            result.put("doorServiceCount",prescriptionService.waitUpdoorCount(doctor));//上门服务数量
        }
		logger.info("action:doctorReviewConsultCount--end:"+DateUtil.dateToStrLong(new Date()));
		return success("请求成功",result);
	}

+ 18 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -91,6 +91,15 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
        String medicareType = obj.getString("medicareType");
        String medicare = obj.getString("medicare");
        String clinicId = obj.getString("clinicId");
        /*String key = obj.getString("key");
        String text = obj.getString("text");
        if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
            if(!verifyCaptcha(key,text)){
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("图形验证码输入错误");
                return mixEnvelop;
            }
        }*/
        net.sf.json.JSONArray jsonArray = new JSONArray();
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            jsonArray = ykyyEntranceService.findHisPatientBymMedicare(medicare,clinicId,false);
@ -375,4 +384,13 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                                    @RequestParam(value = "id", required = false) String id) throws ParseException {
        return success(wlyyFamilyMemberService.findMemberById(id));
    }
    public boolean verifyCaptcha(String key,String text){
        boolean pass = false;
        String captcha = redisTemplate.opsForValue().get(key).toString();
        if (org.apache.commons.lang3.StringUtils.isNotBlank(captcha)&& captcha.equals(text.toLowerCase())){
            pass = true;
            redisTemplate.delete(key);
        }
        return pass;
    }
}