From ae48a7276026ef355b5471bca002be217b617624 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 8 Jan 2021 14:06:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E6=8F=90=E4=BA=A4=EF=BC=9A?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E7=9A=84=E6=9C=88=E4=BB=BD=EF=BC=8C=E8=A1=A5?= =?UTF-8?q?0=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ScreenAnGrassRootsGovernMonthlyDao.java | 4 +- .../ScreenAnGrassRootsOrgMonthlyDao.java | 4 +- .../screen/impl/AnScreenServiceImpl.java | 21 +++++++-- .../ScreenAnGrassRootsGovernMonthlyDao.xml | 43 +++++++++++++------ .../ScreenAnGrassRootsOrgMonthlyDao.xml | 37 +++++++++++----- 5 files changed, 79 insertions(+), 30 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 bffebbd488..7b03527fcd 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 monthId + * @param curDate * @return java.util.List * @author zhaoqifeng * @date 2020/10/9 16:49 */ - List selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + List selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate); /** * 基层治理-治理排行 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 72923db4c8..c962c58c9e 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 monthId + * @param curDate * @return java.util.List * @author zhaoqifeng * @date 2020/10/9 16:32 */ - List selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + List selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate); /** * 基层组织-组织排行榜单 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 a456c3046c..9669af2105 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 @@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -38,6 +39,8 @@ public class AnScreenServiceImpl implements AnScreenService { private ScreenAnGrassRootsGovernMonthlyDao screenAnGrassRootsGovernMonthlyDao; @Autowired private ScreenAnCommunityProjectProfileDao screenAnCommunityProjectProfileDao; + @Autowired + private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; /** * 基层党员-各类总数 @@ -124,10 +127,19 @@ public class AnScreenServiceImpl implements AnScreenService { public GrassRootsOrgTrendResultDTO grassRootsOrgTrend(AnScreenTrendFormDTO formDTO) { GrassRootsOrgTrendResultDTO resultDTO = new GrassRootsOrgTrendResultDTO(); + // 1. x轴 +// List xAxis = new ArrayList<>(); +// if(StringUtils.isNotBlank(formDTO.getMonthId())){ +// xAxis = partyMemberLeadServiceImpl.getXproEndMonth(formDTO.getMonthId()); +// }else{ +// xAxis = partyMemberLeadServiceImpl.getXPro(); +// } + 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()); + String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01"; + // 查询近一年的指数值【包括本月】 + List list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), curDate); + 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()); List projectTotal = list.stream().map(GrassRootsOrgTrendDTO::getProjectTotal).collect(Collectors.toList()); @@ -180,8 +192,9 @@ public class AnScreenServiceImpl implements AnScreenService { GrassRootsGovernTrendResultDTO resultDTO = new GrassRootsGovernTrendResultDTO(); String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM); + String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01"; // 查询近一年的指数值【包括本月】 - List list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), monthId); + List list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), curDate); 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 c7f5d471cc..4f4e7e96c5 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 @@ -16,18 +16,37 @@ AND MONTH_ID = #{monthId}