教育训练处考试制证系统后端
“djh”
2025-02-18 bc472feefdfc4afbcb0fcd35a8fb8d047edf6a9f
煤矿缴费修改
已修改2个文件
31 ■■■■■ 文件已修改
exam-system/src/main/java/com/gkhy/exam/pay/service/CoalPayService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
exam-system/src/main/java/com/gkhy/exam/pay/utils/PayUtils.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
exam-system/src/main/java/com/gkhy/exam/pay/service/CoalPayService.java
@@ -34,5 +34,5 @@
    String teamPayMoney(CoalTeamPayReq coalTeamPayReq);
    ResultVo topay() throws IOException, BillSignException, BillSignException;
    ResultVo topay() throws IOException, BillSignException;
}
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);