|
|
@@ -22,6 +22,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.RandomUtils;
|
|
|
import org.apache.commons.lang3.Range;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.rocketmq.client.consumer.LitePullConsumer;
|
|
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
@@ -297,7 +298,8 @@ public class CollectionService {
|
|
|
collection.setLiked(likes.stream().anyMatch(l -> l.getCollectionId().equals(collection.getId())));
|
|
|
}
|
|
|
if (!appointments.isEmpty()) {
|
|
|
- collection.setAppointment(appointments.stream().anyMatch(a -> a.getBlindBoxId().equals(collection.getId())));
|
|
|
+ collection.setAppointment(appointments.stream()
|
|
|
+ .anyMatch(a -> a.getBlindBoxId().equals(collection.getId())));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -619,4 +621,32 @@ public class CollectionService {
|
|
|
|
|
|
return dtos;
|
|
|
}
|
|
|
+
|
|
|
+ public List<Collection> setOasisScancode(List<Long> oasisIds) {
|
|
|
+ List<Collection> collections = collectionRepo
|
|
|
+ .findAllByOasisIdInAndSourceAndSaleLessThan(oasisIds, CollectionSource.COMPANY, 1);
|
|
|
+ List<Collection> result = new ArrayList<>();
|
|
|
+ collections.forEach(collection -> {
|
|
|
+ collection.setOnShelf(false);
|
|
|
+ collection.setScanCode(true);
|
|
|
+ collection.setSalable(true);
|
|
|
+ collectionRepo.save(collection);
|
|
|
+ result.add(collection);
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<Collection> setOasisOnShelf(List<Long> oasisIds) {
|
|
|
+ List<Collection> collections = collectionRepo
|
|
|
+ .findAllByOasisIdInAndSourceAndSaleLessThan(oasisIds, CollectionSource.COMPANY, 1);
|
|
|
+ List<Collection> result = new ArrayList<>();
|
|
|
+ collections.forEach(collection -> {
|
|
|
+ collection.setOnShelf(true);
|
|
|
+ collection.setScanCode(false);
|
|
|
+ collection.setSalable(true);
|
|
|
+ collectionRepo.save(collection);
|
|
|
+ result.add(collection);
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|