添加功能
This commit is contained in:
@@ -13,6 +13,14 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface ThemeProfessionalTrainMapper {
|
public interface ThemeProfessionalTrainMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数量
|
||||||
|
*
|
||||||
|
* @param dto 查询参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Long queryCount(QueryParamDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过技能等级查询
|
* 通过技能等级查询
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -60,8 +61,15 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ
|
|||||||
// 计算当前时间数据
|
// 计算当前时间数据
|
||||||
ParamUtil.dealParam(dto);
|
ParamUtil.dealParam(dto);
|
||||||
BigDecimal sectorAmount = themeSectorDevelopMapper.querySectorAmount(dto);
|
BigDecimal sectorAmount = themeSectorDevelopMapper.querySectorAmount(dto);
|
||||||
|
if (Objects.nonNull(sectorAmount)) {
|
||||||
|
sectorAmount = MathUtil.divide(new BigDecimal("100000000"), sectorAmount);
|
||||||
|
}
|
||||||
|
|
||||||
BigDecimal companyNewInvestmentAmount = themeSectorDevelopMapper.queryCompanyNewInvestmentAmount(dto);
|
BigDecimal companyNewInvestmentAmount = themeSectorDevelopMapper.queryCompanyNewInvestmentAmount(dto);
|
||||||
|
if (Objects.nonNull(companyNewInvestmentAmount)) {
|
||||||
|
companyNewInvestmentAmount = MathUtil.divide(new BigDecimal("100000000"),
|
||||||
|
companyNewInvestmentAmount);
|
||||||
|
}
|
||||||
|
|
||||||
Long talentDemandCount = Optional.ofNullable(themeRecruitmentJobMapper.queryDemandCount(dto))
|
Long talentDemandCount = Optional.ofNullable(themeRecruitmentJobMapper.queryDemandCount(dto))
|
||||||
.orElse(0L);
|
.orElse(0L);
|
||||||
@@ -75,6 +83,8 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ
|
|||||||
|
|
||||||
Long startupCompanyCount = themeSectorDevelopMapper.queryStartupCompanyCount(dto);
|
Long startupCompanyCount = themeSectorDevelopMapper.queryStartupCompanyCount(dto);
|
||||||
|
|
||||||
|
Long skillTrainCount = themeProfessionalTrainMapper.queryCount(dto);
|
||||||
|
|
||||||
// 计算上一时间段数据
|
// 计算上一时间段数据
|
||||||
QueryParamDto lastDto = new QueryParamDto();
|
QueryParamDto lastDto = new QueryParamDto();
|
||||||
BeanUtils.copyProperties(dto, lastDto);
|
BeanUtils.copyProperties(dto, lastDto);
|
||||||
@@ -97,6 +107,8 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ
|
|||||||
|
|
||||||
Long lastStartupCompanyCount = themeSectorDevelopMapper.queryStartupCompanyCount(lastDto);
|
Long lastStartupCompanyCount = themeSectorDevelopMapper.queryStartupCompanyCount(lastDto);
|
||||||
|
|
||||||
|
Long lastSkillTrainCount = themeProfessionalTrainMapper.queryCount(lastDto);
|
||||||
|
|
||||||
return SectorTalentOverviewVo.builder()
|
return SectorTalentOverviewVo.builder()
|
||||||
.sectorAmount(sectorAmount)
|
.sectorAmount(sectorAmount)
|
||||||
.sectorAmountMom(MathUtil.calculatePercentageGrowthRate(lastSectorAmount, sectorAmount))
|
.sectorAmountMom(MathUtil.calculatePercentageGrowthRate(lastSectorAmount, sectorAmount))
|
||||||
@@ -117,6 +129,8 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ
|
|||||||
.startupCompanyCount(startupCompanyCount)
|
.startupCompanyCount(startupCompanyCount)
|
||||||
.startupCompanyCountMom(
|
.startupCompanyCountMom(
|
||||||
MathUtil.calculatePercentageGrowthRate(lastStartupCompanyCount, startupCompanyCount))
|
MathUtil.calculatePercentageGrowthRate(lastStartupCompanyCount, startupCompanyCount))
|
||||||
|
.skillTrainCount(skillTrainCount)
|
||||||
|
.skillTrainCountMom(MathUtil.calculatePercentageGrowthRate(lastSkillTrainCount, skillTrainCount))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,17 +245,32 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ
|
|||||||
.orElse(SectorTalentTreadVo.builder().build());
|
.orElse(SectorTalentTreadVo.builder().build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BigDecimal sectorInvestmentAmount = vo.getSectorInvestmentAmount();
|
||||||
|
if (Objects.nonNull(sectorInvestmentAmount)) {
|
||||||
|
sectorInvestmentAmount = MathUtil.divide(new BigDecimal("100000000"),
|
||||||
|
sectorInvestmentAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal lastSectorIncreaseValue = lastSector.getSectorIncreaseValue();
|
||||||
|
if (Objects.nonNull(lastSectorIncreaseValue)) {
|
||||||
|
lastSectorIncreaseValue = MathUtil.divide(new BigDecimal("100000000"),
|
||||||
|
lastSectorIncreaseValue);
|
||||||
|
}
|
||||||
|
|
||||||
BigDecimal sectorIncreaseValue = Optional.ofNullable(vo.getSectorIncreaseValue())
|
BigDecimal sectorIncreaseValue = Optional.ofNullable(vo.getSectorIncreaseValue())
|
||||||
.orElse(BigDecimal.ZERO)
|
.orElse(BigDecimal.ZERO)
|
||||||
.subtract(Optional.ofNullable(lastSector.getSectorIncreaseValue()).orElse(BigDecimal.ZERO));
|
.subtract(Optional.ofNullable(lastSector.getSectorIncreaseValue()).orElse(BigDecimal.ZERO));
|
||||||
|
sectorInvestmentAmount = MathUtil.divide(new BigDecimal("100000000"),
|
||||||
|
sectorInvestmentAmount);
|
||||||
|
|
||||||
|
|
||||||
list.add(SectorTalentTreadVo.builder()
|
list.add(SectorTalentTreadVo.builder()
|
||||||
.code(vo.getCode())
|
.code(vo.getCode())
|
||||||
.desc(vo.getDesc())
|
.desc(vo.getDesc())
|
||||||
.jobDemandCount(lobarDemand.getLaborDemandCount())
|
.jobDemandCount(lobarDemand.getLaborDemandCount())
|
||||||
.sectorInvestmentAmount(vo.getSectorInvestmentAmount())
|
.sectorInvestmentAmount(sectorInvestmentAmount)
|
||||||
.sectorIncreaseValue(sectorIncreaseValue)
|
.sectorIncreaseValue(sectorIncreaseValue)
|
||||||
.growthRate(MathUtil.calculatePercentage(lastSector.getSectorIncreaseValue(), sectorIncreaseValue))
|
.growthRate(MathUtil.calculatePercentage(lastSectorIncreaseValue, sectorIncreaseValue))
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -323,23 +352,12 @@ public class AnalysisSectorTalentServiceImpl implements AnalysisSectorTalentServ
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<HeatmapVo> heatmap(QueryParamDto dto) {
|
public List<HeatmapVo> heatmap(QueryParamDto dto) {
|
||||||
List<HeatmapVo> list = new ArrayList<>();
|
|
||||||
for (Tuple2<String, String> area : CommonConstant.AREA_LIST) {
|
ParamUtil.dealParam(dto);
|
||||||
list.add(HeatmapVo.builder()
|
List<HeatmapVo> list = themeRecruitmentJobMapper.heatmap(dto);
|
||||||
.areaCode(area.getT1())
|
// 计算占比
|
||||||
.areaName(area.getT2())
|
MathUtil.calculatePercentageHeatmap(list);
|
||||||
.count((long) Math.floor(Math.random() * 10000) + 1)
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
long totalCount = list.stream().mapToLong(HeatmapVo::getCount).sum();
|
|
||||||
for (HeatmapVo vo : list) {
|
|
||||||
if (totalCount > 0) {
|
|
||||||
vo.setPercentage(new BigDecimal(vo.getCount())
|
|
||||||
.divide(BigDecimal.valueOf(totalCount), 4, RoundingMode.HALF_UP)
|
|
||||||
.multiply(BigDecimal.valueOf(100))
|
|
||||||
.setScale(2, RoundingMode.HALF_UP));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,8 +5,6 @@ import com.ruoyi.cms.constant.enums.QueryTimeTypeEnum;
|
|||||||
import com.ruoyi.cms.domain.vo.HeatmapVo;
|
import com.ruoyi.cms.domain.vo.HeatmapVo;
|
||||||
import com.ruoyi.cms.domain.vo.QueryResultVo;
|
import com.ruoyi.cms.domain.vo.QueryResultVo;
|
||||||
import com.ruoyi.cms.domain.vo.TreadVo;
|
import com.ruoyi.cms.domain.vo.TreadVo;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -57,6 +55,24 @@ public class MathUtil {
|
|||||||
return new BigDecimal(plainString);
|
return new BigDecimal(plainString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算比率
|
||||||
|
*
|
||||||
|
* @param divisor 除数(分母)
|
||||||
|
* @param dividend 被除数(分子)
|
||||||
|
* @return 比率
|
||||||
|
*/
|
||||||
|
public static BigDecimal divide(BigDecimal divisor, BigDecimal dividend) {
|
||||||
|
|
||||||
|
if (Objects.isNull(divisor) || Objects.isNull(dividend)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String plainString = dividend.divide(divisor, 2, RoundingMode.HALF_UP)
|
||||||
|
.stripTrailingZeros().toPlainString();
|
||||||
|
return new BigDecimal(plainString);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算比率
|
* 计算比率
|
||||||
|
|||||||
@@ -10,6 +10,17 @@
|
|||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<select id="queryCount"
|
||||||
|
parameterType="com.ruoyi.cms.domain.dto.QueryParamDto"
|
||||||
|
resultType="java.lang.Long">
|
||||||
|
|
||||||
|
SELECT COUNT(DISTINCT AAC044)
|
||||||
|
FROM theme_professional_train
|
||||||
|
WHERE
|
||||||
|
<!-- 引入公共条件 -->
|
||||||
|
<include refid="commonConditions"/>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="queryBySkillLevel"
|
<select id="queryBySkillLevel"
|
||||||
parameterType="com.ruoyi.cms.domain.dto.QueryParamDto"
|
parameterType="com.ruoyi.cms.domain.dto.QueryParamDto"
|
||||||
resultType="com.ruoyi.cms.domain.vo.QueryResultVo">
|
resultType="com.ruoyi.cms.domain.vo.QueryResultVo">
|
||||||
|
|||||||
@@ -761,7 +761,7 @@ CREATE TABLE shz_data_dashboard.theme_professional_train
|
|||||||
jglx character varying(200) COLLATE pg_catalog."default",
|
jglx character varying(200) COLLATE pg_catalog."default",
|
||||||
qh character varying(200) COLLATE pg_catalog."default",
|
qh character varying(200) COLLATE pg_catalog."default",
|
||||||
zsbh character varying(200) COLLATE pg_catalog."default",
|
zsbh character varying(200) COLLATE pg_catalog."default",
|
||||||
sfzh character varying(200) COLLATE pg_catalog."default",
|
sfhg character varying(10) COLLATE pg_catalog."default",
|
||||||
jndj character varying(200) COLLATE pg_catalog."default",
|
jndj character varying(200) COLLATE pg_catalog."default",
|
||||||
cxxylb character varying(200) COLLATE pg_catalog."default",
|
cxxylb character varying(200) COLLATE pg_catalog."default",
|
||||||
cxxyzt character varying(200) COLLATE pg_catalog."default",
|
cxxyzt character varying(200) COLLATE pg_catalog."default",
|
||||||
@@ -780,13 +780,13 @@ ALTER TABLE shz_data_dashboard.theme_professional_train
|
|||||||
OWNER TO sysdba;
|
OWNER TO sysdba;
|
||||||
|
|
||||||
COMMENT
|
COMMENT
|
||||||
ON COLUMN shz_data_dashboard.theme_unemployment_register."AAC043" IS '证件类型';
|
ON COLUMN shz_data_dashboard.theme_professional_train."AAC043" IS '证件类型';
|
||||||
|
|
||||||
COMMENT
|
COMMENT
|
||||||
ON COLUMN shz_data_dashboard.theme_unemployment_register."AAC044" IS '证件号码';
|
ON COLUMN shz_data_dashboard.theme_professional_train."AAC044" IS '证件号码';
|
||||||
|
|
||||||
COMMENT
|
COMMENT
|
||||||
ON COLUMN shz_data_dashboard.theme_unemployment_register."AAC003" IS '姓名';
|
ON COLUMN shz_data_dashboard.theme_professional_train."AAC003" IS '姓名';
|
||||||
|
|
||||||
COMMENT
|
COMMENT
|
||||||
ON COLUMN shz_data_dashboard.theme_professional_train.pxkssj IS '培训开始时间';
|
ON COLUMN shz_data_dashboard.theme_professional_train.pxkssj IS '培训开始时间';
|
||||||
|
|||||||
Reference in New Issue
Block a user