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}