From 5888b39a86ca568268138e46fdcdef91d30cb4ab Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 1 Jul 2020 09:17:53 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AA=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/StatsGroupServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index b9735e489c..1571c6b3fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -154,7 +154,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { //机关下的所有网格(包括直属网格) List allGrid = this.getAllGrid(agencyId,customerId); if (allGrid.size() != NumConstant.ZERO) { - // 1. 机关下有多少网格 + // 1. 机关下有多少网格 (this.getAllGrid拿的是当前机关下所有网格,以下方法是根据“dateId”来拿的,两者过滤) List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); AtomicReference gridSize = new AtomicReference<>(NumConstant.ZERO); if (customerGridIdList.size() != NumConstant.ZERO) { From 740409ef3302141d16eaef482247a348a49f2a57 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 1 Jul 2020 09:50:17 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/StatsIssueServiceImpl.java | 2 ++ .../main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml | 2 ++ .../src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml | 1 + 3 files changed, 5 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index 8fc548d4c2..a4d845ab90 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -227,6 +227,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { FactIssueAgencyMonthlyDTO dto = issueAgencyMonthlyIncList.get(i); if (agency.getId().equals(dto.getAgencyId())) { monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setVotingIncr(dto.getVotingIncr()); monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); monthly.setClosedIncr(dto.getClosedIncr()); monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); @@ -430,6 +431,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { FactIssueGridMonthlyDTO dto = gridMonthlyIncListList.get(i); if (grid.getId().equals(dto.getGridId())) { monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setVotingIncr(dto.getVotingIncr()); monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); monthly.setClosedIncr(dto.getClosedIncr()); monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml index 430abbd36c..45f53d10cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -51,6 +51,7 @@ SELECT da.ID AS "agencyId", SUM(IFNULL(ISSUE_INCR, 0)) AS "issueIncr", + SUM(IFNULL(VOTING_INCR, 0)) AS "votingIncr", SUM(IFNULL(SHIFT_PROJECT_INCR, 0)) AS "shiftProjectIncr", SUM(IFNULL(CLOSED_INCR, 0)) AS "closedIncr", SUM(IFNULL(CLOSED_RESOLVED_INCR, 0)) AS "closedResolvedIncr", @@ -64,6 +65,7 @@ AND MONTH_ID = #{monthId} WHERE da.DEL_FLAG = '0' + AND da.AGENCY_DIM_TYPE= 'all' AND da.CUSTOMER_ID = #{customerId} GROUP BY da.ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml index cbcc5b4276..35ca051fa1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml @@ -57,6 +57,7 @@ dg.AGENCY_ID AS "agencyId", dg.ID AS "gridId", SUM(IFNULL(ISSUE_INCR, 0)) AS "issueIncr", + SUM(IFNULL(VOTING_INCR, 0)) AS "votingIncr", SUM(IFNULL(SHIFT_PROJECT_INCR, 0)) AS "shiftProjectIncr", SUM(IFNULL(CLOSED_INCR, 0)) AS "closedIncr", SUM(IFNULL(CLOSED_RESOLVED_INCR, 0)) AS "closedResolvedIncr", From 5385badfb783cc7ecb0c94ebf60a8bdc5564a66f Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Wed, 1 Jul 2020 09:57:26 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E4=B8=BAt-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../publicity/impl/PublicityServiceImpl.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java index 990cc97916..902bfdee3f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java @@ -45,6 +45,8 @@ public class PublicityServiceImpl implements PublicityService { private PublicityDao publicityDao;//机关每日发文 @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + private Date dateFact = DateUtils.addDateDays( new Date(),-1); + /** * @param tokenDto @@ -66,16 +68,15 @@ public class PublicityServiceImpl implements PublicityService { @Override public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); if (StringUtils.equals("month", type)) {//当月 - String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 @@ -94,16 +95,15 @@ public class PublicityServiceImpl implements PublicityService { @Override public List tagused(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); if (StringUtils.equals("month", type)) {//当月 - String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 @@ -122,8 +122,8 @@ public class PublicityServiceImpl implements PublicityService { @Override public List subagencyPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); +// Date date = new Date(); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -131,7 +131,7 @@ public class PublicityServiceImpl implements PublicityService { return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId); } else if (StringUtils.equals("year", type)) {//当年 @@ -150,8 +150,8 @@ public class PublicityServiceImpl implements PublicityService { @Override public List departmentPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); +// Date date = new Date(); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -159,7 +159,7 @@ public class PublicityServiceImpl implements PublicityService { return publicityDao.getSubDepartPublishedMonth(agencyId, monthId); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId); } else if (StringUtils.equals("year", type)) {//当年 @@ -178,8 +178,8 @@ public class PublicityServiceImpl implements PublicityService { @Override public List subgridPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); - Date date = new Date(); - String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); +// Date date = new Date(); + String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -187,7 +187,7 @@ public class PublicityServiceImpl implements PublicityService { return publicityDao.getSubGridPublishedMonth(agencyId, monthId); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact); return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId); } else if (StringUtils.equals("year", type)) {//当年 From f0ed21f83872b514d3ab6be1fa9c8937cf9dfb72 Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Wed, 1 Jul 2020 10:15:16 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/publicity/impl/PublicityServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java index 902bfdee3f..234e4afeee 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java @@ -45,7 +45,7 @@ public class PublicityServiceImpl implements PublicityService { private PublicityDao publicityDao;//机关每日发文 @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; - private Date dateFact = DateUtils.addDateDays( new Date(),-1); + /** @@ -68,6 +68,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); + Date dateFact = DateUtils.addDateDays( new Date(),-1); String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -95,6 +96,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List tagused(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); + Date dateFact = DateUtils.addDateDays( new Date(),-1); String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -122,7 +124,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List subagencyPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); -// Date date = new Date(); + Date dateFact = DateUtils.addDateDays( new Date(),-1); String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -150,7 +152,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List departmentPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); -// Date date = new Date(); + Date dateFact = DateUtils.addDateDays( new Date(),-1); String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); @@ -178,7 +180,7 @@ public class PublicityServiceImpl implements PublicityService { @Override public List subgridPublishedarticle(TokenDto tokenDto, String type) { String agencyId = this.getLoginUserDetails(tokenDto); -// Date date = new Date(); + Date dateFact = DateUtils.addDateDays( new Date(),-1); String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD); String yearId = strDate.substring(0, 4); String monthId = strDate.substring(0, 6); From a1e4630329828abb8530d0f951148b649e1d0e01 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Jul 2020 10:27:37 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0report=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 48d193c2d2..06d8740880 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ 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.15 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.16 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 206fcd0f9b..293500ea7b 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ 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"> - 0.3.15 + 0.3.16 data-report-server From 4229f604dff245cec54cb2e650cd9e3994171f91 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Jul 2020 10:34:54 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0job=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-job/epmet-job-server/deploy/docker-compose-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml index 69e741e250..6fc6d88cfe 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-job-server: container_name: epmet-job-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-job-server:0.3.7 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-job-server:0.3.13 ports: - "8084:8084" network_mode: host # 使用现有网络 From 8f4fd4bd1dbe910d5f42c774651e8adedfcf0651 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 1 Jul 2020 10:57:55 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/user/UserAnalysisDao.xml | 4 +- .../data-statistical-server/pom.xml | 2 +- .../service/topic/impl/TopicServiceImpl.java | 329 ++++++++++++++++++ .../service/user/impl/UserServiceImpl.java | 8 +- 4 files changed, 337 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml index a36fe93ab5..29e482c554 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -57,8 +57,8 @@ m.id, m.DATE_ID AS currentDate, m.DATE_ID AS dateId, - m.REG_TOTAL AS regTotal, - 0 AS partiTotal, + m.REG_TOTAL AS partiTotal, + 0 AS regTotal, m.PARTYMEMBER_TOTAL AS partymemberTotal, m.PARTYMEMBER_PROPORTION*100 AS partymemberProportionValue, m.WARM_HEARTED_TOTAL AS warmHeartedTotal, diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 3c2cbaf611..8a9a478a65 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 - true + false 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index a4e9ecbc6a..77df964e59 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -921,4 +921,333 @@ public class TopicServiceImpl implements TopicService { } + /** + * @Description 根据话题状态的维度自动匹配、分析数据 + * @param + * @return + * @author wangc + * @date 2020.06.30 17:04 + **/ + void analyzeTopicGroupByIssueStatus(Map> subGridOfAgency, List agencies, Map> gridGroupMap, Map> topicOperationMap, Date targetDate, TopicStatisticalData dataPacket, List statusDimension, DimIdGenerator.DimIdBean timeDimension){ + //Boolean isMonthEnd = false; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + //前一天零点 + calendar.add(Calendar.DATE, NumConstant.ONE_NEG); + calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); + calendar.set(Calendar.MINUTE, NumConstant.ZERO); + calendar.set(Calendar.SECOND, NumConstant.ZERO); + Date targetDateCheck = null == targetDate ? calendar.getTime() : targetDate; + + calendar.setTime(targetDateCheck); + //如果目标日期是当月的最后一天 + //if(calendar.get(Calendar.DATE) == calendar.getActualMaximum(Calendar.DAY_OF_MONTH)){ + //求出这个月的第一天 + calendar.setTime(new Date()); + calendar.set(Calendar.DAY_OF_MONTH, NumConstant.ONE); + calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); + calendar.set(Calendar.MINUTE, NumConstant.ZERO); + calendar.set(Calendar.SECOND, NumConstant.ZERO); + + // isMonthEnd = true; + //} + + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + Map statusMap = new HashMap<>(); + statusDimension.forEach(status -> statusMap.put(status.getId(),status)); + Map agencyMap = new HashMap<>(); + agencies.forEach(agency -> {agencyMap.put(agency.getAgencyId(),agency);}); + + + List groupList = new LinkedList<>(); + for(Map.Entry> entry : gridGroupMap.entrySet()){ + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO) + groupList.addAll(entry.getValue()); + } + + //key -> groupId + Map groupTopicData = traverseGroupTopic(groupList,topicOperationMap); + Map gridDistinct = new HashMap<>(); + agencies.forEach(agency -> { + if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ + agency.getGridIds().forEach(grid -> { + gridDistinct.put(grid,false); + }); + } + }); + + for(Map.Entry> entry : subGridOfAgency.entrySet()){ + + FactTopicIssueAgencyDailyDTO issueAgencyD = new FactTopicIssueAgencyDailyDTO(); + FactTopicTotalAgencyDailyDTO totalAgencyD = new FactTopicTotalAgencyDailyDTO(); + + //initAgencyDailyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getPid(),agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueAgencyD,totalAgencyD); + + + statusMap.forEach((k,v) -> { + //无状态标识 + boolean noStatusFlag = false; + if(StringUtils.equals(k,"discussing")){ + noStatusFlag = true; + } + final boolean noStatusFlagFinal = noStatusFlag; + + //k:状态的key + //对应状态key的一条话题-状态记录 + FactTopicStatusAgencyDailyDTO topicAgencyD = new FactTopicStatusAgencyDailyDTO(); + topicAgencyD.setTopicStatusId(k); + //initAgencyDailyDTO + + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ + entry.getValue().forEach(gridId -> { + + + FactTopicStatusGridDailyDTO topicGridD = new FactTopicStatusGridDailyDTO(); + + topicGridD.setTopicStatusId(k); + + FactTopicIssueGridDailyDTO issueGridD = new FactTopicIssueGridDailyDTO(); + FactTopicTotalGridDailyDTO totalGirdD = new FactTopicTotalGridDailyDTO(); + + //init + //if(noStatusFlagFinal){ + //initGridDailyDTO(entry.getKey(),gridId,agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueGridD,totalGirdD,topicGridD_discussing); + //}else{ + //initGridDailyDTO(entry.getKey(),gridId,agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,topicGridD_discussing); + //} + + + List groups = gridGroupMap.get(gridId); + if(null != groups && groups.size() > NumConstant.ZERO) { + groups.forEach(group -> { + if (null != group && StringUtils.isNotBlank(group.getGroupId())) { + + if(noStatusFlagFinal) { + issueAgencyD.setIssueIncr(issueAgencyD.getIssueIncr() + groupTopicData.get(group.getGroupId()).getIssueIncr()); + issueAgencyD.setIssueTotal(issueAgencyD.getIssueTotal() + groupTopicData.get(group.getGroupId()).getIssueTotal()); + totalAgencyD.setIssueTotalCount(issueAgencyD.getIssueTotal()); + totalAgencyD.setHiddenTotalCount(totalAgencyD.getHiddenTotalCount() + groupTopicData.get(group.getGroupId()).getHiddenTotal()); + totalAgencyD.setTopicIncr(totalAgencyD.getTopicIncr() + groupTopicData.get(group.getGroupId()).getTopicIncr()); + totalAgencyD.setTopicTotal(totalAgencyD.getTopicTotal() + groupTopicData.get(group.getGroupId()).getTotal()); + issueGridD.setIssueIncr(issueGridD.getIssueIncr() + groupTopicData.get(group.getGroupId()).getIssueIncr()); + issueGridD.setIssueTotal(issueGridD.getIssueTotal() + groupTopicData.get(group.getGroupId()).getIssueTotal()); + totalGirdD.setIssueTotalCount(issueGridD.getIssueTotal()); + totalGirdD.setHiddenTotalCount(totalGirdD.getHiddenTotalCount() + groupTopicData.get(group.getGroupId()).getHiddenTotal()); + totalGirdD.setTopicIncr(totalGirdD.getTopicIncr() + groupTopicData.get(group.getGroupId()).getTopicIncr()); + totalGirdD.setTopicTotal(totalGirdD.getTopicTotal() + groupTopicData.get(group.getGroupId()).getTotal()); + } + + + + GroupTopicData data = groupTopicData.get(group.getGroupId()); + if (null != data) { + + //根据当前的话题状态key,去data中取相应的数据 + switch(k){ + case "discussing": + + topicAgencyD.setTopicCount(topicAgencyD.getTopicCount() + data.getDiscussingTotal()); + topicAgencyD.setTopicIncrement(topicAgencyD.getTopicIncrement() + data.getDiscussingIncr()); + + topicGridD.setTopicCount(topicGridD.getTopicCount() + data.getDiscussingTotal()); + topicGridD.setTopicIncrement(topicGridD.getTopicIncrement() + data.getDiscussingIncr()); + break; + case "hidden": + + topicAgencyD.setTopicCount(topicAgencyD.getTopicCount() + data.getHiddenTotal()); + topicAgencyD.setTopicIncrement(topicAgencyD.getTopicIncrement() + data.getHiddenIncr()); + + topicGridD.setTopicCount(topicGridD.getTopicCount() + data.getHiddenTotal()); + topicGridD.setTopicIncrement(topicGridD.getTopicIncrement() + data.getHiddenIncr()); + break; + case "closed": + + topicAgencyD.setTopicCount(topicAgencyD.getTopicCount() + data.getClosedTotal()); + topicAgencyD.setTopicIncrement(topicAgencyD.getTopicIncrement() + data.getClosedIncr()); + + topicGridD.setTopicCount(topicGridD.getTopicCount() + data.getClosedTotal()); + topicGridD.setTopicIncrement(topicGridD.getTopicIncrement() + data.getClosedIncr()); + break; + } + + } + + } + + + }); + } + //网格-百分比 + //setGridTopicProportion(numberFormat, topicGridD, totalGirdD); + + if(!gridDistinct.get(gridId)) { + + //setGridDailyDataPacket(dataPacket, issueGridD, totalGirdD, topicGridD_discussing, topicGridD_hidden, topicGridD_closed); + /* + if(noStatusFlagFinal){ + set :: issueGridD | totalGridD | topicGridD + }else{ + set :: topicGridD + } + */ + gridDistinct.put(gridId,true); + } + + + + }); + + + } + //机关-百分比 + //setAgencyTopicProportion(numberFormat,topicAgencyD,totalAgencyD); + + + + //setAgencyDailyDataPacket(dataPacket,issueAgencyD,totalAgencyD,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed); + /* + if(noStatusFlagFinal){ + set :: issueAgencyD | totalAgencyD | topicAgencyD + }else{ + set :: topicAgencyD + } + */ + + }); + + + } + + gridDistinct.forEach((k,v) -> { + gridDistinct.put(k,false); + }); + + List topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDate,dataPacket.getCustomerId()); + //key : gridId + Map> GridGroupMapBetweenTimeRange = + topicsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId)); + List groupListBetweenTimeRange = new LinkedList<>(); + + for(Map.Entry> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){ + if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO) + groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue()); + } + List operationsBetweenTimeRange = + topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDate); + + //key: topicId + Map> topicOperationMapBetweenTimeRange = + operationsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getTopicId)); + //key: groupId + Map groupTopicDataBetweenTimeRange = traverseGroupTopic(groupListBetweenTimeRange,topicOperationMapBetweenTimeRange); + + for(Map.Entry> entry : subGridOfAgency.entrySet()){ + + FactTopicIssueAgencyMonthlyDTO issueAgencyM = new FactTopicIssueAgencyMonthlyDTO(); + + + //initAgencyMonthlyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getPid(),agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueAgencyM); + + + statusMap.forEach((k,v) -> { + boolean noStatusFlag = false; + if(StringUtils.equals(k,"discussing")){ + noStatusFlag = true; + } + final boolean noStatusFlagFinal = noStatusFlag; + + FactTopicStatusAgencyMonthlyDTO topicAgencyM = new FactTopicStatusAgencyMonthlyDTO(); + topicAgencyM.setTopicStatusId(k); + + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ + entry.getValue().forEach(gridId -> { + + + FactTopicIssueGridMonthlyDTO issueGridM = new FactTopicIssueGridMonthlyDTO(); + initGridMonthlyDTO(entry.getKey(),gridId,agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,issueGridM); + + + List groups = gridGroupMap.get(gridId); + if(null != groups) { + groups.forEach(group -> { + if (null != group && StringUtils.isNotBlank(group.getGroupId())) { + + if(noStatusFlagFinal) { + + issueAgencyM.setIssueIncr(issueAgencyM.getIssueIncr() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueIncr()); + issueAgencyM.setIssueTotal(issueAgencyM.getIssueTotal() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueTotal()); + issueGridM.setIssueIncr(issueGridM.getIssueIncr() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueIncr()); + issueGridM.setIssueTotal(issueGridM.getIssueTotal() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueTotal()); + + } + + GroupTopicData data = groupTopicDataBetweenTimeRange.get(group.getGroupId()); + if (null != data) { + + switch(k){ + case "discussing": + + topicAgencyM.setTopicCount(topicAgencyM.getTopicCount() + data.getDiscussingTotal()); + topicAgencyM.setTopicIncr(topicAgencyM.getTopicIncr() + data.getDiscussingIncr()); + break; + case "hidden": + + topicAgencyM.setTopicCount(topicAgencyM.getTopicCount() + data.getHiddenTotal()); + topicAgencyM.setTopicIncr(topicAgencyM.getTopicIncr() + data.getHiddenIncr()); + break; + case "closed": + + topicAgencyM.setTopicCount(topicAgencyM.getTopicCount() + data.getClosedTotal()); + topicAgencyM.setTopicIncr(topicAgencyM.getTopicIncr() + data.getClosedIncr()); + break; + } + + + } + + } + + + }); + } + + if(!gridDistinct.get(gridId)) { + + setGridMonthlyDataPacket(dataPacket, issueGridM); + } + + gridDistinct.put(gridId,true); + }); + + + } + + //机关-百分比 + //Integer topicTotal = dataPacket.getTotalAgencyDailyList().stream().filter( obj -> StringUtils.equals(obj.getAgencyId(),entry.getKey())).findFirst().get().getTopicTotal(); + //setAgencyTopicMonthlyProportion(numberFormat,topicAgencyM,topicTotal); + + + /* + if(noStatusFlagFinal){ + set :: issueAgencyM | topicAgencyM + }else{ + set topicAgencyM + } + + */ + }); + + + + } + + + + + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index f7655f12a7..3882b0d524 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -186,15 +186,17 @@ public class UserServiceImpl implements UserService { Boolean isMonthBeginning = true; Calendar calendar =Calendar.getInstance(); + //求出T-1 calendar.setTime(new Date()); calendar.add(Calendar.DATE, NumConstant.ONE_NEG); Date targetDateCheck = null == targetDate ? calendar.getTime() : targetDate; + //指定日期 OR T-1 calendar.setTime(targetDateCheck); //如果目标日期不是是当月的第一天 if(calendar.get(Calendar.DATE) != calendar.getActualMinimum(Calendar.DAY_OF_MONTH)){ //求出这个月的第一天 - calendar.setTime(new Date()); + calendar.set(Calendar.DAY_OF_MONTH, NumConstant.ONE); calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); calendar.set(Calendar.MINUTE, NumConstant.ZERO); @@ -255,7 +257,7 @@ public class UserServiceImpl implements UserService { regAgencyD.setPartymemberTotal(partyRegData.getTotal()); regAgencyD.setRegIncr(regData.getIncr()); regAgencyD.setWarmIncr(warmRegData.getIncr()); - regAgencyD.setPartymemberIncr(partiData.getIncr()); + regAgencyD.setPartymemberIncr(partyPartiData.getIncr()); regAgencyD.setResiProportion(new BigDecimal(NumConstant.ONE)); regAgencyD.setPartymemberProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyRegData.getTotal()/(float)regData.getTotal() ))); regAgencyD.setWarmHeartedProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmRegData.getTotal()/(float)regData.getTotal() ))); @@ -312,7 +314,7 @@ public class UserServiceImpl implements UserService { regAgencyM.setPartymemberTotal(partyRegData.getTotal()); regAgencyM.setRegIncr(regData.getIncr()); regAgencyM.setWarmIncr(warmRegData.getIncr()); - regAgencyM.setPartymemberIncr(partiData.getIncr()); + regAgencyM.setPartymemberIncr(partyPartiData.getIncr()); regAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE)); regAgencyM.setPartymemberProportion(regAgencyD.getPartymemberProportion()); regAgencyM.setWarmHeartedProportion(regAgencyD.getWarmHeartedProportion()); From a264b800a4835eb7dc385b3176cc86360f2e8bc8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Jul 2020 11:02:10 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/utils/DingdingMsgSender.java | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java index 40420d1be7..4250c158b8 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java @@ -2,8 +2,6 @@ package com.epmet.commons.tools.utils; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.dto.form.DingTalkTextMsg; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; import com.google.common.collect.Lists; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.StringUtils; @@ -17,8 +15,6 @@ import javax.crypto.spec.SecretKeySpec; import java.io.IOException; import java.net.URLEncoder; import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; /** * desc: 发送消息工具类 @@ -43,15 +39,8 @@ public class DingdingMsgSender { */ private ArrayBlockingQueue msgQueue = new ArrayBlockingQueue<>(maxQueueSize); - private volatile boolean running = false; - private Cache limitCache = CacheBuilder.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).maximumSize(1000).build(); - - public DingdingMsgSender() { - - } - private void handleMsg() { DingTalkTextMsg msg = null; @@ -59,18 +48,7 @@ public class DingdingMsgSender { //阻塞取元素 msg = msgQueue.take(); if (msg != null) { - AtomicInteger limitCount = limitCache.getIfPresent(msg.getWebHook()); - if (limitCount == null) { - limitCount = new AtomicInteger(1); - limitCache.put(msg.getWebHook(), limitCount); - } - if (limitCount.intValue() > maxQueueSize) { - msgQueue.offer(msg); - Thread.sleep(1000); - } else { - sendPostByJSON(msg); - limitCount.addAndGet(1); - } + sendPostByJSON(msg); } else { Thread.sleep(1000); } From 4640f7bdcfa297880a8c878f4bed9cd96fe425d0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Jul 2020 11:07:41 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0report=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 06d8740880..dea1fde0fd 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ 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.16 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.17 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 293500ea7b..a79c50eef2 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ 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"> - 0.3.16 + 0.3.17 data-report-server From da7062cef1a06eecdb302e11e2c3ea879ae0f23d Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Jul 2020 11:11:23 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E6=9B=B4=E6=96=B0stats=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 0f567c71b9..0ea8dc6ffa 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ 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.21 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.22 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 47dae3a98b..4e2dfff3a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.21 + 0.3.22 data-statistical com.epmet