添加功能
This commit is contained in:
@@ -0,0 +1,101 @@
|
|||||||
|
package com.ruoyi.cms.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.dto.QueryParamDto;
|
||||||
|
import com.ruoyi.cms.service.AnalysisLaborForceEmploymentService;
|
||||||
|
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/27
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/analysis/laborForceEmployment")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AnalysisLaborForceEmploymentController {
|
||||||
|
|
||||||
|
private final AnalysisLaborForceEmploymentService analysisLaborForceEmploymentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据总览
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 数据总览
|
||||||
|
*/
|
||||||
|
@PostMapping("/overview")
|
||||||
|
public AjaxResult overview(@RequestBody QueryParamDto dto) {
|
||||||
|
return AjaxResult.success(analysisLaborForceEmploymentService.overview(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 城镇新增就业完成情况
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 完成情况
|
||||||
|
*/
|
||||||
|
@PostMapping("/taget")
|
||||||
|
public AjaxResult taget(@RequestBody QueryParamDto dto) {
|
||||||
|
return AjaxResult.success(analysisLaborForceEmploymentService.taget(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业产业情况分析
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 结果列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/employIndustrySituation")
|
||||||
|
public AjaxResult employIndustrySituation(@RequestBody QueryParamDto dto) {
|
||||||
|
return AjaxResult.success(analysisLaborForceEmploymentService.employIndustrySituation(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业人员性别分布
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 结果列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/employmentGender")
|
||||||
|
public AjaxResult employmentGender(@RequestBody QueryParamDto dto) {
|
||||||
|
return AjaxResult.success(analysisLaborForceEmploymentService.employmentGender(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业形式
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 结果列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/employmentMode")
|
||||||
|
public AjaxResult employmentMode(@RequestBody QueryParamDto dto) {
|
||||||
|
return AjaxResult.success(analysisLaborForceEmploymentService.employmentMode(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业热力图
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 热力图列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/employmentHeatmap")
|
||||||
|
public AjaxResult employmentHeatmap(@RequestBody QueryParamDto dto) {
|
||||||
|
return AjaxResult.success(analysisLaborForceEmploymentService.employmentHeatmap(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失业热力图
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 热力图列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/unemploymentHeatmap")
|
||||||
|
public AjaxResult unemploymentHeatmap(@RequestBody QueryParamDto dto) {
|
||||||
|
return AjaxResult.success(analysisLaborForceEmploymentService.unemploymentHeatmap(dto));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 LaborForceEmploymentOverviewVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = -8937737222196834158L;
|
||||||
|
/**
|
||||||
|
* 就业累计人数
|
||||||
|
*/
|
||||||
|
private Long totalEmploymentCount;
|
||||||
|
/**
|
||||||
|
* 就业累计人数环比
|
||||||
|
*/
|
||||||
|
private BigDecimal totalEmploymentCountMom;
|
||||||
|
/**
|
||||||
|
* 城镇新增就业人数
|
||||||
|
*/
|
||||||
|
private Long townEmploymentCount;
|
||||||
|
/**
|
||||||
|
* 城镇新增就业人数环比
|
||||||
|
*/
|
||||||
|
private BigDecimal townEmploymentCountMom;
|
||||||
|
/**
|
||||||
|
* 失业人员再就业人数
|
||||||
|
*/
|
||||||
|
private Long unEmploymentEmploymentCount;
|
||||||
|
/**
|
||||||
|
* 失业人员再就业人数环比
|
||||||
|
*/
|
||||||
|
private BigDecimal unEmploymentEmploymentCountMom;
|
||||||
|
/**
|
||||||
|
* 就业困难人员就业人数
|
||||||
|
*/
|
||||||
|
private Long employmentDifficultyEmploymentCount;
|
||||||
|
/**
|
||||||
|
* 就业困难人员就业人数环比
|
||||||
|
*/
|
||||||
|
private BigDecimal employmentDifficultyEmploymentCountMom;
|
||||||
|
/**
|
||||||
|
* 失业登记人数
|
||||||
|
*/
|
||||||
|
private Long unemploymentCount;
|
||||||
|
/**
|
||||||
|
* 失业登记人数环比
|
||||||
|
*/
|
||||||
|
private BigDecimal unemploymentCountMom;
|
||||||
|
/**
|
||||||
|
* 失业金申领人数
|
||||||
|
*/
|
||||||
|
private Long unemploymentBenefitCount;
|
||||||
|
/**
|
||||||
|
* 失业登记人数环比
|
||||||
|
*/
|
||||||
|
private BigDecimal unemploymentBenefitCountMom;
|
||||||
|
/**
|
||||||
|
* 享受失业服务人数
|
||||||
|
*/
|
||||||
|
private Long receiveUnemploymentServiceCount;
|
||||||
|
/**
|
||||||
|
* 失业登记人数环比
|
||||||
|
*/
|
||||||
|
private BigDecimal receiveUnemploymentServiceCountMom;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
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 LaborForceEmploymentTargetVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 3984746858252701664L;
|
||||||
|
/**
|
||||||
|
* 完成率
|
||||||
|
*/
|
||||||
|
private BigDecimal finishRate;
|
||||||
|
/**
|
||||||
|
* 当前完成
|
||||||
|
*/
|
||||||
|
private Long currentFinishCount;
|
||||||
|
/**
|
||||||
|
* 全年完成
|
||||||
|
*/
|
||||||
|
private Long overallYearFinishCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.ruoyi.cms.service;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.dto.QueryParamDto;
|
||||||
|
import com.ruoyi.cms.domain.vo.HeatmapVo;
|
||||||
|
import com.ruoyi.cms.domain.vo.LaborForceEmploymentOverviewVo;
|
||||||
|
import com.ruoyi.cms.domain.vo.LaborForceEmploymentTargetVo;
|
||||||
|
import com.ruoyi.cms.domain.vo.QueryResultVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 劳动力就业失业数据分析
|
||||||
|
*
|
||||||
|
* @author 马宝龙
|
||||||
|
* @date 2026/6/27
|
||||||
|
*/
|
||||||
|
public interface AnalysisLaborForceEmploymentService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据总览
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 数据总览
|
||||||
|
*/
|
||||||
|
LaborForceEmploymentOverviewVo overview(QueryParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 城镇新增就业完成情况
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
LaborForceEmploymentTargetVo taget(QueryParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业产业情况分析
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 结果列表
|
||||||
|
*/
|
||||||
|
List<QueryResultVo> employIndustrySituation(QueryParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业人员性别分布
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 结果列表
|
||||||
|
*/
|
||||||
|
List<QueryResultVo> employmentGender(QueryParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业形式
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 结果列表
|
||||||
|
*/
|
||||||
|
List<QueryResultVo> employmentMode(QueryParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业热力图
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 热力图列表
|
||||||
|
*/
|
||||||
|
List<HeatmapVo> employmentHeatmap(QueryParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失业热力图
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 热力图列表
|
||||||
|
*/
|
||||||
|
List<HeatmapVo> unemploymentHeatmap(QueryParamDto dto);
|
||||||
|
}
|
||||||
@@ -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.HeatmapVo;
|
||||||
|
import com.ruoyi.cms.domain.vo.LaborForceEmploymentOverviewVo;
|
||||||
|
import com.ruoyi.cms.domain.vo.LaborForceEmploymentTargetVo;
|
||||||
|
import com.ruoyi.cms.domain.vo.QueryResultVo;
|
||||||
|
import com.ruoyi.cms.service.AnalysisLaborForceEmploymentService;
|
||||||
|
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/27
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
@Slf4j
|
||||||
|
public class AnalysisLaborForceEmploymentServiceImpl implements AnalysisLaborForceEmploymentService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LaborForceEmploymentOverviewVo overview(QueryParamDto dto) {
|
||||||
|
return LaborForceEmploymentOverviewVo.builder()
|
||||||
|
.totalEmploymentCount(120000L)
|
||||||
|
.totalEmploymentCountMom(BigDecimal.valueOf(3.2))
|
||||||
|
.townEmploymentCount(10000L)
|
||||||
|
.townEmploymentCountMom(BigDecimal.valueOf(-2.1))
|
||||||
|
.unEmploymentEmploymentCount(2000L)
|
||||||
|
.unEmploymentEmploymentCountMom(BigDecimal.valueOf(6.05))
|
||||||
|
.employmentDifficultyEmploymentCount(5000L)
|
||||||
|
.employmentDifficultyEmploymentCountMom(BigDecimal.valueOf(3.03))
|
||||||
|
.unemploymentCount(4000L)
|
||||||
|
.unemploymentCountMom(BigDecimal.valueOf(-1.02))
|
||||||
|
.unemploymentBenefitCount(3000L)
|
||||||
|
.unemploymentBenefitCountMom(BigDecimal.valueOf(4.01))
|
||||||
|
.receiveUnemploymentServiceCount(1000L)
|
||||||
|
.receiveUnemploymentServiceCountMom(BigDecimal.valueOf(-3.01))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LaborForceEmploymentTargetVo taget(QueryParamDto dto) {
|
||||||
|
return LaborForceEmploymentTargetVo.builder()
|
||||||
|
.currentFinishCount(8500L)
|
||||||
|
.overallYearFinishCount(12000L)
|
||||||
|
.finishRate(BigDecimal.valueOf(70.83))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<QueryResultVo> employIndustrySituation(QueryParamDto dto) {
|
||||||
|
List<QueryResultVo> list = new ArrayList<>();
|
||||||
|
List<Tuple2<String, String>> industryList =
|
||||||
|
Collections.unmodifiableList(new ArrayList<>(Arrays.asList(
|
||||||
|
Tuples.of("1", "第一产业"),
|
||||||
|
Tuples.of("2", "第二产业"),
|
||||||
|
Tuples.of("2", "第三产业")
|
||||||
|
)));
|
||||||
|
for (Tuple2<String, String> industry : industryList) {
|
||||||
|
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> employmentGender(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> employmentMode(QueryParamDto dto) {
|
||||||
|
List<QueryResultVo> list = new ArrayList<>();
|
||||||
|
List<Tuple2<String, String>> modeList =
|
||||||
|
Collections.unmodifiableList(new ArrayList<>(Arrays.asList(
|
||||||
|
Tuples.of("1", "单位就业"),
|
||||||
|
Tuples.of("2", "灵活就业"),
|
||||||
|
Tuples.of("3", "个体经营"),
|
||||||
|
Tuples.of("4", "公益性岗位")
|
||||||
|
)));
|
||||||
|
for (Tuple2<String, String> mode : modeList) {
|
||||||
|
list.add(QueryResultVo.builder()
|
||||||
|
.code(mode.getT1())
|
||||||
|
.desc(mode.getT2())
|
||||||
|
.count((long) Math.floor(Math.random() * 100000) + 1)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
MathUtil.calculatePercentage(list);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<HeatmapVo> employmentHeatmap(QueryParamDto dto) {
|
||||||
|
List<HeatmapVo> list = new ArrayList<>();
|
||||||
|
for (Tuple2<String, String> area : CommonConstant.AREA_LIST) {
|
||||||
|
list.add(HeatmapVo.builder()
|
||||||
|
.areaCode(area.getT1())
|
||||||
|
.areaName(area.getT2())
|
||||||
|
.count((long) Math.floor(Math.random() * 10000) + 1)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
MathUtil.calculatePercentageHeatmap(list);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<HeatmapVo> unemploymentHeatmap(QueryParamDto dto) {
|
||||||
|
List<HeatmapVo> list = new ArrayList<>();
|
||||||
|
for (Tuple2<String, String> area : CommonConstant.AREA_LIST) {
|
||||||
|
list.add(HeatmapVo.builder()
|
||||||
|
.areaCode(area.getT1())
|
||||||
|
.areaName(area.getT2())
|
||||||
|
.count((long) Math.floor(Math.random() * 5000) + 1)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
MathUtil.calculatePercentageHeatmap(list);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user