添加功能
This commit is contained in:
@@ -2,8 +2,10 @@ package com.ruoyi.cms.service;
|
||||
|
||||
import com.ruoyi.cms.domain.dto.QueryParamDto;
|
||||
import com.ruoyi.cms.domain.vo.IndustryEmploymentInfoOverviewVo;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import com.ruoyi.cms.domain.vo.QueryResultVo;
|
||||
import com.ruoyi.cms.domain.vo.TreadVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 行业就业情况信息分析
|
||||
@@ -21,4 +23,45 @@ public interface AnalysisIndustryEmploymentInfoService {
|
||||
* @return 数据总览
|
||||
*/
|
||||
IndustryEmploymentInfoOverviewVo overview(QueryParamDto dto);
|
||||
|
||||
|
||||
/**
|
||||
* 行业就业规模与增长趋势
|
||||
*
|
||||
* @param dto 查询参数
|
||||
* @return 趋势列表
|
||||
*/
|
||||
List<TreadVo> scaleAndTrend(QueryParamDto dto);
|
||||
|
||||
/**
|
||||
* 行业就业规模对比
|
||||
*
|
||||
* @param dto 查询参数
|
||||
* @return 结果列表
|
||||
*/
|
||||
List<QueryResultVo> scaleComparison(QueryParamDto dto);
|
||||
|
||||
/**
|
||||
* 就业结构分析
|
||||
*
|
||||
* @param dto 查询参数
|
||||
* @return 结果列表
|
||||
*/
|
||||
List<QueryResultVo> structure(QueryParamDto dto);
|
||||
|
||||
/**
|
||||
* 人员年龄结构
|
||||
*
|
||||
* @param dto 查询参数
|
||||
* @return 结果列表
|
||||
*/
|
||||
List<QueryResultVo> ageStructure(QueryParamDto dto);
|
||||
|
||||
/**
|
||||
* 薪酬水平对标
|
||||
*
|
||||
* @param dto 查询参数
|
||||
* @return 结果列表
|
||||
*/
|
||||
List<QueryResultVo> salaryLevel(QueryParamDto dto);
|
||||
}
|
||||
|
||||
@@ -36,27 +36,9 @@ public class AnalysisCommonServiceImpl implements AnalysisCommonService {
|
||||
@Override
|
||||
public List<DictVo> industryList() {
|
||||
List<DictVo> list = new ArrayList<>();
|
||||
|
||||
list.add(DictVo.builder().code("A").desc("农、林、牧、渔业").build());
|
||||
list.add(DictVo.builder().code("B").desc("采矿业").build());
|
||||
list.add(DictVo.builder().code("C").desc("制造业").build());
|
||||
list.add(DictVo.builder().code("D").desc("电力、热力、燃气及水生产和供应业").build());
|
||||
list.add(DictVo.builder().code("E").desc("建筑业").build());
|
||||
list.add(DictVo.builder().code("F").desc("批发和零售业").build());
|
||||
list.add(DictVo.builder().code("G").desc("交通运输、仓储和邮政业").build());
|
||||
list.add(DictVo.builder().code("H").desc("住宿和餐饮业").build());
|
||||
list.add(DictVo.builder().code("I").desc("信息传输、软件和信息技术服务业").build());
|
||||
list.add(DictVo.builder().code("J").desc("金融业").build());
|
||||
list.add(DictVo.builder().code("K").desc("房地产业").build());
|
||||
list.add(DictVo.builder().code("L").desc("租赁和商务服务业").build());
|
||||
list.add(DictVo.builder().code("M").desc("科学研究和技术服务业").build());
|
||||
list.add(DictVo.builder().code("N").desc("水利、环境和公共设施管理业").build());
|
||||
list.add(DictVo.builder().code("O").desc("居民服务、修理和其他服务业").build());
|
||||
list.add(DictVo.builder().code("P").desc("教育").build());
|
||||
list.add(DictVo.builder().code("Q").desc("卫生和社会工作").build());
|
||||
list.add(DictVo.builder().code("R").desc("文化、体育和娱乐业").build());
|
||||
list.add(DictVo.builder().code("S").desc("公共管理、社会保障和社会组织").build());
|
||||
list.add(DictVo.builder().code("T").desc("国际组织").build());
|
||||
for (Tuple2<String, String> industry : CommonConstant.INDUSTRY_LIST) {
|
||||
list.add(DictVo.builder().code(industry.getT1()).desc(industry.getT2()).build());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
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.IndustryEmploymentInfoOverviewVo;
|
||||
import com.ruoyi.cms.domain.vo.QueryResultVo;
|
||||
import com.ruoyi.cms.domain.vo.TreadVo;
|
||||
import com.ruoyi.cms.service.AnalysisIndustryEmploymentInfoService;
|
||||
import com.ruoyi.cms.util.MathUtil;
|
||||
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.util.List;
|
||||
|
||||
/**
|
||||
* 行业就业情况信息分析
|
||||
@@ -40,4 +51,96 @@ public class AnalysisIndustryEmploymentInfoServiceImpl implements AnalysisIndust
|
||||
.averageSalaryMom(BigDecimal.valueOf(-3.3))
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreadVo> scaleAndTrend(QueryParamDto dto) {
|
||||
|
||||
List<TreadVo> 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() * 10000) + 1)
|
||||
.lastYearCount((long) Math.floor(Math.random() * 10000) + 1)
|
||||
.build());
|
||||
}
|
||||
|
||||
// 计算同环比
|
||||
MathUtil.calculatePercentageGrowthRate(dto.getQueryTimeType(), list);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QueryResultVo> scaleComparison(QueryParamDto dto) {
|
||||
List<QueryResultVo> list = new ArrayList<>();
|
||||
for (Tuple2<String, String> industry : CommonConstant.INDUSTRY_LIST) {
|
||||
list.add(QueryResultVo.builder()
|
||||
.code(industry.getT1())
|
||||
.desc(industry.getT2())
|
||||
.count((long) Math.floor(Math.random() * 100000) + 1)
|
||||
.build());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QueryResultVo> structure(QueryParamDto dto) {
|
||||
List<QueryResultVo> list = new ArrayList<>();
|
||||
List<Tuple2<String, String>> structureList =
|
||||
Collections.unmodifiableList(new ArrayList<>(Arrays.asList(
|
||||
Tuples.of("1", "管理层"),
|
||||
Tuples.of("2", "专业技术"),
|
||||
Tuples.of("3", "技能工人"),
|
||||
Tuples.of("4", "一般员工")
|
||||
)));
|
||||
for (Tuple2<String, String> structure : structureList) {
|
||||
list.add(QueryResultVo.builder()
|
||||
.code(structure.getT1())
|
||||
.desc(structure.getT2())
|
||||
.count((long) Math.floor(Math.random() * 100000) + 1)
|
||||
.build());
|
||||
}
|
||||
// 计算占比
|
||||
MathUtil.calculatePercentage(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QueryResultVo> ageStructure(QueryParamDto dto) {
|
||||
List<QueryResultVo> list = new ArrayList<>();
|
||||
List<Tuple2<String, String>> structureList =
|
||||
Collections.unmodifiableList(new ArrayList<>(Arrays.asList(
|
||||
Tuples.of("1", "16-25岁"),
|
||||
Tuples.of("2", "26-35岁"),
|
||||
Tuples.of("3", "36-45岁"),
|
||||
Tuples.of("4", "46-55岁"),
|
||||
Tuples.of("5", "55岁以上")
|
||||
)));
|
||||
for (Tuple2<String, String> structure : structureList) {
|
||||
list.add(QueryResultVo.builder()
|
||||
.code(structure.getT1())
|
||||
.desc(structure.getT2())
|
||||
.count((long) Math.floor(Math.random() * 100000) + 1)
|
||||
.build());
|
||||
}
|
||||
// 计算占比
|
||||
MathUtil.calculatePercentage(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QueryResultVo> salaryLevel(QueryParamDto dto) {
|
||||
List<QueryResultVo> list = new ArrayList<>();
|
||||
for (Tuple2<String, String> industry : CommonConstant.INDUSTRY_LIST) {
|
||||
list.add(QueryResultVo.builder()
|
||||
.code(industry.getT1())
|
||||
.desc(industry.getT2())
|
||||
.amount(new BigDecimal(Math.random() * 100000 + 1).setScale(2, RoundingMode.HALF_UP))
|
||||
.anotherAmount(new BigDecimal(Math.random() * 100000 + 1).setScale(2, RoundingMode.HALF_UP))
|
||||
.build());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user