mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
Merge branch 'dev-new' into dev-new-rabbitmq
# Conflicts: # jsowell-admin/src/test/java/SpringBootTestController.java # jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java # jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package com.jsowell.adapay.common;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.jsowell.adapay.response.AdapayBaseResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 支付确认对象
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class PaymentConfirmInfo extends AdapayBaseResponse {
|
||||
/**
|
||||
* 返参,必填,由AdaPay生成的支付对象 ID
|
||||
*/
|
||||
@JSONField(name = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 返参,必填,支付创建时的时间戳
|
||||
*/
|
||||
@JSONField(name = "created_time")
|
||||
private String createdTime;
|
||||
|
||||
/**
|
||||
* 必填,订单号
|
||||
*/
|
||||
@JSONField(name = "order_no")
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 商户发起支付的应用id,不同的前端应用将无法使用该 Payment 对象完成支付
|
||||
*/
|
||||
@JSONField(name = "app_id")
|
||||
private String appId;
|
||||
|
||||
@JSONField(name = "confirm_amt")
|
||||
private String confirmAmt;
|
||||
|
||||
@JSONField(name = "confirmed_amt")
|
||||
private String confirmedAmt;
|
||||
|
||||
@JSONField(name = "fee_mode")
|
||||
private String feeMode;
|
||||
|
||||
private String description;
|
||||
|
||||
@JSONField(name = "reserved_amt")
|
||||
private String reservedAmt;
|
||||
|
||||
@JSONField(name = "refunded_amt")
|
||||
private String refundedAmt;
|
||||
|
||||
@JSONField(name = "fee_amt")
|
||||
private String feeAmt;
|
||||
|
||||
@JSONField(name = "error_msg")
|
||||
private String errorMsg;
|
||||
|
||||
@JSONField(name = "div_members")
|
||||
private List<DivMember> divMembers;
|
||||
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.jsowell.adapay.response;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.jsowell.adapay.common.PaymentConfirmInfo;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,12 +10,12 @@ import java.util.List;
|
||||
* 查询支付确认对象详情反参
|
||||
*/
|
||||
@Data
|
||||
public class QueryPaymentConfirmDetailResponse extends AdapayBaseResponse{
|
||||
public class QueryPaymentConfirmDetailResponse extends AdapayBaseResponse {
|
||||
@JSONField(name = "payment_id")
|
||||
private String paymentId;
|
||||
|
||||
@JSONField(name = "prod_mode")
|
||||
private String prodMode;
|
||||
// @JSONField(name = "prod_mode")
|
||||
// private String prodMode;
|
||||
|
||||
@JSONField(name = "payment_confirms")
|
||||
private List<PaymentConfirmInfo> paymentConfirms;
|
||||
@@ -29,53 +28,4 @@ public class QueryPaymentConfirmDetailResponse extends AdapayBaseResponse{
|
||||
|
||||
@JSONField(name = "object")
|
||||
private String object;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class PaymentConfirmInfo{
|
||||
/**
|
||||
* 返参,必填,由AdaPay生成的支付对象 ID
|
||||
*/
|
||||
@JSONField(name = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 返参,必填,支付创建时的时间戳
|
||||
*/
|
||||
@JSONField(name = "created_time")
|
||||
private String createdTime;
|
||||
|
||||
/**
|
||||
* 必填,订单号
|
||||
*/
|
||||
@JSONField(name = "order_no")
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 商户发起支付的应用id,不同的前端应用将无法使用该 Payment 对象完成支付
|
||||
*/
|
||||
@JSONField(name = "app_id")
|
||||
private String appId;
|
||||
|
||||
@JSONField(name = "confirm_amt")
|
||||
private String confirmAmt;
|
||||
|
||||
@JSONField(name = "confirmed_amt")
|
||||
private String confirmedAmt;
|
||||
|
||||
@JSONField(name = "fee_mode")
|
||||
private String feeMode;
|
||||
|
||||
private String description;
|
||||
|
||||
@JSONField(name = "reserved_amt")
|
||||
private String reservedAmt;
|
||||
|
||||
@JSONField(name = "refunded_amt")
|
||||
private String refundedAmt;
|
||||
|
||||
@JSONField(name = "fee_amt")
|
||||
private String feeAmt;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,10 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.huifu.adapay.model.CorpMember;
|
||||
import com.huifu.adapay.model.SettleAccount;
|
||||
import com.huifu.adapay.model.*;
|
||||
import com.jsowell.adapay.common.AdaPayment;
|
||||
import com.jsowell.adapay.common.CreateAdaPaymentParam;
|
||||
import com.jsowell.adapay.common.DivMember;
|
||||
import com.jsowell.adapay.common.RefundInfo;
|
||||
import com.jsowell.adapay.common.*;
|
||||
import com.jsowell.adapay.config.AbstractAdapayConfig;
|
||||
import com.jsowell.adapay.dto.*;
|
||||
import com.jsowell.adapay.factory.AdapayConfigFactory;
|
||||
@@ -51,7 +50,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -1236,11 +1238,11 @@ public class AdapayService {
|
||||
QueryPaymentConfirmDetailResponse response = null;
|
||||
// 查缓存
|
||||
String redisKey = CacheConstants.PAYMENT_CONFIRM_LIST + dto.getPaymentId();
|
||||
String redisResult = redisCache.getCacheObject(redisKey);
|
||||
if (StringUtils.isNotBlank(redisResult)) {
|
||||
response = JSONObject.parseObject(redisResult, QueryPaymentConfirmDetailResponse.class);
|
||||
return response;
|
||||
}
|
||||
// String redisResult = redisCache.getCacheObject(redisKey);
|
||||
// if (StringUtils.isNotBlank(redisResult)) {
|
||||
// response = JSONObject.parseObject(redisResult, QueryPaymentConfirmDetailResponse.class);
|
||||
// return response;
|
||||
// }
|
||||
|
||||
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId());
|
||||
if (config == null) {
|
||||
@@ -1254,7 +1256,7 @@ public class AdapayService {
|
||||
Map<String, Object> map = PaymentConfirm.queryList(param, config.getWechatAppId());
|
||||
response = JSON.parseObject(JSON.toJSONString(map), QueryPaymentConfirmDetailResponse.class);
|
||||
// log.info("queryPaymentConfirmDetailResponse:{}", JSON.toJSONString(queryPaymentConfirmDetailResponse));
|
||||
redisCache.setCacheObject(redisKey, JSON.toJSONString(response), CacheConstants.cache_expire_time_12h);
|
||||
redisCache.setCacheObject(redisKey, JSON.toJSONString(response), CacheConstants.cache_expire_time_10m);
|
||||
} catch (BaseAdaPayException e) {
|
||||
log.error("查询支付确认对象列表error", e);
|
||||
}
|
||||
@@ -1264,7 +1266,7 @@ public class AdapayService {
|
||||
/**
|
||||
* 查询支付确认对象详情
|
||||
*/
|
||||
public QueryPaymentConfirmDetailResponse.PaymentConfirmInfo queryPaymentConfirmDetail(QueryPaymentConfirmDTO dto) {
|
||||
public PaymentConfirmInfo queryPaymentConfirmDetail(QueryPaymentConfirmDTO dto) {
|
||||
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId());
|
||||
if (config == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR);
|
||||
@@ -1272,10 +1274,11 @@ public class AdapayService {
|
||||
Map<String, Object> confirmParams = Maps.newHashMap();
|
||||
confirmParams.put("payment_confirm_id", dto.getPaymentConfirmId());
|
||||
|
||||
QueryPaymentConfirmDetailResponse.PaymentConfirmInfo result = null;
|
||||
PaymentConfirmInfo result = null;
|
||||
try {
|
||||
Map<String, Object> paymentConfirm = PaymentConfirm.query(confirmParams, config.getWechatAppId());
|
||||
result = JSON.parseObject(JSON.toJSONString(paymentConfirm), QueryPaymentConfirmDetailResponse.PaymentConfirmInfo.class);
|
||||
log.info("查询支付确认对象详情:{}", JSON.toJSONString(paymentConfirm));
|
||||
result = JSON.parseObject(JSON.toJSONString(paymentConfirm), PaymentConfirmInfo.class);
|
||||
} catch (BaseAdaPayException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user