mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-24 00:59:43 +08:00
update 订单逻辑改造工厂模式
This commit is contained in:
@@ -521,22 +521,14 @@ public class DelayMerchantOrderLogic extends AbstractOrderLogic {
|
|||||||
BigDecimal deductionAmount = vo.getDeductionAmount();
|
BigDecimal deductionAmount = vo.getDeductionAmount();
|
||||||
|
|
||||||
// 调汇付的交易撤销接口
|
// 调汇付的交易撤销接口
|
||||||
// PaymentReverseResponse paymentReverseRequest = adapayService.createPaymentReverseRequest(paymentId, deductionAmount, dto.getWechatAppId(),
|
PaymentReverseResponse request = adapayService.createPaymentReverseRequest(paymentId, deductionAmount,
|
||||||
// dto.getMemberId(), ScenarioEnum.BALANCE.getValue(), null);
|
dto.getWechatAppId(), dto.getMemberId(), ScenarioEnum.BALANCE.getValue(), null);
|
||||||
|
|
||||||
PaymentReverseOperation operation = new PaymentReverseOperation();
|
if (request != null && request.isNotFailed()) {
|
||||||
operation.setPaymentId(paymentId);
|
|
||||||
operation.setReverseAmt(deductionAmount);
|
|
||||||
operation.setMerchantKey(dto.getWechatAppId());
|
|
||||||
operation.setMemberId(dto.getMemberId());
|
|
||||||
operation.setScenarioType(ScenarioEnum.BALANCE.getValue());
|
|
||||||
PaymentReverseResponse paymentReverseRequest = adapayService.createPaymentReverseRequest(operation);
|
|
||||||
|
|
||||||
if (paymentReverseRequest != null && paymentReverseRequest.isNotFailed()) {
|
|
||||||
memberAdapayRecordService.updateRefundAmount(paymentId, deductionAmount);
|
memberAdapayRecordService.updateRefundAmount(paymentId, deductionAmount);
|
||||||
|
|
||||||
// 放缓存
|
// 放缓存
|
||||||
redisCache.setCacheObject(redisKey, paymentReverseRequest, CacheConstants.cache_expire_time_30m);
|
redisCache.setCacheObject(redisKey, request, CacheConstants.cache_expire_time_30m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -493,14 +493,14 @@ public class NotDelayMerchantOrderLogic extends AbstractOrderLogic{
|
|||||||
BigDecimal deductionAmount = vo.getDeductionAmount();
|
BigDecimal deductionAmount = vo.getDeductionAmount();
|
||||||
|
|
||||||
// 调汇付的交易退款接口
|
// 调汇付的交易退款接口
|
||||||
RefundResponse refundRequest = adapayService.createRefundRequest(paymentId, refundAmount,
|
RefundResponse response = adapayService.createRefundRequest(paymentId, refundAmount,
|
||||||
dto.getWechatAppId(), dto.getMemberId(), ScenarioEnum.ORDER.getValue(), dto.getOrderCode());
|
dto.getWechatAppId(), dto.getMemberId(), ScenarioEnum.ORDER.getValue(), dto.getOrderCode());
|
||||||
|
|
||||||
if (refundRequest != null && refundRequest.isNotFailed()) {
|
if (response != null && response.isNotFailed()) {
|
||||||
memberAdapayRecordService.updateRefundAmount(paymentId, deductionAmount);
|
memberAdapayRecordService.updateRefundAmount(paymentId, deductionAmount);
|
||||||
|
|
||||||
// 放缓存
|
// 放缓存
|
||||||
redisCache.setCacheObject(redisKey, refundRequest, CacheConstants.cache_expire_time_30m);
|
redisCache.setCacheObject(redisKey, response, CacheConstants.cache_expire_time_30m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user