diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index a8a569100d..0b1295ab88 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -117,5 +117,5 @@ public interface ServiceConstant { /** * 数据统计 */ - String DATA_STATISTICAL = "data-statistical-server"; + String DATA_STATISTICAL_SERVER = "data-statistical-server"; } 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 = "已关闭"; 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/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 9b8dace788..128cdf183c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -158,8 +158,9 @@ public class TopicServiceImpl implements TopicService { String agencyId = this.getLoginUserDetails(tokenDto); List topicSummaryInfo = topicDao.topicSummaryInfo(agencyId); TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); - int i = (shiftedCount.getShiftedIssueCount() / topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue))) * NumConstant.ONE_HUNDRED; - String ratio = String.valueOf(i) + TopicConstant.RATIO; + Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue)); + String ratio; + ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : (shiftedCount.getShiftedIssueCount() / collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO; TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); result.setName(TopicConstant.SHIFTED); result.setRatio(ratio); 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 @@ + 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..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' @@ -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 = '热心居民' diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java index 99f2d1739a..695b4aae18 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java @@ -24,7 +24,7 @@ public class StatsGroupAgencyDailyTask implements ITask { @Override public void run(String params) { logger.debug("StatsGroupAgencyDailyTask定时任务正在执行,参数为:{}", params); - Result result = statsGroupService.groupGridDaily(); + Result result = statsGroupService.groupAgencyDaily(); if (result.success()){ logger.debug("StatsGroupAgencyDailyTask定时任务正在执行定时任务执行成功"); }else { diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java index 675c63ea88..780ba44f18 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java @@ -25,7 +25,7 @@ public class StatsGroupGridDailyTask implements ITask { @Override public void run(String params) { logger.debug("StatsGroupGridDailyTask定时任务正在执行,参数为:{}", params); - Result result = statsGroupService.groupAgencyDaily(); + Result result = statsGroupService.groupGridDaily(); if (result.success()){ logger.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行成功"); }else {