Commit edc3a234 authored by liucx's avatar liucx

添加日志

parent a3870578
......@@ -31,6 +31,7 @@ public class DateUtil {
public static final String DATE_FMT = "yyyy-MM-dd";
public static final String DATE_TIME_FMT = "yyyy-MM-dd HH:mm:ss";
public static final String DATE_TIME_FMT_HOURS = "yyyy-MM-dd 00:00:00";
/**
* 从Date类型的时间中提取日期部分
......@@ -284,6 +285,10 @@ public class DateUtil {
return dateToStr(new Date(), DATE_TIME_FMT);
}
public static String getNowHours() {
return dateToStr(new Date(), DATE_TIME_FMT_HOURS);
}
/**
* 获取今天日期
*
......
......@@ -104,8 +104,7 @@ public class CommunicationRecordStatisticalLogServiceImpl extends ServiceImpl<Co
@Override
public void saveOrUpdateWeek() {
Date startTime = DateUtil.getThisWeekMonday(new Date());
Date str= DateUtil.dateStrToDate( DateUtil.dateToStr(startTime,"yyyy-MM-dd 00:00:00"),"yyyy-MM-dd 00:00:00");
Date startTime = DateUtil.getThisWeekMonday(DateUtil.dateStrToDate(DateUtil.getNowHours(),DateUtil.DATE_TIME_FMT_HOURS));
List<CustomerCommunicationRecordTask> list = customerCommunicationRecordService.queryCustomerCommunicationRecordTask(startTime, new Date());
if(ObjectUtils.isEmpty(list)){
......
......@@ -44,8 +44,8 @@ public class TimedTaskController {
@Scheduled(cron = "0 15 12,16 * * ?")
public CommonResult weekCommunicationCount() {
communicationRecordStatisticalLogService.saveOrUpdateWeek();
logger.info("统计沟通记录次数成功");
return CommonResult.success("统计沟通记录次数成功");
logger.info("统计沟通记录次数成功");
return CommonResult.success("统计沟通记录次数成功");
}
@ApiOperation(value = "月统计沟通记录次数", notes = "月统计沟通记录次数 ", httpMethod = "GET")
@GetMapping("mothCommunication")
......
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