Browse Source

Merge remote-tracking branch 'origin/dev_data_stats' into dev_data_stats

dev_shibei_match
yinzuomei 5 years ago
parent
commit
6f983deb25
  1. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  2. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml
  3. 10
      epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
  4. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml
  5. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  6. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java
  7. 170
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
  8. 5
      epmet-openapi/epmet-openapi-scan/src/main/resources/readme

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -117,7 +117,7 @@ public class ProjectServiceImpl implements ProjectService {
if (null == agencyProjectDailyDTO) {
return resultList;
}
//2:获取当前组织最近日期的直属下级组织项目统计数据,按项目总量降序
//2:获取机关下直属网格最近一天的日统计数据,按项目总数降序
resultList = projectDao.selectSubGrid(agencyProjectDailyDTO);
return resultList;
}

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml

@ -74,6 +74,7 @@
AND agency_id = #{agencyId}
ORDER BY
date_id DESC
LIMIT 90
</select>
<!--小组数量 月增长-->
@ -83,12 +84,13 @@
group_incr AS value,
'小组数量' AS type
FROM
fact_group_agency_daily
fact_group_agency_monthly
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
ORDER BY
month_id DESC
LIMIT 12
</select>
</mapper>

10
epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml

@ -123,15 +123,18 @@
(
SELECT
da.id AS "agencyId",
da.agency_name AS "name",
dg.grid_name AS "name",
fgpd.pending_total AS "value",
"处理中" AS "type",
fgpd.project_total
FROM
fact_grid_project_daily fgpd
LEFT JOIN dim_agency da ON fgpd.agency_id = da.id
LEFT JOIN dim_grid dg ON fgpd.grid_id = dg.id
WHERE
fgpd.del_flag = '0'
AND da.del_flag = '0'
AND dg.del_flag = '0'
AND fgpd.agency_id = #{agencyId}
AND fgpd.date_id = #{dateId}
)
@ -139,15 +142,18 @@
(
SELECT
da.id AS "agencyId",
da.agency_name AS "name",
dg.grid_name AS "name",
fgpd.closed_total AS "value",
"已结案" AS "type",
fgpd.project_total
FROM
fact_grid_project_daily fgpd
LEFT JOIN dim_agency da ON fgpd.agency_id = da.id
LEFT JOIN dim_grid dg ON fgpd.grid_id = dg.id
WHERE
fgpd.del_flag = '0'
AND da.del_flag = '0'
AND dg.del_flag = '0'
AND fgpd.agency_id = #{agencyId}
AND fgpd.date_id = #{dateId}
)

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml

@ -156,6 +156,7 @@
AND agency_id = #{agencyId}
ORDER BY
date_id DESC
LIMIT 270
</select>
<!--话题转议题-->
@ -187,6 +188,7 @@
AND agency_id = #{agencyId}
ORDER BY
month_id DESC
LIMIT 36
</select>
<select id="getTopicShiftedIncrMonthly" parameterType="java.lang.String" resultType="com.epmet.topic.dto.result.TopicIncrTrendResultDTO">

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -46,6 +46,11 @@ public interface ProjectConstant {
/**
* 执行失败钉钉消息模版
*/
String EXE_FAILED_MSG = "定时任务【%s】执行失败,客户ID:%s,统计时间:%s,异常信息:%s";
String EXE_FAILED_MSG = "统计数据方法【%s】执行失败,客户ID:%s,统计日期:%s,异常信息:%s";
/**
* 统计数据执行失败日志前缀
*/
String STATS_FAILED_PREFIX = "统计数据执行失败:%s 客户ID:%s,统计日期:%s,异常信息:%s";
}

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java

@ -71,7 +71,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
try {
log.debug("for循环统计机关-项目-日月数据,当前统计的客户Id:" + customerId);
log.info("for循环统计机关-项目-日月数据,当前统计的客户Id:" + customerId);
//遍历统计每一个客户数据
customerAgencyStats(customerId);
} catch (Exception e) {
@ -93,13 +93,13 @@ public class StatsProjectServiceImpl implements StatsProjectService {
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//2:根据客户Id查询机关维度表数据
log.debug("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询机关维度数据,当前客户Id:" + customerId);
log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询机关维度数据,对应客户Id:" + customerId);
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO();
dimAgencyDTO.setCustomerId(customerId);
List<DimAgencyDTO> dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
//3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据)
log.debug("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目业务表结案数据,当前客户Id:"+customerId);
log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目业务表已结案数据,对应客户Id:"+customerId);
ProjectEntity projectEntity = new ProjectEntity();
projectEntity.setCustomerId(customerId);
projectEntity.setCreatedTime(date);
@ -107,18 +107,18 @@ public class StatsProjectServiceImpl implements StatsProjectService {
List<ProjectEntity> projectList = projectService.getProjectList(projectEntity);
//4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据)
log.debug("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目进展表业务数据,当前客户Id:"+customerId);
log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目进展表业务数据,对应客户Id:"+customerId);
List<ProjectProcessEntity> processList = projectProcessService.getProcessList(projectEntity);
//5:机关层级日月统计
if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) {
//5.1:执行机关日数据统计
log.debug("StatsProjectServiceImpl.customerAgencyStats-开始执行机关日统计方法,方法名:agencyDateProjectStats,客户Id:"+customerId);
log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关日统计方法,方法名:agencyDateProjectStats,客户Id:"+customerId);
agencyDateProjectStats(customerId, dimId, dimAgencyList, projectList, processList);
//5.2:执行机关月数据统计
//if (Calendar.getInstance().get(Calendar.DATE) == 1) {
log.debug("StatsProjectServiceImpl.customerAgencyStats-开始执行机关月统计方法,方法名:agencyMonthProjectStats,客户Id:"+customerId);
log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关月统计方法,方法名:agencyMonthProjectStats,客户Id:"+customerId);
agencyMonthProjectStats(customerId, dimId, dimAgencyList);
//}
}
@ -252,9 +252,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());
factAgencyProjectDailyService.delDateProject(delEntity);
//2.2:批量保存机关日统计数据
log.info("StatsProjectServiceImpl.agencyDateProjectStats-批量新增机关项目日统计表数据,对应客户Id:"+customerId+",日维度Id:"+dimId.getDateId());
factAgencyProjectDailyService.insertBatch(projectDateEntityList);
}
@ -329,9 +331,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());
factAgencyProjectMonthlyService.delMonthProject(delEntity);
//3.2:批量保存机关月统计数据
log.info("StatsProjectServiceImpl.agencyMonthProjectStats-批量新增机关项目月统计表数据,对应客户Id:"+customerId+",月维度Id:"+dimId.getMonthId());
factAgencyProjectMonthlyService.insertBatch(monthlyEntityList);
}
@ -353,6 +357,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
try {
log.info("for循环统计网格-项目-日月数据,当前统计的客户Id:" + customerId);
//遍历统计每一个客户数据
customerGridStats(customerId);
} catch (Exception e) {
@ -374,9 +379,11 @@ public class StatsProjectServiceImpl implements StatsProjectService {
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//2:根据客户Id查询网格维度表数据
log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询网格维度数据,对应客户Id:" + customerId);
List<DimGridEntity> dimGridList = dimGridService.getGridListByCustomerId(customerId);
//3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据)
log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目业务表已结案数据,对应客户Id:"+customerId);
ProjectEntity projectEntity = new ProjectEntity();
projectEntity.setCustomerId(customerId);
projectEntity.setCreatedTime(date);
@ -384,15 +391,18 @@ public class StatsProjectServiceImpl implements StatsProjectService {
List<ProjectEntity> projectList = projectService.getProjectList(projectEntity);
//4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据)
log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目进展表业务数据,对应客户Id:"+customerId);
List<ProjectProcessEntity> 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);
//5.2:执行网格月数据统计
//if (Calendar.getInstance().get(Calendar.DATE) == 1) {
log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关月统计方法,方法名:gridMonthProjectStats,客户Id:"+customerId);
gridMonthProjectStats(customerId, dimId, dimGridList);
//}
}
@ -527,9 +537,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());
factGridProjectDailyService.delDateProject(delEntity);
//3.2:批量保存网格日统计数据
log.info("StatsProjectServiceImpl.gridDateProjectStats-批量新增网格项目日统计表数据,对应客户Id:"+customerId+",日维度Id:"+dimId.getDateId());
factGridProjectDailyService.insertBatch(gridDateEntityList);
}
@ -604,9 +616,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());
factGridProjectMonthlyService.delMonthProject(delEntity);
//3.2:批量保存机关月统计数据
log.info("StatsProjectServiceImpl.gridMonthProjectStats-批量新增网格项目月统计表数据,对应客户Id:"+customerId+",月维度Id:"+dimId.getMonthId());
factGridProjectMonthlyService.insertBatch(monthlyEntityList);
}
@ -622,7 +636,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) {

170
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java

@ -160,10 +160,18 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
Date finalStatsDate = statsDate;
//executorService.submit(() -> {
//统计
try {
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);
}
}
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
@ -187,13 +195,17 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
executorService.submit(() -> {
try {
statsTagUsedMonthly(dimIdBean.getMonthId(), customerId);
} catch (Exception e) {
log.error("statsTagUsedMonthly 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);
}
}
});
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
@ -218,9 +230,17 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
Date finalStatsDate = statsDate;
//统计
statsTagViewedDaily(finalStatsDate, dimIdBean, customerId);
try {
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);
}
}
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
@ -247,7 +267,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
try {
statsTagViewedMonthly(dimIdBean.getMonthId(), customerId);
} catch (Exception e) {
log.error("statsTagViewedMonthly 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);
}
}
}
}
@ -277,7 +303,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
log.debug("start === statsTagUsedQuarterly ");
statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId);
} catch (Exception e) {
log.error("statsTagUsedQuarterly 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(() -> {
@ -285,7 +317,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
log.debug("start === statsTagUsedQuarterly ");
statsTagUsedYearly(dimIdBean.getYearId(), customerId);
} catch (Exception e) {
log.error("statsTagUsedYearly 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);
}
}
});
}
@ -316,15 +354,29 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
log.debug("start === statsTagViewedQuarterly ");
statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId);
} catch (Exception e) {
log.error("statsTagUsedQuarterly 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(() -> {
try {
log.debug("start === statsTagViewedYearly ");
statsTagViewedYearly(dimIdBean.getYearId(), customerId);
} catch (Exception e) {
log.error("statsTagUsedYearly 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);
}
}
});
}
@ -363,6 +415,7 @@ 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);
@ -436,7 +489,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
}
boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values());
} catch (Exception e) {
log.error("statsPublishedGridDaily exception customerId:{},statsDate:{}", customerId, statsDate);
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);
@ -507,7 +561,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values());
} catch (Exception e) {
e.printStackTrace();
log.error("statsPublishedAgencyDaily exception,customer:{}", customerId);
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);
@ -525,7 +579,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) {
try {
//1.业务数据来源 发布时间为统计时间的
// 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分
// 1.1查出今天所有的文章标签 根据网格Id
@ -600,14 +654,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailySelfMap);
}
factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values());
} catch (Exception e) {
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);
}
}
}
/**
@ -618,7 +665,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagViewedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) {
try {
//1.业务数据来源 发布时间为统计时间的
// 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分
// 1.1查出今天所有的文章标签 根据网格Id
@ -701,15 +748,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailySelfMap);
}
factTagViewedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values());
} catch (Exception e) {
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);
}
}
}
/**
@ -719,7 +757,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagUsedMonthly(String monthId, String customerId) {
try {
List<FactTagUsedGridDailyEntity> gridDailyList = factTagUsedGridDailyService.getTagUsedCountByMonth(customerId, monthId);
if (!CollectionUtils.isEmpty(gridDailyList)) {
List<FactTagUsedGridMonthlyEntity> gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagUsedGridMonthlyEntity.class);
@ -735,14 +772,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List<FactTagUsedAgencyMonthlyEntity> agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class);
factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList));
}
} catch (Exception e) {
try {
String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按月统计标签被使用次数", customerId, monthId, e.getMessage());
HttpClientManager.getInstance().sendAlarmMsg(content);
} catch (Exception ex) {
log.error("sendAlarmMsg exception", e);
}
}
}
/**
@ -752,7 +781,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagViewedMonthly(String monthId, String customerId) {
try {
List<FactTagViewedGridDailyEntity> gridDailyList = factTagViewedGridDailyService.getTagViewedCountByMonth(customerId, monthId);
if (!CollectionUtils.isEmpty(gridDailyList)) {
List<FactTagViewedGridMonthlyEntity> gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagViewedGridMonthlyEntity.class);
@ -764,14 +793,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List<FactTagViewedAgencyMonthlyEntity> agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagViewedAgencyMonthlyEntity.class);
factTagViewedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList));
}
} catch (Exception e) {
try {
String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按月统计标签被查看次数", customerId, monthId, e.getMessage());
HttpClientManager.getInstance().sendAlarmMsg(content);
} catch (Exception ex) {
log.error("sendAlarmMsg exception", e);
}
}
}
/**
@ -781,7 +803,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagUsedQuarterly(String quarterId, String customerId) {
try {
List<FactTagUsedGridMonthlyEntity> gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId);
if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List<FactTagUsedGridQuarterlyEntity> gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class);
@ -797,14 +819,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List<FactTagUsedAgencyQuarterlyEntity> agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class);
factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList);
}
} catch (Exception e) {
try {
String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按季统计标签被使用次数", customerId, quarterId, e.getMessage());
HttpClientManager.getInstance().sendAlarmMsg(content);
} catch (Exception ex) {
log.error("sendAlarmMsg exception", e);
}
}
}
/**
@ -814,7 +829,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagViewedQuarterly(String quarterId, String customerId) {
try {
List<FactTagViewedGridMonthlyEntity> gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId);
if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List<FactTagViewedGridQuarterlyEntity> gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class);
@ -826,14 +841,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List<FactTagViewedAgencyQuarterlyEntity> agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class);
factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList);
}
} catch (Exception e) {
try {
String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按季统计标签被查看次数", customerId, quarterId, e.getMessage());
HttpClientManager.getInstance().sendAlarmMsg(content);
} catch (Exception ex) {
log.error("sendAlarmMsg exception", e);
}
}
}
/**
@ -843,7 +851,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
* @param customerId
*/
private void statsTagUsedYearly(String yearId, String customerId) {
try {
List<FactTagUsedGridMonthlyEntity> gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByYearId(customerId, yearId);
if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List<FactTagUsedGridYearlyEntity> gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridYearlyEntity.class);
@ -859,14 +867,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List<FactTagUsedAgencyYearlyEntity> agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class);
factTagUsedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList);
}
} catch (Exception e) {
try {
String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按年统计标签被使用次数", customerId, yearId, e.getMessage());
HttpClientManager.getInstance().sendAlarmMsg(content);
} catch (Exception ex) {
log.error("sendAlarmMsg exception", e);
}
}
}
/**
@ -877,7 +878,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
*/
private void statsTagViewedYearly(String yearId, String customerId) {
try {
List<FactTagViewedGridMonthlyEntity> gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId);
if (!CollectionUtils.isEmpty(gridMonthlyList)) {
List<FactTagViewedGridYearlyEntity> gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class);
@ -888,14 +889,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService {
List<FactTagViewedAgencyYearlyEntity> agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class);
factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList);
}
} catch (Exception e) {
try {
String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按年统计标签被查看次数", customerId, yearId, e.getMessage());
HttpClientManager.getInstance().sendAlarmMsg(content);
} catch (Exception ex) {
log.error("sendAlarmMsg exception", e);
}
}
}
private void setTagUsedData2ParentAgency(Map<String, DimAgencyEntity> dimAgencyEntityMap, Map<String, FactTagUsedAgencyDailyEntity> agencyDailyEntityMap, FactTagUsedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) {

5
epmet-openapi/epmet-openapi-scan/src/main/resources/readme

@ -3,6 +3,5 @@ sadd epmet:openapi:scan:whitelist "客户端ip地址"
#eg:
sadd epmet:openapi:scan:whitelist "\"192.168.1.1\""
#于洋家的ip
27.219.156.47
116.179.32.197(可以删除了)
#del
srem 'epmet:openapi:scan:whitelist' "\"116.179.32.197\"" "\"27.219.156.47\""
Loading…
Cancel
Save