教育训练处考试制证系统后端
“djh”
2025-03-24 631ead73058002bafa9a5a47f092e85d87c9a5d8
exam-system/src/main/java/com/gkhy/exam/pay/utils/PayUtils.java
@@ -9,6 +9,7 @@
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSONObject;
import com.gkhy.exam.pay.entity.PayReqData;
import com.ruoyi.common.utils.Threads;
import com.xjhys.edu.fee.sdk.client.BillClient;
import com.xjhys.edu.fee.sdk.client.impl.ClientFactory;
import com.xjhys.edu.fee.sdk.model.ResponseDataVo;
@@ -46,6 +47,7 @@
import org.dom4j.io.XMLWriter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import sun.misc.BASE64Encoder;
@@ -290,6 +292,17 @@
        return params;
    }
    @Async
    public void asyncNotrify(String orderNo){
        try {
            Threads.sleep(2000);
            affirmPost(orderNo);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    //缴费结果确认查询
    public String affirmPost(String orderNo) throws IOException {
@@ -310,6 +323,7 @@
        HttpResultVo execute = httpClient.execute(httppost, getResponseHandler());
        String stringContent = execute.getStringContent();
        ResultVo resultVo = JSONObject.parseObject(stringContent, ResultVo.class);
        log.info("缴费结果确认,请求参数:"+orderNo);
        log.info("请求结果为:" + resultVo);
        if (resultVo.getRespcode().equals(CaiZhengConstans.CAI_ZHENG_SUCCESS)) {
            return "success";
@@ -417,10 +431,10 @@
        header.put("Accept", "application/json;charset=utf-8");
        header.put("Content-Type", "application/json;charset=utf-8");
        String resultStr = HttpUtil.post(orderUrl, jsonObject);
        System.out.println("发起入参===" + jsonObject);
        log.info("发起入参===" + jsonObject);
        JSONObject result = JSONObject.parseObject(resultStr);
        ResultVo resultVo = JSONObject.parseObject(resultStr, ResultVo.class);
        System.out.println("发起回参===" + result);
        log.info("发起回参===" + result);
        result.put("postData", reqdatastr);
        JSONObject jsonObject2 = result.getJSONObject("respdata");
        String signfile = jsonObject2.getString("fileData");