Browse Source

Merge branch 'master' of http://git.ningdatech.com/liushuai/project-management into 20231122_xujian

master
PoffyZhang 10 months ago
parent
commit
4e23c98166
9 changed files with 152 additions and 52 deletions
  1. +8
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionCacheHelper.java
  2. +19
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionsCacheHelperImpl.java
  3. +14
    -35
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExpertRegisterUtil.java
  4. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitApplication.java
  5. +9
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitStats.java
  6. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/CockpitStatsVO.java
  7. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java
  8. +77
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java
  9. +18
    -2
      pmapi/src/test/java/com/ningdatech/pmapi/region/RegionTest.java

+ 8
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionCacheHelper.java View File

@@ -109,4 +109,12 @@ public interface RegionCacheHelper {
*/
String getUnionPath(String code, Integer level);

/**
* 根据区域名称获取区域信息(参数格式:浙江省-杭州市-滨江区)
*
* @param regionName 地区名称
* @return \
**/
RegionDTO getByRegionName(String regionName);

}

+ 19
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionsCacheHelperImpl.java View File

@@ -211,6 +211,25 @@ public class RegionsCacheHelperImpl extends AbstractRegionCacheHelper implements
return String.join("@@", unionPathStrList);
}

@Override
public RegionDTO getByRegionName(String regionName) {
if (StrUtils.isBlank(regionName)) {
return null;
}
String[] regionArray = regionName.split("-");
int length = regionArray.length;
return all().stream()
.filter(w -> {
boolean lastEq = w.getRegionLevel().equals(length)
&& w.getRegionName().equals(regionArray[length - 1]);
if (lastEq && length > 1) {
RegionDTO parent = getByCodeAndLevel(w.getParentCode(), w.getRegionLevel() - 1);
return parent.getRegionName().equals(regionArray[length - 2]);
}
return false;
}).findFirst().orElse(null);
}

protected void buildUnionPathStrList(String code, Integer level, List<String> unionPathStrList) {
if (level <= 0 || super.getParentCodeRoot().equals(code)) {
return;


+ 14
- 35
pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExpertRegisterUtil.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.common.util;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.json.JSONUtil;
import cn.hutool.poi.excel.ExcelReader;
@@ -25,7 +26,6 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
* <p>
@@ -60,7 +60,6 @@ public class ExpertRegisterUtil {
basic.setName(MapUtil.getStr(w, "*姓名"));
basic.setPhoneNo(MapUtil.getStr(w, "*手机"));
basic.setGender("男".equals(MapUtil.getStr(w, "性别")) ? "1" : "0");
String expertRegion = MapUtil.getStr(w, "*专家层级");
// 政治面貌
basic.setPolitical(new ArrayList<>());
String political = MapUtil.getStr(w, "政治面貌");
@@ -112,36 +111,18 @@ public class ExpertRegisterUtil {
}
request.setEduInfo(eduInfo);
// 专家层级
String lastRegionName = expertRegion.substring(expertRegion.lastIndexOf("-") + 1);
List<RegionDTO> regions = regionCacheHelper.all();
Optional<RegionDTO> firstExpertRegion = regions.stream()
.filter(region -> region.getRegionLevel().equals(3)
&& region.getRegionName().equals(lastRegionName))
.findFirst();
if (firstExpertRegion.isPresent()) {
RegionDTO dto = firstExpertRegion.get();
ExpertRegionInfo regionInfo = new ExpertRegionInfo();
regionInfo.setRegionCode(dto.getRegionCode());
regionInfo.setRegionLevel(dto.getRegionLevel());
regionInfo.setRegionName(dto.getRegionName());
basic.setExpertRegionInfo(regionInfo);
String expertRegionStr = MapUtil.getStr(w, "*专家层级");
RegionDTO expertRegion = regionCacheHelper.getByRegionName(expertRegionStr);
if (expertRegion != null) {
basic.setExpertRegionInfo(BeanUtil.copyProperties(expertRegion, ExpertRegionInfo.class));
}
// 履职意向
String intentionRegionStr = MapUtil.getStr(w, "*履职意向");
String intentionRegions = MapUtil.getStr(w, "*履职意向");
basic.setExpertIntentionWorkRegions(new ArrayList<>());
for (String intentionRegion : intentionRegionStr.split("\\n")) {
String[] split = intentionRegion.split("-");
Optional<RegionDTO> first = regions.stream()
.filter(region -> region.getRegionName().equals(split[split.length - 1])
&& region.getRegionLevel().equals(split.length))
.findFirst();
if (first.isPresent()) {
RegionDTO dto = first.get();
ExpertRegionInfo regionInfo = new ExpertRegionInfo();
regionInfo.setRegionCode(dto.getRegionCode());
regionInfo.setRegionLevel(dto.getRegionLevel());
regionInfo.setRegionName(dto.getRegionName());
basic.getExpertIntentionWorkRegions().add(regionInfo);
for (String intentionRegionStr : intentionRegions.split("\\n|,")) {
RegionDTO currRegion = regionCacheHelper.getByRegionName(intentionRegionStr);
if (currRegion != null) {
basic.getExpertIntentionWorkRegions().add(BeanUtil.copyProperties(currRegion, ExpertRegionInfo.class));
}
}
request.setBasicInfo(basic);
@@ -222,12 +203,11 @@ public class ExpertRegisterUtil {
String goodAtStr = MapUtil.getStr(w, "*擅长方向");
for (String othTag : goodAtStr.split(",")) {
tagMap.entrySet().stream()
.filter(tag -> tag.getValue().getParentCode().equals(ExpertTagEnum.GOOD_AT.getKey())
&& tag.getValue().getTagName().equals(othTag))
.filter(tag -> tag.getValue().getTagName().equals(othTag))
.forEach(tag -> {
TagFieldInfo expertTag = new TagFieldInfo();
expertTag.setTagCode(tag.getValue().getTagCode());
expertTag.setTagFieldName(tag.getValue().getParentCode());
expertTag.setTagFieldName(ExpertTagEnum.GOOD_AT.getKey());
expertTag.setTagName(tag.getValue().getTagName());
professionalInfo.getGoodAt().add(expertTag);
});
@@ -236,12 +216,11 @@ public class ExpertRegisterUtil {
String techStr = MapUtil.getStr(w, "技术专长");
for (String othTag : techStr.split(",|、")) {
tagMap.entrySet().stream()
.filter(tag -> tag.getValue().getParentCode().equals(ExpertTagEnum.TECHNICAL_EXPERTISE.getKey())
&& tag.getValue().getTagName().equals(othTag))
.filter(tag -> tag.getValue().getTagName().equals(othTag))
.forEach(tag -> {
TagFieldInfo expertTag = new TagFieldInfo();
expertTag.setTagCode(tag.getValue().getTagCode());
expertTag.setTagFieldName(tag.getValue().getParentCode());
expertTag.setTagFieldName(ExpertTagEnum.TECHNICAL_EXPERTISE.getKey());
expertTag.setTagName(tag.getValue().getTagName());
professionalInfo.getTechnicalExpertise().add(expertTag);
});


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitApplication.java View File

@@ -24,6 +24,9 @@ public class CockpitApplication implements Serializable {
@ApiModelProperty("应用名称")
private String applicationName;

@ApiModelProperty("项目编码")
private String projectCode;

@ApiModelProperty("介绍")
private String introduce;



+ 9
- 6
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/entity/CockpitStats.java View File

@@ -101,27 +101,30 @@ public class CockpitStats implements Serializable {
@ApiModelProperty("专家-总人数")
private Integer expertTotalNum = 0;

@ApiModelProperty("专家-方案合理性")
@ApiModelProperty("专家-方案合理性-擅长")
private Integer expertPlanRationalityNum = 0;

@ApiModelProperty("专家-计数可行性评估")
@ApiModelProperty("专家-计数可行性评估-擅长")
private Integer expertTechnicalFeasibilityAssessmentNum = 0;

@ApiModelProperty("专家-信创")
@ApiModelProperty("专家-信创-擅长")
private Integer expertXinchuangNum = 0;

@ApiModelProperty("专家-软硬件核价")
@ApiModelProperty("专家-软硬件核价-擅长")
private Integer expertSoftHardPricingNum = 0;

@ApiModelProperty("专家-党政信息")
@ApiModelProperty("专家-党政信息-擅长")
private Integer expertPartyGovInfoNum = 0;

@ApiModelProperty("专家-网络安全")
@ApiModelProperty("专家-网络安全-擅长")
private Integer expertNetworkSecurityNum = 0;

@ApiModelProperty("专家-信息化专家")
private Integer expertPromotionInfoTechnologyNum = 0;

@ApiModelProperty("专家-信创专家")
private Integer expertXinchuangOtherNum = 0;

@ApiModelProperty("专家-财务专家")
private Integer expertFinancialNum = 0;



+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/CockpitStatsVO.java View File

@@ -173,6 +173,9 @@ public class CockpitStatsVO implements Serializable {

@ApiModelProperty("专家-财务专家 数量")
private Integer expertFinancialNum;

@ApiModelProperty("专家-信创专家 数量")
private Integer expertXinchuangOtherNum;
}

@Data


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java View File

@@ -381,7 +381,7 @@ public class ProjectRenewalFundManage {
}

//判断金额
checkPaymentAmount(projectCode,projectYear,dto.getAnnualPaymentAmount());
// checkPaymentAmount(projectCode,projectYear,dto.getAnnualPaymentAmount());

declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name());
if(Objects.nonNull(project)){


+ 77
- 8
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java View File

@@ -21,6 +21,10 @@ import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
import com.ningdatech.pmapi.gov.enumeration.GovProjectStatusEnum;
import com.ningdatech.pmapi.gov.model.entity.*;
import com.ningdatech.pmapi.gov.service.*;
import com.ningdatech.pmapi.meta.model.entity.ExpertTag;
import com.ningdatech.pmapi.meta.model.entity.MetaTag;
import com.ningdatech.pmapi.meta.service.IExpertTagService;
import com.ningdatech.pmapi.meta.service.IMetaTagService;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectService;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
@@ -109,6 +113,10 @@ public class CockpitStatsStatisticsTask {

private List<Integer> years = Lists.newArrayList(2021,2022,2023,2024,2025);

private final IMetaTagService metaTagService;

private final IExpertTagService expertTagService;

/**
* 定义统计 驾驶舱数据 每天3点开始执行一次
*
@@ -366,15 +374,76 @@ public class CockpitStatsStatisticsTask {
List<ExpertUserFullInfo> experts = expertUserFullInfoService.list(Wrappers.lambdaQuery(ExpertUserFullInfo.class)
.eq(StringUtils.isNotBlank(regionCode) && !DashboardConstant.CockpitStats.TOTAL.equals(regionCode),
ExpertUserFullInfo::getRegionCode, regionCode));

List<ExpertTag> goodAt = expertTagService.list(Wrappers.lambdaQuery(ExpertTag.class));
Map<Long, List<ExpertTag>> 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 xinxihuaCode = "5400000";
String xinchuangOtherCode = "5500000";

cockpitStats.setExpertTotalNum(experts.size());
cockpitStats.setExpertFinancialNum(0);
cockpitStats.setExpertNetworkSecurityNum(0);
cockpitStats.setExpertXinchuangNum(0);
cockpitStats.setExpertPlanRationalityNum(0);
cockpitStats.setExpertPromotionInfoTechnologyNum(0);
cockpitStats.setExpertPartyGovInfoNum(0);
cockpitStats.setExpertSoftHardPricingNum(0);
cockpitStats.setExpertTechnicalFeasibilityAssessmentNum(0);
Integer financialNum = 0;
Integer networkSecurityNum = 0;
Integer xinchuangNum = 0;
Integer planRationalityNum = 0;
Integer promotionInfoTechnologyNum = 0;
Integer partyGovInfoNum = 0;
Integer softHardPricingNum = 0;
Integer technicalFeasibilityAssessmentNum = 0;
Integer xinchuangOtherNum = 0;
for(ExpertUserFullInfo e : experts){
if(tagMap.containsKey(e.getUserId())){
List<ExpertTag> expertTags = tagMap.get(e.getUserId());
for(ExpertTag expertTag : expertTags){
if(expertTag.getTagCode().equals(networkCode)){
networkSecurityNum++;
}
if(expertTag.getTagCode().equals(caiwuCode)){
financialNum ++;
}
if(expertTag.getTagCode().equals(xinchuangCode)){
xinchuangNum ++;
}
if(expertTag.getTagCode().equals(fanganCode)){
planRationalityNum++;
}
if(expertTag.getTagCode().equals(jishuCode)){
technicalFeasibilityAssessmentNum ++;
}
if(expertTag.getTagCode().equals(dangzhengCode)){
partyGovInfoNum ++;
}
if(expertTag.getTagCode().equals(ruanyingCode)){
softHardPricingNum ++;
}
if(expertTag.getTagCode().equals(xinxihuaCode)){
promotionInfoTechnologyNum++;
}
if(expertTag.getTagCode().equals(xinchuangOtherCode)){
xinchuangOtherNum++;
}
}
}
}
//财务专家
cockpitStats.setExpertFinancialNum(financialNum);
//网络安全
cockpitStats.setExpertNetworkSecurityNum(networkSecurityNum);
cockpitStats.setExpertXinchuangNum(xinchuangNum);
cockpitStats.setExpertPlanRationalityNum(planRationalityNum);
cockpitStats.setExpertPromotionInfoTechnologyNum(promotionInfoTechnologyNum);
cockpitStats.setExpertPartyGovInfoNum(partyGovInfoNum);
cockpitStats.setExpertSoftHardPricingNum(softHardPricingNum);
cockpitStats.setExpertTechnicalFeasibilityAssessmentNum(technicalFeasibilityAssessmentNum);
cockpitStats.setExpertXinchuangOtherNum(xinchuangOtherNum);

//3.顶部数据
//3.1 计划项目数(申报项目:完成年度计划的项目总数


+ 18
- 2
pmapi/src/test/java/com/ningdatech/pmapi/region/RegionTest.java View File

@@ -1,9 +1,17 @@
package com.ningdatech.pmapi.region;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.AppTests;
import com.ningdatech.pmapi.common.helper.RegionCacheHelper;
import com.ningdatech.pmapi.common.util.ExpertRegisterUtil;
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum;
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum;
import com.ningdatech.pmapi.expert.controller.ExpertController;
import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion;
import com.ningdatech.pmapi.expert.entity.ExpertMetaApply;
import com.ningdatech.pmapi.expert.service.IExpertIntentionWorkRegionService;
import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService;
import com.ningdatech.pmapi.meta.helper.DictionaryCache;
import com.ningdatech.pmapi.meta.helper.TagCache;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
@@ -12,7 +20,10 @@ import com.ningdatech.pmapi.sys.service.IRegionService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

@@ -28,7 +39,7 @@ public class RegionTest extends AppTests {
private IRegionService regionService;

@Test
public void test(){
public void test() {
Set<Region> set = regionService.list().stream().collect(Collectors.toSet());

Set<Long> ids = set.stream().map(Region::getId).collect(Collectors.toSet());
@@ -50,7 +61,12 @@ public class RegionTest extends AppTests {
private ExpertController expertController;

@Test
public void test1(){
public void test1() {
System.out.println(regionCacheHelper.getByRegionName("浙江省-杭州市-滨江区"));
}

@Test
public void test2() {
ExpertRegisterUtil.regionCacheHelper = regionCacheHelper;
ExpertRegisterUtil.tagCache = tagCache;
ExpertRegisterUtil.dictionaryCache = dictionaryCache;


Loading…
Cancel
Save