Commit 550c4a9b authored by liucx's avatar liucx

错误日志捕获

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