瀏覽代碼

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

liubing 4 年之前
父節點
當前提交
a04c0d8d98
共有 29 個文件被更改,包括 776 次插入63 次删除
  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 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TnPrescriptionService.java
  4. 2 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  5. 2 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  6. 6 6
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/TnyyEntranceService.java
  7. 19 7
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
  8. 7 4
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  9. 35 3
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  10. 1 1
      business/base-service/src/mqConfig/mqdata/MS53001.json
  11. 94 0
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  12. 9 0
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  13. 26 0
      business/sms-service/src/main/java/com/yihu/jw/sms/dao/WlyyHospitalSysDictDao.java
  14. 115 0
      business/sms-service/src/main/java/com/yihu/jw/sms/service/ZBSmsService.java
  15. 2 1
      common/common-entity/sql记录
  16. 12 1
      common/common-entity/src/main/java/com/yihu/jw/entity/door/WlyyDoorFeeDetailDO.java
  17. 72 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  18. 8 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  19. 66 6
      svr/svr-door-serivce/pom.xml
  20. 0 1
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java
  21. 15 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/patient/PatientController.java
  22. 23 2
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/patient/WlyyDoorServiceOrderController.java
  23. 8 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/dao/WlyyDoorFeeDetailDao.java
  24. 3 1
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java
  25. 23 1
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java
  26. 13 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/ServerPackageService.java
  27. 1 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java
  28. 5 9
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  29. 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 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TnPrescriptionService.java

@ -539,6 +539,7 @@ public class TnPrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pr
/*            object.put("ybfl",map.get("ybfl"));//医保分类*/
            object.put("retprice",map.get("LSJG"));//零售价格
            object.put("kcsl",map.get("KCSL"));//库存
            object.put("stock_amount",map.get("KCSL"));//库存
            object.put("ypcd",map.get("YPCD"));//产地
            object.put("zfpb",map.get("ZFPB"));//作废判别
            object.put("jbywbz",map.get("jbywbz"));//基本药物标志

+ 2 - 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;
        }
@ -635,6 +635,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            object.put("ydyp",map.get("ydyp"));//药店药品
            object.put("ypmc2",map.get("ypmc2"));//药品名称2
            object.put("t",map.get("pzwh"));//药品批文
            object.put("stock_amount",map.get("kcsl"));//库存
            array.add(object);
        }
        return array;

+ 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>");

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

@ -174,12 +174,12 @@ public class TnyyEntranceService {
                            doctor.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)));
                            doctor.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
                            doctor.setProvinceCode("350000");
                            doctor.setProvinceName("福建省");
                            doctor.setTownCode("350203");
                            doctor.setTownName("思明区");
                            doctor.setCityCode("350200");
                            doctor.setCityName("厦门市");
                            doctor.setProvinceCode("370000");
                            doctor.setProvinceName("山东省");
                            doctor.setTownCode("370902");
                            doctor.setTownName("泰山区");
                            doctor.setCityCode("370900");
                            doctor.setCityName("泰安市");
//                            doctor.setExpertise(doctorJson.getString("expertise"));
//                            doctor.setIntroduce(doctorJson.getString("introduce"));
//                            doctor.setMobile(doctorJson.getString("mobile"));

+ 19 - 7
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");
@ -3055,7 +3067,7 @@ public class XzzxEntranceService{
                object1.put("retprice",jsonObject.getString("RETAIL_PRICE"));
                object1.put("specification",jsonObject.getString("PHYSIC_SPEC"));
                object1.put("pack_retprice",jsonObject.getString("RETAIL_PRICE"));
                object1.put("stock_amount","");
                object1.put("stock_amount",jsonObject.getString("QUANTITY"));
                object1.put("visible_flag",jsonObject.getString("VALID_FLAG"));
                object1.put("drug_flag",jsonObject.getString("OTC_FLAG"));
                object1.put("py_code",jsonObject.getString("SPELL_CODE"));

+ 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 ";

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

@ -476,6 +476,12 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                }
            }
        }
        if (businessOrderDO.getOrderNo()!=null&&businessOrderDO.getOrderNo().contains("HLWYYQD")){
            businessOrderDO.setOrderNo("HLWYYQD"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
        }else {
            businessOrderDO.setOrderNo("HLWYY"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
        }
        businessOrderDao.save(businessOrderDO);
        String ourTradeNo = businessOrderDO.getOrderNo();
        if (!StringUtils.isNoneBlank(tradeType)){
            tradeType=WeChatConfig.TRADE_TYPE_JSAPI;
@ -1076,6 +1082,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                openId = patientWechatDo.getOpenid();
            }
            String price = businessOrderDO.getPayPrice().toString();
            businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            String notifyUrl = hospitalSysDictDO.getDictCode();
            response = ylzPayService.rechargeConsume("123456",businessOrderDO.getPatientName(),"01",ssc,"01",idcard,depositType,
                    price,price,businessOrderDO.getOrderNo(),idcard,"0",businessOrderDO.getPatientName(),businessOrderDO.getRematk(),openId,notifyUrl,notifyUrl,null);
@ -1503,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 = "";
@ -1515,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()+"";
@ -1553,6 +1584,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            }
            businessOrderDO.setPayType(4);
            businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            businessOrderDao.save(businessOrderDO);
            List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
            if (patientWechatDos!=null&&patientWechatDos.size()!=0){

+ 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消息:在线复诊");

+ 26 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/dao/WlyyHospitalSysDictDao.java

@ -0,0 +1,26 @@
package com.yihu.jw.sms.dao;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2019/6/17.
 */
public interface WlyyHospitalSysDictDao extends PagingAndSortingRepository<WlyyHospitalSysDictDO, String>, JpaSpecificationExecutor<WlyyHospitalSysDictDO> {
    WlyyHospitalSysDictDO findByHospitalAndDictCode(String hospital, String dictCode);
    List<WlyyHospitalSysDictDO> findByHospitalAndDictNameOrderBySortAsc(String hospital, String dictName);
    WlyyHospitalSysDictDO findById(String id);
    List<WlyyHospitalSysDictDO> findByDictName(String dictName);
    @Query("from WlyyHospitalSysDictDO where 1=1")
    List<WlyyHospitalSysDictDO> findAlldict();
    @Query("from WlyyHospitalSysDictDO where dictCode = ?1")
    List<WlyyHospitalSysDictDO> findByDictCode(String dictCode);
}

+ 115 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/service/ZBSmsService.java

@ -0,0 +1,115 @@
package com.yihu.jw.sms.service;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.sms.dao.WlyyHospitalSysDictDao;
import com.yihu.jw.util.http.HttpClientUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 福州总部的短信接口
 */
@Service
public class ZBSmsService {
    private Logger logger= LoggerFactory.getLogger(ZBSmsService.class);
    private String clientId;
    private String resturl;
    private String smsAPI;
    private String smsHandlerId;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private WlyyHospitalSysDictDao sysDictDao;
    private String appId = "9000424";
//    private String secret = "Q1ZCTGKMCTDYHGGQP9S4VJO6KUQRTIA39RKHJ57IIQ8";//测试参数
    private String secret = "YM7WCB2LX32MCKFHWB64V4ARBGMQ36VOO8XOZ2TPP1B";//正式参数
    private String prixUrl = "https://api.yihu.com/OpenPlatform/cgiBin/1.0/";//正式参数
//    private String prixUrl = "https://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/";//测试参数
    /**
     * 初始化总部接口参数
     */
    private void init(){
        List<WlyyHospitalSysDictDO> dictDOList = sysDictDao.findByDictName("zbSms");
        for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:dictDOList){
            if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("clientId")){
                clientId=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("resturl")){
                resturl=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("smsAPI")){
                smsAPI=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("smsHandlerId")){
                smsHandlerId=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("appId")){
                appId=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("secret")){
                secret=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("prixUrl")){
                prixUrl=wlyyHospitalSysDictDO.getDictValue();
            }
        }
    }
    /**
     * 发送短信
     * @return
     */
    public Integer sendMessage(String mobile,String content) throws Exception {
        try{
            //初始化参数
            init();
            String apiUrl = prixUrl+"MsgGW/Sms/send";
            String timestamp =
                    Long.toString(System.currentTimeMillis());//timestamp必须与服务器时间相差在5分钟以内,否则调用将失败;
            Map<String, String> paramMap = new HashMap<>();
            paramMap.put("provinceCode", "350000");
            paramMap.put("cityCode", "350200");
            paramMap.put("mobile", mobile);
            paramMap.put("content", content);
            paramMap.put("handlerId", smsHandlerId);
            paramMap.put("timestamp", timestamp);
            StringBuilder stringBuilder = new StringBuilder();
            // 对参数名进行字典排序
            String[] keyArray = paramMap.keySet().toArray(new String[0]);
            Arrays.sort(keyArray);
            // 拼接有序的参数名-值串
            stringBuilder.append(appId);
            for (String key : keyArray)
            {
                stringBuilder.append(key).append(paramMap.get(key));
            }
            String codes = stringBuilder.append(secret).toString();
            String sign = org.apache.commons.codec.digest.DigestUtils.shaHex(codes).toUpperCase();
            // 添加签名,并发送请求
            paramMap.put("appId", appId);
            paramMap.put("sign", sign);
            String rep = httpClientUtil.httpPost(apiUrl, paramMap);
            logger.info("总部短信接口请求返回值:"+rep);
            if (!StringUtils.isEmpty(rep)){
                com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(rep);
                if ( jsonObject.getInteger("Code")==10000){
                    return 0;
                }
            }
            return 1;
        }catch (Exception e){
            logger.error(e.getMessage());
        }
        return null;
    }
}

+ 2 - 1
common/common-entity/sql记录

@ -67,6 +67,7 @@ CREATE TABLE `wlyy_followup_drugs` (
) ENGINE=InnoDB AUTO_INCREMENT=436 DEFAULT CHARSET=utf8mb4 COMMENT='随访用药记录';
-- 2021-01-19 ysj 上门服务项费用相关
ALTER TABLE wlyy_door_fee_detail ADD pay_status TINYINT(1) COMMENT '付款状态:0未付款 1已付款' ;

+ 12 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/door/WlyyDoorFeeDetailDO.java

@ -112,6 +112,11 @@ public class WlyyDoorFeeDetailDO extends UuidIdentityEntityWithOperator {
	 */
	private Integer status;
    /**
     * 付款状态:0未付款 1已付款
     */
    private Integer payStatus;
	@Column(name = "order_id")
    public String getOrderId() {
@ -177,6 +182,12 @@ public class WlyyDoorFeeDetailDO extends UuidIdentityEntityWithOperator {
        this.status = status;
    }
    @Column(name = "pay_status")
    public Integer getPayStatus() {
        return payStatus;
    }
    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }
}

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

@ -30,6 +30,7 @@ import com.yihu.jw.security.utils.DateUtil;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.jw.security.utils.SerializeUtil;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.sms.service.ZBSmsService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import com.yihu.utils.network.HttpResponse;
@ -130,6 +131,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @Autowired
    private ZhongShanSMSService zhongShanSMSService;
    @Autowired
    private ZBSmsService zbSmsService;
    @Autowired
    private OauthCaConfigSerivce oauthCaConfigSerivce;
    @Autowired
    private OauthWjwConfigService oauthWjwConfigService;
@ -606,15 +609,84 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        throw new IllegalStateException("验证码发送失败!");
    }
    /**
     * 福州健康之路短信接口
     * @param parameters
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/oauth/sendZBCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendZBCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
        String client_id = parameters.get("client_id");
        String username = parameters.get("username");
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id");
        }
        if (StringUtils.isEmpty(username)) {
            throw new InvalidRequestException("username");
        }
        if (username.length()>12){
            throw new InvalidRequestException("请输入正确的手机号!");
        }
        //验证请求间隔超时,防止频繁获取验证码
        if (!wlyyRedisVerifyCodeService.isIntervalTimeout(client_id, username)) {
            throw new IllegalAccessException("SMS request frequency is too fast");
        }
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedSMS");
        if (wlyyHospitalSysDictDO!=null&&!StringUtils.isEmpty(wlyyHospitalSysDictDO.getDictValue())){
            String captcha = wlyyHospitalSysDictDO.getDictValue();
            Captcha _captcha = new Captcha();
            _captcha.setCode(captcha);
            _captcha.setExpiresIn(300);
            wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
            Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("success", 200);
            HttpHeaders headers = new HttpHeaders();
            headers.set("Cache-Control", "no-store");
            headers.set("Pragma", "no-cache");
            return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
        }else {
            //发送短信获取验证码
            String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
            int result =  zbSmsService.sendMessage(username,"您好,你的手机登录短信验证码是:"+captcha+",5分钟内有效。");
            if (0 == result) {
                Captcha _captcha = new Captcha();
                _captcha.setCode(captcha);
                _captcha.setExpiresIn(300);
                wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
                Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200, null);
                HttpHeaders headers = new HttpHeaders();
                headers.set("Cache-Control", "no-store");
                headers.set("Pragma", "no-cache");
                return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
            }
        }
        throw new IllegalStateException("验证码发送失败!");
    }
    @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)){
           return sendZSCaptcha(parameters);
        }else if ("xm_xzzx_wx".equals(wxId)){
            return sendXZCaptcha(parameters);
        }else if ("sd_tnzyy_wx".equals(wxId)){
            return sendZBCaptcha(parameters);
        }
        throw new IllegalStateException("验证码发送失败");
    }

+ 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) {

+ 66 - 6
svr/svr-door-serivce/pom.xml

@ -161,19 +161,79 @@
    <build>
        <finalName>svr-door-service</finalName>
        <plugins>
            <!-- 分离lib -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <!-- 依赖包输出目录,将来不打进jar包里 -->
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <excludeTransitive>false</excludeTransitive>
                            <stripVersion>false</stripVersion>
                            <includeScope>runtime</includeScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- copy资源文件 -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                </resource>
                            </resources>
                            <outputDirectory>${project.build.directory}/resources</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- 打jar包时忽略配置文件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <mainClass>com.yihu.SvrDoorServiceApplication</mainClass>
                    <excludes>
                        <exclude>**/*.yml</exclude>
                        <exclude>**/*.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <!-- spring boot repackage -->
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
                    <layout>ZIP</layout>
                    <includes>
                        <include>
                            <groupId>non-exists</groupId>
                            <artifactId>non-exists</artifactId>
                        </include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

+ 0 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java

@ -546,7 +546,6 @@ public class DoorOrderController extends BaseController {
    @RequestMapping(value = "selectServiceTypes", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "获取服务项目类型-上门服务")
    public String selectServiceTypes(){
        try {

+ 15 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/patient/PatientController.java

@ -2,6 +2,7 @@ package com.yihu.jw.door.controller.patient;
import com.yihu.jw.door.controller.BaseController;
import com.yihu.jw.door.dao.common.SignFamilyDao;
import com.yihu.jw.door.service.common.ServerPackageService;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.door.SignFamily;
@ -19,6 +20,7 @@ import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
@ -43,6 +45,19 @@ public class PatientController extends BaseController {
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private ServerPackageService serverPackageService;
    @RequestMapping(value = "serviceOrder/selectServiceTypes", method = RequestMethod.POST)
    @ApiOperation(value = "获取服务项目类型-上门服务")
    public String selectServiceTypes(){
        try {
            return write(200, "查询成功", "data",serverPackageService.selectPatientTypes());
        } catch (Exception ex) {
            error(ex);
            return error(-1, "查询失败");
        }
    }
    @GetMapping(value = "getProfessionalDict")
    @ApiOperation("职业状态字典")

+ 23 - 2
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/patient/WlyyDoorServiceOrderController.java

@ -283,7 +283,6 @@ public class WlyyDoorServiceOrderController extends EnvelopRestEndpoint {
    }
    @GetMapping(value = "getPrescriptionByCode")
    @ResponseBody
    @ApiOperation("获取长处方详情")
    public Envelop getPrescriptionByCode(@ApiParam(name = "recipeNo", value = "挂号号",required = true)
                                         @RequestParam String recipeNo) {
@ -296,7 +295,6 @@ public class WlyyDoorServiceOrderController extends EnvelopRestEndpoint {
    }
    @GetMapping(value = "getProxyPatientList")
    @ResponseBody
    @ApiOperation("获取代预约服务对象列表")
    public Envelop getProxyPatientList() {
        try {
@ -307,5 +305,28 @@ public class WlyyDoorServiceOrderController extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "getServiceItemFees")
    @ApiOperation("获取未付款的服务项")
    public Envelop getServiceItemFees(@ApiParam(name = "orderId", value = "订单id",required = true)
                                         @RequestParam String orderId) {
        try {
            JSONObject json = wlyyDoorServiceOrderService.getServiceItemFees(orderId);
            return success(json);
        } catch (Exception e) {
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = "payServiceItemFees")
    @ApiOperation("付服务项费用")
    public Envelop payServiceItemFees(@ApiParam(name = "ids", value = "订单id",required = true)
                                      @RequestParam String[] ids) {
        try {
            wlyyDoorServiceOrderService.payServiceItemFees(ids);
            return success();
        } catch (Exception e) {
            return failed(e.getMessage());
        }
    }
}

+ 8 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/dao/WlyyDoorFeeDetailDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.door.dao;
import com.yihu.jw.entity.door.WlyyDoorFeeDetailDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
@ -29,6 +30,13 @@ public interface WlyyDoorFeeDetailDao extends PagingAndSortingRepository<WlyyDoo
    @Query("select d from WlyyDoorFeeDetailDO d where d.orderId = ?1 and d.type=?2 and d.status <> 3")
    List<WlyyDoorFeeDetailDO> findByOrderIdAndType(String orderId, Integer type);
    @Query("select d from WlyyDoorFeeDetailDO d where d.orderId = ?1 and d.payStatus=?2 and d.status <> 3")
    List<WlyyDoorFeeDetailDO> findByOrderIdAndPayStatus(String orderId, Integer payStatus);
    @Query("select d.id as id,d.fee as fee,d.orderId as orderId from WlyyDoorFeeDetailDO d where d.code in(:codes) and d.type = :type")
    List<Map<String,Object>> findIdByCodeAndType(@Param("codes") List<String> codes, @Param("type") Integer type);
    @Modifying
    @Query("update WlyyDoorFeeDetailDO  set payStatus = 1 where id in (?1) ")
    int updatePayStatusById(String[] ids);
}

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

@ -552,7 +552,9 @@ public class DoorOrderService {
        JSONArray docArr = new JSONArray();
        docArr.add(doc);
        jsonObjectParam.put("doctorArr",docArr);
        if (wlyyDoorServiceOrderService.orderWithDoctorAdd(new JSONObject(), jsonObjectParam, doorServiceOrder)) return null;
        if (wlyyDoorServiceOrderService.orderWithDoctorAdd(new JSONObject(), jsonObjectParam, doorServiceOrder)){
            return null;
        }
        doorServiceOrderDao.save(doorServiceOrder);

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

@ -250,7 +250,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                    orderItemDO.setDoctor(order.getDoctor());
                    orderItemDO.setCode(feeDetailDO.getCode());
                    orderItemDO.setCreateTime(new Date());
                    orderItemDO.setPatient(orderItemDO.getPatient());
                    orderItemDO.setPatient(order.getPatient());
                    orderItemDOList.add(orderItemDO);
                } catch (Exception e) {
                    result.put(ResponseContant.resultFlag, ResponseContant.fail);
@ -277,6 +277,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                }else{
                    feeDetailDO.setStatus(status);
                }
                feeDetailDO.setPayStatus(0);
//                feeDetailDO.setNumber(1);
                feeDetailDO.setOrderId(order.getId());
                if(StringUtils.isBlank(feeDetailDO.getId())) {
@ -2929,4 +2930,25 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        result.put(ResponseContant.resultMsg, wlyyDoorServiceOrder);
        return result;
    }
    /**
     * 获取未付款的服务项
     * @param orderId
     * @return
     */
    public JSONObject getServiceItemFees(String orderId){
        JSONObject json = new JSONObject();
        List<WlyyDoorFeeDetailDO> feeDetailDOs = wlyyDoorFeeDetailDao.findByOrderIdAndPayStatus(orderId, 0);
        BigDecimal sum = feeDetailDOs.stream().map(WlyyDoorFeeDetailDO::getFee).reduce(BigDecimal::add).get();
        sum = sum.setScale(1, BigDecimal.ROUND_DOWN);
        json.put("orderId",orderId);
        json.put("sum",sum);
        json.put("feeDetailDOs",feeDetailDOs);
        return json;
    }
    @Transactional
    public void payServiceItemFees(String[] ids){
        wlyyDoorFeeDetailDao.updatePayStatusById(ids);
    }
}

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

@ -137,7 +137,20 @@ public class ServerPackageService  {
        return mapList;
    }
    /**
     * 居民端服务项类型
     * @return
     */
    public List<Map<String,Object>> selectPatientTypes(){
        String sql = "SELECT code,value type from base_system_dict_entry WHERE dict_code = 'door_service_subject_class_dict' and code = 'door'";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        return mapList;
    }
    /**
     * 医生端服务项类型
     * @return
     */
    public List<Map<String,Object>> selectTypes(){
        String sql = "SELECT code,value type from base_system_dict_entry WHERE dict_code = 'door_service_subject_class_dict' ORDER BY sort";
        List<Map<String,Object>> mapList1 = jdbcTemplate.queryForList(sql);

+ 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;
    }
}