添加功能

This commit is contained in:
马宝龙
2026-06-26 16:19:10 +08:00
parent 4424604b5b
commit 5e63d112cc
9 changed files with 556 additions and 1 deletions

View File

@@ -33,4 +33,11 @@ public interface AnalysisCommonService {
* @return 高校类型列表
*/
List<DictVo> universityTypeList();
/**
* 查询重点行业列表
*
* @return 重点行业列表
*/
List<DictVo> majorIndustryList();
}

View File

@@ -0,0 +1,82 @@
package com.ruoyi.cms.service;
import com.ruoyi.cms.domain.dto.QueryParamDto;
import com.ruoyi.cms.domain.vo.MajorIndustryEmploymentMonitorOverviewVo;
import com.ruoyi.cms.domain.vo.MajorIndustryEmploymentMonitorTreadVo;
import com.ruoyi.cms.domain.vo.QueryResultVo;
import java.util.List;
/**
* 重点行业就失业监测分析
*
* @author 马宝龙
* @date 2026/6/26
*/
public interface AnalysisMajorIndustryEmploymentMonitorService {
/**
* 数据总览
*
* @param dto 查询参数
* @return 数据总览
*/
MajorIndustryEmploymentMonitorOverviewVo overview(QueryParamDto dto);
/**
* 用工需求和失业率趋势
*
* @param dto 查询参数
* @return 趋势列表
*/
List<MajorIndustryEmploymentMonitorTreadVo> demandAndUnemploymentRate(QueryParamDto dto);
/**
* 行业失业率对比
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> industryUnemploymentRate(QueryParamDto dto);
/**
* 失业人员行业分布
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> industryDistribution(QueryParamDto dto);
/**
* 薪资水平监测
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> salaryLevel(QueryParamDto dto);
/**
* 性别就业差异分析
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> gender(QueryParamDto dto);
/**
* 岗位类型就业分析
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> jobType(QueryParamDto dto);
/**
* 裁员和用工缺口监测
*
* @param dto 查询参数
* @return 结果列表
*/
List<QueryResultVo> layoffAndLaborGap(QueryParamDto dto);
}

View File

@@ -52,4 +52,14 @@ public class AnalysisCommonServiceImpl implements AnalysisCommonService {
return list;
}
@Override
public List<DictVo> majorIndustryList() {
List<DictVo> list = new ArrayList<>();
for (Tuple2<String, String> industry : CommonConstant.MAJOR_INDUSTRY_LIST) {
list.add(DictVo.builder().code(industry.getT1()).desc(industry.getT2()).build());
}
return list;
}
}

View File

@@ -0,0 +1,168 @@
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.MajorIndustryEmploymentMonitorOverviewVo;
import com.ruoyi.cms.domain.vo.MajorIndustryEmploymentMonitorTreadVo;
import com.ruoyi.cms.domain.vo.QueryResultVo;
import com.ruoyi.cms.service.AnalysisMajorIndustryEmploymentMonitorService;
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 AnalysisMajorIndustryEmploymentMonitorServiceImpl implements AnalysisMajorIndustryEmploymentMonitorService {
@Override
public MajorIndustryEmploymentMonitorOverviewVo overview(QueryParamDto dto) {
return MajorIndustryEmploymentMonitorOverviewVo.builder()
.monitorIndustryCount(12L)
.monitorIndustryCountMom(BigDecimal.valueOf(3.2))
.monitorCompanyCount(856L)
.monitorCompanyCountMom(BigDecimal.valueOf(5.1))
.totalTownEmploymentCount(32500L)
.totalTownEmploymentCountMom(BigDecimal.valueOf(4.5))
.unEmploymentEmploymentCount(12800L)
.unEmploymentEmploymentCountMom(BigDecimal.valueOf(6.3))
.employmentDifficultyEmploymentCount(5600L)
.employmentDifficultyEmploymentCountMom(BigDecimal.valueOf(-2.1))
.employmentDemandCount(45000L)
.employmentDemandCountMom(BigDecimal.valueOf(8.7))
.unEmploymentCount(3800L)
.unEmploymentCountMom(BigDecimal.valueOf(-1.5))
.unEmploymentRate(BigDecimal.valueOf(4.2))
.unEmploymentRateMom(BigDecimal.valueOf(-0.3))
.build();
}
@Override
public List<MajorIndustryEmploymentMonitorTreadVo> demandAndUnemploymentRate(QueryParamDto dto) {
List<MajorIndustryEmploymentMonitorTreadVo> list = new ArrayList<>();
for (int i = 0; i < 12; i++) {
list.add(MajorIndustryEmploymentMonitorTreadVo.builder()
.code(i + 1 + "")
.desc(i + 1 + "")
.laborDemandCount((long) Math.floor(Math.random() * 30000) + 1000)
.townEmploymentCount((long) Math.floor(Math.random() * 20000) + 500)
.unEmploymentRate(BigDecimal.valueOf(Math.random() * 5 + 2).setScale(1, RoundingMode.HALF_UP))
.cityAverageUnEmploymentRate(BigDecimal.valueOf(Math.random() * 4 + 3).setScale(1, RoundingMode.HALF_UP))
.build());
}
return list;
}
@Override
public List<QueryResultVo> industryUnemploymentRate(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() * 10000) + 1)
.amount(BigDecimal.valueOf(Math.random() * 5 + 2).setScale(1, RoundingMode.HALF_UP))
.build());
}
return list;
}
@Override
public List<QueryResultVo> industryDistribution(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)
.build());
}
MathUtil.calculatePercentage(list);
return list;
}
@Override
public List<QueryResultVo> salaryLevel(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())
.amount(BigDecimal.valueOf(Math.random() * 20000 + 2).setScale(1, RoundingMode.HALF_UP))
.anotherAmount(BigDecimal.valueOf(Math.random() * 20000 + 2).setScale(1, RoundingMode.HALF_UP))
.build());
}
return list;
}
@Override
public List<QueryResultVo> gender(QueryParamDto dto) {
List<QueryResultVo> list = new ArrayList<>();
List<Tuple2<String, String>> genderList =
Collections.unmodifiableList(new ArrayList<>(Arrays.asList(
Tuples.of("1", ""),
Tuples.of("2", "")
)));
for (Tuple2<String, String> gender : genderList) {
list.add(QueryResultVo.builder()
.code(gender.getT1())
.desc(gender.getT2())
.count((long) Math.floor(Math.random() * 100000) + 1)
.build());
}
MathUtil.calculatePercentage(list);
return list;
}
@Override
public List<QueryResultVo> jobType(QueryParamDto dto) {
List<QueryResultVo> list = new ArrayList<>();
List<Tuple2<String, String>> jobTypeList =
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> jobType : jobTypeList) {
list.add(QueryResultVo.builder()
.code(jobType.getT1())
.desc(jobType.getT2())
.count((long) Math.floor(Math.random() * 100000) + 1)
.build());
}
MathUtil.calculatePercentage(list);
return list;
}
@Override
public List<QueryResultVo> layoffAndLaborGap(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() * 5000) + 1)
.anotherCount((long) Math.floor(Math.random() * 5000) + 1)
.build());
}
return list;
}
}