vip赠送记录过滤当日的数据
This commit is contained in:
parent
62baa3a458
commit
efeeca6d05
@ -30,6 +30,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -105,9 +107,22 @@ public class CheckInServiceImpl implements CheckInService {
|
|||||||
ResultResponse<List<WalletGoldAssetRecordDTO>> response =
|
ResultResponse<List<WalletGoldAssetRecordDTO>> response =
|
||||||
walletGoldClient.getLatestVipGiveawayRecords(userId, limit);
|
walletGoldClient.getLatestVipGiveawayRecords(userId, limit);
|
||||||
|
|
||||||
List<WalletGoldAssetRecordDTO> records = ResponseAssert.requiredSuccess(response);
|
List<WalletGoldAssetRecordDTO> body = response.getBody();
|
||||||
|
if (CollectionUtils.isEmpty(body)) {
|
||||||
|
return CollectionUtils.newArrayList();
|
||||||
|
}
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(records)) {
|
// 过滤出 createTime 是当天的记录
|
||||||
|
List<WalletGoldAssetRecordDTO> records = body.stream()
|
||||||
|
.filter(record -> {
|
||||||
|
if (record.getCreateTime() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
LocalDateTime createDateTime = record.getCreateTime().toLocalDateTime();
|
||||||
|
return createDateTime.toLocalDate().equals(LocalDate.now());
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
|
if (CollectionUtils.isEmpty(body)) {
|
||||||
return CollectionUtils.newArrayList();
|
return CollectionUtils.newArrayList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user