添加功能

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,101 @@
package com.ruoyi.cms.controller;
import com.ruoyi.cms.domain.dto.QueryParamDto;
import com.ruoyi.cms.service.AnalysisSectorTalentService;
import com.ruoyi.common.core.domain.AjaxResult;
import lombok.RequiredArgsConstructor;
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;
/**
* 产业发展与人才供需分析
*
* @author 马宝龙
* @date 2026/6/26
*/
@RestController
@RequestMapping("/analysis/sectorTalent")
@RequiredArgsConstructor
public class AnalysisSectorTalentController {
private final AnalysisSectorTalentService analysisSectorTalentService;
/**
* 数据总览
*
* @param dto 查询参数
* @return 数据总览
*/
@PostMapping("/overview")
public AjaxResult overview(@RequestBody QueryParamDto dto) {
return AjaxResult.success(analysisSectorTalentService.overview(dto));
}
/**
* 产业景气指数
*
* @param dto 查询参数
* @return 产业景气指数
*/
@PostMapping("/sectorProsperityIndex")
public AjaxResult sectorProsperityIndex(@RequestBody QueryParamDto dto) {
return AjaxResult.success(analysisSectorTalentService.sectorProsperityIndex(dto));
}
/**
* 产业发展趋势分析
*
* @param dto 查询参数
* @return 趋势列表
*/
@PostMapping("/sectorDevelopTrend")
public AjaxResult sectorDevelopTrend(@RequestBody QueryParamDto dto) {
return AjaxResult.success(analysisSectorTalentService.sectorDevelopTrend(dto));
}
/**
* 人才需求结构分析
*
* @param dto 查询参数
* @return 结果列表
*/
@PostMapping("/talentDemandStructure")
public AjaxResult talentDemandStructure(@RequestBody QueryParamDto dto) {
return AjaxResult.success(analysisSectorTalentService.talentDemandStructure(dto));
}
/**
* 高校毕业生人才供给专业分布
*
* @param dto 查询参数
* @return 结果列表
*/
@PostMapping("/talentSupplyDistribution")
public AjaxResult talentSupplyDistribution(@RequestBody QueryParamDto dto) {
return AjaxResult.success(analysisSectorTalentService.talentSupplyDistribution(dto));
}
/**
* 职业培训技能人才等级分布
*
* @param dto 查询参数
* @return 结果列表
*/
@PostMapping("/talentSkillLevelDistribution")
public AjaxResult talentSkillLevelDistribution(@RequestBody QueryParamDto dto) {
return AjaxResult.success(analysisSectorTalentService.talentSkillLevelDistribution(dto));
}
/**
* 人才供需匹配度评估
*
* @param dto 查询参数
* @return 结果列表
*/
@PostMapping("/talentSupplyDemandMatchingDegree")
public AjaxResult talentSupplyDemandMatchingDegree(@RequestBody QueryParamDto dto) {
return AjaxResult.success(analysisSectorTalentService.talentSupplyDemandMatchingDegree(dto));
}
}

View File

@@ -60,4 +60,8 @@ public class QueryResultVo implements Serializable {
* 其他金额占比
*/
private BigDecimal anotherAmountPercentage;
/**
* 比率
*/
private BigDecimal rate;
}

View File

@@ -0,0 +1,79 @@
package com.ruoyi.cms.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 产业发展与人才供需分析 - 数据总览
*
* @author 马宝龙
* @date 2026/6/25
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SectorTalentOverviewVo implements Serializable {
private static final long serialVersionUID = -8478307079421272922L;
/**
* 产业产值
*/
private BigDecimal sectorAmount;
/**
* 产业产值环比
*/
private BigDecimal sectorAmountMom;
/**
* 企业新增投资额
*/
private BigDecimal companyNewInvestmentAmount;
/**
* 企业新增投资额环比
*/
private BigDecimal companyNewInvestmentAmountMom;
/**
* 人才需求
*/
private Long talentDemandCount;
/**
* 人才需求环比
*/
private BigDecimal talentDemandCountMom;
/**
* 人才供给
*/
private Long talentSupplyCount;
/**
* 人才供给环比
*/
private BigDecimal talentSupplyCountMom;
/**
* 供需匹配度
*/
private BigDecimal supplyDemandMatchingDegree;
/**
* 供需匹配度环比
*/
private BigDecimal supplyDemandMatchingDegreeMom;
/**
* 人才缺口
*/
private Long talentGapCount;
/**
* 人才缺口环比
*/
private BigDecimal talentGapCountMom;
/**
* 技能培训人数
*/
private Long skillTrainCount;
/**
* 人才缺口环比
*/
private BigDecimal skillTrainCountMom;
}

View File

@@ -0,0 +1,27 @@
package com.ruoyi.cms.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 产业发展与人才供需分析 - 产业景气指数
*
* @author 马宝龙
* @date 2026/6/25
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SectorTalentProsperityIndexVo implements Serializable {
private static final long serialVersionUID = 6863893452822473926L;
/**
* 景气指数
*/
private BigDecimal prosperityIndex;
}

View File

@@ -0,0 +1,48 @@
package com.ruoyi.cms.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 产业发展与人才供需分析 - 产业发展趋势分析
*
* @author 马宝龙
* @date 2026/6/25
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SectorTalentTreadVo implements Serializable {
private static final long serialVersionUID = -8478307079421272922L;
/**
* 编码
*/
private String code;
/**
* 描述
*/
private String desc;
/**
* 岗位需求
*/
private Long jobDemandCount;
/**
* 产业投资
*/
private BigDecimal sectorInvestmentAmount;
/**
* 产业增加值
*/
private BigDecimal sectorIncreaseValue;
/**
* 增长率
*/
private BigDecimal growthRate;
}

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;
}
}