From 9bc83594755889cf7234d53f7206077d5bcac104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=AE=9D=E9=BE=99?= Date: Mon, 13 Jul 2026 21:59:01 +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 | 58 ++- ...alysisSectorOccupationSkillController.java | 11 - .../mapper/ThemeEmploymentRegisterMapper.java | 10 +- .../ruoyi/cms/mapper/ThemeKeyGroupMapper.java | 26 ++ .../mapper/ThemeProfessionalTrainMapper.java | 32 ++ .../cms/mapper/ThemeRecruitmentJobMapper.java | 16 +- .../ThemeUnemploymentRegisterMapper.java | 2 +- .../AnalysisSectorOccupationSkillService.java | 8 - .../impl/AnalysisExportServiceImpl.java | 163 +++++++- ...ysisIndustryEmploymentInfoServiceImpl.java | 8 +- ...isKeyGroupServiceSituationServiceImpl.java | 3 +- ...aborForceRecruitmentDemandServiceImpl.java | 18 +- ...rIndustryEmploymentMonitorServiceImpl.java | 8 +- ...lysisSectorOccupationSkillServiceImpl.java | 349 ++++++++++++------ .../impl/AnalysisSectorTalentServiceImpl.java | 3 - .../java/com/ruoyi/cms/util/ParamUtil.java | 10 +- .../mapper/ThemeEmploymentRegisterMapper.xml | 29 +- .../resources/mapper/ThemeKeyGroupMapper.xml | 48 +++ .../mapper/ThemeProfessionalTrainMapper.xml | 77 ++++ .../mapper/ThemeRecruitmentJobMapper.xml | 43 +-- .../ThemeUnemploymentRegisterMapper.xml | 5 +- sql/datadashboard/table.sql | 118 ++++-- 22 files changed, 779 insertions(+), 266 deletions(-) create mode 100644 ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeKeyGroupMapper.java create mode 100644 ruoyi-bussiness/src/main/resources/mapper/ThemeKeyGroupMapper.xml 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 ad86c18..80dcf91 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 @@ -131,24 +131,24 @@ public class CommonConstant { Tuple2::getT2 ))); /** - * 重点产业列表 + * 产业列表 */ - public static final List> MAJOR_SECTOR_LIST = + public static final List> SECTOR_LIST = Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("新材料产业 (碳基、硅基、铝基)", "新材料产业 (碳基、硅基、铝基)"), - Tuples.of("新能源产业", "新能源产业"), - Tuples.of("农业资源转化产业 (农产品精深加工)", "农业资源转化产业 (农产品精深加工)"), - Tuples.of("现代服务业", "现代服务业"), - Tuples.of("绿色算力产业", "绿色算力产业"), - Tuples.of("纺织服装产业", "纺织服装产业"), - Tuples.of("先进装备制造", "先进装备制造"), - Tuples.of("生物医药", "生物医药") + Tuples.of("1", "新材料产业 (碳基、硅基、铝基)"), + Tuples.of("2", "新能源产业"), + Tuples.of("3", "农业资源转化产业 (农产品精深加工)"), + Tuples.of("4", "现代服务业"), + Tuples.of("5", "绿色算力产业"), + Tuples.of("6", "纺织服装产业"), + Tuples.of("7", "先进装备制造"), + Tuples.of("8", "生物医药") ))); /** - * 重点产业Map + * 产业Map */ - public static final Map MAJOR_SECTOR_MAP = - Collections.unmodifiableMap(MAJOR_SECTOR_LIST.stream() + public static final Map SECTOR_MAP = + Collections.unmodifiableMap(SECTOR_LIST.stream() .collect(Collectors.toMap( Tuple2::getT1, Tuple2::getT2 @@ -174,32 +174,11 @@ public class CommonConstant { Tuple2::getT2 ))); - /** - * 产业列表 - */ - public static final List> SECTOR_LIST = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "新材料"), - Tuples.of("2", "新能源"), - Tuples.of("3", "现代服务业"), - Tuples.of("4", "先进服务"), - Tuples.of("5", "数字经济"), - Tuples.of("6", "农业") - ))); - /** - * 产业Map - */ - public static final Map SECTOR_MAP = - Collections.unmodifiableMap(SECTOR_LIST.stream() - .collect(Collectors.toMap( - Tuple2::getT1, - Tuple2::getT2 - ))); /** * 重点群体列表 */ - public static final List> KEY_GROUP_LIST = + public static final List> GROUP_TYPE_LIST = Collections.unmodifiableList(new ArrayList<>(Arrays.asList( Tuples.of("1", "失业人员"), Tuples.of("2", "高校毕业生"), @@ -208,6 +187,15 @@ public class CommonConstant { Tuples.of("5", "零就业家庭"), Tuples.of("6", "其他重点人群") ))); + /** + * 重点群体Map + */ + public static final Map GROUP_TYPE_MAP = + Collections.unmodifiableMap(GROUP_TYPE_LIST.stream() + .collect(Collectors.toMap( + Tuple2::getT1, + Tuple2::getT2 + ))); /** diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisSectorOccupationSkillController.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisSectorOccupationSkillController.java index 6083c67..f517e33 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisSectorOccupationSkillController.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/AnalysisSectorOccupationSkillController.java @@ -87,15 +87,4 @@ public class AnalysisSectorOccupationSkillController { public AjaxResult talentSkillLevelDistribution(@RequestBody QueryParamDto dto) { return AjaxResult.success(analysisSectorOccupationSkillService.talentSkillLevelDistribution(dto)); } - - /** - * 热力图 - * - * @param dto 查询参数 - * @return 热力图列表 - */ - @PostMapping("/heatmap") - public AjaxResult heatmap(@RequestBody QueryParamDto dto) { - return AjaxResult.success(analysisSectorOccupationSkillService.heatmap(dto)); - } } \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEmploymentRegisterMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEmploymentRegisterMapper.java index f5c8267..07aab24 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEmploymentRegisterMapper.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEmploymentRegisterMapper.java @@ -26,7 +26,7 @@ public interface ThemeEmploymentRegisterMapper { * @param dto 查询参数 * @return 人数 */ - Long queryEmploymentCount(QueryParamDto dto); + Long queryCount(QueryParamDto dto); /** * 获取各种就业登记人数 @@ -181,4 +181,12 @@ public interface ThemeEmploymentRegisterMapper { * @return 数 */ List queryEmploymentCountByJobType(QueryParamDto dto); + + /** + * 查询各岗位类型就业人数 + * + * @param dto 查询参数 + * @return 数 + */ + List queryAverageSalaryBySector(QueryParamDto dto); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeKeyGroupMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeKeyGroupMapper.java new file mode 100644 index 0000000..df0bc91 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeKeyGroupMapper.java @@ -0,0 +1,26 @@ +package com.ruoyi.cms.mapper; + +import com.ruoyi.cms.domain.dto.QueryParamDto; +import com.ruoyi.cms.domain.vo.QueryResultVo; + +import java.util.List; + +/** + * 重点群体主题库 + * + * @author 马宝龙 + * @date 2026/7/13 + */ +public interface ThemeKeyGroupMapper { + + + + + /** + * 重点产业招聘需求对比 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List queryByGroupType(QueryParamDto dto); +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeProfessionalTrainMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeProfessionalTrainMapper.java index 2cb098a..6d55a17 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeProfessionalTrainMapper.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeProfessionalTrainMapper.java @@ -21,6 +21,22 @@ public interface ThemeProfessionalTrainMapper { */ Long queryCount(QueryParamDto dto); + /** + * 查询培训后就业人数 + * + * @param dto 查询参数 + * @return 结果 + */ + Long queryAfterTrainEmploymentCount(QueryParamDto dto); + + /** + * 查询高级技能人才人数 + * + * @param dto 查询参数 + * @return 结果 + */ + Long queryAdvanceSkillTalentCount(QueryParamDto dto); + /** * 通过技能等级查询 * @@ -28,4 +44,20 @@ public interface ThemeProfessionalTrainMapper { * @return 结果列表 */ List queryBySkillLevel(QueryParamDto dto); + + /** + * 重点产业招聘需求对比 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List queryBySector(QueryParamDto dto); + + /** + * 重点产业招聘需求对比 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List queryByGroupType(QueryParamDto dto); } \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeRecruitmentJobMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeRecruitmentJobMapper.java index d9c20c1..c2ba594 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeRecruitmentJobMapper.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeRecruitmentJobMapper.java @@ -155,7 +155,7 @@ public interface ThemeRecruitmentJobMapper { * @param dto 查询参数 * @return 结果列表 */ - List majorSectorRecruitment(QueryParamDto dto); + List queryBySector(QueryParamDto dto); /** @@ -164,7 +164,7 @@ public interface ThemeRecruitmentJobMapper { * @param dto 查询参数 * @return 趋势列表 */ - List majorSectorLaborForceTreadYear(QueryParamDto dto); + List queryBySectorTreadYear(QueryParamDto dto); /** * 重点监测行业劳动力动态走势 - 季度 @@ -172,7 +172,7 @@ public interface ThemeRecruitmentJobMapper { * @param dto 查询参数 * @return 趋势列表 */ - List majorSectorLaborForceTreadQuarter(QueryParamDto dto); + List queryBySectorTreadQuarter(QueryParamDto dto); /** * 重点监测行业劳动力动态走势 - 月度 @@ -180,7 +180,7 @@ public interface ThemeRecruitmentJobMapper { * @param dto 查询参数 * @return 趋势列表 */ - List majorSectorLaborForceTreadMonth(QueryParamDto dto); + List queryBySectorTreadMonth(QueryParamDto dto); /** * 不同类型企业用工规模 @@ -221,12 +221,4 @@ public interface ThemeRecruitmentJobMapper { * @return 结果列表 */ List commitmentSalary(QueryParamDto dto); - - /** - * 人才需求结构分析 - 产业 - * - * @param dto 查询参数 - * @return 结果列表 - */ - List queryBySector(QueryParamDto dto); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeUnemploymentRegisterMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeUnemploymentRegisterMapper.java index 5b79d45..a4a635c 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeUnemploymentRegisterMapper.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeUnemploymentRegisterMapper.java @@ -22,7 +22,7 @@ public interface ThemeUnemploymentRegisterMapper { * @param dto 查询参数 * @return 人数 */ - Long queryUnemploymentCount(QueryParamDto dto); + Long queryCount(QueryParamDto dto); /** * 失业增长趋势 - 年度 diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisSectorOccupationSkillService.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisSectorOccupationSkillService.java index 3541fdc..3883498 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisSectorOccupationSkillService.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/AnalysisSectorOccupationSkillService.java @@ -65,12 +65,4 @@ public interface AnalysisSectorOccupationSkillService { * @return 结果列表 */ List talentSkillLevelDistribution(QueryParamDto dto); - - /** - * 热力图 - * - * @param dto 查询参数 - * @return 热力图列表 - */ - List heatmap(QueryParamDto dto); } \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisExportServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisExportServiceImpl.java index 2a0f072..fe244bc 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisExportServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisExportServiceImpl.java @@ -13,6 +13,8 @@ import com.ruoyi.cms.domain.vo.LaborForceRecruitmentDemandOverviewVo; 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.domain.vo.SectorOccupationSkillGapVo; +import com.ruoyi.cms.domain.vo.SectorOccupationSkillOverviewVo; import com.ruoyi.cms.domain.vo.SectorTalentOverviewVo; import com.ruoyi.cms.domain.vo.SectorTalentProsperityIndexVo; import com.ruoyi.cms.domain.vo.SectorTalentTreadVo; @@ -22,6 +24,7 @@ import com.ruoyi.cms.service.AnalysisGraduateEmploymentInfoService; import com.ruoyi.cms.service.AnalysisIndustryEmploymentInfoService; import com.ruoyi.cms.service.AnalysisLaborForceRecruitmentDemandService; import com.ruoyi.cms.service.AnalysisMajorIndustryEmploymentMonitorService; +import com.ruoyi.cms.service.AnalysisSectorOccupationSkillService; import com.ruoyi.cms.service.AnalysisSectorTalentService; import com.ruoyi.cms.util.document.ExcelUtil; import com.ruoyi.cms.util.document.MultiSheetExcelUtil; @@ -59,6 +62,7 @@ public class AnalysisExportServiceImpl implements AnalysisExportService { private final AnalysisMajorIndustryEmploymentMonitorService analysisMajorIndustryEmploymentMonitorService; private final AnalysisLaborForceRecruitmentDemandService analysisLaborForceRecruitmentDemandService; private final AnalysisSectorTalentService analysisSectorTalentService; + private final AnalysisSectorOccupationSkillService analysisSectorOccupationSkillService; @Override public void exportData(HttpServletResponse response, QueryParamDto dto) { @@ -109,7 +113,7 @@ public class AnalysisExportServiceImpl implements AnalysisExportService { break; // 智慧就业大数据分析展示系统-产业与人才供需技能提升分析 case WISDOM_EMPLOYMENT_SECTOR_TALENT_SKILL: - test(response, dto); + exportSectorOccupationSkill(response, dto); break; // 智慧就业大数据分析展示系统-重点人群跟踪服务情况分析 case WISDOM_EMPLOYMENT_KEY_GROUP_SERVICE_SITUATION: @@ -985,6 +989,163 @@ public class AnalysisExportServiceImpl implements AnalysisExportService { } + /** + * 导出 产业发展与人才供需分析 + * + * @param response 响应 + * @param dto 查询参数 + * @throws IOException 异常 + */ + private void exportSectorOccupationSkill(HttpServletResponse response, QueryParamDto dto) throws IOException { + + MultiSheetExcelUtil multiSheetExcelUtil = new MultiSheetExcelUtil(); + + String exportTime = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS); + + // 数据总览 + List basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("导出时间", exportTime)); + basicExportList.add(new ExcelRow("数据总览")); + basicExportList.add(new ExcelRow("指标名称(单位)", "指标值", "较上期变化(%)")); + QueryParamDto newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + SectorOccupationSkillOverviewVo overview = + analysisSectorOccupationSkillService.overview(newParam); + + basicExportList.add(new ExcelRow( + "技能培训总人数(人)", transform(overview.getSkillTrainCount()), + transform(overview.getSkillTrainCountMom()) + )); + basicExportList.add(new ExcelRow( + "培训覆盖率(%)", transform(overview.getTrainCoverageRate()), + transform(overview.getTrainCoverageRateMom()) + )); + basicExportList.add(new ExcelRow( + "平均薪资(元)", transform(overview.getAverageSalary()), + transform(overview.getAverageSalaryMom()) + )); + basicExportList.add(new ExcelRow( + "培训后就业率(%)", transform(overview.getAfterTrainEmploymentRate()), + transform(overview.getAfterTrainEmploymentRateMom()) + )); + basicExportList.add(new ExcelRow( + "高级技能人才人数(人)", transform(overview.getAdvanceSkillTalentCount()), + transform(overview.getAdvanceSkillTalentCountMom()) + )); + basicExportList.add(new ExcelRow( + "新兴技能缺口(人)", transform(overview.getNewSkillGapCount()), + transform(overview.getNewSkillGapCountMom()) + )); + + // 创建Excel工具类并添加工作表 + ExcelUtil basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("数据总览"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + // 产业发展与人才需求趋势 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("产业发展与人才需求趋势")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + EchartsVo echarts = analysisSectorOccupationSkillService.sectorAndTalentDemandTread(newParam); + List xAxis = echarts.getXAxis(); + xAxis.add(0, "产业\\时间"); + basicExportList.add(new ExcelRow(xAxis.toArray(new String[0]))); + for (EchartsSeriesVo vo : echarts.getSeries()) { + List dataList = vo.getData(); + List dataStr = new ArrayList<>(); + dataStr.add(vo.getName()); + dataList.forEach(data -> dataStr.add(transform(Optional.ofNullable(data).orElse(0L)))); + basicExportList.add(new ExcelRow(dataStr.toArray(new String[0]))); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("产业发展与人才需求趋势"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + // 重点产业的核心职业技能需求 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("重点产业的核心职业技能需求")); + basicExportList.add(new ExcelRow("产业", "薪资水平(元)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + List resultList = analysisSectorOccupationSkillService.coreSkillDemand(newParam); + for (QueryResultVo result : resultList) { + basicExportList.add(new ExcelRow( + result.getDesc(), transform(result.getAmount()) + )); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("重点产业的核心职业技能需求"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + // 职业技能供给与缺口分析 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("职业技能供给与缺口分析")); + basicExportList.add(new ExcelRow("产业", "招聘需求(人)", "培训供给(人)", "缺口数量(人)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + List skillGapList = + analysisSectorOccupationSkillService.skillSupplyAndGap(newParam); + for (SectorOccupationSkillGapVo skillGap : skillGapList) { + basicExportList.add(new ExcelRow( + skillGap.getDesc(), transform(skillGap.getRecruitmentDemandCount()), + transform(skillGap.getTrainSupplyCount()), transform(skillGap.getGapCount()) + )); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("职业技能供给与缺口分析"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + // 重点群体技能培训覆盖率 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("重点群体技能培训覆盖率")); + basicExportList.add(new ExcelRow("人员类型", "人员总数(人)", "培训人数(人)", "覆盖率(%)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + resultList = analysisSectorOccupationSkillService.keyGroupSkillCoverageRate(newParam); + for (QueryResultVo result : resultList) { + basicExportList.add(new ExcelRow( + result.getDesc(), transform(result.getCount()), transform(result.getAnotherCount()), + transform(result.getRate()) + )); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("重点群体技能培训覆盖率"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + // 职业培训技能人才等级分布 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("职业培训技能人才等级分布")); + basicExportList.add(new ExcelRow("技能等级", "人数(人)", "占比(%)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + resultList = analysisSectorOccupationSkillService.talentSkillLevelDistribution(newParam); + for (QueryResultVo result : resultList) { + basicExportList.add(new ExcelRow( + result.getDesc(), transform(result.getCount()), transform(result.getCountPercentage()) + )); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("职业培训技能人才等级分布"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + + multiSheetExcelUtil.setFileName(dto.getExportModule().getDesc()); + multiSheetExcelUtil.exportExcel(response); + + } + /** * 导出 行业就业情况信息分析 diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisIndustryEmploymentInfoServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisIndustryEmploymentInfoServiceImpl.java index 485dead..72d8837 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisIndustryEmploymentInfoServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisIndustryEmploymentInfoServiceImpl.java @@ -46,9 +46,9 @@ public class AnalysisIndustryEmploymentInfoServiceImpl implements AnalysisIndust // 计算当前时间段数据 ParamUtil.dealParam(dto); - Long employmentCount = themeEmploymentRegisterMapper.queryEmploymentCount(dto); + Long employmentCount = themeEmploymentRegisterMapper.queryCount(dto); - Long unemploymentCount = themeUnemploymentRegisterMapper.queryUnemploymentCount(dto); + Long unemploymentCount = themeUnemploymentRegisterMapper.queryCount(dto); BigDecimal unemploymentRate = MathUtil.calculatePercentage( (Optional.ofNullable(unemploymentCount).orElse(0L) + Optional.ofNullable(employmentCount).orElse(0L)), unemploymentCount); @@ -67,9 +67,9 @@ public class AnalysisIndustryEmploymentInfoServiceImpl implements AnalysisIndust QueryParamDto lastDto = new QueryParamDto(); BeanUtils.copyProperties(dto, lastDto); ParamUtil.calculateLastTime(lastDto); - Long lastEmploymentCount = themeEmploymentRegisterMapper.queryEmploymentCount(lastDto); + Long lastEmploymentCount = themeEmploymentRegisterMapper.queryCount(lastDto); - Long lastUnemploymentCount = themeUnemploymentRegisterMapper.queryUnemploymentCount(lastDto); + Long lastUnemploymentCount = themeUnemploymentRegisterMapper.queryCount(lastDto); BigDecimal lastUnemploymentRate = MathUtil.calculatePercentage( (Optional.ofNullable(lastUnemploymentCount).orElse(0L) + Optional.ofNullable(lastEmploymentCount).orElse(0L)), lastUnemploymentCount); diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisKeyGroupServiceSituationServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisKeyGroupServiceSituationServiceImpl.java index 0dc7021..b984e15 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisKeyGroupServiceSituationServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisKeyGroupServiceSituationServiceImpl.java @@ -14,7 +14,6 @@ import com.ruoyi.cms.domain.vo.QueryResultVo; import com.ruoyi.cms.service.AnalysisKeyGroupServiceSituationService; import com.ruoyi.cms.util.PageUtil; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.DateUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -220,7 +219,7 @@ public class AnalysisKeyGroupServiceSituationServiceImpl implements AnalysisKeyG public List keyGroupTypeList() { List list = new ArrayList<>(); - for (Tuple2 industry : CommonConstant.KEY_GROUP_LIST) { + for (Tuple2 industry : CommonConstant.GROUP_TYPE_LIST) { list.add(DictVo.builder().code(industry.getT1()).desc(industry.getT2()).build()); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisLaborForceRecruitmentDemandServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisLaborForceRecruitmentDemandServiceImpl.java index 99bc0a8..149cfc9 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisLaborForceRecruitmentDemandServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisLaborForceRecruitmentDemandServiceImpl.java @@ -181,9 +181,9 @@ public class AnalysisLaborForceRecruitmentDemandServiceImpl implements AnalysisL public List majorIndustryRecruitment(QueryParamDto dto) { dealParam(dto); - List list = themeRecruitmentJobMapper.majorSectorRecruitment(dto); + List list = themeRecruitmentJobMapper.queryBySector(dto); MathUtil.calculatePercentage(list); - ParamUtil.fillDictName(list, "majorSector"); + ParamUtil.fillDictName(list, "sector"); return list; } @@ -191,9 +191,7 @@ public class AnalysisLaborForceRecruitmentDemandServiceImpl implements AnalysisL @Override public EchartsVo majorIndustryLaborForceTread(QueryParamDto dto) { - ParamUtil.dealParam(dto); - EchartsVo vo; List list; switch (dto.getQueryTimeType()) { @@ -201,25 +199,25 @@ public class AnalysisLaborForceRecruitmentDemandServiceImpl implements AnalysisL dto.setStartTime(LocalDateTime.of(dto.getYear(), 1, 1, 0, 0, 0) .minusYears(5L)); dto.setEndTime(LocalDateTime.of(dto.getYear(), 12, 31, 23, 59, 59)); - list = themeRecruitmentJobMapper.majorSectorLaborForceTreadYear(dto); + list = themeRecruitmentJobMapper.queryBySectorTreadYear(dto); vo = transform(list,false); - ParamUtil.fillDictName(vo, "majorSector"); + ParamUtil.fillDictName(vo, "sector"); break; } case QUARTER: { dto.setStartTime(LocalDateTime.of(dto.getYear(), 1, 1, 0, 0, 0)); dto.setEndTime(LocalDateTime.of(dto.getYear(), 12, 31, 23, 59, 59)); - list = themeRecruitmentJobMapper.majorSectorLaborForceTreadQuarter(dto); + list = themeRecruitmentJobMapper.queryBySectorTreadQuarter(dto); vo = transform(list,false); - ParamUtil.fillDictName(vo, "majorSector"); + ParamUtil.fillDictName(vo, "sector"); break; } case MONTH: { dto.setStartTime(LocalDateTime.of(dto.getYear(), 1, 1, 0, 0, 0)); dto.setEndTime(LocalDateTime.of(dto.getYear(), 12, 31, 23, 59, 59)); - list = themeRecruitmentJobMapper.majorSectorLaborForceTreadMonth(dto); + list = themeRecruitmentJobMapper.queryBySectorTreadMonth(dto); vo = transform(list,false); - ParamUtil.fillDictName(vo, "majorSector"); + ParamUtil.fillDictName(vo, "sector"); break; } default: 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 index d9d87a0..0cd5561 100644 --- 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 @@ -76,9 +76,9 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys Long employmentDemandCount = themeRecruitmentJobMapper.queryDemandCount(dto); - Long unemploymentCount = themeUnemploymentRegisterMapper.queryUnemploymentCount(dto); + Long unemploymentCount = themeUnemploymentRegisterMapper.queryCount(dto); - Long employmentCount = themeEmploymentRegisterMapper.queryEmploymentCount(dto); + Long employmentCount = themeEmploymentRegisterMapper.queryCount(dto); BigDecimal unemploymentRate = MathUtil.calculatePercentage( (Optional.ofNullable(unemploymentCount).orElse(0L) + Optional.ofNullable(employmentCount).orElse(0L)), unemploymentCount); @@ -96,9 +96,9 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys Long lastEmploymentDemandCount = themeRecruitmentJobMapper.queryDemandCount(lastDto); - Long lastUnemploymentCount = themeUnemploymentRegisterMapper.queryUnemploymentCount(lastDto); + Long lastUnemploymentCount = themeUnemploymentRegisterMapper.queryCount(lastDto); - Long lastEmploymentCount = themeEmploymentRegisterMapper.queryEmploymentCount(lastDto); + Long lastEmploymentCount = themeEmploymentRegisterMapper.queryCount(lastDto); BigDecimal lastUnemploymentRate = MathUtil.calculatePercentage( (Optional.ofNullable(lastUnemploymentCount).orElse(0L) + Optional.ofNullable(lastEmploymentCount).orElse(0L)), lastUnemploymentCount); diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisSectorOccupationSkillServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisSectorOccupationSkillServiceImpl.java index e3eabe4..bbcad96 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisSectorOccupationSkillServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisSectorOccupationSkillServiceImpl.java @@ -1,29 +1,39 @@ 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.EchartsSeriesVo; import com.ruoyi.cms.domain.vo.EchartsVo; -import com.ruoyi.cms.domain.vo.HeatmapVo; import com.ruoyi.cms.domain.vo.QueryResultVo; import com.ruoyi.cms.domain.vo.SectorOccupationSkillGapVo; import com.ruoyi.cms.domain.vo.SectorOccupationSkillOverviewVo; +import com.ruoyi.cms.domain.vo.TreadVo; +import com.ruoyi.cms.mapper.ThemeEmploymentRegisterMapper; +import com.ruoyi.cms.mapper.ThemeKeyGroupMapper; +import com.ruoyi.cms.mapper.ThemeProfessionalTrainMapper; +import com.ruoyi.cms.mapper.ThemeRecruitmentJobMapper; +import com.ruoyi.cms.mapper.ThemeUnemploymentRegisterMapper; import com.ruoyi.cms.service.AnalysisSectorOccupationSkillService; import com.ruoyi.cms.util.MathUtil; +import com.ruoyi.cms.util.ParamUtil; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.bean.BeanUtils; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; 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.time.LocalDateTime; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.IntStream; /** * 产业发展与职业技能提升分析 @@ -34,147 +44,272 @@ import java.util.stream.IntStream; @Service @Validated @Slf4j +@RequiredArgsConstructor public class AnalysisSectorOccupationSkillServiceImpl implements AnalysisSectorOccupationSkillService { + private final ThemeEmploymentRegisterMapper themeEmploymentRegisterMapper; + private final ThemeUnemploymentRegisterMapper themeUnemploymentRegisterMapper; + private final ThemeRecruitmentJobMapper themeRecruitmentJobMapper; + private final ThemeProfessionalTrainMapper themeProfessionalTrainMapper; + private final ThemeKeyGroupMapper themeKeyGroupMapper; + + @Override public SectorOccupationSkillOverviewVo overview(QueryParamDto dto) { + + // 计算当前时间数据 + ParamUtil.dealParam(dto); + Long skillTrainCount = themeProfessionalTrainMapper.queryCount(dto); + + Long employmentCount = Optional.ofNullable(themeEmploymentRegisterMapper.queryCount(dto)) + .orElse(0L); + Long unemploymentCount = Optional.ofNullable(themeUnemploymentRegisterMapper.queryCount(dto)) + .orElse(0L); + BigDecimal trainCoverageRate = MathUtil.calculatePercentage((employmentCount + unemploymentCount), + skillTrainCount); + + BigDecimal averageSalary = themeEmploymentRegisterMapper.queryAverageSalary(dto); + + Long afterTrainEmploymentCount = themeProfessionalTrainMapper.queryAfterTrainEmploymentCount(dto); + BigDecimal afterTrainEmploymentRate = MathUtil.calculatePercentage(skillTrainCount, + afterTrainEmploymentCount); + + Long advanceSkillTalentCount = themeProfessionalTrainMapper.queryAdvanceSkillTalentCount(dto); + + // 计算上一时间段数据 + QueryParamDto lastDto = new QueryParamDto(); + BeanUtils.copyProperties(dto, lastDto); + ParamUtil.calculateLastTime(lastDto); + Long lastSkillTrainCount = themeProfessionalTrainMapper.queryCount(lastDto); + + Long lastEmploymentCount = Optional.ofNullable(themeEmploymentRegisterMapper.queryCount(lastDto)) + .orElse(0L); + Long lastUnemploymentCount = Optional.ofNullable(themeUnemploymentRegisterMapper.queryCount(lastDto)) + .orElse(0L); + BigDecimal lastTrainCoverageRate = MathUtil.calculatePercentage((lastEmploymentCount + lastUnemploymentCount), + lastSkillTrainCount); + + BigDecimal lastAverageSalary = themeEmploymentRegisterMapper.queryAverageSalary(lastDto); + + Long lastAfterTrainEmploymentCount = themeProfessionalTrainMapper.queryAfterTrainEmploymentCount(lastDto); + BigDecimal lastAfterTrainEmploymentRate = MathUtil.calculatePercentage(lastSkillTrainCount, + lastAfterTrainEmploymentCount); + + Long lastAdvanceSkillTalentCount = themeProfessionalTrainMapper.queryAdvanceSkillTalentCount(lastDto); + return SectorOccupationSkillOverviewVo.builder() - .skillTrainCount(25000L) - .skillTrainCountMom(BigDecimal.valueOf(8.5)) - .trainCoverageRate(BigDecimal.valueOf(68.3)) - .trainCoverageRateMom(BigDecimal.valueOf(3.2)) - .averageSalary(BigDecimal.valueOf(6850.50)) - .averageSalaryMom(BigDecimal.valueOf(4.2)) - .afterTrainEmploymentRate(BigDecimal.valueOf(82.5)) - .afterTrainEmploymentRateMom(BigDecimal.valueOf(2.1)) - .advanceSkillTalentCount(5800L) - .advanceSkillTalentCountMom(BigDecimal.valueOf(6.8)) - .newSkillGapCount(3200L) - .newSkillGapCountMom(BigDecimal.valueOf(-2.5)) + .skillTrainCount(skillTrainCount) + .skillTrainCountMom( + MathUtil.calculatePercentageGrowthRate(lastSkillTrainCount, skillTrainCount)) + .trainCoverageRate(trainCoverageRate) + .trainCoverageRateMom(MathUtil.calculatePercentageGrowthRate(lastTrainCoverageRate, trainCoverageRate)) + .averageSalary(averageSalary) + .averageSalaryMom(MathUtil.calculatePercentageGrowthRate(lastAverageSalary, averageSalary)) + .afterTrainEmploymentRate(afterTrainEmploymentRate) + .afterTrainEmploymentRateMom( + MathUtil.calculatePercentageGrowthRate(lastAfterTrainEmploymentRate, afterTrainEmploymentRate)) + .advanceSkillTalentCount(advanceSkillTalentCount) + .advanceSkillTalentCountMom( + MathUtil.calculatePercentageGrowthRate(lastAdvanceSkillTalentCount, advanceSkillTalentCount)) + .newSkillGapCount(0L) + .newSkillGapCountMom(BigDecimal.valueOf(0)) .build(); } @Override public EchartsVo sectorAndTalentDemandTread(QueryParamDto dto) { - List xAxis = IntStream.rangeClosed(1, 12) - .mapToObj(i -> i + "月") - .collect(Collectors.toList()); - List series = new ArrayList<>(); - for (Tuple2 sector : CommonConstant.SECTOR_LIST) { - List dataList = new ArrayList<>(); - for (int i = 0; i < 12; i++) { - dataList.add((long) Math.floor(Math.random() * 20000) + 5000); + ParamUtil.dealParam(dto); + EchartsVo vo; + List list; + switch (dto.getQueryTimeType()) { + case YEAR: { + dto.setStartTime(LocalDateTime.of(dto.getYear(), 1, 1, 0, 0, 0) + .minusYears(5L)); + dto.setEndTime(LocalDateTime.of(dto.getYear(), 12, 31, 23, 59, 59)); + list = themeRecruitmentJobMapper.queryBySectorTreadYear(dto); + vo = transform(list, false); + ParamUtil.fillDictName(vo, "sector"); + break; } - series.add(EchartsSeriesVo.builder().name(sector.getT2()).data(dataList).build()); + case QUARTER: { + dto.setStartTime(LocalDateTime.of(dto.getYear(), 1, 1, 0, 0, 0)); + dto.setEndTime(LocalDateTime.of(dto.getYear(), 12, 31, 23, 59, 59)); + list = themeRecruitmentJobMapper.queryBySectorTreadQuarter(dto); + vo = transform(list, false); + ParamUtil.fillDictName(vo, "sector"); + break; + } + case MONTH: { + dto.setStartTime(LocalDateTime.of(dto.getYear(), 1, 1, 0, 0, 0)); + dto.setEndTime(LocalDateTime.of(dto.getYear(), 12, 31, 23, 59, 59)); + list = themeRecruitmentJobMapper.queryBySectorTreadMonth(dto); + vo = transform(list, false); + ParamUtil.fillDictName(vo, "sector"); + break; + } + default: + throw new ServiceException("时间类型错误"); + } + return vo; + } + + private EchartsVo transform(List list, boolean isCode) { + + EchartsVo vo = EchartsVo.builder() + .xAxis(new ArrayList<>()) + .series(new ArrayList<>()) + .build(); + if (CollectionUtils.isEmpty(list)) { + return vo; } - return EchartsVo.builder().xAxis(xAxis).series(series).build(); + Map> anotherCodeMap = new HashMap<>(); + for (TreadVo tread : list) { + if (StringUtils.isBlank(tread.getAnotherCode())) { + continue; + } + if (!anotherCodeMap.containsKey(tread.getAnotherCode())) { + anotherCodeMap.put(tread.getAnotherCode(), new ArrayList<>()); + } + anotherCodeMap.get(tread.getAnotherCode()).add(tread); + } + + List xAxis; + if (isCode) { + xAxis = anotherCodeMap.values().stream() + .findFirst() + .map(firstGroup -> firstGroup.stream() + .map(TreadVo::getCode) + .collect(Collectors.toList())) + .orElse(new ArrayList<>()); + } else { + xAxis = anotherCodeMap.values().stream() + .findFirst() + .map(firstGroup -> firstGroup.stream() + .map(TreadVo::getDesc) + .collect(Collectors.toList())) + .orElse(new ArrayList<>()); + } + + List series = new ArrayList<>(); + for (Map.Entry> entry : anotherCodeMap.entrySet()) { + List dataList = new ArrayList<>(); + for (TreadVo tread : entry.getValue()) { + dataList.add(tread.getCurrentCount()); + } + series.add(EchartsSeriesVo.builder() + .name(entry.getKey()) + .data(dataList) + .build()); + } + + vo.setXAxis(xAxis); + vo.setSeries(series); + return vo; } @Override public List coreSkillDemand(QueryParamDto dto) { - List list = new ArrayList<>(); - List> skillList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "光伏技术"), - Tuples.of("2", "化工工艺"), - Tuples.of("3", "机械设计"), - Tuples.of("4", "食品工艺"), - Tuples.of("5", "纺织工艺"), - Tuples.of("6", "数据中心运维") - ))); - for (Tuple2 skill : skillList) { - list.add(QueryResultVo.builder() - .code(skill.getT1()) - .desc(skill.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + + List list = themeEmploymentRegisterMapper.queryAverageSalaryBySector(dto); + ParamUtil.fillDictName(list, "sector"); + return list; } @Override public List skillSupplyAndGap(QueryParamDto dto) { + + ParamUtil.dealParam(dto); + + List demandList = themeRecruitmentJobMapper.queryBySector(dto); + + List trainSupplyList = themeProfessionalTrainMapper.queryBySector(dto); + + Set sectorSet = new HashSet<>(); + Map demandMap = new HashMap<>(); + for (QueryResultVo queryResultVo : demandList) { + sectorSet.add(queryResultVo.getCode()); + demandMap.put(queryResultVo.getCode(), queryResultVo); + } + Map trainSupplyMap = new HashMap<>(); + for (QueryResultVo queryResultVo : trainSupplyList) { + sectorSet.add(queryResultVo.getCode()); + trainSupplyMap.put(queryResultVo.getCode(), queryResultVo); + } + List list = new ArrayList<>(); - for (Tuple2 sector : CommonConstant.SECTOR_LIST) { - long demand = (long) Math.floor(Math.random() * 10000) + 500; - long supply = (long) Math.floor(Math.random() * 5000) + 100; + for (String sector : sectorSet) { + QueryResultVo demand = Optional.ofNullable(demandMap.get(sector)) + .orElse(QueryResultVo.builder().build()); + QueryResultVo trainSupply = Optional.ofNullable(trainSupplyMap.get(sector)) + .orElse(QueryResultVo.builder().build()); + long demandCount = Optional.ofNullable(demand.getCount()).orElse(0L); + long trainSupplyCount = Optional.ofNullable(trainSupply.getCount()) + .orElse(0L); list.add(SectorOccupationSkillGapVo.builder() - .code(sector.getT1()) - .desc(sector.getT2()) - .recruitmentDemandCount(demand) - .trainSupplyCount(supply) - .gapCount((demand - supply) > 0 ? demand - supply : 0) + .code(sector) + .desc(ParamUtil.fillDictName(sector, "sector")) + .recruitmentDemandCount(demandCount) + .trainSupplyCount(trainSupplyCount) + .gapCount((demandCount - trainSupplyCount) > 0 ? demandCount - trainSupplyCount : 0) .build()); } + return list; } @Override public List keyGroupSkillCoverageRate(QueryParamDto dto) { + + ParamUtil.dealParam(dto); + + List groupList = themeKeyGroupMapper.queryByGroupType(dto); + + List trainList = themeProfessionalTrainMapper.queryByGroupType(dto); + + Set groupTypeSet = new HashSet<>(); + Map groupMap = new HashMap<>(); + for (QueryResultVo queryResultVo : groupList) { + groupTypeSet.add(queryResultVo.getCode()); + groupMap.put(queryResultVo.getCode(), queryResultVo); + } + Map trainMap = new HashMap<>(); + for (QueryResultVo queryResultVo : trainList) { + groupTypeSet.add(queryResultVo.getCode()); + trainMap.put(queryResultVo.getCode(), queryResultVo); + } + List list = new ArrayList<>(); - List> groupList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "高校毕业生"), - Tuples.of("2", "失业人员"), - Tuples.of("3", "残疾人"), - Tuples.of("4", "低保家庭"), - Tuples.of("5", "零就业家庭"), - Tuples.of("6", "其他重点群体") - ))); - for (Tuple2 group : groupList) { + for (String sector : groupTypeSet) { + QueryResultVo group = Optional.ofNullable(groupMap.get(sector)) + .orElse(QueryResultVo.builder().build()); + QueryResultVo train = Optional.ofNullable(trainMap.get(sector)) + .orElse(QueryResultVo.builder().build()); + long groupCount = Optional.ofNullable(group.getCount()).orElse(0L); + long trainCount = Optional.ofNullable(train.getCount()) + .orElse(0L); list.add(QueryResultVo.builder() - .code(group.getT1()) - .desc(group.getT2()) - .count((long) Math.floor(Math.random() * 20000) + 5000) - .anotherCount((long) Math.floor(Math.random() * 20000) + 5000) - .rate(BigDecimal.valueOf(Math.random() * 100 + 1).setScale(1, RoundingMode.HALF_UP)) + .code(sector) + .count(groupCount) + .anotherCount(trainCount) + .rate(MathUtil.calculatePercentage(groupCount, trainCount)) .build()); } + ParamUtil.fillDictName(list, "groupType"); return list; } @Override public List talentSkillLevelDistribution(QueryParamDto dto) { - List list = new ArrayList<>(); - List> skillLevelList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "初级工及其他"), - Tuples.of("2", "中级工"), - Tuples.of("3", "高级工"), - Tuples.of("4", "技师/高级技师") - ))); - for (Tuple2 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 heatmap(QueryParamDto dto) { - List list = new ArrayList<>(); - for (Tuple2 area : CommonConstant.AREA_LIST) { - list.add(HeatmapVo.builder() - .areaCode(area.getT1()) - .areaName(area.getT2()) - .count((long) Math.floor(Math.random() * 10000) + 1) - .build()); - } - long totalCount = list.stream().mapToLong(HeatmapVo::getCount).sum(); - for (HeatmapVo vo : list) { - if (totalCount > 0) { - vo.setPercentage(new BigDecimal(vo.getCount()) - .divide(BigDecimal.valueOf(totalCount), 4, RoundingMode.HALF_UP) - .multiply(BigDecimal.valueOf(100)) - .setScale(2, RoundingMode.HALF_UP)); - } - } + ParamUtil.dealParam(dto); + List list = themeProfessionalTrainMapper.queryBySkillLevel(dto); + MathUtil.calculatePercentage(list); + return list; } } \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisSectorTalentServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisSectorTalentServiceImpl.java index 0e23c9d..35aec53 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisSectorTalentServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisSectorTalentServiceImpl.java @@ -1,6 +1,5 @@ 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.MajorIndustryEmploymentMonitorTreadVo; @@ -22,10 +21,8 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; -import reactor.util.function.Tuple2; import java.math.BigDecimal; -import java.math.RoundingMode; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Comparator; diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/util/ParamUtil.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/util/ParamUtil.java index 9f2fe2d..8043ed3 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/util/ParamUtil.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/util/ParamUtil.java @@ -6,7 +6,6 @@ import com.ruoyi.cms.domain.vo.EchartsSeriesVo; import com.ruoyi.cms.domain.vo.EchartsVo; import com.ruoyi.cms.domain.vo.GraduateEmploymentInfoTreadVo; import com.ruoyi.cms.domain.vo.QueryResultVo; -import com.ruoyi.cms.domain.vo.TreadVo; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.StringUtils; import org.apache.commons.collections4.CollectionUtils; @@ -184,7 +183,8 @@ public class ParamUtil { /** * 填充字典名称 - * @param code 码值 + * + * @param code 码值 * @param dictName 字典名称 * @return 字典值 */ @@ -196,9 +196,6 @@ public class ParamUtil { case "majorIndustry": { return Optional.ofNullable(CommonConstant.MAJOR_INDUSTRY_MAP.get(code)).orElse("未知"); } - case "majorSector": { - return Optional.ofNullable(CommonConstant.MAJOR_SECTOR_MAP.get(code)).orElse("未知"); - } case "sector": { return Optional.ofNullable(CommonConstant.SECTOR_MAP.get(code)).orElse("未知"); } @@ -229,6 +226,9 @@ public class ParamUtil { case "area": { return Optional.ofNullable(CommonConstant.AREA_MAP.get(code)).orElse("未知"); } + case "groupType": { + return Optional.ofNullable(CommonConstant.GROUP_TYPE_MAP.get(code)).orElse("未知"); + } default: throw new ServiceException("字典名称错误"); } diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml index 7ea509a..76c58fd 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml @@ -19,12 +19,15 @@ ) + + AND AAB023 = #{sector} + AND (ABE585 IS NULL OR ABE585 > #{endTime}) - - - - + + \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeKeyGroupMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeKeyGroupMapper.xml new file mode 100644 index 0000000..da95801 --- /dev/null +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeKeyGroupMapper.xml @@ -0,0 +1,48 @@ + + + + + + + recognition_time BETWEEN #{startTime} AND #{endTime} + + AND area_code = #{area} + + + AND industry LIKE #{industry} || '%' + + + AND ( + + industry LIKE #{industry} || '%' + + ) + + + AND sector = #{sector} + + + + + + + + \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeProfessionalTrainMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeProfessionalTrainMapper.xml index 844e19a..9613e3f 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeProfessionalTrainMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeProfessionalTrainMapper.xml @@ -8,6 +8,19 @@ AND xzqh = #{area} + + AND industry LIKE #{industry} || '%' + + + AND ( + + industry LIKE #{industry} || '%' + + ) + + + AND sector = #{sector} + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeRecruitmentJobMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeRecruitmentJobMapper.xml index 19ce4d9..f2a9ef6 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeRecruitmentJobMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeRecruitmentJobMapper.xml @@ -505,7 +505,7 @@ ORDER BY month_num; - - - - - - - \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeUnemploymentRegisterMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeUnemploymentRegisterMapper.xml index 3a28672..35263c8 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeUnemploymentRegisterMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeUnemploymentRegisterMapper.xml @@ -19,12 +19,15 @@ ) + + AND AAB023 = #{sector} + AND (ABE586 IS NULL OR ABE586 > #{endTime}) -