diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java index bca8a573bf..6feb784626 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java @@ -48,7 +48,5 @@ public interface ScreenPublicPartiTotalDataDao{ * @author wangc * @date 2020.08.20 16:00 **/ - List selectPublicPartiTotalByAreaCode(@Param("areaCode") String areaCode, - @Param("customerId")String customerId, - @Param("list")List subCustomers); + List selectPublicPartiTotalByAreaCode(@Param("areaCode") String areaCode); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java index 64d5eefc21..39a16db7bf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java @@ -49,9 +49,7 @@ public interface ScreenUserJoinDao { * @author wangc * @date 2020.08.20 15:07 **/ - UserJoinIndicatorGrowthRateResultDTO selectUserJoinDataByAreaCode(@Param("areaCode") String areaCode, @Param("monthId")String monthId, - @Param("list") List subCustomers, - @Param("customerId")String customerId); + UserJoinIndicatorGrowthRateResultDTO selectUserJoinDataByAreaCode(@Param("areaCode") String areaCode, @Param("monthId")String monthId); /** 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 8dc4519b81..ec53c3c834 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 @@ -143,23 +143,21 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); Result> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); List subCustomers; - if(null == crmResp || !crmResp.success()) {subCustomers = null ;} + if(null == crmResp || !crmResp.success()|| org.apache.commons.collections4.CollectionUtils.isEmpty(crmResp.getData())) {subCustomers = null ;} else {subCustomers = crmResp.getData();} String monthId = dateUtils.getCurrentMonthId(); - UserJoinIndicatorGrowthRateResultDTO latest = CollectionUtils.isEmpty(subCustomers) ? + UserJoinIndicatorGrowthRateResultDTO latest = CollectionUtils.isEmpty(subCustomers) ||StringUtils.isBlank(agencyInfo.getAreaCode())? screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : - screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId, - subCustomers,agencyInfo.getCustomerId()); + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId); //保证获取公众参与概率数据的最大可能性 int time = NumConstant.TWELVE; while (null == latest && time > NumConstant.ONE) { time--; monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); - latest = CollectionUtils.isEmpty(subCustomers) ? + latest = CollectionUtils.isEmpty(subCustomers)||StringUtils.isBlank(agencyInfo.getAreaCode()) ? screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : - screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId, - subCustomers,agencyInfo.getCustomerId()); + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId); } if (null == latest) return new PublicPartiProfileResultDTO(); @@ -178,28 +176,30 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 15:32 **/ - @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override public List publicPartiRank(AgencyAndNumFormDTO param) { - if(null == param.getTopNum()){ + if (null == param.getTopNum()) { param.setTopNum(NumConstant.TWO); } - if(NumConstant.ZERO == param.getTopNum()){ + if (NumConstant.ZERO == param.getTopNum()) { param.setTopNum(NumConstant.MAX); } - ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()) ; + ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); List subCustomers; Result> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); - if(null == crmResp || !crmResp.success()) {subCustomers = null ;} - else {subCustomers = crmResp.getData();} - PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + if (null == crmResp || !crmResp.success() || CollectionUtils.isEmpty(crmResp.getData())) { + subCustomers = null; + } else { + subCustomers = crmResp.getData(); + } + PageHelper.startPage(NumConstant.ONE, param.getTopNum()); List result = - CollectionUtils.isEmpty(subCustomers) ? - screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()) - : screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode(),agencyInfo.getCustomerId(), - subCustomers); - if(null == result) { + CollectionUtils.isEmpty(subCustomers) || StringUtils.isBlank(agencyInfo.getAreaCode()) ? + screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()) + : screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode()); + if (null == result) { return new ArrayList<>(); } return result; 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 00e91ae090..f98257b0a0 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,28 +25,29 @@ (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 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml index 04793de3ee..1f3e4623c0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml @@ -36,37 +36,31 @@ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index c954dc41d3..749de01cef 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -26,30 +26,36 @@