From 672a5041c659b7c79513d23a871794d96ba467f3 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 8 Jan 2021 11:17:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E7=BB=84=E7=BB=87/=E5=9F=BA?= =?UTF-8?q?=E5=B1=82=E6=B2=BB=E7=90=86=20=E6=8C=87=E6=A0=87=EF=BC=8C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E4=BC=A0=E4=BA=86monthId=EF=BC=8C=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E6=98=AF=E6=88=AA=E6=AD=A2=E5=88=B0?= =?UTF-8?q?=E5=BD=93=E5=89=8DmonthId=E7=9A=84=E8=BF=9112=E6=9C=88=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screenan/ScreenAnGrassRootsGovernMonthlyDao.java | 6 +++--- .../screenan/ScreenAnGrassRootsOrgMonthlyDao.java | 6 +++--- .../screen/impl/AnScreenServiceImpl.java | 12 ++++++++---- .../screenan/ScreenAnGrassRootsGovernMonthlyDao.xml | 6 ++++-- .../screenan/ScreenAnGrassRootsOrgMonthlyDao.xml | 6 ++++-- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java index 40609442aa..bffebbd488 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java @@ -48,12 +48,12 @@ public interface ScreenAnGrassRootsGovernMonthlyDao { * 基层治理-指标月度趋势 * * @param agencyId - * @param yearId + * @param monthId * @return java.util.List * @author zhaoqifeng * @date 2020/10/9 16:49 */ - List selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + List selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("monthId") String monthId); /** * 基层治理-治理排行 @@ -66,4 +66,4 @@ public interface ScreenAnGrassRootsGovernMonthlyDao { */ List selectGrassRootsGovernRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId); -} \ No newline at end of file +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java index 9fb38ae91e..72923db4c8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java @@ -49,12 +49,12 @@ public interface ScreenAnGrassRootsOrgMonthlyDao { * 基层组织-指标月度趋势 * * @param agencyId - * @param yearId + * @param monthId * @return java.util.List * @author zhaoqifeng * @date 2020/10/9 16:32 */ - List selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + List selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("monthId") String monthId); /** * 基层组织-组织排行榜单 @@ -67,4 +67,4 @@ public interface ScreenAnGrassRootsOrgMonthlyDao { */ List selectGrassRootsOrgRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId); -} \ No newline at end of file +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java index 9d931f4103..a456c3046c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java @@ -123,8 +123,10 @@ public class AnScreenServiceImpl implements AnScreenService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) public GrassRootsOrgTrendResultDTO grassRootsOrgTrend(AnScreenTrendFormDTO formDTO) { GrassRootsOrgTrendResultDTO resultDTO = new GrassRootsOrgTrendResultDTO(); - String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); - List list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), yearId); + + String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM); + // 查询近一年的指数值【包括本月】 + List list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), monthId); List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); List groupTotalList = list.stream().map(GrassRootsOrgTrendDTO::getGroupTotal).collect(Collectors.toList()); List issueTotalList = list.stream().map(GrassRootsOrgTrendDTO::getIssueTotal).collect(Collectors.toList()); @@ -176,8 +178,10 @@ public class AnScreenServiceImpl implements AnScreenService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) public GrassRootsGovernTrendResultDTO grassRootsGovernTrend(AnScreenTrendFormDTO formDTO) { GrassRootsGovernTrendResultDTO resultDTO = new GrassRootsGovernTrendResultDTO(); - String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); - List list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), yearId); + + String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM); + // 查询近一年的指数值【包括本月】 + List list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), monthId); List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); List partiProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getPartiProjectTotal).collect(Collectors.toList()); List closedProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getClosedProjectTotal).collect(Collectors.toList()); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml index f88612d078..c7f5d471cc 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml @@ -25,7 +25,9 @@ FROM screen_an_grass_roots_govern_monthly WHERE DEL_FLAG = 0 AND ORG_ID = #{agencyId} - AND YEAR_ID = #{yearId} + + AND MONTH_ID <= #{monthId} + ORDER BY MONTH_ID - \ No newline at end of file + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml index 05c17e1378..0476fa56d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml @@ -21,7 +21,9 @@ FROM screen_an_grass_roots_org_monthly WHERE DEL_FLAG = 0 AND ORG_ID = #{agencyId} - AND YEAR_ID = #{yearId} + + AND MONTH_ID <= #{monthId} + ORDER BY MONTH_ID - \ No newline at end of file +