|
@ -13,6 +13,8 @@ import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
|
|
|
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.org.BaseDoctorPatientFollowDO;
|
|
|
import com.yihu.jw.entity.base.org.BaseOrgDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
@ -243,11 +245,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
@Autowired
|
|
|
private DictDeptDescDao dictDeptDescDao;
|
|
|
|
|
|
|
|
|
@Value("${demo.flag}")
|
|
|
private boolean demoFlag;
|
|
|
@Value("${wechat.id}")
|
|
|
private String wechatId;
|
|
|
@Value("${wechat.flag}")
|
|
|
private boolean flag;
|
|
|
|
|
|
/**
|
|
|
* 获取居民就诊记录接口
|
|
@ -382,6 +385,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
String condition = "";
|
|
|
if ("xm_ykyy_wx".equals(wechatId)) {
|
|
|
if (flag){
|
|
|
condition = "date_format(o.register_date ,'%Y-%m-%d %H:%i:%S' ) AS registerDate,";
|
|
|
}else {
|
|
|
condition = "to_char(o.register_date ,'yyyy-MM-dd hh24:mi:ss' ) AS \"registerDate\",";
|
|
|
}
|
|
|
condition = "to_char(o.register_date ,'yyyy-MM-dd hh24:mi:ss' ) AS \"registerDate\",";
|
|
|
} else {
|
|
|
condition = "date_format(o.register_date ,'%Y-%m-%d %H:%i:%S' ) AS registerDate,";
|
|
@ -414,7 +422,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" o.description AS \"description\", " +
|
|
|
" o.disease_img AS \"diseaseImg\", ";
|
|
|
if ("xm_ykyy_wx".equals(wechatId)) {
|
|
|
sql = sql + "to_char(o.create_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"createTime\",";
|
|
|
if (flag){
|
|
|
sql = sql + "date_format(o.create_time ,'%Y-%m-%d %H:%i:%S' ) AS createTime,";
|
|
|
}else {
|
|
|
sql = sql + "to_char(o.create_time ,'yyyy-MM-dd hh24:mi:ss' ) AS \"createTime\",";
|
|
|
}
|
|
|
} else {
|
|
|
sql = sql + "date_format(o.create_time ,'%Y-%m-%d %H:%i:%S' ) AS createTime,";
|
|
|
}
|
|
@ -2102,7 +2114,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
//先下单
|
|
|
businessOrderService.savePrescriptionOrder(prescription.getId());
|
|
|
//同步his
|
|
|
ykyyEntranceService.findByRealOrder(prescription.getId());
|
|
|
ykyyEntranceService.findByRealOrder(prescription.getId(),demoFlag);
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findById(prescription.getId());
|
|
|
if (prescriptionDOList != null && prescriptionDOList.size() != 0) {
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDOList.get(0);
|
|
@ -2124,7 +2136,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
result1.put("code", 1);
|
|
|
result1.put("mes", "开方提交成功");
|
|
|
return result1;
|
|
|
} else {
|
|
|
} else if (wechatId.equalsIgnoreCase("xm_xzzx_wx")) {
|
|
|
Double price = prescription.getDrugFee();
|
|
|
businessOrderService.recharge(prescription.getId(), "处方收费", "4", "处方收费", prescription.getPatientCode(), prescription.getPatientName(), prescription.getDoctor(), price);
|
|
|
//上传his开方
|
|
|
//sendHisDiagnosis(jsonData, outpatientDO, prescription)
|
|
|
//zsSynHis(prescription.getId());
|
|
|
Map<String, Object> result1 = new HashedMap();
|
|
|
result1.put("code", 1);
|
|
|
result1.put("mes", "开方提交成功");
|
|
|
return result1;
|
|
|
}else {
|
|
|
result.put("code", 1);
|
|
|
result.put("mes", "诊断完成");
|
|
|
return result;
|
|
@ -3135,7 +3157,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"base_evaluate a " +
|
|
|
"LEFT JOIN base_evaluate_score b ON b.id=a.relation_code " +
|
|
|
"LEFT JOIN wlyy_consult_team c ON c.consult=b.relation_code AND c.doctor='" + doctor + "' " +
|
|
|
"WHERE a.relation_code=b.id AND b.doctor='" + doctor + "' ";
|
|
|
"WHERE a.relation_code=b.id AND b.doctor='" + doctor + "' order by b.create_time DESC ";
|
|
|
List<Map<String, Object>> scoreList = jdbcTemplate.queryForList(sqlScoreList);
|
|
|
|
|
|
if (scoreList != null && scoreList.size() > 0) {
|
|
@ -3316,12 +3338,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
|
|
|
data.put("type", "9");
|
|
|
msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个图文复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
|
|
|
sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(), "9", "doctorRefuse", null);
|
|
|
sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuse", "");
|
|
|
}
|
|
|
if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
|
|
|
data.put("type", "16");
|
|
|
msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个视频复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
|
|
|
sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(), "16", "doctorRefuse", null);
|
|
|
sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuse", "");
|
|
|
}
|
|
|
data.put("msg", msg);
|
|
|
messageDO.setData(data.toString());
|
|
@ -3368,72 +3390,101 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @param titelType
|
|
|
* @param remindMsg
|
|
|
*/
|
|
|
public void sendWxTemplateMsg(String wxId, String outpatientId, String type, String titelType, String remindMsg) {
|
|
|
public void sendWxTemplateMsg(String wxId, String outpatientId,ConsultTeamDo consultTeam, String type, String titelType, String remindMsg) {
|
|
|
|
|
|
BaseDoctorDO consDoctorDO = new BaseDoctorDO();
|
|
|
BasePatientDO consPatientDO = new BasePatientDO();
|
|
|
//获取咨询的信息
|
|
|
if (consultTeam!=null){
|
|
|
consDoctorDO = baseDoctorDao.findById(consultTeam.getDoctor());
|
|
|
consPatientDO = basePatientDao.findById(consultTeam.getPatient());
|
|
|
}
|
|
|
|
|
|
WlyyOutpatientDO outpatientDO = new WlyyOutpatientDO();
|
|
|
BaseDoctorDO doctorDO = new BaseDoctorDO();
|
|
|
BasePatientDO patientDO = new BasePatientDO();
|
|
|
if (StringUtils.isNotEmpty(outpatientId)){
|
|
|
outpatientDO = outpatientDao.findById(outpatientId);
|
|
|
doctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
patientDO = basePatientDao.findById(outpatientDO.getPatient());
|
|
|
}
|
|
|
|
|
|
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
|
|
|
String contentMsg = "";
|
|
|
String first = "";
|
|
|
String remark = "";
|
|
|
if ("doctorRefuseRemind".equalsIgnoreCase(titelType)) {
|
|
|
if ("9".equals(type)) {
|
|
|
contentMsg = "通知内容:您的图文复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
|
|
|
contentMsg = "您的图文复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
|
|
|
first = outpatientDO.getPatientName() + ",您好!您的图文复诊已取消";
|
|
|
|
|
|
}
|
|
|
if ("16".equals(type)) {
|
|
|
contentMsg = "通知内容:您的视频复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
|
|
|
contentMsg = "您的视频复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
|
|
|
first = outpatientDO.getPatientName() + ",您好!您的视频复诊已取消";
|
|
|
}
|
|
|
|
|
|
} else if ("payRemind".equalsIgnoreCase(titelType)) {
|
|
|
|
|
|
if ("9".equals(type)) {
|
|
|
contentMsg = "通知内容:您有一个图文复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
contentMsg = "您有一个图文复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = outpatientDO.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。";
|
|
|
|
|
|
} else if ("16".equals(type)) {
|
|
|
contentMsg = "通知内容:您有一个视频复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
contentMsg = "您有一个视频复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = outpatientDO.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。";
|
|
|
} else if ("1".equals(type)) {
|
|
|
contentMsg = "通知内容:您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = outpatientDO.getPatientName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
|
|
|
}
|
|
|
if ("1".equals(type)) {
|
|
|
contentMsg = "您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = consPatientDO.getName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
|
|
|
} else if ("17".equals(type)) {
|
|
|
contentMsg = "通知内容:您有一个视频咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = outpatientDO.getPatientName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
|
|
|
contentMsg = "您有一个视频咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
first = consPatientDO.getName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
|
|
|
}
|
|
|
|
|
|
} else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
|
|
|
first = outpatientDO.getPatientName() + ",您好! 医生已为您开具处方,请及时支付。";
|
|
|
contentMsg = "通知内容:医生已为您开具处方,请及时支付。";
|
|
|
remark = "备注:点击完成支付,如您已支付请忽略本条信息";
|
|
|
contentMsg = "医生已为您开具处方,请及时支付。";
|
|
|
remark = "点击完成支付,如您已支付请忽略本条信息";
|
|
|
} else if ("msgRemind".equalsIgnoreCase(titelType)) {
|
|
|
first = outpatientDO.getPatientName() + ",您好!";
|
|
|
contentMsg = "通知内容:" + remindMsg;
|
|
|
remark = "备注:请您尽快回复";
|
|
|
contentMsg = "" + remindMsg;
|
|
|
remark = "请您尽快回复";
|
|
|
} else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
|
|
|
first = doctorDO.getName() + doctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
|
|
|
if ("16".equals(type)) {
|
|
|
contentMsg = "通知内容:您的视频复诊已开始,错过将重新排队";
|
|
|
remark = "备注:点击消息进入视频诊室接听视频通话,开始视频咨询。";
|
|
|
contentMsg = "您的视频复诊已开始,错过将重新排队";
|
|
|
remark = "点击消息进入视频诊室接听视频通话,开始视频咨询。";
|
|
|
} else if ("17".equals(type)) {
|
|
|
contentMsg = "通知内容:您的视频咨询已开始,错过将重新排队";
|
|
|
remark = "备注:点击消息进入视频诊室接听视频通话,开始视频复诊。";
|
|
|
contentMsg = "您的视频咨询已开始,错过将重新排队";
|
|
|
remark = "点击消息进入视频诊室接听视频通话,开始视频复诊。";
|
|
|
}
|
|
|
|
|
|
} else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
|
|
|
|
|
|
if ("16".equals(type)) {
|
|
|
first = "您的视频复诊已预约成功。";
|
|
|
contentMsg = "通知内容:预计" + outpatientDO.getDoctorName() + "医生将于" + outpatientDO.getRegisterDate() + " 与您进行视频复诊。请留意微信公众号消息。";
|
|
|
contentMsg = "预计" + outpatientDO.getDoctorName() + "医生将于" + DateUtil.dateToStrLong(outpatientDO.getRegisterDate()) + " 与您进行视频复诊。请留意微信公众号消息。";
|
|
|
} else if ("17".equals(type)) {
|
|
|
first = "您的视频咨询已预约成功。";
|
|
|
contentMsg = "通知内容:预计" + outpatientDO.getDoctorName() + "医生将于" + outpatientDO.getRegisterDate() + " 与您进行视频咨询。请留意微信公众号消息。";
|
|
|
contentMsg = "预计" + consDoctorDO.getName() + "医生将于" + DateUtil.dateToStrLong(consultTeam.getCzrq()) + " 与您进行视频咨询。请留意微信公众号消息。";
|
|
|
}
|
|
|
|
|
|
remark = "备注:咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
|
|
|
remark = "咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
|
|
|
} else if ("evaluateRemind".equalsIgnoreCase(titelType)) {
|
|
|
first = outpatientDO.getPatientName() + ",您好!您有1条专家咨询已结束,请及时对咨询医生进行评价。";
|
|
|
contentMsg = "通知内容:请对" + outpatientDO.getDoctorName() + "医生的服务进行评价";
|
|
|
if (consultTeam.getType()!=null&&1==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条图文咨询已结束,请及时对咨询医生进行评价。";
|
|
|
}
|
|
|
if (consultTeam.getType()!=null&&9==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条图文复诊已结束,请及时对咨询医生进行评价。";
|
|
|
}
|
|
|
if (consultTeam.getType()!=null&&16==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条视频复诊已结束,请及时对咨询医生进行评价。";
|
|
|
}
|
|
|
if (consultTeam.getType()!=null&&17==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条视频咨询已结束,请及时对咨询医生进行评价。";
|
|
|
}
|
|
|
contentMsg = "请对" + consDoctorDO.getName() + "医生的服务进行评价";
|
|
|
}
|
|
|
|
|
|
|
|
@ -4496,17 +4547,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (one.getId().equalsIgnoreCase(workTimeDO.getId())) {
|
|
|
continue;
|
|
|
}
|
|
|
try {
|
|
|
//与医院与自己排班比较 是否冲突 第一组最后时间小于等于第二组最前时间 || 第一组最前时间大于等于第二组最后时间
|
|
|
if (one.getEndTime().before(workTimeDO.getStartTime()) || one.getStartTime().after(workTimeDO.getEndTime())) {
|
|
|
|
|
|
} else {
|
|
|
throw new Exception("您选择的时间与“开始时间-结束时间”的医院排班/自己排班冲突,请重新选择!");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return false;
|
|
|
//与医院与自己排班比较 是否冲突 第一组最后时间小于等于第二组最前时间 || 第一组最前时间大于等于第二组最后时间
|
|
|
if (one.getEndTime().before(workTimeDO.getStartTime()) || one.getStartTime().after(workTimeDO.getEndTime())) {
|
|
|
|
|
|
} else {
|
|
|
throw new Exception("您选择的时间与“开始时间-结束时间”的医院排班/自己排班冲突,请重新选择!");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
doctorWorkTimeDao.save(workTimeDO);
|
|
|
|
|
@ -5237,7 +5285,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @param outpatient
|
|
|
* @return
|
|
|
*/
|
|
|
public SystemMessageDO sendOutPatientMes(WlyyOutpatientDO outpatient) {
|
|
|
public SystemMessageDO sendOutPatientMes(WlyyOutpatientDO outpatient,boolean payFlag) {
|
|
|
SystemMessageDO systemMessageDO = new SystemMessageDO();
|
|
|
String msg = "";
|
|
|
JSONObject data = new JSONObject();
|
|
@ -5251,11 +5299,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if ("1".equals(outpatient.getType())) {
|
|
|
systemMessageDO.setTitle("图文复诊");
|
|
|
systemMessageDO.setType("1");
|
|
|
saveInquirySystemMessage(outpatient);
|
|
|
if (payFlag){
|
|
|
saveInquirySystemMessage(outpatient,null);
|
|
|
}
|
|
|
} else {
|
|
|
systemMessageDO.setTitle("视频复诊预约成功");
|
|
|
systemMessageDO.setType("2");
|
|
|
saveInquirySystemMessage(outpatient);
|
|
|
if (payFlag){
|
|
|
saveInquirySystemMessage(outpatient,null);
|
|
|
}
|
|
|
msg = "您的视频复诊已预约成功。\n" +
|
|
|
"预计" + outpatient.getDoctorName() + "医生将于" + outpatient.getRegisterDate() + " 与您进行视频咨询。请留意系统消息或微信公众号消息。咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
|
|
|
systemMessageDO.setReceiver(outpatient.getDoctor());
|
|
@ -5273,10 +5325,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
data.put("msg", msg);
|
|
|
systemMessageDO.setData(data.toString());
|
|
|
systemMessageService.saveMessage(systemMessageDO);
|
|
|
sendWxTemplateMsg(wechatId, outpatient.getId(), "17", "videoOrderRemind", null);
|
|
|
sendWxTemplateMsg(wechatId, outpatient.getId(),null, "17", "videoOrderRemind", "");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
BasePatientDO patient = basePatientDao.findById(outpatient.getPatient());
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
ykyyService.pushNotificationToYktPatient(patient.getYktId(), systemMessageDO.getTitle(), data.get("msg").toString());
|
|
@ -5289,44 +5340,85 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return systemMessageDO;
|
|
|
}
|
|
|
|
|
|
public void saveInquirySystemMessage(WlyyOutpatientDO outpatient) {
|
|
|
public void saveInquirySystemMessage(WlyyOutpatientDO outpatient,ConsultTeamDo consultTeamDo) {
|
|
|
SystemMessageDO systemMessageDO = new SystemMessageDO();
|
|
|
String msg = "";
|
|
|
String type = "";
|
|
|
if ("1".equals(outpatient.getType())) {
|
|
|
type = "9";
|
|
|
msg = outpatient.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
|
|
|
} else {
|
|
|
type = "16";
|
|
|
msg = outpatient.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
|
|
|
}
|
|
|
|
|
|
systemMessageDO.setTitle("支付提醒");
|
|
|
systemMessageDO.setType("11");
|
|
|
systemMessageDO.setSender(outpatient.getDoctor());
|
|
|
systemMessageDO.setSenderName(outpatient.getDoctorName());
|
|
|
systemMessageDO.setRelationCode(outpatient.getId());
|
|
|
systemMessageDO.setReceiver(outpatient.getPatient());
|
|
|
systemMessageDO.setReceiverName(outpatient.getPatientName());
|
|
|
|
|
|
JSONObject data = new JSONObject();
|
|
|
try {
|
|
|
data.put("name", outpatient.getPatientName());
|
|
|
data.put("age", IdCardUtil.getAgeForIdcard(outpatient.getIdcard()));
|
|
|
data.put("gender", IdCardUtil.getSexForIdcard_new(outpatient.getIdcard()));
|
|
|
data.put("question", outpatient.getDescription());
|
|
|
data.put("msg", msg);
|
|
|
data.put("type", type);
|
|
|
systemMessageDO.setData(data.toString());
|
|
|
systemMessageService.saveMessage(systemMessageDO);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
if (outpatient!=null){
|
|
|
if ("1".equals(outpatient.getType())) {
|
|
|
type = "9";
|
|
|
msg = outpatient.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
|
|
|
} else if ("2".equals(outpatient.getType())){
|
|
|
type = "16";
|
|
|
msg = outpatient.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
|
|
|
}
|
|
|
|
|
|
systemMessageDO.setSender(outpatient.getDoctor());
|
|
|
systemMessageDO.setSenderName(outpatient.getDoctorName());
|
|
|
systemMessageDO.setRelationCode(outpatient.getId());
|
|
|
systemMessageDO.setReceiver(outpatient.getPatient());
|
|
|
systemMessageDO.setReceiverName(outpatient.getPatientName());
|
|
|
|
|
|
data = new JSONObject();
|
|
|
try {
|
|
|
data.put("name", outpatient.getPatientName());
|
|
|
data.put("age", IdCardUtil.getAgeForIdcard(outpatient.getIdcard()));
|
|
|
data.put("gender", IdCardUtil.getSexForIdcard_new(outpatient.getIdcard()));
|
|
|
data.put("question", outpatient.getDescription());
|
|
|
data.put("msg", msg);
|
|
|
data.put("type", type);
|
|
|
systemMessageDO.setData(data.toString());
|
|
|
systemMessageService.saveMessage(systemMessageDO);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
sendWxTemplateMsg(wechatId, outpatient.getId(),null, type, "payRemind", "");
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
BasePatientDO patient = basePatientDao.findById(outpatient.getPatient());
|
|
|
ykyyService.pushNotificationToYktPatient(patient.getYktId(), systemMessageDO.getTitle(), data.get("msg").toString());
|
|
|
}
|
|
|
}
|
|
|
BasePatientDO patient = basePatientDao.findById(outpatient.getPatient());
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
ykyyService.pushNotificationToYktPatient(patient.getYktId(), systemMessageDO.getTitle(), data.get("msg").toString());
|
|
|
|
|
|
|
|
|
if (consultTeamDo!=null){
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(consultTeamDo.getDoctor());
|
|
|
BasePatientDO patientDO = basePatientDao.findById(consultTeamDo.getPatient());
|
|
|
if (consultTeamDo.getType().equals("17")){
|
|
|
type = "17";
|
|
|
msg = patientDO.getName() + ",您好!您有一个视频咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
|
|
|
}else if (consultTeamDo.getType().equals("1")){
|
|
|
type = "1";
|
|
|
msg = patientDO.getName() + ",您好!您有一个图文咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
|
|
|
}
|
|
|
systemMessageDO.setSender(consultTeamDo.getDoctor());
|
|
|
systemMessageDO.setSenderName(doctorDO.getName());
|
|
|
systemMessageDO.setRelationCode(consultTeamDo.getConsult());
|
|
|
systemMessageDO.setReceiver(consultTeamDo.getPatient());
|
|
|
systemMessageDO.setReceiverName(consultTeamDo.getName());
|
|
|
|
|
|
data = new JSONObject();
|
|
|
try {
|
|
|
data.put("name", patientDO.getName());
|
|
|
data.put("age", IdCardUtil.getAgeForIdcard(patientDO.getIdcard()));
|
|
|
data.put("gender", IdCardUtil.getSexForIdcard_new(patientDO.getIdcard()));
|
|
|
data.put("question", consultTeamDo.getSymptoms());
|
|
|
data.put("msg", msg);
|
|
|
data.put("type", type);
|
|
|
systemMessageDO.setData(data.toString());
|
|
|
systemMessageService.saveMessage(systemMessageDO);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
sendWxTemplateMsg(wechatId, "",consultTeamDo, type, "payRemind", "");
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
ykyyService.pushNotificationToYktPatient(patientDO.getYktId(), systemMessageDO.getTitle(), data.get("msg").toString());
|
|
|
}
|
|
|
}
|
|
|
sendWxTemplateMsg(wechatId, outpatient.getId(), type, "payRemind", null);
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@ -6375,7 +6467,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
|
|
|
ykyyService.pushNotificationToYktPatient(patient.getYktId(), messageDO.getTitle(), data.get("msg").toString());
|
|
|
}
|
|
|
sendWxTemplateMsg(wxId, outpatientDO.getId(), "", "prescriptionPayRemind", null);
|
|
|
sendWxTemplateMsg(wxId, outpatientDO.getId(), null,"", "prescriptionPayRemind", "");
|
|
|
} else {
|
|
|
wlyyPrescriptionDO.setId(prescriptionId);
|
|
|
wlyyPrescriptionDO.setCheckStatus(status);
|