|
@@ -568,7 +568,39 @@ public class PayCallService extends SuperService {
|
|
|
refundRecord.setPaymentType(entity.getPaymentType());
|
|
refundRecord.setPaymentType(entity.getPaymentType());
|
|
|
|
|
|
|
|
if (resultContent.isSuccess()) {
|
|
if (resultContent.isSuccess()) {
|
|
|
- entity.setIsRefund(Boolean.FALSE);
|
|
|
|
|
|
|
+ UnionFrictionlessPayFinishModel model = resultContent.getContent();
|
|
|
|
|
+ String refundStatus = "PROCESSING";
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(model)) {
|
|
|
|
|
+ refundStatus = model.getRefundStatus();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ("SUCCESS".equals(refundStatus)) {
|
|
|
|
|
+ // 成功
|
|
|
|
|
+ entity.setIsRefund(Boolean.TRUE);
|
|
|
|
|
+ entity.setRefundState(RefundState.Refunded);
|
|
|
|
|
+ entity.setRefuseRemark("退款成功");
|
|
|
|
|
+ entity.setOrderType(OrderState.REFUNDED);
|
|
|
|
|
+
|
|
|
|
|
+ refundRecord.setRefuseRemark("退款成功");
|
|
|
|
|
+ refundRecord.setRefundState(RefundState.Refunded);
|
|
|
|
|
+ } else if ("PROCESSING".equals(refundStatus)) {
|
|
|
|
|
+ // 进行中
|
|
|
|
|
+ entity.setIsRefund(Boolean.FALSE);
|
|
|
|
|
+ entity.setRefundState(RefundState.Refunding);
|
|
|
|
|
+ entity.setRefuseRemark("退款中");
|
|
|
|
|
+
|
|
|
|
|
+ refundRecord.setRefuseRemark("退款中");
|
|
|
|
|
+ refundRecord.setRefundState(RefundState.Refunding);
|
|
|
|
|
+ } else if ("FAIL".equals(refundStatus)) {
|
|
|
|
|
+ // 失败
|
|
|
|
|
+ entity.setIsRefund(Boolean.FALSE);
|
|
|
|
|
+ entity.setRefundState(RefundState.Fail);
|
|
|
|
|
+ entity.setRefuseRemark("退款失败");
|
|
|
|
|
+
|
|
|
|
|
+ refundRecord.setRefuseRemark("退款失败");
|
|
|
|
|
+ refundRecord.setRefundState(RefundState.Fail);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
entity.setRefundRemark(param.getRemark());
|
|
entity.setRefundRemark(param.getRemark());
|
|
|
entity.setRefundTime(System.currentTimeMillis());
|
|
entity.setRefundTime(System.currentTimeMillis());
|
|
|
// 申请人
|
|
// 申请人
|
|
@@ -577,17 +609,13 @@ public class PayCallService extends SuperService {
|
|
|
entity.setRefundUserId(getCurrentUserId());
|
|
entity.setRefundUserId(getCurrentUserId());
|
|
|
// 退款金额
|
|
// 退款金额
|
|
|
entity.setRefundAMount(payAmount);
|
|
entity.setRefundAMount(payAmount);
|
|
|
- // 退款状态
|
|
|
|
|
- entity.setRefundState(RefundState.Refunding);
|
|
|
|
|
- entity.setRefuseRemark("退款中");
|
|
|
|
|
expenseFlowDao.save(entity);
|
|
expenseFlowDao.save(entity);
|
|
|
|
|
|
|
|
// 保存退款记录
|
|
// 保存退款记录
|
|
|
refundRecord.setRefundUserId(getCurrentUserId());
|
|
refundRecord.setRefundUserId(getCurrentUserId());
|
|
|
refundRecord.setExamineTime(System.currentTimeMillis());
|
|
refundRecord.setExamineTime(System.currentTimeMillis());
|
|
|
- refundRecord.setRefuseRemark("退款中");
|
|
|
|
|
- refundRecord.setRefundState(RefundState.Refunding);
|
|
|
|
|
refundRecordService.saveEntity(refundRecord);
|
|
refundRecordService.saveEntity(refundRecord);
|
|
|
|
|
+
|
|
|
return ResultContent.buildSuccess(resultContent.getContent());
|
|
return ResultContent.buildSuccess(resultContent.getContent());
|
|
|
} else {
|
|
} else {
|
|
|
// 失败
|
|
// 失败
|