|
@ -1,30 +1,38 @@
|
|
package com.yihu.jw.hospital.prescription.service;
|
|
package com.yihu.jw.hospital.prescription.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
|
|
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
|
|
import com.yihu.jw.hospital.prescription.dao.OauthYlzConfigDao;
|
|
|
|
import com.yihu.jw.order.pay.utils.PayLogService;
|
|
|
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
import com.ylzinfo.onepay.sdk.OnepayDefaultClient;
|
|
|
|
import com.ylzinfo.onepay.sdk.domain.RequestParams;
|
|
|
|
import com.ylzinfo.onepay.sdk.domain.ResponseParams;
|
|
|
|
import com.ylzinfo.onepay.sdk.utils.DateUtil;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
import java.io.StringWriter;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class PayInfoNoticeService {
|
|
public class PayInfoNoticeService {
|
|
@Value("${hospital.url}")
|
|
@Value("${hospital.url}")
|
|
private String serverUrl;
|
|
private String serverUrl;
|
|
@Autowired
|
|
@Autowired
|
|
private HttpClientUtil httpClientUtil;
|
|
private HttpClientUtil httpClientUtil;
|
|
|
|
@Autowired
|
|
|
|
private BasePatientDao patientDao;
|
|
|
|
|
|
|
|
|
|
|
|
public String pushPrescriptionPay(String patient,String doctorName,String orderNo,String outpatientId,String prescriptionId,String total){
|
|
|
|
BasePatientDO patientDO = patientDao.findById(patient);
|
|
|
|
if (patientDO!=null){
|
|
|
|
String userName = patientDO.getName();
|
|
|
|
String idcard = patientDO.getIdcard();
|
|
|
|
String phone = patientDO.getMobile();
|
|
|
|
String title="您在厦门大学附属中山医院有一笔诊察/处方费用以支付完成!";
|
|
|
|
String url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientId+"&id="+prescriptionId;
|
|
|
|
String remark = "结算方式:微信结算" +
|
|
|
|
"点击查看取药/配送信息";
|
|
|
|
return paySuccessNotice(userName,idcard,phone,title,url,doctorName,total,"0",total,orderNo,remark);
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 支付成功提醒
|
|
* 支付成功提醒
|
|
@ -44,20 +52,19 @@ public class PayInfoNoticeService {
|
|
*/
|
|
*/
|
|
public String paySuccessNotice(String userName,String idCard,String phone,String title,String url,
|
|
public String paySuccessNotice(String userName,String idCard,String phone,String title,String url,
|
|
String doctorName,String total,String miPay,String selfPay,String orderNo,String remark) {
|
|
String doctorName,String total,String miPay,String selfPay,String orderNo,String remark) {
|
|
url = "https://172.16.1.34";
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("userName", userName);
|
|
jsonObject.put("userName", userName);
|
|
jsonObject.put("idCard", idCard);
|
|
jsonObject.put("idCard", idCard);
|
|
jsonObject.put("phone", phone);
|
|
jsonObject.put("phone", phone);
|
|
jsonObject.put("title", title);
|
|
jsonObject.put("title", title);
|
|
jsonObject.put("url", serverUrl);
|
|
|
|
|
|
jsonObject.put("url", url);
|
|
jsonObject.put("doctorName", doctorName);
|
|
jsonObject.put("doctorName", doctorName);
|
|
jsonObject.put("total", total);
|
|
jsonObject.put("total", total);
|
|
jsonObject.put("miPay", miPay);
|
|
jsonObject.put("miPay", miPay);
|
|
jsonObject.put("selfPay", selfPay);
|
|
jsonObject.put("selfPay", selfPay);
|
|
jsonObject.put("orderNo", orderNo);
|
|
jsonObject.put("orderNo", orderNo);
|
|
jsonObject.put("remark", remark);
|
|
jsonObject.put("remark", remark);
|
|
String responseMsg = httpClientUtil.sendPost(url + "/interface/paySuccessNoticePush.htm", jsonObject.toJSONString());
|
|
|
|
|
|
String responseMsg = httpClientUtil.sendPost(serverUrl + "/interface/paySuccessNoticePush.htm", jsonObject.toJSONString());
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
String respCode = "";
|
|
String respCode = "";
|
|
if (responseMsg != null) {
|
|
if (responseMsg != null) {
|