Browse Source

眼科bug修改

wangjun 4 years ago
parent
commit
ad7154fbef

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseJpushTemplateDao.java

@ -0,0 +1,12 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.hospital.dict.BaseDeptDict;
import com.yihu.jw.entity.hospital.dict.BaseJpushTemplateDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseJpushTemplateDao extends PagingAndSortingRepository<BaseJpushTemplateDO, String>, JpaSpecificationExecutor<BaseJpushTemplateDO> {
    @Query("from BaseJpushTemplateDO  where code = ?1 and isDel ='1'")
    BaseJpushTemplateDO findByCode(String code);
}

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

@ -2,10 +2,7 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.BaseDictJobTitleDao;
import com.yihu.jw.dict.dao.BaseJobCategoryDao;
import com.yihu.jw.dict.dao.DictDeptDescDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.dict.dao.*;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
@ -27,6 +24,7 @@ import com.yihu.jw.entity.base.yx.YxTokenMappingDO;
import com.yihu.jw.entity.hospital.consult.WlyyDoctorClinicRoomDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.dict.BaseJpushTemplateDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.doctor.WlyyDoctorOnlineTimeDO;
import com.yihu.jw.entity.hospital.doctor.WlyyDoctorWorkTimeDO;
@ -292,7 +290,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private YkyySMSService ykyySMSService;
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    @Autowired
    private BaseJpushTemplateDao baseJpushTemplateDao;
    @Value("${demo.flag}")
@ -2608,7 +2607,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            prescription.setRegFee(outpatientDO.getFee());
            prescription.setPrescribeTime(new Date());
            //保存费用
            prescriptionDao.save(prescription);
            prescription = prescriptionDao.save(prescription);
            if (wechatId.equalsIgnoreCase("xm_ykyy_wx")) {
                outpatientDO.setStatus("2");
                outpatientDao.save(outpatientDO);
@ -4398,6 +4397,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 医生拒诊开始");
                logger.info("极光消息推送 医生拒诊开始");
                wxTempalteJPush("cancel_remind",outpatientDO,null,"","","","");
                /*String res = wxTempalteJPush(outpatientDO.getConsumer(),newConfig.getFirst(),"医生拒绝了你的问诊",type,outpatientDO.getId());
                logger.info("JPUSH res==="+res);*/
            }else if("outPatientTimeOutRemind".equals(titelType)){
                //就诊等待过长提示
                scene="jzddgcts";
@ -4431,6 +4434,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 就诊支付提醒开始");
                logger.info("极光消息推送 就诊支付提醒开始");
                wxTempalteJPush("outpatient_pay",outpatientDO,null,"","","","");
            } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
                //处方开具支付提醒
                scene = "cfzfts";
@ -4443,6 +4448,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 处方支付提醒开始");
                logger.info("极光消息推送 医生拒诊开始");
                wxTempalteJPush("prescription_pay",outpatientDO,null,"","","","");
            }else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
                //视频问诊预约提醒
                scene = "spwzyytx";
@ -4472,6 +4479,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                newConfig.setKeyword3(consDoctorDO.getName());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                logger.info("极光消息推送 医生拒诊开始");
                wxTempalteJPush("give_score",outpatientDO,consultTeam,"","","","");
                logger.info("眼科微信消息模板推送 服务评价提醒开始");
            } else if ("systemCancelRemind".equalsIgnoreCase(titelType)) {
                //系统24小时取消复诊提醒
@ -4667,6 +4676,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                wxPushLogDO.setScene(scene);
                wxPushLogDao.save(wxPushLogDO);
            }
            //发送极光消息推送
            wxTempalteJPush("logistics_remind",wlyyOutpatientDO,null,drugName,mailNo,remindMsg,prescriptionId);
        }else {
            first = "您好,您的处方订单物流"+remindMsg;
            contentMsg = "患者"+patienName+"的处方药品订单,"+drugName+"等,当前"+remindMsg+"。物流方:「顺丰快递」,物流单号:"+mailNo+"。";
@ -11482,4 +11493,169 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return response;
    }
    public String wxTempalteJPush(String templateCode,WlyyOutpatientDO wlyyOutpatientDO ,ConsultTeamDo consultTeamDo,String drugName ,String mailNo,String mailStatus,String prescriptionId){
        String userId = "";
        String content = "";
        String title="";
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        if("give_score".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                if(1==consultTeamDo.getType()){
                    content.replace("{{咨询类型}}","图文咨询");
                }else if(9==consultTeamDo.getType()){
                    content.replace("{{咨询类型}}","图文复诊");
                }
                else if(16==consultTeamDo.getType()){
                    content.replace("{{咨询类型}}","视频复诊");
                }
                else if(17==consultTeamDo.getType()){
                    content.replace("{{咨询类型}}","视频咨询");
                }
                title=baseJpushTemplateDO.getPushHeader();
            }
            userId = wlyyOutpatientDO.getConsumer();
            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());
                title=baseJpushTemplateDO.getPushHeader();
            }
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",30);
            jsonObject.put("id",wlyyOutpatientDO.getId());
        }else if("consult_remind".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content.replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                title=baseJpushTemplateDO.getPushHeader().replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
            }
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",31);
            jsonObject.put("id",wlyyOutpatientDO.getId());
        } else if("prescription_pay".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content.replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
                title=baseJpushTemplateDO.getPushHeader();
            }
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",6);
            jsonObject.put("id",wlyyOutpatientDO.getId());
        } else if("outpatient_pay".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","图文复诊");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","图文复诊");
                }else if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","视频复诊");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","视频复诊");
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","图文咨询");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","图文咨询");
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","视频咨询");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","视频咨询");
                }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","协同复诊");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","协同复诊");
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","家医咨询");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","家医咨询");
                }
            }
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",11);
            jsonObject.put("id",wlyyOutpatientDO.getId());
        } else if("cancel_remind".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","图文复诊");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","图文复诊");
                }else if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","视频复诊");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","视频复诊");
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","图文咨询");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","图文咨询");
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","视频咨询");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","视频咨询");
                }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","协同复诊");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","协同复诊");
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","家医咨询");
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","家医咨询");
                }
            }
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",12);
            jsonObject.put("id",wlyyOutpatientDO.getId());
        }else if("outpatient_remind".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","图文复诊").replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","图文复诊");
                    jsonObject.put("type",1);
                }else if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","视频复诊").replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                    content+= "视频复诊预约时间为:"+wlyyOutpatientDO.getRegisterDate();
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","视频复诊");
                    jsonObject.put("type",2);
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","图文咨询").replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","图文咨询");
                    jsonObject.put("type",41);
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","视频咨询").replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","视频咨询");
                    content+= "视频咨询预约时间为:"+wlyyOutpatientDO.getRegisterDate();
                    jsonObject.put("type",42);
                }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","协同复诊").replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","协同复诊");
                    jsonObject.put("type",3);
                }else if ("3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                    content = baseJpushTemplateDO.getPushContent().replace("{{咨询类型}}","家医咨询").replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                    title=baseJpushTemplateDO.getPushHeader().replace("{{咨询类型}}","家医咨询");
                    jsonObject.put("type",43);
                }
            }
            userId = wlyyOutpatientDO.getDoctor();
            jsonObject.put("id",wlyyOutpatientDO.getId());
        } else if("prescription_refuse".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content.replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName()).replace("{患者姓名}}",wlyyOutpatientDO.getPatientName());
                title=baseJpushTemplateDO.getPushHeader().replace("{{患者姓名}}",wlyyOutpatientDO.getDoctorName());
            }
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",8);
            jsonObject.put("id",prescriptionId);
        } else if("logistics_remind".equalsIgnoreCase(templateCode)){
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content.replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{药品名称}}",drugName)
                .replace("{{物流状态}}",mailStatus).replace("{{运单号}}",mailNo);
                title=baseJpushTemplateDO.getPushHeader();
            }
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",32);
            jsonObject.put("id",prescriptionId);
        }
        return jPushMessage(userId,content,title,jsonObject);
    }
}

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

@ -2941,7 +2941,7 @@ public class YkyyEntranceService {
    //查询诊疗项目视图
    public JSONArray findZlxm(String itemName,String itemCode,String deptCode) throws Exception{
        String sql = "select t.item_code as \"code\",t.item_name as \"name\"," +
                "t.price as \"charge_amount\",t.total_unit as \"totalUnit\"," +
                "t.price as \"chargeAmount\",t.total_unit as \"totalUnit\"," +
                "t.zxks as \"dept\" ,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";

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

@ -138,7 +138,6 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    private WlyyInspectionDao inspectionDao;
    /**
     *
     * 处方下单
@ -177,7 +176,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                businessOrderDO.setDoctor(wlyyPrescriptionDO.getDoctor());
                businessOrderDO.setPatient(outpatientDO.getConsumer());
                businessOrderDO.setPatientName(outpatientDO.getConsumerName());
                BigDecimal b = new BigDecimal(String.valueOf(wlyyPrescriptionDO.getDrugFee()));
                BigDecimal b = new BigDecimal(String.valueOf(wlyyPrescriptionDO.getDrugFee()==null?0:wlyyPrescriptionDO.getDrugFee()));
                BigDecimal c = new BigDecimal(String.valueOf(100));
                BigDecimal bc = b.multiply(c);
                BigDecimal dc = new BigDecimal(0);
@ -880,12 +879,14 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
                        wlyyOutpatientDO.setPayStatus(1);
                        outpatientDao.save(wlyyOutpatientDO);
                        prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                    }
                }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
                    WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
                    wlyyOutpatientDO.setPayStatus(1);
                    outpatientDao.save(wlyyOutpatientDO);
                    prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                    if (StringUtils.isNoneBlank(wlyyOutpatientDO.getDoctor())){
                        BaseDoctorDO baseDoctorDO= doctorDao.findById(wlyyOutpatientDO.getDoctor());
                        if (baseDoctorDO!=null){

+ 7 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxTemplateService.java

@ -15,6 +15,7 @@ import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.oauth.OauthSsoService;
@ -108,6 +109,8 @@ public class WxTemplateService {
    private OutpatientDao outpatientDao;
    @Autowired
    private YxTokenMappingDao yxTokenMappingDao;
    @Autowired
    private PrescriptionService prescriptionService;
    
@ -614,6 +617,10 @@ public class WxTemplateService {
                        weixinMessagePushUtils.putWxMsg(wxAccessTokenService.getWxAccessTokenById(wechatId).getAccessToken(),basePatientWechatDo.getOpenid(),config);
                }
            }
            WlyyOutpatientDO wlyyOutpatientDO = new WlyyOutpatientDO();
            wlyyOutpatientDO.setConsumer(basePatientDO.getId());
            wlyyOutpatientDO.setDoctorName(senderName);
            prescriptionService.wxTempalteJPush("consult_remind",wlyyOutpatientDO,null,"","","","");
        }else{
            throw new Exception("接收者ID错误,无法找到该账号");
        }

+ 58 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/BaseJpushTemplateDO.java

@ -0,0 +1,58 @@
package com.yihu.jw.entity.hospital.dict;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "base_supervise_data_dict")
public class BaseJpushTemplateDO extends UuidIdentityEntityWithOperator {
    private String code;
    private String name;
    private String pushHeader;
    private String pushContent;
    private String isDel;
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "push_header")
    public String getPushHeader() {
        return pushHeader;
    }
    public void setPushHeader(String pushHeader) {
        this.pushHeader = pushHeader;
    }
    @Column(name = "push_content")
    public String getPushContent() {
        return pushContent;
    }
    public void setPushContent(String pushContent) {
        this.pushContent = pushContent;
    }
    @Column(name = "is_del")
    public String getIsDel() {
        return isDel;
    }
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
}

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -38,6 +38,7 @@ public class BaseHospitalRequestMapping {
        public static final String PREFIX  = "/prescription";
        public static final String findDoctorByIdCard = "/findDoctorByIdCard";
        public static final String testJpush = "/testJpush";
        public static final String updateChannelId = "/updateChannelId";
        //=====================start=======================================

+ 5 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -21,6 +21,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.im.service.ImService;
@ -123,6 +124,8 @@ public class UnSettledHISPrescriptionService {
    private BaseSmsTemplateDao smsTemplateDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    @Autowired
    private PrescriptionService prescriptionService;
    
    
    /**
@ -212,6 +215,8 @@ public class UnSettledHISPrescriptionService {
                        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findByRealOrder(cfsb);
                        BaseDoctorDO baseDoctorDO = doctorDao.findById(doctor);
                        ykyySMSService.sendSmsByTempcode("check_failed",wlyyOutpatientDO,prescriptionDO,baseDoctorDO.getMobile());
                        logger.info("极光推送处方驳回消息");
                       prescriptionService.wxTempalteJPush("prescription_refuse",wlyyOutpatientDO,null,"","","",prescriptionDO.getId());
                    }
                }

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

@ -11,6 +11,7 @@ import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
@ -39,6 +40,7 @@ import com.yihu.jw.hospital.service.consult.KnowledgeCategoryService;
import com.yihu.jw.hospital.service.consult.QrcodeService;
import com.yihu.jw.hospital.service.consult.SysDictService;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
@ -203,6 +205,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private FileUtil fileUtil;
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    @Autowired
    private ConsultTeamDao consultTeamDao;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
@ -1674,4 +1678,23 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        }
        return success(object);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.testJpush)
    @ApiOperation(value = "根据身份证号查询医生", notes = "")
    public Envelop testJPush(@ApiParam(name = "outpatientId", value = "")
                                      @RequestParam(value = "outpatientId", required = false)String outpatientId,
                             @ApiParam(name = "templateCode", value = "")
                             @RequestParam(value = "templateCode", required = false)String templateCode,
                             @ApiParam(name = "drugName", value = "")
                                 @RequestParam(value = "drugName", required = false)String drugName,
                             @ApiParam(name = "mailNo", value = "")
                                 @RequestParam(value = "mailNo", required = false)String mailNo,
                             @ApiParam(name = "mailStatus", value = "")
                                 @RequestParam(value = "mailStatus", required = false)String mailStatus,
                             @ApiParam(name = "prescriptionId", value = "")
                                 @RequestParam(value = "prescriptionId", required = false)String prescriptionId) {
       WlyyOutpatientDO wlyyOutpatientDO =  outpatientDao.findById(outpatientId);
        ConsultTeamDo consultTeamDo = consultTeamDao.queryByRelationCode(outpatientId);
        return success(prescriptionService.wxTempalteJPush(templateCode,wlyyOutpatientDO,consultTeamDo,drugName,mailNo,mailStatus,prescriptionId));
    }
}