|
@ -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;
|
|
@ -133,6 +131,7 @@ import java.text.DecimalFormat;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static javafx.scene.input.KeyCode.L;
|
|
|
|
|
@ -291,7 +290,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
private YkyySMSService ykyySMSService;
|
|
|
@Autowired
|
|
|
private TnyyEntranceService tnyyEntranceService;
|
|
|
|
|
|
@Autowired
|
|
|
private BaseJpushTemplateDao baseJpushTemplateDao;
|
|
|
|
|
|
|
|
|
@Value("${demo.flag}")
|
|
@ -2607,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);
|
|
@ -3727,7 +3727,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("winNo", org.getWinNo());
|
|
|
rs.put("deptName", hospitalDOs.get(0).getDeptName());
|
|
|
rs.put("dept", hospitalDOs.get(0).getDeptCode());
|
|
|
|
|
|
if (StringUtils.isNotBlank(withWork) && "1".equals(withWork)) {
|
|
|
List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(doctor, hospitalDOs.get(0).getOrgCode(),"");
|
|
|
rs.put("workTime", times);
|
|
@ -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+"。";
|
|
@ -4861,7 +4872,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"room.consult_type AS \"consult_type\"," +
|
|
|
"outpatient.consumer as \"consumer\", " +
|
|
|
"outpatient.consumer_name as \"consumerName\"," +
|
|
|
"outpatient.consumer_mobile as \"consumerMobile\", ";
|
|
|
"outpatient.consumer_mobile as \"consumerMobile\", "+
|
|
|
"outpatient.create_time as \"create_date\", ";
|
|
|
if ("xm_ykyy_wx".equals(wechatId)) {
|
|
|
if(flag){
|
|
|
sql += "date_format(room.reservation_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"timedate_format\",";
|
|
@ -5688,6 +5700,36 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
//mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
|
|
|
count = hibenateUtils.objTransformLong(listCount.get(0).get("total"));
|
|
|
}
|
|
|
List<WlyyHospitalSysDictDO> doctorFrontList = wlyyHospitalSysDictDao.findByDictNameOrderBySort("doctorFrontList");
|
|
|
if (doctorFrontList!=null&&doctorFrontList.size()>0){
|
|
|
List<Map<String,Object>> frontDoctor = new ArrayList<>();
|
|
|
if (list!=null&&list.size()>0){
|
|
|
for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:doctorFrontList){
|
|
|
for(Map<String,Object> map: list){
|
|
|
if(map.get("id").toString().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
|
|
|
map.put("doctorFrontSort",wlyyHospitalSysDictDO.getSort());
|
|
|
logger.info("doctorFrontSort",wlyyHospitalSysDictDO.getSort());
|
|
|
logger.info("doctorId",wlyyHospitalSysDictDO.getDictCode());
|
|
|
frontDoctor.add(map);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:doctorFrontList){
|
|
|
for(Map<String,Object> map1: list){
|
|
|
if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase(map1.get("id").toString())){
|
|
|
list.remove(map1);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for(Map<String,Object> map1: list){
|
|
|
frontDoctor.add(map1);
|
|
|
}
|
|
|
list = frontDoctor;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
logger.info("findDoctorByHospitalAndDiseaseAndDept end:" + DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss:SSS"));
|
|
|
logger.info("sql:" + sql);
|
|
|
MixEnvelop envelop =new MixEnvelop();
|
|
@ -5697,7 +5739,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
envelop.setCurrPage(page);
|
|
|
return envelop;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取常见疾病、热门部门、医生拒绝接诊原因 字典
|
|
|
*
|
|
@ -8780,6 +8821,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
content.deleteCharAt(content.length()-1);
|
|
|
icd10Code.deleteCharAt(icd10Code.length()-1);
|
|
|
}
|
|
|
wlyyOutpatientDO.setStatus("2");
|
|
|
wlyyOutpatientDO.setIcd10Name(content.toString());
|
|
|
wlyyOutpatientDO.setIcd10(icd10Code.toString());
|
|
|
outpatientDao.save(wlyyOutpatientDO);
|
|
@ -11426,14 +11468,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
|
|
|
jsonObject.put("platform","all");
|
|
|
com.alibaba.fastjson.JSONObject audience = new com.alibaba.fastjson.JSONObject();
|
|
|
audience.put("alias",userId);
|
|
|
com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray();
|
|
|
jsonArray.add(userId);
|
|
|
audience.put("alias",jsonArray);
|
|
|
jsonObject.put("audience",audience);
|
|
|
com.alibaba.fastjson.JSONObject notification = new com.alibaba.fastjson.JSONObject();
|
|
|
com.alibaba.fastjson.JSONObject android = new com.alibaba.fastjson.JSONObject();
|
|
|
android.put("alert",alert);
|
|
|
android.put("title",title);
|
|
|
android.put("extras",extras);
|
|
|
android.put("builder_id","1");
|
|
|
android.put("builder_id",1);
|
|
|
com.alibaba.fastjson.JSONObject ios = new com.alibaba.fastjson.JSONObject();
|
|
|
ios.put("alert",alert);
|
|
|
ios.put("sound","default");
|
|
@ -11442,10 +11486,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
notification.put("android",android);
|
|
|
notification.put("ios",ios);
|
|
|
jsonObject.put("notification",notification);
|
|
|
System.out.println(notification.toString());
|
|
|
String url = "https://api.jpush.cn/v3/push";
|
|
|
Map<String, Object> headerMap = new HashedMap();
|
|
|
headerMap.put("Authorization",auth);
|
|
|
headerMap.put("Content-Type","application/json");
|
|
|
/*headerMap.put("Content-Length",1024);
|
|
|
headerMap.put("Host","127.0.0.1");*/
|
|
|
logger.info("极光推送参数"+jsonObject);
|
|
|
String response = httpClientUtil.postBodyHead(url,jsonObject,headerMap);
|
|
|
logger.info("极光推送返回日志==="+response);
|
|
|
WlyyHttpLogDO httpLogDO = new WlyyHttpLogDO();
|
|
@ -11457,4 +11505,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",18);
|
|
|
}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",17);
|
|
|
}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",15);
|
|
|
}
|
|
|
}
|
|
|
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);
|
|
|
}
|
|
|
}
|