...
|
...
|
@@ -88,14 +88,15 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public InviteSettlementItemListVO getInviteSettlementItemList(Integer uid, String month, Integer page, Integer limit) {
|
|
|
if (!ObjectUtils.allNotNull(uid, month, page, limit) || uid <= 0 || page <= 0 || limit <= 0) {
|
|
|
public InviteSettlementItemListVO getInviteSettlementItemList(Integer uid, Integer tab, String month, Integer page, Integer limit) {
|
|
|
if (!ObjectUtils.allNotNull(uid, tab, month, page, limit) || uid <= 0 || page <= 0 || limit <= 0) {
|
|
|
throwServiceException("参数不正确");
|
|
|
}
|
|
|
Pair<Integer, Integer> time = getTimeRangeOfMonth(month);
|
|
|
List<Integer> statusList = getStatusList(tab);
|
|
|
// 只查询结算规则1的记录
|
|
|
int settlementType = 1;
|
|
|
InviteSettlementItemStats stats = inviteSettlementItemMapper.selectStats(uid, settlementType, time.getLeft(), time.getRight());
|
|
|
InviteSettlementItemStats stats = inviteSettlementItemMapper.selectStats(uid, statusList, settlementType, time.getLeft(), time.getRight());
|
|
|
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();
|
...
|
...
|
@@ -112,12 +113,11 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
|
|
.totalWaitPayAmount(formatAmount("¥%s", totalWaitPayAmount));
|
|
|
if (totalElements == 0) {
|
|
|
return builder
|
|
|
|
|
|
.list(Lists.newArrayList())
|
|
|
.build();
|
|
|
}
|
|
|
int start = (page - 1) * limit;
|
|
|
List<InviteSettlementItem> list = inviteSettlementItemMapper.select(uid, settlementType, time.getLeft(), time.getRight(), start, limit);
|
|
|
List<InviteSettlementItem> list = inviteSettlementItemMapper.select(uid, statusList, settlementType, time.getLeft(), time.getRight(), start, limit);
|
|
|
Map<Integer, Integer> settlementStatusMap = buildInviteSettlementIdStatusMap(uid, list);
|
|
|
Map<Integer, String> sellerUidNickNameMap = userProxyService.getNickNameByUids(list.stream()
|
|
|
.map(InviteSettlementItem::getSellerUid)
|
...
|
...
|
@@ -143,6 +143,20 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
|
|
.build();
|
|
|
}
|
|
|
|
|
|
private List<Integer> getStatusList(Integer tab) {
|
|
|
if (tab == 0) {
|
|
|
return Lists.newArrayList(1, 3, 4);
|
|
|
}
|
|
|
if (tab == 1) {
|
|
|
return Lists.newArrayList(1, 3);
|
|
|
}
|
|
|
if (tab == 2) {
|
|
|
return Lists.newArrayList(4);
|
|
|
}
|
|
|
throwServiceException("参数不正确");
|
|
|
return Lists.newArrayList();
|
|
|
}
|
|
|
|
|
|
private Map<Integer, Integer> buildInviteSettlementIdStatusMap(Integer uid, List<InviteSettlementItem> list) {
|
|
|
val inviteSettlementIds = list.stream()
|
|
|
.map(InviteSettlementItem::getInviteSettlementId)
|
...
|
...
|
|