From bc472feefdfc4afbcb0fcd35a8fb8d047edf6a9f Mon Sep 17 00:00:00 2001 From: “djh” <“3298565835@qq.com”> Date: 星期二, 18 二月 2025 16:50:30 +0800 Subject: [PATCH] 煤矿缴费修改 --- exam-system/src/main/java/com/gkhy/exam/pay/utils/PayUtils.java | 29 +++++++++++------------------ 1 files changed, 11 insertions(+), 18 deletions(-) diff --git a/exam-system/src/main/java/com/gkhy/exam/pay/utils/PayUtils.java b/exam-system/src/main/java/com/gkhy/exam/pay/utils/PayUtils.java index ab6c6e9..4f2e5c6 100644 --- a/exam-system/src/main/java/com/gkhy/exam/pay/utils/PayUtils.java +++ b/exam-system/src/main/java/com/gkhy/exam/pay/utils/PayUtils.java @@ -92,17 +92,17 @@ public ResultVo sendApiPost(PayReqData payReqData) throws IOException { Map<String, String> param = new HashMap<>(); - String appid = "A1749891493E4CDDBFE4506357B1F0AB"; - String orderUrl = "http://finpt.xjcz.gov.cn/fs-service/fs-pay/invoice.do"; +// String appid = "A1749891493E4CDDBFE4506357B1F0AB"; +// String orderUrl = "http://finpt.xjcz.gov.cn/fs-service/fs-pay/invoice.do"; HttpPost httpPost = new HttpPost(orderUrl); log.info("请求地址:"+orderUrl); //请求参数转为json格式base64编码 String reqData = Base64.getEncoder().encodeToString(JSONObject.toJSONString(payReqData).getBytes()); - String mac = appid + "||" + reqData; + String mac = appId + "||" + reqData; mac = DigestUtils.md5Hex(mac.getBytes()); - param.put("appid", appid); - log.info("请求appid:"+appid); + param.put("appid", appId); + log.info("请求appid:"+appId); param.put("reqdata", reqData); param.put("mac", mac); @@ -362,31 +362,24 @@ public ResultVo uploadXml(String orderId, String plain) throws IOException { Map<String, String> params = new HashMap<>(); -// Sign sign = new Sign(); -// SignResult sign1 = this.sign(plain); -// log.info("签名结果为:"+ Arrays.toString(sign1.getSignData())); -// VerifyResult verify = this.verify(plain, sign1.getSignData()); -// SignDto signDto = new SignDto("SM3", "Base64", new Date(), verify.getReturnData(), verify.getSerialNumber(), verify.getIssure()); -// Element signature = sign.getSignature(signDto); - - String appid = "A1749891493E4CDDBFE4506357B1F0AB"; - String orderUrl = "http://finpt.xjcz.gov.cn/fs-service/fs-pay/uploadXml.do"; +// String appid = "A1749891493E4CDDBFE4506357B1F0AB"; +// String orderUrl = "http://finpt.xjcz.gov.cn/fs-service/fs-pay/uploadXml.do"; JSONObject jsonObject = new JSONObject(); jsonObject.put("orderNo",orderId); jsonObject.put("fileData", Base64.getEncoder().encodeToString(plain.getBytes())); String reqdata = Base64.getEncoder().encodeToString(jsonObject.toJSONString().getBytes()); - String mac = appid+"||" +reqdata; + String mac = appId+"||" +reqdata; mac = DigestUtils.md5Hex(mac.getBytes()); - params.put("appid",appid); + params.put("appid",appId); params.put("reqdata",reqdata); params.put("mac",mac); - HttpPost httpPost = new HttpPost(orderUrl); + HttpPost httpPost = new HttpPost(uploadXmlUrl); httpPost.setEntity(assemblyFormEntity(params,"utf-8")); - HttpClient httpClient = getHttpClient(orderUrl); + HttpClient httpClient = getHttpClient(uploadXmlUrl); HttpResultVo execute = httpClient.execute(httpPost, getResponseHandler()); String stringContent = execute.getStringContent(); ResultVo resultVo = JSONObject.parseObject(stringContent, ResultVo.class); -- Gitblit v1.9.2