mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 订单逻辑改造工厂模式
This commit is contained in:
@@ -521,22 +521,14 @@ public class DelayMerchantOrderLogic extends AbstractOrderLogic {
|
||||
BigDecimal deductionAmount = vo.getDeductionAmount();
|
||||
|
||||
// 调汇付的交易撤销接口
|
||||
// PaymentReverseResponse paymentReverseRequest = adapayService.createPaymentReverseRequest(paymentId, deductionAmount, dto.getWechatAppId(),
|
||||
// dto.getMemberId(), ScenarioEnum.BALANCE.getValue(), null);
|
||||
PaymentReverseResponse request = adapayService.createPaymentReverseRequest(paymentId, deductionAmount,
|
||||
dto.getWechatAppId(), dto.getMemberId(), ScenarioEnum.BALANCE.getValue(), null);
|
||||
|
||||
PaymentReverseOperation operation = new PaymentReverseOperation();
|
||||
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()) {
|
||||
if (request != null && request.isNotFailed()) {
|
||||
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();
|
||||
|
||||
// 调汇付的交易退款接口
|
||||
RefundResponse refundRequest = adapayService.createRefundRequest(paymentId, refundAmount,
|
||||
RefundResponse response = adapayService.createRefundRequest(paymentId, refundAmount,
|
||||
dto.getWechatAppId(), dto.getMemberId(), ScenarioEnum.ORDER.getValue(), dto.getOrderCode());
|
||||
|
||||
if (refundRequest != null && refundRequest.isNotFailed()) {
|
||||
if (response != null && response.isNotFailed()) {
|
||||
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