This commit is contained in:
2023-08-23 16:46:07 +08:00
parent c5a8b808c6
commit 2b6ded7b75
4 changed files with 9 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import com.jsowell.adapay.response.PaymentReverseResponse;
import com.jsowell.adapay.vo.OrderSettleResult;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.pile.domain.AdapayMemberAccount;
import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.domain.OrderDetail;

View File

@@ -2369,10 +2369,10 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
}
@Override
public void refundBalanceWithAdapay(ApplyRefundDTO dto) {
public void refundBalanceWithAdapay(ApplyRefundDTO dto){
String redisKey = CacheConstants.MEMBER_BALANCE_REFUNDS_ARE_IN_PROGRESS + dto.getMemberId();
String redisResult = redisCache.getCacheObject(redisKey);
if (StringUtils.isNotBlank(redisResult)) {
PaymentReverseResponse redisResult = redisCache.getCacheObject(redisKey);
if (Objects.nonNull(redisResult)) {
throw new BusinessException(ReturnCodeEnum.CODE_BALANCE_REFUNDS_ARE_IN_PROGRESS_ERROR);
}
@@ -2389,6 +2389,9 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
throw new BusinessException(ReturnCodeEnum.CODE_REFUND_MEMBER_BALANCE_ERROR);
}
// 模拟放缓存
redisCache.setCacheObject(redisKey, new PaymentConfirmResponse(), CacheConstants.cache_expire_time_30m);
// 查询用户充值余额订单 过滤掉已经退款的充值订单
List<BalanceDeductionAmountVO> list = calculateTheBalanceDeductionAmount(dto.getMemberId(), refundAmount);
for (BalanceDeductionAmountVO vo : list) {