删除不用的包和代码
This commit is contained in:
parent
772262b153
commit
1e5fda7d20
@ -86,31 +86,6 @@
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.websocket</groupId>
|
||||
<artifactId>javax.websocket-api</artifactId>
|
||||
<version>1.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 支付宝支付 通用版 -->
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.15.14.ALL</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 微信支付 -->
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-pay</artifactId>
|
||||
<version>4.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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";
|
||||
}
|
||||
@ -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 返回体
|
||||
|
||||
@ -43,9 +43,6 @@ public class InternetBillServiceImpl implements InternetBillService {
|
||||
@Resource
|
||||
XhpcHistoryOrderMapper historyOrderMapper;
|
||||
|
||||
@Resource
|
||||
EtOrderMappingMapper orderMappingMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public XhpcTradebillInternetCheckRecordDomain getInfoByPk(int pk) {
|
||||
|
||||
@ -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<String, String> 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user