From cff3c43f216c6f01f675e4821832e15f2a77c57c Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期三, 05 二月 2025 13:00:04 +0800
Subject: [PATCH] 煤矿缴费修改

---
 exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java
index 2c86c26..79e19c9 100644
--- a/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java
+++ b/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java
@@ -12,6 +12,7 @@
 import com.gkhy.exam.pay.service.CoalPayStudentService;
 import com.gkhy.exam.pay.utils.PayUtils;
 import com.gkhy.exam.pay.utils.ResultVo;
+import com.gkhy.exam.pay.utils.Sign;
 import com.ruoyi.common.constant.ResultConstants;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysDept;
@@ -20,6 +21,7 @@
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.mapper.SysDeptMapper;
+import org.dom4j.Element;
 import org.redisson.api.RLock;
 import org.redisson.api.RedissonClient;
 import org.springframework.beans.BeanUtils;
@@ -80,7 +82,7 @@
             //学员数据
             List<CoalPayStudent> coalPayStudents = coalPayStudentService.selectByCoalPayId(pay.getId());
             List<CoalPayStudent> havePay = coalPayStudents.stream()
-                    .filter(stu -> stu.getPayStatus() != null && stu.getPayStatus().equals(1))
+                    .filter(stu -> stu.getPayStatus() != null && stu.getPayStatus()==1)
                     .collect(Collectors.toList());
             coalPayRepDto.setTotalNum(coalPayStudents.size());
             coalPayRepDto.setHavePayNum(havePay.size());
@@ -184,6 +186,7 @@
         for (CoalPayStudent payStudent : coalPayStudents) {
             //封装学生基础信息
             CoalPayStudentRep coalPayStudentRep = new CoalPayStudentRep();
+            coalPayStudentRep.setId(payStudent.getId());
             coalPayStudentRep.setName(payStudent.getName());
             coalPayStudentRep.setIdCard(payStudent.getIdCard());
             coalPayStudentRep.setPhone(payStudent.getPhone());
@@ -249,6 +252,11 @@
 
             ResultVo resultVo = payUtils.sendApiPost(payReqData);
             if (resultVo.getRespcode().equals("BUS0000")) {
+                //进行票据签名并校验
+                ResultVo resultVo1 = payUtils.uploadXml(resultVo.getRespdata().getOrderNo(), resultVo.getRespdata().getFileData());
+              if (!resultVo1.getRespcode().equals("BUS0000")){
+                  throw new BusinessException(this.getClass(), ResultConstants.BUSINESS_ERROR, "签名验证错误");
+              }
                 payStudent.setId(studentId);
                 payStudent.setOrderId(resultVo.getRespdata().getOrderNo());
                 payStudent.setGovPayStatus(1);

--
Gitblit v1.9.2