|
|
@@ -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){
|