ouyang 3 лет назад
Родитель
Сommit
a2b8eac944

+ 2 - 2
src/main/java/com/izouma/nineth/repo/CollectionRepo.java

@@ -162,8 +162,8 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
 
 
     //筛选
-    @Query(value = "select c.id, c.asset_id, c.stock, c.start_time, c.end_time, c.publish_time, c.purchase_time from collection_info c where c.end_time <= ?1 and c.end_time < ?2", nativeQuery = true)
-    List<Collection> selectScreen(LocalDateTime startTime, LocalDateTime endTime);
+//    @Query(value = "select c.id, c.asset_id, c.stock, c.start_time, c.end_time, c.publish_time, c.purchase_time from collection_info c where c.end_time <= ?1 and c.end_time < ?2", nativeQuery = true)
+    List<Collection> findAllByEndTimeLessThanEqualAndEndTimeLessThan(LocalDateTime startTime, LocalDateTime endTime);
 
     @Transactional
     @Modifying

+ 2 - 2
src/main/java/com/izouma/nineth/service/scheduledTask/SubscribeTask.java

@@ -31,10 +31,10 @@ public class SubscribeTask {
 
     @Scheduled(cron = "0/30 * * * * ? ")
     public void subscriberTask(){
-        ArrayList<Subscribe> subscribes = new ArrayList<>();
+       ArrayList<Subscribe> subscribes = new ArrayList<>();
         LocalDateTime startTime = LocalDateTime.now();
         LocalDateTime endTime = LocalDateTime.now().plusMinutes(1);
-        List<Collection> collectionList = collectionRepo.findAllByEndTimeLessThanEqualAndPublishTimeGreaterThanEqual(startTime,endTime);
+        List<Collection> collectionList = collectionRepo.findAllByEndTimeLessThanEqualAndEndTimeLessThan(startTime,endTime);
         if (Collections.isEmpty(collectionList)){
             log.error("该时间段中并无藏品筛选");
             return;