🎨 升级部分依赖版本,优化代码,部分代码增加泛型参数

This commit is contained in:
altusea
2025-05-13 15:56:14 +08:00
committed by GitHub
parent a7b007f853
commit 063fbb7f19
263 changed files with 559 additions and 607 deletions

View File

@@ -34,8 +34,6 @@ import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxRuntimeException;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.reflect.ConstructorUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;

View File

@@ -44,7 +44,7 @@ public class BrandMerchantTransferServiceImpl implements BrandMerchantTransferSe
if (request.getNeedQueryDetail() != null) {
url = String.format("%s?need_query_detail=%b", url, request.getNeedQueryDetail());
}
if (request.getDetailState() != null && request.getDetailState().length() != 0) {
if (request.getDetailState() != null && !request.getDetailState().isEmpty()) {
url = String.format("%s&detail_state=%s", url, request.getDetailState());
}
@@ -68,7 +68,7 @@ public class BrandMerchantTransferServiceImpl implements BrandMerchantTransferSe
if (request.getNeedQueryDetail() != null) {
url = String.format("%s?need_query_detail=%b", url, request.getNeedQueryDetail());
}
if (request.getDetailState() != null && request.getDetailState().length() != 0) {
if (request.getDetailState() != null && !request.getDetailState().isEmpty()) {
url = String.format("%s&detail_state=%s", url, request.getDetailState());
}

View File

@@ -4,7 +4,6 @@ import com.github.binarywang.wxpay.bean.customs.*;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.CustomDeclarationService;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.v3.util.RsaCryptoUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import lombok.RequiredArgsConstructor;

View File

@@ -294,7 +294,7 @@ public class EcommerceServiceImpl implements EcommerceService {
@Override
public ReturnAdvanceResult refundsReturnAdvance(String subMchid, String refundId) throws WxPayException {
String url = String.format("%s/v3/ecommerce/refunds/%s/return-advance", this.payService.getPayBaseUrl(), refundId);
Map request = new HashMap();
Map<String, String> request = new HashMap<>();
request.put("sub_mchid",subMchid);
String response = this.payService.postV3(url, GSON.toJson(request));
return GSON.fromJson(response, ReturnAdvanceResult.class);
@@ -489,7 +489,7 @@ public class EcommerceServiceImpl implements EcommerceService {
public static Map<Object, Object> getObjectToMap(Object obj) {
try {
Map<Object, Object> result = new LinkedHashMap<>();
final Class<? extends Object> beanClass = obj.getClass();
final Class<?> beanClass = obj.getClass();
final BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
final PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
if (propertyDescriptors != null) {

View File

@@ -47,7 +47,7 @@ public class MerchantTransferServiceImpl implements MerchantTransferService {
if (request.getLimit() != null) {
url = String.format("%s&limit=%d", url, request.getLimit());
}
if (request.getDetailStatus() != null && request.getDetailStatus().length() != 0) {
if (request.getDetailStatus() != null && !request.getDetailStatus().isEmpty()) {
url = String.format("%s&detail_status=%s", url, request.getDetailStatus());
}
@@ -74,7 +74,7 @@ public class MerchantTransferServiceImpl implements MerchantTransferService {
if (request.getLimit() != null) {
url = String.format("%s&limit=%d", url, request.getLimit());
}
if (request.getDetailStatus() != null && request.getDetailStatus().length() != 0) {
if (request.getDetailStatus() != null && !request.getDetailStatus().isEmpty()) {
url = String.format("%s&detail_status=%s", url, request.getDetailStatus());
}

View File

@@ -87,7 +87,7 @@ public class TransferServiceImpl implements TransferService {
@Override
public TransferBillsResult transferBills(TransferBillsRequest request) throws WxPayException {
String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills", this.payService.getPayBaseUrl());
if (request.getUserName() != null && request.getUserName().length() > 0) {
if (request.getUserName() != null && !request.getUserName().isEmpty()) {
X509Certificate validCertificate = this.payService.getConfig().getVerifier().getValidCertificate();
RsaCryptoUtil.encryptFields(request, validCertificate);
}