Commit 550c4a9b authored by liucx's avatar liucx

错误日志捕获

parent edc3a234
...@@ -41,6 +41,7 @@ public class CommunicationRecordStatisticalLogServiceImpl extends ServiceImpl<Co ...@@ -41,6 +41,7 @@ public class CommunicationRecordStatisticalLogServiceImpl extends ServiceImpl<Co
private void updateAndSave( List<CustomerCommunicationRecordTask> list,String type){ private void updateAndSave( List<CustomerCommunicationRecordTask> list,String type){
for (CustomerCommunicationRecordTask customerCommunicationRecordTask : list) { for (CustomerCommunicationRecordTask customerCommunicationRecordTask : list) {
try {
CommunicationRecordStatisticalLog distinct = getBaseMapper().selectDistinct(customerCommunicationRecordTask.getCustomerId().longValue(), customerCommunicationRecordTask.getProductId().longValue(), customerCommunicationRecordTask.getProductType()); CommunicationRecordStatisticalLog distinct = getBaseMapper().selectDistinct(customerCommunicationRecordTask.getCustomerId().longValue(), customerCommunicationRecordTask.getProductId().longValue(), customerCommunicationRecordTask.getProductType());
if (ObjectUtils.isEmpty(distinct)) { if (ObjectUtils.isEmpty(distinct)) {
CommunicationRecordStatisticalLog communicationRecordStatisticalLog = new CommunicationRecordStatisticalLog(); CommunicationRecordStatisticalLog communicationRecordStatisticalLog = new CommunicationRecordStatisticalLog();
...@@ -49,18 +50,21 @@ public class CommunicationRecordStatisticalLogServiceImpl extends ServiceImpl<Co ...@@ -49,18 +50,21 @@ public class CommunicationRecordStatisticalLogServiceImpl extends ServiceImpl<Co
communicationRecordStatisticalLog.setProductId(customerCommunicationRecordTask.getProductId().longValue()); communicationRecordStatisticalLog.setProductId(customerCommunicationRecordTask.getProductId().longValue());
distinct.setDayConut(customerCommunicationRecordTask.getCount()); distinct.setDayConut(customerCommunicationRecordTask.getCount());
saveOrUpdate(communicationRecordStatisticalLog); saveOrUpdate(communicationRecordStatisticalLog);
}else { } else {
if(type.equals("day")){ if (type.equals("day")) {
distinct.setDayConut(customerCommunicationRecordTask.getCount()); distinct.setDayConut(customerCommunicationRecordTask.getCount());
} }
if(type.equals("week")){ if (type.equals("week")) {
distinct.setWeekConut(customerCommunicationRecordTask.getCount()); distinct.setWeekConut(customerCommunicationRecordTask.getCount());
} }
if(type.equals("month")){ if (type.equals("month")) {
distinct.setMonthConut(customerCommunicationRecordTask.getCount()); distinct.setMonthConut(customerCommunicationRecordTask.getCount());
} }
updateById(distinct); updateById(distinct);
} }
}catch (Exception e){
log.error("更新或添加错误信息:{},类型:{}",e,type);
}
} }
} }
......
...@@ -40,7 +40,6 @@ public class TimedTaskController { ...@@ -40,7 +40,6 @@ public class TimedTaskController {
} }
@ApiOperation(value = "周统计沟通记录次数", notes = "周统计沟通记录次数 ", httpMethod = "GET") @ApiOperation(value = "周统计沟通记录次数", notes = "周统计沟通记录次数 ", httpMethod = "GET")
@GetMapping("weekCommunication") @GetMapping("weekCommunication")
// @Scheduled(cron = "0 33 12,17 * * ?")
@Scheduled(cron = "0 15 12,16 * * ?") @Scheduled(cron = "0 15 12,16 * * ?")
public CommonResult weekCommunicationCount() { public CommonResult weekCommunicationCount() {
communicationRecordStatisticalLogService.saveOrUpdateWeek(); communicationRecordStatisticalLogService.saveOrUpdateWeek();
......
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