|
|
@ -143,23 +143,21 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { |
|
|
|
ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); |
|
|
|
Result<List<String>> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); |
|
|
|
List<String> 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(); |
|
|
@ -191,14 +189,16 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { |
|
|
|
ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); |
|
|
|
List<String> subCustomers; |
|
|
|
Result<List<String>> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); |
|
|
|
if(null == crmResp || !crmResp.success()) {subCustomers = null ;} |
|
|
|
else {subCustomers = crmResp.getData();} |
|
|
|
if (null == crmResp || !crmResp.success() || CollectionUtils.isEmpty(crmResp.getData())) { |
|
|
|
subCustomers = null; |
|
|
|
} else { |
|
|
|
subCustomers = crmResp.getData(); |
|
|
|
} |
|
|
|
PageHelper.startPage(NumConstant.ONE, param.getTopNum()); |
|
|
|
List<PublicPartiRankResultDTO> result = |
|
|
|
CollectionUtils.isEmpty(subCustomers) ? |
|
|
|
CollectionUtils.isEmpty(subCustomers) || StringUtils.isBlank(agencyInfo.getAreaCode()) ? |
|
|
|
screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()) |
|
|
|
: screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode(),agencyInfo.getCustomerId(), |
|
|
|
subCustomers); |
|
|
|
: screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode()); |
|
|
|
if (null == result) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|