添加功能

This commit is contained in:
马宝龙
2026-06-26 17:06:53 +08:00
parent 5e63d112cc
commit dfb9911c97
8 changed files with 486 additions and 1 deletions

View File

@@ -0,0 +1,75 @@
package com.ruoyi.cms.service;
import com.ruoyi.cms.domain.dto.QueryParamDto;
import com.ruoyi.cms.domain.vo.QueryResultVo;
import com.ruoyi.cms.domain.vo.SectorTalentOverviewVo;
import com.ruoyi.cms.domain.vo.SectorTalentProsperityIndexVo;
import com.ruoyi.cms.domain.vo.SectorTalentTreadVo;
import java.util.List;
/**
* 产业发展与人才供需分析
*
* @author 马宝龙
* @date 2026/6/26
*/
public interface AnalysisSectorTalentService {
/**
* 数据总览
*
* @param queryParamDto 查询参数
* @return 数据总览
*/
SectorTalentOverviewVo overview(QueryParamDto queryParamDto);
/**
* 产业景气指数
*
* @param queryParamDto 查询参数
* @return 产业景气指数
*/
SectorTalentProsperityIndexVo sectorProsperityIndex(QueryParamDto queryParamDto);
/**
* 产业发展趋势分析
*
* @param queryParamDto 查询参数
* @return 趋势列表
*/
List<SectorTalentTreadVo> sectorDevelopTrend(QueryParamDto queryParamDto);
/**
* 人才需求结构分析
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> talentDemandStructure(QueryParamDto dto);
/**
* 高校毕业生人才供给专业分布
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> talentSupplyDistribution(QueryParamDto dto);
/**
* 职业培训技能人才等级分布
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> talentSkillLevelDistribution(QueryParamDto dto);
/**
* 人才供需匹配度评估
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> talentSupplyDemandMatchingDegree(QueryParamDto dto);
}

View File

@@ -77,7 +77,7 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys
.code(industry.getT1())
.desc(industry.getT2())
.count((long) Math.floor(Math.random() * 10000) + 1)
.amount(BigDecimal.valueOf(Math.random() * 5 + 2).setScale(1, RoundingMode.HALF_UP))
.rate(BigDecimal.valueOf(Math.random() * 30 + 2).setScale(1, RoundingMode.HALF_UP))
.build());
}
return list;

View File

@@ -0,0 +1,151 @@
package com.ruoyi.cms.service.impl;
import com.ruoyi.cms.constant.CommonConstant;
import com.ruoyi.cms.domain.dto.QueryParamDto;
import com.ruoyi.cms.domain.vo.QueryResultVo;
import com.ruoyi.cms.domain.vo.SectorTalentOverviewVo;
import com.ruoyi.cms.domain.vo.SectorTalentProsperityIndexVo;
import com.ruoyi.cms.domain.vo.SectorTalentTreadVo;
import com.ruoyi.cms.service.AnalysisSectorTalentService;
import com.ruoyi.cms.util.MathUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import reactor.util.function.Tuple2;
import reactor.util.function.Tuples;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* 产业发展与人才供需分析
*
* @author 马宝龙
* @date 2026/6/26
*/
@Service
@Validated
@Slf4j
public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentService {
@Override
public SectorTalentOverviewVo overview(QueryParamDto dto) {
return SectorTalentOverviewVo.builder()
.sectorAmount(BigDecimal.valueOf(156.8))
.sectorAmountMom(BigDecimal.valueOf(5.2))
.companyNewInvestmentAmount(BigDecimal.valueOf(23.5))
.companyNewInvestmentAmountMom(BigDecimal.valueOf(8.1))
.talentDemandCount(32000L)
.talentDemandCountMom(BigDecimal.valueOf(6.5))
.talentSupplyCount(28500L)
.talentSupplyCountMom(BigDecimal.valueOf(4.3))
.supplyDemandMatchingDegree(BigDecimal.valueOf(85.6))
.supplyDemandMatchingDegreeMom(BigDecimal.valueOf(2.1))
.talentGapCount(3500L)
.talentGapCountMom(BigDecimal.valueOf(-3.2))
.skillTrainCount(12000L)
.skillTrainCountMom(BigDecimal.valueOf(12.5))
.build();
}
@Override
public SectorTalentProsperityIndexVo sectorProsperityIndex(QueryParamDto dto) {
return SectorTalentProsperityIndexVo.builder()
.prosperityIndex(BigDecimal.valueOf(112.5))
.build();
}
@Override
public List<SectorTalentTreadVo> sectorDevelopTrend(QueryParamDto dto) {
List<SectorTalentTreadVo> list = new ArrayList<>();
for (int i = 0; i < 12; i++) {
list.add(SectorTalentTreadVo.builder()
.code(i + 1 + "")
.desc(i + 1 + "")
.jobDemandCount((long) Math.floor(Math.random() * 20000) + 1000)
.sectorInvestmentAmount(BigDecimal.valueOf(Math.random() * 100 + 10).setScale(2,
RoundingMode.HALF_UP))
.sectorIncreaseValue(BigDecimal.valueOf(Math.random() * 50 + 5).setScale(2, RoundingMode.HALF_UP))
.growthRate(BigDecimal.valueOf(Math.random() * 15 + 1).setScale(1, RoundingMode.HALF_UP))
.build());
}
return list;
}
@Override
public List<QueryResultVo> talentDemandStructure(QueryParamDto dto) {
List<QueryResultVo> list = new ArrayList<>();
for (Tuple2<String, String> industry : CommonConstant.INDUSTRY_LIST) {
list.add(QueryResultVo.builder()
.code(industry.getT1())
.desc(industry.getT2())
.count((long) Math.floor(Math.random() * 100000) + 1)
.build());
}
MathUtil.calculatePercentage(list);
return list;
}
@Override
public List<QueryResultVo> talentSupplyDistribution(QueryParamDto dto) {
List<QueryResultVo> list = new ArrayList<>();
List<Tuple2<String, String>> majorList =
Collections.unmodifiableList(new ArrayList<>(Arrays.asList(
Tuples.of("1", "机械制造"),
Tuples.of("2", "电子信息"),
Tuples.of("3", "管理类"),
Tuples.of("4", "基础科学"),
Tuples.of("5", "其他")
)));
for (Tuple2<String, String> major : majorList) {
list.add(QueryResultVo.builder()
.code(major.getT1())
.desc(major.getT2())
.count((long) Math.floor(Math.random() * 100000) + 1)
.build());
}
MathUtil.calculatePercentage(list);
return list;
}
@Override
public List<QueryResultVo> talentSkillLevelDistribution(QueryParamDto dto) {
List<QueryResultVo> list = new ArrayList<>();
List<Tuple2<String, String>> skillLevelList =
Collections.unmodifiableList(new ArrayList<>(Arrays.asList(
Tuples.of("1", "初级工及其他"),
Tuples.of("2", "中级工"),
Tuples.of("3", "高级工"),
Tuples.of("4", "技师/高级技师")
)));
for (Tuple2<String, String> level : skillLevelList) {
list.add(QueryResultVo.builder()
.code(level.getT1())
.desc(level.getT2())
.count((long) Math.floor(Math.random() * 100000) + 1)
.build());
}
MathUtil.calculatePercentage(list);
return list;
}
@Override
public List<QueryResultVo> talentSupplyDemandMatchingDegree(QueryParamDto dto) {
List<QueryResultVo> list = new ArrayList<>();
for (Tuple2<String, String> industry : CommonConstant.MAJOR_INDUSTRY_LIST) {
list.add(QueryResultVo.builder()
.code(industry.getT1())
.desc(industry.getT2())
.count((long) Math.floor(Math.random() * 100000) + 1)
.anotherCount((long) Math.floor(Math.random() * 100000) + 1)
.rate(BigDecimal.valueOf(Math.random() * 30 + 1).setScale(1, RoundingMode.HALF_UP))
.build());
}
return list;
}
}