|
|
@ -8,6 +8,7 @@ import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCpcBaseDataDao; |
|
|
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyBranchDataDao; |
|
|
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao; |
|
|
|
import com.epmet.datareport.service.evaluationindex.screen.AgencyService; |
|
|
|
import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; |
|
|
|
import com.epmet.datareport.utils.DateUtils; |
|
|
|
import com.epmet.datareport.utils.ModuleConstant; |
|
|
@ -50,7 +51,8 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService |
|
|
|
private DateUtils dateUtils; |
|
|
|
@Autowired |
|
|
|
private OperCrmOpenFeignClient operCrmOpenFeignClient; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AgencyService screenCustomerAgencyService; |
|
|
|
/** |
|
|
|
* @Description 1、党员基本情况-饼状图概况 |
|
|
|
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321324
|
|
|
@ -62,10 +64,29 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService |
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) |
|
|
|
@Override |
|
|
|
public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) { |
|
|
|
|
|
|
|
PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); |
|
|
|
if(StringUtils.isNotBlank(param.getAreaCode())){ |
|
|
|
logger.info(String.format("党员基本情况-饼状图概况按照areaCode查询:%s",param.getAreaCode())); |
|
|
|
List<String> ids=screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(),param.getAgencyId()); |
|
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(ids)){ |
|
|
|
PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercentByIds(ids); |
|
|
|
if(null == result){ |
|
|
|
logger.warn("selectAgencyPartymemberPercentByIds is null"); |
|
|
|
result = new PartymemberPercentResultDTO(); |
|
|
|
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); |
|
|
|
return result; |
|
|
|
} |
|
|
|
if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){ |
|
|
|
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); |
|
|
|
}else{ |
|
|
|
result.setPercentInPlatForm(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue())))); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
logger.warn("当前组织没有下级getNextAgencyIds is empty"); |
|
|
|
return new PartymemberPercentResultDTO(); |
|
|
|
} |
|
|
|
PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); |
|
|
|
if(null == result){ |
|
|
|
logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId()); |
|
|
|
result = new PartymemberPercentResultDTO(); |
|
|
|
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); |
|
|
|