|
|
@@ -2526,18 +2526,19 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
private OrderRefundDto getYoutubeRefundInfo(GroupsRelationView relationView, OrderDon orderDon, GoodsDonSku sku) {
|
|
|
OrderRefundDto orderRefundDto = new OrderRefundDto();
|
|
|
Date expiryTime = relationView.getExpiryTime();
|
|
|
+ DateTime now = DateTime.now();
|
|
|
if (relationView.getIsFrozen()) {
|
|
|
- expiryTime = DateUtil.offsetDay(DateTime.now(), relationView.getReservedDays());
|
|
|
+ expiryTime = DateUtil.offsetDay(now, relationView.getReservedDays());
|
|
|
}
|
|
|
if (expiryTime == null) {
|
|
|
if (sku.getDays() != null) {
|
|
|
- expiryTime = DateUtil.offsetDay(DateTime.now(), sku.getDays());
|
|
|
+ expiryTime = DateUtil.offsetDay(now, sku.getDays());
|
|
|
} else {
|
|
|
- expiryTime = DateUtil.offsetMonth(DateTime.now(), sku.getMonths());
|
|
|
+ expiryTime = DateUtil.offsetMonth(now, sku.getMonths());
|
|
|
}
|
|
|
}
|
|
|
//剩余几个月
|
|
|
- Long remainMonths = DateUtil.betweenMonth(DateTime.now(), expiryTime, false) + 1;
|
|
|
+ Long remainMonths = DateUtil.betweenMonth(now, expiryTime, false) + 1;
|
|
|
BigDecimal refundBalance = BigDecimal.ZERO;
|
|
|
BigDecimal refundMoney = BigDecimal.ZERO;
|
|
|
//订单金额
|
|
|
@@ -2551,10 +2552,10 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
if (orderTotalMoney.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
orderTotalMoney = sku.getPrice();
|
|
|
}
|
|
|
- refundMoney = orderTotalMoney.divide(BigDecimal.valueOf(2), RoundingMode.DOWN);
|
|
|
if (money.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
refundBalance = refundBalance.add(refundMoney);
|
|
|
} else {
|
|
|
+ refundMoney = orderTotalMoney.divide(BigDecimal.valueOf(2), RoundingMode.DOWN);
|
|
|
if (refundMoney.compareTo(money) > 0) {
|
|
|
refundMoney = money;
|
|
|
refundBalance = refundMoney.subtract(money);
|