Browse Source

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

# Conflicts:
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java
#	epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml
feature/evaluate
wangchao 5 years ago
parent
commit
624c36ead3
  1. 2
      epmet-cloud-generator/src/main/resources/application.yml
  2. 41
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  3. 100
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  4. 15
      epmet-module/data-report/data-report-client/pom.xml
  5. 11
      epmet-module/data-report/data-report-server/Dockerfile
  6. 17
      epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml
  7. 17
      epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml
  8. 159
      epmet-module/data-report/data-report-server/pom.xml
  9. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java
  10. 24
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
  11. 119
      epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
  12. 20
      epmet-module/data-report/pom.xml
  13. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java
  14. 66
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsSubject.java
  15. 38
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java
  16. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java
  17. 177
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java
  18. 172
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectMonthlyDTO.java
  19. 172
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java
  20. 172
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectMonthlyDTO.java
  21. 11
      epmet-module/data-statistical/data-statistical-server/Dockerfile
  22. 17
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
  23. 17
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml
  24. 43
      epmet-module/data-statistical/data-statistical-server/pom.xml
  25. 49
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/AsyncConfig.java
  26. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
  27. 59
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  28. 86
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java
  29. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java
  30. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java
  31. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerDao.java
  32. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerDepartmentDao.java
  33. 44
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java
  34. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java
  35. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java
  36. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java
  37. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java
  38. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java
  39. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java
  40. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java
  41. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java
  42. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java
  43. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java
  44. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java
  45. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java
  46. 91
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java
  47. 63
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java
  48. 82
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java
  49. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java
  50. 147
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java
  51. 142
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectMonthlyEntity.java
  52. 142
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java
  53. 142
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectMonthlyEntity.java
  54. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/LastExecRecordEntity.java
  55. 125
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java
  56. 85
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java
  57. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/properties/ThreadProperties.java
  58. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java
  59. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java
  60. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java
  61. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java
  62. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerService.java
  63. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerServiceImpl.java
  64. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java
  65. 172
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
  66. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java
  67. 68
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java
  68. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java
  69. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java
  70. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java
  71. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java
  72. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerDepartmentServiceImpl.java
  73. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java
  74. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java
  75. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java
  76. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java
  77. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java
  78. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java
  79. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java
  80. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.java
  81. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java
  82. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java
  83. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java
  84. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/LastExecRecordService.java
  85. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java
  86. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java
  87. 87
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java
  88. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java
  89. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
  90. 67
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java
  91. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java
  92. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java
  93. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java
  94. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java
  95. 45
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java
  96. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java
  97. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java
  98. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java
  99. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java
  100. 33
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml

2
epmet-cloud-generator/src/main/resources/application.yml

@ -9,7 +9,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.1.130:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://192.168.1.130:3306/epmet_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: epmet_dba
password: EpmEt-dbA-UsEr
#oracle配置

41
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -8,6 +8,8 @@
package com.epmet.commons.tools.redis;
import com.epmet.commons.tools.constant.StrConstant;
/**
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
@ -213,4 +215,43 @@ public class RedisKeys {
public static String getAgencyByIdKey(String agencyId) {
return rootPrefix.concat("gov:agency:").concat(agencyId);
}
/**
* 客户标签排行 缓存Key
* @param customerId
* @return
*/
public static String getCustomerTagKey(String customerId) {
return rootPrefix.concat("tags:customer:rankingTag:").concat(customerId);
}
/**
* 客户关联标签 缓存Key
* @param customerId
* @param tagId
* @return
*/
public static String getCustomerReTagKey(String customerId,String tagId) {
return rootPrefix.concat("tags:customer:relationTag:").concat(customerId).concat(StrConstant.COLON).concat(tagId);
}
/**
* 网格标签排行 缓存Key
* @param gridId
* @return
*/
public static String getGridTagKey(String gridId) {
return rootPrefix.concat("tags:grid:rankingTag:").concat(gridId);
}
/**
* 网格关联标签 缓存Key
* @param gridId
* @param tagId
* @return
*/
public static String getGridReTagKey(String gridId,String tagId) {
return rootPrefix.concat("tags:grid:relationTag:").concat(gridId).concat(StrConstant.COLON).concat(tagId);
}
}

100
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -16,6 +16,7 @@ import org.joda.time.format.DateTimeFormatter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
@ -25,6 +26,7 @@ import java.util.Date;
* @since 1.0.0
*/
public class DateUtils {
/** 时间格式(yyyy-MM-dd) */
public final static String DATE_PATTERN = "yyyy-MM-dd";
/** 时间格式(yyyy-MM-dd HH:mm:ss) */
@ -34,6 +36,15 @@ public class DateUtils {
/** 时间格式(yyyy-MM-dd HH:mm) */
public final static String DATE_TIME_PATTERN_END_WITH_MINUTE = "yyyy-MM-dd HH:mm";
public static final String DATE_PATTERN_YYYYMMDD = "yyyyMMdd";
public static final String DATE_NAME_PATTERN = "yyyy年MM月dd日";
public static final String MONTH_NAME_PATTERN = "yyyy年MM月";
public static final String DATE_PATTERN_YYYY = "yyyy";
public static final String DATE_PATTERN_YYYYMM = "yyyyMM";
public static final String WEEK_TYPE_ENGLISH = "english";
public static final String WEEK_TYPE_CHINESE = "chinese";
/**
* 日期格式化 日期格式为yyyy-MM-dd
* @param date 日期
@ -184,4 +195,93 @@ public class DateUtils {
DateTime dateTime = new DateTime(date);
return dateTime.plusYears(years).toDate();
}
/**
* 获取星期几例如星期一
* @param date
* @return
*/
public static String getWeekNameOfWeek(Date date, String type) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
String[] chineseWeekDayName = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
String[] englishWeekDayName = { "Sunday", "Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" };
String weekDayName;
switch (type) {
case WEEK_TYPE_ENGLISH:
weekDayName = englishWeekDayName[dayOfWeek - 1];
break;
case WEEK_TYPE_CHINESE:
weekDayName = chineseWeekDayName[dayOfWeek - 1];
break;
default:
weekDayName = "";
}
return weekDayName;
}
//public static String getEnglishWeekName(Date date) {
// new SimpleDateFormat("E");
//}
/**
* 获取属于一年的第几周
* @param date
* @return
*/
public static int getWeekOfYear(Date date) {
DateTime dateTime = new DateTime(date);
return dateTime.getWeekOfWeekyear();
}
/**
* 按照格式进行时间取整
* @param targetDate
* @param pattern
* @return
*/
public static Date integrate(Date targetDate, String pattern) {
return DateUtils.parse(DateUtils.format(targetDate, pattern), pattern);
}
/**
* 查询指定日期是几月
* @param date
* @return
*/
public static int getMonthOfYear(Date date) {
LocalDate localDate = new LocalDate(date);
return localDate.getMonthOfYear();
}
/**
* 获取季度
* @param date
* @return
*/
public static int getQuarterIndex(Date date) {
LocalDate localDate = new LocalDate(date);
int monthOfYear = localDate.getMonthOfYear();
if (monthOfYear == 1 || monthOfYear == 2 || monthOfYear == 3) {
return 1;
}
if (monthOfYear == 4 || monthOfYear == 5 || monthOfYear == 6) {
return 2;
}
if (monthOfYear == 7 || monthOfYear == 8 || monthOfYear == 9) {
return 3;
}
return 4;
}
public static void main(String[] args) {
//int weekOfYear = getWeekOfYear(new Date());
int quarterIndex = DateUtils.getQuarterIndex(DateUtils.parse("20201001", DateUtils.DATE_PATTERN_YYYYMMDD));
System.out.println(666);
}
}

15
epmet-module/data-report/data-report-client/pom.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>data-report</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>data-report-client</artifactId>
</project>

11
epmet-module/data-report/data-report-server/Dockerfile

@ -0,0 +1,11 @@
FROM java:8
RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone
COPY ./target/*.jar ./app.jar
EXPOSE 8109
ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"]

17
epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
data-report-server:
container_name: data-report-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.1
ports:
- "8109:8109"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/dev:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 250M

17
epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
data-report-server:
container_name: data-report-server-dev
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-report-server:0.3.1
ports:
- "8108:8108"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/test:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 400M

159
epmet-module/data-report/data-report-server/pom.xml

@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.1</version>
<artifactId>data-report-server</artifactId>
<parent>
<artifactId>data-report</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>data-report-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-mybatis</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring.boot.admin.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!--服务调用相关依赖-->
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-service-call</artifactId>
<version>0.3.1</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<server.port>8109</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<!-- 数据库配置-->
<datasource.druid.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.url>
<datasource.druid.username>epmet_data_statistical_user</datasource.druid.username>
<datasource.druid.password>EpmEt-db-UsEr</datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>118.190.150.119</spring.redis.host>
<spring.redis.port>47379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>122.152.200.70:8848</nacos.server-addr>
<nacos.discovery.namespace>fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
</properties>
</profile>
<profile>
<id>test</id>
<!--<activation>
<activeByDefault>true</activeByDefault>
</activation>-->
<properties>
<server.port>8109</server.port>
<spring.profiles.active>test</spring.profiles.active>
<!-- 数据库配置-->
<datasource.druid.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.url>
<datasource.druid.username>epmet</datasource.druid.username>
<datasource.druid.password>elink@833066</datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>EpmEtrEdIs!q@w</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>192.168.10.150:8848</nacos.server-addr>
<nacos.discovery.namespace>67e3c350-533e-4d7c-9f8f-faf1b4aa82ae</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>true</spring.flyway.enabled>
</properties>
</profile>
</profiles>
</project>

11
epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java

@ -0,0 +1,11 @@
package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DataReportApplication {
public static void main(String[] args) {
SpringApplication.run(DataReportApplication.class, args);
}
}

24
epmet-module/data-report/data-report-server/src/main/java/com/epmet/config/ModuleConfigImpl.java

@ -0,0 +1,24 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
package com.epmet.config;
import com.epmet.commons.tools.config.ModuleConfig;
import org.springframework.stereotype.Service;
/**
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Service
public class ModuleConfigImpl implements ModuleConfig {
@Override
public String getName() {
return "data-report";
}
}

119
epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml

@ -0,0 +1,119 @@
server:
port: @server.port@
servlet:
context-path: /data/report
spring:
main:
allow-bean-definition-overriding: true
application:
name: data-report-server
#环境 dev|test|prod
profiles:
active: dev
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
redis:
database: @spring.redis.index@
host: @spring.redis.host@
port: @spring.redis.port@
password: @spring.redis.password@
timeout: 30s
datasource:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.url@
username: @datasource.druid.username@
password: @datasource.druid.password@
cloud:
nacos:
discovery:
server-addr: @nacos.server-addr@
#nacos的命名空间ID,默认是public
namespace: @nacos.discovery.namespace@
#不把自己注册到注册中心的地址
register-enabled: @nacos.register-enabled@
ip: @nacos.ip@
config:
enabled: @nacos.config-enabled@
server-addr: @nacos.server-addr@
namespace: @nacos.config.namespace@
group: @nacos.config.group@
file-extension: yaml
#指定共享配置,且支持动态刷新
# ext-config:
# - data-id: datasource.yaml
# group: ${spring.cloud.nacos.config.group}
# refresh: true
# - data-id: common.yaml
# group: ${spring.cloud.nacos.config.group}
# refresh: true
# 数据迁移工具flyway
flyway:
enabled: false
locations: classpath:db/migration
url: @datasource.druid.url@
user: @datasource.druid.username@
password: @datasource.druid.password@
baseline-on-migrate: true
baseline-version: 0
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.epmet.entity
global-config:
#数据库相关配置
db-config:
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
id-type: INPUT
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
field-strategy: NOT_NULL
#驼峰下划线转换
column-underline: true
banner: false
#原生配置
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
feign:
hystrix:
enabled: true
client:
config:
default:
loggerLevel: BASIC
httpclient:
enabled: true
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 60000 #缺省为1000
ribbon:
ReadTimeout: 300000
ConnectTimeout: 300000
#pageHelper分页插件
pagehelper:
helper-dialect: mysql
reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1

20
epmet-module/data-report/pom.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>epmet-module</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>data-report</artifactId>
<packaging>pom</packaging>
<modules>
<module>data-report-client</module>
<module>data-report-server</module>
</modules>
</project>

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java

@ -6,5 +6,7 @@ public interface DataSourceConstant {
String STATS = "stats";
String GOV_ISSUE = "govIssue";
String GOV_PROJECT = "govProject";
String GOV_VOICE = "govVoice";
String OPER_CRM = "operCrm";
}

66
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsSubject.java

@ -0,0 +1,66 @@
package com.epmet.constant;
public interface StatsSubject {
String DIM_AGENCY = "dim_agency";
String DIM_CUSTOMER = "dim_customer";
String DIM_DATE = "dim_date";
String DIM_DEPARTMENT = "dim_department";
String DIM_GRID = "dim_grid";
String DIM_MONTH = "dim_month";
String DIM_QUARTER = "dim_quarter";
String DIM_TOPIC_STATUS = "dim_topic_status";
String DIM_WEEK = "dim_week";
String DIM_YEAR = "dim_year";
String FACT_AGENCY_PROJECT_DAILY = "fact_agency_project_daily";
String FACT_AGENCY_PROJECT_MONTHLY = "fact_agency_project_monthly";
String FACT_ARTICLE_PUBLISHED_AGENCY_DAILY = "fact_article_published_agency_daily";
String FACT_ARTICLE_PUBLISHED_DEPARTMENT_DAILY = "fact_article_published_department_daily";
String FACT_ARTICLE_PUBLISHED_GRID_DAILY = "fact_article_published_grid_daily";
String FACT_GRID_PROJECT_DAILY = "fact_grid_project_daily";
String FACT_GRID_PROJECT_MONTHLY = "fact_grid_project_monthly";
String FACT_GROUP_AGENCY_DAILY = "fact_group_agency_daily";
String FACT_GROUP_AGENCY_MONTHLY = "fact_group_agency_monthly";
String FACT_GROUP_GRID_DAILY = "fact_group_grid_daily";
String FACT_ISSUE_AGENCY_DAILY = "fact_issue_agency_daily";
String FACT_ISSUE_AGENCY_MONTHLY = "fact_issue_agency_monthly";
String FACT_ISSUE_GRID_DAILY = "fact_issue_grid_daily";
String FACT_ISSUE_GRID_MONTHLY = "fact_issue_grid_monthly";
String FACT_PARTICIPATION_USER_AGENCY_DAILY = "fact_participation_user_agency_daily";
String FACT_PARTICIPATION_USER_AGENCY_MONTHLY = "fact_participation_user_agency_monthly";
String FACT_PARTICIPATION_USER_GRID_DAILY = "fact_participation_user_grid_daily";
String FACT_PARTICIPATION_USER_GRID_MONTHLY = "fact_participation_user_grid_monthly";
String FACT_REG_USER_AGENCY_DAILY = "fact_reg_user_agency_daily";
String FACT_REG_USER_AGENCY_MONTHLY = "fact_reg_user_agency_monthly";
String FACT_REG_USER_GRID_DAILY = "fact_reg_user_grid_daily";
String FACT_REG_USER_GRID_MONTHLY = "fact_reg_user_grid_monthly";
String FACT_TAG_USED_AGENCY_DAILY = "fact_tag_used_agency_daily";
String FACT_TAG_USED_AGENCY_MONTHLY = "fact_tag_used_agency_monthly";
String FACT_TAG_USED_AGENCY_QUARTERLY = "fact_tag_used_agency_quarterly";
String FACT_TAG_USED_AGENCY_YEARLY = "fact_tag_used_agency_yearly";
String FACT_TAG_USED_DEPARTMENT_DAILY = "fact_tag_used_department_daily";
String FACT_TAG_USED_DEPARTMENT_MONTHLY = "fact_tag_used_department_monthly";
String FACT_TAG_USED_DEPARTMENT_QUARTERLY = "fact_tag_used_department_quarterly";
String FACT_TAG_USED_DEPARTMENT_YEARLY = "fact_tag_used_department_yearly";
String FACT_TAG_USED_GRID_DAILY = "fact_tag_used_grid_daily";
String FACT_TAG_USED_GRID_MONTHLY = "fact_tag_used_grid_monthly";
String FACT_TAG_USED_GRID_QUARTERLY = "fact_tag_used_grid_quarterly";
String FACT_TAG_USED_GRID_YEARLY = "fact_tag_used_grid_yearly";
String FACT_TAG_VIEWED_AGENCY_DAILY = "fact_tag_viewed_agency_daily";
String FACT_TAG_VIEWED_AGENCY_MONTHLY = "fact_tag_viewed_agency_monthly";
String FACT_TAG_VIEWED_AGENCY_QUARTERLY = "fact_tag_viewed_agency_quarterly";
String FACT_TAG_VIEWED_AGENCY_YEARLY = "fact_tag_viewed_agency_yearly";
String FACT_TAG_VIEWED_GRID_DAILY = "fact_tag_viewed_grid_daily";
String FACT_TAG_VIEWED_GRID_MONTHLY = "fact_tag_viewed_grid_monthly";
String FACT_TAG_VIEWED_GRID_QUARTERLY = "fact_tag_viewed_grid_quarterly";
String FACT_TAG_VIEWED_GRID_YEARLY = "fact_tag_viewed_grid_yearly";
String FACT_TOPIC_ISSUE_AGENCY_DAILY = "fact_topic_issue_agency_daily";
String FACT_TOPIC_ISSUE_AGENCY_MONTHLY = "fact_topic_issue_agency_monthly";
String FACT_TOPIC_ISSUE_GRID_DAILY = "fact_topic_issue_grid_daily";
String FACT_TOPIC_ISSUE_GRID_MONTHLY = "fact_topic_issue_grid_monthly";
String FACT_TOPIC_STATUS_AGENCY_DAILY = "fact_topic_status_agency_daily";
String FACT_TOPIC_STATUS_AGENCY_MONTHLY = "fact_topic_status_agency_monthly";
String FACT_TOPIC_STATUS_GRID_DAILY = "fact_topic_status_grid_daily";
String FACT_TOPIC_TOTAL_AGENCY_DAILY = "fact_topic_total_agency_daily";
String FACT_TOPIC_TOTAL_GRID_DAILY = "fact_topic_total_grid_daily";
String LAST_EXEC_RECORD = "last_exec_record";
}

38
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java

@ -0,0 +1,38 @@
package com.epmet.dto.stats;
/**
* @author jianjun liu
* @email liujianjun@yunzongnet.com
* @date 2020-06-17 16:43
**/
import lombok.Data;
import java.io.Serializable;
/**
* desc文章总数 统计返回结果 dto
*
* @author liujianjun
* @date 2020/6/17 16:43
*/
@Data
public class ArticleGridPublishedSummaryDTO implements Serializable {
private static final long serialVersionUID = 6755654148306711602L;
/**
* 客户id
*/
private String customerId;
/**
* 网格Id
*/
private String gridId;
/**
* 发布文章总数
*/
private Integer publishedCount;
/**
* 状态为发布中的文章总数
*/
private Integer publishingCount;
}

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java

@ -88,4 +88,6 @@ public class DimDateDTO implements Serializable {
*/
private Date updatedTime;
private String monthId;
}

177
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java

@ -0,0 +1,177 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据每日定时执行先删后增
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class FactAgencyProjectDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户Id dim_customer.id
*/
private String customerId;
/**
* 机关Id dim_agency.id
*/
private String agencyId;
/**
* 上级组织Iddim_agency.pid
*/
private String parentId;
/**
* 日维度Id dim_date.id
*/
private String dateId;
/**
* 周维度Id dim_week.id
*/
private String weekId;
/**
* 月维度Id dim_month.id
*/
private String monthId;
/**
* 年维度Id dim_year.id
*/
private String yearId;
/**
* 截止当日项目总数 当前组织及下级项目总数
*/
private Integer projectTotal;
/**
* 截止当日处理中项目数 当前组织及下级所有未结案项目总数
*/
private Integer pendingTotal;
/**
* 截止当日处理中项目占比 当前组织及下级未结案项目百分比存百分比数小数点后两位
*/
private BigDecimal pendingRatio;
/**
* 截止当日已结案项目数 当前组织及下级已结案项目总数
*/
private Integer closedTotal;
/**
* 截止当日已结案项目占比 当前组织及下级已结案项目百分比存百分比数小数点后两位
*/
private BigDecimal closedRatio;
/**
* 截止当日已结案中已解决项目数 当前组织及下级已结案项目中已解决总数
*/
private Integer resolvedTotal;
/**
* 截止当日已结案中已解决项目占比 当前组织及下级已结案项目中已解决占比
*/
private BigDecimal resolvedRatio;
/**
* 截止当日已结案中未解决项目数 当前组织及下级已结案项目中未解决总数
*/
private Integer unresolvedTotal;
/**
* 截止当日已结案中未解决项目占比 当前组织及下级已结案项目中未解决占比
*/
private BigDecimal unresolvedRatio;
/**
* 当日项目总数 当前组织及下级项目总数
*/
private Integer projectIncr;
/**
* 当日处理中项目数 当前组织及下级前一日新增处理中项目数
*/
private Integer pendingIncr;
/**
* 当日已结案项目数 当前组织及下级前一日新增结案项目数
*/
private Integer closedIncr;
/**
* 当日已结案项目中已解决数 当前组织及下级前一日新增结案中已解决项目数
*/
private Integer resolvedIncr;
/**
* 当日已结案项目组未解决数 当前组织及下级前一日新增结案中未解决项目数
*/
private Integer unresolvedIncr;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

172
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectMonthlyDTO.java

@ -0,0 +1,172 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据每月月初定时执行先删后增
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class FactAgencyProjectMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户Id dim_customer.id
*/
private String customerId;
/**
* 机关Id dim_agency.id
*/
private String agencyId;
/**
* 上级组织Iddim_agency.pid
*/
private String parentId;
/**
* 月维度Id dim_month.id
*/
private String monthId;
/**
* 季维度Id dim_quarter.id
*/
private String quarterId;
/**
* 年维度Id dim_year.id
*/
private String yearId;
/**
* 截止当月项目总数 当前组织及下级项目总数
*/
private Integer projectTotal;
/**
* 截止当月处理中项目数 当前组织及下级所有未结案项目总数
*/
private Integer pendingTotal;
/**
* 截止当月处理中项目占比 当前组织及下级未结案项目百分比存百分比数小数点后两位
*/
private BigDecimal pendingRatio;
/**
* 截止当月已结案项目数 当前组织及下级已结案项目总数
*/
private Integer closedTotal;
/**
* 截止当月已结案项目占比 当前组织及下级已结案项目百分比存百分比数小数点后两位
*/
private BigDecimal closedRatio;
/**
* 截止当月已结案中已解决项目数 当前组织及下级已结案项目中已解决总数
*/
private Integer resolvedTotal;
/**
* 截止当月已结案中已解决项目占比 当前组织及下级已结案项目中已解决占比
*/
private BigDecimal resolvedRatio;
/**
* 截止当月已结案中未解决项目数 当前组织及下级已结案项目中未解决总数
*/
private Integer unresolvedTotal;
/**
* 截止当月已结案中未解决项目占比 当前组织及下级已结案项目中未解决占比
*/
private BigDecimal unresolvedRatio;
/**
* 当月项目总数 当前组织及下级前一月新增项目数
*/
private Integer projectIncr;
/**
* 当月处理中项目数 当前组织及下级前一月新增处理中项目数
*/
private Integer pendingIncr;
/**
* 当月已结案项目数 当前组织及下级前一月新增结案项目数
*/
private Integer closedIncr;
/**
* 当月已结案项目中已解决数 当前组织及下级前一日新增结案中已解决项目数
*/
private Integer resolvedIncr;
/**
* 当月已结案项目组未解决数 当前组织及下级前一日新增结案中未解决项目数
*/
private Integer unresolvedIncr;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

172
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java

@ -0,0 +1,172 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据每日定时执行先删后增
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class FactGridProjectDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户Id dim_customer.id
*/
private String customerId;
/**
* 机关Id dim_agency.id
*/
private String agencyId;
/**
* 网格Id dim_grid.id
*/
private String gridId;
/**
* 日维度Id dim_date.id
*/
private String dateId;
/**
* 周维度Id dim_week.id
*/
private String weekId;
/**
* 月维度Id dim_month.id
*/
private String monthId;
/**
* 截止当日网格下项目总数 当前组织及下级项目总数
*/
private Integer projectTotal;
/**
* 截止当日网格下处理中项目数 当前组织及下级所有未结案项目总数
*/
private Integer pendingTotal;
/**
* 截止当日网格下处理中项目占比 当前组织及下级未结案项目百分比存百分比数小数点后两位
*/
private BigDecimal pendingRatio;
/**
* 截止当日网格下已结案项目数 当前组织及下级已结案项目总数
*/
private Integer closedTotal;
/**
* 截止当日网格下已结案项目占比 当前组织及下级已结案项目百分比存百分比数小数点后两位
*/
private BigDecimal closedRatio;
/**
* 截止当日已结案中已解决项目数 当前组织及下级已结案项目中已解决总数
*/
private Integer resolvedTotal;
/**
* 截止当日已结案中已解决项目占比 当前组织及下级已结案项目中已解决占比
*/
private BigDecimal resolvedRatio;
/**
* 截止当日已结案中未解决项目数 当前组织及下级已结案项目中未解决总数
*/
private Integer unresolvedTotal;
/**
* 截止当日已结案中未解决项目占比 当前组织及下级已结案项目中未解决占比
*/
private BigDecimal unresolvedRatio;
/**
* 当日已结案项目中已解决数 当前组织及下级前一日新增结案中已解决项目数
*/
private Integer resolvedIncr;
/**
* 当日已结案项目组未解决数 当前组织及下级前一日新增结案中未解决项目数
*/
private Integer unresolvedIncr;
/**
* 当日网格下项目总数 该网格下项目总数
*/
private Integer gridIncr;
/**
* 当日网格下处理中项目数 该网格下未结案项目总数
*/
private Integer pendingIncr;
/**
* 当日网格下已结案项目数 该网格下已结案项目总数
*/
private String closedIncr;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

172
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectMonthlyDTO.java

@ -0,0 +1,172 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.stats;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据每月月初定时执行先删后增
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class FactGridProjectMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户Id dim_customer.id
*/
private String customerId;
/**
* 机关Id dim_agency.id
*/
private String agencyId;
/**
* 网格Id dim_grid.id
*/
private String gridId;
/**
* 月维度Id dim_month.id
*/
private String monthId;
/**
* 季维度Id dim_quarter.id
*/
private String quarterId;
/**
* 年维度Id dim_year.id
*/
private String yearId;
/**
* 截止当月项目总数 当前组织及下级项目总数
*/
private Integer projectTotal;
/**
* 截止当月处理中项目数 当前组织及下级所有未结案项目总数
*/
private Integer pendingTotal;
/**
* 截止当月处理中项目占比 当前组织及下级未结案项目百分比存百分比数小数点后两位
*/
private BigDecimal pendingRatio;
/**
* 截止当月已结案项目数 当前组织及下级已结案项目总数
*/
private Integer closedTotal;
/**
* 截止当月已结案项目占比 当前组织及下级已结案项目百分比存百分比数小数点后两位
*/
private BigDecimal closedRatio;
/**
* 截止当月已结案中已解决项目数 当前组织及下级已结案项目中已解决总数
*/
private Integer resolvedTotal;
/**
* 截止当月已结案中已解决项目占比 当前组织及下级已结案项目中已解决占比
*/
private BigDecimal resolvedRatio;
/**
* 截止当月已结案中未解决项目数 当前组织及下级已结案项目中未解决总数
*/
private Integer unresolvedTotal;
/**
* 截止当月已结案中未解决项目占比 当前组织及下级已结案项目中未解决占比
*/
private BigDecimal unresolvedRatio;
/**
* 当月项目总数 当前组织及下级前一月新增项目数
*/
private Integer projectIncr;
/**
* 当月处理中项目数 当前组织及下级前一月新增处理中项目数
*/
private Integer pendingIncr;
/**
* 当月已结案项目数 当前组织及下级前一月新增结案项目数
*/
private Integer closedIncr;
/**
* 当月已结案项目中已解决数 当前组织及下级前一日新增结案中已解决项目数
*/
private Integer resolvedIncr;
/**
* 当月已结案项目组未解决数 当前组织及下级前一日新增结案中未解决项目数
*/
private Integer unresolvedIncr;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

11
epmet-module/data-statistical/data-statistical-server/Dockerfile

@ -0,0 +1,11 @@
FROM java:8
RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone
COPY ./target/*.jar ./app.jar
EXPOSE 8108
ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"]

17
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
data-statistical-server:
container_name: data-statistical-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.1
ports:
- "8108:8108"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/dev:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 250M

17
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
data-statistical-server:
container_name: data-statistical-server-dev
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.1
ports:
- "8108:8108"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/test:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 400M

43
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -2,6 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.1</version>
<parent>
<artifactId>data-statistical</artifactId>
<groupId>com.epmet</groupId>
@ -122,6 +123,18 @@
<datasource.druid.project.username>epmet_gov_project_user</datasource.druid.project.username>
<datasource.druid.project.password>EpmEt-db-UsEr</datasource.druid.project.password>
<datasource.druid.voice.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_gov_voice?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.voice.url>
<datasource.druid.voice.username>epmet_gov_voice_user</datasource.druid.voice.username>
<datasource.druid.voice.password>EpmEt-db-UsEr</datasource.druid.voice.password>
<datasource.druid.voice.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_oper_crm?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.voice.url>
<datasource.druid.voice.username>epmet_oper_crm_user</datasource.druid.voice.username>
<datasource.druid.voice.password>EpmEt-db-UsEr</datasource.druid.voice.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
@ -138,6 +151,12 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>false</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
</properties>
</profile>
<profile>
@ -151,10 +170,10 @@
<!-- 数据库配置-->
<datasource.druid.stats.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_data_stats?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.stats.url>
<datasource.druid.username>epmet</datasource.druid.username>
<datasource.druid.password>elink@833066</datasource.druid.password>
<datasource.druid.stats.username>epmet</datasource.druid.stats.username>
<datasource.druid.stats.password>elink@833066</datasource.druid.stats.password>
<datasource.druid.org.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_gov_org?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
@ -174,6 +193,18 @@
<datasource.druid.project.username>epmet_gov_project_user</datasource.druid.project.username>
<datasource.druid.project.password>EpmEt-db-UsEr</datasource.druid.project.password>
<datasource.druid.voice.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_gov_voice?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.voice.url>
<datasource.druid.voice.username>epmet</datasource.druid.voice.username>
<datasource.druid.voice.password>elink@8473066</datasource.druid.voice.password>
<datasource.druid.crm.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_oper_crm?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.crm.url>
<datasource.druid.crm.username>epmet</datasource.druid.crm.username>
<datasource.druid.crm.password>elink@8473066</datasource.druid.crm.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
@ -190,6 +221,12 @@
<!--flyway migration 数据库迁移工具-->
<spring.flyway.enabled>true</spring.flyway.enabled>
<!--线程池配置-->
<thread.pool.core-pool-size>5</thread.pool.core-pool-size>
<thread.pool.max-pool-size>8</thread.pool.max-pool-size>
<thread.pool.queue-capacity>10</thread.pool.queue-capacity>
<thread.pool.keep-alive>30</thread.pool.keep-alive>
</properties>
</profile>
</profiles>

49
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/AsyncConfig.java

@ -0,0 +1,49 @@
package com.epmet.config;
import com.epmet.properties.ThreadProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
/**
* 线程池配置类
*/
@Configuration
@EnableConfigurationProperties(ThreadProperties.class)
@EnableAsync
public class AsyncConfig {
@Autowired
private ThreadProperties threadProperties;
@Bean
public Executor executor() {
ThreadProperties.ThreadPoolProperties threadPoolProps = threadProperties.getThreadPool();
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(threadPoolProps.getCorePoolSize());
executor.setMaxPoolSize(threadPoolProps.getMaxPoolSize());
executor.setQueueCapacity(threadPoolProps.getQueueCapacity());
executor.setThreadNamePrefix("data-stats-");
// rejection-policy:当pool已经达到max size的时候,如何处理新任务
// CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); //对拒绝task的处理策略
executor.setKeepAliveSeconds(threadPoolProps.getKeepAlive());
executor.initialize();
return executor;
}
@Bean
public ExecutorService executorService() {
ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) executor();
return executor.getThreadPoolExecutor();
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/ModuleConfigImpl.java

@ -19,6 +19,6 @@ import org.springframework.stereotype.Service;
public class ModuleConfigImpl implements ModuleConfig {
@Override
public String getName() {
return "data-stats";
return "data-statistical";
}
}

59
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -7,6 +7,11 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.List;
@RequestMapping("demo")
@ -16,6 +21,9 @@ public class DemoController {
@Autowired
private StatsDemoService demoService;
@Autowired
private ExecutorService executorService;
@GetMapping("testlist")
public void testList() {
demoService.testList();
@ -26,11 +34,58 @@ public class DemoController {
demoService.testTx();
}
/**
* 异步方式1手动submit
*/
@GetMapping("testthreadpool")
public void testThreadPool() {
System.out.println(LocalDateTime.now().getSecond());;
System.out.println("----------->>");
Future<Boolean> future1 = executorService.submit(() -> demoService.testThreadPool());
Future<Boolean> future2 = executorService.submit(() -> demoService.testThreadPool());
Future<Boolean> future3 = executorService.submit(() -> demoService.testThreadPool());
try {
// 可以获取返回值,此处会阻塞
Boolean o1 = future1.get();
System.out.println(LocalDateTime.now().getSecond());
Boolean o2 = future2.get();
System.out.println(LocalDateTime.now().getSecond());
Boolean o3 = future3.get();
System.out.println(LocalDateTime.now().getSecond());
System.out.println("<<-----------");
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}
/**
* 异步方式2service方法中加注解@Async
*/
@GetMapping("testthreadpoolasyncs")
public void testThreadPoolAsync() {
System.out.println(LocalDateTime.now().getSecond());
System.out.println("----------->>");
demoService.testThreadPoolAsync();
demoService.testThreadPoolAsync();
demoService.testThreadPoolAsync();
demoService.testThreadPoolAsync();
demoService.testThreadPoolAsync();
}
@GetMapping("cascadegencyinfo")
public List<AgencySubTreeDto> selectAllAgency(){
List<AgencySubTreeDto> result = demoService.getAllAgency();
return result;
}
}

86
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java

@ -0,0 +1,86 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsDimService;
import com.epmet.service.stats.DimDateService;
import com.epmet.service.stats.DimMonthService;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("dim")
public class DimController {
@Autowired
private DimDateService dimDateService;
@Autowired
private DimMonthService dimMonthService;
@Autowired
private StatsDimService statsDimService;
/**
* 初始化按日维度
* @return
*/
@PostMapping("/date/init")
public Result initDateDim() {
dimDateService.initDimDate();
return new Result();
}
/**
* 初始化网格维度
* @return
*/
@PostMapping("/grid/init")
public Result initGridDim() {
statsDimService.initGridDim();
return new Result();
}
/**
* 初始化机关单位维度
* @return
*/
@PostMapping("/agency/init")
public Result intiAgencyDim() {
statsDimService.initAgencyDim();
return new Result();
}
/**
* 客户维度
* @return
*/
@PostMapping("/customer/init")
public Result intiCustomerDim() {
statsDimService.initCustomerDim();
return new Result();
}
/**
* 部门维度
* @return
*/
@PostMapping("/department/init")
public Result intiDepartmentDim() {
statsDimService.initDepartmentDim();
return new Result();
}
/**
* 月维度
* @return
*/
@PostMapping("/month/init")
public Result initMonthDim() {
dimMonthService.initMonthDim();
return new Result();
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java

@ -0,0 +1,29 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.ExecutorService;
/**
* desc:宣传能力controller
*/
@RequestMapping("publicity")
@RestController
public class PublicityController {
@Autowired
private StatsDemoService demoService;
@Autowired
private ExecutorService executorService;
@PostMapping(value = "publicitySummaryStatsjob")
public Result<Boolean> publicitySummaryStatsjob(){
return null;
}
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java

@ -1,23 +1,32 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.StatsDemoService;
import com.epmet.service.StatsProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* 数据统计-项目
* @author sun
*/
@RequestMapping("statsProject")
@RequestMapping("statsproject")
@RestController
public class StatsProjectController {
@Autowired
private StatsProjectService statsProjectService;
/**
* @param customerId
* @return
* @Author sun
* @Description 数据-项目-机关日()统计
**/
@PostMapping("agencyproject/{customerId}")
public Result statsAgencyProject(@PathVariable("customerId") String customerId) {
statsProjectService.statsAgencyProject(customerId);
return new Result();
}
}

46
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerDao.java

@ -0,0 +1,46 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.crm;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.crm.CustomerEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 客户表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-11
*/
@Mapper
public interface CustomerDao extends BaseDao<CustomerEntity> {
/**
* 根据创建时间起止查询有效客户列表
* @param createTimeFrom
* @param createTimeTo
* @return
*/
List<CustomerEntity> listValidCustomersByCreateTime(
@Param("createTimeFrom") Date createTimeFrom,
@Param("createTimeTo") Date createTimeTo);
}

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerDepartmentDao.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.org;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.org.CustomerDepartmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 客户部门表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Mapper
public interface CustomerDepartmentDao extends BaseDao<CustomerDepartmentEntity> {
List<CustomerDepartmentEntity> listDepartmentsByCreatedTime(
@Param("createdTimeFrom") Date createdTimeFrom,
@Param("createdTimeTo") Date createdTimeTo);
}

44
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java

@ -0,0 +1,44 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.org;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.org.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 客户网格表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-16
*/
@Mapper
public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
/**
* 根据创建时间截取时间段内的网格
* @param start
* @param end
* @return
*/
List<CustomerGridEntity> listGridsByCreateTime(@Param("start") Date start, @Param("end") Date end);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java

@ -6,6 +6,7 @@ import com.epmet.entity.org.CustomerAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
@ -13,6 +14,9 @@ public interface StatsCustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<CustomerAgencyEntity> listAllEntities();
List<CustomerAgencyEntity> listAgenciesByCreateTime(
@Param("statsStartTime") Date statsStartTime,
@Param("statsEndTime") Date statsEndTime);
List<AgencySubTreeDto> selectAllAgency();
List<AgencySubTreeDto> selectSubAgencyByPid(@Param("pid")String pid);

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java

@ -19,9 +19,12 @@ package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.stats.DimAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 机关维度
*
@ -30,5 +33,12 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface DimAgencyDao extends BaseDao<DimAgencyEntity> {
/**
* @param dto
* @return
* @Author sun
* @Description 根据客户Id查询机关维度列表数据
**/
List<DimAgencyDTO> selectDimAgencyList(DimAgencyDTO dto);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java

@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.DimCustomerEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 客户维度
*
@ -29,5 +31,16 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface DimCustomerDao extends BaseDao<DimCustomerEntity> {
/**
* desc: 分页获取客户id
*
* @param pageNo
* @param offset
* return: List<String>
* @date: 2020/6/17 16:33
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
List<String> selectCustomerIdPage(Integer pageNo, int offset);
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java

@ -18,9 +18,12 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.DimDateDTO;
import com.epmet.entity.stats.DimDateEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 日期维度表
*
@ -29,5 +32,19 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface DimDateDao extends BaseDao<DimDateEntity> {
/**
* @param dto
* @return
* @Author sun
* @Description 根据创建时间查询日维度信息
**/
List<DimDateDTO> selectDimDate(DimDateDTO dto);
/**
* 最新的按日维度
*/
DimDateDTO getLatestDimDate();
int insertOne(DimDateEntity dimDateEntity);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java

@ -18,9 +18,13 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.entity.stats.DimGridEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.Date;
import java.util.List;
/**
* 客户网格维度
*
@ -29,5 +33,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface DimGridDao extends BaseDao<DimGridEntity> {
DimGridEntity getLastCreatedGridDimEntity();
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactAgencyProjectDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface FactAgencyProjectDailyDao extends BaseDao<FactAgencyProjectDailyEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface FactAgencyProjectMonthlyDao extends BaseDao<FactAgencyProjectMonthlyEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactGridProjectDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface FactGridProjectDailyDao extends BaseDao<FactGridProjectDailyEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactGridProjectMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface FactGridProjectMonthlyDao extends BaseDao<FactGridProjectMonthlyEntity> {
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java

@ -0,0 +1,35 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.LastExecRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 最后一次执行记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface LastExecRecordDao extends BaseDao<LastExecRecordEntity> {
LastExecRecordEntity getLastExecRecord(@Param("statsSubject") String statsSubject);
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.voice;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.voice.ArticleEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface ArticleDao extends BaseDao<ArticleEntity> {
}

46
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java

@ -0,0 +1,46 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.voice;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO;
import com.epmet.entity.voice.ArticlePublishRangeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 文章发布范围表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Mapper
public interface ArticlePublishRangeDao extends BaseDao<ArticlePublishRangeEntity> {
/**
* desc:查询网格发布文章总数及状态为发布中的文章总数
*
* @param customerId
* @param createDate
* @return
*/
List<ArticleGridPublishedSummaryDTO> selectByCreatedDate(@Param("customerId") String customerId, @Param("createDate") Date createDate);
}

91
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java

@ -0,0 +1,91 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.crm;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 客户表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-11
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("customer")
public class CustomerEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户名称
*/
private String customerName;
/**
* 产品标题 显示在产品顶端的标题
*/
private String title;
/**
* 组织机构代码
*/
private String organizationNumber;
/**
* 组织机构代码证图片
*/
private String organizationImg;
/**
* 有效期
*/
private Date validityTime;
/**
* 客户管理员
*/
private String customerAdmin;
/**
* 密码 加密存储
*/
private String customerPassword;
/**
* 客户组织级别机关级别
* 社区级community
* 街道:street,
* 区县级: district,
* 市级: city
* 省级:province 机关级别社区级community街道:street,区县级: district,市级: city省级:province
*/
private String organizationLevel;
/**
* 客户logo
*/
private String logo;
}

63
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java

@ -0,0 +1,63 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.org;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 客户部门表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("customer_department")
public class CustomerDepartmentEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 所属组织机构IDcustomer_agency.id
*/
private String agencyId;
/**
* 部门名称
*/
private String departmentName;
/**
* 部门职责
*/
private String departmentDuty;
/**
* 总人数
*/
private Integer totalUser;
}

82
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java

@ -0,0 +1,82 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.org;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 客户网格表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("customer_grid")
public class CustomerGridEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 网格名称
*/
private String gridName;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
/**
* 所属地区码所属组织地区码
*/
private String areaCode;
/**
* 管辖区域
*/
private String manageDistrict;
/**
* 当前网格总人数
*/
private Integer totalUser;
/**
* 所属组织机构IDcustomer_organization.id
*/
private String pid;
/**
* 所有上级组织ID
*/
private String pids;
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java

@ -58,4 +58,6 @@ public class DimDateEntity extends BaseEpmetEntity {
*/
private String weekId;
private String monthId;
}

147
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java

@ -0,0 +1,147 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_agency_project_daily")
public class FactAgencyProjectDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id dim_customer.id
*/
private String customerId;
/**
* 机关Id dim_agency.id
*/
private String agencyId;
/**
* 上级组织Iddim_agency.pid
*/
private String parentId;
/**
* 日维度Id dim_date.id
*/
private String dateId;
/**
* 周维度Id dim_week.id
*/
private String weekId;
/**
* 月维度Id dim_month.id
*/
private String monthId;
/**
* 年维度Id dim_year.id
*/
private String yearId;
/**
* 截止当日项目总数 当前组织及下级项目总数
*/
private Integer projectTotal;
/**
* 截止当日处理中项目数 当前组织及下级所有未结案项目总数
*/
private Integer pendingTotal;
/**
* 截止当日处理中项目占比 当前组织及下级未结案项目百分比存百分比数小数点后两位
*/
private BigDecimal pendingRatio;
/**
* 截止当日已结案项目数 当前组织及下级已结案项目总数
*/
private Integer closedTotal;
/**
* 截止当日已结案项目占比 当前组织及下级已结案项目百分比存百分比数小数点后两位
*/
private BigDecimal closedRatio;
/**
* 截止当日已结案中已解决项目数 当前组织及下级已结案项目中已解决总数
*/
private Integer resolvedTotal;
/**
* 截止当日已结案中已解决项目占比 当前组织及下级已结案项目中已解决占比
*/
private BigDecimal resolvedRatio;
/**
* 截止当日已结案中未解决项目数 当前组织及下级已结案项目中未解决总数
*/
private Integer unresolvedTotal;
/**
* 截止当日已结案中未解决项目占比 当前组织及下级已结案项目中未解决占比
*/
private BigDecimal unresolvedRatio;
/**
* 当日项目总数 当前组织及下级项目总数
*/
private Integer projectIncr;
/**
* 当日处理中项目数 当前组织及下级前一日新增处理中项目数
*/
private Integer pendingIncr;
/**
* 当日已结案项目数 当前组织及下级前一日新增结案项目数
*/
private Integer closedIncr;
/**
* 当日已结案项目中已解决数 当前组织及下级前一日新增结案中已解决项目数
*/
private Integer resolvedIncr;
/**
* 当日已结案项目组未解决数 当前组织及下级前一日新增结案中未解决项目数
*/
private Integer unresolvedIncr;
}

142
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectMonthlyEntity.java

@ -0,0 +1,142 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_agency_project_monthly")
public class FactAgencyProjectMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id dim_customer.id
*/
private String customerId;
/**
* 机关Id dim_agency.id
*/
private String agencyId;
/**
* 上级组织Iddim_agency.pid
*/
private String parentId;
/**
* 月维度Id dim_month.id
*/
private String monthId;
/**
* 季维度Id dim_quarter.id
*/
private String quarterId;
/**
* 年维度Id dim_year.id
*/
private String yearId;
/**
* 截止当月项目总数 当前组织及下级项目总数
*/
private Integer projectTotal;
/**
* 截止当月处理中项目数 当前组织及下级所有未结案项目总数
*/
private Integer pendingTotal;
/**
* 截止当月处理中项目占比 当前组织及下级未结案项目百分比存百分比数小数点后两位
*/
private BigDecimal pendingRatio;
/**
* 截止当月已结案项目数 当前组织及下级已结案项目总数
*/
private Integer closedTotal;
/**
* 截止当月已结案项目占比 当前组织及下级已结案项目百分比存百分比数小数点后两位
*/
private BigDecimal closedRatio;
/**
* 截止当月已结案中已解决项目数 当前组织及下级已结案项目中已解决总数
*/
private Integer resolvedTotal;
/**
* 截止当月已结案中已解决项目占比 当前组织及下级已结案项目中已解决占比
*/
private BigDecimal resolvedRatio;
/**
* 截止当月已结案中未解决项目数 当前组织及下级已结案项目中未解决总数
*/
private Integer unresolvedTotal;
/**
* 截止当月已结案中未解决项目占比 当前组织及下级已结案项目中未解决占比
*/
private BigDecimal unresolvedRatio;
/**
* 当月项目总数 当前组织及下级前一月新增项目数
*/
private Integer projectIncr;
/**
* 当月处理中项目数 当前组织及下级前一月新增处理中项目数
*/
private Integer pendingIncr;
/**
* 当月已结案项目数 当前组织及下级前一月新增结案项目数
*/
private Integer closedIncr;
/**
* 当月已结案项目中已解决数 当前组织及下级前一日新增结案中已解决项目数
*/
private Integer resolvedIncr;
/**
* 当月已结案项目组未解决数 当前组织及下级前一日新增结案中未解决项目数
*/
private Integer unresolvedIncr;
}

142
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java

@ -0,0 +1,142 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_grid_project_daily")
public class FactGridProjectDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id dim_customer.id
*/
private String customerId;
/**
* 机关Id dim_agency.id
*/
private String agencyId;
/**
* 网格Id dim_grid.id
*/
private String gridId;
/**
* 日维度Id dim_date.id
*/
private String dateId;
/**
* 周维度Id dim_week.id
*/
private String weekId;
/**
* 月维度Id dim_month.id
*/
private String monthId;
/**
* 截止当日网格下项目总数 当前组织及下级项目总数
*/
private Integer projectTotal;
/**
* 截止当日网格下处理中项目数 当前组织及下级所有未结案项目总数
*/
private Integer pendingTotal;
/**
* 截止当日网格下处理中项目占比 当前组织及下级未结案项目百分比存百分比数小数点后两位
*/
private BigDecimal pendingRatio;
/**
* 截止当日网格下已结案项目数 当前组织及下级已结案项目总数
*/
private Integer closedTotal;
/**
* 截止当日网格下已结案项目占比 当前组织及下级已结案项目百分比存百分比数小数点后两位
*/
private BigDecimal closedRatio;
/**
* 截止当日已结案中已解决项目数 当前组织及下级已结案项目中已解决总数
*/
private Integer resolvedTotal;
/**
* 截止当日已结案中已解决项目占比 当前组织及下级已结案项目中已解决占比
*/
private BigDecimal resolvedRatio;
/**
* 截止当日已结案中未解决项目数 当前组织及下级已结案项目中未解决总数
*/
private Integer unresolvedTotal;
/**
* 截止当日已结案中未解决项目占比 当前组织及下级已结案项目中未解决占比
*/
private BigDecimal unresolvedRatio;
/**
* 当日已结案项目中已解决数 当前组织及下级前一日新增结案中已解决项目数
*/
private Integer resolvedIncr;
/**
* 当日已结案项目组未解决数 当前组织及下级前一日新增结案中未解决项目数
*/
private Integer unresolvedIncr;
/**
* 当日网格下项目总数 该网格下项目总数
*/
private Integer gridIncr;
/**
* 当日网格下处理中项目数 该网格下未结案项目总数
*/
private Integer pendingIncr;
/**
* 当日网格下已结案项目数 该网格下已结案项目总数
*/
private String closedIncr;
}

142
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectMonthlyEntity.java

@ -0,0 +1,142 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_grid_project_monthly")
public class FactGridProjectMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id dim_customer.id
*/
private String customerId;
/**
* 机关Id dim_agency.id
*/
private String agencyId;
/**
* 网格Id dim_grid.id
*/
private String gridId;
/**
* 月维度Id dim_month.id
*/
private String monthId;
/**
* 季维度Id dim_quarter.id
*/
private String quarterId;
/**
* 年维度Id dim_year.id
*/
private String yearId;
/**
* 截止当月项目总数 当前组织及下级项目总数
*/
private Integer projectTotal;
/**
* 截止当月处理中项目数 当前组织及下级所有未结案项目总数
*/
private Integer pendingTotal;
/**
* 截止当月处理中项目占比 当前组织及下级未结案项目百分比存百分比数小数点后两位
*/
private BigDecimal pendingRatio;
/**
* 截止当月已结案项目数 当前组织及下级已结案项目总数
*/
private Integer closedTotal;
/**
* 截止当月已结案项目占比 当前组织及下级已结案项目百分比存百分比数小数点后两位
*/
private BigDecimal closedRatio;
/**
* 截止当月已结案中已解决项目数 当前组织及下级已结案项目中已解决总数
*/
private Integer resolvedTotal;
/**
* 截止当月已结案中已解决项目占比 当前组织及下级已结案项目中已解决占比
*/
private BigDecimal resolvedRatio;
/**
* 截止当月已结案中未解决项目数 当前组织及下级已结案项目中未解决总数
*/
private Integer unresolvedTotal;
/**
* 截止当月已结案中未解决项目占比 当前组织及下级已结案项目中未解决占比
*/
private BigDecimal unresolvedRatio;
/**
* 当月项目总数 当前组织及下级前一月新增项目数
*/
private Integer projectIncr;
/**
* 当月处理中项目数 当前组织及下级前一月新增处理中项目数
*/
private Integer pendingIncr;
/**
* 当月已结案项目数 当前组织及下级前一月新增结案项目数
*/
private Integer closedIncr;
/**
* 当月已结案项目中已解决数 当前组织及下级前一日新增结案中已解决项目数
*/
private Integer resolvedIncr;
/**
* 当月已结案项目组未解决数 当前组织及下级前一日新增结案中未解决项目数
*/
private Integer unresolvedIncr;
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/LastExecRecordEntity.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 最后一次执行记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("last_exec_record")
public class LastExecRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 执行主体即每一个统计表
*/
private String subject;
/**
* 最后一次执行时间
*/
private Date execTime;
}

125
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java

@ -0,0 +1,125 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.voice;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 文章表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("article")
public class ArticleEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 草稿ID
*/
private String draftId;
/**
* 文章标题
*/
private String title;
/**
* 文章内容 精简内容
*/
private String previewContent;
/**
* 是否置顶 1是0否
*/
private Integer isTop;
/**
* 发布范围描述 所有发布范围集合顿号隔开
*/
private String publishRangeDesc;
/**
* 发布单位ID
*/
private String publisherId;
/**
* 发布单位名称
*/
private String publisherName;
/**
* 发布单位类型 机关:agency部门department网格grid
*/
private String publisherType;
/**
* 发布时间
*/
private Date publishDate;
/**
* 发布状态 已发布:published已下线offline
*/
private String statusFlag;
/**
* 下线时间
*/
private Date offLineTime;
/**
* 文章标签串 竖杠分割的标签名称
*/
private String tags;
/**
* 组织ID
*/
private String orgId;
/**
* 组织ID路径 eg字段为def:abc
*/
private String orgIdPath;
/**
* 网格ID 数据权限使用
*/
private String gridId;
/**
* 部门ID 数据权限使用
*/
private String departmentId;
}

85
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java

@ -0,0 +1,85 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.voice;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 文章发布范围表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("article_publish_range")
public class ArticlePublishRangeEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 文章ID
*/
private String articleId;
/**
* 网格ID
*/
private String gridId;
/**
* 组织-网格名称
*/
private String agencyGridName;
/**
* 组织ID
*/
private String agencyId;
/**
* 所有上级组织机构ID 以英文:隔开
*/
private String pids;
/**
* 所有上级名称 以横杠隔开
*/
private String allParentName;
/**
* 下线时间
*/
private Date offLineTime;
/**
* 发布状态 已发布:published;已下线offline
*/
private String publishStatus;
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/properties/ThreadProperties.java

@ -0,0 +1,25 @@
package com.epmet.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 线程池属性类
*/
@ConfigurationProperties(prefix = "thread")
@Data
public class ThreadProperties {
private ThreadPoolProperties threadPool;
@Data
public static class ThreadPoolProperties {
private int corePoolSize;
private int maxPoolSize;
private int queueCapacity;
private int keepAlive;
public ThreadPoolProperties() {
}
}
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java

@ -8,5 +8,8 @@ public interface StatsDemoService {
void testList();
void testTx();
Boolean testThreadPool();
void testThreadPoolAsync();
List<AgencySubTreeDto> getAllAgency();
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java

@ -0,0 +1,12 @@
package com.epmet.service;
public interface StatsDimService {
void initGridDim();
void initAgencyDim();
void initCustomerDim();
void initDepartmentDim();
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java

@ -7,4 +7,11 @@ package com.epmet.service;
public interface StatsProjectService {
/**
* @param customerId
* @return
* @Author sun
* @Description 数据-项目-机关日()统计
**/
void statsAgencyProject(String customerId);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java

@ -0,0 +1,15 @@
package com.epmet.service;
public interface StatsPublicityService {
/**
* desc: 统计宣传能力的汇总信息
*
* return:
* @date: 2020/6/17 16:11
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
Boolean publicitySummary();
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerService.java

@ -0,0 +1,12 @@
package com.epmet.service.crm;
import com.epmet.entity.crm.CustomerEntity;
import java.util.Date;
import java.util.List;
public interface CustomerService {
List<CustomerEntity> listValidCustomersByCreateTime(Date createTimeFrom, Date createTimeTo);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerServiceImpl.java

@ -0,0 +1,25 @@
package com.epmet.service.crm.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.crm.CustomerDao;
import com.epmet.entity.crm.CustomerEntity;
import com.epmet.service.crm.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
@DataSource(DataSourceConstant.OPER_CRM)
public class CustomerServiceImpl implements CustomerService {
@Autowired
private CustomerDao customerDao;
@Override
public List<CustomerEntity> listValidCustomersByCreateTime(Date createTimeFrom, Date createTimeTo) {
return customerDao.listValidCustomersByCreateTime(createTimeFrom, createTimeTo);
}
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java

@ -8,8 +8,10 @@ import com.epmet.service.StatsDemoService;
import com.epmet.service.org.DemoGovOrgService;
import com.epmet.service.stats.DemoDataStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -27,6 +29,7 @@ public class StatsDemoServiceImpl implements StatsDemoService {
@Autowired
private DemoDataStatsService demoDataStatsService;
@Override
public void testList() {
List<CustomerAgencyEntity> agencies = demoGovOrgService.listAllEntities();
List<IssueEntity> issues = demoIssueService.listAllEntities();
@ -35,10 +38,37 @@ public class StatsDemoServiceImpl implements StatsDemoService {
//该service不加事务
//@Transactional(rollbackFor = Exception.class)
@Override
public void testTx() {
demoDataStatsService.testTx();
}
@Override
public Boolean testThreadPool() {
try {
Thread.sleep(2000l);
} catch (InterruptedException e) {
System.err.println("睡眠发生异常");
e.printStackTrace();
}
return true;
}
/**
* 推荐
*/
@Async //注意此处注解
@Override
public void testThreadPoolAsync() {
try {
Thread.sleep(2000l);
System.out.println(LocalDateTime.now().getSecond());
} catch (InterruptedException e) {
System.err.println("睡眠发生异常");
e.printStackTrace();
}
}
public List<AgencySubTreeDto> getAllAgency(){
return demoGovOrgService.getAllAgency();
}

172
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java

@ -0,0 +1,172 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.StatsSubject;
import com.epmet.dao.org.CustomerDepartmentDao;
import com.epmet.dao.stats.LastExecRecordDao;
import com.epmet.entity.crm.CustomerEntity;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.org.CustomerDepartmentEntity;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.LastExecRecordEntity;
import com.epmet.service.StatsDimService;
import com.epmet.service.crm.CustomerService;
import com.epmet.service.org.CustomerAgencyService;
import com.epmet.service.org.CustomerDepartmentService;
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.stats.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class StatsDimServiceImpl implements StatsDimService {
@Autowired
private DimGridService dimGridService;
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private CustomerGridService customerGridService;
@Autowired
private LastExecRecordService lastExecRecordService;
@Autowired
private CustomerAgencyService customerAgencyService;
@Autowired
private CustomerService customerService;
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
private CustomerDepartmentService departmentService;
@Autowired
private DimDepartmentService dimDepartmentService;
@Override
public void initGridDim() {
DimGridEntity lastCreatedGridDim = dimGridService.getLastCreatedGridDim();
List<CustomerGridEntity> grids;
if (lastCreatedGridDim == null) {
// 首次初始化
grids = customerGridService.listGridsByCreateTime(null, null);
} else {
// 非首次初始化
// 结束时间边界与开始时间边界,包含开始时间不包含结束时间。结束时间可以为空,则查询从开始时间往后的所有新创建网格
//Date endTimeBorder = DateUtils.parse(DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_PATTERN_YYYYMMDD);
Date startTimeBorder = DateUtils.parse(DateUtils.format(lastCreatedGridDim.getCreatedTime(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_PATTERN_YYYYMMDD);
grids = customerGridService.listGridsByCreateTime(startTimeBorder, null);
}
List<DimGridEntity> gridDims = convertCustomerGrid2GridDim(grids);
dimGridService.addGridDims(gridDims);
}
/**
* 将网格信息转换成网格维度信息
* @param grids
* @return
*/
private List<DimGridEntity> convertCustomerGrid2GridDim(List<CustomerGridEntity> grids) {
Date now = new Date();
return grids.stream().map(grid -> {
DimGridEntity dimGrid = new DimGridEntity();
dimGrid.setAgencyId(grid.getPid());
dimGrid.setAreaCode(grid.getAreaCode());
dimGrid.setCustomerId(grid.getCustomerId());
dimGrid.setGridName(grid.getGridName());
dimGrid.setCreatedBy("APP_USER");
dimGrid.setCreatedTime(now);
dimGrid.setDelFlag("0");
dimGrid.setId(grid.getId());
dimGrid.setRevision(0);
dimGrid.setUpdatedBy("APP_USER");
dimGrid.setUpdatedTime(now);
return dimGrid;
}).collect(Collectors.toList());
}
/**
* 初始化机关单位维度
*/
@Override
public void initAgencyDim() {
LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_AGENCY);
if (lastExecRecord == null) {
lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_AGENCY);
}
Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD);
Date statsStartTime = null;
if (lastExecRecord.getExecTime() != null) {
statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD);
}
List<CustomerAgencyEntity> agencies = customerAgencyService.listAgenciesByCreateTime(statsStartTime, statsEndTime);
dimAgencyService.addAgencyDims(agencies);
lastExecRecord.setExecTime(new Date());
// 记录最后一次统计时间
lastExecRecordService.updateById(lastExecRecord);
}
/**
* 初始化网格维度
*/
@Override
public void initCustomerDim() {
LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_CUSTOMER);
if (lastExecRecord == null) {
lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_CUSTOMER);
}
Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD);
Date statsStartTime = null;
if (lastExecRecord.getExecTime() != null) {
statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD);
}
List<CustomerEntity> customers = customerService.listValidCustomersByCreateTime(statsStartTime, statsEndTime);
dimCustomerService.addCustomerDims(customers);
lastExecRecord.setExecTime(new Date());
// 记录最后一次统计时间
lastExecRecordService.updateById(lastExecRecord);
}
@Override
public void initDepartmentDim() {
LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_DEPARTMENT);
if (lastExecRecord == null) {
lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_DEPARTMENT);
}
Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD);
Date statsStartTime = null;
if (lastExecRecord.getExecTime() != null) {
statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD);
}
List<CustomerDepartmentEntity> departments = departmentService.listDepartmentsByCreatedTime(statsStartTime, statsEndTime);
dimDepartmentService.addDepartmentDims(departments);
lastExecRecord.setExecTime(new Date());
// 记录最后一次统计时间
lastExecRecordService.updateById(lastExecRecord);
}
}

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

@ -2,6 +2,7 @@ package com.epmet.service.impl;
import com.epmet.service.StatsProjectService;
import com.epmet.service.project.ProjectService;
import com.epmet.service.stats.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -12,7 +13,37 @@ import org.springframework.stereotype.Service;
@Service
public class StatsProjectServiceImpl implements StatsProjectService {
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private DimDateService dimDateService;
@Autowired
private DimWeekService dimWeekService;
@Autowired
private DimMonthService dimMonthService;
@Autowired
private DimQuarterService dimQuarterService;
@Autowired
private DimYearService dimYearService;
@Autowired
private ProjectService projectService;
@Autowired
private FactAgencyProjectDailyService factAgencyProjectDailyService;
@Autowired
private FactAgencyProjectMonthlyService factAgencyProjectMonthlyService;
@Autowired
private FactGridProjectDailyService factGridProjectDailyService;
@Autowired
private FactGridProjectMonthlyService factGridProjectMonthlyService;
/**
* @param customerId
* @return
* @Author sun
* @Description 数据-项目-机关日()统计
**/
@Override
public void statsAgencyProject(String customerId) {
}
}

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

@ -0,0 +1,68 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO;
import com.epmet.service.StatsPublicityService;
import com.epmet.service.stats.*;
import com.epmet.service.voice.ArticlePublishRangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
/**
* desc: 宣传能力数据统计 service
*
* @date: 2020/6/17 16:08
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
@Service
public class StatsPublicityServiceImpl implements StatsPublicityService {
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private DimDateService dimDateService;
@Autowired
private DimWeekService dimWeekService;
@Autowired
private DimMonthService dimMonthService;
@Autowired
private DimQuarterService dimQuarterService;
@Autowired
private DimYearService dimYearService;
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
private ArticlePublishRangeService articlePublishRangeService;
@Override
public Boolean publicitySummary() {
int pageNo = 1;
int pageSize = 100;
List<String> customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo, (pageNo - 1) * pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
customerIdList.forEach(customerId -> {
});
}
} while (!CollectionUtils.isEmpty(customerIdList) || customerIdList.size() >= pageSize);
return null;
}
private String statsPublishArticle(String customerId, Date statsDate) {
//1.先查询昨天的 有没有数据 有则 昨日发布文章总数 = 昨日的发布文章数增量 + 统计表中已有的昨日的网格总数 ;
// 否则 昨日发布文章总数 = 发布范围表中计算所有发布文章总数
List<ArticleGridPublishedSummaryDTO> articleCount = articlePublishRangeService.selectByCreatedDate(customerId, statsDate == null ? DateUtils.addDateDays(new Date(), -1) : statsDate);
return null;
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java

@ -0,0 +1,10 @@
package com.epmet.service.org;
import com.epmet.entity.org.CustomerAgencyEntity;
import java.util.Date;
import java.util.List;
public interface CustomerAgencyService {
List<CustomerAgencyEntity> listAgenciesByCreateTime(Date statsStartTime, Date statsEndTime);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java

@ -0,0 +1,11 @@
package com.epmet.service.org;
import com.epmet.entity.org.CustomerDepartmentEntity;
import java.util.Date;
import java.util.List;
public interface CustomerDepartmentService {
List<CustomerDepartmentEntity> listDepartmentsByCreatedTime(Date createdTimeFrom, Date createdTimeTo);
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java

@ -0,0 +1,17 @@
package com.epmet.service.org;
import com.epmet.entity.org.CustomerGridEntity;
import java.util.Date;
import java.util.List;
public interface CustomerGridService {
/**
* 根据创建时间截取时间段内的网格
* @param start
* @param end
* @return
* @Param("start") Date start, @Param("end") Date end
*/
List<CustomerGridEntity> listGridsByCreateTime(Date start, Date end);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java

@ -0,0 +1,25 @@
package com.epmet.service.org.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.org.StatsCustomerAgencyDao;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.service.org.CustomerAgencyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
@DataSource(DataSourceConstant.GOV_ORG)
public class CustomerAgencyServiceImpl implements CustomerAgencyService {
@Autowired
private StatsCustomerAgencyDao customerAgencyDao;
@Override
public List<CustomerAgencyEntity> listAgenciesByCreateTime(Date statsStartTime, Date statsEndTime) {
return customerAgencyDao.listAgenciesByCreateTime(statsStartTime, statsEndTime);
}
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerDepartmentServiceImpl.java

@ -0,0 +1,31 @@
package com.epmet.service.org.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.org.CustomerDepartmentDao;
import com.epmet.entity.org.CustomerDepartmentEntity;
import com.epmet.service.org.CustomerDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
@DataSource(DataSourceConstant.GOV_ORG)
public class CustomerDepartmentServiceImpl implements CustomerDepartmentService {
@Autowired
private CustomerDepartmentDao departmentDao;
/**
* 根据创建时间查询部门列表
* @param createdTimeFrom
* @param createdTimeTo
* @return
*/
@Override
public List<CustomerDepartmentEntity> listDepartmentsByCreatedTime(Date createdTimeFrom, Date createdTimeTo) {
return departmentDao.listDepartmentsByCreatedTime(createdTimeFrom, createdTimeTo);
}
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java

@ -0,0 +1,25 @@
package com.epmet.service.org.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.org.CustomerGridDao;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.service.org.CustomerGridService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
@DataSource(DataSourceConstant.GOV_ORG)
public class CustomerGridServiceImpl implements CustomerGridService {
@Autowired
private CustomerGridDao customerGridDao;
@Override
public List<CustomerGridEntity> listGridsByCreateTime(Date start, Date end) {
return customerGridDao.listGridsByCreateTime(start, end);
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java

@ -20,6 +20,7 @@ package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import java.util.List;
@ -92,4 +93,14 @@ public interface DimAgencyService extends BaseService<DimAgencyEntity> {
* @date 2020-06-16
*/
void delete(String[] ids);
/**
* @param dto
* @return
* @Author sun
* @Description 根据客户Id查询机关维度列表数据
**/
List<DimAgencyDTO> getDimAgencyList(DimAgencyDTO dto);
void addAgencyDims(List<CustomerAgencyEntity> agencies);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java

@ -20,6 +20,8 @@ package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.DimCustomerDTO;
import com.epmet.entity.crm.CustomerEntity;
import com.epmet.entity.org.CustomerDepartmentEntity;
import com.epmet.entity.stats.DimCustomerEntity;
import java.util.List;
@ -92,4 +94,22 @@ public interface DimCustomerService extends BaseService<DimCustomerEntity> {
* @date 2020-06-16
*/
void delete(String[] ids);
/**
* desc: 分页获取 客户id
*
* @param pageNo
* @param pageSize
* return: List<String>
* @date: 2020/6/17 16:26
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
List<String> selectCustomerIdPage(Integer pageNo, Integer pageSize);
/**
* 添加客户维度
* @param customers
*/
void addCustomerDims(List<CustomerEntity> customers);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java

@ -92,4 +92,15 @@ public interface DimDateService extends BaseService<DimDateEntity> {
* @date 2020-06-16
*/
void delete(String[] ids);
/**
* @param dto
* @return
* @Author sun
* @Description 根据创建时间查询日维度信息
**/
List<DimDateDTO> getDimDate(DimDateDTO dto);
void initDimDate();
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java

@ -20,6 +20,7 @@ package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.DimDepartmentDTO;
import com.epmet.entity.org.CustomerDepartmentEntity;
import com.epmet.entity.stats.DimDepartmentEntity;
import java.util.List;
@ -92,4 +93,6 @@ public interface DimDepartmentService extends BaseService<DimDepartmentEntity> {
* @date 2020-06-16
*/
void delete(String[] ids);
void addDepartmentDims(List<CustomerDepartmentEntity> departments);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java

@ -20,8 +20,12 @@ package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.entity.stats.DimGridEntity;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -92,4 +96,8 @@ public interface DimGridService extends BaseService<DimGridEntity> {
* @date 2020-06-16
*/
void delete(String[] ids);
DimGridEntity getLastCreatedGridDim();
void addGridDims(List<DimGridEntity> gridDims);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java

@ -92,4 +92,6 @@ public interface DimMonthService extends BaseService<DimMonthEntity> {
* @date 2020-06-16
*/
void delete(String[] ids);
void initMonthDim();
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.java

@ -0,0 +1,31 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.stats.FactAgencyProjectDailyEntity;
/**
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
public interface FactAgencyProjectDailyService extends BaseService<FactAgencyProjectDailyEntity> {
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java

@ -0,0 +1,31 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity;
/**
* 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
public interface FactAgencyProjectMonthlyService extends BaseService<FactAgencyProjectMonthlyEntity> {
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java

@ -0,0 +1,31 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.stats.FactGridProjectDailyEntity;
/**
* 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
public interface FactGridProjectDailyService extends BaseService<FactGridProjectDailyEntity> {
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java

@ -0,0 +1,31 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.stats.FactGridProjectMonthlyEntity;
/**
* 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
public interface FactGridProjectMonthlyService extends BaseService<FactGridProjectMonthlyEntity> {
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/LastExecRecordService.java

@ -0,0 +1,10 @@
package com.epmet.service.stats;
import com.epmet.entity.stats.LastExecRecordEntity;
public interface LastExecRecordService {
LastExecRecordEntity getLastExecRecord(String statsSubject);
LastExecRecordEntity createLastExecRecord(String statsSubject);
void updateById(LastExecRecordEntity lastExecRecord);
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.DimAgencyDao;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.service.stats.DimAgencyService;
import org.apache.commons.lang3.StringUtils;
@ -33,6 +34,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -97,4 +99,37 @@ public class DimAgencyServiceImpl extends BaseServiceImpl<DimAgencyDao, DimAgenc
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param dto
* @return
* @Author sun
* @Description 根据客户Id查询机关维度列表数据
**/
@Override
public List<DimAgencyDTO> getDimAgencyList(DimAgencyDTO dto) {
return baseDao.selectDimAgencyList(dto);
}
@Transactional
@Override
public void addAgencyDims(List<CustomerAgencyEntity> agencies) {
Date now = new Date();
for (CustomerAgencyEntity agency : agencies) {
DimAgencyEntity dimAgencyEntity = new DimAgencyEntity();
dimAgencyEntity.setAgencyName(agency.getOrganizationName());
dimAgencyEntity.setAllParentName(agency.getAllParentName());
dimAgencyEntity.setCustomerId(agency.getCustomerId());
dimAgencyEntity.setLevel(agency.getLevel());
dimAgencyEntity.setPid(agency.getPid());
dimAgencyEntity.setPids(agency.getPid());
dimAgencyEntity.setCreatedBy("APP_USER");
dimAgencyEntity.setUpdatedBy("APP_USER");
dimAgencyEntity.setCreatedTime(now);
dimAgencyEntity.setUpdatedTime(now);
dimAgencyEntity.setRevision(0);
dimAgencyEntity.setDelFlag("0");
baseDao.insert(dimAgencyEntity);
}
}
}

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java

@ -20,19 +20,24 @@ package com.epmet.service.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.DimCustomerDao;
import com.epmet.dto.stats.DimCustomerDTO;
import com.epmet.entity.crm.CustomerEntity;
import com.epmet.entity.org.CustomerDepartmentEntity;
import com.epmet.entity.stats.DimCustomerEntity;
import com.epmet.service.stats.DimCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -43,6 +48,7 @@ import java.util.Map;
* @since v1.0.0 2020-06-16
*/
@Service
@Slf4j
public class DimCustomerServiceImpl extends BaseServiceImpl<DimCustomerDao, DimCustomerEntity> implements DimCustomerService {
@Override
@ -61,8 +67,8 @@ public class DimCustomerServiceImpl extends BaseServiceImpl<DimCustomerDao, DimC
return ConvertUtils.sourceToTarget(entityList, DimCustomerDTO.class);
}
private QueryWrapper<DimCustomerEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<DimCustomerEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<DimCustomerEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -97,4 +103,30 @@ public class DimCustomerServiceImpl extends BaseServiceImpl<DimCustomerDao, DimC
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<String> selectCustomerIdPage(Integer pageNo, Integer pageSize) {
if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 0) {
log.error("selectCustomerIdPage param error,pageNo:{},pageSize:{}", pageNo, pageSize);
throw new RenException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(), EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getMsg());
}
return baseDao.selectCustomerIdPage(pageNo, (pageNo - 1) * pageSize);
}
@Transactional
@Override
public void addCustomerDims(List<CustomerEntity> customers) {
Date now = new Date();
for (CustomerEntity customer : customers) {
DimCustomerEntity dim = new DimCustomerEntity();
dim.setCustomerName(customer.getCustomerName());
dim.setCreatedBy("APP_USER");
dim.setCreatedTime(now);
dim.setUpdatedBy("APP_USER");
dim.setUpdatedTime(now);
dim.setDelFlag("0");
dim.setRevision(0);
dim.setId(customer.getId());
baseDao.insert(dim);
}
}
}

87
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java

@ -23,18 +23,16 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.stats.DimDateDao;
import com.epmet.dto.stats.DimDateDTO;
import com.epmet.entity.stats.DimDateEntity;
import com.epmet.service.stats.DimDateService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 日期维度表
@ -45,7 +43,6 @@ import java.util.Map;
@Service
public class DimDateServiceImpl extends BaseServiceImpl<DimDateDao, DimDateEntity> implements DimDateService {
@Override
public PageData<DimDateDTO> page(Map<String, Object> params) {
IPage<DimDateEntity> page = baseDao.selectPage(
@ -98,4 +95,84 @@ public class DimDateServiceImpl extends BaseServiceImpl<DimDateDao, DimDateEntit
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param dto
* @return
* @Author sun
* @Description 根据创建时间查询日维度信息
**/
@Override
public List<DimDateDTO> getDimDate(DimDateDTO dto) {
return baseDao.selectDimDate(dto);
}
@Override
public void initDimDate() {
DimDateDTO latestDimDateDto = baseDao.getLatestDimDate();
Date targetDate = DateUtils.addDateDays(DateUtils.parse(
DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD),
DateUtils.DATE_PATTERN_YYYYMMDD), -1);
Date lastDimDate;
if (latestDimDateDto == null) {
// 没有维度数据
initDimDate(targetDate);
} else if(targetDate.after(lastDimDate = DateUtils.parse(latestDimDateDto.getId(), DateUtils.DATE_PATTERN_YYYYMMDD))) {
// 有维度数据,并且当前日期大于最大按日维度数据的id,需要连续生成至少一天的维度数据(补缺)
initDimDate(lastDimDate, targetDate);
}
}
/**
* 连续初始化
* @param lastDimDate
* @param targetDate
*/
private void initDimDate(Date lastDimDate, Date targetDate) {
while (lastDimDate.before(targetDate)) {
lastDimDate = DateUtils.addDateDays(lastDimDate, 1);
initDimDate(lastDimDate);
}
}
/**
* 初始化单日
* @param targetDate
*/
public void initDimDate(Date targetDate) {
DimDateEntity dimDateEntity = generateDimDate(targetDate);
int c = baseDao.insertOne(dimDateEntity);
}
public DimDateEntity generateDimDate(Date targetDate) {
Date now = new Date();
// 日期id
String id = DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYYMMDD);
// 月份id
String monthId = DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYYMM);
// 日期名称字符串
String dateNameStr = DateUtils.format(targetDate, DateUtils.DATE_NAME_PATTERN);
// 星期几
String chineseWeekName = DateUtils.getWeekNameOfWeek(targetDate, DateUtils.WEEK_TYPE_CHINESE);
String englishWeekName = DateUtils.getWeekNameOfWeek(targetDate, DateUtils.WEEK_TYPE_ENGLISH);
// 一年的第几周
String weekId = DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYY).concat("W").concat(String.valueOf(DateUtils.getWeekOfYear(targetDate)));
DimDateEntity dimDateEntity = new DimDateEntity();
dimDateEntity.setId(id);
dimDateEntity.setDateName(dateNameStr);
dimDateEntity.setDayOfWeek(englishWeekName);
dimDateEntity.setDayOfWeekName(chineseWeekName);
dimDateEntity.setWeekId(weekId);
dimDateEntity.setMonthId(monthId);
dimDateEntity.setDelFlag("0");
dimDateEntity.setCreatedBy("APP_USER");
dimDateEntity.setCreatedTime(now);
dimDateEntity.setRevision(0);
dimDateEntity.setUpdatedBy("APP_USER");
dimDateEntity.setUpdatedTime(now);
return dimDateEntity;
}
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.DimDepartmentDao;
import com.epmet.dto.stats.DimDepartmentDTO;
import com.epmet.entity.org.CustomerDepartmentEntity;
import com.epmet.entity.stats.DimDepartmentEntity;
import com.epmet.service.stats.DimDepartmentService;
import org.apache.commons.lang3.StringUtils;
@ -33,6 +34,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -97,4 +99,22 @@ public class DimDepartmentServiceImpl extends BaseServiceImpl<DimDepartmentDao,
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Transactional(rollbackFor = Exception.class)
@Override
public void addDepartmentDims(List<CustomerDepartmentEntity> departments) {
Date now = new Date();
for (CustomerDepartmentEntity department : departments) {
DimDepartmentEntity dim = new DimDepartmentEntity();
dim.setAgencyId(department.getAgencyId());
dim.setCustomerId(department.getCustomerId());
dim.setDepartmentName(department.getDepartmentName());
dim.setCreatedBy("APP_USER");
dim.setUpdatedBy("APP_USER");
dim.setCreatedTime(now);
dim.setUpdatedTime(now);
dim.setRevision(0);
dim.setDelFlag("0");
baseDao.insert(dim);
}
}
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

@ -25,14 +25,16 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.DimGridDao;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.service.stats.DimGridService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -97,4 +99,16 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public DimGridEntity getLastCreatedGridDim() {
return baseDao.getLastCreatedGridDimEntity();
}
@Transactional
@Override
public void addGridDims(List<DimGridEntity> gridDims) {
for (DimGridEntity gridDim : gridDims) {
baseDao.insert(gridDim);
}
}
}

67
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java

@ -23,16 +23,22 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.StatsSubject;
import com.epmet.dao.stats.DimMonthDao;
import com.epmet.dto.stats.DimMonthDTO;
import com.epmet.entity.stats.DimMonthEntity;
import com.epmet.entity.stats.LastExecRecordEntity;
import com.epmet.service.stats.DimMonthService;
import com.epmet.service.stats.LastExecRecordService;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.LocalDate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -45,6 +51,9 @@ import java.util.Map;
@Service
public class DimMonthServiceImpl extends BaseServiceImpl<DimMonthDao, DimMonthEntity> implements DimMonthService {
@Autowired
private LastExecRecordService lastExecRecordService;
@Override
public PageData<DimMonthDTO> page(Map<String, Object> params) {
IPage<DimMonthEntity> page = baseDao.selectPage(
@ -97,4 +106,62 @@ public class DimMonthServiceImpl extends BaseServiceImpl<DimMonthDao, DimMonthEn
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Transactional
@Override
public void initMonthDim() {
LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_MONTH);
if (lastExecRecord == null) {
lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_DEPARTMENT);
}
Date now = new Date();
String startTime;
String endTime = DateUtils.format(now, DateUtils.DATE_PATTERN_YYYYMM);
if (lastExecRecord.getExecTime() == null) {
Date targetDate = new LocalDate(now).minusMonths(1).toDate();
initMonthDim(DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYYMM));
} else {
startTime = DateUtils.format(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMM);
initMonthDims(startTime, endTime);
}
lastExecRecord.setExecTime(new Date());
// 记录最后一次统计时间
lastExecRecordService.updateById(lastExecRecord);
}
public void initMonthDims(String startMonthStr, String endMonthStr) {
Integer startMonthInt = Integer.valueOf(startMonthStr);
Integer endMonthInt = Integer.valueOf(endMonthStr);
while(startMonthInt < endMonthInt) {
initMonthDim(startMonthInt + "");
++ startMonthInt;
}
}
public void initMonthDim(String startMonthStr) {
Date now = new Date();
Date startDate = DateUtils.stringToDate( startMonthStr, DateUtils.DATE_PATTERN_YYYYMM);
Date endDate = DateUtils.addDateDays(DateUtils.addDateMonths(startDate, 1), -1);
LocalDate localDate = new LocalDate(startDate);
DimMonthEntity dim = new DimMonthEntity();
dim.setStartDate(startDate);
dim.setEndDate(endDate);
dim.setMonthName(DateUtils.format(startDate, DateUtils.MONTH_NAME_PATTERN));
dim.setMonthOrder(DateUtils.getMonthOfYear(startDate));
dim.setQuarterId(localDate.getYear() + "Q" + DateUtils.getQuarterIndex(startDate));
dim.setYearId(localDate.getYear() + "");
dim.setCreatedBy("APP_USER");
dim.setUpdatedBy("APP_USER");
dim.setCreatedTime(now);
dim.setUpdatedTime(now);
dim.setDelFlag("0");
dim.setId(DateUtils.format(startDate, DateUtils.DATE_PATTERN_YYYYMM));
baseDao.insert(dim);
}
}

36
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java

@ -0,0 +1,36 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.stats.FactAgencyProjectDailyDao;
import com.epmet.entity.stats.FactAgencyProjectDailyEntity;
import com.epmet.service.stats.FactAgencyProjectDailyService;
import org.springframework.stereotype.Service;
/**
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Service
public class FactAgencyProjectDailyServiceImpl extends BaseServiceImpl<FactAgencyProjectDailyDao, FactAgencyProjectDailyEntity> implements FactAgencyProjectDailyService {
}

36
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java

@ -0,0 +1,36 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.stats.FactAgencyProjectMonthlyDao;
import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity;
import com.epmet.service.stats.FactAgencyProjectMonthlyService;
import org.springframework.stereotype.Service;
/**
* 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Service
public class FactAgencyProjectMonthlyServiceImpl extends BaseServiceImpl<FactAgencyProjectMonthlyDao, FactAgencyProjectMonthlyEntity> implements FactAgencyProjectMonthlyService {
}

36
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java

@ -0,0 +1,36 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.stats.FactGridProjectDailyDao;
import com.epmet.entity.stats.FactGridProjectDailyEntity;
import com.epmet.service.stats.FactGridProjectDailyService;
import org.springframework.stereotype.Service;
/**
* 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Service
public class FactGridProjectDailyServiceImpl extends BaseServiceImpl<FactGridProjectDailyDao, FactGridProjectDailyEntity> implements FactGridProjectDailyService {
}

36
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java

@ -0,0 +1,36 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.stats.FactGridProjectMonthlyDao;
import com.epmet.entity.stats.FactGridProjectMonthlyEntity;
import com.epmet.service.stats.FactGridProjectMonthlyService;
import org.springframework.stereotype.Service;
/**
* 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Service
public class FactGridProjectMonthlyServiceImpl extends BaseServiceImpl<FactGridProjectMonthlyDao, FactGridProjectMonthlyEntity> implements FactGridProjectMonthlyService {
}

45
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java

@ -0,0 +1,45 @@
package com.epmet.service.stats.impl;
import com.epmet.dao.stats.LastExecRecordDao;
import com.epmet.entity.stats.LastExecRecordEntity;
import com.epmet.service.stats.LastExecRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service
public class LastExecRecordServiceImpl implements LastExecRecordService {
@Autowired
private LastExecRecordDao lastExecRecordDao;
public LastExecRecordEntity getLastExecRecord(String statsSubject) {
return lastExecRecordDao.getLastExecRecord(statsSubject);
}
/**
* 创建末次执行记录
* @param statsSubject
* @return
*/
@Override
public LastExecRecordEntity createLastExecRecord(String statsSubject) {
Date now = new Date();
LastExecRecordEntity entity = new LastExecRecordEntity();
entity.setExecTime(now);
entity.setSubject(statsSubject);
entity.setCreatedBy("APP_USER");
entity.setUpdatedBy("APP_USER");
entity.setCreatedTime(now);
entity.setUpdatedTime(now);
entity.setDelFlag("0");
entity.setRevision(0);
lastExecRecordDao.insert(entity);
return entity;
}
@Override
public void updateById(LastExecRecordEntity lastExecRecord) {
lastExecRecordDao.updateById(lastExecRecord);
}
}

46
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java

@ -0,0 +1,46 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.voice;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO;
import com.epmet.entity.voice.ArticlePublishRangeEntity;
import java.util.Date;
import java.util.List;
/**
* 文章发布范围表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
public interface ArticlePublishRangeService extends BaseService<ArticlePublishRangeEntity> {
/**
* desc: 根据客户Id 创建日期查询 发布范围数据
*
* @param customerId
* @param createDate
* return:
* @date: 2020/6/17 16:59
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
List<ArticleGridPublishedSummaryDTO> selectByCreatedDate(String customerId, Date createDate);
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.voice;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.voice.ArticleEntity;
/**
* desc: 数据统计文章service
*
* return:
* @date: 2020/6/17 15:28
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
public interface ArticleService extends BaseService<ArticleEntity> {
}

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.voice.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.voice.ArticlePublishRangeDao;
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO;
import com.epmet.entity.voice.ArticlePublishRangeEntity;
import com.epmet.service.voice.ArticlePublishRangeService;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* 文章发布范围表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-17
*/
@Service
@DataSource(DataSourceConstant.GOV_VOICE)
public class ArticlePublishRangeServiceImpl extends BaseServiceImpl<ArticlePublishRangeDao, ArticlePublishRangeEntity> implements ArticlePublishRangeService {
@Override
public List<ArticleGridPublishedSummaryDTO> selectByCreatedDate(String customerId, Date createDate) {
return baseDao.selectByCreatedDate(customerId,createDate);
}
}

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.voice.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.voice.ArticleDao;
import com.epmet.entity.voice.ArticleEntity;
import com.epmet.service.voice.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 项目表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11
*/
@Service
@DataSource(DataSourceConstant.GOV_VOICE)
public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntity> implements ArticleService {
@Autowired
private ArticleDao articleDao;
}

33
epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml

@ -61,19 +61,6 @@ spring:
baseline-on-migrate: true
baseline-version: 0
#stats:
# datasources:
# - name: statsDatasource
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: @datasource.druid.stats.url@
# username: @datasource.druid.stats.username@
# password: @datasource.druid.stats.password@
# - name: orgDatasource
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: @datasource.druid.org.url@
# username: @datasource.druid.org.username@
# password: @datasource.druid.org.password@
management:
endpoints:
web:
@ -147,4 +134,22 @@ dynamic:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.project.url@
username: @datasource.druid.project.username@
password: @datasource.druid.project.password@
password: @datasource.druid.project.password@
govVoice:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.voice.url@
username: @datasource.druid.voice.username@
password: @datasource.druid.voice.password@
operCrm:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.crm.url@
username: @datasource.druid.crm.username@
password: @datasource.druid.crm.password@
thread:
# 线程池配置
threadPool:
corePoolSize: @thread.pool.core-pool-size@
maxPoolSize: @thread.pool.max-pool-size@
queueCapacity: @thread.pool.queue-capacity@
keepAlive: @thread.pool.keep-alive@

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save