From 6e73722d18b6f695765183cb6884817db2983738 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Jun 2020 09:06:59 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/src/main/resources/logback-spring.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index be99941c33..ad10364cb5 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -143,6 +143,7 @@ + @@ -161,6 +162,7 @@ + From 57bb9278f23d5d42681d92ec8f6f4773e6b92642 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Jun 2020 09:17:34 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/issue/IssueDao.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml index 19e81a0cb5..bb9e3b4747 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml @@ -35,6 +35,7 @@ WHERE fiad.DEL_FLAG = '0' AND fiad.PID = #{agencyId} GROUP BY AGENCY_ID + ORDER BY fiad.ISSUE_TOTAL DESC + - - - - - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml new file mode 100644 index 0000000000..796804c0c9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml @@ -0,0 +1,84 @@ + + + + + + + INSERT INTO fact_topic_issue_agency_daily + ( + ID, + + PID, + + AGENCY_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.pid}, + + #{item.agencyId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml new file mode 100644 index 0000000000..1d85661ddd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml @@ -0,0 +1,78 @@ + + + + + + + INSERT INTO fact_topic_issue_agency_monthly + ( + ID, + + PID, + + AGENCY_ID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.pid}, + + #{item.agencyId}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml new file mode 100644 index 0000000000..d509a646bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml @@ -0,0 +1,87 @@ + + + + + + + INSERT INTO fact_topic_issue_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml new file mode 100644 index 0000000000..e9232f4a24 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml @@ -0,0 +1,77 @@ + + + + + + + INSERT INTO fact_topic_issue_grid_monthly + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml new file mode 100644 index 0000000000..f8f4a16a84 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml @@ -0,0 +1,95 @@ + + + + + + + INSERT INTO fact_topic_status_agency_daily + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCREMENT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml new file mode 100644 index 0000000000..dc61db8665 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml @@ -0,0 +1,86 @@ + + + + + + + INSERT INTO fact_topic_status_agency_monthly + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml new file mode 100644 index 0000000000..b60c3bffaf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_status_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCREMENT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml new file mode 100644 index 0000000000..d12e0d8c11 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_total_agency_daily + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_TOTAL, + + TOPIC_INCR, + + HIDDEN_TOTAL_COUNT, + + ISSUE_TOTAL_COUNT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicTotal}, + + #{item.topicIncr}, + + #{item.hiddenTotalCount}, + + #{item.issueTotalCount}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_total_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml new file mode 100644 index 0000000000..537a46cebb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_total_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_TOTAL, + + TOPIC_INCR, + + HIDDEN_TOTAL_COUNT, + + ISSUE_TOTAL_COUNT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicTotal}, + + #{item.topicIncr}, + + #{item.hiddenTotalCount}, + + #{item.issueTotalCount}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_total_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml new file mode 100644 index 0000000000..b41b6f89dd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml @@ -0,0 +1,106 @@ + + + + + + + INSERT INTO fact_participation_user_agency_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml new file mode 100644 index 0000000000..7215527ed6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml @@ -0,0 +1,105 @@ + + + + + + + INSERT INTO fact_participation_user_agency_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml new file mode 100644 index 0000000000..575cea1844 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml @@ -0,0 +1,111 @@ + + + + + + + INSERT INTO fact_participation_user_grid_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + DATE_ID, + + WEEK_ID, + + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml new file mode 100644 index 0000000000..cfe17cd854 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml @@ -0,0 +1,109 @@ + + + + + + + INSERT INTO fact_participation_user_grid_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml new file mode 100644 index 0000000000..185a97da77 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml @@ -0,0 +1,106 @@ + + + + + + + INSERT INTO fact_reg_user_agency_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml new file mode 100644 index 0000000000..aa8548ff1c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml @@ -0,0 +1,105 @@ + + + + + + + INSERT INTO fact_reg_user_agency_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml new file mode 100644 index 0000000000..f8d85b7ab9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml @@ -0,0 +1,109 @@ + + + + + + + INSERT INTO fact_reg_user_grid_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml new file mode 100644 index 0000000000..f5f66265fe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml @@ -0,0 +1,110 @@ + + + + + + + INSERT INTO fact_reg_user_grid_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml new file mode 100644 index 0000000000..10bf5cd05b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 91dc279ec1..1b6f925c97 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -30,7 +30,7 @@ - + AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -42,7 +42,16 @@ REGISTER_RELATION WHERE DEL_FLAG = '0' - AND REGISTER = '1' + + + + AND PARTICIPATION = '1' + + + + AND REGISTER = '1' + + GRID_ID = #{gridId} @@ -80,7 +89,7 @@ - + AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -112,7 +121,7 @@ - + AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -138,7 +147,7 @@ urole.USER_ID = #{incrUserId} - + AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -158,7 +167,7 @@ urole.USER_ID = #{userId} - + AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -189,7 +198,7 @@ - + AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -211,7 +220,7 @@ urole.USER_ID = #{userId} - + AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -310,14 +319,7 @@ urole.GRID_ID = #{gridId} - - - AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) - - - AND urole.CREATED_TIME CURDATE( ) AND urole.CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) - - + AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) AND erole.ROLE_NAME = '热心居民' From f3a330b437efb32061a16f526358606eb0390c48 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 24 Jun 2020 10:39:07 +0800 Subject: [PATCH 5/7] =?UTF-8?q?pom=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index af7cc94e2b..8bd8f152a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -159,7 +159,7 @@ 6379 123456 - false + true 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b From 512687903465293d48b6145db1df68b49742a71f Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Jun 2020 12:11:10 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/issue/impl/IssueServiceImpl.java | 82 +++++++++++++------ .../main/resources/mapper/issue/IssueDao.xml | 2 +- .../java/com/epmet/DataStatsApplication.java | 2 + 3 files changed, 61 insertions(+), 25 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java index 4271cbe29e..207a7f9c30 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.issue.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.issue.IssueDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; @@ -17,6 +18,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -35,15 +37,29 @@ public class IssueServiceImpl implements IssueService { IssueSummaryInfoResultDTO result = new IssueSummaryInfoResultDTO(); String agencyId = getAgencyId(tokenDto); IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); - result.setAgencyId(agencyId); - result.setDateName(data.getDateName()); - result.setIssueTotal(data.getIssueTotal()); - result.setVotingTotal(data.getVotingTotal()); - result.setShiftProjectTotal(data.getShiftProjectTotal()); - result.setClosedTotal(data.getClosedTotal()); - result.setVotingRatio(toRatio(data.getVotingPercent())); - result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent())); - result.setClosedRatio(toRatio(data.getClosedPercent())); + if (null == data) { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); + result.setAgencyId(agencyId); + result.setDateName(DateUtils.format(date, "yyyy.MM.dd")); + result.setIssueTotal(NumConstant.ZERO); + result.setVotingTotal(NumConstant.ZERO); + result.setShiftProjectTotal(NumConstant.ZERO); + result.setClosedTotal(NumConstant.ZERO); + result.setVotingRatio("0%"); + result.setShiftProjectRatio("0%"); + result.setClosedRatio("0%"); + } else { + result.setAgencyId(agencyId); + result.setDateName(data.getDateName()); + result.setIssueTotal(data.getIssueTotal()); + result.setVotingTotal(data.getVotingTotal()); + result.setShiftProjectTotal(data.getShiftProjectTotal()); + result.setClosedTotal(data.getClosedTotal()); + result.setVotingRatio(toRatio(data.getVotingPercent())); + result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent())); + result.setClosedRatio(toRatio(data.getClosedPercent())); + } return result; } @@ -52,21 +68,39 @@ public class IssueServiceImpl implements IssueService { List list = new ArrayList<>(); String agencyId = getAgencyId(tokenDto); IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); - IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); - voting.setName(IssueConstant.VOTING_NAME); - voting.setValue(data.getVotingTotal()); - voting.setRatio(toRatio(data.getVotingPercent())); - list.add(voting); - IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); - shift.setName(IssueConstant.SHIFT_NAME); - shift.setValue(data.getShiftProjectTotal()); - shift.setRatio(toRatio(data.getShiftProjectPercent())); - list.add(shift); - IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); - closed.setName(IssueConstant.CLOSED_NAME); - closed.setValue(data.getClosedTotal()); - closed.setRatio(toRatio(data.getClosedPercent())); - list.add(closed); + if (null == data) { + IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); + voting.setName(IssueConstant.VOTING_NAME); + voting.setValue(NumConstant.ZERO); + voting.setRatio("0%"); + list.add(voting); + IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); + shift.setName(IssueConstant.SHIFT_NAME); + shift.setValue(NumConstant.ZERO); + shift.setRatio("0%"); + list.add(shift); + IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); + closed.setName(IssueConstant.CLOSED_NAME); + closed.setValue(NumConstant.ZERO); + closed.setRatio("0%"); + list.add(closed); + } else { + IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); + voting.setName(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + voting.setRatio(toRatio(data.getVotingPercent())); + list.add(voting); + IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); + shift.setName(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + shift.setRatio(toRatio(data.getShiftProjectPercent())); + list.add(shift); + IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); + closed.setName(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + closed.setRatio(toRatio(data.getClosedPercent())); + list.add(closed); + } return list; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml index bb9e3b4747..468f4c7a89 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml @@ -13,7 +13,7 @@ CLOSED_TOTAL, CLOSED_PERCENT, MAX(DATE_ID) AS DATE_ID, - DATE_FORMAT(DATE_ID, '%Y.%m.%d') AS DATE_NAME + DATE_FORMAT(MAX(DATE_ID), '%Y.%m.%d') AS DATE_NAME FROM fact_issue_agency_daily fiad WHERE DEL_FLAG = '0' diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index 7da757a418..ad4e2110fa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -3,8 +3,10 @@ package com.epmet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.scheduling.annotation.EnableAsync; @SpringBootApplication (exclude = {DataSourceAutoConfiguration.class}) +@EnableAsync public class DataStatsApplication { public static void main(String[] args) { From d68e45c608f1308131173cfc2954322b9600132d Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Jun 2020 12:15:48 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/issue/constant/IssueConstant.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java index 88d4f44c78..52488ea582 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java @@ -6,8 +6,8 @@ package com.epmet.issue.constant; * @date 2020/6/22 14:07 */ public interface IssueConstant { - String MONTH = "month"; - String DATE = "date"; + String MONTH = "monthly"; + String DATE = "daily"; String VOTING_NAME = "表决中"; String SHIFT_NAME = "已转项目"; String CLOSED_NAME = "已关闭";