|
|
@@ -39,12 +39,12 @@ public class UserFollowTask {
|
|
|
|
|
|
@Scheduled(cron = "0 0 5 1 * ?")
|
|
|
@RequestMapping(value = "/open/userFollowStatistics", method = RequestMethod.GET)
|
|
|
- public void userFollowStatistics() throws InterruptedException {
|
|
|
+ public void userFollowStatistics(Integer m) throws InterruptedException {
|
|
|
//获取上月1号到本月1号的外出
|
|
|
- Calendar now=getNowDate();
|
|
|
- Calendar date=getNowDate();
|
|
|
- String ym=getYearMonth();
|
|
|
|
|
|
+ Calendar now=getNowDate(m);
|
|
|
+ Calendar date=getNowDate(m);
|
|
|
+ String ym=getYearMonth(m);
|
|
|
date.set(Calendar.MONTH,now.get(Calendar.MONTH)-1);
|
|
|
List<OutPublicReleaseCount> list =publicReleaseMapper.getTimeUserFollow(date.getTime(),now.getTime());
|
|
|
for (OutPublicReleaseCount out : list) {
|
|
|
@@ -79,25 +79,25 @@ public class UserFollowTask {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public Calendar getNowDate(){
|
|
|
+ public Calendar getNowDate(Integer m){
|
|
|
Calendar now=Calendar.getInstance();
|
|
|
- now.set(2021,10,1);
|
|
|
+ if (m!=null)now.set(2021,m,1);
|
|
|
now.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
now.clear(Calendar.MINUTE);
|
|
|
now.clear(Calendar.SECOND);
|
|
|
now.clear(Calendar.MILLISECOND);
|
|
|
return now;
|
|
|
}
|
|
|
- public String getYearMonth(){
|
|
|
+ public String getYearMonth(Integer m){
|
|
|
Calendar now=Calendar.getInstance();
|
|
|
- now.set(2021,10,1);
|
|
|
+ now.set(2021,m,1);
|
|
|
int y=now.get(Calendar.YEAR);
|
|
|
- int m=now.get(Calendar.MONTH);
|
|
|
- if(m<1){
|
|
|
- m=12;
|
|
|
+ int mo=now.get(Calendar.MONTH);
|
|
|
+ if(mo<1){
|
|
|
+ mo=12;
|
|
|
y--;
|
|
|
}
|
|
|
- return y+"-"+m;
|
|
|
+ return y+"-"+mo;
|
|
|
}
|
|
|
|
|
|
|