From 33d850692237ff59bc07710d14817cbbac2f975b Mon Sep 17 00:00:00 2001 From: heheng <heheng@123456> Date: 星期二, 18 二月 2025 16:45:18 +0800 Subject: [PATCH] merge --- exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 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 17cb91a..9bee470 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 @@ -1,7 +1,7 @@ package com.gkhy.exam.pay.service.impl; +import cn.com.jit.mof.bean.MOFVerifyResult; import cn.com.jit.new_vstk.Bean.SignResult; -import cn.com.jit.new_vstk.Bean.VerifyResult; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gkhy.exam.pay.dto.rep.CoalPayRepDto; @@ -13,10 +13,7 @@ import com.gkhy.exam.pay.mapper.CoalPayMapper; import com.gkhy.exam.pay.service.CoalPayService; 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.gkhy.exam.pay.utils.SignDto; +import com.gkhy.exam.pay.utils.*; import com.ruoyi.common.constant.ResultConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysDept; @@ -328,7 +325,7 @@ } @Override - public ResultVo topay() throws IOException { + public ResultVo topay() throws IOException, BillSignException { PayReqData payReqData = new PayReqData(); PayReqData.Feedata feedatas = new PayReqData.Feedata(); @@ -387,10 +384,12 @@ throw new RuntimeException(e); } log.info("票据原文为:" + document.asXML()); + BillSign billSign = new BillSign(); + String s = billSign.readRefSignDto(document); Element rootElement = document.getRootElement(); - SignResult sign = payUtils.sign(fileData); - VerifyResult verify = payUtils.verify(sign.getSignData(), fileData); - SignDto signDto = new SignDto(new Date(), verify.getSubjectdn(), verify.getSn(), verify.getIssure()); + SignResult sign = payUtils.sign(s); + MOFVerifyResult verify = payUtils.verify(sign.getSignData(), s); + SignDto signDto = new SignDto(verify.getSignTime(), new String(Base64.getEncoder().encode(sign.getSignData())), verify.getIssure(), verify.getSn()); log.info("拼接对象为:" + JSONObject.toJSONString(signDto)); Sign sign1 = new Sign(); Document signature = sign1.getSignature(signDto); -- Gitblit v1.9.2