Commit 0bace13c authored by liucx's avatar liucx

清零

parent 3d979df7
...@@ -21,4 +21,19 @@ public interface CommunicationRecordStatisticalLogService { ...@@ -21,4 +21,19 @@ public interface CommunicationRecordStatisticalLogService {
* 更新周数据 * 更新周数据
*/ */
void saveOrUpdateWeek(); void saveOrUpdateWeek();
/**
* 每天清零
*/
void dayCommunicationReset();
/**
* 每周清零
*/
void weekCommunicationReset();
/**
* 每月清零
*/
void mothCommunicationReset();
} }
...@@ -114,6 +114,38 @@ public class CommunicationRecordStatisticalLogServiceImpl extends ServiceImpl<Co ...@@ -114,6 +114,38 @@ public class CommunicationRecordStatisticalLogServiceImpl extends ServiceImpl<Co
this.updateAndSave(list,"week"); this.updateAndSave(list,"week");
} }
@Override
public void dayCommunicationReset() {
List<CommunicationRecordStatisticalLog> list = baseMapper.selectAll();
for (CommunicationRecordStatisticalLog communicationRecordStatisticalLog : list) {
CommunicationRecordStatisticalLog update = new CommunicationRecordStatisticalLog();
update.setDayConut(0);
update.setId(communicationRecordStatisticalLog.getId());
updateById(update);
}
}
@Override
public void weekCommunicationReset() {
List<CommunicationRecordStatisticalLog> list = baseMapper.selectAll();
for (CommunicationRecordStatisticalLog communicationRecordStatisticalLog : list) {
CommunicationRecordStatisticalLog update = new CommunicationRecordStatisticalLog();
update.setWeekConut(0);
update.setId(communicationRecordStatisticalLog.getId());
updateById(update);
}
}
@Override
public void mothCommunicationReset() {
List<CommunicationRecordStatisticalLog> list = baseMapper.selectAll();
for (CommunicationRecordStatisticalLog communicationRecordStatisticalLog : list) {
CommunicationRecordStatisticalLog update = new CommunicationRecordStatisticalLog();
update.setMonthConut(0);
update.setId(communicationRecordStatisticalLog.getId());
updateById(update);
}
}
} }
package com.zfxftech.telmarket.task.communication; package com.zfxftech.telmarket.task.communication;
import com.zfxftech.telmarket.common.annotation.tokenAnnotation.JwtPassAnnotation;
import com.zfxftech.telmarket.common.bean.CommonResult; import com.zfxftech.telmarket.common.bean.CommonResult;
import com.zfxftech.telmarket.service.followAccount.CommunicationRecordStatisticalLogService; import com.zfxftech.telmarket.service.followAccount.CommunicationRecordStatisticalLogService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -29,21 +30,21 @@ public class TimedTaskController { ...@@ -29,21 +30,21 @@ public class TimedTaskController {
@ApiOperation(value = "日统计沟通记录次数", notes = "日统计沟通记录次数 ", httpMethod = "GET") @ApiOperation(value = "日统计沟通记录次数", notes = "日统计沟通记录次数 ", httpMethod = "GET")
@GetMapping("/dayCommunication") @GetMapping("dayCommunication")
@Scheduled(cron = "0 25 12,15 * * ?") @Scheduled(cron = "0 25 12,15 * * ?")
public CommonResult dayCommunicationCount() { public CommonResult dayCommunicationCount() {
communicationRecordStatisticalLogService.saveOrUpdateDay(); communicationRecordStatisticalLogService.saveOrUpdateDay();
return CommonResult.success("日统计沟通记录次数成功"); return CommonResult.success("日统计沟通记录次数成功");
} }
@ApiOperation(value = "周统计沟通记录次数", notes = "周统计沟通记录次数 ", httpMethod = "GET") @ApiOperation(value = "周统计沟通记录次数", notes = "周统计沟通记录次数 ", httpMethod = "GET")
@GetMapping("/weekCommunication") @GetMapping("weekCommunication")
@Scheduled(cron = "0 15 12,16 * * ?") @Scheduled(cron = "0 15 12,16 * * ?")
public CommonResult weekCommunicationCount() { public CommonResult weekCommunicationCount() {
communicationRecordStatisticalLogService.saveOrUpdateWeek(); communicationRecordStatisticalLogService.saveOrUpdateWeek();
return CommonResult.success("日统计沟通记录次数成功"); return CommonResult.success("日统计沟通记录次数成功");
} }
@ApiOperation(value = "月统计沟通记录次数", notes = "月统计沟通记录次数 ", httpMethod = "GET") @ApiOperation(value = "月统计沟通记录次数", notes = "月统计沟通记录次数 ", httpMethod = "GET")
@GetMapping("/mothCommunication") @GetMapping("mothCommunication")
@Scheduled(cron = "0 20 12,16 * * ?") @Scheduled(cron = "0 20 12,16 * * ?")
public CommonResult monthCommunicationCount() { public CommonResult monthCommunicationCount() {
communicationRecordStatisticalLogService.saveOrUpdateMonth(); communicationRecordStatisticalLogService.saveOrUpdateMonth();
...@@ -60,5 +61,30 @@ public class TimedTaskController { ...@@ -60,5 +61,30 @@ public class TimedTaskController {
} }
//---------------清零
@ApiOperation(value = "日清零", notes = "日清零 ", httpMethod = "GET")
@GetMapping("dayCommunicationReset")
@JwtPassAnnotation
@Scheduled(cron = "59 59 23 * * ? ")
public CommonResult dayCommunicationReset() {
communicationRecordStatisticalLogService.dayCommunicationReset();
return CommonResult.success("日统计记录清零成功");
}
@ApiOperation(value = "周清零", notes = "周清零 ", httpMethod = "GET")
@GetMapping("weekCommunicationReset")
@Scheduled(cron = "0 0 23 ? * 1")
public CommonResult weekCommunicationReset() {
communicationRecordStatisticalLogService.weekCommunicationReset();
return CommonResult.success("日统计记录清零成功");
}
@ApiOperation(value = "月清零", notes = "月清零 ", httpMethod = "GET")
@GetMapping("mothCommunicationReset")
@Scheduled(cron = "0 0 23 L * ?")
public CommonResult mothCommunicationReset() {
communicationRecordStatisticalLogService.mothCommunicationReset();
return CommonResult.success("日统计记录清零成功");
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment