From 111bcd417f7350bff3289b48a188095430471156 Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期三, 12 二月 2025 16:09:23 +0800
Subject: [PATCH] 煤矿缴费修改

---
 exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java |   12 +++++++++++-
 1 files changed, 11 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..a7ede06 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,10 +186,13 @@
         for (CoalPayStudent payStudent : coalPayStudents) {
             //封装学生基础信息
             CoalPayStudentRep coalPayStudentRep = new CoalPayStudentRep();
+            coalPayStudentRep.setId(payStudent.getId());
             coalPayStudentRep.setName(payStudent.getName());
             coalPayStudentRep.setIdCard(payStudent.getIdCard());
             coalPayStudentRep.setPhone(payStudent.getPhone());
             coalPayStudentRep.setSex(payStudent.getSex());
+            coalPayStudentRep.setPayType(payStudent.getPayType());
+            coalPayStudentRep.setPayCode(payStudent.getPayCode());
             coalPayStudentRep.setPayStatus(payStudent.getPayStatus());
 
             //查询对应批次以及批次包含工种类别
@@ -249,6 +254,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