Authored by tanling

按首次入驻时间排序

... ... @@ -169,7 +169,6 @@ public class InviteServiceImpl implements IInviteService {
LOGGER.warn("inviter has quit, showInviteCode is {}, uid is {}", showInviteCode, uid);
throw new ServiceException(ServiceError.INVITE_CODE_INVALIDATE);
}
}
}
... ... @@ -207,8 +206,8 @@ public class InviteServiceImpl implements IInviteService {
Map<Integer, String> nickNameMap = userProxyService.getNickNameByUids(inviteeUidList);
// 批量查询入驻时间
List<StoredSeller> storedSellerList = storedSellerService.batchGetStoredSeller(inviteeUidList);
Map<Integer, Long> storedSellerMap = storedSellerList.stream().collect(Collectors.toMap(StoredSeller::getUid, StoredSeller::getEnterTime));
// List<StoredSeller> storedSellerList = storedSellerService.batchGetStoredSeller(inviteeUidList);
// Map<Integer, Long> storedSellerMap = storedSellerList.stream().collect(Collectors.toMap(StoredSeller::getUid, StoredSeller::getEnterTime));
// 批量查询订单数目
List<InviteSettlementItem> orderNumList = inviteSettlementItemMapper.selectOrderNumByInviterUid(uid);
... ... @@ -219,7 +218,7 @@ public class InviteServiceImpl implements IInviteService {
.showInviteCode(showInviteCode)
.inviteeUidNum(inviteeUidList.size())
.finishedOrderNum(orderNumMap.values().stream().collect(Collectors.summingInt(Integer::intValue)))
.inviteRecordList(getInviteRecordList(inviteRecords, storedSellerMap, orderNumMap, nickNameMap))
.inviteRecordList(getInviteRecordList(inviteRecords, orderNumMap, nickNameMap))
.build();
}
... ... @@ -229,14 +228,13 @@ public class InviteServiceImpl implements IInviteService {
}
private List<InviteInfoResp.InviteRecord> getInviteRecordList(List<InviteRecord> inviteRecords,
Map<Integer, Long> storedSellerMap,
Map<Integer, Integer> orderNumMap,
Map<Integer, String> nickNameMap) {
return inviteRecords.stream().map(x ->{
return InviteInfoResp.InviteRecord.builder()
.inviteeUid(x.getInviteeUid())
.nickName(Objects.isNull(nickNameMap.get(x.getInviteeUid())) ? "" : nickNameMap.get(x.getInviteeUid()))
.enterTime(storedSellerMap.get(x.getInviteeUid()) == null ? "" : DateUtil.formatYYMMddHHmmssPoint(storedSellerMap.get(x.getInviteeUid()).intValue()))
.enterTime(DateUtil.formatYYMMddHHmmssPoint(x.getCreateTime()))
.orderNum(Objects.isNull(orderNumMap.get(x.getInviteeUid())) ? 0 : orderNumMap.get(x.getInviteeUid()))
.build();
}).collect(Collectors.toList());
... ...