|
@ -10457,9 +10457,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return null;
|
|
|
}
|
|
|
public Map saveNatAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
|
|
|
String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag) throws Exception {
|
|
|
String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag,String cardNoType) throws Exception {
|
|
|
Map returnMap = new HashMap();
|
|
|
|
|
|
if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
|
|
|
net.sf.json.JSONObject jsondate = new JSONObject();
|
|
|
jsondate.put("checkPart","鼻/咽拭子");
|
|
@ -10515,6 +10514,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
baseNatAppointmentDO.setStreetName(streetName);
|
|
|
baseNatAppointmentDO.setPatientId(patientId);
|
|
|
baseNatAppointmentDO.setIsSuccess("0");
|
|
|
baseNatAppointmentDO.setCardNoType(cardNoType);
|
|
|
baseNatAppointmentDO.setPayStatus("0");
|
|
|
baseNatAppointmentDO.setCreateTime(new Date());
|
|
|
baseNatAppointmentDO.setMobile(mobile);
|
|
@ -10611,7 +10611,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
baseNatAppointmentDO.setIsSuccess("1");
|
|
|
baseNatAppointmentDO.setVoucherNo(voucherNo);
|
|
|
baseNatAppointmentDO =baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
logger.info("模板消息推送标识pushFlag"+pushFlag);
|
|
|
/*logger.info("模板消息推送标识pushFlag"+pushFlag);
|
|
|
if (!StringUtils.isNoneBlank(pushFlag)){
|
|
|
String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
|
|
|
String applyDepaName = map.get("deptName").toString();
|
|
@ -10636,10 +10636,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
ylzPayService.msgPush("01", mediaCard, "01", patientDO.getMobile(), "00", hisId, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1",pushChannel);
|
|
|
}else {
|
|
|
|
|
|
/* String title="您在厦门大学附属中山医院有一笔交易已支付完成!";
|
|
|
String title="您在厦门大学附属中山医院有一笔交易已支付完成!";
|
|
|
String pushPayLog = payInfoNoticeService.pushPrescriptionPayAndHsjc(baseNatAppointmentDO.getPatientId(),baseNatAppointmentDO.getDoctorName(),waitPayDetailVO.getVoucherNo(),natAppointmentDO.getId()+"",fee,title,null,waitPayDetailVO.getRecipeNo());
|
|
|
*/
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
|
|
|
/*//成功后发送模板消息
|
|
@ -10698,6 +10697,87 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
return returnMap;
|
|
|
}
|
|
|
|
|
|
public String sendMessage(Integer id,String pushChannel,String pushFlag) throws Exception {
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
|
|
|
if (baseNatAppointmentDO==null){
|
|
|
throw new Exception("预约记录不存在");
|
|
|
}
|
|
|
if (!StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
|
|
|
throw new Exception("核酸项目不存在");
|
|
|
}
|
|
|
|
|
|
logger.info("模板消息推送标识pushFlag"+pushFlag);
|
|
|
if (!StringUtils.isNoneBlank(pushFlag)){
|
|
|
String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
|
|
|
String applyDepaName = baseNatAppointmentDO.getDeptName();
|
|
|
String applyDoctorName = baseNatAppointmentDO.getDoctorName();
|
|
|
BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId());
|
|
|
String userName = null;
|
|
|
String idcard = null;
|
|
|
if (patientDO != null) {
|
|
|
userName = patientDO.getName();
|
|
|
idcard = patientDO.getIdcard();
|
|
|
}
|
|
|
String hisId = patientMappingService.findHisPatNoByPatient(baseNatAppointmentDO.getPatientId(),baseNatAppointmentDO.getMedicare());
|
|
|
logger.info("cardNo:" + baseNatAppointmentDO.getMedicare());
|
|
|
JSONObject jsonObject1 =entranceService.BS15054(hisId,baseNatAppointmentDO.getRealOrder(),demoFlag);
|
|
|
net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
|
|
|
logger.info("获取待结算数据 res: " + res.toString());
|
|
|
String rsCode = res.getString("@RESULT");
|
|
|
String free= 0+"";
|
|
|
if ("0".equals(rsCode)) {
|
|
|
free = res.getString("@total_charge");
|
|
|
}
|
|
|
ylzPayService.msgPush("01", baseNatAppointmentDO.getMedicare(), "01", patientDO.getMobile(), "00", hisId, userName, idcard, baseNatAppointmentDO.getVoucherNo(), applyDepaName, applyDoctorName, recipeTime, free, "1",pushChannel);
|
|
|
}else {
|
|
|
if (pushChannel.equalsIgnoreCase("WX_PUB")){
|
|
|
String first="尊敬的用户"+baseNatAppointmentDO.getName()+",您已完成线上自助核酸检测预约申请";
|
|
|
String responseMsg="";
|
|
|
String url="";
|
|
|
String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
|
|
|
String contentMsg="申请人:"+baseNatAppointmentDO.getName()+"\r\n预约时间:"+date;
|
|
|
String remark = "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\r\n" +
|
|
|
"2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\r\n" +
|
|
|
"3、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
|
|
|
if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
responseMsg = entranceService.ehospitalNotice(
|
|
|
baseNatAppointmentDO.getName(),
|
|
|
baseNatAppointmentDO.getCardNo(),
|
|
|
baseNatAppointmentDO.getMobile(),
|
|
|
first,
|
|
|
url,
|
|
|
contentMsg,
|
|
|
remark);
|
|
|
logger.info("中山发送模板消息返回结果="+responseMsg);
|
|
|
System.out.println("结束发送模板消息");
|
|
|
}
|
|
|
}else if (pushChannel.equalsIgnoreCase("ALI_PUB")){
|
|
|
BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId());
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
|
|
|
jsonObject.put("code","13");
|
|
|
jsonObject.put("open_id",patientDO.getAlipayId());
|
|
|
jsonObject.put("first","尊敬的用户"+baseNatAppointmentDO.getName()+",您已完成线上自助核酸检测预约申请");
|
|
|
jsonObject.put("keyword1",DateUtil.getStringDate());
|
|
|
String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
|
|
|
jsonObject.put("keyword2","申请人:"+baseNatAppointmentDO.getName()+"\n预约时间:"+date);
|
|
|
String remark = "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\n" +
|
|
|
"2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\n" +
|
|
|
"3、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
|
|
|
jsonObject.put("remark",remark);
|
|
|
jsonObject.put("url","111111");
|
|
|
String url = "https://xmzsyyfwc.xmpbinfo.cn/weixin/1/notification/push/nucleictest";
|
|
|
logger.info("jsonObject"+jsonObject.toJSONString());
|
|
|
String encdata = AES.encrypt("3bdc154ed1e44a9c9f44451a16d8e0aa",jsonObject.toJSONString());
|
|
|
Map<String, String> params = new HashedMap();
|
|
|
params.put("encdata",encdata);
|
|
|
String reponse = httpClientUtil.httpPost(url,params);
|
|
|
logger.info("支付宝模板消息"+reponse);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
return "发送成功!";
|
|
|
}
|
|
|
public MixEnvelop getNatRecords(String patientId,String id,String payStatus,String appointmentTime, String isSuccess,Integer page ,Integer pageSize){
|
|
|
try {
|
|
|
savePayStatusByHis(patientId);
|
|
@ -10717,6 +10797,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"t.medicare as \"medicare\","+
|
|
|
"t.voucher_no as \"voucherNo\","+
|
|
|
"t.id as \"id\"," +
|
|
|
"t.card_no_type as \"cardNoType\"," +
|
|
|
"t.appointment_time as \"appointmentTime\" " +
|
|
|
" from base_nat_appointment t where 1=1 ";
|
|
|
if (StringUtils.isNoneBlank(patientId)){
|