优化录取计算:计算专业后保存为结果数据
This commit is contained in:
zhouwentao 2024-03-17 21:49:25 +08:00
parent c6a1c6ce21
commit bb1f350a92
5 changed files with 32 additions and 2 deletions

View File

@ -157,7 +157,7 @@ public class MiniArticleController {
yxSchoolResearchTeachingService.test();
}
if(false){
if(true){
LambdaQueryWrapper<YxArticle> lambdaQueryWrapper = new LambdaQueryWrapper<>();
//lambdaQueryWrapper.isNull(YxArticle::getSchoolId);
lambdaQueryWrapper.eq(YxArticle::getSchoolId,"");

View File

@ -416,4 +416,10 @@
LEFT JOIN yx_school_research_teaching srt ON srt.school_id = s.id
WHERE sc.school_code = #{schoolCode}
</select>
<select id="getBySchoolName" resultType="org.jeecg.modules.yx.dto.YxSchoolDTO">
SELECT s.*,sc.school_code FROM yx_school s
LEFT JOIN yx_school_child sc ON sc.school_id = s.id
WHERE s.school_name = #{schoolName} or sc.school_name = #{schoolName}
limit 1
</select>
</mapper>

View File

@ -134,11 +134,15 @@ public class MusicService {
continue;
}
if (recommendMajorDTO.getSchoolCode().equals("6060")) {
System.out.println("111");
}
//将当期成绩按照专业录取分数方式折算
majorTypeChild = recommendMajorDTO.getMajorTypeChild();
mainSubjects = recommendMajorDTO.getMainSubjects();
if (!"高职高专".equals(activeCurrentUserScore.getBatch())) {
if (!"高职高专".equals(recommendMajorDTO.getBatch())) {
if (recommendMajorDTO.getRulesEnrollProbability().equals("文过专排主科")) {
professionalScore2 = activeCurrentUserScore.getProfessionalScore();
professionalScore3 = activeCurrentUserScore.getProfessionalScore().multiply(YxConstant.bigDecimal05);
@ -169,6 +173,9 @@ public class MusicService {
professionalScore2 = activeCurrentUserScore.getYyjy();
}
}
}else{
professionalScore2 = yyScore;
professionalScore3 = yyScore;
}
//判断其他录取要求
if(!ScoreUtil.otherScoreJudge(professionalScore,activeCurrentUserScore,recommendMajorDTO)){

View File

@ -2,8 +2,10 @@ package org.jeecg.modules.yx.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.util.AssertUtils;
import org.jeecg.modules.yx.dto.YxArticleDTO;
import org.jeecg.modules.yx.dto.YxSchoolDTO;
import org.jeecg.modules.yx.entity.YxArticle;
import org.jeecg.modules.yx.entity.YxArticleContent;
import org.jeecg.modules.yx.mapper.YxArticleContentMapper;
@ -65,6 +67,12 @@ public class YxArticleServiceImpl extends ServiceImpl<YxArticleMapper, YxArticle
if (yxArticle.getViewCount()==null) {
yxArticle.setViewCount(0);
}
try {
YxSchoolDTO schoolDTO = yxSchoolService.getBySchoolName(yxArticle.getSchoolName());
if (schoolDTO!=null && StringUtils.isNotBlank(schoolDTO.getId())) {
yxArticle.setSchoolId(schoolDTO.getId());
}
}catch (Exception e){}
this.saveOrUpdate(yxArticle);
YxArticleContent yxArticleContent = new YxArticleContent();
yxArticleContent.setArticleId(yxArticle.getId());
@ -85,6 +93,12 @@ public class YxArticleServiceImpl extends ServiceImpl<YxArticleMapper, YxArticle
if (yxArticle.getViewCount()==null) {
yxArticle.setViewCount(0);
}
try {
YxSchoolDTO schoolDTO = yxSchoolService.getBySchoolName(yxArticle.getSchoolName());
if (schoolDTO!=null && StringUtils.isNotBlank(schoolDTO.getId())) {
yxArticle.setSchoolId(schoolDTO.getId());
}
}catch (Exception e){}
this.saveOrUpdate(yxArticle);
LambdaUpdateWrapper<YxArticleContent> updateWrapper = new LambdaUpdateWrapper<YxArticleContent>();
updateWrapper.eq(YxArticleContent::getArticleId, yxArticle.getId());

View File

@ -266,6 +266,9 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
@Override
public YxSchoolDTO getBySchoolName(String schoolName) {
if (StringUtils.isBlank(schoolName)) {
return null;
}
return baseMapper.getBySchoolName(schoolName);
}