Browse Source

Merge remote-tracking branch 'origin/dev_pyscreen' into dev_temp

dev
yinzuomei 5 years ago
parent
commit
85ce79b6f8
  1. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java
  2. 15
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java
  3. 77
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml
  4. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml
  5. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java

@ -44,4 +44,6 @@ public class GovernCapacityResultDTO implements Serializable {
* 当前agencyName的上一级组织名称 * 当前agencyName的上一级组织名称
*/ */
private String parentAgencyName; private String parentAgencyName;
private String orgId;
} }

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.service.evaluationindex.screen.GrassrootsPartyDevService;
import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.DateUtils;
import com.epmet.datareport.utils.ModuleConstant; 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.BranchBuildRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; 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()){ if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));
}else{ }else{
result.setPercentInPlatForm(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue())))); result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal()));
} }
return result; return result;
} }
@ -96,11 +97,21 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){ if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));
}else{ }else{
result.setPercentInPlatForm(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue())))); result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal()));
} }
return result; 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党员基本情况-年龄分布 * @Description 2党员基本情况-年龄分布
* @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980 * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980

77
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml

@ -6,6 +6,7 @@
<!-- 查询政府治理能力各项指标 --> <!-- 查询政府治理能力各项指标 -->
<select id="selectGovernCapacityRatio" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO"> <select id="selectGovernCapacityRatio" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO">
SELECT SELECT
rankData.org_id as orgId,
rankData.ORG_NAME AS agencyName, rankData.ORG_NAME AS agencyName,
rankData.RESPONSE_RATIO, rankData.RESPONSE_RATIO,
rankData.RESOLVED_RATIO, rankData.RESOLVED_RATIO,
@ -27,27 +28,61 @@
<!-- 基层治理-治理能力榜单 多客户版,调用此sql --> <!-- 基层治理-治理能力榜单 多客户版,调用此sql -->
<select id="selectGovernCapacityRatioNew" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO"> <select id="selectGovernCapacityRatioNew" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO">
SELECT (SELECT
rankData.ORG_NAME AS agencyName, agency.agency_id as orgId,
rankData.RESPONSE_RATIO, agency.AGENCY_NAME AS agencyName,
rankData.RESOLVED_RATIO, IFNULL(rankData.RESPONSE_RATIO,0) AS RESPONSE_RATIO,
rankData.GOVERN_RATIO, IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO,
rankData.SATISFACTION_RATIO, IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO,
pa.AGENCY_NAME AS parentAgencyName IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
FROM pa.AGENCY_NAME AS parentAgencyName
screen_govern_rank_data rankData FROM screen_customer_agency agency
LEFT JOIN screen_customer_agency agency ON (rankData.org_id = agency.AGENCY_ID AND agency.DEL_FLAG = '0') left join screen_customer_agency pa
left join screen_customer_agency pa on(agency.PARENT_AREA_CODE=pa.AREA_CODE and pa.DEL_FLAG='0') on(agency.PARENT_AREA_CODE=pa.AREA_CODE
WHERE and pa.DEL_FLAG='0')
rankData.DEL_FLAG = '0' left join screen_govern_rank_data rankData
AND rankData.org_id in ON (agency.AGENCY_ID =rankData.org_id
<foreach collection="orgIds" item="orgId" open="(" close=")" separator=","> AND rankData.DEL_FLAG = '0'
#{orgId} and rankData.org_type='agency')
</foreach> WHERE
AND rankData.MONTH_ID =#{monthId} agency.DEL_FLAG = '0'
ORDER BY AND agency.agency_id in
(rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC, <foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC #{orgId}
</foreach>
AND rankData.MONTH_ID =#{monthId}
ORDER BY
(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
)
union
(
SELECT
grid.grid_id as orgId,
grid.GRID_NAME AS agencyName,
IFNULL(rankData.RESPONSE_RATIO,0) AS RESPONSE_RATIO,
IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO,
IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO,
IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
ca.agency_name AS parentAgencyName
FROM screen_customer_grid grid
left join screen_customer_agency ca
on (ca.agency_id = grid.parent_agency_id)
left join screen_govern_rank_data rankData
ON (grid.grid_id=rankData.org_id
AND grid.DEL_FLAG = 0
and rankData.org_type='grid')
WHERE grid.DEL_FLAG = '0'
AND grid.GRID_ID in
<foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
#{orgId}
</foreach>
AND rankData.MONTH_ID =#{monthId}
ORDER BY
(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
)
</select> </select>
</mapper> </mapper>

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml

@ -29,7 +29,7 @@
FROM FROM
screen_customer_agency sca screen_customer_agency sca
LEFT JOIN screen_party_link_masses_data md LEFT JOIN screen_party_link_masses_data md
ON ( sca.agency_id = md.ORG_ID AND md.del_flag = '0' ) ON ( sca.agency_id = md.ORG_ID AND md.del_flag = '0' and md.org_type='agency')
WHERE SCA.DEL_FLAG='0' WHERE SCA.DEL_FLAG='0'
AND sca.is_display = '1' AND sca.is_display = '1'
<if test="agencyIdList != null and agencyIdList.size() > 0"> <if test="agencyIdList != null and agencyIdList.size() > 0">
@ -47,7 +47,7 @@
FROM FROM
screen_customer_grid scg screen_customer_grid scg
LEFT JOIN screen_party_link_masses_data md LEFT JOIN screen_party_link_masses_data md
ON ( scg.GRID_ID = md.ORG_ID AND md.del_flag = '0' ) ON ( scg.GRID_ID = md.ORG_ID AND md.del_flag = '0' and md.org_type='grid' )
WHERE scg.DEL_FLAG='0' WHERE scg.DEL_FLAG='0'
<if test="agencyIdList != null and agencyIdList.size() > 0"> <if test="agencyIdList != null and agencyIdList.size() > 0">
AND scg.GRID_ID in AND scg.GRID_ID in

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java

@ -188,19 +188,19 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl<
if (!CollectionUtils.isEmpty(projectOrg)){ if (!CollectionUtils.isEmpty(projectOrg)){
projectOrg.forEach(p -> { projectOrg.forEach(p -> {
if (a.getAreaCode().equals(p.getAreaCode())){ if (a.getAreaCode().equals(p.getAreaCode())){
a.setClosedIncr(p.getClosedIncr()); a.setClosedIncr(null == p.getClosedIncr() ? NumConstant.ZERO : p.getClosedIncr());
a.setProjectIncr(p.getProjectIncr()); a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr());
a.setProjectIncr(p.getProjectIncr()); a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr());
} }
}); });
} }
if (!CollectionUtils.isEmpty(projectGrandOrg)){ if (!CollectionUtils.isEmpty(projectGrandOrg)){
projectGrandOrg.forEach(p -> { projectGrandOrg.forEach(p -> {
if (a.getAreaCode().equals(p.getAreaCode())){ if (a.getAreaCode().equals(p.getAreaCode())){
a.setClosedTotal(p.getClosedTotal()); a.setClosedTotal(null == p.getClosedTotal() ? NumConstant.ZERO : p.getClosedTotal());
a.setProjectTotal(p.getProjectTotal()); a.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal());
a.setUnClosedTotal(p.getUnClosedTotal()); a.setUnClosedTotal(null == p.getUnClosedTotal() ? NumConstant.ZERO : p.getUnClosedTotal());
a.setProjectIncr(p.getProjectIncr()); a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr());
} }
}); });
} }

Loading…
Cancel
Save