|
@@ -99,17 +99,20 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
|
@@ -99,17 +99,20 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
99
|
int totalElements = Objects.isNull(stats.getTotalElements()) ? 0 : stats.getTotalElements();
|
99
|
int totalElements = Objects.isNull(stats.getTotalElements()) ? 0 : stats.getTotalElements();
|
100
|
BigDecimal totalOrderAmount = Objects.isNull(stats.getTotalOrderAmount()) ? BigDecimal.ZERO : stats.getTotalOrderAmount();
|
100
|
BigDecimal totalOrderAmount = Objects.isNull(stats.getTotalOrderAmount()) ? BigDecimal.ZERO : stats.getTotalOrderAmount();
|
101
|
BigDecimal totalSettleAmount = Objects.isNull(stats.getTotalSettleAmount()) ? BigDecimal.ZERO : stats.getTotalSettleAmount();
|
101
|
BigDecimal totalSettleAmount = Objects.isNull(stats.getTotalSettleAmount()) ? BigDecimal.ZERO : stats.getTotalSettleAmount();
|
|
|
102
|
+ BigDecimal totalPaidAmount = Objects.isNull(stats.getTotalPaidAmount()) ? BigDecimal.ZERO : stats.getTotalPaidAmount();
|
|
|
103
|
+ BigDecimal totalWaitPayAmount = Objects.isNull(stats.getTotalWaitPayAmount()) ? BigDecimal.ZERO : stats.getTotalWaitPayAmount();
|
102
|
InviteSettlementItemListVO.InviteSettlementItemListVOBuilder builder = InviteSettlementItemListVO.builder();
|
104
|
InviteSettlementItemListVO.InviteSettlementItemListVOBuilder builder = InviteSettlementItemListVO.builder();
|
103
|
builder.page(page)
|
105
|
builder.page(page)
|
104
|
.pageSize(limit)
|
106
|
.pageSize(limit)
|
105
|
.pageTotal((totalElements % limit == 0) ? (totalElements / limit) : (totalElements / limit + 1))
|
107
|
.pageTotal((totalElements % limit == 0) ? (totalElements / limit) : (totalElements / limit + 1))
|
106
|
.totalElements(totalElements)
|
108
|
.totalElements(totalElements)
|
107
|
.totalOrderAmount(formatAmount("¥%s", totalOrderAmount))
|
109
|
.totalOrderAmount(formatAmount("¥%s", totalOrderAmount))
|
108
|
- .totalSettleAmount(formatAmount("¥%s", totalSettleAmount));
|
110
|
+ .totalSettleAmount(formatAmount("¥%s", totalSettleAmount))
|
|
|
111
|
+ .totalPaidAmount(formatAmount("¥%s", totalPaidAmount))
|
|
|
112
|
+ .totalWaitPayAmount(formatAmount("¥%s", totalWaitPayAmount));
|
109
|
if (totalElements == 0) {
|
113
|
if (totalElements == 0) {
|
110
|
return builder
|
114
|
return builder
|
111
|
- .totalPaidAmount(formatAmount("¥%s", BigDecimal.ZERO))
|
|
|
112
|
- .totalWaitPayAmount(formatAmount("¥%s", BigDecimal.ZERO))
|
115
|
+
|
113
|
.list(Lists.newArrayList())
|
116
|
.list(Lists.newArrayList())
|
114
|
.build();
|
117
|
.build();
|
115
|
}
|
118
|
}
|
|
@@ -128,14 +131,6 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
|
@@ -128,14 +131,6 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
128
|
};
|
131
|
};
|
129
|
|
132
|
|
130
|
return builder
|
133
|
return builder
|
131
|
- .totalPaidAmount(formatAmount("¥%s", list.stream()
|
|
|
132
|
- .filter(itemHasPaid)
|
|
|
133
|
- .map(InviteSettlementItem::getSettleAmount)
|
|
|
134
|
- .reduce(BigDecimal.ZERO, BigDecimal::add)))
|
|
|
135
|
- .totalWaitPayAmount(formatAmount("¥%s", list.stream()
|
|
|
136
|
- .filter(itemHasPaid.negate())
|
|
|
137
|
- .map(InviteSettlementItem::getSettleAmount)
|
|
|
138
|
- .reduce(BigDecimal.ZERO, BigDecimal::add)))
|
|
|
139
|
.list(list.stream()
|
134
|
.list(list.stream()
|
140
|
.map(item -> new InviteSettlementItemListVO.InviteSettlementItemVO()
|
135
|
.map(item -> new InviteSettlementItemListVO.InviteSettlementItemVO()
|
141
|
.setBuyerOrderCode(item.getBuyerOrderCode().toString())
|
136
|
.setBuyerOrderCode(item.getBuyerOrderCode().toString())
|