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 4d2d7e7..ad86c18 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 @@ -186,6 +186,15 @@ public class CommonConstant { 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 + ))); /** * 重点群体列表 diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/SectorTalentOverviewVo.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/SectorTalentOverviewVo.java index 32482a3..1703577 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/SectorTalentOverviewVo.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/SectorTalentOverviewVo.java @@ -81,7 +81,7 @@ public class SectorTalentOverviewVo implements Serializable { */ private Long skillTrainCount; /** - * 人才缺口环比 + * 技能培训人数环比 */ private BigDecimal skillTrainCountMom; } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/SectorTalentTreadVo.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/SectorTalentTreadVo.java index 626024b..ad31763 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/SectorTalentTreadVo.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/vo/SectorTalentTreadVo.java @@ -41,7 +41,7 @@ public class SectorTalentTreadVo implements Serializable { */ private BigDecimal sectorIncreaseValue; /** - * 增长率 + * 产值增长率 */ private BigDecimal growthRate; diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeGraduateInfoMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeGraduateInfoMapper.java index dbb85a5..6a12f43 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeGraduateInfoMapper.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeGraduateInfoMapper.java @@ -96,7 +96,7 @@ public interface ThemeGraduateInfoMapper { * @param dto 查询参数 * @return 结果列表 */ - List majorProfessional(QueryParamDto dto); + List queryByMajor(QueryParamDto dto); /** * 性别就业差异分析 @@ -104,7 +104,7 @@ public interface ThemeGraduateInfoMapper { * @param dto 查询参数 * @return 结果列表 */ - List gender(QueryParamDto dto); + List queryByGender(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 1042fd3..dbbabfb 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 @@ -1,6 +1,9 @@ package com.ruoyi.cms.mapper; import com.ruoyi.cms.domain.dto.QueryParamDto; +import com.ruoyi.cms.domain.vo.QueryResultVo; + +import java.util.List; /** * 求职者主题库 @@ -17,4 +20,12 @@ public interface ThemeJobSeekerMapper { * @return 数 */ Long querySupplyCount(QueryParamDto dto); + + /** + * 通过产业查询 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List queryBySector(QueryParamDto dto); } 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 new file mode 100644 index 0000000..905c6e7 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeProfessionalTrainMapper.java @@ -0,0 +1,23 @@ +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 ThemeProfessionalTrainMapper { + + /** + * 通过技能等级查询 + * + * @param dto 查询参数 + * @return 结果列表 + */ + List queryBySkillLevel(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 1f87090..d9c20c1 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 @@ -221,4 +221,12 @@ 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/ThemeSectorDevelopMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeSectorDevelopMapper.java index 331a310..7806fba 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeSectorDevelopMapper.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeSectorDevelopMapper.java @@ -1,8 +1,11 @@ package com.ruoyi.cms.mapper; import com.ruoyi.cms.domain.dto.QueryParamDto; +import com.ruoyi.cms.domain.vo.MajorIndustryEmploymentMonitorTreadVo; +import com.ruoyi.cms.domain.vo.SectorTalentTreadVo; import java.math.BigDecimal; +import java.util.List; /** * 产业发展主题库 @@ -36,4 +39,29 @@ public interface ThemeSectorDevelopMapper { */ Long queryStartupCompanyCount(QueryParamDto dto); + /** + * 产业发展趋势 - 年度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List sectorDevelopTrendYear(QueryParamDto dto); + + /** + * 产业发展趋势 - 季度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List sectorDevelopTrendQuarter(QueryParamDto dto); + + /** + * 产业发展趋势 - 月度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List sectorDevelopTrendMonth(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 5381b96..2a0f072 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,12 +13,16 @@ 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.SectorTalentOverviewVo; +import com.ruoyi.cms.domain.vo.SectorTalentProsperityIndexVo; +import com.ruoyi.cms.domain.vo.SectorTalentTreadVo; 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.AnalysisLaborForceRecruitmentDemandService; import com.ruoyi.cms.service.AnalysisMajorIndustryEmploymentMonitorService; +import com.ruoyi.cms.service.AnalysisSectorTalentService; import com.ruoyi.cms.util.document.ExcelUtil; import com.ruoyi.cms.util.document.MultiSheetExcelUtil; import com.ruoyi.common.exception.ServiceException; @@ -54,6 +58,7 @@ public class AnalysisExportServiceImpl implements AnalysisExportService { private final AnalysisGraduateEmploymentInfoService analysisGraduateEmploymentInfoService; private final AnalysisMajorIndustryEmploymentMonitorService analysisMajorIndustryEmploymentMonitorService; private final AnalysisLaborForceRecruitmentDemandService analysisLaborForceRecruitmentDemandService; + private final AnalysisSectorTalentService analysisSectorTalentService; @Override public void exportData(HttpServletResponse response, QueryParamDto dto) { @@ -76,7 +81,7 @@ public class AnalysisExportServiceImpl implements AnalysisExportService { break; // 就业大数据专题分析平台-产业发展与人才供需分析 case EMPLOYMENT_SECTOR_TALENT: - test(response, dto); + exportSectorTalent(response, dto); break; // 就业大数据专题分析平台-产业发展与职业技能提升分析 case EMPLOYMENT_SECTOR_OCCUPATION_SKILL: @@ -809,6 +814,177 @@ public class AnalysisExportServiceImpl implements AnalysisExportService { } + /** + * 导出 产业发展与人才供需分析 + * + * @param response 响应 + * @param dto 查询参数 + * @throws IOException 异常 + */ + private void exportSectorTalent(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); + SectorTalentOverviewVo overview = + analysisSectorTalentService.overview(newParam); + + basicExportList.add(new ExcelRow( + "产业产值(亿元)", transform(overview.getSectorAmount()), + transform(overview.getSectorAmountMom()) + )); + basicExportList.add(new ExcelRow( + "企业新增投资额(亿元)", transform(overview.getCompanyNewInvestmentAmount()), + transform(overview.getCompanyNewInvestmentAmountMom()) + )); + basicExportList.add(new ExcelRow( + "人才需求(人)", transform(overview.getTalentDemandCount()), + transform(overview.getTalentDemandCountMom()) + )); + basicExportList.add(new ExcelRow( + "人才供给(人)", transform(overview.getTalentSupplyCount()), + transform(overview.getTalentSupplyCountMom()) + )); + basicExportList.add(new ExcelRow( + "供需匹配度(%)", transform(overview.getSupplyDemandMatchingDegree()), + transform(overview.getSupplyDemandMatchingDegreeMom()) + )); + basicExportList.add(new ExcelRow( + "人才缺口(人)", transform(overview.getTalentGapCount()), + transform(overview.getTalentGapCountMom()) + )); + basicExportList.add(new ExcelRow( + "创业企业数(家)", transform(overview.getStartupCompanyCount()), + transform(overview.getStartupCompanyCountMom()) + )); + + // 创建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); + SectorTalentProsperityIndexVo sectorTalentProsperityIndexVo = + analysisSectorTalentService.sectorProsperityIndex(newParam); + basicExportList.add(new ExcelRow("指数", transform(sectorTalentProsperityIndexVo.getProsperityIndex()))); + // 创建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 sectorTalentList = analysisSectorTalentService.sectorDevelopTrend(newParam); + for (SectorTalentTreadVo tread : sectorTalentList) { + basicExportList.add(new ExcelRow( + tread.getDesc(), transform(tread.getJobDemandCount()), transform(tread.getSectorInvestmentAmount()), + transform(tread.getSectorIncreaseValue()), transform(tread.getGrowthRate()) + )); + } + // 创建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 = analysisSectorTalentService.talentDemandStructure(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); + + // 高校毕业生人才供给专业分布 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("高校毕业生人才供给专业分布")); + basicExportList.add(new ExcelRow("专业", "人数(人)", "占比(%)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + resultList = analysisSectorTalentService.talentSupplyDistribution(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); + + // 职业培训技能人才等级分布 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("职业培训技能人才等级分布")); + basicExportList.add(new ExcelRow("技能等级", "人数(人)", "占比(%)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + resultList = analysisSectorTalentService.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); + + // 人才供需匹配度评估 + basicExportList = new ArrayList<>(); + basicExportList.add(new ExcelRow("人才供需匹配度评估")); + basicExportList.add(new ExcelRow("产业", "人才需求(人)", "人才供给(人)", "供需比(%)")); + newParam = new QueryParamDto(); + BeanUtils.copyProperties(dto, newParam); + resultList = analysisSectorTalentService.talentSupplyDemandMatchingDegree(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); + + + multiSheetExcelUtil.setFileName(dto.getExportModule().getDesc()); + multiSheetExcelUtil.exportExcel(response); + + } + /** * 导出 行业就业情况信息分析 diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisGraduateEmploymentInfoServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisGraduateEmploymentInfoServiceImpl.java index b9a8b06..5aa2003 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisGraduateEmploymentInfoServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisGraduateEmploymentInfoServiceImpl.java @@ -138,7 +138,7 @@ public class AnalysisGraduateEmploymentInfoServiceImpl implements AnalysisGradua public List majorProfessional(QueryParamDto dto) { ParamUtil.dealParam(dto); - List list = themeGraduateInfoMapper.majorProfessional(dto); + List list = themeGraduateInfoMapper.queryByMajor(dto); list.sort(Comparator.comparingLong(QueryResultVo::getCount).reversed()); return list; @@ -148,7 +148,7 @@ public class AnalysisGraduateEmploymentInfoServiceImpl implements AnalysisGradua public List gender(QueryParamDto dto) { ParamUtil.dealParam(dto); - List list = themeGraduateInfoMapper.gender(dto); + List list = themeGraduateInfoMapper.queryByGender(dto); MathUtil.calculatePercentage(list); ParamUtil.fillDictName(list, "gender"); 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 23ae0a9..4a14080 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 @@ -3,31 +3,38 @@ 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; import com.ruoyi.cms.domain.vo.QueryResultVo; 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.mapper.ThemeGraduateInfoMapper; import com.ruoyi.cms.mapper.ThemeJobSeekerMapper; +import com.ruoyi.cms.mapper.ThemeProfessionalTrainMapper; import com.ruoyi.cms.mapper.ThemeRecruitmentJobMapper; import com.ruoyi.cms.mapper.ThemeSectorDevelopMapper; import com.ruoyi.cms.service.AnalysisSectorTalentService; import com.ruoyi.cms.util.MathUtil; import com.ruoyi.cms.util.ParamUtil; +import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.bean.BeanUtils; 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 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.Comparator; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Optional; +import java.util.Set; /** * 产业发展与人才供需分析 @@ -44,6 +51,8 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ private final ThemeSectorDevelopMapper themeSectorDevelopMapper; private final ThemeRecruitmentJobMapper themeRecruitmentJobMapper; private final ThemeJobSeekerMapper themeJobSeekerMapper; + private final ThemeGraduateInfoMapper themeGraduateInfoMapper; + private final ThemeProfessionalTrainMapper themeProfessionalTrainMapper; @Override public SectorTalentOverviewVo overview(QueryParamDto dto) { @@ -113,97 +122,202 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ @Override public SectorTalentProsperityIndexVo sectorProsperityIndex(QueryParamDto dto) { + // 目前没有来源,先固定 return SectorTalentProsperityIndexVo.builder() - .prosperityIndex(BigDecimal.valueOf(112.5)) + .prosperityIndex(BigDecimal.valueOf(85)) .build(); } @Override public List sectorDevelopTrend(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 laborDemandList = + themeRecruitmentJobMapper.laborDemandTrendYear(dto); + // 产业投资/产业增加值 + List sectorDevelopList = + themeSectorDevelopMapper.sectorDevelopTrendYear(dto); + // 产业投资/产业增加值 上一时间段 + dto.setStartTime(dto.getStartTime().minusYears(1L)); + dto.setEndTime(dto.getEndTime().minusYears(1L)); + List lastSectorDevelopList = + themeSectorDevelopMapper.sectorDevelopTrendYear(dto); + list = dealResult(laborDemandList, sectorDevelopList, lastSectorDevelopList); + 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 laborDemandList = + themeRecruitmentJobMapper.laborDemandTrendQuarter(dto); + // 产业投资/产业增加值 + List sectorDevelopList = + themeSectorDevelopMapper.sectorDevelopTrendQuarter(dto); + // 产业投资/产业增加值 上一时间段 + dto.setStartTime(dto.getStartTime().minusYears(1L)); + dto.setEndTime(dto.getEndTime().minusYears(1L)); + List lastSectorDevelopList = + themeSectorDevelopMapper.sectorDevelopTrendQuarter(dto); + list = dealResult(laborDemandList, sectorDevelopList, lastSectorDevelopList); + 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 laborDemandList = + themeRecruitmentJobMapper.laborDemandTrendMonth(dto); + // 产业投资/产业增加值 + List sectorDevelopList = + themeSectorDevelopMapper.sectorDevelopTrendMonth(dto); + // 产业投资/产业增加值 上一时间段 + dto.setStartTime(dto.getStartTime().minusYears(1L)); + dto.setEndTime(dto.getEndTime().minusYears(1L)); + List lastSectorDevelopList = + themeSectorDevelopMapper.sectorDevelopTrendMonth(dto); + list = dealResult(laborDemandList, sectorDevelopList, lastSectorDevelopList); + break; + } + default: + throw new ServiceException("时间类型错误"); + } + return list; + } + + /** + * 处理结果 + * + * @param laborDemandList 用工需求 + * @param sectorDevelopList 产业投资/产业增加值 + * @param lastSectorDevelopList 上一时间段产业投资/产业增加值 + * @return 结果 + */ + private List dealResult(List laborDemandList, + List sectorDevelopList, + List lastSectorDevelopList) { + List list = new ArrayList<>(); - for (int i = 0; i < 12; i++) { + + Map laborDemandMap = new HashMap<>(); + for (MajorIndustryEmploymentMonitorTreadVo employment : laborDemandList) { + laborDemandMap.put(employment.getCode(), employment); + } + Map lastSectorDevelopMap = new HashMap<>(); + for (SectorTalentTreadVo lastSector : lastSectorDevelopList) { + lastSectorDevelopMap.put(lastSector.getCode(), lastSector); + } + for (int i = 0; i < sectorDevelopList.size(); i++) { + + SectorTalentTreadVo vo = sectorDevelopList.get(i); + MajorIndustryEmploymentMonitorTreadVo lobarDemand = Optional.ofNullable(laborDemandMap.get(vo.getCode())) + .orElse(MajorIndustryEmploymentMonitorTreadVo.builder().build()); + SectorTalentTreadVo lastSector; + if (0 == i) { + lastSector = Optional.ofNullable(lastSectorDevelopMap.get(vo.getCode())) + .orElse(SectorTalentTreadVo.builder().build()); + } else { + lastSector = Optional.ofNullable(sectorDevelopList.get(i - 1)) + .orElse(SectorTalentTreadVo.builder().build()); + } + + BigDecimal sectorIncreaseValue = Optional.ofNullable(vo.getSectorIncreaseValue()) + .orElse(BigDecimal.ZERO) + .subtract(Optional.ofNullable(lastSector.getSectorIncreaseValue()).orElse(BigDecimal.ZERO)); + list.add(SectorTalentTreadVo.builder() - .code(i + 1 + "") - .desc(i + 1 + "月") - .jobDemandCount((long) Math.floor(Math.random() * 20000) + 1000) - .sectorInvestmentAmount(BigDecimal.valueOf(Math.random() * 100 + 10).setScale(2, - RoundingMode.HALF_UP)) - .sectorIncreaseValue(BigDecimal.valueOf(Math.random() * 50 + 5).setScale(2, RoundingMode.HALF_UP)) - .growthRate(BigDecimal.valueOf(Math.random() * 15 + 1).setScale(1, RoundingMode.HALF_UP)) - .build()); + .code(vo.getCode()) + .desc(vo.getDesc()) + .jobDemandCount(lobarDemand.getLaborDemandCount()) + .sectorInvestmentAmount(vo.getSectorInvestmentAmount()) + .sectorIncreaseValue(sectorIncreaseValue) + .growthRate(MathUtil.calculatePercentage(lastSector.getSectorIncreaseValue(), sectorIncreaseValue)) + .build() + ); } return list; } @Override public List talentDemandStructure(QueryParamDto dto) { - List list = new ArrayList<>(); - for (Tuple2 industry : CommonConstant.SECTOR_LIST) { - list.add(QueryResultVo.builder() - .code(industry.getT1()) - .desc(industry.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + + List list = themeRecruitmentJobMapper.queryBySector(dto); MathUtil.calculatePercentage(list); + ParamUtil.fillDictName(list, "sector"); + return list; } @Override public List talentSupplyDistribution(QueryParamDto dto) { - List list = new ArrayList<>(); - List> majorList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "机械制造"), - Tuples.of("2", "电子信息"), - Tuples.of("3", "管理类"), - Tuples.of("4", "基础科学"), - Tuples.of("5", "其他") - ))); - for (Tuple2 major : majorList) { - list.add(QueryResultVo.builder() - .code(major.getT1()) - .desc(major.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + + List list = themeGraduateInfoMapper.queryByMajor(dto); MathUtil.calculatePercentage(list); + + list.sort(Comparator.comparingLong(QueryResultVo::getCount).reversed()); 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()); - } + + ParamUtil.dealParam(dto); + List list = themeProfessionalTrainMapper.queryBySkillLevel(dto); MathUtil.calculatePercentage(list); + return list; } @Override public List talentSupplyDemandMatchingDegree(QueryParamDto dto) { + + ParamUtil.dealParam(dto); + + List supplyList = themeJobSeekerMapper.queryBySector(dto); + + List demandList = themeRecruitmentJobMapper.queryBySector(dto); + + Set sectorSet = new HashSet<>(); + Map supplyMap = new HashMap<>(); + for (QueryResultVo queryResultVo : supplyList) { + sectorSet.add(queryResultVo.getCode()); + supplyMap.put(queryResultVo.getCode(), queryResultVo); + } + Map demandMap = new HashMap<>(); + for (QueryResultVo queryResultVo : demandList) { + sectorSet.add(queryResultVo.getCode()); + demandMap.put(queryResultVo.getCode(), queryResultVo); + } + List list = new ArrayList<>(); - for (Tuple2 industry : CommonConstant.SECTOR_LIST) { + for (String sector : sectorSet) { + QueryResultVo supply = Optional.ofNullable(supplyMap.get(sector)) + .orElse(QueryResultVo.builder().build()); + QueryResultVo demand = Optional.ofNullable(demandMap.get(sector)) + .orElse(QueryResultVo.builder().build()); list.add(QueryResultVo.builder() - .code(industry.getT1()) - .desc(industry.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .anotherCount((long) Math.floor(Math.random() * 100000) + 1) - .rate(BigDecimal.valueOf(Math.random() * 30 + 1).setScale(1, RoundingMode.HALF_UP)) + .code(sector) + .count(demand.getCount()) + .anotherCount(supply.getCount()) + .rate(MathUtil.calculatePercentage(demand.getCount(), supply.getCount())) .build()); } + ParamUtil.fillDictName(list, "sector"); + return list; } 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 359635e..9f2fe2d 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 @@ -199,6 +199,9 @@ public class ParamUtil { case "majorSector": { return Optional.ofNullable(CommonConstant.MAJOR_SECTOR_MAP.get(code)).orElse("未知"); } + case "sector": { + return Optional.ofNullable(CommonConstant.SECTOR_MAP.get(code)).orElse("未知"); + } case "educationLevel": { return Optional.ofNullable(CommonConstant.EDUCATION_LEVEL_MAP.get(code)).orElse("未知"); } diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeGraduateInfoMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeGraduateInfoMapper.xml index 3affcd0..43b33ed 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeGraduateInfoMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeGraduateInfoMapper.xml @@ -249,7 +249,7 @@ ORDER BY code - - + \ 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 new file mode 100644 index 0000000..8ee6b3d --- /dev/null +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeProfessionalTrainMapper.xml @@ -0,0 +1,35 @@ + + + + + + + pxkssj BETWEEN #{startTime} AND #{endTime} + + AND xzqh = #{area} + + + + + + \ 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 81be5f3..19ce4d9 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeRecruitmentJobMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeRecruitmentJobMapper.xml @@ -123,6 +123,9 @@ ) + + AND sector = #{sector} + GROUP BY r.month_num ) SELECT @@ -173,6 +176,9 @@ ) + + AND sector = #{sector} + GROUP BY r.month_num ) SELECT @@ -223,6 +229,9 @@ ) + + AND sector = #{sector} + GROUP BY r.month_num ) SELECT @@ -810,4 +819,25 @@ END + + + \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeSectorDevelopMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeSectorDevelopMapper.xml index 90491bc..443b1df 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeSectorDevelopMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeSectorDevelopMapper.xml @@ -49,4 +49,139 @@ + + + + + + + + \ No newline at end of file diff --git a/sql/datadashboard/table.sql b/sql/datadashboard/table.sql index ba46358..e53b450 100644 --- a/sql/datadashboard/table.sql +++ b/sql/datadashboard/table.sql @@ -481,7 +481,7 @@ CREATE TABLE shz_data_dashboard.theme_recruitment_job name character varying(255) COLLATE pg_catalog."default", location character varying(255) COLLATE pg_catalog."default", industry character varying(100) COLLATE pg_catalog."default", - sector character varying(100) COLLATE pg_catalog."default", + sector character varying(100) COLLATE pg_catalog."default", major_sector character varying(100) COLLATE pg_catalog."default", scale character varying(50) COLLATE pg_catalog."default", del_flag character varying(1) COLLATE pg_catalog."default", @@ -609,8 +609,8 @@ CREATE TABLE shz_data_dashboard.theme_job_seeker phone character varying(200) COLLATE pg_catalog."default", min_salary character varying(10) COLLATE pg_catalog."default", max_salary character varying(10) COLLATE pg_catalog."default", - industry character varying(100) COLLATE pg_catalog."default", - sector character varying(100) COLLATE pg_catalog."default", + industry character varying(100) COLLATE pg_catalog."default", + sector character varying(100) COLLATE pg_catalog."default", area character varying(20) COLLATE pg_catalog."default", status character varying(2) COLLATE pg_catalog."default", del_flag character varying(1) COLLATE pg_catalog."default", @@ -749,6 +749,107 @@ ON COLUMN shz_data_dashboard.theme_sector_develop.startup_company_count IS '创 COMMENT ON TABLE shz_data_dashboard.theme_sector_develop IS '产业发展主题库'; +-- 职业培训主题库 +CREATE TABLE shz_data_dashboard.theme_professional_train +( + "AAC043" character varying(2) COLLATE pg_catalog."default", + "AAC044" character varying(20) COLLATE pg_catalog."default", + "AAC003" character varying(200) COLLATE pg_catalog."default", + pxkssj timestamp without time zone, + pxjssj timestamp without time zone, + pxjg character varying(200) COLLATE pg_catalog."default", + jglx character varying(200) COLLATE pg_catalog."default", + qh character varying(200) COLLATE pg_catalog."default", + zsbh character varying(200) COLLATE pg_catalog."default", + sfzh character varying(200) COLLATE pg_catalog."default", + jndj character varying(200) COLLATE pg_catalog."default", + cxxylb character varying(200) COLLATE pg_catalog."default", + cxxyzt character varying(200) COLLATE pg_catalog."default", + xzqh character varying(200) COLLATE pg_catalog."default", + btbz numeric(10, 2), + zjly character varying(200) COLLATE pg_catalog."default", + aac005 character varying(200) COLLATE pg_catalog."default", + aac004 character varying(200) COLLATE pg_catalog."default", + aac006 timestamp without time zone, + aac011 character varying(200) COLLATE pg_catalog."default", + aae100 character varying(200) COLLATE pg_catalog."default" +) +; + +ALTER TABLE shz_data_dashboard.theme_professional_train + OWNER TO sysdba; + +COMMENT +ON COLUMN shz_data_dashboard.theme_unemployment_register."AAC043" IS '证件类型'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_unemployment_register."AAC044" IS '证件号码'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_unemployment_register."AAC003" IS '姓名'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.pxkssj IS '培训开始时间'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.pxjssj IS '培训结束时间'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.pxjg IS '培训机构'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.jglx IS '机构类型'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.qh IS '期号'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.sfhg IS '是否合格'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.zsbh IS '证书编号'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.jndj IS '技能等级'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.cxxylb IS '参训学员类别'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.cxxyzt IS '参训学员状态'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.xzqh IS '行政区号'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.btbz IS '补贴标准'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.zjly IS '资金来源'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.aac005 IS '民族'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.aac004 IS '性别'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.aac006 IS '出生日期'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.aac011 IS '文化程度'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_professional_train.aae100 IS '是否就业登记:1 是;0 否'; + +COMMENT +ON TABLE shz_data_dashboard.theme_professional_train IS '职业培训主题库'; + + + + + + -- 就业失业预警指标 CREATE TABLE shz_data_dashboard.model_warning_indicator (