|
|
@@ -6098,19 +6098,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 今天在该店铺是否打过卡
|
|
|
// int today = (int) clockStoreList.stream().filter(item -> item.getCreatedTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().equals(LocalDate.now())).count();
|
|
|
int today = clockStoreList.stream()
|
|
|
- .anyMatch(item -> {
|
|
|
- if (item.getCreatedTime() == null) return false;
|
|
|
- Instant created = item.getCreatedTime().toInstant();
|
|
|
- Instant now = Instant.now();
|
|
|
- Duration diff = Duration.between(created, now);
|
|
|
- return diff.compareTo(Duration.ofHours(24)) > 0;
|
|
|
- })
|
|
|
- ? 1 : 0;
|
|
|
- if (today > 0) {
|
|
|
- result.setClockInStoreToday(1);
|
|
|
- } else {
|
|
|
- result.setClockInStoreToday(0);
|
|
|
- }
|
|
|
+ .filter(item -> item.getCreatedTime() != null)
|
|
|
+ .max(Comparator.comparing(StoreClockIn::getCreatedTime))
|
|
|
+ .map(item -> Duration.between(item.getCreatedTime().toInstant(), Instant.now())
|
|
|
+ .compareTo(Duration.ofHours(24)) > 0 ? 1 : 0)
|
|
|
+ .orElse(0);
|
|
|
+
|
|
|
+ result.setClockInStoreToday(today);
|
|
|
|
|
|
Integer totalCount = 0;
|
|
|
Object ratingObj = commonRatingService.getRatingCount(storeInfo.getId(), 1);
|