...
|
...
|
@@ -99,17 +99,20 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
|
|
int totalElements = Objects.isNull(stats.getTotalElements()) ? 0 : stats.getTotalElements();
|
|
|
BigDecimal totalOrderAmount = Objects.isNull(stats.getTotalOrderAmount()) ? BigDecimal.ZERO : stats.getTotalOrderAmount();
|
|
|
BigDecimal totalSettleAmount = Objects.isNull(stats.getTotalSettleAmount()) ? BigDecimal.ZERO : stats.getTotalSettleAmount();
|
|
|
BigDecimal totalPaidAmount = Objects.isNull(stats.getTotalPaidAmount()) ? BigDecimal.ZERO : stats.getTotalPaidAmount();
|
|
|
BigDecimal totalWaitPayAmount = Objects.isNull(stats.getTotalWaitPayAmount()) ? BigDecimal.ZERO : stats.getTotalWaitPayAmount();
|
|
|
InviteSettlementItemListVO.InviteSettlementItemListVOBuilder builder = InviteSettlementItemListVO.builder();
|
|
|
builder.page(page)
|
|
|
.pageSize(limit)
|
|
|
.pageTotal((totalElements % limit == 0) ? (totalElements / limit) : (totalElements / limit + 1))
|
|
|
.totalElements(totalElements)
|
|
|
.totalOrderAmount(formatAmount("¥%s", totalOrderAmount))
|
|
|
.totalSettleAmount(formatAmount("¥%s", totalSettleAmount));
|
|
|
.totalSettleAmount(formatAmount("¥%s", totalSettleAmount))
|
|
|
.totalPaidAmount(formatAmount("¥%s", totalPaidAmount))
|
|
|
.totalWaitPayAmount(formatAmount("¥%s", totalWaitPayAmount));
|
|
|
if (totalElements == 0) {
|
|
|
return builder
|
|
|
.totalPaidAmount(formatAmount("¥%s", BigDecimal.ZERO))
|
|
|
.totalWaitPayAmount(formatAmount("¥%s", BigDecimal.ZERO))
|
|
|
|
|
|
.list(Lists.newArrayList())
|
|
|
.build();
|
|
|
}
|
...
|
...
|
@@ -128,14 +131,6 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
|
|
};
|
|
|
|
|
|
return builder
|
|
|
.totalPaidAmount(formatAmount("¥%s", list.stream()
|
|
|
.filter(itemHasPaid)
|
|
|
.map(InviteSettlementItem::getSettleAmount)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add)))
|
|
|
.totalWaitPayAmount(formatAmount("¥%s", list.stream()
|
|
|
.filter(itemHasPaid.negate())
|
|
|
.map(InviteSettlementItem::getSettleAmount)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add)))
|
|
|
.list(list.stream()
|
|
|
.map(item -> new InviteSettlementItemListVO.InviteSettlementItemVO()
|
|
|
.setBuyerOrderCode(item.getBuyerOrderCode().toString())
|
...
|
...
|
|