From 9794b400ec5182b3386687a1860f0a26d61f1fcf Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 7 Sep 2020 11:13:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/OrgTypeConstant.java | 18 ++- .../impl/FactIndexCollectServiceImpl.java | 111 ++++-------------- 2 files changed, 39 insertions(+), 90 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java index 95919792d9..7c88be956c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java @@ -9,7 +9,7 @@ package com.epmet.constant; /** - * 组织类别 常量 + * 组织类别/机关级别 常量 * * @author sun * @since 1.0.0 @@ -30,4 +30,20 @@ public interface OrgTypeConstant { * 组织 */ String AGENCY = "agency"; + + /** + * 乡(镇、街道)级 + */ + String STREET = "street"; + + /** + * 区县级 + */ + String DISTRICT = "district"; + + /** + * 社区级 + */ + String COMMUNITY = "community"; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index e8d04fea45..6033f97b04 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -702,46 +702,20 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO); - FactIndexGridScoreDTO indexGridScoreDTO1 = new FactIndexGridScoreDTO(); + FactIndexGridScoreDTO indexGridScoreDTO1 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); // 赋默认值 - 治理能力 - indexGridScoreDTO1.setGridId(gridDTO.getGridId()); - indexGridScoreDTO1.setAgencyId(gridDTO.getParentAgencyId()); - indexGridScoreDTO1.setAllParentIds(gridDTO.getAllParentIds()); - indexGridScoreDTO1.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO1.setYearId(getYearStr(monthId)); - indexGridScoreDTO1.setMonthId(monthId); - indexGridScoreDTO1.setIsTotal(NumConstant.ZERO_STR); - indexGridScoreDTO1.setScore(zero); indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - indexGridScoreDTO1.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO1); - FactIndexGridScoreDTO indexGridScoreDTO2 = new FactIndexGridScoreDTO(); + FactIndexGridScoreDTO indexGridScoreDTO2 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); // 赋默认值 - 服务能力 - indexGridScoreDTO2.setGridId(gridDTO.getGridId()); - indexGridScoreDTO2.setAgencyId(gridDTO.getParentAgencyId()); - indexGridScoreDTO2.setAllParentIds(gridDTO.getAllParentIds()); - indexGridScoreDTO2.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO2.setYearId(getYearStr(monthId)); - indexGridScoreDTO2.setMonthId(monthId); - indexGridScoreDTO2.setIsTotal(NumConstant.ZERO_STR); - indexGridScoreDTO2.setScore(zero); indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - indexGridScoreDTO2.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO2); - FactIndexGridScoreDTO indexGridScoreDTO3 = new FactIndexGridScoreDTO(); - // 赋默认值 - 网格相关 - indexGridScoreDTO3.setGridId(gridDTO.getGridId()); - indexGridScoreDTO3.setAgencyId(gridDTO.getParentAgencyId()); - indexGridScoreDTO3.setAllParentIds(gridDTO.getAllParentIds()); - indexGridScoreDTO3.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO3.setYearId(getYearStr(monthId)); - indexGridScoreDTO3.setMonthId(monthId); + FactIndexGridScoreDTO indexGridScoreDTO3 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR); - indexGridScoreDTO3.setScore(zero); + // 赋默认值 - 网格相关 indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - indexGridScoreDTO3.setDelFlag(NumConstant.ZERO_STR); insertIndexGridScoreDTOS.add(indexGridScoreDTO3); } factIndexGridScoreDao.batchInsertGridScoreData(insertIndexGridScoreDTOS, customerId); @@ -775,39 +749,19 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); insertIndexCommunityScore.add(communityScore1); - FactIndexCommunityScoreEntity communityScore2 = new FactIndexCommunityScoreEntity(); // 赋默认值 - 治理能力 - communityScore2.setAgencyId(agencyDTO.getAgencyId()); - communityScore2.setParentAgencyId(agencyDTO.getPid()); - communityScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore2.setYearId(getYearStr(monthId)); - communityScore2.setMonthId(monthId); - communityScore2.setIsTotal(NumConstant.ZERO_STR); - communityScore2.setScore(zero); + FactIndexCommunityScoreEntity communityScore2 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); insertIndexCommunityScore.add(communityScore2); - FactIndexCommunityScoreEntity communityScore3 = new FactIndexCommunityScoreEntity(); // 赋默认值 - 服务能力 - communityScore3.setAgencyId(agencyDTO.getAgencyId()); - communityScore3.setParentAgencyId(agencyDTO.getPid()); - communityScore3.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore3.setYearId(getYearStr(monthId)); - communityScore3.setMonthId(monthId); - communityScore3.setIsTotal(NumConstant.ZERO_STR); - communityScore3.setScore(zero); + FactIndexCommunityScoreEntity communityScore3 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); insertIndexCommunityScore.add(communityScore3); - FactIndexCommunityScoreEntity communityScore4 = new FactIndexCommunityScoreEntity(); // 赋默认值 - 社区相关 - communityScore4.setAgencyId(agencyDTO.getAgencyId()); - communityScore4.setParentAgencyId(agencyDTO.getPid()); - communityScore4.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore4.setYearId(getYearStr(monthId)); - communityScore4.setMonthId(monthId); + FactIndexCommunityScoreEntity communityScore4 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); communityScore4.setIsTotal(NumConstant.ONE_STR); - communityScore4.setScore(zero); communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); insertIndexCommunityScore.add(communityScore4); } @@ -858,8 +812,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { BigDecimal zero = new BigDecimal(NumConstant.ZERO); List insertIndexAgencyScore = new ArrayList<>(); for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ - if ("community".equals(agencyDTO.getLevel()) || "street".equals(agencyDTO.getLevel()) - || "district".equals(agencyDTO.getLevel())){ + if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel()) || OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) + || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ AgencyScoreEntity agencyScore1 = new AgencyScoreEntity(); // 赋默认值 - 党建能力指数 agencyScore1.setAgencyId(agencyDTO.getAgencyId()); @@ -873,51 +827,30 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { agencyScore1.setScore(zero); agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - AgencyScoreEntity agencyScore2 = new AgencyScoreEntity(); + AgencyScoreEntity agencyScore2 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); // 赋默认值 - 治理能力 - agencyScore2.setAgencyId(agencyDTO.getAgencyId()); - agencyScore2.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore2.setYearId(getYearStr(monthId)); - agencyScore2.setMonthId(monthId); - agencyScore2.setIsTotal(NumConstant.ZERO_STR); - agencyScore2.setScore(zero); agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - AgencyScoreEntity agencyScore3 = new AgencyScoreEntity(); + AgencyScoreEntity agencyScore3 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); // 赋默认值 - 服务能力 - agencyScore3.setAgencyId(agencyDTO.getAgencyId()); - agencyScore3.setParentAgencyId(agencyDTO.getPid()); - agencyScore3.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore3.setYearId(getYearStr(monthId)); - agencyScore3.setMonthId(monthId); - agencyScore3.setIsTotal(NumConstant.ZERO_STR); - agencyScore3.setScore(zero); agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - AgencyScoreEntity agencyScore4 = new AgencyScoreEntity(); - agencyScore4.setAgencyId(agencyDTO.getAgencyId()); - agencyScore4.setParentAgencyId(agencyDTO.getPid()); - agencyScore4.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore4.setYearId(getYearStr(monthId)); - agencyScore4.setMonthId(monthId); + AgencyScoreEntity agencyScore4 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); agencyScore4.setIsTotal(NumConstant.ONE_STR); - agencyScore4.setScore(zero); - if ("community".equals(agencyDTO.getLevel())){ + if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel())){ // 赋默认值 - 全区相关 agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); - agencyScore4.setDataType("district"); - agencyScore1.setDataType("district"); - agencyScore2.setDataType("district"); - agencyScore3.setDataType("district"); - } else if ("street".equals(agencyDTO.getLevel()) || "district".equals(agencyDTO.getLevel())){ + agencyScore4.setDataType(OrgTypeConstant.DISTRICT); + agencyScore1.setDataType(OrgTypeConstant.DISTRICT); + agencyScore2.setDataType(OrgTypeConstant.DISTRICT); + agencyScore3.setDataType(OrgTypeConstant.DISTRICT); + } else if (OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ // 赋默认值 - 街道相关 agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); - agencyScore4.setDataType("street"); - agencyScore1.setDataType("street"); - agencyScore2.setDataType("street"); - agencyScore3.setDataType("street"); + agencyScore4.setDataType(OrgTypeConstant.STREET); + agencyScore1.setDataType(OrgTypeConstant.STREET); + agencyScore2.setDataType(OrgTypeConstant.STREET); + agencyScore3.setDataType(OrgTypeConstant.STREET); } insertIndexAgencyScore.add(agencyScore1); insertIndexAgencyScore.add(agencyScore2);