Przeglądaj źródła

Merge branch 'dev' of xiongzhu/raex_back into master

xubinhui 2 lat temu
rodzic
commit
076069266d

+ 34 - 41
src/main/java/com/izouma/nineth/config/RiceScheduledTasksConfig.java

@@ -21,53 +21,46 @@ public class RiceScheduledTasksConfig {
     @Autowired
     private RiceInviteRepo riceInviteRepo;
 
+
+
+//    //@Scheduled(cron = "0 * * * * ?")
+//    @Scheduled(cron = "0 0 0 * * ?")
+//    public void resetExchangeCount() {
+//        List<Rice> riceList = riceRepo.findAll();
+//        for (Rice rice : riceList) {
+//            rice.setExchangeCount(0);
+//        }
+//        riceRepo.saveAll(riceList);
+//    }
+//
+//
 //    @Scheduled(cron = "0 0 0 * * ?")
-//    public void InviteExchangeCount() {
+//    public void resetInviteCount() {
 //        List<Rice> riceList = riceRepo.findAll();
 //        for (Rice rice : riceList) {
 //            rice.setInviteCount(0);
 //        }
 //        riceRepo.saveAll(riceList);
 //    }
-
-    @Scheduled(cron = "0 0 0 * * ?")
-    public void resetExchangeCount() {
-        List<Rice> riceList = riceRepo.findAll();
-        for (Rice rice : riceList) {
-            rice.setExchangeCount(0);
-        }
-        riceRepo.saveAll(riceList);
-    }
-
-
-    @Scheduled(cron = "0 0 0 * * ?")
-    public void resetInviteCount() {
-        List<Rice> riceList = riceRepo.findAll();
-        for (Rice rice : riceList) {
-            rice.setInviteCount(0);
-        }
-        riceRepo.saveAll(riceList);
-    }
-
-
-
-    // @Scheduled(cron = "0 * * * * ?")
-    @Scheduled(cron = "0 0 0 * * ?")
-    public void resetHelpCount() {
-        List<Rice> riceList = riceRepo.findAll();
-        for (Rice rice : riceList) {
-            rice.setHelpCount(0L);
-        }
-        riceRepo.saveAll(riceList);
-    }
-
-    @Scheduled(cron = "0 0 0 * * ?")
-    public void resetEarnPointsEveryDay() {
-        List<Rice> riceList = riceRepo.findAll();
-        for (Rice rice : riceList) {
-            rice.setEarnPointsEveryDay(0L);
-        }
-        riceRepo.saveAll(riceList);
-    }
+//
+//
+//
+//    @Scheduled(cron = "0 0 0 * * ?")
+//    public void resetHelpCount() {
+//        List<Rice> riceList = riceRepo.findAll();
+//        for (Rice rice : riceList) {
+//            rice.setHelpCount(0L);
+//        }
+//        riceRepo.saveAll(riceList);
+//    }
+//
+//    @Scheduled(cron = "0 0 0 * * ?")
+//    public void resetEarnPointsEveryDay() {
+//        List<Rice> riceList = riceRepo.findAll();
+//        for (Rice rice : riceList) {
+//            rice.setEarnPointsEveryDay(0L);
+//        }
+//        riceRepo.saveAll(riceList);
+//    }
 
 }

+ 13 - 0
src/main/java/com/izouma/nineth/domain/Rice.java

@@ -88,6 +88,19 @@ public class Rice extends BaseEntity {
 
 
 
+    @ApiModelProperty("测试Long")
+    private Long testL =0L;
+
+    @ApiModelProperty("测试Long")
+    private int testI =0;
+
+
+
+
+
+    public Long getTestL() {
+        return testL == null ? 0L : testL;
+    }
 
 
     public Long getEarnPointsEveryDay() {

+ 1 - 0
src/main/java/com/izouma/nineth/security/WebSecurityConfig.java

@@ -181,6 +181,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/news/newsInfo").permitAll()
                 .antMatchers("/metaResources/getUrl").permitAll()
                 .antMatchers("/news/newsInfo").permitAll()
+                .antMatchers("/statistic/globalSearch").permitAll()
                 .antMatchers("/metaResources/like/**").permitAll()
                 .antMatchers("/metaResources/getLikeNum/**").permitAll()
                 .antMatchers("/metaProblem/findAll").permitAll()

+ 2 - 0
src/main/java/com/izouma/nineth/service/OrderService.java

@@ -835,6 +835,8 @@ public class OrderService {
                                 NeteaseMessage neteaseMessage = new NeteaseMessage();
                                 neteaseMessage.setFromId("56302");
                                 neteaseMessage.setToId("9626109603");
+//                                neteaseMessage.setFromId("9859");
+//                                neteaseMessage.setToId("7852443446");
                                 neteaseMessage.setType(0);
                                 neteaseMessage.setOpe(1);
                                 neteaseMessage

+ 73 - 0
src/main/java/com/izouma/nineth/service/RiceService.java

@@ -17,6 +17,7 @@ import org.apache.commons.lang.time.DateUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -784,4 +785,76 @@ public class RiceService {
         LocalDateTime localDateTime = LocalDateTime.of(localDate, LocalTime.MAX);
         return localDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli();
     }
+
+
+    /**
+     * 定时任务
+     */
+
+
+    //@Scheduled(cron = "0 * * * * ?")
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void resetExchangeCount() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setExchangeCount(0);
+        }
+        riceRepo.saveAll(riceList);
+    }
+
+
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void resetInviteCount() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setInviteCount(0);
+        }
+        riceRepo.saveAll(riceList);
+    }
+
+
+
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void resetHelpCount() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setHelpCount(0L);
+        }
+        riceRepo.saveAll(riceList);
+    }
+
+    //@Scheduled(cron = "0 0 0 * * ?")
+    @Scheduled(cron = "0 * * * * ?")
+    public void resetEarnPointsEveryDay() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setEarnPointsEveryDay(0L);
+        }
+        riceRepo.saveAll(riceList);
+    }
+
+
+    //@Scheduled(cron = "0 0 0 * * ?")
+    @Scheduled(cron = "0 * * * * ?")
+    public void resetTestL() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setTestL(0L);
+        }
+        riceRepo.saveAll(riceList);
+    }
+
+
+
+    //@Scheduled(cron = "0 0 0 * * ?")
+    @Scheduled(cron = "0 * * * * ?")
+    public void resetTestI() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setTestI(0);
+        }
+        riceRepo.saveAll(riceList);
+    }
+
+
 }