From 5e63d112cc7f55ec547f1a36f24f84103ce71507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=AE=9D=E9=BE=99?= Date: Fri, 26 Jun 2026 16:19:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/cms/constant/CommonConstant.java | 32 +++- .../controller/AnalysisCommonController.java | 11 ++ ...orIndustryEmploymentMonitorController.java | 112 ++++++++++++ ...orIndustryEmploymentMonitorOverviewVo.java | 88 +++++++++ ...MajorIndustryEmploymentMonitorTreadVo.java | 47 +++++ .../cms/service/AnalysisCommonService.java | 7 + ...MajorIndustryEmploymentMonitorService.java | 82 +++++++++ .../impl/AnalysisCommonServiceImpl.java | 10 ++ ...rIndustryEmploymentMonitorServiceImpl.java | 168 ++++++++++++++++++ 9 files changed, 556 insertions(+), 1 deletion(-) create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisMajorIndustryEmploymentMonitorController.java create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/MajorIndustryEmploymentMonitorOverviewVo.java create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/MajorIndustryEmploymentMonitorTreadVo.java create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisMajorIndustryEmploymentMonitorService.java create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisMajorIndustryEmploymentMonitorServiceImpl.java diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/CommonConstant.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/CommonConstant.java index 4ebbc1c..af51034 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/CommonConstant.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/CommonConstant.java @@ -76,7 +76,37 @@ public class CommonConstant { ))); /** - * 行业列表 + * 重点行业列表 + */ + public static final List> MAJOR_INDUSTRY_LIST = + Collections.unmodifiableList(new ArrayList<>(Arrays.asList( + Tuples.of("C26", "化学原料和化学制品制造业"), + Tuples.of("C30", "非金属矿物制品业"), + Tuples.of("C31", "黑色金属冶炼和压延加工业"), + Tuples.of("C32", "有色金属冶炼和压延加工业"), + Tuples.of("D44", "电力、热力生产和供应业"), + Tuples.of("C13", "农副食品加工业"), + Tuples.of("C14", "食品制造业"), + Tuples.of("C15", "酒、饮料和精制茶制造业"), + Tuples.of("L72", "商务服务业"), + Tuples.of("M74", "专业技术服务业"), + Tuples.of("M75", "科技推广和应用服务业"), + Tuples.of("I65", "软件和信息技术服务业"), + Tuples.of("I64", "互联网和相关服务"), + Tuples.of("C17", "纺织业"), + Tuples.of("C18", "纺织服装、服饰业"), + Tuples.of("C34", "通用设备制造业"), + Tuples.of("C35", "专用设备制造业"), + Tuples.of("C36", "汽车制造业"), + Tuples.of("C38", "电气机械和器材制造业"), + Tuples.of("C39", "计算机、通信和其他电子设备制造业"), + Tuples.of("C40", "仪器仪表制造业"), + Tuples.of("C27", "医药制造业"), + Tuples.of("M73", "研究和试验发展") + ))); + + /** + * 高校类型列表 */ public static final List> UNIVERSITY_TYPE_LIST = Collections.unmodifiableList(new ArrayList<>(Arrays.asList( diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisCommonController.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisCommonController.java index 41570af..24fc6b4 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisCommonController.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisCommonController.java @@ -52,4 +52,15 @@ public class AnalysisCommonController { public AjaxResult universityTypeList() { return AjaxResult.success(analysisCommonService.universityTypeList()); } + + /** + * 查询重点行业列表 + * + * @return 重点行业列表 + */ + @GetMapping("/majorIndustryList") +// @Log(title = "根据枚举名称查询枚举的所有值", businessType = BusinessType.QUERY) + public AjaxResult majorIndustryList() { + return AjaxResult.success(analysisCommonService.majorIndustryList()); + } } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisMajorIndustryEmploymentMonitorController.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisMajorIndustryEmploymentMonitorController.java new file mode 100644 index 0000000..6f1507f --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisMajorIndustryEmploymentMonitorController.java @@ -0,0 +1,112 @@ +package com.ruoyi.cms.controller; + +import com.ruoyi.cms.domain.dto.QueryParamDto; +import com.ruoyi.cms.service.AnalysisMajorIndustryEmploymentMonitorService; +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/majorIndustryEmploymentMonitor") +@RequiredArgsConstructor +public class AnalysisMajorIndustryEmploymentMonitorController { + + private final AnalysisMajorIndustryEmploymentMonitorService analysisMajorIndustryEmploymentMonitorService; + + /** + * 数据总览 + * + * @param dto 查询参数 + * @return 数据总览 + */ + @PostMapping("/overview") + public AjaxResult overview(@RequestBody QueryParamDto dto) { + return AjaxResult.success(analysisMajorIndustryEmploymentMonitorService.overview(dto)); + } + + /** + * 用工需求和失业率趋势 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + @PostMapping("/demandAndUnemploymentRate") + public AjaxResult demandAndUnemploymentRate(@RequestBody QueryParamDto dto) { + return AjaxResult.success(analysisMajorIndustryEmploymentMonitorService.demandAndUnemploymentRate(dto)); + } + + /** + * 行业失业率对比 + * + * @param dto 查询参数 + * @return 结果列表 + */ + @PostMapping("/industryUnemploymentRate") + public AjaxResult industryUnemploymentRate(@RequestBody QueryParamDto dto) { + return AjaxResult.success(analysisMajorIndustryEmploymentMonitorService.industryUnemploymentRate(dto)); + } + + /** + * 失业人员行业分布 + * + * @param dto 查询参数 + * @return 结果列表 + */ + @PostMapping("/industryDistribution") + public AjaxResult industryDistribution(@RequestBody QueryParamDto dto) { + return AjaxResult.success(analysisMajorIndustryEmploymentMonitorService.industryDistribution(dto)); + } + + /** + * 薪资水平监测 + * + * @param dto 查询参数 + * @return 结果列表 + */ + @PostMapping("/salaryLevel") + public AjaxResult salaryLevel(@RequestBody QueryParamDto dto) { + return AjaxResult.success(analysisMajorIndustryEmploymentMonitorService.salaryLevel(dto)); + } + + /** + * 性别就业差异分析 + * + * @param dto 查询参数 + * @return 结果列表 + */ + @PostMapping("/gender") + public AjaxResult gender(@RequestBody QueryParamDto dto) { + return AjaxResult.success(analysisMajorIndustryEmploymentMonitorService.gender(dto)); + } + + /** + * 岗位类型就业分析 + * + * @param dto 查询参数 + * @return 结果列表 + */ + @PostMapping("/jobType") + public AjaxResult jobType(@RequestBody QueryParamDto dto) { + return AjaxResult.success(analysisMajorIndustryEmploymentMonitorService.jobType(dto)); + } + + /** + * 裁员和用工缺口监测 + * + * @param dto 查询参数 + * @return 结果列表 + */ + @PostMapping("/layoffAndLaborGap") + public AjaxResult layoffAndLaborGap(@RequestBody QueryParamDto dto) { + return AjaxResult.success(analysisMajorIndustryEmploymentMonitorService.layoffAndLaborGap(dto)); + } +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/MajorIndustryEmploymentMonitorOverviewVo.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/MajorIndustryEmploymentMonitorOverviewVo.java new file mode 100644 index 0000000..2a8af3b --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/MajorIndustryEmploymentMonitorOverviewVo.java @@ -0,0 +1,88 @@ +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/26 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class MajorIndustryEmploymentMonitorOverviewVo implements Serializable { + private static final long serialVersionUID = -2913710026460921170L; + + /** + * 监测行业数 + */ + private Long monitorIndustryCount; + /** + * 监测行业数环比 + */ + private BigDecimal monitorIndustryCountMom; + /** + * 检测企业数 + */ + private Long monitorCompanyCount; + /** + * 检测企业数环比 + */ + private BigDecimal monitorCompanyCountMom; + /** + * 累计城镇新增就业人数 + */ + private Long totalTownEmploymentCount; + /** + * 累计城镇新增就业人数环比 + */ + private BigDecimal totalTownEmploymentCountMom; + /** + * 失业人员再就业人数 + */ + private Long unEmploymentEmploymentCount; + /** + * 失业人员再就业人数环比 + */ + private BigDecimal unEmploymentEmploymentCountMom; + /** + * 就业困难人员就业人数 + */ + private Long employmentDifficultyEmploymentCount; + /** + * 就业困难人员就业人数环比 + */ + private BigDecimal employmentDifficultyEmploymentCountMom; + /** + * 就业需求 + */ + private Long employmentDemandCount; + /** + * 就业需求环比 + */ + private BigDecimal employmentDemandCountMom; + /** + * 失业人数 + */ + private Long unEmploymentCount; + /** + * 失业人数环比 + */ + private BigDecimal unEmploymentCountMom; + /** + * 失业率 + */ + private BigDecimal unEmploymentRate; + /** + * 失业率环比 + */ + private BigDecimal unEmploymentRateMom; +} diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/MajorIndustryEmploymentMonitorTreadVo.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/MajorIndustryEmploymentMonitorTreadVo.java new file mode 100644 index 0000000..23939d6 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/MajorIndustryEmploymentMonitorTreadVo.java @@ -0,0 +1,47 @@ +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/26 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class MajorIndustryEmploymentMonitorTreadVo implements Serializable { + private static final long serialVersionUID = -131492728482137431L; + /** + * 编码 + */ + private String code; + /** + * 描述 + */ + private String desc; + /** + * 用工需求 + */ + private Long laborDemandCount; + /** + * 城镇新增就业人数 + */ + private Long townEmploymentCount; + /** + * 失业率 + */ + private BigDecimal unEmploymentRate; + /** + * 全市平均失业率 + */ + private BigDecimal cityAverageUnEmploymentRate; +} diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisCommonService.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisCommonService.java index 80ae099..c4e8bf9 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisCommonService.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisCommonService.java @@ -33,4 +33,11 @@ public interface AnalysisCommonService { * @return 高校类型列表 */ List universityTypeList(); + + /** + * 查询重点行业列表 + * + * @return 重点行业列表 + */ + List majorIndustryList(); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisMajorIndustryEmploymentMonitorService.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisMajorIndustryEmploymentMonitorService.java new file mode 100644 index 0000000..1586152 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisMajorIndustryEmploymentMonitorService.java @@ -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 demandAndUnemploymentRate(QueryParamDto dto); + + /** + * 行业失业率对比 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List industryUnemploymentRate(QueryParamDto dto); + + /** + * 失业人员行业分布 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List industryDistribution(QueryParamDto dto); + + /** + * 薪资水平监测 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List salaryLevel(QueryParamDto dto); + + /** + * 性别就业差异分析 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List gender(QueryParamDto dto); + + /** + * 岗位类型就业分析 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List jobType(QueryParamDto dto); + + /** + * 裁员和用工缺口监测 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List layoffAndLaborGap(QueryParamDto dto); +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisCommonServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisCommonServiceImpl.java index e9f55cc..693eedc 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisCommonServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisCommonServiceImpl.java @@ -52,4 +52,14 @@ public class AnalysisCommonServiceImpl implements AnalysisCommonService { return list; } + + @Override + public List majorIndustryList() { + List list = new ArrayList<>(); + for (Tuple2 industry : CommonConstant.MAJOR_INDUSTRY_LIST) { + list.add(DictVo.builder().code(industry.getT1()).desc(industry.getT2()).build()); + } + + return list; + } } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisMajorIndustryEmploymentMonitorServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisMajorIndustryEmploymentMonitorServiceImpl.java new file mode 100644 index 0000000..96c72c7 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisMajorIndustryEmploymentMonitorServiceImpl.java @@ -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 demandAndUnemploymentRate(QueryParamDto dto) { + List 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 industryUnemploymentRate(QueryParamDto dto) { + List list = new ArrayList<>(); + for (Tuple2 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 industryDistribution(QueryParamDto dto) { + List list = new ArrayList<>(); + for (Tuple2 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 salaryLevel(QueryParamDto dto) { + List list = new ArrayList<>(); + for (Tuple2 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 gender(QueryParamDto dto) { + List list = new ArrayList<>(); + List> genderList = + Collections.unmodifiableList(new ArrayList<>(Arrays.asList( + Tuples.of("1", "男"), + Tuples.of("2", "女") + ))); + for (Tuple2 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 jobType(QueryParamDto dto) { + List list = new ArrayList<>(); + List> jobTypeList = + Collections.unmodifiableList(new ArrayList<>(Arrays.asList( + Tuples.of("1", "管理人员"), + Tuples.of("2", "专业技术人员"), + Tuples.of("3", "技能工人"), + Tuples.of("4", "一般员工"), + Tuples.of("5", "其他") + ))); + for (Tuple2 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 layoffAndLaborGap(QueryParamDto dto) { + List list = new ArrayList<>(); + for (Tuple2 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; + } +} \ No newline at end of file