| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | 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 { |
| | | |
| | |
| | | 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"; |
| | |
| | | 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"); |