教育训练处考试制证系统后端
heheng
2025-05-19 3a762add44449332d6d379e361698850f6066e16
exam-system/src/main/java/com/gkhy/exam/pay/controller/PaymentApiController.java
@@ -2,13 +2,12 @@
import com.alibaba.fastjson2.JSONObject;
import com.gkhy.exam.pay.service.PaymentService;
import com.ruoyi.common.annotation.Anonymous;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Base64;
@@ -25,6 +24,7 @@
    @ApiOperation(value = "支付Api-回调", notes = "支付Api-回调")
    @PostMapping({"/callBack"})
    @Anonymous
    public JSONObject add(@RequestParam Map<String, Object> callBackParam) {
        String jsonStr = baseToString(callBackParam.get("reqdata").toString());
        JSONObject jsonObject = JSONObject.parseObject(jsonStr);
@@ -52,4 +52,23 @@
        String decodedString = new String(byteArray);
        return decodedString;
    }
    @GetMapping({"/confirm"})
    @ApiOperation("回调确认")
    @Anonymous
    public void notifyConfirm(String orderNo) {
        try {
            paymentService.notifyConfirm(orderNo);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Scheduled(cron = "0 23 10 * * ? ")
    // @Scheduled(cron = "0 37 17 * * ?")
    public void checkWarning() {
        paymentService.schedulePayment();
    }
}