Browse Source

反参修改

dev_shibei_match
zxc 5 years ago
parent
commit
fca8867d69
  1. 15
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java

15
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java

@ -12,6 +12,7 @@ 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;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO;
@ -78,7 +79,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
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()))));
result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal()));
}
return result;
}
@ -96,11 +97,21 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
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()))));
result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal()));
}
return result;
}
public String getRatio(Integer partyMemberTotal, Integer platFormTotal){
if (null == partyMemberTotal || null == platFormTotal || partyMemberTotal == NumConstant.ZERO || platFormTotal == NumConstant.ZERO){
return "0.00%";
}
BigDecimal aDecimal = new BigDecimal(partyMemberTotal);
BigDecimal bDecimal = new BigDecimal(platFormTotal);
BigDecimal result = aDecimal.divide(bDecimal, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP);
return result.multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.TWO,BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO);
}
/**
* @Description 2党员基本情况-年龄分布
* @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980

Loading…
Cancel
Save