Explorar el Código

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

wangzhinan hace 4 años
padre
commit
24073e4609

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -86,5 +86,8 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("update WlyyOutpatientDO p set p.channelId=?2 where p.id=?1")
    void updateChannelId(String id,String channelId);
    @Query("from WlyyOutpatientDO a where a.consumer = ?1 and a.status=1 and a.payStatus =1 order by a.createTime desc")
    List<WlyyOutpatientDO> findWlyyOutpatientDO(String patient);
}

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

@ -4523,7 +4523,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                logger.info("极光消息推送 医生拒诊开始");
                wxTempalteJPush("give_score",outpatientDO,consultTeam,"","","","");
                wxTempalteJPush("give_score",null,consultTeam,"","","","");
                logger.info("眼科微信消息模板推送 服务评价提醒开始");
            } else if ("systemCancelRemind".equalsIgnoreCase(titelType)) {
                //系统24小时取消复诊提醒
@ -4966,6 +4966,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else if (2==type) {//视频复诊
            //在线复诊
            sql += " AND room.reservation_type !=3 AND room.consult_type =2";
        } else if(0==type) {
            sql += " AND room.consult_type =1";
        } else {
            sql += " AND room.reservation_type !=2";
        }
@ -11600,26 +11602,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                if(1==consultTeamDo.getType()){
                    content.replace("{{咨询类型}}","图文咨询");
                    content= content.replace("{{咨询类型}}","图文咨询");
                }else if(9==consultTeamDo.getType()){
                    content.replace("{{咨询类型}}","图文复诊");
                    content= content.replace("{{咨询类型}}","图文复诊");
                }
                else if(16==consultTeamDo.getType()){
                    content.replace("{{咨询类型}}","视频复诊");
                    content=  content.replace("{{咨询类型}}","视频复诊");
                }
                else if(17==consultTeamDo.getType()){
                    content.replace("{{咨询类型}}","视频咨询");
                    content=  content.replace("{{咨询类型}}","视频咨询");
                }
                title=baseJpushTemplateDO.getPushHeader();
            }
            userId = wlyyOutpatientDO.getConsumer();
            userId = consultTeamDo.getPatient();
            jsonObject.put("type",10);
            jsonObject.put("id",consultTeamDo.getConsult());
        }else if("video_invite".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content.replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                content = baseJpushTemplateDO.getPushContent().replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());;
                title=baseJpushTemplateDO.getPushHeader();
            }
            userId = wlyyOutpatientDO.getConsumer();
@ -11629,18 +11631,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content.replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                content= content.replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                title=baseJpushTemplateDO.getPushHeader().replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
            }
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",31);
            jsonObject.put("id",wlyyOutpatientDO.getId());
            isDoctor="1";
        } else if("prescription_pay".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content.replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
                content= content.replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
                title=baseJpushTemplateDO.getPushHeader();
            }
            userId = wlyyOutpatientDO.getConsumer();
@ -11702,7 +11703,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","家医咨询");
                }
            }
            isDoctor="1";
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",12);
            jsonObject.put("id",wlyyOutpatientDO.getId());
@ -11750,10 +11750,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content.replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName()).replace("{患者姓名}}",wlyyOutpatientDO.getPatientName());
                content=  content.replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName()).replace("{患者姓名}}",wlyyOutpatientDO.getPatientName());
                title=baseJpushTemplateDO.getPushHeader().replace("{{患者姓名}}",wlyyOutpatientDO.getDoctorName());
            }
            userId = wlyyOutpatientDO.getConsumer();
            userId = wlyyOutpatientDO.getDoctor();
            jsonObject.put("type",8);
            jsonObject.put("id",prescriptionId);
            isDoctor="1";
@ -11761,7 +11761,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content.replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{药品名称}}",drugName)
                content=  content.replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{药品名称}}",drugName)
                .replace("{{物流状态}}",mailStatus).replace("{{运单号}}",mailNo);
                title=baseJpushTemplateDO.getPushHeader();
            }

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

@ -864,6 +864,9 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(code);
        if (businessOrderDO!=null){
            if (businessOrderDO.getStatus()==1){
                throw new Exception("该处方已支付过");
            }
            List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
            String openId = "";
            if (StringUtils.isNotBlank(appletCode)){

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

@ -2962,14 +2962,14 @@ public class YkyyEntranceService {
                "t.zxks as \"dept\" ,t.yqdm as \"yqdm\" ,m.name as \"exec_unit_name\" from VEMR_ORDER_ITEM t " +
                " left join V_HLW_KSXX m on m.code = t.zxks " +
                " where 1=1";
        if (StringUtils.isNotEmpty(itemName)){
        /*if (StringUtils.isNotEmpty(itemName)){
            sql+=" and t.ITEM_NAME like '%"+itemName+"%'";
        }
        }*/
        if (StringUtils.isNotEmpty(yqdm)){
            sql+=" and t.yqdm = '"+yqdm+"'";
        }
        if (StringUtils.isNoneBlank(pyCode)){
            sql+=" and lower(t.kb_code) like '%"+pyCode.toLowerCase()+"%'";
        if (StringUtils.isNoneBlank(itemName)){
            sql+=" and lower(t.kb_code) like '%"+itemName.toLowerCase()+"%'";
        }
        if (StringUtils.isNotEmpty(itemCode)){
            String[] split = itemCode.split(",|,");

+ 9 - 4
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxTemplateService.java

@ -617,11 +617,16 @@ public class WxTemplateService {
                        config.setUrl(url);
                        weixinMessagePushUtils.putWxMsg(wxAccessTokenService.getWxAccessTokenById(wechatId).getAccessToken(),basePatientWechatDo.getOpenid(),config);
                }
                List<WlyyOutpatientDO> list = outpatientDao.findWlyyOutpatientDO(basePatientDO.getId());
                if (list!=null&&list.size()>0){
                    WlyyOutpatientDO wlyyOutpatientDO = list.get(0);
                    wlyyOutpatientDO.setConsumer(basePatientDO.getId());
                    wlyyOutpatientDO.setDoctorName(senderName);
                    prescriptionService.wxTempalteJPush("consult_remind",wlyyOutpatientDO,null,"","","","");
                }
            }
            WlyyOutpatientDO wlyyOutpatientDO = new WlyyOutpatientDO();
            wlyyOutpatientDO.setConsumer(basePatientDO.getId());
            wlyyOutpatientDO.setDoctorName(senderName);
            prescriptionService.wxTempalteJPush("consult_remind",wlyyOutpatientDO,null,"","","","");
        }else{
            throw new Exception("接收者ID错误,无法找到该账号");
        }