diff --git a/xhpc-modules/xhpc-tradebill/pom.xml b/xhpc-modules/xhpc-tradebill/pom.xml index df49c1db..dd1675f2 100644 --- a/xhpc-modules/xhpc-tradebill/pom.xml +++ b/xhpc-modules/xhpc-tradebill/pom.xml @@ -86,31 +86,6 @@ compile - - javax.websocket - javax.websocket-api - 1.1 - provided - - - org.springframework.boot - spring-boot-starter-websocket - - - - - com.alipay.sdk - alipay-sdk-java - 4.15.14.ALL - - - - - com.github.binarywang - weixin-java-pay - 4.2.0 - - org.apache.ant ant diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/AliPayProperties.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/AliPayProperties.java deleted file mode 100644 index 140b3346..00000000 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/AliPayProperties.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xhpc.tradebill.config; - - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - - -/** - * 支付宝支付配置类 - */ -@Data -@ConfigurationProperties(prefix = "alibaba.pay") -public class AliPayProperties { - - private String gatewayDomain; - private String serverDomain; - private String publicKey; - private String privateKey; - private String appId; - private String certPath; - private String publicCertPath; - private String rootCertPath; -} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/WxPayProperties.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/WxPayProperties.java deleted file mode 100644 index e61cffd3..00000000 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/config/WxPayProperties.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.xhpc.tradebill.config; - - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * 微信支付配置类 - */ -@Data -@ConfigurationProperties(prefix = "wx.pay") -public class WxPayProperties { - /** - * 设置微信公众号或者小程序等的appid - */ - private String appId; - - /** - * 微信支付商户号 - */ - private String mchId; - - /** - * 微信支付商户密钥 - */ - private String mchKey; - - /** - * 服务商模式下的子商户公众账号ID,普通模式请不要配置,请在配置文件中将对应项删除 - */ - private String subAppId; - - /** - * 服务商模式下的子商户号,普通模式请不要配置,最好是请在配置文件中将对应项删除 - */ - private String subMchId; - - /** - * apiclient_cert.p12文件的绝对路径,或者如果放在项目中,请以classpath:开头指定 - */ - private String keyPath; -} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/constant/WeixinPayConstant.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/constant/WeixinPayConstant.java deleted file mode 100644 index 295f222f..00000000 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/constant/WeixinPayConstant.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.xhpc.tradebill.constant; - -/** - * 微信支付常量 - */ -public class WeixinPayConstant { - - /** - * 返回当日所有订单信息(不含充值退款订单) - */ - public static final String BILL_TYPE_ALL = "ALL"; - - /** - * 返回当日成功支付的订单(不含充值退款订单) - */ - public static final String BILL_TYPE_SUCCESS = "SUCCESS"; - - /** - * 返回当日退款订单(不含充值退款订单) - */ - public static final String BILL_TYPE_REFUND = "REFUND"; - - /** - * 返回格式为.gzip的压缩包账单 - */ - public static final String TAR_TYPE_GZIP = "GZIP"; - - /** - * 基本账户 - */ - public static final String ACCOUNT_TYPE_BASIC = "BASIC"; - - /** - * 运营账户 - */ - public static final String ACCOUNT_TYPE_OPERATION = "OPERATION"; - - /** - * 手续费账户 - */ - public static final String ACCOUNT_TYPE_FEES = "FEES"; -} diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/PaymentBillService.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/PaymentBillService.java index 2e1bc3b9..70bec913 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/PaymentBillService.java +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/PaymentBillService.java @@ -1,9 +1,6 @@ package com.xhpc.tradebill.service; -import com.alipay.api.response.AlipayDataBillAccountlogQueryResponse; -import com.github.binarywang.wxpay.bean.result.WxPayFundFlowResult; -import com.github.binarywang.wxpay.exception.WxPayException; import com.xhpc.tradebill.domain.XhpcTradebillPaymentCheckRecordDomain; import javax.servlet.http.HttpServletResponse; @@ -75,27 +72,6 @@ public interface PaymentBillService { */ XhpcTradebillPaymentCheckRecordDomain computeTradebillData(XhpcTradebillPaymentCheckRecordDomain domain) ; - - /** - * 使用微信支付SDK获取账单信息 - * - * @param billDate 账单日期,格式:2021-12-20 - * @return 账单数据 - * @throws WxPayException 异常 - */ - WxPayFundFlowResult getWechatPayBill(String billDate) throws WxPayException; - - /** - * 使用支付宝SDK获取账单信息 - * - * @param startTime 账单开始时间 - * @param endTime 账单结束时间 - * @return 账单数据 - * @throws Exception 异常 - */ - AlipayDataBillAccountlogQueryResponse getAliPayBill(String startTime, String endTime) throws Exception; - - /** * 导出对账单 * @param response 返回体 diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/InternetBillServiceImpl.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/InternetBillServiceImpl.java index 88760321..ad3c1977 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/InternetBillServiceImpl.java +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/InternetBillServiceImpl.java @@ -43,9 +43,6 @@ public class InternetBillServiceImpl implements InternetBillService { @Resource XhpcHistoryOrderMapper historyOrderMapper; - @Resource - EtOrderMappingMapper orderMappingMapper; - @Override public XhpcTradebillInternetCheckRecordDomain getInfoByPk(int pk) { diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java index 570ff9a9..aaf9cd92 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java @@ -9,21 +9,7 @@ import cn.hutool.core.text.csv.CsvUtil; import cn.hutool.core.util.CharsetUtil; import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelWriter; -import com.alibaba.fastjson.JSON; -import com.alipay.api.AlipayApiException; -import com.alipay.api.AlipayClient; -import com.alipay.api.DefaultAlipayClient; -import com.alipay.api.request.AlipayDataBillAccountlogQueryRequest; -import com.alipay.api.response.AlipayDataBillAccountlogQueryResponse; -import com.github.binarywang.wxpay.bean.result.WxPayFundFlowResult; -import com.github.binarywang.wxpay.exception.WxPayException; -import com.github.binarywang.wxpay.service.WxPayService; import com.xhpc.common.core.utils.SecurityUtils; -import com.xhpc.tradebill.config.AliPayProperties; -import com.xhpc.tradebill.constant.WeixinPayConstant; -import com.xhpc.tradebill.domain.XhpcRechargeOrderDomain; -import com.xhpc.tradebill.domain.XhpcRefundOrderDomain; -import com.xhpc.tradebill.domain.XhpcTradebillInternetCheckRecordDomain; import com.xhpc.tradebill.domain.XhpcTradebillPaymentCheckRecordDomain; import com.xhpc.tradebill.mapper.XhpcRechargeOrderMapper; import com.xhpc.tradebill.mapper.XhpcRefundOrderMapper; @@ -51,11 +37,6 @@ import java.util.*; @Service public class PaymentBillServiceImpl implements PaymentBillService { - public WxPayService wxPayService; - - @Resource - AliPayProperties aliPayProperties; - @Resource XhpcRechargeOrderMapper rechargeOrderMapper; @@ -360,59 +341,6 @@ public class PaymentBillServiceImpl implements PaymentBillService { } - /** - * 使用微信支付SDK获取账单信息 - * - * @param billDate 账单日期,格式:2021-12-20 - * @return 账单数据 - * @throws WxPayException 异常 - */ - public WxPayFundFlowResult getWechatPayBill(String billDate) throws WxPayException { - - return this.wxPayService.downloadFundFlow(billDate, - WeixinPayConstant.ACCOUNT_TYPE_BASIC, - WeixinPayConstant.TAR_TYPE_GZIP); - } - - /** - * 使用支付宝SDK获取账单信息 - * - * @param startTime 账单开始时间 - * @param endTime 账单结束时间 - * @return 账单数据 - * @throws Exception 异常 - */ - public AlipayDataBillAccountlogQueryResponse getAliPayBill(String startTime, String endTime) throws - Exception { - - try { - AlipayClient alipayClient = new DefaultAlipayClient(aliPayProperties.getGatewayDomain(), - aliPayProperties.getAppId(), - aliPayProperties.getPrivateKey(), - aliPayProperties.getPublicKey(), - "json", "GBK", "RSA2"); - AlipayDataBillAccountlogQueryRequest request = new AlipayDataBillAccountlogQueryRequest(); - - HashMap params = new HashMap<>(); - params.put("start_time", startTime); - params.put("end_time", endTime); - params.put("page_no", "1"); - params.put("page_size", "2000"); - - request.setBizContent(JSON.toJSONString(params)); - log.debug(JSON.toJSONString(params)); - AlipayDataBillAccountlogQueryResponse response = alipayClient.execute(request); - if (response.isSuccess()) { - log.info("调用支付宝对账接口成功"); - return response; - } else { - log.debug("调用支付宝对账接口失败, 失败原因:" + response.getMsg()); - throw new AlipayApiException(response.getMsg()); - } - } catch (Exception e) { - throw new Exception(e.getMessage()); - } - } @Override