mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update
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;
|
||||
|
||||
@@ -1225,11 +1227,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) {
|
||||
@@ -1243,7 +1245,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);
|
||||
}
|
||||
@@ -1253,7 +1255,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);
|
||||
@@ -1261,10 +1263,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);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.jsowell.adapay.common.DivMember;
|
||||
import com.jsowell.adapay.common.PaymentConfirmInfo;
|
||||
import com.jsowell.adapay.dto.QueryConfirmReverseDTO;
|
||||
import com.jsowell.adapay.dto.QueryPaymentConfirmDTO;
|
||||
import com.jsowell.adapay.operation.PaymentReverseOperation;
|
||||
@@ -52,7 +53,9 @@ import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
||||
import com.jsowell.pile.transaction.service.TransactionService;
|
||||
import com.jsowell.pile.util.UserUtils;
|
||||
import com.jsowell.pile.vo.SupStationStatsVO;
|
||||
import com.jsowell.pile.vo.base.*;
|
||||
import com.jsowell.pile.vo.base.MerchantOrderInfoVO;
|
||||
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||
import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
||||
import com.jsowell.pile.vo.nanrui.JiangSuOrderInfoVO;
|
||||
@@ -1583,9 +1586,9 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
dto.setWechatAppId(wechatAppId);
|
||||
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
||||
if (response != null) {
|
||||
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> confirms = response.getPaymentConfirms();
|
||||
List<PaymentConfirmInfo> confirms = response.getPaymentConfirms();
|
||||
if (CollectionUtils.isNotEmpty(confirms)) {
|
||||
for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirm : confirms) {
|
||||
for (PaymentConfirmInfo confirm : confirms) {
|
||||
// 校验分账是否撤销
|
||||
if (queryConfirmReverseStatus(confirm.getId(), wechatAppId)) {
|
||||
logger.info("支付确认id:" + confirm.getId() + "撤销了。。。");
|
||||
@@ -3371,7 +3374,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
// dto.setPaymentId(record.getPaymentId());
|
||||
// QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(dto);
|
||||
// if (response != null && CollectionUtils.isNotEmpty(response.getPaymentConfirms())) {
|
||||
// for (QueryPaymentConfirmDetailResponse.PaymentConfirmInfo paymentConfirm : response.getPaymentConfirms()) {
|
||||
// for (PaymentConfirmInfo paymentConfirm : response.getPaymentConfirms()) {
|
||||
// JSONObject jsonObject = JSON.parseObject(paymentConfirm.getDescription());
|
||||
// if (StringUtils.equals(jsonObject.getString("orderCode"), orderCode)) {
|
||||
// // 订单号对的上,累计分账金额
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jsowell.adapay.common.PaymentConfirmInfo;
|
||||
import com.jsowell.adapay.dto.QueryPaymentConfirmDTO;
|
||||
import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse;
|
||||
import com.jsowell.adapay.service.AdapayService;
|
||||
@@ -126,7 +127,7 @@ public class SettleOrderReportServiceImpl implements SettleOrderReportService {
|
||||
.paymentId(paymentId)
|
||||
.build();
|
||||
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(build);
|
||||
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> paymentConfirms = response.getPaymentConfirms();
|
||||
List<PaymentConfirmInfo> paymentConfirms = response.getPaymentConfirms();
|
||||
// 如果没有分账信息,说明没有清分
|
||||
String clearingStatus = null;
|
||||
if (CollectionUtils.isEmpty(paymentConfirms)) {
|
||||
@@ -548,7 +549,7 @@ public class SettleOrderReportServiceImpl implements SettleOrderReportService {
|
||||
.paymentId(paymentId)
|
||||
.build();
|
||||
QueryPaymentConfirmDetailResponse response = adapayService.queryPaymentConfirmList(build);
|
||||
List<QueryPaymentConfirmDetailResponse.PaymentConfirmInfo> paymentConfirms = response.getPaymentConfirms();
|
||||
List<PaymentConfirmInfo> paymentConfirms = response.getPaymentConfirms();
|
||||
if (!CollectionUtils.isEmpty(paymentConfirms)) {
|
||||
clearingBillVO.setConfirmInfo(paymentConfirms.get(0));
|
||||
clearingList.add(clearingBillVO);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.jsowell.pile.vo.web;
|
||||
|
||||
import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse;
|
||||
import com.jsowell.adapay.common.PaymentConfirmInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -37,5 +37,5 @@ public class ClearingBillVO {
|
||||
*/
|
||||
private String withdrawStatus;
|
||||
|
||||
private QueryPaymentConfirmDetailResponse.PaymentConfirmInfo confirmInfo;
|
||||
private PaymentConfirmInfo confirmInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user