|
@ -6,6 +6,8 @@ import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
|
|
|
import com.yihu.jw.hospital.prescription.dao.OauthDzqmConfigDao;
|
|
|
import com.yihu.jw.hospital.prescription.dao.OauthYlzConfigDao;
|
|
|
import com.yihu.jw.order.pay.utils.PayLogService;
|
|
|
import com.yihu.jw.util.common.QrcodeUtil;
|
|
|
import com.yihu.jw.utils.ByteToInputStream;
|
|
|
import com.yihu.jw.utils.StringUtil;
|
|
|
import com.ylzinfo.onepay.sdk.HisOnepayClient;
|
|
|
import com.ylzinfo.onepay.sdk.OnepayClient;
|
|
@ -17,6 +19,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.InputStream;
|
|
|
import java.io.PrintWriter;
|
|
|
import java.io.StringWriter;
|
|
|
import java.util.HashMap;
|
|
@ -308,7 +311,7 @@ public class YlzPayService {
|
|
|
* @param channel
|
|
|
* @return
|
|
|
*/
|
|
|
public String createSicardPayUrl(String accId,String openId,String cardNo,String channel){
|
|
|
public String createSicardPayUrl(String accId,String openId,String cardNo,String channel,String flag){
|
|
|
String object = null;
|
|
|
Boolean isSuccess = true;
|
|
|
String error = null;
|
|
@ -331,6 +334,13 @@ public class YlzPayService {
|
|
|
//jsonObject.put("extra")
|
|
|
ResponseParams<JSONObject> response = onepayClient.createSicardPayUrl(jsonObject);
|
|
|
if (response.getRespCode().equals("000000")){
|
|
|
JSONObject object1 = response.getParam();
|
|
|
String url = object1.getString("payUrl");
|
|
|
InputStream qrcode = QrcodeUtil.createQrcode(url,300,"jpg");
|
|
|
ByteToInputStream byteToInputStream = new ByteToInputStream();
|
|
|
String QRCodeImg = byteToInputStream.getBase64FromInputStream(qrcode);
|
|
|
object1.put("qrcodeUrl","data:image/png;base64,"+ QRCodeImg);
|
|
|
response.setParam(object1);
|
|
|
object = JSON.toJSONString(response);
|
|
|
}else {
|
|
|
isSuccess = false;
|
|
@ -345,7 +355,7 @@ public class YlzPayService {
|
|
|
e.printStackTrace(pw);
|
|
|
error = sw.toString();
|
|
|
}
|
|
|
logService.saveHttpLog(isSuccess, "hop.mmpay.sicard.url", "互联网医院支付地址", "POST", null,JSON.toJSONString(jsonObject), object, error,logService.pushType);
|
|
|
logService.saveHttpLog(isSuccess, "hop.mmpay.sicard.pay.url", "互联网医院支付地址", "POST", null,JSON.toJSONString(jsonObject), object, error,logService.pushType);
|
|
|
return object;
|
|
|
}
|
|
|
|