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 18b2315..5760471 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 @@ -153,6 +153,24 @@ public class CommonConstant { Tuple2::getT1, Tuple2::getT2 ))); + /** + * 产业类型列表 + */ + public static final List> SECTOR_TYPE_LIST = + Collections.unmodifiableList(new ArrayList<>(Arrays.asList( + Tuples.of("1", "第一产业"), + Tuples.of("2", "第二产业"), + Tuples.of("3", "第三产业") + ))); + /** + * 产业类型Map + */ + public static final Map SECTOR_TYPE_MAP = + Collections.unmodifiableMap(SECTOR_TYPE_LIST.stream() + .collect(Collectors.toMap( + Tuple2::getT1, + Tuple2::getT2 + ))); /** * 高校类型列表 @@ -386,4 +404,52 @@ public class CommonConstant { Tuple2::getT1, Tuple2::getT2 ))); + + /** + * 就业形式列表 + */ + public static final List> EMPLOYMENT_MODE_LIST = + Collections.unmodifiableList(new ArrayList<>(Arrays.asList( + Tuples.of("10", "单位就业"), + Tuples.of("21", "个体经营"), + Tuples.of("22", "灵活就业"), + Tuples.of("29", "单位就业个人身份登记申请"), + Tuples.of("30", "公益性岗位就业"), + Tuples.of("99", "其他") + ))); + + /** + * 就业形式Map + */ + public static final Map EMPLOYMENT_MODE_MAP = + Collections.unmodifiableMap(EMPLOYMENT_MODE_LIST.stream() + .collect(Collectors.toMap( + Tuple2::getT1, + Tuple2::getT2 + ))); + + /** + * 失业原因列表 + */ + public static final List> UNEMPLOYMENT_REASON_LIST = + Collections.unmodifiableList(new ArrayList<>(Arrays.asList( + Tuples.of("21", "被企业解除或终止劳动关系的"), + Tuples.of("22", "企业破产倒闭终止劳动关系的"), + Tuples.of("23", "从机关事业单位被辞退解聘的"), + Tuples.of("24", "从各类单位辞职的"), + Tuples.of("31", "退出个体经营的"), + Tuples.of("32", "私营企业业主停业、破产停止经营的"), + Tuples.of("33", "退出灵活就业的"), + Tuples.of("40", "退出公益性岗位"), + Tuples.of("90", "其他") + ))); + /** + * 失业原因Map + */ + public static final Map UNEMPLOYMENT_REASON_MAP = + Collections.unmodifiableMap(UNEMPLOYMENT_REASON_LIST.stream() + .collect(Collectors.toMap( + Tuple2::getT1, + Tuple2::getT2 + ))); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeAssistRecordMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeAssistRecordMapper.java index 45d70c1..21f1c0b 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeAssistRecordMapper.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeAssistRecordMapper.java @@ -8,6 +8,7 @@ import com.ruoyi.cms.domain.vo.KeyGroupServiceSituationHelpScoreVo; import com.ruoyi.cms.domain.vo.KeyGroupServiceSituationHelpTypeVo; import com.ruoyi.cms.domain.vo.KeyGroupServiceSituationKeyGroupScoreVo; import com.ruoyi.cms.domain.vo.QueryResultVo; +import com.ruoyi.cms.domain.vo.TreadVo; import java.math.BigDecimal; import java.util.List; @@ -44,6 +45,14 @@ public interface ThemeAssistRecordMapper { */ Long queryEmploymentCount(QueryParamDto dto); + /** + * 查询失业数量 + * + * @param dto 查询参数 + * @return 结果 + */ + Long queryUnemploymentCount(QueryParamDto dto); + /** * 查询整体满意度 * @@ -136,6 +145,30 @@ public interface ThemeAssistRecordMapper { */ List heatmap(QueryParamDto dto); + /** + * 享受失业服务人数趋势 - 年度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List receiveUnemploymentServiceTrendYear(QueryParamDto dto); + + /** + * 享受失业服务人数趋势 - 季度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List receiveUnemploymentServiceTrendQuarter(QueryParamDto dto); + + /** + * 享受失业服务人数趋势 - 月度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List receiveUnemploymentServiceTrendMonth(QueryParamDto dto); + /** * 查询数量 * @@ -150,4 +183,6 @@ public interface ThemeAssistRecordMapper { * @return 结果 */ List list(KeyGroupQueryDTO 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 b6ecb77..0b6eeb2 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 @@ -28,6 +28,24 @@ public interface ThemeEmploymentRegisterMapper { */ Long queryCount(QueryParamDto dto); + + /** + * 查询累计就业登记人数 + * + * @param dto 查询参数 + * @return 人数 + */ + Long queryCumulativeCount(QueryParamDto dto); + + + /** + * 查询累计城镇就业登记人数 + * + * @param dto 查询参数 + * @return 人数 + */ + Long queryCumulativeTownCount(QueryParamDto dto); + /** * 获取各种就业登记人数 * @@ -114,7 +132,7 @@ public interface ThemeEmploymentRegisterMapper { * @param dto 查询参数 * @return 结果列表 */ - List ageStructure(QueryParamDto dto); + List queryByAge(QueryParamDto dto); /** * 薪酬水平对标 @@ -183,10 +201,42 @@ public interface ThemeEmploymentRegisterMapper { List queryEmploymentCountByJobCategory(QueryParamDto dto); /** - * 查询各岗位类型就业人数 + * 查询各产业就业人数 * * @param dto 查询参数 * @return 数 */ List queryAverageSalaryBySector(QueryParamDto dto); + + /** + * 查询各产业类型就业人数 + * + * @param dto 查询参数 + * @return 数 + */ + List queryBySectorType(QueryParamDto dto); + + /** + * 查询各性别就业人数 + * + * @param dto 查询参数 + * @return 数 + */ + List queryByGender(QueryParamDto dto); + + /** + * 查询各性别就业人数 + * + * @param dto 查询参数 + * @return 数 + */ + List queryByMode(QueryParamDto dto); + + /** + * 查询各性别就业人数 + * + * @param dto 查询参数 + * @return 数 + */ + List queryByEducationLevel(QueryParamDto dto); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEmploymentTargetMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEmploymentTargetMapper.java new file mode 100644 index 0000000..edb8acd --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeEmploymentTargetMapper.java @@ -0,0 +1,21 @@ +package com.ruoyi.cms.mapper; + +import com.ruoyi.cms.domain.dto.QueryParamDto; + +/** + * 就业目标主题库 + * + * @author 马宝龙 + * @date 2026/7/15 + */ +public interface ThemeEmploymentTargetMapper { + + + /** + * 查询城镇新就业目标 + * @param dto 查询参数 + * @return 结果 + */ + Long queryTownNewEmployeeCount(QueryParamDto dto); + +} \ No newline at end of file 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 6ac80ae..1cbbb9f 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 @@ -4,6 +4,7 @@ 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.TreadVo; import java.util.List; @@ -24,13 +25,22 @@ public interface ThemeUnemploymentRegisterMapper { */ Long queryCount(QueryParamDto dto); + + /** + * 查询失业金申领人数 + * + * @param dto 查询参数 + * @return 人数 + */ + Long queryBenefitCount(QueryParamDto dto); + /** * 失业增长趋势 - 年度 * * @param dto 查询参数 * @return 趋势列表 */ - List unemploymentTrendYear(QueryParamDto dto); + List unemploymentMonitorTrendYear(QueryParamDto dto); /** * 失业增长趋势 - 季度 @@ -38,7 +48,7 @@ public interface ThemeUnemploymentRegisterMapper { * @param dto 查询参数 * @return 趋势列表 */ - List unemploymentTrendQuarter(QueryParamDto dto); + List unemploymentMonitorTrendQuarter(QueryParamDto dto); /** * 失业增长趋势 - 月度 @@ -46,7 +56,7 @@ public interface ThemeUnemploymentRegisterMapper { * @param dto 查询参数 * @return 趋势列表 */ - List unemploymentTrendMonth(QueryParamDto dto); + List unemploymentMonitorTrendMonth(QueryParamDto dto); /** * 查询各行业失业人数 @@ -95,4 +105,70 @@ public interface ThemeUnemploymentRegisterMapper { * @return 热力图列表 */ List heatmap(QueryParamDto dto); + + /** + * 查询各行业失业人数 + * + * @param dto 查询参数 + * @return 数 + */ + List queryByReason(QueryParamDto dto); + + /** + * 查询各行业失业人数 + * + * @param dto 查询参数 + * @return 数 + */ + List queryByDuration(QueryParamDto dto); + + + /** + * 失业人员趋势 - 年度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List unemploymentTrendYear(QueryParamDto dto); + + /** + * 失业人员趋势 - 季度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List unemploymentTrendQuarter(QueryParamDto dto); + + /** + * 失业人员趋势 - 月度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List unemploymentTrendMonth(QueryParamDto dto); + + + /** + * 16-24岁青年失业人员趋势 - 年度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List unemploymentYouthTrendYear(QueryParamDto dto); + + /** + * 16-24岁青年失业人员趋势 - 季度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List unemploymentYouthTrendQuarter(QueryParamDto dto); + + /** + * 16-24岁青年失业人员趋势 - 月度 + * + * @param dto 查询参数 + * @return 趋势列表 + */ + List unemploymentYouthTrendMonth(QueryParamDto dto); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/TestService.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/TestService.java deleted file mode 100644 index 57c9421..0000000 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/TestService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.ruoyi.cms.service; - -/** - * <类注释内容> - * - * @author 马宝龙 - * @date 2026/6/24 - */ -public interface TestService { -} 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 72d8837..a0e407e 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 @@ -166,7 +166,7 @@ public class AnalysisIndustryEmploymentInfoServiceImpl implements AnalysisIndust @Override public List ageStructure(QueryParamDto dto) { ParamUtil.dealParam(dto); - List list = themeEmploymentRegisterMapper.ageStructure(dto); + List list = themeEmploymentRegisterMapper.queryByAge(dto); // 计算占比 MathUtil.calculatePercentage(list); return list; diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisLaborForceEmploymentServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisLaborForceEmploymentServiceImpl.java index 10f35b7..c8ba2ce 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisLaborForceEmploymentServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/AnalysisLaborForceEmploymentServiceImpl.java @@ -1,26 +1,29 @@ package com.ruoyi.cms.service.impl; -import com.ruoyi.cms.constant.CommonConstant; +import com.ruoyi.cms.domain.dto.EmploymentRegisterSqlDto; import com.ruoyi.cms.domain.dto.QueryParamDto; import com.ruoyi.cms.domain.vo.HeatmapVo; import com.ruoyi.cms.domain.vo.LaborForceEmploymentOverviewVo; import com.ruoyi.cms.domain.vo.LaborForceEmploymentTargetVo; import com.ruoyi.cms.domain.vo.QueryResultVo; import com.ruoyi.cms.domain.vo.TreadVo; +import com.ruoyi.cms.mapper.ThemeAssistRecordMapper; +import com.ruoyi.cms.mapper.ThemeEmploymentRegisterMapper; +import com.ruoyi.cms.mapper.ThemeEmploymentTargetMapper; +import com.ruoyi.cms.mapper.ThemeUnemploymentRegisterMapper; import com.ruoyi.cms.service.AnalysisLaborForceEmploymentService; 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.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; +import java.time.LocalDateTime; import java.util.List; +import java.util.Optional; /** * 劳动力就业失业数据分析 @@ -31,257 +34,304 @@ import java.util.List; @Service @Validated @Slf4j +@RequiredArgsConstructor public class AnalysisLaborForceEmploymentServiceImpl implements AnalysisLaborForceEmploymentService { + private final ThemeEmploymentRegisterMapper themeEmploymentRegisterMapper; + private final ThemeUnemploymentRegisterMapper themeUnemploymentRegisterMapper; + private final ThemeAssistRecordMapper themeAssistRecordMapper; + private final ThemeEmploymentTargetMapper themeEmploymentTargetMapper; + @Override public LaborForceEmploymentOverviewVo overview(QueryParamDto dto) { + + // 计算当前时间数据 + ParamUtil.dealParam(dto); + Long totalEmploymentCount = themeEmploymentRegisterMapper.queryCumulativeCount(dto); + + EmploymentRegisterSqlDto kindEmployment = + Optional.ofNullable(themeEmploymentRegisterMapper.queryKindEmploymentCount(dto)) + .orElse(EmploymentRegisterSqlDto.builder().build()); + Long townEmploymentCount = kindEmployment.getTotalTownEmploymentCount(); + Long unEmploymentEmploymentCount = kindEmployment.getUnEmploymentEmploymentCount(); + Long employmentDifficultyEmploymentCount = kindEmployment.getEmploymentDifficultyEmploymentCount(); + + Long unemploymentCount = themeUnemploymentRegisterMapper.queryCount(dto); + + Long unemploymentBenefitCount = themeUnemploymentRegisterMapper.queryBenefitCount(dto); + + Long receiveUnemploymentServiceCount = themeAssistRecordMapper.queryUnemploymentCount(dto); + + // 计算上一时间段数据 + QueryParamDto lastDto = new QueryParamDto(); + BeanUtils.copyProperties(dto, lastDto); + ParamUtil.calculateLastTime(lastDto); + Long lastTotalEmploymentCount = themeEmploymentRegisterMapper.queryCumulativeCount(lastDto); + + EmploymentRegisterSqlDto lastKindEmployment = + Optional.ofNullable(themeEmploymentRegisterMapper.queryKindEmploymentCount(lastDto)) + .orElse(EmploymentRegisterSqlDto.builder().build()); + Long lastTownEmploymentCount = lastKindEmployment.getTotalTownEmploymentCount(); + Long lastUnEmploymentEmploymentCount = lastKindEmployment.getUnEmploymentEmploymentCount(); + Long lastEmploymentDifficultyEmploymentCount = lastKindEmployment.getEmploymentDifficultyEmploymentCount(); + + Long lastUnemploymentCount = themeUnemploymentRegisterMapper.queryCount(lastDto); + + Long lastUnemploymentBenefitCount = themeUnemploymentRegisterMapper.queryBenefitCount(lastDto); + + Long lastReceiveUnemploymentServiceCount = themeAssistRecordMapper.queryUnemploymentCount(lastDto); + return LaborForceEmploymentOverviewVo.builder() - .totalEmploymentCount(120000L) - .totalEmploymentCountMom(BigDecimal.valueOf(3.2)) - .townEmploymentCount(10000L) - .townEmploymentCountMom(BigDecimal.valueOf(-2.1)) - .unEmploymentEmploymentCount(2000L) - .unEmploymentEmploymentCountMom(BigDecimal.valueOf(6.05)) - .employmentDifficultyEmploymentCount(5000L) - .employmentDifficultyEmploymentCountMom(BigDecimal.valueOf(3.03)) - .unemploymentCount(4000L) - .unemploymentCountMom(BigDecimal.valueOf(-1.02)) - .unemploymentBenefitCount(3000L) - .unemploymentBenefitCountMom(BigDecimal.valueOf(4.01)) - .receiveUnemploymentServiceCount(1000L) - .receiveUnemploymentServiceCountMom(BigDecimal.valueOf(-3.01)) + .totalEmploymentCount(totalEmploymentCount) + .totalEmploymentCountMom( + MathUtil.calculatePercentageGrowthRate(lastTotalEmploymentCount, totalEmploymentCount)) + .townEmploymentCount(townEmploymentCount) + .townEmploymentCountMom( + MathUtil.calculatePercentageGrowthRate(lastTownEmploymentCount, townEmploymentCount)) + .unEmploymentEmploymentCount(unEmploymentEmploymentCount) + .unEmploymentEmploymentCountMom( + MathUtil.calculatePercentageGrowthRate(lastUnEmploymentEmploymentCount, + unEmploymentEmploymentCount)) + .employmentDifficultyEmploymentCount(employmentDifficultyEmploymentCount) + .employmentDifficultyEmploymentCountMom( + MathUtil.calculatePercentageGrowthRate(lastEmploymentDifficultyEmploymentCount, + employmentDifficultyEmploymentCount)) + .unemploymentCount(unemploymentCount) + .unemploymentCountMom(MathUtil.calculatePercentageGrowthRate(lastUnemploymentCount, unemploymentCount)) + .unemploymentBenefitCount(unemploymentBenefitCount) + .unemploymentBenefitCountMom( + MathUtil.calculatePercentageGrowthRate(lastUnemploymentBenefitCount, unemploymentBenefitCount)) + .receiveUnemploymentServiceCount(receiveUnemploymentServiceCount) + .receiveUnemploymentServiceCountMom( + MathUtil.calculatePercentageGrowthRate(lastReceiveUnemploymentServiceCount, + receiveUnemploymentServiceCount)) .build(); } @Override public LaborForceEmploymentTargetVo taget(QueryParamDto dto) { + + ParamUtil.dealParam(dto); + + Long townNewEmployeeCount = themeEmploymentTargetMapper.queryTownNewEmployeeCount(dto); + Long totalTownEmploymentCount = themeEmploymentRegisterMapper.queryCumulativeTownCount(dto); + return LaborForceEmploymentTargetVo.builder() - .currentFinishCount(8500L) - .overallYearFinishCount(12000L) - .finishRate(BigDecimal.valueOf(70.83)) + .currentFinishCount(totalTownEmploymentCount) + .overallYearFinishCount(townNewEmployeeCount) + .finishRate(MathUtil.calculatePercentage(townNewEmployeeCount, totalTownEmploymentCount)) .build(); } @Override public List employIndustrySituation(QueryParamDto dto) { - List list = new ArrayList<>(); - List> industryList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "第一产业"), - Tuples.of("2", "第二产业"), - Tuples.of("3", "第三产业") - ))); - for (Tuple2 industry : industryList) { - list.add(QueryResultVo.builder() - .code(industry.getT1()) - .desc(industry.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + + List list = themeEmploymentRegisterMapper.queryBySectorType(dto); MathUtil.calculatePercentage(list); + ParamUtil.fillDictName(list, "sectorType"); + return list; } @Override public List employmentGender(QueryParamDto dto) { - List list = new ArrayList<>(); - List> genderList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "男"), - Tuples.of("2", "女") - ))); - for (Tuple2 gender : genderList) { - list.add(QueryResultVo.builder() - .code(gender.getT1()) - .desc(gender.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + + List list = themeEmploymentRegisterMapper.queryByGender(dto); MathUtil.calculatePercentage(list); + ParamUtil.fillDictName(list, "gender"); + return list; } @Override public List employmentMode(QueryParamDto dto) { - List list = new ArrayList<>(); - List> modeList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "单位就业"), - Tuples.of("2", "灵活就业"), - Tuples.of("3", "个体经营"), - Tuples.of("4", "公益性岗位") - ))); - for (Tuple2 mode : modeList) { - list.add(QueryResultVo.builder() - .code(mode.getT1()) - .desc(mode.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + + List list = themeEmploymentRegisterMapper.queryByMode(dto); MathUtil.calculatePercentage(list); + ParamUtil.fillDictName(list, "employmentMode"); + return list; } @Override public List employmentHeatmap(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()); - } + + ParamUtil.dealParam(dto); + List list = themeEmploymentRegisterMapper.heatmap(dto); + // 计算占比 MathUtil.calculatePercentageHeatmap(list); return list; + } @Override public List unemploymentHeatmap(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() * 5000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + List list = themeUnemploymentRegisterMapper.heatmap(dto); + // 计算占比 MathUtil.calculatePercentageHeatmap(list); return list; } @Override public List unemploymentReason(QueryParamDto dto) { - List list = new ArrayList<>(); - List> reasonList = - 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 reason : reasonList) { - list.add(QueryResultVo.builder() - .code(reason.getT1()) - .desc(reason.getT2()) - .count((long) Math.floor(Math.random() * 10000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + + List list = themeUnemploymentRegisterMapper.queryByReason(dto); MathUtil.calculatePercentage(list); + ParamUtil.fillDictName(list, "unemploymentReason"); + return list; } @Override public List unemploymentDuration(QueryParamDto dto) { - List list = new ArrayList<>(); - List> durationList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "6个月及以下"), - Tuples.of("2", "6-12个月"), - Tuples.of("3", "1-2年"), - Tuples.of("4", "2年以上") - ))); - for (Tuple2 duration : durationList) { - list.add(QueryResultVo.builder() - .code(duration.getT1()) - .desc(duration.getT2()) - .count((long) Math.floor(Math.random() * 10000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + + List list = themeUnemploymentRegisterMapper.queryByDuration(dto); MathUtil.calculatePercentage(list); + return list; } @Override public List employmentAge(QueryParamDto dto) { - List list = new ArrayList<>(); - List> ageList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "16~30岁"), - Tuples.of("2", "30~40岁"), - Tuples.of("3", "40~50岁"), - Tuples.of("4", "50岁及以上") - ))); - for (Tuple2 age : ageList) { - list.add(QueryResultVo.builder() - .code(age.getT1()) - .desc(age.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + List list = themeEmploymentRegisterMapper.queryByAge(dto); + // 计算占比 MathUtil.calculatePercentage(list); return list; + } @Override public List employmentEducationLevel(QueryParamDto dto) { - List list = new ArrayList<>(); - List> educationList = - Collections.unmodifiableList(new ArrayList<>(Arrays.asList( - Tuples.of("1", "硕士研究生及以上"), - Tuples.of("2", "大学本科"), - Tuples.of("3", "大学专科"), - Tuples.of("4", "高中/中专"), - Tuples.of("5", "初中及以下") - ))); - for (Tuple2 education : educationList) { - list.add(QueryResultVo.builder() - .code(education.getT1()) - .desc(education.getT2()) - .count((long) Math.floor(Math.random() * 100000) + 1) - .build()); - } + + ParamUtil.dealParam(dto); + + List list = themeEmploymentRegisterMapper.queryByEducationLevel(dto); MathUtil.calculatePercentage(list); + ParamUtil.fillDictName(list, "educationLevel"); + return list; } @Override public List unemploymentTrend(QueryParamDto dto) { - List list = new ArrayList<>(); - for (int i = 0; i < 12; i++) { - list.add(TreadVo.builder() - .code(i + 1 + "") - .sort(i) - .desc(i + 1 + "月") - .currentCount((long) Math.floor(Math.random() * 5000) + 1) - .lastYearCount((long) Math.floor(Math.random() * 5000) + 1) - .build()); + + 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 = themeUnemploymentRegisterMapper.unemploymentTrendYear(dto); + 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 = themeUnemploymentRegisterMapper.unemploymentTrendQuarter(dto); + 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 = themeUnemploymentRegisterMapper.unemploymentTrendMonth(dto); + break; + } + default: + throw new ServiceException("时间类型错误"); } + + // 计算同环比 MathUtil.calculatePercentageGrowthRate(dto.getQueryTimeType(), list); + return list; } @Override public List unemploymentYouthTrend(QueryParamDto dto) { - List list = new ArrayList<>(); - for (int i = 0; i < 12; i++) { - list.add(TreadVo.builder() - .code(i + 1 + "") - .sort(i) - .desc(i + 1 + "月") - .currentCount((long) Math.floor(Math.random() * 2000) + 1) - .lastYearCount((long) Math.floor(Math.random() * 2000) + 1) - .build()); + + 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 = themeUnemploymentRegisterMapper.unemploymentYouthTrendYear(dto); + 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 = themeUnemploymentRegisterMapper.unemploymentYouthTrendQuarter(dto); + 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 = themeUnemploymentRegisterMapper.unemploymentYouthTrendMonth(dto); + break; + } + default: + throw new ServiceException("时间类型错误"); } + + // 计算同环比 MathUtil.calculatePercentageGrowthRate(dto.getQueryTimeType(), list); + return list; } @Override public List receiveUnemploymentServiceTrend(QueryParamDto dto) { - List list = new ArrayList<>(); - for (int i = 0; i < 12; i++) { - list.add(TreadVo.builder() - .code(i + 1 + "") - .sort(i) - .desc(i + 1 + "月") - .currentCount((long) Math.floor(Math.random() * 3000) + 1) - .lastYearCount((long) Math.floor(Math.random() * 3000) + 1) - .build()); + + + 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 = themeAssistRecordMapper.receiveUnemploymentServiceTrendYear(dto); + 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 = themeAssistRecordMapper.receiveUnemploymentServiceTrendQuarter(dto); + 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 = themeAssistRecordMapper.receiveUnemploymentServiceTrendMonth(dto); + break; + } + default: + throw new ServiceException("时间类型错误"); } + + // 计算同环比 MathUtil.calculatePercentageGrowthRate(dto.getQueryTimeType(), list); + return list; } } \ No newline at end of file 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 55ead2d..319c236 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 @@ -150,7 +150,7 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys themeEmploymentRegisterMapper.employmentTrendYear(dto); // 失业 List unemploymentList = - themeUnemploymentRegisterMapper.unemploymentTrendYear(dto); + themeUnemploymentRegisterMapper.unemploymentMonitorTrendYear(dto); list = dealResult(labarDemandList, employmentList, unemploymentList); break; } @@ -166,7 +166,7 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys themeEmploymentRegisterMapper.employmentTrendQuarter(dto); // 失业 List unemploymentList = - themeUnemploymentRegisterMapper.unemploymentTrendQuarter(dto); + themeUnemploymentRegisterMapper.unemploymentMonitorTrendQuarter(dto); list = dealResult(labarDemandList, employmentList, unemploymentList); break; } @@ -182,7 +182,7 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys themeEmploymentRegisterMapper.employmentTrendMonth(dto); // 失业 List unemploymentList = - themeUnemploymentRegisterMapper.unemploymentTrendMonth(dto); + themeUnemploymentRegisterMapper.unemploymentMonitorTrendMonth(dto); list = dealResult(labarDemandList, employmentList, unemploymentList); break; } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/TestServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/TestServiceImpl.java deleted file mode 100644 index cae19cd..0000000 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/TestServiceImpl.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.ruoyi.cms.service.impl; - -/** - * <类注释内容> - * - * @author 马宝龙 - * @date 2026/6/24 - */ -public class TestServiceImpl { -} 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 01d35c0..1894902 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 "sector": { return Optional.ofNullable(CommonConstant.SECTOR_MAP.get(code)).orElse("未知"); } + case "sectorType": { + return Optional.ofNullable(CommonConstant.SECTOR_TYPE_MAP.get(code)).orElse("未知"); + } case "educationLevel": { return Optional.ofNullable(CommonConstant.EDUCATION_LEVEL_MAP.get(code)).orElse("未知"); } @@ -214,6 +217,12 @@ public class ParamUtil { case "employmentCrowd": { return Optional.ofNullable(CommonConstant.EMPLOYMENT_CROWD_MAP.get(code)).orElse("未知"); } + case "employmentMode": { + return Optional.ofNullable(CommonConstant.EMPLOYMENT_MODE_MAP.get(code)).orElse("未知"); + } + case "unemploymentReason": { + return Optional.ofNullable(CommonConstant.UNEMPLOYMENT_REASON_MAP.get(code)).orElse("未知"); + } case "jobCategory": { return Optional.ofNullable(CommonConstant.JOB_CATEGORY_MAP.get(code)).orElse("未知"); } diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeAssistRecordMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeAssistRecordMapper.xml index 7d02541..12fae97 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeAssistRecordMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeAssistRecordMapper.xml @@ -80,6 +80,19 @@ + + + + + + + + + \ 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 4092b19..798488e 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentRegisterMapper.xml @@ -40,6 +40,66 @@ + + + + + + - + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentTargetMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentTargetMapper.xml new file mode 100644 index 0000000..214fead --- /dev/null +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeEmploymentTargetMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ 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 0f34219..0c1070c 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/ThemeUnemploymentRegisterMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeUnemploymentRegisterMapper.xml @@ -25,6 +25,28 @@ AND (ABE586 IS NULL OR ABE586 > #{endTime}) + + + ADC210 BETWEEN r.start_time AND r.end_time + + AND AAB301 = #{area} + + + AND AAB022 LIKE #{industry} || '%' + + + AND ( + + AAB022 LIKE #{industry} || '%' + + ) + + + AND AAB023 = #{sector} + + + AND (ABE586 IS NULL OR ABE586 > #{endTime}) + + + SELECT COUNT(DISTINCT AAC044) + FROM theme_unemployment_register + WHERE + + + AND AJC174 = '1' + + + + + - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sql/datadashboard/table.sql b/sql/datadashboard/table.sql index 8eae4f6..7feb971 100644 --- a/sql/datadashboard/table.sql +++ b/sql/datadashboard/table.sql @@ -24,6 +24,7 @@ CREATE TABLE shz_data_dashboard.theme_employment_register "AAB019" character varying(10) COLLATE pg_catalog."default", "AAB022" character varying(10) COLLATE pg_catalog."default", "AAB023" character varying(10) COLLATE pg_catalog."default", + "AAB024" character varying(10) COLLATE pg_catalog."default", "AAB020" character varying(10) COLLATE pg_catalog."default", "AAE006" character varying(255) COLLATE pg_catalog."default", "ACC321" integer, @@ -109,6 +110,9 @@ ON COLUMN shz_data_dashboard.theme_employment_register."AAB022" IS '所属行业 COMMENT ON COLUMN shz_data_dashboard.theme_employment_register."AAB023" IS '所属产业'; +COMMENT +ON COLUMN shz_data_dashboard.theme_employment_register."AAB024" IS '产业类型'; + COMMENT ON COLUMN shz_data_dashboard.theme_employment_register."AAB020" IS '经济类型'; @@ -376,7 +380,8 @@ CREATE TABLE shz_data_dashboard.theme_unemployment_register "AAB023" character varying(10) COLLATE pg_catalog."default", "AAB020" character varying(10) COLLATE pg_catalog."default", "ACA112" character varying(10) COLLATE pg_catalog."default", - "AAC004" character varying(10) COLLATE pg_catalog."default" + "AAC004" character varying(10) COLLATE pg_catalog."default", + "AAC006" timestamp without time zone ) ; @@ -461,6 +466,9 @@ ON COLUMN shz_data_dashboard.theme_unemployment_register."ACA112" IS '工种名 COMMENT ON COLUMN shz_data_dashboard.theme_unemployment_register."AAC004" IS '性别'; +COMMENT +ON COLUMN shz_data_dashboard.theme_employment_register."AAC006" IS '出生日期'; + COMMENT ON TABLE shz_data_dashboard.theme_unemployment_register IS '失业登记主题库'; @@ -856,7 +864,7 @@ COMMENT ON COLUMN shz_data_dashboard.theme_professional_train.sector IS '产业'; COMMENT -ON COLUMN shz_data_dashboard.theme_key_group.group_type IS '人员类型'; +ON COLUMN shz_data_dashboard.theme_professional_train.group_type IS '人员类型'; COMMENT ON TABLE shz_data_dashboard.theme_professional_train IS '职业培训主题库'; @@ -1056,6 +1064,42 @@ COMMENT ON TABLE shz_data_dashboard.theme_economy_indicator IS '经济指标主题库'; +-- 就业目标主题库 +CREATE TABLE shz_data_dashboard.theme_employment_target +( + + area_name character varying(20) NOT NULL COLLATE pg_catalog."default", + area_code character varying(20) NOT NULL COLLATE pg_catalog."default", + year character varying(10) NOT NULL COLLATE pg_catalog."default", + town_newly_employment_count numeric(18), + unemployment_employment_count numeric(18), + employment_difficult_employment_count numeric(18) +) +; + +ALTER TABLE shz_data_dashboard.theme_employment_target + OWNER TO sysdba; + +COMMENT +ON COLUMN shz_data_dashboard.theme_employment_target.area_name IS '区域'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_employment_target.area_code IS '区划代码'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_employment_target.year IS '年份(如“2024”)'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_employment_target.town_newly_employment_count IS '城镇新增就业目标(单位:人)'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_employment_target.unemployment_employment_count IS '失业人员再就业目标(单位:人)'; + +COMMENT +ON COLUMN shz_data_dashboard.theme_employment_target.employment_difficult_employment_count IS '就业困难实现就业目标(单位:人)'; + +COMMENT +ON TABLE shz_data_dashboard.theme_employment_target IS '就业目标主题库';