diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java new file mode 100644 index 0000000000..826bb05905 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java @@ -0,0 +1,97 @@ +package com.epmet.commons.tools.filter; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.filter.LevelFilter; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.spi.IThrowableProxy; +import ch.qos.logback.classic.spi.StackTraceElementProxy; +import ch.qos.logback.core.spi.FilterReply; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.text.SimpleDateFormat; + +/** + * desc: 发送日志消息 + * + * @date: 2020/6/24 17:47 + * @author: jianjun liu + */ +public class LogMsgSendFilter extends LevelFilter { + private static final Logger logger = LoggerFactory.getLogger(LogMsgSendFilter.class); + @Override + public FilterReply decide(ILoggingEvent event) { + //如果日志级别等于设置的日志级别 则发送消息 + if (event.getLevel().isGreaterOrEqual(Level.ERROR)) { + try { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("【日志告警】\n"); + + stringBuilder.append("\n"); + + stringBuilder.append("告警级别:" + event.getLevel()); + stringBuilder.append("\n"); + stringBuilder.append("故障时间:" + formatLongTime2Str(event.getTimeStamp())); + stringBuilder.append("\n"); + stringBuilder.append("TraceId:" + Thread.currentThread().getName()); + stringBuilder.append("\n"); + stringBuilder.append("告警信息:" + event.getFormattedMessage()); + stringBuilder.append("\n"); + + IThrowableProxy throwableProxy = event.getThrowableProxy(); + //异常信息处理 暂时处理一级的5行数据 + apendStackInfo(stringBuilder, throwableProxy); + + Result flag = HttpClientManager.getInstance().sendAlarmMsg(stringBuilder.toString()); + if (!flag.success()) { + logger.warn("msgSender.sendMsg fail,param:{}", stringBuilder.toString()); + } + } catch (Exception e) { + logger.warn("decide exception", e); + } + } + //交给其他filter继续向下处理 + return super.decide(event); + } + + private void apendStackInfo(StringBuilder stringBuilder, IThrowableProxy throwableProxy) { + int defaultRowLine = 5; + if (throwableProxy != null) { + stringBuilder.append("异常信息:") + .append(throwableProxy.getClassName()) + .append(" : ") + .append(throwableProxy.getMessage()) + .append("\n"); + + StackTraceElementProxy[] stackTraceElementProxyArray = throwableProxy.getStackTraceElementProxyArray(); + StackTraceElementProxy stackTraceElementProxy = null; + + if (stackTraceElementProxyArray.length < defaultRowLine) { + defaultRowLine = stackTraceElementProxyArray.length; + } + for (int i = 0; i < defaultRowLine; i++) { + stackTraceElementProxy = stackTraceElementProxyArray[i]; + StackTraceElement stackTraceElement = stackTraceElementProxy.getStackTraceElement(); + stringBuilder.append("\t\tat "); + stringBuilder.append(stackTraceElement.getClassName()); + stringBuilder.append("."); + stringBuilder.append(stackTraceElement.getMethodName()); + stringBuilder.append("("); + stringBuilder.append(stackTraceElement.getFileName()); + stringBuilder.append(":"); + stringBuilder.append(stackTraceElement.getLineNumber()); + stringBuilder.append(")"); + stringBuilder.append("\n"); + } + } + } + + + private String formatLongTime2Str(long timestamp) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + return dateFormat.format(timestamp); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index f61c01dedb..5f78474374 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -159,7 +159,7 @@ ) ) a ORDER BY - a.project_total DESC + a.project_total DESC, a.type ASC diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java index f7eccf24b1..c5bd28f916 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java @@ -29,8 +29,8 @@ public interface GroupConstant { String CITY = "city"; String PROVINCE = "province"; - String ERRORGRIDDAILY = "groupGridDaily ==>【网格小组统计出错了... 维度:网格-日】customerId为:"; + String STATS_FAILED_GRID_DAILY = "统计数据方法groupGridDaily【网格小组统计-网格-日】执行失败,客户ID:%s,统计日期:%s,异常信息:%s"; - String ERRORAGENCYDAILY = "groupAgencyDaily ==>【网格小组统计出错了... 维度:机关-日】customerId为:"; + String STATS_FAILED_AGENCY_DAILY = "统计数据方法groupAgencyDaily【网格小组统计-机关-日】执行失败,客户ID:%s,统计日期:%s,异常信息:%s"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 67647f3f32..7eba9840e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -34,8 +34,6 @@ import java.util.stream.Collectors; @Slf4j public class StatsGroupServiceImpl implements StatsGroupService { - @Autowired - private DimGridService dimGridService; @Autowired private DimAgencyService dimAgencyService; @Autowired @@ -63,18 +61,15 @@ public class StatsGroupServiceImpl implements StatsGroupService { List customerIds; do { customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); if (customerIds.size() != NumConstant.ZERO){ customerIds.forEach(customerId -> { try { - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); - -// List gridsInfo = dimGridService.getGridListByCustomerId(customerId); List gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId()); - List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); } catch (Exception e) { - log.error(GroupConstant.ERRORGRIDDAILY+customerId,e); + log.error(String.format(GroupConstant.STATS_FAILED_GRID_DAILY,customerId,LocalDate.now(),e)); } }); } @@ -101,7 +96,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); } catch (Exception e) { - log.error(GroupConstant.ERRORAGENCYDAILY+customerId,e); + log.error(String.format(GroupConstant.STATS_FAILED_AGENCY_DAILY,customerId,LocalDate.now(),e)); } }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index fd6ffe7b88..ab38ff305a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IssueConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; @@ -18,6 +19,7 @@ import com.epmet.service.StatsIssueService; import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -33,6 +35,7 @@ import java.util.stream.Collectors; * @dscription * @date 2020/6/17 16:51 */ +@Slf4j @Service public class StatsIssueServiceImpl implements StatsIssueService { @Autowired @@ -60,11 +63,17 @@ public class StatsIssueServiceImpl implements StatsIssueService { int pageSize = 100; List customerIdList = null; do { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { //遍历统计每一个客户数据 - customerStats(customerId); + try { + customerStats(customerId, date); + } catch(Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", DateUtils.format(date), e.getMessage())); + } } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -77,10 +86,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { * @param customerId * @return void */ - @Async - public void customerStats(String customerId) { - //获取当前日期前一天 - Date date = DateUtils.getBeforeDay(new Date()); + private void customerStats(String customerId, Date date) { //机关议题日统计 saveIssueAgencyDaily(customerId, date); //机关议题月统计 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index f5eec05e4b..0c4793e565 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -99,7 +99,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) - log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目业务表已结案数据,对应客户Id:"+customerId); + log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目业务表已结案数据,对应客户Id:" + customerId); ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(customerId); projectEntity.setCreatedTime(date); @@ -107,19 +107,27 @@ public class StatsProjectServiceImpl implements StatsProjectService { List projectList = projectService.getProjectList(projectEntity); //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) - log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目进展表业务数据,对应客户Id:"+customerId); + log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目进展表业务数据,对应客户Id:" + customerId); List processList = projectProcessService.getProcessList(projectEntity); //5:机关层级日月统计 if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) { //5.1:执行机关日数据统计 - log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关日统计方法,方法名:agencyDateProjectStats,客户Id:"+customerId); - agencyDateProjectStats(customerId, dimId, dimAgencyList, projectList, processList); + try { + log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关日统计方法,方法名:agencyDateProjectStats,客户Id:" + customerId); + agencyDateProjectStats(customerId, dimId, dimAgencyList, projectList, processList); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyDateProjectStats", customerId, dimId.getDateId(), e.getMessage())); + } //5.2:执行机关月数据统计 //if (Calendar.getInstance().get(Calendar.DATE) == 1) { - log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关月统计方法,方法名:agencyMonthProjectStats,客户Id:"+customerId); - agencyMonthProjectStats(customerId, dimId, dimAgencyList); + try { + log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关月统计方法,方法名:agencyMonthProjectStats,客户Id:" + customerId); + agencyMonthProjectStats(customerId, dimId, dimAgencyList); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyMonthProjectStats", customerId, dimId.getMonthId(), e.getMessage())); + } //} } @@ -252,11 +260,11 @@ public class StatsProjectServiceImpl implements StatsProjectService { FactAgencyProjectDailyEntity delEntity = new FactAgencyProjectDailyEntity(); delEntity.setCustomerId(customerId); delEntity.setDateId(dimId.getDateId()); - log.info("StatsProjectServiceImpl.agencyDateProjectStats-根据客户Id、日维度Id批量删除机关项目日统计表数据,对应客户Id:"+customerId+",日维度Id:"+dimId.getDateId()); + log.info("StatsProjectServiceImpl.agencyDateProjectStats-根据客户Id、日维度Id批量删除机关项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); factAgencyProjectDailyService.delDateProject(delEntity); //2.2:批量保存机关日统计数据 - log.info("StatsProjectServiceImpl.agencyDateProjectStats-批量新增机关项目日统计表数据,对应客户Id:"+customerId+",日维度Id:"+dimId.getDateId()); + log.info("StatsProjectServiceImpl.agencyDateProjectStats-批量新增机关项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); factAgencyProjectDailyService.insertBatch(projectDateEntityList); } @@ -331,11 +339,11 @@ public class StatsProjectServiceImpl implements StatsProjectService { FactAgencyProjectMonthlyEntity delEntity = new FactAgencyProjectMonthlyEntity(); delEntity.setCustomerId(customerId); delEntity.setMonthId(dimId.getMonthId()); - log.info("StatsProjectServiceImpl.agencyMonthProjectStats-根据客户Id、月维度Id批量删除机关项目月统计表数据,对应客户Id:"+customerId+",月维度Id:"+dimId.getMonthId()); + log.info("StatsProjectServiceImpl.agencyMonthProjectStats-根据客户Id、月维度Id批量删除机关项目月统计表数据,对应客户Id:" + customerId + ",月维度Id:" + dimId.getMonthId()); factAgencyProjectMonthlyService.delMonthProject(delEntity); //3.2:批量保存机关月统计数据 - log.info("StatsProjectServiceImpl.agencyMonthProjectStats-批量新增机关项目月统计表数据,对应客户Id:"+customerId+",月维度Id:"+dimId.getMonthId()); + log.info("StatsProjectServiceImpl.agencyMonthProjectStats-批量新增机关项目月统计表数据,对应客户Id:" + customerId + ",月维度Id:" + dimId.getMonthId()); factAgencyProjectMonthlyService.insertBatch(monthlyEntityList); } @@ -383,7 +391,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { List dimGridList = dimGridService.getGridListByCustomerId(customerId); //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) - log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目业务表已结案数据,对应客户Id:"+customerId); + log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目业务表已结案数据,对应客户Id:" + customerId); ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(customerId); projectEntity.setCreatedTime(date); @@ -391,19 +399,27 @@ public class StatsProjectServiceImpl implements StatsProjectService { List projectList = projectService.getProjectList(projectEntity); //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) - log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目进展表业务数据,对应客户Id:"+customerId); + log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目进展表业务数据,对应客户Id:" + customerId); List processList = projectProcessService.getProcessList(projectEntity); //5:网格层级日月统计 if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) { //5.1:执行网格日数据统计 - log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关日统计方法,方法名:gridDateProjectStats,客户Id:"+customerId); - gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList); + try { + log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关日统计方法,方法名:gridDateProjectStats,客户Id:" + customerId); + gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridDateProjectStats", customerId, dimId.getDateId(), e.getMessage())); + } //5.2:执行网格月数据统计 //if (Calendar.getInstance().get(Calendar.DATE) == 1) { - log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关月统计方法,方法名:gridMonthProjectStats,客户Id:"+customerId); - gridMonthProjectStats(customerId, dimId, dimGridList); + try { + log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关月统计方法,方法名:gridMonthProjectStats,客户Id:" + customerId); + gridMonthProjectStats(customerId, dimId, dimGridList); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridMonthProjectStats", customerId, dimId.getMonthId(), e.getMessage())); + } //} } @@ -537,11 +553,11 @@ public class StatsProjectServiceImpl implements StatsProjectService { FactAgencyProjectDailyEntity delEntity = new FactAgencyProjectDailyEntity(); delEntity.setCustomerId(customerId); delEntity.setDateId(dimId.getDateId()); - log.info("StatsProjectServiceImpl.gridDateProjectStats-根据客户Id、日维度Id批量删除网格项目日统计表数据,对应客户Id:"+customerId+",日维度Id:"+dimId.getDateId()); + log.info("StatsProjectServiceImpl.gridDateProjectStats-根据客户Id、日维度Id批量删除网格项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); factGridProjectDailyService.delDateProject(delEntity); //3.2:批量保存网格日统计数据 - log.info("StatsProjectServiceImpl.gridDateProjectStats-批量新增网格项目日统计表数据,对应客户Id:"+customerId+",日维度Id:"+dimId.getDateId()); + log.info("StatsProjectServiceImpl.gridDateProjectStats-批量新增网格项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); factGridProjectDailyService.insertBatch(gridDateEntityList); } @@ -616,11 +632,11 @@ public class StatsProjectServiceImpl implements StatsProjectService { FactAgencyProjectMonthlyEntity delEntity = new FactAgencyProjectMonthlyEntity(); delEntity.setCustomerId(customerId); delEntity.setMonthId(dimId.getMonthId()); - log.info("StatsProjectServiceImpl.gridMonthProjectStats-根据客户Id、月维度Id批量删除网格项目月统计表数据,对应客户Id:"+customerId+",月维度Id:"+dimId.getMonthId()); + log.info("StatsProjectServiceImpl.gridMonthProjectStats-根据客户Id、月维度Id批量删除网格项目月统计表数据,对应客户Id:" + customerId + ",月维度Id:" + dimId.getMonthId()); factGridProjectMonthlyService.delMonthProject(delEntity); //3.2:批量保存机关月统计数据 - log.info("StatsProjectServiceImpl.gridMonthProjectStats-批量新增网格项目月统计表数据,对应客户Id:"+customerId+",月维度Id:"+dimId.getMonthId()); + log.info("StatsProjectServiceImpl.gridMonthProjectStats-批量新增网格项目月统计表数据,对应客户Id:" + customerId + ",月维度Id:" + dimId.getMonthId()); factGridProjectMonthlyService.insertBatch(monthlyEntityList); } @@ -636,7 +652,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { try { DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(); - //calendar.set(Calendar.HOUR_OF_DAY, -24); + calendar.set(Calendar.HOUR_OF_DAY, -24); String str = sdf.format(calendar.getTime()); date = sdf.parse(str); } catch (Exception e) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index f0b0ca3c19..72b5ce2b1b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -5,7 +5,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.constant.DimAgencyConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; @@ -165,12 +164,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedDailyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计标签被使用次数", customerId, dimIdBean.getMonthId(), e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } } } @@ -199,12 +192,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "按月统计标签被使用次数", customerId, dimIdBean.getMonthId(), e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按月统计标签被使用次数", customerId, dimIdBean.getMonthId(), e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } } } @@ -234,12 +221,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { statsTagViewedDaily(statsDate, dimIdBean, customerId); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计标签被查看次数", customerId, statsDate, e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", ex); - } } } } @@ -268,12 +249,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按月统计标签被查看次数", customerId, dimIdBean.getMonthId(), e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } } } @@ -304,12 +279,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedQuarterly", customerId, dimIdBean.getQuarterId(), e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按季统计标签被使用次数", customerId, dimIdBean.getQuarterId(), e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } }); executorService.submit(() -> { @@ -318,12 +287,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { statsTagUsedYearly(dimIdBean.getYearId(), customerId); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedYearly", customerId, dimIdBean.getYearId(), e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按年统计标签被使用次数", customerId, dimIdBean.getYearId(), e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } }); } @@ -355,12 +318,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getQuarterId(), e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按季统计标签被查看次数", customerId, dimIdBean.getQuarterId(), e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } }); executorService.submit(() -> { @@ -371,12 +328,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getYearId(), e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按年统计标签被查看次数", customerId, dimIdBean.getYearId(), e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } }); } @@ -416,12 +367,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedDepartmentDaily", customerId, statsDate, e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计部门纬度文章总数", customerId, statsDate, e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } } @@ -491,12 +436,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } catch (Exception e) { e.printStackTrace(); log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedGridDaily", customerId, statsDate, e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计网格纬度文章总数", customerId, statsDate, e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } @@ -562,12 +501,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } catch (Exception e) { e.printStackTrace(); log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedAgencyDaily", customerId, statsDate, e.getMessage())); - try { - String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计部门纬度文章总数", customerId, statsDate, e.getMessage()); - HttpClientManager.getInstance().sendAlarmMsg(content); - } catch (Exception ex) { - log.error("sendAlarmMsg exception", e); - } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml index 99ccda0d9c..148588bffb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -126,7 +126,7 @@ 15 - + ERROR ACCEPT DENY @@ -137,7 +137,7 @@ - +