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 c4db1cc..1f87090 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
@@ -39,7 +39,7 @@ public interface ThemeRecruitmentJobMapper {
* @param dto 查询参数
* @return 数
*/
- Long queryEmploymentDemandCount(QueryParamDto dto);
+ Long queryDemandCount(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
new file mode 100644
index 0000000..331a310
--- /dev/null
+++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ThemeSectorDevelopMapper.java
@@ -0,0 +1,39 @@
+package com.ruoyi.cms.mapper;
+
+import com.ruoyi.cms.domain.dto.QueryParamDto;
+
+import java.math.BigDecimal;
+
+/**
+ * 产业发展主题库
+ *
+ * @author 马宝龙
+ * @date 2026/7/10
+ */
+public interface ThemeSectorDevelopMapper {
+
+ /**
+ * 查询产业产值
+ *
+ * @param dto 查询参数
+ * @return 结果
+ */
+ BigDecimal querySectorAmount(QueryParamDto dto);
+
+ /**
+ * 查询企业新增投资额
+ *
+ * @param dto 查询参数
+ * @return 结果
+ */
+ BigDecimal queryCompanyNewInvestmentAmount(QueryParamDto dto);
+
+ /**
+ * 查询创业企业数
+ *
+ * @param dto 查询参数
+ * @return 结果
+ */
+ Long queryStartupCompanyCount(QueryParamDto dto);
+
+}
\ No newline at end of file
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 691b282..485dead 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
@@ -59,7 +59,7 @@ public class AnalysisIndustryEmploymentInfoServiceImpl implements AnalysisIndust
Long flexibleEmploymentCount = themeEmploymentRegisterMapper.queryFlexibleEmploymentCount(dto);
- Long recruitmentDemand = themeRecruitmentJobMapper.queryEmploymentDemandCount(dto);
+ Long recruitmentDemand = themeRecruitmentJobMapper.queryDemandCount(dto);
BigDecimal averageSalary = themeEmploymentRegisterMapper.queryAverageSalary(dto);
@@ -80,7 +80,7 @@ public class AnalysisIndustryEmploymentInfoServiceImpl implements AnalysisIndust
Long lastFlexibleEmploymentCount = themeEmploymentRegisterMapper.queryFlexibleEmploymentCount(lastDto);
- Long lastRecruitmentDemand = themeRecruitmentJobMapper.queryEmploymentDemandCount(lastDto);
+ Long lastRecruitmentDemand = themeRecruitmentJobMapper.queryDemandCount(lastDto);
BigDecimal lastAverageSalary = themeEmploymentRegisterMapper.queryAverageSalary(lastDto);
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 a122536..99bc0a8 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
@@ -69,7 +69,7 @@ public class AnalysisLaborForceRecruitmentDemandServiceImpl implements AnalysisL
ParamUtil.dealParam(dto);
Long recruitmentJobCount = themeRecruitmentJobMapper.queryRecruitmentJobCount(dto);
- Long recruitmentCount = themeRecruitmentJobMapper.queryEmploymentDemandCount(dto);
+ Long recruitmentCount = themeRecruitmentJobMapper.queryDemandCount(dto);
BigDecimal marketCommitmentSalary = themeRecruitmentJobMapper.queryAverageSalary(dto);
@@ -85,7 +85,7 @@ public class AnalysisLaborForceRecruitmentDemandServiceImpl implements AnalysisL
ParamUtil.calculateLastTime(lastDto);
Long lastRecruitmentJobCount = themeRecruitmentJobMapper.queryRecruitmentJobCount(lastDto);
- Long lastRecruitmentCount = themeRecruitmentJobMapper.queryEmploymentDemandCount(lastDto);
+ Long lastRecruitmentCount = themeRecruitmentJobMapper.queryDemandCount(lastDto);
BigDecimal lastMarketCommitmentSalary = themeRecruitmentJobMapper.queryAverageSalary(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 eae28bf..d9d87a0 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
@@ -74,7 +74,7 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys
EmploymentRegisterSqlDto kindEmploymentCount = themeEmploymentRegisterMapper.queryKindEmploymentCount(dto);
- Long employmentDemandCount = themeRecruitmentJobMapper.queryEmploymentDemandCount(dto);
+ Long employmentDemandCount = themeRecruitmentJobMapper.queryDemandCount(dto);
Long unemploymentCount = themeUnemploymentRegisterMapper.queryUnemploymentCount(dto);
@@ -94,7 +94,7 @@ public class AnalysisMajorIndustryEmploymentMonitorServiceImpl implements Analys
EmploymentRegisterSqlDto lastKindEmploymentCount =
themeEmploymentRegisterMapper.queryKindEmploymentCount(lastDto);
- Long lastEmploymentDemandCount = themeRecruitmentJobMapper.queryEmploymentDemandCount(lastDto);
+ Long lastEmploymentDemandCount = themeRecruitmentJobMapper.queryDemandCount(lastDto);
Long lastUnemploymentCount = themeUnemploymentRegisterMapper.queryUnemploymentCount(lastDto);
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 41d3c27..23ae0a9 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
@@ -7,8 +7,14 @@ 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.ThemeJobSeekerMapper;
+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.utils.bean.BeanUtils;
+import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -21,6 +27,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Optional;
/**
* 产业发展与人才供需分析
@@ -31,25 +38,76 @@ import java.util.List;
@Service
@Validated
@Slf4j
+@RequiredArgsConstructor
public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentService {
+ private final ThemeSectorDevelopMapper themeSectorDevelopMapper;
+ private final ThemeRecruitmentJobMapper themeRecruitmentJobMapper;
+ private final ThemeJobSeekerMapper themeJobSeekerMapper;
+
@Override
public SectorTalentOverviewVo overview(QueryParamDto dto) {
+
+ // 计算当前时间数据
+ ParamUtil.dealParam(dto);
+ BigDecimal sectorAmount = themeSectorDevelopMapper.querySectorAmount(dto);
+
+ BigDecimal companyNewInvestmentAmount = themeSectorDevelopMapper.queryCompanyNewInvestmentAmount(dto);
+
+ Long talentDemandCount = Optional.ofNullable(themeRecruitmentJobMapper.queryDemandCount(dto))
+ .orElse(0L);
+
+ Long talentSupplyCount = Optional.ofNullable(themeJobSeekerMapper.querySupplyCount(dto))
+ .orElse(0L);
+
+ BigDecimal supplyDemandMatchingDegree = MathUtil.calculatePercentage(talentDemandCount, talentSupplyCount);
+
+ Long talentGapCount = talentDemandCount > talentSupplyCount ? talentDemandCount - talentSupplyCount : 0L;
+
+ Long startupCompanyCount = themeSectorDevelopMapper.queryStartupCompanyCount(dto);
+
+ // 计算上一时间段数据
+ QueryParamDto lastDto = new QueryParamDto();
+ BeanUtils.copyProperties(dto, lastDto);
+ ParamUtil.calculateLastTime(lastDto);
+ BigDecimal lastSectorAmount = themeSectorDevelopMapper.querySectorAmount(lastDto);
+
+ BigDecimal lastCompanyNewInvestmentAmount = themeSectorDevelopMapper.queryCompanyNewInvestmentAmount(lastDto);
+
+ Long lastTalentDemandCount = Optional.ofNullable(themeRecruitmentJobMapper.queryDemandCount(lastDto))
+ .orElse(0L);
+
+ Long lastTalentSupplyCount = Optional.ofNullable(themeJobSeekerMapper.querySupplyCount(lastDto))
+ .orElse(0L);
+
+ BigDecimal lastSupplyDemandMatchingDegree = MathUtil.calculatePercentage(lastTalentDemandCount,
+ lastTalentSupplyCount);
+
+ Long lastTalentGapCount = lastTalentDemandCount > lastTalentSupplyCount ?
+ lastTalentDemandCount - lastTalentSupplyCount : 0L;
+
+ Long lastStartupCompanyCount = themeSectorDevelopMapper.queryStartupCompanyCount(lastDto);
+
return SectorTalentOverviewVo.builder()
- .sectorAmount(BigDecimal.valueOf(156.8))
- .sectorAmountMom(BigDecimal.valueOf(5.2))
- .companyNewInvestmentAmount(BigDecimal.valueOf(23.5))
- .companyNewInvestmentAmountMom(BigDecimal.valueOf(8.1))
- .talentDemandCount(32000L)
- .talentDemandCountMom(BigDecimal.valueOf(6.5))
- .talentSupplyCount(28500L)
- .talentSupplyCountMom(BigDecimal.valueOf(4.3))
- .supplyDemandMatchingDegree(BigDecimal.valueOf(85.6))
- .supplyDemandMatchingDegreeMom(BigDecimal.valueOf(2.1))
- .talentGapCount(3500L)
- .talentGapCountMom(BigDecimal.valueOf(-3.2))
- .skillTrainCount(12000L)
- .skillTrainCountMom(BigDecimal.valueOf(12.5))
+ .sectorAmount(sectorAmount)
+ .sectorAmountMom(MathUtil.calculatePercentageGrowthRate(lastSectorAmount, sectorAmount))
+ .companyNewInvestmentAmount(companyNewInvestmentAmount)
+ .companyNewInvestmentAmountMom(
+ MathUtil.calculatePercentageGrowthRate(lastCompanyNewInvestmentAmount,
+ companyNewInvestmentAmount))
+ .talentDemandCount(talentDemandCount)
+ .talentDemandCountMom(MathUtil.calculatePercentageGrowthRate(lastTalentDemandCount, talentDemandCount))
+ .talentSupplyCount(talentSupplyCount)
+ .talentSupplyCountMom(MathUtil.calculatePercentageGrowthRate(lastTalentSupplyCount, talentSupplyCount))
+ .supplyDemandMatchingDegree(supplyDemandMatchingDegree)
+ .supplyDemandMatchingDegreeMom(
+ MathUtil.calculatePercentageGrowthRate(lastSupplyDemandMatchingDegree,
+ supplyDemandMatchingDegree))
+ .talentGapCount(talentGapCount)
+ .talentGapCountMom(MathUtil.calculatePercentageGrowthRate(lastTalentGapCount, talentGapCount))
+ .startupCompanyCount(startupCompanyCount)
+ .startupCompanyCountMom(
+ MathUtil.calculatePercentageGrowthRate(lastStartupCompanyCount, startupCompanyCount))
.build();
}
diff --git a/ruoyi-bussiness/src/main/resources/mapper/ThemeJobSeekerMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ThemeJobSeekerMapper.xml
index 3a0045a..041ddcb 100644
--- a/ruoyi-bussiness/src/main/resources/mapper/ThemeJobSeekerMapper.xml
+++ b/ruoyi-bussiness/src/main/resources/mapper/ThemeJobSeekerMapper.xml
@@ -10,6 +10,19 @@
AND area = #{area}
+
+ AND industry LIKE #{industry} || '%'
+
+
+ AND (
+
+ industry LIKE #{industry} || '%'
+
+ )
+
+
+ AND sector = #{sector}
+
-