教育训练处考试制证系统后端
“djh”
2025-02-18 bc472feefdfc4afbcb0fcd35a8fb8d047edf6a9f
exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayStudentServiceImpl.java
@@ -1,5 +1,6 @@
package com.gkhy.exam.pay.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -174,6 +175,25 @@
        if (nonCoalStuRep.getPayStatus() == 1) {
            throw new BusinessException(this.getClass(), ResultConstants.BUSINESS_ERROR, "已缴费请勿重复缴费");
        }
        if (nonCoalStuRep.getGovPayStatus() == 2 && nonCoalStuRep.getPayStatus() == 0) {
            try {
                JSONObject result = payUtils.query(nonCoalStuRep.getOrderNo());
                String status = result.getString("status");
                if (("1").equals(status)) {
                    nonCoalPayStudentMapper.update(null, Wrappers.<NonCoalPayStudent>lambdaUpdate()
                            .set(NonCoalPayStudent::getPayStatus, 1)
                            .set(NonCoalPayStudent::getPayTime, result.getDate("payTime"))
                            .eq(NonCoalPayStudent::getOrderNo, nonCoalStuRep.getOrderNo()).eq(NonCoalPayStudent::getDelFlag, 0)
                            .eq(NonCoalPayStudent::getPayStatus, 0));
                } else if (status == null) {
                    log.error("查询财政订单失败:" + result.getString("respmsg") + ",错误编码:" + result.getString("respcode"));
                }
            } catch (Exception e) {
                log.error("查询财政订单失败:" + e.getMessage());
            }
        }
        return nonCoalStuRep;
    }