From 8af2c79a678da79af362f4364e744adb78cfe6ed Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Feb 2021 09:46:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenGovernRankDataDao.java | 9 ++++ .../impl/GrassRootsGovernServiceImpl.java | 49 +++++++++++++------ .../mapper/screen/ScreenGovernRankDataDao.xml | 24 +++++++++ 3 files changed, 67 insertions(+), 15 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index e973aa85f3..405144008a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -41,4 +41,13 @@ public interface ScreenGovernRankDataDao{ * @date 2020.08.20 17:34 **/ List selectGovernCapacityRatio(@Param("monthId") String monthId,@Param("agencyId") String agencyId); + + /** + * @Description 查询政府治理能力各项指标【new】 + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2021/2/26 上午9:22 + */ + List selectGovernCapacityRatioNew(@Param("monthId") String monthId,@Param("orgIds") List orgIds); } \ 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/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index e6044d6aec..8dc4519b81 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -104,16 +104,21 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List difficultProject(AgencyNumTypeParamFormDTO param) { - List nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); - if (CollectionUtils.isEmpty(nextAgencyIds)){ - return new ArrayList<>(); - } + List nextAgencyIds = new ArrayList<>(); + List result = new ArrayList<>(); if(null == param.getTopNum()){ param.setTopNum(NumConstant.TWO); } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); -// List result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); - List result = screenDifficultyDataDao.selectDifficultyNew(nextAgencyIds,param.getType()); + if (StringUtils.isNotEmpty(param.getAreaCode())){ + nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); + if (CollectionUtils.isEmpty(nextAgencyIds)){ + return new ArrayList<>(); + } + result = screenDifficultyDataDao.selectDifficultyNew(nextAgencyIds,param.getType()); + }else { + result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); + } for(DifficultProjectResultDTO resultDTO:result){ if (StringUtils.isNotBlank(resultDTO.getImgUrl()) && !resultDTO.getImgUrl().contains("http")) { resultDTO.setImgUrl(StrConstant.EPMETY_STR); @@ -211,19 +216,33 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List governCapacityRank(AgencyAndNumFormDTO param) { + List orderList = new ArrayList<>(); if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE); if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); PageHelper.startPage(NumConstant.ONE,param.getTopNum()); String monthId = dateUtils.getCurrentMonthId(); - List orderList = - screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId()); - int time = NumConstant.TWELVE; - while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ - time--; - monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId); - PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - orderList = - screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId()); + if (StringUtils.isNotEmpty(param.getAreaCode())){ + List nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); + if (CollectionUtils.isEmpty(nextAgencyIds)){ + return new ArrayList<>(); + } + orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds); + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds); + } + }else { + orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId()); + int time = NumConstant.TWELVE; + while (CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE) { + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); + PageHelper.startPage(NumConstant.ONE, param.getTopNum()); + orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId()); + } } if(null == orderList || orderList.isEmpty()) return new ArrayList<>(); List result = new LinkedList<>(); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml index a1766981cc..00e91ae090 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml @@ -25,4 +25,28 @@ (rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC,rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC + + + \ No newline at end of file