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 80dcf91..8d61d63 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 @@ -305,7 +305,7 @@ public class CommonConstant { /** * 岗位类型列表 */ - public static final List> JOB_TYPE_LIST = + public static final List> JOB_CATEGORY_LIST = Collections.unmodifiableList(new ArrayList<>(Arrays.asList( Tuples.of("1", "管理人员"), Tuples.of("2", "专业技术人员"), @@ -316,8 +316,8 @@ public class CommonConstant { /** * 岗位类型Map */ - public static final Map JOB_TYPE_MAP = - Collections.unmodifiableMap(JOB_TYPE_LIST.stream() + public static final Map JOB_CATEGORY_MAP = + Collections.unmodifiableMap(JOB_CATEGORY_LIST.stream() .collect(Collectors.toMap( Tuple2::getT1, Tuple2::getT2 diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEconomyIndicatorMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEconomyIndicatorMapper.java new file mode 100644 index 0000000..344201a --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEconomyIndicatorMapper.java @@ -0,0 +1,51 @@ +package com.ruoyi.cms.mapper; + +import com.ruoyi.cms.domain.dto.QueryParamDto; +import com.ruoyi.cms.domain.vo.JobDemandTreadEconomyCorrelationVo; +import com.ruoyi.cms.domain.vo.QueryResultVo; + +import java.util.List; + +/** + * 经济指标主题库 + * + * @author 马宝龙 + * @date 2026/7/14 + */ +public interface ThemeEconomyIndicatorMapper { + + + /** + * 指标趋势 - 年度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryTrendYear(QueryParamDto dto); + + /** + * 指标趋势 - 季度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryTrendQuarter(QueryParamDto dto); + + /** + * 指标趋势 - 月度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryTrendMonth(QueryParamDto dto); + + + /** + * 按月份查询GDP + * + * @param dto 查询参数 + * @return 数 + */ + List queryGdpByMonth(QueryParamDto 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 07aab24..b6ecb77 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 @@ -180,7 +180,7 @@ public interface ThemeEmploymentRegisterMapper { * @param dto 查询参数 * @return 数 */ - List queryEmploymentCountByJobType(QueryParamDto dto); + List queryEmploymentCountByJobCategory(QueryParamDto dto); /** * 查询各岗位类型就业人数 diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeJobSeekerMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeJobSeekerMapper.java index dbbabfb..6275ef6 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeJobSeekerMapper.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeJobSeekerMapper.java @@ -19,7 +19,7 @@ public interface ThemeJobSeekerMapper { * @param dto 查询参数 * @return 数 */ - Long querySupplyCount(QueryParamDto dto); + Long queryCount(QueryParamDto dto); /** * 通过产业查询 @@ -28,4 +28,29 @@ public interface ThemeJobSeekerMapper { * @return 结果列表 */ List queryBySector(QueryParamDto dto); + + + /** + * 岗位需求增长趋势 - 年度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryTrendYear(QueryParamDto dto); + + /** + * 岗位需求增长趋势 - 季度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryTrendQuarter(QueryParamDto dto); + + /** + * 岗位需求增长趋势 - 月度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryTrendMonth(QueryParamDto dto); } 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 c2ba594..f6b5f66 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 @@ -21,7 +21,7 @@ public interface ThemeRecruitmentJobMapper { * 查询监测行业数 * * @param dto 查询参数 - * @return 数 + * @return 结果 */ Long queryMonitorIndustryCount(QueryParamDto dto); @@ -29,7 +29,7 @@ public interface ThemeRecruitmentJobMapper { * 查询监测企业数 * * @param dto 查询参数 - * @return 数 + * @return 结果 */ Long queryMonitorCompanyCount(QueryParamDto dto); @@ -37,7 +37,7 @@ public interface ThemeRecruitmentJobMapper { * 查询就业需求数 * * @param dto 查询参数 - * @return 数 + * @return 结果 */ Long queryDemandCount(QueryParamDto dto); @@ -45,9 +45,16 @@ public interface ThemeRecruitmentJobMapper { * 查询招聘岗位数 * * @param dto 查询参数 - * @return 数 + * @return 结果 */ - Long queryRecruitmentJobCount(QueryParamDto dto); + Long queryJobCount(QueryParamDto dto); + + /** + * 查询技术类岗位数 + * @param dto 查询参数 + * @return 结果 + */ + Long queryTechnicalJobCount(QueryParamDto dto); /** * 查询平均薪资 @@ -81,6 +88,63 @@ public interface ThemeRecruitmentJobMapper { */ List laborDemandTrendMonth(QueryParamDto dto); + /** + * 岗位需求增长趋势 - 年度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryJobTrendYear(QueryParamDto dto); + + /** + * 岗位需求增长趋势 - 季度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryJobTrendQuarter(QueryParamDto dto); + + /** + * 岗位需求增长趋势 - 月度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryJobTrendMonth(QueryParamDto dto); + + /** + * 通过岗位分类查询岗位趋势 - 年度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryJobByJobCategoryTreadYear(QueryParamDto dto); + + /** + * 通过岗位分类查询岗位趋势 - 季度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryJobByJobCategoryTreadQuarter(QueryParamDto dto); + + /** + * 通过岗位分类查询岗位趋势 - 月度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List queryJobByJobCategoryTreadMonth(QueryParamDto dto); + + + /** + * 按月份查询岗位数 + * + * @param dto 查询参数 + * @return 数 + */ + List queryJobByMonth(QueryParamDto dto); + /** * 查询各行业就业需求数 @@ -106,7 +170,7 @@ public interface ThemeRecruitmentJobMapper { * @param dto 查询参数 * @return 数 */ - List queryEmploymentDemandCountByJobType(QueryParamDto dto); + List queryEmploymentDemandCountByJobCategory(QueryParamDto dto); /** @@ -221,4 +285,12 @@ public interface ThemeRecruitmentJobMapper { * @return 结果列表 */ List commitmentSalary(QueryParamDto dto); + + /** + * 热门岗位 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List hotJobRank(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 a4a635c..6ac80ae 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 @@ -78,7 +78,7 @@ public interface ThemeUnemploymentRegisterMapper { * @param dto 查询参数 * @return 数 */ - List queryUnemploymentCountByJobType(QueryParamDto dto); + List queryUnemploymentCountByJobCategory(QueryParamDto dto); /** * 查询各行业裁员人数 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 1838d06..833fb2e 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 @@ -9,6 +9,10 @@ import com.ruoyi.cms.domain.vo.GraduateEmploymentInfoStartupVo; import com.ruoyi.cms.domain.vo.GraduateEmploymentInfoTreadVo; import com.ruoyi.cms.domain.vo.HeatmapVo; import com.ruoyi.cms.domain.vo.IndustryEmploymentInfoOverviewVo; +import com.ruoyi.cms.domain.vo.JobDemandTreadDemandVo; +import com.ruoyi.cms.domain.vo.JobDemandTreadEconomyCorrelationVo; +import com.ruoyi.cms.domain.vo.JobDemandTreadGDPCorrelationVo; +import com.ruoyi.cms.domain.vo.JobDemandTreadOverviewVo; import com.ruoyi.cms.domain.vo.LaborForceRecruitmentDemandOverviewVo; import com.ruoyi.cms.domain.vo.MajorIndustryEmploymentMonitorOverviewVo; import com.ruoyi.cms.domain.vo.MajorIndustryEmploymentMonitorTreadVo; @@ -18,10 +22,12 @@ 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; +import com.ruoyi.cms.domain.vo.SkillKeywordVo; import com.ruoyi.cms.domain.vo.TreadVo; import com.ruoyi.cms.service.AnalysisExportService; import com.ruoyi.cms.service.AnalysisGraduateEmploymentInfoService; import com.ruoyi.cms.service.AnalysisIndustryEmploymentInfoService; +import com.ruoyi.cms.service.AnalysisJobDemandTreadService; import com.ruoyi.cms.service.AnalysisLaborForceRecruitmentDemandService; import com.ruoyi.cms.service.AnalysisMajorIndustryEmploymentMonitorService; import com.ruoyi.cms.service.AnalysisSectorOccupationSkillService; @@ -63,6 +69,7 @@ public class AnalysisExportServiceImpl implements AnalysisExportService { private final AnalysisLaborForceRecruitmentDemandService analysisLaborForceRecruitmentDemandService; private final AnalysisSectorTalentService analysisSectorTalentService; private final AnalysisSectorOccupationSkillService analysisSectorOccupationSkillService; + private final AnalysisJobDemandTreadService analysisJobDemandTreadService; @Override public void exportData(HttpServletResponse response, QueryParamDto dto) { @@ -93,7 +100,7 @@ public class AnalysisExportServiceImpl implements AnalysisExportService { break; // 就业大数据专题分析平台-岗位需求趋势变化分析 case EMPLOYMENT_JOB_DEMAND_TREAD: - test(response, dto); + exportJobDemandTread(response, dto); break; // 就业大数据专题分析平台-重点人群跟踪服务情况分析 case EMPLOYMENT_KEY_GROUP_SERVICE_SITUATION: @@ -1146,6 +1153,179 @@ public class AnalysisExportServiceImpl implements AnalysisExportService { } + /** + * 导出 岗位需求趋势变化分析 + * + * @param response 响应 + * @param dto 查询参数 + * @throws IOException 异常 + */ + private void exportJobDemandTread(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); + JobDemandTreadOverviewVo overview = + analysisJobDemandTreadService.overview(newParam); + + basicExportList.add(new ExcelRow( + "岗位需求总量(个)", transform(overview.getJobDemandCount()), + transform(overview.getJobDemandCountMom()) + )); + basicExportList.add(new ExcelRow( + "求人倍率(%)", transform(overview.getDemandSupplyRate()), + transform(overview.getDemandSupplyRateMom()) + )); + basicExportList.add(new ExcelRow( + "技术类岗位占比(%)", transform(overview.getTechnicalJobPercentage()), + transform(overview.getTechnicalJobPercentageMom()) + )); + basicExportList.add(new ExcelRow( + "硬技能需求人数(人)", transform(overview.getHardSkillDemandCount()), + transform(overview.getHardSkillDemandCountMom()) + )); + + // 创建Excel工具类并添加工作表 + ExcelUtil basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("数据总览"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + // 宏观经济与岗位需求关联 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("宏观经济与岗位需求关联")); + basicExportList.add(new ExcelRow("时间", "GDP增速(%)", "CPI同比(%)", "PMI指数", "岗位需求(个)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + List correlationList = + analysisJobDemandTreadService.economyAndJobDemandCorrelation(newParam); + for (JobDemandTreadEconomyCorrelationVo result : correlationList) { + basicExportList.add(new ExcelRow( + result.getDesc(), transform(result.getGdpGrowthRate()), transform(result.getCpiYoyRate()), + transform(result.getPmiIndex()), transform(result.getJobDemandCount()) + )); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("宏观经济与岗位需求关联"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + // 热门岗位Top10排名 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("热门岗位Top10排名")); + basicExportList.add(new ExcelRow("岗位", "需求人数(人)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + List resultList = + analysisJobDemandTreadService.hotJobRank(newParam); + for (QueryResultVo result : resultList) { + basicExportList.add(new ExcelRow( + result.getDesc(), transform(result.getCount()) + )); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("热门岗位Top10排名"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + // GDP与岗位需求相关性分析 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("GDP与岗位需求相关性分析")); + basicExportList.add(new ExcelRow("经济指数", "需求人数(人)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + List gdpList = + analysisJobDemandTreadService.gdpAndJobDemandCorrelation(newParam); + for (JobDemandTreadGDPCorrelationVo result : gdpList) { + basicExportList.add(new ExcelRow( + transform(result.getGdpIndex()), transform(result.getJobDemandCount()) + )); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("GDP与岗位需求相关性分析"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + // 岗位类型占比变化趋势 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("岗位类型占比变化趋势")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + EchartsVo echarts = analysisJobDemandTreadService.jobTypePercentageTread(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 demandList = + analysisJobDemandTreadService.jobDemandCountTread(newParam); + for (JobDemandTreadDemandVo result : demandList) { + basicExportList.add(new ExcelRow( + result.getDesc(), transform(result.getJobDemandCount()), transform(result.getLobarSupplyCount()), + transform(result.getDemandSupplyRate()), transform(result.getDemandSupplyRateMom()) + )); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("岗位需求总量"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + + // 高技能关键词(Top10) + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("高技能关键词(Top10)")); + basicExportList.add(new ExcelRow("技能关键词", "出现次数(次)", "类型")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + List skillKeywordList = + analysisJobDemandTreadService.skillKeyword(newParam); + for (SkillKeywordVo result : skillKeywordList) { + basicExportList.add(new ExcelRow( + result.getKeyword(), transform(result.getCount()), result.getType() + )); + } + // 创建Excel工具类并添加工作表 + basicSituationExcelUtil = new ExcelUtil<>(ExcelRow.class); + basicSituationExcelUtil.setDataList(basicExportList); + basicSituationExcelUtil.setSheetName("高技能关键词(Top10)"); + multiSheetExcelUtil.addSheet(basicSituationExcelUtil); + + + multiSheetExcelUtil.setFileName(dto.getExportModule().getDesc()); + multiSheetExcelUtil.exportExcel(response); + + } + /** * 导出 行业就业情况信息分析 diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisJobDemandTreadServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisJobDemandTreadServiceImpl.java index f5e48d3..34403b4 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisJobDemandTreadServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisJobDemandTreadServiceImpl.java @@ -10,24 +10,38 @@ import com.ruoyi.cms.domain.vo.JobDemandTreadDemandVo; import com.ruoyi.cms.domain.vo.JobDemandTreadEconomyCorrelationVo; import com.ruoyi.cms.domain.vo.JobDemandTreadGDPCorrelationVo; import com.ruoyi.cms.domain.vo.JobDemandTreadOverviewVo; +import com.ruoyi.cms.domain.vo.MajorIndustryEmploymentMonitorTreadVo; import com.ruoyi.cms.domain.vo.QueryResultVo; import com.ruoyi.cms.domain.vo.SkillKeywordVo; +import com.ruoyi.cms.domain.vo.TreadVo; +import com.ruoyi.cms.mapper.ThemeEconomyIndicatorMapper; +import com.ruoyi.cms.mapper.ThemeJobSeekerMapper; +import com.ruoyi.cms.mapper.ThemeRecruitmentJobMapper; import com.ruoyi.cms.service.AnalysisJobDemandTreadService; 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.Objects; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.IntStream; /** * 岗位需求趋势变化分析 @@ -38,166 +52,447 @@ import java.util.stream.IntStream; @Service @Validated @Slf4j +@RequiredArgsConstructor public class AnalysisJobDemandTreadServiceImpl implements AnalysisJobDemandTreadService { + private final ThemeRecruitmentJobMapper themeRecruitmentJobMapper; + private final ThemeJobSeekerMapper themeJobSeekerMapper; + private final ThemeEconomyIndicatorMapper themeEconomyIndicatorMapper; + @Override public JobDemandTreadOverviewVo overview(QueryParamDto dto) { + + // 计算当前时间数据 + ParamUtil.dealParam(dto); + Long jobDemandCount = themeRecruitmentJobMapper.queryJobCount(dto); + + Long demandCount = Optional.ofNullable(themeRecruitmentJobMapper.queryDemandCount(dto)) + .orElse(0L); + Long supplyCount = Optional.ofNullable(themeJobSeekerMapper.queryCount(dto)) + .orElse(0L); + BigDecimal demandSupplyRate = MathUtil.calculatePercentage(supplyCount, demandCount); + + Long technicalJobCount = Optional.ofNullable(themeRecruitmentJobMapper.queryTechnicalJobCount(dto)) + .orElse(0L); + BigDecimal technicalJobPercentage = MathUtil.calculatePercentage(jobDemandCount, technicalJobCount); + + // 计算上一时间段数据 + QueryParamDto lastDto = new QueryParamDto(); + BeanUtils.copyProperties(dto, lastDto); + ParamUtil.calculateLastTime(lastDto); + Long lastJobDemandCount = themeRecruitmentJobMapper.queryJobCount(lastDto); + + Long lastDemandCount = Optional.ofNullable(themeRecruitmentJobMapper.queryDemandCount(lastDto)) + .orElse(0L); + Long lastSupplyCount = Optional.ofNullable(themeJobSeekerMapper.queryCount(lastDto)) + .orElse(0L); + BigDecimal lastDemandSupplyRate = MathUtil.calculatePercentage(lastSupplyCount, lastDemandCount); + + Long lastTechnicalJobCount = Optional.ofNullable(themeRecruitmentJobMapper.queryTechnicalJobCount(lastDto)) + .orElse(0L); + BigDecimal lastTechnicalJobPercentage = MathUtil.calculatePercentage(lastJobDemandCount, lastTechnicalJobCount); + return JobDemandTreadOverviewVo.builder() - .jobDemandCount(85000L) - .jobDemandCountMom(BigDecimal.valueOf(6.2)) - .demandSupplyRate(BigDecimal.valueOf(1.35)) - .demandSupplyRateMom(BigDecimal.valueOf(0.05)) - .technicalJobPercentage(BigDecimal.valueOf(42.5)) - .technicalJobPercentageMom(BigDecimal.valueOf(2.3)) - .hardSkillDemandCount(32000L) - .hardSkillDemandCountMom(BigDecimal.valueOf(8.1)) + .jobDemandCount(jobDemandCount) + .jobDemandCountMom(MathUtil.calculatePercentageGrowthRate(lastJobDemandCount, jobDemandCount)) + .demandSupplyRate(demandSupplyRate) + .demandSupplyRateMom(MathUtil.calculatePercentageGrowthRate(lastDemandSupplyRate, demandSupplyRate)) + .technicalJobPercentage(technicalJobPercentage) + .technicalJobPercentageMom( + MathUtil.calculatePercentageGrowthRate(lastTechnicalJobPercentage, technicalJobPercentage)) + .hardSkillDemandCount(0L) + .hardSkillDemandCountMom(BigDecimal.valueOf(0)) .build(); } @Override public List economyAndJobDemandCorrelation(QueryParamDto dto) { + + ParamUtil.dealParam(dto); + + 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 jobDemandList = + themeRecruitmentJobMapper.queryJobTrendYear(dto); + // 指标趋势 + List economyIndicatorList = + themeEconomyIndicatorMapper.queryTrendYear(dto); + list = dealResult(jobDemandList, economyIndicatorList); + 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 jobDemandList = + themeRecruitmentJobMapper.queryJobTrendQuarter(dto); + // 指标趋势 + List economyIndicatorList = + themeEconomyIndicatorMapper.queryTrendQuarter(dto); + list = dealResult(jobDemandList, economyIndicatorList); + 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 jobDemandList = + themeRecruitmentJobMapper.queryJobTrendMonth(dto); + // 指标趋势 + List economyIndicatorList = + themeEconomyIndicatorMapper.queryTrendMonth(dto); + list = dealResult(jobDemandList, economyIndicatorList); + break; + } + default: + throw new ServiceException("时间类型错误"); + } + return list; + } + + /** + * 处理结果 + * + * @param jobDemandList 岗位需求 + * @param economyIndicatorList 指标趋势 + * @return 结果 + */ + private List dealResult(List jobDemandList, + List economyIndicatorList) { + List list = new ArrayList<>(); - for (int i = 0; i < 12; i++) { + + Map jobDemandMap = new HashMap<>(); + for (QueryResultVo jobDemand : jobDemandList) { + jobDemandMap.put(jobDemand.getCode(), jobDemand); + } + for (JobDemandTreadEconomyCorrelationVo vo : economyIndicatorList) { + QueryResultVo jobDemand = Optional.ofNullable(jobDemandMap.get(vo.getCode())) + .orElse(QueryResultVo.builder().build()); list.add(JobDemandTreadEconomyCorrelationVo.builder() - .code(i + 1 + "") - .desc(i + 1 + "月") - .gdpGrowthRate(BigDecimal.valueOf(Math.random() * 5 + 2).setScale(1, RoundingMode.HALF_UP)) - .cpiYoyRate(BigDecimal.valueOf(Math.random() * 3 + 1).setScale(1, RoundingMode.HALF_UP)) - .pmiIndex(BigDecimal.valueOf(Math.random() * 10 + 45).setScale(1, RoundingMode.HALF_UP)) - .jobDemandCount((long) Math.floor(Math.random() * 20000) + 5000) - .build()); + .code(vo.getCode()) + .desc(vo.getDesc()) + .gdpGrowthRate(vo.getGdpGrowthRate()) + .cpiYoyRate(vo.getCpiYoyRate()) + .pmiIndex(vo.getPmiIndex()) + .jobDemandCount(Optional.ofNullable(jobDemand.getCount()).orElse(0L)) + .build() + ); } return list; } @Override public List hotJobRank(QueryParamDto dto) { - List list = new ArrayList<>(); - List> jobList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "软件工程师"), - Tuples.of("2", "数据分析师"), - Tuples.of("3", "销售经理"), - Tuples.of("4", "机械工程师"), - Tuples.of("5", "电气工程师"), - Tuples.of("6", "财务会计"), - Tuples.of("7", "市场营销"), - Tuples.of("8", "人力资源"), - Tuples.of("9", "客服专员"), - Tuples.of("10", "物流管理") - ))); - for (Tuple2 job : jobList) { - list.add(QueryResultVo.builder() - .code(job.getT1()) - .desc(job.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .build()); - } - return list; + + ParamUtil.dealParam(dto); + + return themeRecruitmentJobMapper.hotJobRank(dto); } @Override public List gdpAndJobDemandCorrelation(QueryParamDto dto) { + + ParamUtil.dealParam(dto); + + dto.setStartTime(LocalDateTime.of(dto.getYear(), 1, 1, 0, 0, 0) + .minusYears(3L)); + dto.setEndTime(LocalDateTime.of(dto.getYear(), 12, 31, 23, 59, 59)); + + List jobList = themeRecruitmentJobMapper.queryJobByMonth(dto); + + List gdpList = themeEconomyIndicatorMapper.queryGdpByMonth(dto); + + Set monthSet = new HashSet<>(); + Map jobMap = new HashMap<>(); + for (QueryResultVo queryResultVo : jobList) { + monthSet.add(queryResultVo.getCode()); + jobMap.put(queryResultVo.getCode(), queryResultVo); + } + Map gdpMap = new HashMap<>(); + for (QueryResultVo queryResultVo : gdpList) { + monthSet.add(queryResultVo.getCode()); + gdpMap.put(queryResultVo.getCode(), queryResultVo); + } List list = new ArrayList<>(); - for (int i = 0; i < 12; i++) { + for (String month : monthSet) { + QueryResultVo job = Optional.ofNullable(jobMap.get(month)).orElse(QueryResultVo.builder().build()); + QueryResultVo gdp = Optional.ofNullable(gdpMap.get(month)).orElse(QueryResultVo.builder().build()); + if (Objects.isNull(gdp.getRate()) || Objects.isNull(job.getCount())) { + continue; + } list.add(JobDemandTreadGDPCorrelationVo.builder() - .gdpIndex(BigDecimal.valueOf(Math.random() * 5 + 1).setScale(1, RoundingMode.HALF_UP)) - .jobDemandCount((long) Math.floor(Math.random() * 20000) + 5000) + .gdpIndex(gdp.getRate()) + .jobDemandCount(job.getCount()) .build()); } return list; } + @Override public EchartsVo jobTypePercentageTread(QueryParamDto dto) { - List xAxis = IntStream.rangeClosed(1, 12) - .mapToObj(i -> i + "月") - .collect(Collectors.toList()); - List> typeList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "技术类"), - Tuples.of("2", "管理类"), - Tuples.of("3", "操作类"), - Tuples.of("4", "其他") - ))); - - List series = new ArrayList<>(); - for (Tuple2 type : typeList) { - List dataList = new ArrayList<>(); - for (int i = 0; i < 12; i++) { - dataList.add((long) Math.floor(Math.random() * 40) + 10); + 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.queryJobByJobCategoryTreadYear(dto); + vo = transform(list, false); + ParamUtil.fillDictName(vo, "jobCategory"); + break; } - series.add(EchartsSeriesVo.builder().name(type.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.queryJobByJobCategoryTreadQuarter(dto); + vo = transform(list, false); + ParamUtil.fillDictName(vo, "jobCategory"); + 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.queryJobByJobCategoryTreadMonth(dto); + vo = transform(list, false); + ParamUtil.fillDictName(vo, "jobCategory"); + 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 jobDemandCountTread(QueryParamDto dto) { + ParamUtil.dealParam(dto); + + 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 jobList = + themeRecruitmentJobMapper.queryJobTrendYear(dto); + // 岗位人数 + List jobDemandList = + themeRecruitmentJobMapper.laborDemandTrendYear(dto); + // 求职人数 + List jobSeekerList = themeJobSeekerMapper.queryTrendYear(dto); + + // 上一时间段 + dto.setStartTime(dto.getStartTime().minusYears(1L)); + dto.setEndTime(dto.getEndTime().minusYears(1L)); + + // 岗位人数 + List lastJobDemandList = + themeRecruitmentJobMapper.laborDemandTrendYear(dto); + // 求职人数 + List lastJobSeekerList = themeJobSeekerMapper.queryTrendYear(dto); + list = dealResult(jobList, jobDemandList, jobSeekerList, lastJobDemandList, lastJobSeekerList); + 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 jobList = + themeRecruitmentJobMapper.queryJobTrendQuarter(dto); + // 岗位人数 + List jobDemandList = + themeRecruitmentJobMapper.laborDemandTrendQuarter(dto); + // 求职人数 + List jobSeekerList = themeJobSeekerMapper.queryTrendQuarter(dto); + + // 上一时间段 + dto.setStartTime(dto.getStartTime().minusYears(1L)); + dto.setEndTime(dto.getEndTime().minusYears(1L)); + + // 岗位人数 + List lastJobDemandList = + themeRecruitmentJobMapper.laborDemandTrendQuarter(dto); + // 求职人数 + List lastJobSeekerList = themeJobSeekerMapper.queryTrendQuarter(dto); + list = dealResult(jobList, jobDemandList, jobSeekerList, lastJobDemandList, lastJobSeekerList); + 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 jobList = + themeRecruitmentJobMapper.queryJobTrendMonth(dto); + // 岗位人数 + List jobDemandList = + themeRecruitmentJobMapper.laborDemandTrendMonth(dto); + // 求职人数 + List jobSeekerList = themeJobSeekerMapper.queryTrendMonth(dto); + + // 上一时间段 + dto.setStartTime(dto.getStartTime().minusYears(1L)); + dto.setEndTime(dto.getEndTime().minusYears(1L)); + + // 岗位人数 + List lastJobDemandList = + themeRecruitmentJobMapper.laborDemandTrendMonth(dto); + // 求职人数 + List lastJobSeekerList = themeJobSeekerMapper.queryTrendMonth(dto); + list = dealResult(jobList, jobDemandList, jobSeekerList, lastJobDemandList, lastJobSeekerList); + break; + } + default: + throw new ServiceException("时间类型错误"); + } + return list; + } + + /** + * 处理结果 + * + * @param jobList 岗位需求 + * @param jobDemandList 岗位人数 + * @param jobSeekerList 求职人数 + * @param lastJobDemandList 岗位人数 + * @param lastJobSeekerList 求职人数 + * @return 结果 + */ + private List dealResult(List jobList, + List jobDemandList, + List jobSeekerList, + List lastJobDemandList, + List lastJobSeekerList) { + List list = new ArrayList<>(); - for (int i = 0; i < 12; i++) { - long demand = (long) Math.floor(Math.random() * 20000) + 5000; - long supply = (long) Math.floor(Math.random() * 15000) + 3000; - BigDecimal rate = MathUtil.calculatePercentage(demand, supply); + + Map jobSeekerMap = new HashMap<>(); + for (QueryResultVo vo : jobSeekerList) { + jobSeekerMap.put(vo.getCode(), vo); + } + Map jobDemandMap = new HashMap<>(); + for (MajorIndustryEmploymentMonitorTreadVo vo : jobDemandList) { + jobDemandMap.put(vo.getCode(), vo); + } + + for (int i = 0; i < jobList.size(); i++) { + QueryResultVo vo = jobList.get(i); + + QueryResultVo jobSeeker = Optional.ofNullable(jobSeekerMap.get(vo.getCode())) + .orElse(QueryResultVo.builder().build()); + MajorIndustryEmploymentMonitorTreadVo jobDemand = Optional.ofNullable(jobDemandMap.get(vo.getCode())) + .orElse(MajorIndustryEmploymentMonitorTreadVo.builder().build()); + BigDecimal demandSupplyRate = MathUtil.calculatePercentage(jobSeeker.getCount(), + jobDemand.getLaborDemandCount()); + + BigDecimal lastDemandSupplyRate; + QueryResultVo seeker; + MajorIndustryEmploymentMonitorTreadVo job; + if (0 == i) { + seeker = Optional.ofNullable(lastJobSeekerList.get(lastJobSeekerList.size() - 1)) + .orElse(QueryResultVo.builder().build()); + job = Optional.ofNullable(lastJobDemandList.get(lastJobDemandList.size() - 1)) + .orElse(MajorIndustryEmploymentMonitorTreadVo.builder().build()); + } else { + seeker = Optional.ofNullable(jobSeekerMap.get(jobList.get(i - 1).getCode())) + .orElse(QueryResultVo.builder().build()); + job = Optional.ofNullable(jobDemandMap.get(jobList.get(i - 1).getCode())) + .orElse(MajorIndustryEmploymentMonitorTreadVo.builder().build()); + } + lastDemandSupplyRate = MathUtil.calculatePercentage(seeker.getCount(), job.getLaborDemandCount()); + list.add(JobDemandTreadDemandVo.builder() - .code(i + 1 + "") - .desc(i + 1 + "月") - .jobDemandCount(demand) - .lobarSupplyCount(supply) - .demandSupplyRate(rate) - .demandSupplyRateMom(BigDecimal.valueOf(Math.random() * 0.3 - 0.15).setScale(2, - RoundingMode.HALF_UP)) - .build()); + .code(vo.getCode()) + .desc(vo.getDesc()) + .jobDemandCount(vo.getCount()) + .lobarSupplyCount(jobSeeker.getCount()) + .demandSupplyRate(demandSupplyRate) + .demandSupplyRateMom(MathUtil.calculatePercentageGrowthRate(lastDemandSupplyRate, demandSupplyRate)) + .build() + ); } return list; } @Override public List occupationList() { - List list = new ArrayList<>(); - List> occupationList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "软件开发"), - Tuples.of("2", "数据分析"), - Tuples.of("3", "机械制造"), - Tuples.of("4", "电气工程"), - Tuples.of("5", "财务会计"), - Tuples.of("6", "市场营销"), - Tuples.of("7", "行政管理"), - Tuples.of("8", "物流配送") - ))); - for (Tuple2 occupation : occupationList) { - list.add(DictVo.builder().code(occupation.getT1()).desc(occupation.getT2()).build()); - } - return list; + // 目前没有职业,返回空列表 + return new ArrayList<>(); } @Override public List skillKeyword(QueryParamDto dto) { - List list = new ArrayList<>(); - List> keywordList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("Python", "硬技能"), - Tuples.of("Java", "硬技能"), - Tuples.of("数据分析", "硬技能"), - Tuples.of("项目管理", "软技能"), - Tuples.of("团队协作", "软技能"), - Tuples.of("机器学习", "硬技能"), - Tuples.of("沟通能力", "软技能"), - Tuples.of("SQL", "硬技能"), - Tuples.of("智能制造", "硬技能"), - Tuples.of("英语", "硬技能") - ))); - for (Tuple2 keyword : keywordList) { - list.add(SkillKeywordVo.builder() - .keyword(keyword.getT1()) - .type(keyword.getT2()) - .count((long) Math.floor(Math.random() * 2000) + 1) - .build()); - } - return list; + // 目前没有技能,返回空列表 + return new ArrayList<>(); } @Override 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 149cfc9..596efca 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 @@ -67,13 +67,13 @@ public class AnalysisLaborForceRecruitmentDemandServiceImpl implements AnalysisL // 计算当前时间数据 ParamUtil.dealParam(dto); - Long recruitmentJobCount = themeRecruitmentJobMapper.queryRecruitmentJobCount(dto); + Long recruitmentJobCount = themeRecruitmentJobMapper.queryJobCount(dto); Long recruitmentCount = themeRecruitmentJobMapper.queryDemandCount(dto); BigDecimal marketCommitmentSalary = themeRecruitmentJobMapper.queryAverageSalary(dto); - Long supplyCount = themeJobSeekerMapper.querySupplyCount(dto); + Long supplyCount = themeJobSeekerMapper.queryCount(dto); BigDecimal demandSupplyRate = MathUtil.calculatePercentage(supplyCount, recruitmentCount); Tuple2 rateDesc = calculateDemandSupplyRate(demandSupplyRate); @@ -83,13 +83,13 @@ public class AnalysisLaborForceRecruitmentDemandServiceImpl implements AnalysisL QueryParamDto lastDto = new QueryParamDto(); BeanUtils.copyProperties(dto, lastDto); ParamUtil.calculateLastTime(lastDto); - Long lastRecruitmentJobCount = themeRecruitmentJobMapper.queryRecruitmentJobCount(lastDto); + Long lastRecruitmentJobCount = themeRecruitmentJobMapper.queryJobCount(lastDto); Long lastRecruitmentCount = themeRecruitmentJobMapper.queryDemandCount(lastDto); BigDecimal lastMarketCommitmentSalary = themeRecruitmentJobMapper.queryAverageSalary(lastDto); - Long lastSupplyCount = themeJobSeekerMapper.querySupplyCount(lastDto); + Long lastSupplyCount = themeJobSeekerMapper.queryCount(lastDto); BigDecimal lastDemandSupplyRate = MathUtil.calculatePercentage(lastSupplyCount, lastRecruitmentCount); Long lastActiveCompanyCount = themeRecruitmentJobMapper.queryMonitorCompanyCount(lastDto); 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 0cd5561..55ead2d 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 @@ -335,36 +335,36 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys dealParam(dto); // 用工需求 - List laborDemandList = themeRecruitmentJobMapper.queryEmploymentDemandCountByJobType(dto); + List laborDemandList = themeRecruitmentJobMapper.queryEmploymentDemandCountByJobCategory(dto); // 就业 - List employmentList = themeEmploymentRegisterMapper.queryEmploymentCountByJobType(dto); + List employmentList = themeEmploymentRegisterMapper.queryEmploymentCountByJobCategory(dto); // 失业 - List unemploymentList = themeUnemploymentRegisterMapper.queryUnemploymentCountByJobType(dto); + List unemploymentList = themeUnemploymentRegisterMapper.queryUnemploymentCountByJobCategory(dto); - Set jobTypeSet = new HashSet<>(); + Set jobCategorySet = new HashSet<>(); Map loborDemandMap = new HashMap<>(); for (QueryResultVo vo : laborDemandList) { - jobTypeSet.add(vo.getCode()); + jobCategorySet.add(vo.getCode()); loborDemandMap.put(vo.getCode(), vo); } Map employmentMap = new HashMap<>(); for (QueryResultVo vo : employmentList) { - jobTypeSet.add(vo.getCode()); + jobCategorySet.add(vo.getCode()); employmentMap.put(vo.getCode(), vo); } Map unemploymentMap = new HashMap<>(); for (QueryResultVo vo : unemploymentList) { - jobTypeSet.add(vo.getCode()); + jobCategorySet.add(vo.getCode()); unemploymentMap.put(vo.getCode(), vo); } List list = new ArrayList<>(); - for (String jobType : jobTypeSet) { - QueryResultVo laborDemand = Optional.ofNullable(loborDemandMap.get(jobType)) + for (String jobCategory : jobCategorySet) { + QueryResultVo laborDemand = Optional.ofNullable(loborDemandMap.get(jobCategory)) .orElse(QueryResultVo.builder().build()); - QueryResultVo employment = Optional.ofNullable(employmentMap.get(jobType)) + QueryResultVo employment = Optional.ofNullable(employmentMap.get(jobCategory)) .orElse(QueryResultVo.builder().build()); - QueryResultVo unemployment = Optional.ofNullable(unemploymentMap.get(jobType)) + QueryResultVo unemployment = Optional.ofNullable(unemploymentMap.get(jobCategory)) .orElse(QueryResultVo.builder().build()); BigDecimal unEmploymentRate = @@ -373,13 +373,13 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys unemployment.getCount()); QueryResultVo vo = QueryResultVo.builder() - .code(jobType) + .code(jobCategory) .count(Optional.ofNullable(laborDemand.getCount()).orElse(0L)) .rate(unEmploymentRate) .build(); list.add(vo); } - ParamUtil.fillDictName(list, "jobType"); + ParamUtil.fillDictName(list, "jobCategory"); return list; } 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 35aec53..8361544 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 @@ -71,7 +71,7 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ Long talentDemandCount = Optional.ofNullable(themeRecruitmentJobMapper.queryDemandCount(dto)) .orElse(0L); - Long talentSupplyCount = Optional.ofNullable(themeJobSeekerMapper.querySupplyCount(dto)) + Long talentSupplyCount = Optional.ofNullable(themeJobSeekerMapper.queryCount(dto)) .orElse(0L); BigDecimal supplyDemandMatchingDegree = MathUtil.calculatePercentage(talentDemandCount, talentSupplyCount); @@ -93,7 +93,7 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ Long lastTalentDemandCount = Optional.ofNullable(themeRecruitmentJobMapper.queryDemandCount(lastDto)) .orElse(0L); - Long lastTalentSupplyCount = Optional.ofNullable(themeJobSeekerMapper.querySupplyCount(lastDto)) + Long lastTalentSupplyCount = Optional.ofNullable(themeJobSeekerMapper.queryCount(lastDto)) .orElse(0L); BigDecimal lastSupplyDemandMatchingDegree = MathUtil.calculatePercentage(lastTalentDemandCount, 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 8043ed3..270aa73 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 @@ -214,8 +214,8 @@ public class ParamUtil { case "employmentCrowd": { return Optional.ofNullable(CommonConstant.EMPLOYMENT_CROWD_MAP.get(code)).orElse("未知"); } - case "jobType": { - return Optional.ofNullable(CommonConstant.JOB_TYPE_MAP.get(code)).orElse("未知"); + case "jobCategory": { + return Optional.ofNullable(CommonConstant.JOB_CATEGORY_MAP.get(code)).orElse("未知"); } case "companyType": { return Optional.ofNullable(CommonConstant.COMPANY_TYPE_MAP.get(code)).orElse("未知"); diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeEconomyIndicatorMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeEconomyIndicatorMapper.xml new file mode 100644 index 0000000..638b873 --- /dev/null +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeEconomyIndicatorMapper.xml @@ -0,0 +1,168 @@ + + + + + + + indicator_time BETWEEN #{startTime} AND #{endTime} + + AND area_code = #{area} + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml index 76c58fd..4092b19 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml @@ -602,7 +602,7 @@ - + login_date >= r.start_time + AND create_time <= r.end_time + + AND area = #{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 f2a9ef6..a464dbb 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeRecruitmentJobMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeRecruitmentJobMapper.xml @@ -23,6 +23,26 @@ + + posting_date BETWEEN r.start_time AND r.end_time + + AND job_location_area_code = #{area} + + + AND industry LIKE #{industry} || '%' + + + AND ( + + industry LIKE #{industry} || '%' + + ) + + + AND sector = #{sector} + + + @@ -72,6 +92,19 @@ + + + + + + + + + + + + + + + + + + + + - + + \ 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 35263c8..0f34219 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeUnemploymentRegisterMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeUnemploymentRegisterMapper.xml @@ -259,7 +259,7 @@ ORDER BY code -