Browse Source

催款统计导出BUG修复

anderx 4 years ago
parent
commit
debcafd474
1 changed files with 8 additions and 3 deletions
  1. 8 3
      src/main/java/com/goafanti/common/task/UserFollowTask.java

+ 8 - 3
src/main/java/com/goafanti/common/task/UserFollowTask.java

@@ -36,12 +36,17 @@ public class UserFollowTask {
      * 	每月1号凌晨5点轮询统计
      *
      */
-
     @Scheduled(cron = "0 0 5 1 * ?")
+    public void autoTask() throws InterruptedException {
+        userFollowStatistics(null);
+    }
+
     @RequestMapping(value = "/open/userFollowStatistics", method = RequestMethod.GET)
+    public void manualTask(Integer m) throws InterruptedException {
+        userFollowStatistics(m);
+    }
     public void 	userFollowStatistics(Integer m) throws InterruptedException {
         //获取上月1号到本月1号的外出
-
         Calendar now=getNowDate(m);
         Calendar date=getNowDate(m);
         String ym=getYearMonth(m);
@@ -90,7 +95,7 @@ public class UserFollowTask {
     }
     public String getYearMonth(Integer m){
         Calendar now=Calendar.getInstance();
-        now.set(2021,m,1);
+        if (m!=null)now.set(2021,m,1);
         int y=now.get(Calendar.YEAR);
         int mo=now.get(Calendar.MONTH);
         if(mo<1){