|
|
@ -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(); |
|
|
@ -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<PublicPartiRankResultDTO> 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<String> subCustomers; |
|
|
|
Result<List<String>> 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<PublicPartiRankResultDTO> 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; |
|
|
|