From 4995c86dcbfca4fc8f9820efb44bfed3d3be302a Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 4 Dec 2023 17:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=93=E5=AE=B6=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/constant/DashboardConstant.java | 35 ++ .../dashboard/controller/StatisticsController.java | 7 +- .../dashboard/manage/ExpertStatisticsManage.java | 351 +++++++++++++++++++ .../dashboard/manage/FundStatisticsManage.java | 2 +- .../dashboard/model/vo/ExpertStatisticsVO.java | 370 ++------------------- .../scheduler/task/CockpitStatsStatisticsTask.java | 14 +- 6 files changed, 422 insertions(+), 357 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/ExpertStatisticsManage.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/DashboardConstant.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/DashboardConstant.java index 9c0a083..95127f2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/DashboardConstant.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/DashboardConstant.java @@ -31,4 +31,39 @@ public class DashboardConstant { public static final String TOTAL = "TOTAL"; public static final int NONE_YEAR = 0; } + + public class Expert { + public static final String ACCOUNT_STATUS_OK = "available"; + + public static final String DISTRIBUTION_SHENG = "省维度"; + + public static final String DISTRIBUTION_SHI = "市维度"; + + public static final String NETWORK_CODE = "1030000"; + public static final String XINCHUANG_CODE = "2040000"; + public static final String FANGAN_CODE = "2030000"; + public static final String JISHU_CODE = "2010000"; + public static final String DANGZHENG_CODE = "1020000"; + public static final String RUANYING_CODE = "2020000"; + public static final String CAIWU_CODE = "5600000"; + + public static final String XINCHUANG_OTTHER_CODE = "5500000"; + + public static final String XINXIHUA_CODE = "5400000"; + public static final String EXPERT_TYPE = "expert_type"; + + public static final String EXPERT_TYPE_INNER = "300000"; + + public static final String EXPERT_TYPE_OUT = "300001"; + + public static final String EXPERT_LEVEL_ZHENGGAO = "900000"; + + public static final String EXPERT_LEVEL_FUGAO = "900001"; + + public static final String EXPERT_LEVEL_MID = "900002"; + + public static final String EXPERT_LEVEL_CHUJI = "900003"; + + public static final String EXPERT_LEVEL_NULL = "900004"; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/StatisticsController.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/StatisticsController.java index c5e81d9..82130e7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/StatisticsController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/StatisticsController.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.dashboard.controller; +import com.ningdatech.pmapi.dashboard.manage.ExpertStatisticsManage; import com.ningdatech.pmapi.dashboard.manage.FundStatisticsManage; import com.ningdatech.pmapi.dashboard.model.vo.*; import io.swagger.annotations.Api; @@ -21,15 +22,17 @@ public class StatisticsController { private final FundStatisticsManage fundStatisticsManage; + private final ExpertStatisticsManage expertStatisticsManage; + @GetMapping("/fund") @ApiOperation("项目资金统计") public FundStatisticsVO fund(@RequestParam(required = false) Integer year) { - return fundStatisticsManage.fund(year); + return fundStatisticsManage.statistics(year); } @GetMapping("/expert") @ApiOperation("专家统计") public ExpertStatisticsVO expert(@RequestParam(required = false) Integer year) { - return new ExpertStatisticsVO(); + return expertStatisticsManage.statistics(year); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/ExpertStatisticsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/ExpertStatisticsManage.java new file mode 100644 index 0000000..fd05d39 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/ExpertStatisticsManage.java @@ -0,0 +1,351 @@ +package com.ningdatech.pmapi.dashboard.manage; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.ningdatech.pmapi.common.constant.RegionConst; +import com.ningdatech.pmapi.common.helper.RegionCacheHelper; +import com.ningdatech.pmapi.dashboard.constant.DashboardConstant; +import com.ningdatech.pmapi.dashboard.model.vo.ExpertStatisticsVO; +import com.ningdatech.pmapi.expert.constant.ExpertUserInfoStepEnum; +import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.expert.service.IExpertIntentionWorkRegionService; +import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.meta.model.dto.DictionaryDTO; +import com.ningdatech.pmapi.meta.model.dto.TagDTO; +import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; +import com.ningdatech.pmapi.meta.model.entity.ExpertTag; +import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; +import com.ningdatech.pmapi.meta.service.IExpertTagService; +import com.ningdatech.pmapi.meta.service.IMetaDictionaryService; +import com.ningdatech.pmapi.meta.service.IMetaTagService; +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ForkJoinPool; +import java.util.stream.Collectors; + +/** + * @Classname ExpertStatisticsManage + * @Description + * @Date 2023/12/04 17:44 + * @Author PoffyZhang + */ +@Component +@RequiredArgsConstructor +@Slf4j +public class ExpertStatisticsManage { + + private final RegionCacheHelper regionCacheHelper; + + private final IExpertUserFullInfoService userFullInfoService; + + private final IExpertIntentionWorkRegionService expertIntentionWorkRegionService; + + private final IExpertTagService expertTagService; + + private final IMetaTagService metaTagService; + + private final IExpertDictionaryService expertDictionaryService; + + private final IMetaDictionaryService metaDictionaryService; + + private Integer[] years = new Integer[]{LocalDateTime.now().getYear()-2, + LocalDateTime.now().getYear()-1,LocalDateTime.now().getYear(), + LocalDateTime.now().getYear()+1,LocalDateTime.now().getYear()+2}; + + private Integer[] threeYears = new Integer[]{LocalDateTime.now().getYear()-2, + LocalDateTime.now().getYear()-1,LocalDateTime.now().getYear()}; + + private String[] SHENGWEIDU = new String[]{DashboardConstant.Expert.NETWORK_CODE, + DashboardConstant.Expert.DANGZHENG_CODE,DashboardConstant.Expert.FANGAN_CODE, + DashboardConstant.Expert.JISHU_CODE,DashboardConstant.Expert.XINCHUANG_CODE, + DashboardConstant.Expert.RUANYING_CODE}; + + private String[] SHIWEIDU = new String[]{DashboardConstant.Expert.CAIWU_CODE, + DashboardConstant.Expert.XINXIHUA_CODE,DashboardConstant.Expert.XINCHUANG_OTTHER_CODE}; + + private String[] TYPES = new String[]{DashboardConstant.Expert.EXPERT_TYPE_INNER, + DashboardConstant.Expert.EXPERT_TYPE_OUT}; + + private String[] LEVELS = new String[]{DashboardConstant.Expert.EXPERT_LEVEL_ZHENGGAO, + DashboardConstant.Expert.EXPERT_LEVEL_FUGAO,DashboardConstant.Expert.EXPERT_LEVEL_MID, + DashboardConstant.Expert.EXPERT_LEVEL_CHUJI,DashboardConstant.Expert.EXPERT_LEVEL_NULL}; + + /** + * 专家统计 + * @param year + * @return + */ + public ExpertStatisticsVO statistics(Integer year) { + List experts = userFullInfoService.list(Wrappers.lambdaQuery(ExpertUserFullInfo.class) + .eq(ExpertUserFullInfo::getExpertAccountStatus, DashboardConstant.Expert.ACCOUNT_STATUS_OK) + .eq(ExpertUserFullInfo::getUserInfoStep, ExpertUserInfoStepEnum.EVIDENCE_HAS_BEEN_SUBMITTED.getKey())); + List intentionWorkRegions = expertIntentionWorkRegionService.list(); + + List expertTags = expertTagService.list(); + + List tags = metaTagService.queryAll(); + + List dictionaries = metaDictionaryService.queryAll(); + Set code = Sets.newHashSet(); + Map dictionMap = dictionaries.stream().filter(d -> code.add(d.getDictionaryCode())) + .collect(Collectors.toMap(DictionaryDTO::getDictionaryCode, DictionaryDTO::getName)); + + List expertDictionaries = expertDictionaryService.list(Wrappers.lambdaQuery(ExpertDictionary.class) + .eq(ExpertDictionary::getExpertInfoField, DashboardConstant.Expert.EXPERT_TYPE)); + + ExpertStatisticsVO res = new ExpertStatisticsVO(); + CompletableFuture.allOf( + CompletableFuture.runAsync(() -> { + //选择的年份去计算的数据 + yearCompleteExpert(res,year,experts,intentionWorkRegions,expertTags, + tags,expertDictionaries,dictionMap); + }, ForkJoinPool.commonPool()), + CompletableFuture.runAsync(() -> { + //近三年 + threeYearsCompleteExpert(res,experts); + }, ForkJoinPool.commonPool()), + CompletableFuture.runAsync(() -> { + //近一年 + lastYearsCompleteExpert(res,experts); + }, ForkJoinPool.commonPool()) + ).join(); + + return res; + } + + /** + * 近一年 + * @param res + */ + private void lastYearsCompleteExpert(ExpertStatisticsVO res,List experts) { + List lastYear = experts.stream().filter(expert -> { + if (expert.getCreateOn().compareTo(LocalDateTime.now().plusYears(-1)) >= 0 && + expert.getCreateOn().compareTo(LocalDateTime.now()) <= 0) { + return Boolean.TRUE; + } + return Boolean.FALSE; + }).collect(Collectors.toList()); + res.setThisYearAdded(lastYear.size()); + } + + /** + * 近三年 + * @param res + */ + private void threeYearsCompleteExpert(ExpertStatisticsVO res,List experts) { + List threeYearsAdds = Lists.newArrayList(); + for (Integer year : threeYears){ + ExpertStatisticsVO.ExpertData expert = new ExpertStatisticsVO.ExpertData(); + expert.setName(year.toString()); + expert.setCode(year.toString()); + expert.setNum(experts.stream().filter(e -> { + if (Objects.nonNull(e.getCreateOn()) && year.equals(e.getCreateOn().getYear())) { + return Boolean.TRUE; + } + return Boolean.FALSE; + }).collect(Collectors.toList()).size()); + threeYearsAdds.add(expert); + } + res.setThreeYearsAdded(threeYearsAdds); + } + + /** + * 选择年份或者全部 + * @param res + * @param year + */ + private void yearCompleteExpert(ExpertStatisticsVO res, Integer year, + List experts,List intentionWorkRegions, + List expertTags,List tags,List expertDictionaries, + Map dictionMap) { + res.setTotal(experts.size()); + + Set userSet = Sets.newHashSet(); + Map expertMap = experts.stream().filter(e -> userSet.add(e.getUserId())) + .collect(Collectors.toMap(ExpertUserFullInfo::getUserId, e -> e)); + + List regions = regionCacheHelper.listChildren(RegionConst.RC_LS, RegionConst.RL_COUNTY) + .stream().sorted(Comparator.comparing(RegionDTO::getRegionCode)).collect(Collectors.toList()); + + //是否要筛选年 + experts = experts.stream().filter(e -> { + if (Objects.nonNull(e.getCreateOn()) && + (Objects.isNull(year) || year.equals(e.getCreateOn().getYear()))) { + return Boolean.TRUE; + } + return Boolean.FALSE; + }).collect(Collectors.toList()); + + //计算区域专家 + computeRegionExperts(res, intentionWorkRegions, expertMap, regions); + + //计算专家特长 + computeRegionDistribution(res,experts,expertTags,tags); + + //计算专家类型 + computeTypes(res,experts,expertDictionaries,dictionMap); + + //计算专家等级 + computeLevels(res,experts,expertDictionaries,dictionMap); + } + + /** + * 计算 专家等级 + * @param res + * @param experts + */ + private void computeLevels(ExpertStatisticsVO res, List experts, + List expertDictionaries,Map dictionMap) { + List levels = Lists.newArrayList(); + + Set userSets = Sets.newHashSet(); + Map expertUserFullInfoMap = experts.stream() + .filter(u -> userSets.add(u.getUserId())) + .collect(Collectors.toMap(ExpertUserFullInfo::getUserId, e -> e)); + + Map> dictionaryMap = expertDictionaries.stream() + .collect(Collectors.groupingBy(ExpertDictionary::getDictionaryCode)); + for(String levelCode : LEVELS){ + ExpertStatisticsVO.ExpertData expertData = new ExpertStatisticsVO.ExpertData(); + if(dictionaryMap.containsKey(levelCode)){ + List dictionaries = dictionaryMap.get(levelCode); + expertData.setNum(dictionaries.stream().filter(d -> { + if(expertUserFullInfoMap.containsKey(d.getUserId())){ + return Boolean.TRUE; + } + return Boolean.FALSE; + }).collect(Collectors.toList()).size()); + } + expertData.setName(dictionMap.get(levelCode)); + expertData.setCode(levelCode); + levels.add(expertData); + } + + res.setLevels(levels); + } + + /** + * 计算 专家类型 + * @param res + * @param experts + */ + private void computeTypes(ExpertStatisticsVO res, List experts, + List expertDictionaries,Map dictionMap) { + List types = Lists.newArrayList(); + + Set userSets = Sets.newHashSet(); + Map expertUserFullInfoMap = experts.stream() + .filter(u -> userSets.add(u.getUserId())) + .collect(Collectors.toMap(ExpertUserFullInfo::getUserId, e -> e)); + + Map> dictionaryMap = expertDictionaries.stream() + .collect(Collectors.groupingBy(ExpertDictionary::getDictionaryCode)); + for(String typeCode : TYPES){ + ExpertStatisticsVO.ExpertData expertData = new ExpertStatisticsVO.ExpertData(); + if(dictionaryMap.containsKey(typeCode)){ + List dictionaries = dictionaryMap.get(typeCode); + expertData.setNum(dictionaries.stream().filter(d -> { + if(expertUserFullInfoMap.containsKey(d.getUserId())){ + return Boolean.TRUE; + } + return Boolean.FALSE; + }).collect(Collectors.toList()).size()); + } + expertData.setName(dictionMap.get(typeCode)); + expertData.setCode(typeCode); + types.add(expertData); + } + + res.setTypes(types); + } + + //计算专家特长 + private void computeRegionDistribution(ExpertStatisticsVO res, List experts, + List expertTags, List tags) { + Set userSets = Sets.newHashSet(); + Map expertUserFullInfoMap = experts.stream() + .filter(u -> userSets.add(u.getUserId())) + .collect(Collectors.toMap(ExpertUserFullInfo::getUserId, e -> e)); + + Map> typeDistribution = Maps.newHashMap(); + + Map> tagsMap = + expertTags.stream().filter(e -> Objects.nonNull(e.getTagCode())) + .collect(Collectors.groupingBy(ExpertTag::getTagCode)); + + Set tagSets = Sets.newHashSet(); + Map tagNameMap = tags.stream().filter(t -> tagSets.add(t.getTagCode())) + .collect(Collectors.toMap(TagDTO::getTagCode, TagDTO::getTagName)); + + //1.省维度 + List shengWeidu = Lists.newArrayList(); + for(String code : SHENGWEIDU){ + shengWeidu.add(getExpertData(expertUserFullInfoMap, + tagsMap, tagNameMap, code)); + } + + //2.市维度 + List shiWeidu = Lists.newArrayList(); + for(String code : SHIWEIDU){ + shiWeidu.add(getExpertData(expertUserFullInfoMap, + tagsMap, tagNameMap, code)); + } + + typeDistribution.put(DashboardConstant.Expert.DISTRIBUTION_SHENG,shengWeidu); + typeDistribution.put(DashboardConstant.Expert.DISTRIBUTION_SHI,shiWeidu); + res.setTypeDistribution(typeDistribution); + } + + /** + * 包装 + * @param expertUserFullInfoMap + * @param tagsMap + * @param tagNameMap + * @param code + * @return + */ + private static ExpertStatisticsVO.ExpertData getExpertData(Map expertUserFullInfoMap, Map> tagsMap, Map tagNameMap, String code) { + ExpertStatisticsVO.ExpertData data = new ExpertStatisticsVO.ExpertData(); + data.setCode(code); + data.setName(tagNameMap.get(code)); + if(tagsMap.containsKey(code)){ + List ets = tagsMap.get(code); + data.setNum(ets.stream().filter(e -> { + if(expertUserFullInfoMap.containsKey(e.getUserId())){ + return Boolean.TRUE; + } + return Boolean.FALSE; + }).collect(Collectors.toList()).size()); + } + return data; + } + + //计算区域专家 + private static void computeRegionExperts(ExpertStatisticsVO res, List intentionWorkRegions, Map expertMap, List regions) { + List regionExpert = Lists.newArrayList(); + for(RegionDTO region : regions){ + ExpertStatisticsVO.ExpertData expertData = new ExpertStatisticsVO.ExpertData(); + expertData.setName(region.getRegionName()); + expertData.setCode(region.getRegionCode()); + expertData.setNum(intentionWorkRegions.stream().filter(w -> { + if(Objects.nonNull(w) && Objects.nonNull(w.getRegionCode()) && + w.getRegionCode().equals(region.getRegionCode()) && + expertMap.containsKey(w.getUserId())){ + return Boolean.TRUE; + } + return Boolean.FALSE; + }).collect(Collectors.toList()).size()); + regionExpert.add(expertData); + } + res.setRegionExpert(regionExpert); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/FundStatisticsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/FundStatisticsManage.java index 363b6fc..4cc37eb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/FundStatisticsManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/FundStatisticsManage.java @@ -58,7 +58,7 @@ public class FundStatisticsManage { * @param year * @return */ - public FundStatisticsVO fund(Integer year) { + public FundStatisticsVO statistics(Integer year) { FundStatisticsVO res = new FundStatisticsVO(); CompletableFuture.allOf( diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/ExpertStatisticsVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/ExpertStatisticsVO.java index cfb607e..259f7a9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/ExpertStatisticsVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/ExpertStatisticsVO.java @@ -1,14 +1,10 @@ package com.ningdatech.pmapi.dashboard.model.vo; -import com.ningdatech.pmapi.dashboard.model.entity.CockpitApplication; -import com.ningdatech.pmapi.portrait.model.entity.Tag; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; import java.util.List; import java.util.Map; @@ -17,359 +13,39 @@ import java.util.Map; public class ExpertStatisticsVO implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("区域code") - private String regionCode; + @ApiModelProperty("入驻专家总数") + private Integer total = 0; - @ApiModelProperty("区域名") - private String regionName; + @ApiModelProperty("近一年新增专家数") + private Integer thisYearAdded = 0; - @ApiModelProperty("年份") - private Integer year; + @ApiModelProperty("活跃专家数") + private Integer active = 0; - @ApiModelProperty("年份") - private LocalDateTime createOn; + @ApiModelProperty("各区县专家数") + private List regionExpert; - @ApiModelProperty("项目监测数据") - private Monitor monitorData; + @ApiModelProperty("近三年专家数") + private List threeYearsAdded; - @ApiModelProperty("项目专家数据") - private Expert expertData; + @ApiModelProperty("专家类型分布") + private Map> typeDistribution; - @ApiModelProperty("顶部数据") - private TopData topData; + @ApiModelProperty("专家类型") + private List types; - @ApiModelProperty("地图-项目数") - private List mapProjectData; - - @ApiModelProperty("状态-项目数") - private StatusProjectsData statusProjectsData; - - @ApiModelProperty("优秀项目数据") - private ExcellentData excellentData; - - @ApiModelProperty("核减数据") - private ReduceData reduceData; - - @ApiModelProperty("产出数据") - private ProduceData produceData; - - @ApiModelProperty("绩效数据") - private PerformanceData performanceData; - - @ApiModelProperty("最佳应用or重大应用") - private Map> appDatas; - - @ApiModelProperty("数据质量区域信息") - private List qualityDatas; - - @Data - public static class Monitor { - @ApiModelProperty("项目监控-超期建设项目数") - private Integer monitorOverdueConstructionProjectsNum; - - @ApiModelProperty("项目监控-超期建设项目-增长比例") - private String monitorOverdueConstructionProjectsRise; - - @ApiModelProperty("项目监控-环节滞后项目数") - private Integer monitorLaggingProjectsNum; - - @ApiModelProperty("项目监控-环节滞后项目-增长比例") - private String monitorLaggingProjectsRise; - - @ApiModelProperty("项目监控-预审驳回项目数") - private Integer monitorRejectedPreReviewProjectsNum; - - @ApiModelProperty("项目监控-预审驳回项目-增长比例") - private String monitorRejectedPreReviewProjectsRise; - - @ApiModelProperty("项目监控-评审驳回项目数") - private Integer monitorRejectedApproveProjectsNum; - - @ApiModelProperty("项目监控-评审驳回项目-增长比例") - private String monitorRejectedApproveProjectsRise; - - @ApiModelProperty("项目监控-验收条件未达标") - private Integer monitorAcceptConditionsNotStandardsNum; - - @ApiModelProperty("项目监控-验收条件未达标-增长比例") - private String monitorAcceptConditionsNotStandardsRise; - - @ApiModelProperty("项目监控-安全投入占比 图") - private List monitorSafetyInputRate; - - @ApiModelProperty("项目监控-等保等级图") - private List secrecyGradeCharts; - - @ApiModelProperty("项目监控-密保等级图") - private List passwordGradeCharts; - } - - @Data - public static class SecrecyGradeChart { - public SecrecyGradeChart (Integer level,Integer num){ - this.level = level; - this.num = num; - } - - @ApiModelProperty("等保等级") - private Integer level; - - @ApiModelProperty("等保数量") - private Integer num; - } - - @Data - public static class PasswordGradeChart { - public PasswordGradeChart (Integer level,Integer num){ - this.level = level; - this.num = num; - } - - @ApiModelProperty("密保等级") - private Integer level; - - @ApiModelProperty("密保数量") - private Integer num; - } - - @Data - public static class SafetyInput { - private Integer year; - private BigDecimal rate; - private Integer amount; - } - - @Data - public static class Expert { - @ApiModelProperty("专家-各区域专家数") - private List expertRegionData; - - @ApiModelProperty("专家-总人数") - private Integer expertTotalNum; - - @ApiModelProperty("专家-总人数-包含这些标签的专家总人数") - private Integer specialExpertNum; - - @ApiModelProperty("专家-方案合理性 数量") - private Integer expertPlanRationalityNum; - - @ApiModelProperty("专家-计数可行性评估 数量") - private Integer expertTechnicalFeasibilityAssessmentNum; - - @ApiModelProperty("专家-信创 数量") - private Integer expertXinchuangNum; - - @ApiModelProperty("专家-软硬件核价 数量") - private Integer expertSoftHardPricingNum; - - @ApiModelProperty("专家-党政信息 数量") - private Integer expertPartyGovInfoNum; - - @ApiModelProperty("专家-网络安全 数量") - private Integer expertNetworkSecurityNum; - - @ApiModelProperty("专家-信息化专家 数量") - private Integer expertPromotionInfoTechnologyNum; - - @ApiModelProperty("专家-财务专家 数量") - private Integer expertFinancialNum; - - @ApiModelProperty("专家-信创专家 数量") - private Integer expertXinchuangOtherNum; - } - - @Data - public static class ExpertRegion { - @ApiModelProperty("区域CODE") - private String regionCode; - - @ApiModelProperty("区域名字") - private String regionName; - - @ApiModelProperty("专家数量") - private Integer expertNum; - } - - @Data - public static class TopData { - @ApiModelProperty("顶部-计划项目数") - private Integer topPlanProjectsNum; - - @ApiModelProperty("顶部-批复项目数") - private Integer topApprovalProjectsNum; - - @ApiModelProperty("顶部-批复金额") - private BigDecimal topApprovalProjectsAmount; - - @ApiModelProperty("顶部-平均建设周期") - private Integer topAverageConstructionPeriod; - - @ApiModelProperty("顶部-在建项目数") - private Integer topOngoingProjectsNum; - } - - @Data - public static class MapProjectsData { - @ApiModelProperty("区域CODE") - private String regionCode; - - @ApiModelProperty("区域名字") - private String regionName; - - @ApiModelProperty("项目数量") - private Integer projectsNum; - } - - @Data - public static class QualityData { - @ApiModelProperty("区域CODE") - private String regionCode; - - @ApiModelProperty("区域名字") - private String regionName; - - @ApiModelProperty("质量分数") - private BigDecimal quality = BigDecimal.ZERO; - } - - @Data - public static class StatusProjectsData { - @ApiModelProperty("项目总数-计划状态") - private Integer projectsTotalPlan; - - @ApiModelProperty("项目总数-申报状态") - private Integer projectsTotalApply; - - @ApiModelProperty("项目总数-审批状态") - private Integer projectsTotalApprove; - - @ApiModelProperty("项目总数-建设状态") - private Integer projectsTotalConstruction; - - @ApiModelProperty("项目总数-验收状态") - private Integer projectsTotalAccept; - - @ApiModelProperty("项目总数-运维状态") - private Integer projectsTotalOperation; - - @ApiModelProperty("项目总数-绩效状态") - private Integer projectsTotalPerformance; - - @ApiModelProperty("项目总数-注销状态") - private Integer projectsTotalLogOff; - } - - @Data - public static class ExcellentData { - @ApiModelProperty("优秀项目-最佳应用") - private Integer excellentBestAppNum; - - @ApiModelProperty("优秀项目-重大应用") - private Integer excellentMajorAppNum; - - @ApiModelProperty("优秀项目-跨域共享数") - private Integer excellentCrossDomainSharingNum; - - @ApiModelProperty("优秀项目-跨域共享数") - private Integer excellentCrossLevelSharingNum; - - @ApiModelProperty("优秀项目-列表") - private List excellentProjects; - } - - @Data - public static class ExcellentProjects { - @ApiModelProperty("项目CODE") - private String projectCode; - - @ApiModelProperty("项目名") - private String projectName; - - @ApiModelProperty("项目简介") - private String projectIntroduction; - - @ApiModelProperty("标签") - private List tags; - } + @ApiModelProperty("专家等级") + private List levels; @Data - public static class ReduceData { - @ApiModelProperty("核减资金") - private BigDecimal reduceFundsTotal; - - @ApiModelProperty("驳回节约资金") - private BigDecimal rejectSavingsFunds; - - @ApiModelProperty("资金对比图") - private List amountComparisonCharts; - } - - @Data - public static class AmountComparisonChart { - public AmountComparisonChart (String statusName,BigDecimal declaredAmount,BigDecimal approvalAmount,BigDecimal differenceAmount){ - this.statusName = statusName; - this.declaredAmount = declaredAmount; - this.approvalAmount = approvalAmount; - this.differenceAmount = differenceAmount; - } - - @ApiModelProperty("状态名") - private String statusName; - - @ApiModelProperty("申报金额") - private BigDecimal declaredAmount; - - @ApiModelProperty("批复金额") - private BigDecimal approvalAmount; - - @ApiModelProperty("差额") - private BigDecimal differenceAmount; - } - - @Data - public static class ProduceData { - @ApiModelProperty("产出-应用数量") - private Integer produceAppNum; - @ApiModelProperty("产出-数据产品") - private Integer produceDataNum; - @ApiModelProperty("产出-组件数") - private Integer produceComponentNum; - @ApiModelProperty("产出-大脑要素") - private Integer produceBrainElementsNum; - @ApiModelProperty("产出-大脑要素") - private Integer produceBrainModelNum; - } - - @Data - public static class PerformanceData { - @ApiModelProperty("绩效-项目总数量") - private Integer performanceTotal; - - @ApiModelProperty("绩效-未评价数量") - private Integer performanceTobeReviewTotal; - - @ApiModelProperty("绩效-已评价数量") - private Integer performanceReviewedTotal; - - @ApiModelProperty("绩效-top数据") - private List performanceTops; - } - - @Data - public static class PerformanceTop { - public PerformanceTop (String topName,BigDecimal score,String appName){ - this.topName = topName; - this.score = score; - this.appName = appName; - } - - @ApiModelProperty("绩效-top") - private String topName; + public static class ExpertData { + @ApiModelProperty("名称") + private String name; - @ApiModelProperty("分数") - private BigDecimal score; + @ApiModelProperty("编码") + private String code; - @ApiModelProperty("应用名称") - private String appName; + @ApiModelProperty("数量") + private Integer num = 0; } } \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java index 4af38ac..478695e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java @@ -394,13 +394,13 @@ public class CockpitStatsStatisticsTask { Map> tagMap = goodAt.stream() .collect(Collectors.groupingBy(ExpertTag::getUserId)); - String networkCode = "1030000"; - String xinchuangCode = "2040000"; - String fanganCode = "2030000"; - String jishuCode = "2010000"; - String dangzhengCode = "1020000"; - String ruanyingCode = "2020000"; - String caiwuCode = "5600000"; + String networkCode = DashboardConstant.Expert.NETWORK_CODE; + String xinchuangCode = DashboardConstant.Expert.XINCHUANG_CODE; + String fanganCode = DashboardConstant.Expert.FANGAN_CODE; + String jishuCode = DashboardConstant.Expert.JISHU_CODE; + String dangzhengCode = DashboardConstant.Expert.DANGZHENG_CODE; + String ruanyingCode = DashboardConstant.Expert.RUANYING_CODE; + String caiwuCode = DashboardConstant.Expert.CAIWU_CODE; List specialTags = Lists.newArrayList(networkCode,xinchuangCode,fanganCode,jishuCode, dangzhengCode,ruanyingCode,caiwuCode);