Browse Source

党员基本情况-年龄分布 修改

dev_shibei_match
zxc 5 years ago
parent
commit
d7dfd41f5f
  1. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java
  2. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java
  3. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java
  4. 18
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java
  5. 15
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java

@ -11,10 +11,7 @@ import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO;
import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* 基层党建相关各指标查询
@ -52,9 +49,9 @@ public class GrassrootsPartyDevController {
* @date 2020.08.18 17:54
**/
@PostMapping("ageinfo")
public Result<PartymemberAgeDistributionResultDTO> ageInfo(@RequestBody ParymemberFormDTO param){
public Result<PartymemberAgeDistributionResultDTO> ageInfo(@RequestBody ParymemberFormDTO param,@RequestHeader("CustomerId") String customerId){
ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class);
return new Result<PartymemberAgeDistributionResultDTO>().ok(grassrootsPartyDevService.partymemberAgeDistribution(param));
return new Result<PartymemberAgeDistributionResultDTO>().ok(grassrootsPartyDevService.partymemberAgeDistribution(param,customerId));
}
/**

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java

@ -39,6 +39,7 @@ public interface ScreenCpcBaseDataDao{
* @date 2020.08.18 17:47
**/
PartymemberAgeDistributionResultDTO selectPartymemberAgeDistribution(@Param("agencyId") String agencyId);
PartymemberAgeDistributionResultDTO selectPartymemberAgeDistributionNew(@Param("agencyId") String agencyId);
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java

@ -34,7 +34,7 @@ public interface GrassrootsPartyDevService {
* @author wangc
* @date 2020.08.18 17:54
**/
PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param);
PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param,String customerId);
/**
* @Description 3支部建设情况|联建共建情况-折线图

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

@ -2,6 +2,8 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCpcBaseDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyBranchDataDao;
@ -13,6 +15,7 @@ import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -45,6 +48,8 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
private ScreenPartyBranchDataDao screenPartyBranchDataDao;
@Autowired
private DateUtils dateUtils;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
/**
* @Description 1党员基本情况-饼状图概况
@ -85,8 +90,17 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) {
PartymemberAgeDistributionResultDTO ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId());
public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param,String customerId) {
Result<List<String>> result = operCrmOpenFeignClient.getAllSubCustomerIds(customerId);
if (!result.success()){
throw new RenException("select subCustomerIds failure");
}
PartymemberAgeDistributionResultDTO ageInfo = new PartymemberAgeDistributionResultDTO();
if (!CollectionUtils.isEmpty(result.getData())) {
ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistributionNew(param.getAgencyId());
}else {
ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId());
}
if(null == ageInfo){
ageInfo = new PartymemberAgeDistributionResultDTO();
}

15
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml

@ -18,5 +18,20 @@
DEL_FLAG = '0'
AND ORG_ID = #{agencyId}
</select>
<select id="selectPartymemberAgeDistributionNew" resultType="com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO">
SELECT
SUM( bd.AGE_LEVEL_1 ) + SUM( bd.AGE_LEVEL_2 ) AS under30Count,
SUM( bd.AGE_LEVEL_3 ) + SUM( bd.AGE_LEVEL_4 ) AS between31And50Count,
SUM( bd.AGE_LEVEL_5 ) AS between51And60Count,
SUM( bd.AGE_LEVEL_6 ) AS above61Count,
SUM( bd.PARTY_MEMBER_COUNT) AS partyMemberCount,
SUM( bd.AGE_LEVEL_1 ) + SUM( bd.AGE_LEVEL_2 )+SUM( bd.AGE_LEVEL_3 ) + SUM( bd.AGE_LEVEL_4 )+SUM( bd.AGE_LEVEL_5 )+SUM( bd.AGE_LEVEL_6 ) as partyTotal
FROM
screen_cpc_base_data bd
LEFT JOIN screen_customer_agency ca ON ca.AGENCY_ID = bd.ORG_ID
WHERE
bd.DEL_FLAG = '0'
AND ca.AREA_CODE LIKE CONCAT((SELECT AREA_CODE FROM screen_customer_agency WHERE AGENCY_ID = #{agencyId} AND DEL_FLAG = 0),'%')
</select>
</mapper>
Loading…
Cancel
Save