Commit 550c4a9b authored by liucx's avatar liucx

错误日志捕获

parent edc3a234
...@@ -41,25 +41,29 @@ public class CommunicationRecordStatisticalLogServiceImpl extends ServiceImpl<Co ...@@ -41,25 +41,29 @@ 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) {
CommunicationRecordStatisticalLog distinct = getBaseMapper().selectDistinct(customerCommunicationRecordTask.getCustomerId().longValue(), customerCommunicationRecordTask.getProductId().longValue(), customerCommunicationRecordTask.getProductType()); try {
if (ObjectUtils.isEmpty(distinct)) { CommunicationRecordStatisticalLog distinct = getBaseMapper().selectDistinct(customerCommunicationRecordTask.getCustomerId().longValue(), customerCommunicationRecordTask.getProductId().longValue(), customerCommunicationRecordTask.getProductType());
CommunicationRecordStatisticalLog communicationRecordStatisticalLog = new CommunicationRecordStatisticalLog(); if (ObjectUtils.isEmpty(distinct)) {
communicationRecordStatisticalLog.setCustomerId(customerCommunicationRecordTask.getCustomerId().longValue()); CommunicationRecordStatisticalLog communicationRecordStatisticalLog = new CommunicationRecordStatisticalLog();
communicationRecordStatisticalLog.setProductType(customerCommunicationRecordTask.getProductType()); communicationRecordStatisticalLog.setCustomerId(customerCommunicationRecordTask.getCustomerId().longValue());
communicationRecordStatisticalLog.setProductId(customerCommunicationRecordTask.getProductId().longValue()); communicationRecordStatisticalLog.setProductType(customerCommunicationRecordTask.getProductType());
distinct.setDayConut(customerCommunicationRecordTask.getCount()); communicationRecordStatisticalLog.setProductId(customerCommunicationRecordTask.getProductId().longValue());
saveOrUpdate(communicationRecordStatisticalLog);
}else {
if(type.equals("day")){
distinct.setDayConut(customerCommunicationRecordTask.getCount()); distinct.setDayConut(customerCommunicationRecordTask.getCount());
saveOrUpdate(communicationRecordStatisticalLog);
} else {
if (type.equals("day")) {
distinct.setDayConut(customerCommunicationRecordTask.getCount());
}
if (type.equals("week")) {
distinct.setWeekConut(customerCommunicationRecordTask.getCount());
}
if (type.equals("month")) {
distinct.setMonthConut(customerCommunicationRecordTask.getCount());
}
updateById(distinct);
} }
if(type.equals("week")){ }catch (Exception e){
distinct.setWeekConut(customerCommunicationRecordTask.getCount()); log.error("更新或添加错误信息:{},类型:{}",e,type);
}
if(type.equals("month")){
distinct.setMonthConut(customerCommunicationRecordTask.getCount());
}
updateById(distinct);
} }
} }
} }
......
...@@ -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