exam-system/src/main/java/com/gkhy/exam/pay/controller/PaymentApiController.java
@@ -37,6 +37,7 @@ } jsonObject1.put("orderNo", orderNo); jsonObject1.put("status", "success"); log.info("返回财政参数:"+jsonObject1); return jsonObject1; } catch (Exception e) { log.info("财政回调处理订单发生错误"); exam-system/src/main/java/com/gkhy/exam/pay/service/impl/PaymentServiceImpl.java
@@ -52,7 +52,7 @@ .eq(CoalPayStudent::getOrderNo, orderNo).eq(CoalPayStudent::getDelFlag, 0) .eq(CoalPayStudent::getPayStatus, 0)); } notifyConfirm(orderNo); payUtils.asyncNotrify(orderNo); } 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 { ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
@@ -4,12 +4,14 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.scheduling.annotation.EnableAsync; /** * 启动程序 * * @author ruoyi */ @EnableAsync @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class },scanBasePackages = {"com.gkhy","com.ruoyi"}) public class RuoYiApplication {