debug:退款
This commit is contained in:
parent
59d743e7d4
commit
4d958866db
|
@ -36,4 +36,7 @@ public class BillRefundDTO {
|
||||||
|
|
||||||
@ApiModelProperty("退款操作人ID")
|
@ApiModelProperty("退款操作人ID")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("校验是否完成")
|
||||||
|
private Boolean checkFinish;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1240,6 +1240,7 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
|
||||||
refundDto.setBillId(order.getBillId());
|
refundDto.setBillId(order.getBillId());
|
||||||
refundDto.setRefundAmount(refundAmount);
|
refundDto.setRefundAmount(refundAmount);
|
||||||
refundDto.setRefundReason(String.format("充值订单%s智能退款%s元", order.getBillNo(), refundAmount));
|
refundDto.setRefundReason(String.format("充值订单%s智能退款%s元", order.getBillNo(), refundAmount));
|
||||||
|
refundDto.setCheckFinish(false);
|
||||||
int refund = this.refund(refundDto);
|
int refund = this.refund(refundDto);
|
||||||
ServiceUtil.assertion(refund != 1, "申请退款失败");
|
ServiceUtil.assertion(refund != 1, "申请退款失败");
|
||||||
}, 10, TimeUnit.SECONDS);
|
}, 10, TimeUnit.SECONDS);
|
||||||
|
@ -1770,7 +1771,10 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
|
||||||
ServiceUtil.assertion(bill == null, "待退款的订单不存在");
|
ServiceUtil.assertion(bill == null, "待退款的订单不存在");
|
||||||
ServiceUtil.assertion(dto.getRefundAmount().compareTo(bill.getMoney()) > 0, "退款金额不允许大于订单金额");
|
ServiceUtil.assertion(dto.getRefundAmount().compareTo(bill.getMoney()) > 0, "退款金额不允许大于订单金额");
|
||||||
ServiceUtil.assertion(!TransactionBillStatus.SUCCESS.getStatus().equals(bill.getStatus()), "当前订单状态不允许退款");
|
ServiceUtil.assertion(!TransactionBillStatus.SUCCESS.getStatus().equals(bill.getStatus()), "当前订单状态不允许退款");
|
||||||
ServiceUtil.assertion(bill.getIsFinished() == null || !bill.getIsFinished(), "当前订单未完成,不允许退款");
|
|
||||||
|
if (dto.getCheckFinish() != null && dto.getCheckFinish()) {
|
||||||
|
ServiceUtil.assertion(bill.getIsFinished() == null || !bill.getIsFinished(), "当前订单未完成,不允许退款");
|
||||||
|
}
|
||||||
|
|
||||||
// 拼接分成列表
|
// 拼接分成列表
|
||||||
transactionAssembler.assembleBonusList(bill);
|
transactionAssembler.assembleBonusList(bill);
|
||||||
|
@ -1784,7 +1788,9 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
|
||||||
TransactionBillQuery billQuery = new TransactionBillQuery();
|
TransactionBillQuery billQuery = new TransactionBillQuery();
|
||||||
billQuery.setBillId(dto.getBillId());
|
billQuery.setBillId(dto.getBillId());
|
||||||
billQuery.setStatus(TransactionBillStatus.SUCCESS.getStatus());
|
billQuery.setStatus(TransactionBillStatus.SUCCESS.getStatus());
|
||||||
billQuery.setIsFinished(true);
|
if (dto.getCheckFinish() != null && dto.getCheckFinish()) {
|
||||||
|
billQuery.setIsFinished(true);
|
||||||
|
}
|
||||||
int updateBill = this.updateByQuery(data, billQuery);
|
int updateBill = this.updateByQuery(data, billQuery);
|
||||||
ServiceUtil.assertion(updateBill != 1, "退款时修改订单状态失败,订单状态已发生改变,请刷新后重试");
|
ServiceUtil.assertion(updateBill != 1, "退款时修改订单状态失败,订单状态已发生改变,请刷新后重试");
|
||||||
|
|
||||||
|
|
|
@ -281,6 +281,7 @@ public class AppTransactionBillController extends BaseController
|
||||||
dto.setUserType(loginUser.getLoginType().getType());
|
dto.setUserType(loginUser.getLoginType().getType());
|
||||||
dto.setUserId(getUserId());
|
dto.setUserId(getUserId());
|
||||||
dto.setRefundReason(String.format("充值订单退款:%s", bill.getBillNo()));
|
dto.setRefundReason(String.format("充值订单退款:%s", bill.getBillNo()));
|
||||||
|
dto.setCheckFinish(true);
|
||||||
return toAjax(transactionBillService.refund(dto));
|
return toAjax(transactionBillService.refund(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,7 @@ public class SmTransactionBillController extends BaseController
|
||||||
dto.setUserType(loginUser.getLoginType().getType());
|
dto.setUserType(loginUser.getLoginType().getType());
|
||||||
dto.setUserId(getUserId());
|
dto.setUserId(getUserId());
|
||||||
dto.setRefundReason(String.format("充值订单退款:%s", bill.getBillNo()));
|
dto.setRefundReason(String.format("充值订单退款:%s", bill.getBillNo()));
|
||||||
|
dto.setCheckFinish(true);
|
||||||
return toAjax(transactionBillService.refund(dto));
|
return toAjax(transactionBillService.refund(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user