updates
This commit is contained in:
parent
51863a9b0c
commit
a5727d175d
|
|
@ -2,19 +2,34 @@ package org.jeecg.modules.mini.controller;
|
|||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.AssertUtils;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.modules.mini.service.MiniTestCulturalService;
|
||||
import org.jeecg.modules.web.dto.ArtCalculateInvestmentDTO;
|
||||
import org.jeecg.modules.web.dto.ArtRecommendMajorBaseDTO;
|
||||
import org.jeecg.modules.web.vo.QueryCalculateInvestmentVO;
|
||||
import org.jeecg.modules.web.vo.QueryRecommendMajorVO;
|
||||
import org.jeecg.modules.yx.constant.YxConstant;
|
||||
import org.jeecg.modules.yx.entity.YxSchoolMajor;
|
||||
import org.jeecg.modules.yx.entity.YxUserScore;
|
||||
import org.jeecg.modules.yx.service.*;
|
||||
import org.jeecg.modules.yx.util.ScoreUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
|
@ -33,6 +48,12 @@ public class MiniMajorController {
|
|||
private IYxCalculationMajorService yxCalculationMajorService;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private MiniTestCulturalService testCulturalService;
|
||||
@Resource
|
||||
private IYxSchoolMajorService yxSchoolMajorService;
|
||||
@Resource
|
||||
private IYxUserScoreService yxUserScoreService;
|
||||
|
||||
@ApiOperation(value = "小程序端-智能推荐")
|
||||
@GetMapping("/recommendMajor/aiAuto")
|
||||
|
|
@ -41,6 +62,11 @@ public class MiniMajorController {
|
|||
return Result.OK(artRecommendMajorBaseDTO);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/groupByBatchNumber")
|
||||
public Result<?> groupByBatchNumber(QueryRecommendMajorVO queryRecommendMajorVO){
|
||||
return Result.OK(yxCalculationMajorService.groupByBatchNumber(queryRecommendMajorVO));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/recommendMajor/page")
|
||||
public Result<?> recommendMajorPage(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
return Result.OK(yxCalculationMajorService.recommendMajorPage(queryRecommendMajorVO));
|
||||
|
|
@ -109,4 +135,143 @@ public class MiniMajorController {
|
|||
return Result.OK(dataList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "文化分测算")
|
||||
@GetMapping(value = "/testCultural")
|
||||
public Result<?> testCultural(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//根据 院校代码,获取 院校的招生专业,计算各专业的录取分数
|
||||
String schoolCode = queryRecommendMajorVO.getSchoolCode();
|
||||
String year = queryRecommendMajorVO.getYear();
|
||||
AssertUtils.notNull(loginUser, "未获取到登录信息");
|
||||
AssertUtils.notNull(year, "请选择年份");
|
||||
return Result.OK(testCulturalService.testCultural(schoolCode, year));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "投档分测算")
|
||||
@GetMapping("/calculateInvestment")
|
||||
public Result<?> calculateInvestment(QueryCalculateInvestmentVO queryCalculateInvestmentVO) {
|
||||
BigDecimal culturalScore = new BigDecimal(queryCalculateInvestmentVO.getCulturalScore());
|
||||
BigDecimal professionalScore = new BigDecimal(queryCalculateInvestmentVO.getProfessionalScore());
|
||||
//获取 院校专业信息列表,录取方式notnull
|
||||
LambdaQueryWrapper<YxSchoolMajor> yxSchoolMajorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
yxSchoolMajorLambdaQueryWrapper.isNotNull(YxSchoolMajor::getRulesEnrollProbability);
|
||||
//字段匹配: batch 批次,category 文理分科,majorType 专业类型
|
||||
if (!"高职高专".equals(queryCalculateInvestmentVO.getBatch())) {
|
||||
yxSchoolMajorLambdaQueryWrapper.ne(YxSchoolMajor::getBatch, "高职高专");
|
||||
} else {
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(YxSchoolMajor::getBatch, queryCalculateInvestmentVO.getBatch());
|
||||
}
|
||||
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(StringUtils.isNotBlank(queryCalculateInvestmentVO.getCategory()), YxSchoolMajor::getCategory, queryCalculateInvestmentVO.getCategory());
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(StringUtils.isNotBlank(queryCalculateInvestmentVO.getProfessionalCategory()), YxSchoolMajor::getMajorType, queryCalculateInvestmentVO.getProfessionalCategory());
|
||||
yxSchoolMajorLambdaQueryWrapper.orderByDesc(YxSchoolMajor::getRulesEnrollProbabilitySx);
|
||||
List<ArtCalculateInvestmentDTO> calculateInvestmentDTOList = new ArrayList<>();
|
||||
Map<String,String> rulesEnrollProbabilityMap=new HashMap<>();
|
||||
rulesEnrollProbabilityMap.put("专过文排","专过文排");
|
||||
rulesEnrollProbabilityMap.put("文*0.8+专*0.5","文8专2");
|
||||
rulesEnrollProbabilityMap.put("文*0.7+专*0.75","文7专3");
|
||||
rulesEnrollProbabilityMap.put("文*0.6+专*1","文6专4");
|
||||
rulesEnrollProbabilityMap.put("文*0.5+专*1.25","文5专5");
|
||||
if (!"体育类".equals(queryCalculateInvestmentVO.getProfessionalCategory())) {
|
||||
//非体育类
|
||||
List<String> rulesEnrollProbabilityList = null;
|
||||
if ("高职高专".equals(queryCalculateInvestmentVO.getBatch())) {
|
||||
rulesEnrollProbabilityList = Arrays.asList("文*0.5+专*1.25");
|
||||
}else{
|
||||
rulesEnrollProbabilityList = Arrays.asList("文*0.8+专*0.5", "文*0.7+专*0.75", "文*0.6+专*1", "文*0.5+专*1.25", "专过文排");
|
||||
}
|
||||
|
||||
yxSchoolMajorLambdaQueryWrapper.in(YxSchoolMajor::getRulesEnrollProbability, rulesEnrollProbabilityList);
|
||||
List<YxSchoolMajor> schooMajorList = yxSchoolMajorService.list(yxSchoolMajorLambdaQueryWrapper);
|
||||
BigDecimal wenhuaBili = null;
|
||||
BigDecimal zhuanyeBili = null;
|
||||
ArtCalculateInvestmentDTO artCalculateInvestmentDTO = null;
|
||||
for (String probabilityOperator : rulesEnrollProbabilityList) {
|
||||
artCalculateInvestmentDTO = new ArtCalculateInvestmentDTO();
|
||||
if (probabilityOperator.equals("专过文排")) {
|
||||
artCalculateInvestmentDTO.setRulesEnrollProbability(rulesEnrollProbabilityMap.get(probabilityOperator));
|
||||
artCalculateInvestmentDTO.setProbabilityOperator("文*1");
|
||||
artCalculateInvestmentDTO.setScore(culturalScore);
|
||||
artCalculateInvestmentDTO.setSchoolNum((int) schooMajorList.stream().filter(s->s.getRulesEnrollProbability().equals("专过文排")).count());
|
||||
calculateInvestmentDTOList.add(artCalculateInvestmentDTO);
|
||||
} else {
|
||||
wenhuaBili = null;
|
||||
zhuanyeBili = null;
|
||||
String[] operators = probabilityOperator.split("\\+");
|
||||
for (String operator : operators) {
|
||||
if (operator.contains("文")) {
|
||||
wenhuaBili = new BigDecimal(operator.split("\\*")[1]);
|
||||
}
|
||||
if (operator.contains("专")) {
|
||||
zhuanyeBili = new BigDecimal(operator.split("\\*")[1]);
|
||||
}
|
||||
}
|
||||
if (wenhuaBili == null || zhuanyeBili == null) {
|
||||
wenhuaBili = YxConstant.bigDecimal100;
|
||||
zhuanyeBili = YxConstant.bigDecimal100;
|
||||
}
|
||||
artCalculateInvestmentDTO = new ArtCalculateInvestmentDTO();
|
||||
artCalculateInvestmentDTO.setRulesEnrollProbability(rulesEnrollProbabilityMap.get(probabilityOperator));
|
||||
artCalculateInvestmentDTO.setProbabilityOperator(probabilityOperator);
|
||||
artCalculateInvestmentDTO.setScore((culturalScore.multiply(wenhuaBili)).add((professionalScore.multiply(zhuanyeBili))));
|
||||
artCalculateInvestmentDTO.setSchoolNum((int) schooMajorList.stream().filter(s->s.getProbabilityOperator().contains(probabilityOperator)).count());
|
||||
calculateInvestmentDTOList.add(artCalculateInvestmentDTO);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<YxSchoolMajor> schooMajorList = yxSchoolMajorService.list(yxSchoolMajorLambdaQueryWrapper);
|
||||
try {
|
||||
if (CollectionUtils.isEmpty(schooMajorList)) {
|
||||
return Result.OK();
|
||||
}
|
||||
ArtCalculateInvestmentDTO artCalculateInvestmentDTO = null;
|
||||
Integer schoolNum = 0;
|
||||
//遍历 院校专业列表,将录取方式,院校代码储存起来
|
||||
//map,key:录取方式,value: array[院校代码]
|
||||
Map<String, Set<String>> maps = new LinkedHashMap<>();
|
||||
Set<String> schoolCodeSet = null;
|
||||
for (YxSchoolMajor yxSchoolMajor : schooMajorList) {
|
||||
schoolCodeSet = maps.getOrDefault(yxSchoolMajor.getRulesEnrollProbability(), new HashSet<>());
|
||||
schoolCodeSet.add(yxSchoolMajor.getSchoolCode());
|
||||
maps.put(yxSchoolMajor.getRulesEnrollProbability(), schoolCodeSet);
|
||||
}
|
||||
if (maps.isEmpty()) {
|
||||
return Result.OK();
|
||||
}
|
||||
//根据录取方式,计算折合分数
|
||||
for (String rulesEnrollProbability : maps.keySet()) {
|
||||
Optional<YxSchoolMajor> any = schooMajorList.stream().filter(s -> s.getRulesEnrollProbability().equals(rulesEnrollProbability)).findAny();
|
||||
if (any.isPresent()) {
|
||||
YxSchoolMajor yxSchoolMajor = any.get();
|
||||
artCalculateInvestmentDTO = new ArtCalculateInvestmentDTO();
|
||||
artCalculateInvestmentDTO.setSchoolNum(maps.get(rulesEnrollProbability).size());
|
||||
artCalculateInvestmentDTO.setRulesEnrollProbability(yxSchoolMajor.getRulesEnrollProbabilitySx());
|
||||
artCalculateInvestmentDTO.setProbabilityOperator(yxSchoolMajor.getProbabilityOperator());
|
||||
artCalculateInvestmentDTO.setScore(ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore, null, yxSchoolMajor.getProbabilityOperator()));
|
||||
calculateInvestmentDTOList.add(artCalculateInvestmentDTO);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return Result.error("计算折合分出错,请联系管理员");
|
||||
}
|
||||
}
|
||||
return Result.OK(calculateInvestmentDTOList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据批次及专业类别获取专业列表")
|
||||
@GetMapping(value = "/schoolMajorListByBatchAndMajorType")
|
||||
public Result<?> schoolMajorListByBatchAndMajorType(QueryRecommendMajorVO queryRecommendMajorVO){
|
||||
LambdaQueryWrapper<YxSchoolMajor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(YxSchoolMajor::getBatch,queryRecommendMajorVO.getBatch());
|
||||
if (StringUtils.isNotBlank(queryRecommendMajorVO.getProfessionalCategory())) {
|
||||
lambdaQueryWrapper.eq(YxSchoolMajor::getMajorType,queryRecommendMajorVO.getProfessionalCategory());
|
||||
}else{
|
||||
YxUserScore activeCurrentUserScore = yxUserScoreService.getActiveCurrentUserScore();
|
||||
lambdaQueryWrapper.eq(YxSchoolMajor::getMajorType,activeCurrentUserScore.getProfessionalCategory());
|
||||
}
|
||||
lambdaQueryWrapper.isNotNull(YxSchoolMajor::getRulesEnrollProbability);
|
||||
lambdaQueryWrapper.groupBy(YxSchoolMajor::getMajorCode);
|
||||
List<YxSchoolMajor> yxSchoolMajorList = yxSchoolMajorService.list(lambdaQueryWrapper);
|
||||
return Result.OK(yxSchoolMajorList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,4 +22,6 @@ public interface YxCalculationMajorMapper extends BaseMapper<YxCalculationMajor>
|
|||
void insertBatch(@Param("tableName") String tableName,@Param("scoreId")String scoreId,@Param("list") List<YxCalculationMajor> list);
|
||||
|
||||
void insertBatchNew(@Param("tableName") String tableName,@Param("scoreId")String scoreId,@Param("list") List<YxCalculationMajor> list);
|
||||
|
||||
List<String> groupByBatchNumber(@Param(value = "tableName")String tableName,@Param("queryvo") QueryRecommendMajorVO queryRecommendMajorVO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -403,5 +403,162 @@
|
|||
</if>
|
||||
ORDER BY enroll_probability DESC
|
||||
</select>
|
||||
|
||||
<select id="groupByBatchNumber" resultType="java.lang.String">
|
||||
SELECT
|
||||
cm.batch
|
||||
FROM ${tableName} cm
|
||||
LEFT JOIN yx_school_child sc ON sc.school_code = cm.school_code
|
||||
LEFT JOIN yx_school_research_teaching srt ON srt.school_id = sc.school_id
|
||||
LEFT JOIN yx_school s ON s.id = sc.school_id
|
||||
WHERE 1=1
|
||||
/*cm.rules_enroll_probability is not null*/
|
||||
<!--成绩单-->
|
||||
<if test="queryvo.scoreId!=null and queryvo.scoreId!=''">
|
||||
AND cm.score_id = #{queryvo.scoreId}
|
||||
</if>
|
||||
<!--院校名称搜索-->
|
||||
<if test="queryvo.schoolName!=null and queryvo.schoolName!=''">
|
||||
AND (s.school_name like concat('%',#{queryvo.schoolName},'%') or sc.schooL_code like
|
||||
concat('%',#{queryvo.schoolName},'%') or cm.major_name like
|
||||
concat('%',#{queryvo.schoolName},'%'))
|
||||
</if>
|
||||
<if test="queryvo.schoolCode!=null and queryvo.schoolCode!=''">
|
||||
AND cm.school_code = #{queryvo.schoolCode}
|
||||
</if>
|
||||
<!--专业编码-->
|
||||
<if test="queryvo.majorCodeList!=null and queryvo.majorCodeList.size>0">
|
||||
AND cm.major_code in
|
||||
<foreach collection="queryvo.majorCodeList" index="index" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--地区-->
|
||||
<if test="queryvo.addressList!=null and queryvo.addressList.size>0">
|
||||
AND s.province in
|
||||
<foreach collection="queryvo.addressList" index="index" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--文理分科-->
|
||||
<if test="queryvo.cognitioPolyclinic!=null and queryvo.cognitioPolyclinic!=''">
|
||||
AND cm.category = #{queryvo.cognitioPolyclinic}
|
||||
</if>
|
||||
<!--批次-->
|
||||
<if test="queryvo.batch!=null and queryvo.batch!=''">
|
||||
AND cm.batch = #{queryvo.batch}
|
||||
</if>
|
||||
<if test="queryvo.batchList!=null and queryvo.batchList.size>0">
|
||||
AND cm.batch in
|
||||
<foreach collection="queryvo.batchList" index="index" item="b" open="(" separator="," close=")">
|
||||
#{b}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--录取方式-->
|
||||
<!--<if test="queryvo.rulesEnrollProbability!=null and queryvo.rulesEnrollProbability!=''">
|
||||
AND cm.rules_enroll_probability_sx = #{queryvo.rulesEnrollProbability}
|
||||
</if>-->
|
||||
<if test="queryvo.rulesEnrollProbabilityList!=null and queryvo.rulesEnrollProbabilityList.size>0">
|
||||
AND cm.rules_enroll_probability_sx in
|
||||
<foreach collection="queryvo.rulesEnrollProbabilityList" index="index" item="b" open="(" separator="," close=")">
|
||||
#{b}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<!--办学性质-->
|
||||
<if test="queryvo.schoolNatureList!=null and queryvo.schoolNatureList.size>0">
|
||||
AND s.school_nature in
|
||||
<foreach collection="queryvo.schoolNatureList" index="index" item="b" open="(" separator="," close=")">
|
||||
#{b}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--科研教学-->
|
||||
<if test="queryvo.kyjxList!=null and queryvo.kyjxList.size>0">
|
||||
<if test="queryvo.kyjxList.contains('硕士点')">
|
||||
AND (srt.academic_master_degree_point >0 or srt.professional_master_degree_point >0)
|
||||
</if>
|
||||
<if test="queryvo.kyjxList.contains('博士点')">
|
||||
AND srt.doctoral_point>0
|
||||
</if>
|
||||
<if test="queryvo.kyjxList.contains('保研')">
|
||||
AND srt.byzg = 1
|
||||
</if>
|
||||
</if>
|
||||
<!--院校标签-->
|
||||
<if test="queryvo.tagsList!=null and queryvo.tagsList.size>0">
|
||||
<choose>
|
||||
<when test="queryvo.tagsList.contains('985') and queryvo.tagsList.contains('211')">
|
||||
AND s.is985 = '1' AND s.is211 = '1'
|
||||
</when>
|
||||
<when test="queryvo.tagsList.contains('985')">
|
||||
AND s.is985 = '1'
|
||||
</when>
|
||||
<when test="queryvo.tagsList.contains('211')">
|
||||
AND s.is211 = '1'
|
||||
</when>
|
||||
<when test="queryvo.tagsList.contains('双一流')">
|
||||
AND s.sfsyl !='双一流'
|
||||
</when>
|
||||
<otherwise>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<!--专业类别-->
|
||||
<if test="queryvo.professionalCategory!=null and queryvo.professionalCategory!=''">
|
||||
<!--AND fld.disciplines_name like concat('%',#{queryvo.professionalCategory},'%')-->
|
||||
AND cm.major_type = #{queryvo.professionalCategory}
|
||||
</if>
|
||||
<!--音乐类 子项专业查询 start-->
|
||||
<if test="queryvo.professionalCategory!=null and queryvo.professionalCategory=='音乐类' and queryvo.pCategoryChildrenList!=null and queryvo.pCategoryChildrenList.size>0">
|
||||
AND(
|
||||
<choose>
|
||||
<when test="queryvo.pCategoryChildrenList.contains('音乐表演声乐')">
|
||||
cm.main_subjects like '%声乐%'
|
||||
<!--AND (
|
||||
cm.major_type_child = '音乐表演'
|
||||
<if test="queryvo.pCategoryChildrenList.contains('音乐教育')">
|
||||
or cm.major_type_child = '音乐教育'
|
||||
</if>
|
||||
)-->
|
||||
</when>
|
||||
<when test="queryvo.pCategoryChildrenList.contains('音乐表演器乐')">
|
||||
cm.main_subjects like '%器乐%'
|
||||
<!--AND (
|
||||
cm.major_type_child = '音乐表演'
|
||||
<if test="queryvo.pCategoryChildrenList.contains('音乐教育')">
|
||||
or cm.major_type_child = '音乐教育'
|
||||
</if>
|
||||
)-->
|
||||
</when>
|
||||
<when test="queryvo.pCategoryChildrenList.contains('音乐教育')">
|
||||
cm.major_type_child = '音乐教育'
|
||||
</when>
|
||||
</choose>
|
||||
)
|
||||
</if>
|
||||
<!--音乐类 子项专业查询 end-->
|
||||
<!--表演类 子项专业查询 start-->
|
||||
<if test="queryvo.professionalCategory!=null and queryvo.professionalCategory=='表演类' and queryvo.pCategoryChildrenList!=null and queryvo.pCategoryChildrenList.size>0">
|
||||
AND cm.main_subjects in
|
||||
<foreach collection="queryvo.pCategoryChildrenList" index="index" item="b" open="(" separator="," close=")">
|
||||
#{b}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--表演类 子项专业查询 end-->
|
||||
|
||||
<!--院校类型-->
|
||||
<if test="queryvo.institutionType!=null and queryvo.institutionType!=''">
|
||||
AND s.institution_type= #{queryvo.institutionType}
|
||||
</if>
|
||||
<!--办学性质-->
|
||||
<if test="queryvo.schoolNature!=null and queryvo.schoolNature!=''">
|
||||
AND s.school_nature= #{queryvo.schoolNature}
|
||||
</if>
|
||||
<if test="queryvo.kslx!=null and queryvo.kslx!=''">
|
||||
AND cm.kslx = #{queryvo.kslx}
|
||||
</if>
|
||||
AND cm.enroll_probability >=60
|
||||
GROUP BY cm.batch
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -61,4 +61,5 @@ public interface IYxCalculationMajorService extends IService<YxCalculationMajor>
|
|||
*/
|
||||
void copyNew(String oldScoreId, String newScoreId, String oldCalculationMajorTableName, String newCalculationMajorTableName);
|
||||
|
||||
List<String> groupByBatchNumber(QueryRecommendMajorVO queryRecommendMajorVO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.yx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
|
@ -173,7 +174,6 @@ public class YxCalculationMajorServiceImpl extends ServiceImpl<YxCalculationMajo
|
|||
if (StringUtils.isNotBlank(rulesEnrollProbability)) {
|
||||
queryRecommendMajorVO.setRulesEnrollProbabilityList(Arrays.asList(rulesEnrollProbability.split(",")));
|
||||
}
|
||||
|
||||
//获取推荐志愿信息service
|
||||
List<RecommendMajorDTO> recommendMajorList = baseMapper.recommendMajorList(activeCurrentUserScore.getCalculationTableName(),queryRecommendMajorVO);
|
||||
ArtRecommendMajorBaseDTO artRecommendMajorBaseDTO = this.checkLevelNum(recommendMajorList);
|
||||
|
|
@ -357,6 +357,53 @@ public class YxCalculationMajorServiceImpl extends ServiceImpl<YxCalculationMajo
|
|||
baseMapper.insertBatch(newCalculationMajorTableName,newScoreId,list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> groupByBatchNumber(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
YxUserScore activeCurrentUserScore = yxUserScoreService.getActiveCurrentUserScore();
|
||||
queryRecommendMajorVO.setScoreId(activeCurrentUserScore.getId());
|
||||
//文理分科
|
||||
queryRecommendMajorVO.setCognitioPolyclinic(activeCurrentUserScore.getCognitioPolyclinic());
|
||||
//专业类别
|
||||
queryRecommendMajorVO.setProfessionalCategory(activeCurrentUserScore.getProfessionalCategory());
|
||||
//有子级专业
|
||||
if (StringUtils.isNotBlank(activeCurrentUserScore.getProfessionalCategoryChildren()) && !"高职高专".equals(queryRecommendMajorVO.getBatch())) {
|
||||
queryRecommendMajorVO.setPCategoryChildrenList(new ArrayList<>(Arrays.asList(activeCurrentUserScore.getProfessionalCategoryChildren().split(","))));
|
||||
if("表演类".equals(activeCurrentUserScore.getProfessionalCategory())){
|
||||
queryRecommendMajorVO.getPCategoryChildrenList().add("兼报");
|
||||
}
|
||||
}
|
||||
//标签类别
|
||||
if (StringUtils.isNotBlank(queryRecommendMajorVO.getTagsStrs())) {
|
||||
queryRecommendMajorVO.setTagsList(Arrays.asList(queryRecommendMajorVO.getTagsStrs().split(",")));
|
||||
}
|
||||
//院校类型
|
||||
if (StringUtils.isNotBlank(queryRecommendMajorVO.getSchoolNatureStrs())) {
|
||||
queryRecommendMajorVO.setSchoolNatureList(Arrays.asList(queryRecommendMajorVO.getSchoolNatureStrs().split(",")));
|
||||
}
|
||||
//院校地区
|
||||
if (StringUtils.isNotBlank(queryRecommendMajorVO.getProvince())) {
|
||||
queryRecommendMajorVO.setAddressList(Arrays.asList(queryRecommendMajorVO.getProvince().split(",")));
|
||||
}
|
||||
//科研教学
|
||||
if (StringUtils.isNotBlank(queryRecommendMajorVO.getKyjxStrs())) {
|
||||
queryRecommendMajorVO.setKyjxList(Arrays.asList(queryRecommendMajorVO.getKyjxStrs().split(",")));
|
||||
}
|
||||
//录取方式
|
||||
String rulesEnrollProbability = queryRecommendMajorVO.getRulesEnrollProbability();
|
||||
if (StringUtils.isNotBlank(rulesEnrollProbability)) {
|
||||
queryRecommendMajorVO.setRulesEnrollProbabilityList(Arrays.asList(rulesEnrollProbability.split(",")));
|
||||
}
|
||||
//获取推荐志愿信息service
|
||||
List<String> haveMajorList = baseMapper.groupByBatchNumber(activeCurrentUserScore.getCalculationTableName(),queryRecommendMajorVO);
|
||||
/*List<YxCalculationMajor> calculationMajorList = baseMapper.selectList(new LambdaQueryWrapper<YxCalculationMajor>()
|
||||
.select(YxCalculationMajor::getBatch,YxCalculationMajor::getEnrollProbability)
|
||||
.eq(YxCalculationMajor::getScoreId, activeCurrentUserScore.getId())
|
||||
.gt(YxCalculationMajor::getEnrollProbability,60)
|
||||
.groupBy(YxCalculationMajor::getBatch));
|
||||
List<String> haveMajorList=new ArrayList<>();*/
|
||||
return haveMajorList;
|
||||
}
|
||||
|
||||
private void setSchoolTagsList(List<RecommendMajorDTO> recommendMajorList) {
|
||||
if (CollectionUtils.isNotEmpty(recommendMajorList)) {
|
||||
Set<String> schoolIdSet = recommendMajorList.stream().map(RecommendMajorDTO::getSchoolId).collect(Collectors.toSet());
|
||||
|
|
|
|||
Loading…
Reference in New Issue