updates
This commit is contained in:
parent
521bdbc1bf
commit
32da580745
|
|
@ -68,7 +68,8 @@ public class MiniArticleController {
|
|||
private IYxSchoolGraduateDegreeService yxSchoolGraduateDegreeService;
|
||||
@Autowired
|
||||
private IYxSchoolResearchTeachingService yxSchoolResearchTeachingService;
|
||||
|
||||
@Autowired
|
||||
private IYxCalculationMajorService yxCalculationMajorService;
|
||||
@ApiOperation(value = "文章列表")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> articlePage(QueryArticleVO queryArticleVO) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.mini.controller;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -12,7 +13,9 @@ import org.jeecg.common.api.vo.Result;
|
|||
import org.jeecg.modules.art.vo.QueryRecommendMajorVO;
|
||||
import org.jeecg.modules.mini.dto.SchoolGraduateDegreeDTO;
|
||||
import org.jeecg.modules.yx.entity.YxSchoolGraduateDegree;
|
||||
import org.jeecg.modules.yx.entity.YxSchoolResearchTeaching;
|
||||
import org.jeecg.modules.yx.service.IYxSchoolGraduateDegreeService;
|
||||
import org.jeecg.modules.yx.service.IYxSchoolResearchTeachingService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -39,7 +42,8 @@ import java.util.stream.Collectors;
|
|||
public class MiniSchoolGraduateDegreeController {
|
||||
@Autowired
|
||||
private IYxSchoolGraduateDegreeService yxSchoolMasterDegreeService;
|
||||
|
||||
@Autowired
|
||||
private IYxSchoolResearchTeachingService yxSchoolResearchTeachingService;
|
||||
/**
|
||||
* 科研教学,根据院校id获取专硕和学硕点信息
|
||||
*
|
||||
|
|
@ -51,6 +55,7 @@ public class MiniSchoolGraduateDegreeController {
|
|||
//构建查询对象
|
||||
LambdaQueryWrapper<YxSchoolGraduateDegree> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(YxSchoolGraduateDegree::getSchoolId, schoolId);
|
||||
lambdaQueryWrapper.eq(YxSchoolGraduateDegree::getLearningStyle,"全日制");
|
||||
List<YxSchoolGraduateDegree> list = yxSchoolMasterDegreeService.list(lambdaQueryWrapper);
|
||||
//组装数据
|
||||
String degreenature = null;//学位性质
|
||||
|
|
@ -63,10 +68,11 @@ public class MiniSchoolGraduateDegreeController {
|
|||
String key = null;
|
||||
boolean existsFlag= false;
|
||||
for (YxSchoolGraduateDegree yxSchoolGraduateDegree : list) {
|
||||
existsFlag = false;
|
||||
degreenature = yxSchoolGraduateDegree.getDegreeNature();
|
||||
disciplineField = yxSchoolGraduateDegree.getDisciplineField();
|
||||
//根据专业名称分组
|
||||
key = degreenature + "_" + disciplineField + "_";
|
||||
key = degreenature + "_" + disciplineField;
|
||||
//+ yxSchoolGraduateDegree.getMajorName()
|
||||
if ("专硕".equals(degreenature)) {//专硕
|
||||
schoolGraduateDegreeDTO = professionalMasterDegreeDTOMap.get(key);
|
||||
|
|
@ -83,11 +89,16 @@ public class MiniSchoolGraduateDegreeController {
|
|||
schoolGraduateDegreeDTO.setDisciplineField(disciplineField);
|
||||
schoolGraduateDegreeDTO.setSchoolGraduateDegreeList(new ArrayList<>());
|
||||
}
|
||||
if (yxSchoolGraduateDegree.getMajorName().contains("美术与书法")) {
|
||||
System.out.printf("美术与书法");
|
||||
}
|
||||
//根据研究方向 分组(子级)
|
||||
for (YxSchoolGraduateDegree schoolGraduateDegree : schoolGraduateDegreeDTO.getSchoolGraduateDegreeList()) {
|
||||
existsFlag = schoolGraduateDegree.getResearchDirection().equals(yxSchoolGraduateDegree.getResearchDirection());
|
||||
if(existsFlag){
|
||||
break;
|
||||
if (schoolGraduateDegreeDTO.getSchoolGraduateDegreeList().size()>=1) {
|
||||
existsFlag = schoolGraduateDegree.getResearchDirection().equals(yxSchoolGraduateDegree.getResearchDirection());
|
||||
if(existsFlag){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!existsFlag) {
|
||||
|
|
@ -114,6 +125,37 @@ public class MiniSchoolGraduateDegreeController {
|
|||
@ApiOperation(value = "获取一个专业研究方向下的考试范围")
|
||||
@GetMapping(value = "/getSchoolGraduateDegreeDetail")
|
||||
public Result<?> getSchoolGraduateDegreeDetail(@RequestParam String id){
|
||||
|
||||
if(false){
|
||||
List<YxSchoolGraduateDegree> list = yxSchoolMasterDegreeService.list();
|
||||
String key = "";
|
||||
Map<String,Integer> maps=new LinkedHashMap<>();
|
||||
Integer i = 0;
|
||||
for (YxSchoolGraduateDegree yxSchoolGraduateDegree : list) {
|
||||
key =yxSchoolGraduateDegree.getSchoolId()+"_"+ yxSchoolGraduateDegree.getCategoryName()+"_"+ yxSchoolGraduateDegree.getResearchDirection();
|
||||
i = maps.getOrDefault(key,0);
|
||||
if (i<Integer.parseInt(yxSchoolGraduateDegree.getDoctoralMajor())) {
|
||||
maps.put(key,Integer.parseInt(yxSchoolGraduateDegree.getDoctoralMajor()));
|
||||
}
|
||||
}
|
||||
Map<String,Integer> schoolMaps=new LinkedHashMap<>();
|
||||
String schoolId= null;
|
||||
String[] split = null;
|
||||
for (String s : maps.keySet()) {
|
||||
split = s.split("\\_");
|
||||
schoolId = split[0];
|
||||
i = schoolMaps.getOrDefault(schoolId, 0);
|
||||
schoolMaps.put(schoolId,i+maps.get(s));
|
||||
}
|
||||
LambdaUpdateWrapper<YxSchoolResearchTeaching> yxSchoolResearchTeachingLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
for (String s : schoolMaps.keySet()) {
|
||||
yxSchoolResearchTeachingLambdaUpdateWrapper.clear();
|
||||
yxSchoolResearchTeachingLambdaUpdateWrapper.eq(YxSchoolResearchTeaching::getSchoolId,s);
|
||||
yxSchoolResearchTeachingLambdaUpdateWrapper.set(YxSchoolResearchTeaching::getDoctoralPoint,schoolMaps.getOrDefault(s,0));
|
||||
yxSchoolResearchTeachingService.update(yxSchoolResearchTeachingLambdaUpdateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
SchoolGraduateDegreeDTO schoolGraduateDegreeDTO = new SchoolGraduateDegreeDTO();
|
||||
LambdaQueryWrapper<YxSchoolGraduateDegree> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(YxSchoolGraduateDegree::getId,id);
|
||||
|
|
@ -137,9 +179,10 @@ public class MiniSchoolGraduateDegreeController {
|
|||
lambdaQueryWrapper.eq(YxSchoolGraduateDegree::getDisciplineField,schoolGraduateDegree.getDisciplineField());
|
||||
lambdaQueryWrapper.eq(YxSchoolGraduateDegree::getDegreeNature,schoolGraduateDegree.getDegreeNature());
|
||||
lambdaQueryWrapper.eq(YxSchoolGraduateDegree::getResearchDirection,schoolGraduateDegree.getResearchDirection());
|
||||
String teacher = "";
|
||||
List<YxSchoolGraduateDegree> list = yxSchoolMasterDegreeService.list(lambdaQueryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
String teacher = list.stream().map(YxSchoolGraduateDegree::getTeacher).filter(StringUtils::isNotBlank).collect(Collectors.joining(" "));
|
||||
teacher = list.stream().map(YxSchoolGraduateDegree::getTeacher).filter(StringUtils::isNotBlank).collect(Collectors.toSet()).stream().collect(Collectors.joining(" "));
|
||||
schoolGraduateDegreeDTO.setTeacher(teacher);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,34 +86,39 @@ public class MiniUserController {
|
|||
@PostMapping("/phoneLogin")
|
||||
@ApiOperation(value = "小程序手机号登录")
|
||||
public Result<?> wechatLogin(@NotNull @RequestBody WxModel wxModel) {
|
||||
String url = "https://api.weixin.qq.com/sns/jscode2session" +
|
||||
"?appid=" + wxAppId +
|
||||
"&secret=" + wxAppSecret +
|
||||
"&grant_type=authorization_code" +
|
||||
"&js_code=" + wxModel.code;
|
||||
String s = HttpUtil.get(url);
|
||||
JSONObject jsonObject = JSONObject.parseObject(s);
|
||||
AssertUtils.notNull(jsonObject, "登录失败");
|
||||
String openId = jsonObject.getString("openid");
|
||||
String sessionKey = jsonObject.getString("session_key");
|
||||
SysUser user = sysUserService.getByWxOpenId(openId);
|
||||
if (user == null) {
|
||||
String salt = oConvertUtils.randomGen(8);
|
||||
//新用户
|
||||
user = new SysUser();
|
||||
user.setWxOpenId(openId);
|
||||
user.setUsername(salt);
|
||||
user.setRealname("用户+" + salt);
|
||||
user.setSalt(salt);
|
||||
String encryptPassword = PasswordUtil.encrypt(salt, "123456", salt);
|
||||
user.setPassword(encryptPassword);
|
||||
user.setStatus(1);
|
||||
//解密手机号
|
||||
user.setPhone(phoneDecrypt(wxModel.getEncryptedData(), sessionKey, wxModel.getIv()));
|
||||
user.setUserIdentity(CommonConstant.USER_IDENTITY_1);
|
||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
user.setOrgCode(null);
|
||||
sysUserService.saveUser(user, null, null, null);
|
||||
SysUser user = null;
|
||||
if(false){
|
||||
user = sysUserService.getUserByPhone("15090658223");
|
||||
}else{
|
||||
String url = "https://api.weixin.qq.com/sns/jscode2session" +
|
||||
"?appid=" + wxAppId +
|
||||
"&secret=" + wxAppSecret +
|
||||
"&grant_type=authorization_code" +
|
||||
"&js_code=" + wxModel.code;
|
||||
String s = HttpUtil.get(url);
|
||||
JSONObject jsonObject = JSONObject.parseObject(s);
|
||||
AssertUtils.notNull(jsonObject, "登录失败");
|
||||
String openId = jsonObject.getString("openid");
|
||||
String sessionKey = jsonObject.getString("session_key");
|
||||
user = sysUserService.getByWxOpenId(openId);
|
||||
if (user == null) {
|
||||
String salt = oConvertUtils.randomGen(8);
|
||||
//新用户
|
||||
user = new SysUser();
|
||||
user.setWxOpenId(openId);
|
||||
user.setUsername(salt);
|
||||
user.setRealname("用户+" + salt);
|
||||
user.setSalt(salt);
|
||||
String encryptPassword = PasswordUtil.encrypt(salt, "123456", salt);
|
||||
user.setPassword(encryptPassword);
|
||||
user.setStatus(1);
|
||||
//解密手机号
|
||||
user.setPhone(phoneDecrypt(wxModel.getEncryptedData(), sessionKey, wxModel.getIv()));
|
||||
user.setUserIdentity(CommonConstant.USER_IDENTITY_1);
|
||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
user.setOrgCode(null);
|
||||
sysUserService.saveUser(user, null, null, null);
|
||||
}
|
||||
}
|
||||
String username = user.getUsername();
|
||||
String syspassword = user.getPassword();
|
||||
|
|
@ -133,8 +138,8 @@ public class MiniUserController {
|
|||
obj.put("vipInfo",null);
|
||||
}
|
||||
obj.put("token", token);
|
||||
obj.put("openId", openId);
|
||||
obj.put("sessionKey", sessionKey);
|
||||
obj.put("openId", "openId");
|
||||
obj.put("sessionKey", "sessionKey");
|
||||
obj.put("userInfo", loginUser);
|
||||
return Result.OK(obj);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public class MiniTestCulturalService {
|
|||
//========================学生的成绩 start
|
||||
YxUserScore userScore = yxUserScoreService.getActiveCurrentUserScore();
|
||||
String professionalCategory = userScore.getProfessionalCategory();
|
||||
String professionalCategoryChildren = userScore.getProfessionalCategoryChildren();
|
||||
String cognitioPolyclinic = userScore.getCognitioPolyclinic();
|
||||
BigDecimal culturalScore = userScore.getCulturalScore();
|
||||
BigDecimal professionalScore = userScore.getProfessionalScore();
|
||||
|
|
@ -66,6 +67,7 @@ public class MiniTestCulturalService {
|
|||
//根据当前用户的专业类别查询
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(YxSchoolMajor::getMajorType, userScore.getProfessionalCategory());
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(YxSchoolMajor::getCategory,cognitioPolyclinic);
|
||||
|
||||
yxHistoryScoreControlLineLambdaQueryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory, userScore.getProfessionalCategory());
|
||||
yxHistoryScoreControlLineLambdaQueryWrapper.eq(YxHistoryScoreControlLine::getCategory,cognitioPolyclinic);
|
||||
String a_ = "_";
|
||||
|
|
@ -76,7 +78,7 @@ public class MiniTestCulturalService {
|
|||
}
|
||||
yxSchoolMajorList = yxSchoolMajorList.stream().collect(Collectors.collectingAndThen(
|
||||
Collectors.toCollection(() -> new TreeSet<>(
|
||||
Comparator.comparing(p ->p.getCategory()+p.getMajorName()+ p.getRulesEnrollProbability()))), ArrayList::new));
|
||||
Comparator.comparing(p ->p.getCategory()+p.getMajorName()+ p.getRulesEnrollProbability()+p.getDetail()))), ArrayList::new));
|
||||
|
||||
Set<String> majorNameSet = yxSchoolMajorList.stream().map(YxSchoolMajor::getMajorName).collect(Collectors.toSet());
|
||||
|
||||
|
|
@ -116,13 +118,12 @@ public class MiniTestCulturalService {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (yxHistoryMajorEnroll == null) {
|
||||
/*if (yxHistoryMajorEnroll == null) {
|
||||
continue;
|
||||
}
|
||||
}*/
|
||||
artTestCulturalDto.setMajorType(yxSchoolMajor.getMajorType());
|
||||
artTestCulturalDto.setMajorTypeChild(yxSchoolMajor.getMajorTypeChild());
|
||||
artTestCulturalDto.setMainSubjects(yxSchoolMajor.getMainSubjects());
|
||||
artTestCulturalDto.setYear(yxHistoryMajorEnroll.getYear());
|
||||
artTestCulturalDto.setMajorName(yxSchoolMajor.getMajorName());
|
||||
artTestCulturalDto.setCategory(yxSchoolMajor.getCategory());
|
||||
artTestCulturalDto.setBatch(yxSchoolMajor.getBatch());
|
||||
|
|
@ -132,20 +133,18 @@ public class MiniTestCulturalService {
|
|||
artTestCulturalDto.setRulesEnrollProbability(yxSchoolMajor.getRulesEnrollProbability());
|
||||
artTestCulturalDto.setMajorNameAll(yxSchoolMajor.getMajorName() + "[" + yxSchoolMajor.getCategory() + "]" + "(" + yxSchoolMajor.getBatch() + ")");
|
||||
|
||||
|
||||
if (yxHistoryMajorEnroll == null) {
|
||||
//没有历年信息,跳过
|
||||
continue;
|
||||
}
|
||||
artTestCulturalDto.setScore(yxHistoryMajorEnroll.getAdmissionLine());
|
||||
//获取上一年的 省控分信息
|
||||
key = yxSchoolMajor.getCategory() + a_ + yxSchoolMajor.getMajorType() + a_ + (yxSchoolMajor.getBatch().equals("提前批") ? "本科A段" : yxSchoolMajor.getBatch());
|
||||
yxHistoryScoreControlLine = yxHistoryScoreControlLineMap.get(yxHistoryMajorEnroll.getYear() + a_ + key);
|
||||
if (yxHistoryScoreControlLine != null) {
|
||||
//文化分控线
|
||||
artTestCulturalDto.setCulturalScore(yxHistoryScoreControlLine.getCulturalScore());
|
||||
//专业分控线
|
||||
artTestCulturalDto.setSpecialScore(yxHistoryScoreControlLine.getSpecialScore());
|
||||
if (yxHistoryMajorEnroll!=null) {
|
||||
artTestCulturalDto.setYear(yxHistoryMajorEnroll.getYear());
|
||||
artTestCulturalDto.setScore(yxHistoryMajorEnroll.getAdmissionLine());
|
||||
//获取上一年的 省控分信息
|
||||
key = yxSchoolMajor.getCategory() + a_ + yxSchoolMajor.getMajorType() + a_ + (yxSchoolMajor.getBatch().equals("提前批") ? "本科A段" : yxSchoolMajor.getBatch());
|
||||
yxHistoryScoreControlLine = yxHistoryScoreControlLineMap.get(yxHistoryMajorEnroll.getYear() + a_ + key);
|
||||
if (yxHistoryScoreControlLine != null) {
|
||||
//文化分控线
|
||||
artTestCulturalDto.setCulturalScore(yxHistoryScoreControlLine.getCulturalScore());
|
||||
//专业分控线
|
||||
artTestCulturalDto.setSpecialScore(yxHistoryScoreControlLine.getSpecialScore());
|
||||
}
|
||||
}
|
||||
|
||||
//美术与设计类,书法类,体育类
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
package org.jeecg.modules.yx.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.yx.entity.YxCalculationMajor;
|
||||
import org.jeecg.modules.yx.service.IYxCalculationMajorService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 用户可报专业折合关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-03-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="用户可报专业折合关联表")
|
||||
@RestController
|
||||
@RequestMapping("/yx/yxCalculationMajor")
|
||||
@Slf4j
|
||||
public class YxCalculationMajorController extends JeecgController<YxCalculationMajor, IYxCalculationMajorService> {
|
||||
@Autowired
|
||||
private IYxCalculationMajorService yxCalculationMajorService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param yxCalculationMajor
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "用户可报专业折合关联表-分页列表查询")
|
||||
@ApiOperation(value="用户可报专业折合关联表-分页列表查询", notes="用户可报专业折合关联表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<YxCalculationMajor>> queryPageList(YxCalculationMajor yxCalculationMajor,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<YxCalculationMajor> queryWrapper = QueryGenerator.initQueryWrapper(yxCalculationMajor, req.getParameterMap());
|
||||
Page<YxCalculationMajor> page = new Page<YxCalculationMajor>(pageNo, pageSize);
|
||||
IPage<YxCalculationMajor> pageList = yxCalculationMajorService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param yxCalculationMajor
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "用户可报专业折合关联表-添加")
|
||||
@ApiOperation(value="用户可报专业折合关联表-添加", notes="用户可报专业折合关联表-添加")
|
||||
@RequiresPermissions("yx:yx_calculation_major:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody YxCalculationMajor yxCalculationMajor) {
|
||||
yxCalculationMajorService.save(yxCalculationMajor);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param yxCalculationMajor
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "用户可报专业折合关联表-编辑")
|
||||
@ApiOperation(value="用户可报专业折合关联表-编辑", notes="用户可报专业折合关联表-编辑")
|
||||
@RequiresPermissions("yx:yx_calculation_major:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody YxCalculationMajor yxCalculationMajor) {
|
||||
yxCalculationMajorService.updateById(yxCalculationMajor);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "用户可报专业折合关联表-通过id删除")
|
||||
@ApiOperation(value="用户可报专业折合关联表-通过id删除", notes="用户可报专业折合关联表-通过id删除")
|
||||
@RequiresPermissions("yx:yx_calculation_major:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
yxCalculationMajorService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "用户可报专业折合关联表-批量删除")
|
||||
@ApiOperation(value="用户可报专业折合关联表-批量删除", notes="用户可报专业折合关联表-批量删除")
|
||||
@RequiresPermissions("yx:yx_calculation_major:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.yxCalculationMajorService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "用户可报专业折合关联表-通过id查询")
|
||||
@ApiOperation(value="用户可报专业折合关联表-通过id查询", notes="用户可报专业折合关联表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<YxCalculationMajor> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
YxCalculationMajor yxCalculationMajor = yxCalculationMajorService.getById(id);
|
||||
if(yxCalculationMajor==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(yxCalculationMajor);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param yxCalculationMajor
|
||||
*/
|
||||
@RequiresPermissions("yx:yx_calculation_major:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, YxCalculationMajor yxCalculationMajor) {
|
||||
return super.exportXls(request, yxCalculationMajor, YxCalculationMajor.class, "用户可报专业折合关联表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("yx:yx_calculation_major:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, YxCalculationMajor.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -205,7 +205,9 @@ public class YxSchoolDoubleFirstPlanController extends JeecgController<YxSchoolD
|
|||
YxSchool yxSchool = null;
|
||||
YxMajor yxMajor = null;
|
||||
YxSchoolDoubleFirstPlan yxSchoolDoubleFirstPlan = null;
|
||||
int i =0;
|
||||
for (YxSchoolDoubleFirstPlan l : list) {
|
||||
i++;
|
||||
schoolName = l.getSchoolName();
|
||||
majorName = l.getMajorName();
|
||||
key = schoolName + "_" + majorName;
|
||||
|
|
@ -214,7 +216,7 @@ public class YxSchoolDoubleFirstPlanController extends JeecgController<YxSchoolD
|
|||
}
|
||||
schoolNameMajorNameSet.add(key);
|
||||
if (StringUtils.isBlank(schoolName)) {
|
||||
return Result.error("文件导入失败:有院校名称为空!");
|
||||
return Result.error("行"+i+",文件导入失败:有院校名称为空!");
|
||||
}
|
||||
|
||||
schoolName = schoolName.replace(" ","").replace("(","(").replace(")",")");
|
||||
|
|
@ -223,7 +225,8 @@ public class YxSchoolDoubleFirstPlanController extends JeecgController<YxSchoolD
|
|||
if (yxSchool == null) {
|
||||
yxSchool = schoolMap.get(schoolName.replace("学院","大学"));
|
||||
if (yxSchool == null) {
|
||||
return Result.error(String.format("文件导入失败:院校-%s-关联失败,未在数据库中找到该院校名称!",schoolName));
|
||||
continue;
|
||||
//return Result.error(String.format("文件导入失败:院校-%s-关联失败,未在数据库中找到该院校名称!",schoolName));
|
||||
}
|
||||
}
|
||||
yxMajor = majorMap.get(majorName);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import org.jeecg.modules.yx.constant.YxConstant;
|
|||
import org.jeecg.modules.yx.entity.*;
|
||||
import org.jeecg.modules.yx.service.*;
|
||||
import org.jeecg.modules.yx.util.ScoreUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -43,6 +44,8 @@ public class YxScoreController {
|
|||
@Autowired
|
||||
private IYxUserScoreService yxUserScoreService;
|
||||
@Autowired
|
||||
private IYxCalculationMajorService yxCalculationMajorService;
|
||||
@Autowired
|
||||
private IYxSchoolMajorService yxSchoolMajorService;
|
||||
@Autowired
|
||||
private IYxVolunteerService yxVolunteerService;
|
||||
|
|
@ -53,7 +56,7 @@ public class YxScoreController {
|
|||
@Autowired
|
||||
private IYxScoreSegmentService yxScoreSegmentService;
|
||||
@PostMapping(value = "/save")
|
||||
public Result<?> save(@RequestBody YxUserScore yxUserScore) {
|
||||
public Result<?> save(@NotNull @RequestBody YxUserScore yxUserScore) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
String userId = sysUser.getId();
|
||||
|
|
@ -211,6 +214,10 @@ public class YxScoreController {
|
|||
yxUserScore.setUpdateTime(null);
|
||||
//保存当前用户的得分
|
||||
yxUserScoreService.save(yxUserScore);
|
||||
|
||||
//yxCalculationMajorService.calculationMajor(yxUserScore);
|
||||
|
||||
|
||||
//创建新的志愿单信息
|
||||
YxVolunteer yxVolunteer = new YxVolunteer();
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
|
|
@ -226,6 +233,8 @@ public class YxScoreController {
|
|||
yxUserScore.setNlqNum(artRecommendMajorBaseDTO.getNan());
|
||||
yxUserScoreService.updateById(yxUserScore);
|
||||
|
||||
|
||||
|
||||
//返回对象
|
||||
JSONObject responseBody=JSONObject.parseObject(JSONObject.toJSONString(yxUserScore));
|
||||
responseBody.put("volunteer",yxVolunteer);
|
||||
|
|
@ -273,7 +282,12 @@ public class YxScoreController {
|
|||
lambdaQueryWrapper.between(YxUserScore::getCreateTime,startTime,endTime);
|
||||
lambdaQueryWrapper.eq(YxUserScore::getCreateBy,loginUser.getId());
|
||||
long useCount = yxUserScoreService.count(lambdaQueryWrapper);
|
||||
long residueCount = YxConstant.todayMaxEditScoreCount - useCount;
|
||||
long residueCount = 0;
|
||||
if (YxConstant.todayMaxEditScoreCount>useCount) {
|
||||
//当天没有超过更改次数
|
||||
residueCount = YxConstant.todayMaxEditScoreCount - useCount;
|
||||
}
|
||||
|
||||
jsonObject.put("useCount",useCount);
|
||||
jsonObject.put("residueCount",residueCount);
|
||||
return Result.OK(jsonObject);
|
||||
|
|
|
|||
|
|
@ -1,178 +0,0 @@
|
|||
package org.jeecg.modules.yx.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.yx.entity.YxUserCalculationMajor;
|
||||
import org.jeecg.modules.yx.service.IYxUserCalculationMajorService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 计算用户专业分数关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-03-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="计算用户专业分数关联表")
|
||||
@RestController
|
||||
@RequestMapping("/yx/yxUserCalculationMajor")
|
||||
@Slf4j
|
||||
public class YxUserCalculationMajorController extends JeecgController<YxUserCalculationMajor, IYxUserCalculationMajorService> {
|
||||
@Autowired
|
||||
private IYxUserCalculationMajorService yxUserCalculationMajorService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param yxUserCalculationMajor
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "计算用户专业分数关联表-分页列表查询")
|
||||
@ApiOperation(value="计算用户专业分数关联表-分页列表查询", notes="计算用户专业分数关联表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<YxUserCalculationMajor>> queryPageList(YxUserCalculationMajor yxUserCalculationMajor,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<YxUserCalculationMajor> queryWrapper = QueryGenerator.initQueryWrapper(yxUserCalculationMajor, req.getParameterMap());
|
||||
Page<YxUserCalculationMajor> page = new Page<YxUserCalculationMajor>(pageNo, pageSize);
|
||||
IPage<YxUserCalculationMajor> pageList = yxUserCalculationMajorService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param yxUserCalculationMajor
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "计算用户专业分数关联表-添加")
|
||||
@ApiOperation(value="计算用户专业分数关联表-添加", notes="计算用户专业分数关联表-添加")
|
||||
@RequiresPermissions("yx:yx_user_calculation_major:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody YxUserCalculationMajor yxUserCalculationMajor) {
|
||||
yxUserCalculationMajorService.save(yxUserCalculationMajor);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param yxUserCalculationMajor
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "计算用户专业分数关联表-编辑")
|
||||
@ApiOperation(value="计算用户专业分数关联表-编辑", notes="计算用户专业分数关联表-编辑")
|
||||
@RequiresPermissions("yx:yx_user_calculation_major:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody YxUserCalculationMajor yxUserCalculationMajor) {
|
||||
yxUserCalculationMajorService.updateById(yxUserCalculationMajor);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "计算用户专业分数关联表-通过id删除")
|
||||
@ApiOperation(value="计算用户专业分数关联表-通过id删除", notes="计算用户专业分数关联表-通过id删除")
|
||||
@RequiresPermissions("yx:yx_user_calculation_major:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
yxUserCalculationMajorService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "计算用户专业分数关联表-批量删除")
|
||||
@ApiOperation(value="计算用户专业分数关联表-批量删除", notes="计算用户专业分数关联表-批量删除")
|
||||
@RequiresPermissions("yx:yx_user_calculation_major:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.yxUserCalculationMajorService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "计算用户专业分数关联表-通过id查询")
|
||||
@ApiOperation(value="计算用户专业分数关联表-通过id查询", notes="计算用户专业分数关联表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<YxUserCalculationMajor> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
YxUserCalculationMajor yxUserCalculationMajor = yxUserCalculationMajorService.getById(id);
|
||||
if(yxUserCalculationMajor==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(yxUserCalculationMajor);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param yxUserCalculationMajor
|
||||
*/
|
||||
@RequiresPermissions("yx:yx_user_calculation_major:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, YxUserCalculationMajor yxUserCalculationMajor) {
|
||||
return super.exportXls(request, yxUserCalculationMajor, YxUserCalculationMajor.class, "计算用户专业分数关联表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("yx:yx_user_calculation_major:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, YxUserCalculationMajor.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -19,27 +19,23 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 计算用户专业分数关联表
|
||||
* @Description: 用户可报专业折合关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-03-10
|
||||
* @Date: 2024-03-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("yx_user_calculation_major")
|
||||
@TableName("yx_calculation_major")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="yx_user_calculation_major对象", description="计算用户专业分数关联表")
|
||||
public class YxUserCalculationMajor implements Serializable {
|
||||
@ApiModel(value="yx_calculation_major对象", description="用户可报专业折合关联表")
|
||||
public class YxCalculationMajor implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
/**年份*/
|
||||
@Excel(name = "年份", width = 15)
|
||||
@ApiModelProperty(value = "年份")
|
||||
private java.lang.String year;
|
||||
/**成绩单id*/
|
||||
@Excel(name = "成绩单id", width = 15)
|
||||
@ApiModelProperty(value = "成绩单id")
|
||||
|
|
@ -80,6 +76,10 @@ public class YxUserCalculationMajor implements Serializable {
|
|||
@Excel(name = "批次", width = 15)
|
||||
@ApiModelProperty(value = "批次")
|
||||
private java.lang.String batch;
|
||||
/**学生的未换算折合分数*/
|
||||
@Excel(name = "学生的未换算折合分数", width = 15)
|
||||
@ApiModelProperty(value = "学生的未换算折合分数")
|
||||
private java.math.BigDecimal studentOldConvertedScore;
|
||||
/**学生的折合分数*/
|
||||
@Excel(name = "学生的折合分数", width = 15)
|
||||
@ApiModelProperty(value = "学生的折合分数")
|
||||
|
|
@ -87,35 +87,16 @@ public class YxUserCalculationMajor implements Serializable {
|
|||
/**录取率*/
|
||||
@Excel(name = "录取率", width = 15)
|
||||
@ApiModelProperty(value = "录取率")
|
||||
private java.math.BigDecimal enrollRobability;
|
||||
private java.math.BigDecimal enrollProbability;
|
||||
/**录取概率计算规则运算符*/
|
||||
@Excel(name = "录取概率计算规则运算符", width = 15)
|
||||
@ApiModelProperty(value = "录取概率计算规则运算符")
|
||||
private java.lang.String probabilityOperator;
|
||||
/**文化分省控线*/
|
||||
@Excel(name = "文化分省控线", width = 15)
|
||||
@ApiModelProperty(value = "文化分省控线")
|
||||
private java.math.BigDecimal culturalControlLine;
|
||||
/**专项分数线*/
|
||||
@Excel(name = "专项分数线", width = 15)
|
||||
@ApiModelProperty(value = "专项分数线")
|
||||
private java.math.BigDecimal specialControlLine;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**专业类型*/
|
||||
@Excel(name = "专业类型", width = 15)
|
||||
@ApiModelProperty(value = "专业类型")
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package org.jeecg.modules.yx.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.yx.entity.YxCalculationMajor;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 用户可报专业折合关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-03-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface YxCalculationMajorMapper extends BaseMapper<YxCalculationMajor> {
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package org.jeecg.modules.yx.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.yx.entity.YxUserCalculationMajor;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 计算用户专业分数关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-03-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface YxUserCalculationMajorMapper extends BaseMapper<YxUserCalculationMajor> {
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.yx.mapper.YxUserCalculationMajorMapper">
|
||||
<mapper namespace="org.jeecg.modules.yx.mapper.YxCalculationMajorMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package org.jeecg.modules.yx.service;
|
||||
|
||||
import org.jeecg.modules.yx.entity.YxCalculationMajor;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.yx.entity.YxUserScore;
|
||||
|
||||
/**
|
||||
* @Description: 用户可报专业折合关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-03-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IYxCalculationMajorService extends IService<YxCalculationMajor> {
|
||||
void calculationMajor(YxUserScore userScore);
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import org.jeecg.modules.yx.entity.YxHistoryScoreControlLine;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 历年各专业省控分数线
|
||||
|
|
@ -24,4 +25,13 @@ public interface IYxHistoryScoreControlLineService extends IService<YxHistorySco
|
|||
|
||||
|
||||
List<YxHistoryScoreControlLine> listByProfessionalCategoryOfYear(int year,String professionalCategory,String category);
|
||||
|
||||
/**
|
||||
* 根据 年份,专业类别,文理分科 获取全批次的数据
|
||||
* @param year 年份
|
||||
* @param professionalCategory 专业类别
|
||||
* @param category 文理分科
|
||||
* @return Map<批次,省控线对象>
|
||||
*/
|
||||
Map<String,YxHistoryScoreControlLine> mapsBatchByProfessionalCategoryOfYear(int year,String professionalCategory,String category);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
package org.jeecg.modules.yx.service;
|
||||
|
||||
import org.jeecg.modules.yx.entity.YxUserCalculationMajor;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 计算用户专业分数关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-03-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IYxUserCalculationMajorService extends IService<YxUserCalculationMajor> {
|
||||
|
||||
}
|
||||
|
|
@ -43,11 +43,8 @@ public class BiaoyanService {
|
|||
try {
|
||||
//专业类别
|
||||
String professionalCategory = activeCurrentUserScore.getProfessionalCategory();
|
||||
//String cognitioPolyclinic = activeCurrentUserScore.getCognitioPolyclinic();
|
||||
String rulesEnrollProbability = null;
|
||||
String probabilityOperator = null;
|
||||
//String majorType = null;//专业类别
|
||||
//String majorTypeChild = null;
|
||||
String nowBatch = activeCurrentUserScore.getBatch();
|
||||
String mainSubjects = null;
|
||||
BigDecimal studentScore = null;//学生折合分
|
||||
|
|
@ -56,15 +53,14 @@ public class BiaoyanService {
|
|||
BigDecimal professionalScore2 = null;//对应主考成绩
|
||||
BigDecimal professionalScore3 = null;//对应主考成绩 换算去年成绩后
|
||||
BigDecimal nowYearDiff = null;//当前年分差
|
||||
YxHistoryScoreControlLine yxHistoryScoreControlLine = yxHistoryScoreControlLineService.getByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), professionalCategory, activeCurrentUserScore.getCognitioPolyclinic(), activeCurrentUserScore.getBatch());
|
||||
BigDecimal culturalControlLine = yxHistoryScoreControlLine.getCulturalScore();//文化分省控线
|
||||
BigDecimal specialControlLine = yxHistoryScoreControlLine.getSpecialScore();//专业分省控线
|
||||
Map<String, YxHistoryScoreControlLine> batchControlLineMaps = yxHistoryScoreControlLineService.mapsBatchByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), professionalCategory, activeCurrentUserScore.getCognitioPolyclinic());
|
||||
BigDecimal culturalControlLine = null;//文化分省控线
|
||||
BigDecimal specialControlLine = null;//专业分省控线
|
||||
BigDecimal nowYearProvincialControlLine = null;//当前年省控线
|
||||
BigDecimal historyThreeYearDiff = null;//近三年平均差值
|
||||
BigDecimal enrollProbability = null;//录取率
|
||||
Map<String, Object> differenceMap = null;
|
||||
List<YxHistoryMajorEnroll> historyMajorEnrollList = null;//历年录取信息
|
||||
|
||||
BigDecimal fzby= activeCurrentUserScore.getFzby();//服装表演-分数
|
||||
BigDecimal xjysdy = activeCurrentUserScore.getXjysdy();//戏剧影视导演-分数
|
||||
BigDecimal xjysby = activeCurrentUserScore.getXjysby();//戏剧影视表演-分数
|
||||
|
|
@ -102,11 +98,11 @@ public class BiaoyanService {
|
|||
//遍历专业列表
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorList) {
|
||||
rulesEnrollProbability = recommendMajorDTO.getRulesEnrollProbability();
|
||||
//专业类别
|
||||
//majorType = recommendMajorDTO.getMajorType();
|
||||
//取出往年的分数信息, 算出 三年平均差值
|
||||
historyMajorEnrollList = recommendMajorDTO.getHistoryMajorEnrollList();
|
||||
probabilityOperator = recommendMajorDTO.getProbabilityOperator();
|
||||
culturalControlLine = batchControlLineMaps.get(recommendMajorDTO.getBatch()).getCulturalScore();
|
||||
specialControlLine = batchControlLineMaps.get(recommendMajorDTO.getBatch()).getSpecialScore();
|
||||
//没有计算方式 跳过
|
||||
if (StringUtils.isBlank(rulesEnrollProbability)) {
|
||||
continue;
|
||||
|
|
@ -165,7 +161,7 @@ public class BiaoyanService {
|
|||
recommendMajorDTO.setStudentConvertedScore(ScoreUtil.convertIntoScore(rulesEnrollProbability, activeCurrentUserScore.getCulturalScore(), professionalScore2, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator));
|
||||
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, activeCurrentUserScore.getCulturalScore(), professionalScore3, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
|
||||
recommendMajorDTO.setStudentScore(studentScore);
|
||||
if ("文过专排主科".equals(rulesEnrollProbability)) {
|
||||
if (rulesEnrollProbability.equals("文过专排主科")) {
|
||||
if (culturalScore.compareTo(culturalControlLine) < 0) {
|
||||
//小于文化分省控线
|
||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ public class BoYinService {
|
|||
BigDecimal professionalScore2 = null;//对应主考成绩
|
||||
BigDecimal professionalScore3 = null;//对应主考成绩 换算去年成绩后
|
||||
BigDecimal nowYearDiff = null;//当前年分差
|
||||
YxHistoryScoreControlLine yxHistoryScoreControlLine = yxHistoryScoreControlLineService.getByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), professionalCategory, activeCurrentUserScore.getCognitioPolyclinic(), activeCurrentUserScore.getBatch());
|
||||
BigDecimal culturalControlLine = yxHistoryScoreControlLine.getCulturalScore();//文化分省控线
|
||||
BigDecimal specialControlLine = yxHistoryScoreControlLine.getSpecialScore();//专业分省控线
|
||||
Map<String, YxHistoryScoreControlLine> batchControlLineMaps = yxHistoryScoreControlLineService.mapsBatchByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), professionalCategory, activeCurrentUserScore.getCognitioPolyclinic());
|
||||
BigDecimal culturalControlLine = null;//文化分省控线
|
||||
BigDecimal specialControlLine = null;//专业分省控线
|
||||
BigDecimal nowYearProvincialControlLine = null;//当前年省控线
|
||||
BigDecimal historyThreeYearDiff = null;//近两年平均差值
|
||||
BigDecimal enrollProbability = null;//录取率
|
||||
|
|
@ -80,6 +80,8 @@ public class BoYinService {
|
|||
//取出往年的分数信息, 算出 三年平均差值
|
||||
historyMajorEnrollList = recommendMajorDTO.getHistoryMajorEnrollList();
|
||||
probabilityOperator = recommendMajorDTO.getProbabilityOperator();
|
||||
culturalControlLine = batchControlLineMaps.get(recommendMajorDTO.getBatch()).getCulturalScore();
|
||||
specialControlLine = batchControlLineMaps.get(recommendMajorDTO.getBatch()).getSpecialScore();
|
||||
//没有计算方式 跳过
|
||||
if (StringUtils.isBlank(rulesEnrollProbability)) {
|
||||
continue;
|
||||
|
|
@ -118,7 +120,7 @@ public class BoYinService {
|
|||
recommendMajorDTO.setStudentConvertedScore(ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator));
|
||||
recommendMajorDTO.setStudentScore(studentScore);
|
||||
//判断录取方式
|
||||
if ("文过专排主科".equals(rulesEnrollProbability)) {
|
||||
if (rulesEnrollProbability.equals("文过专排主科")) {
|
||||
if (culturalScore.compareTo(culturalControlLine) < 0) {
|
||||
//小于文化分省控线
|
||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@ public class MusicService {
|
|||
BigDecimal professionalScore2 = null;//对应主考成绩
|
||||
BigDecimal professionalScore3 = null;//对应主考成绩 换算去年成绩后
|
||||
BigDecimal nowYearDiff = null;//当前年分差
|
||||
YxHistoryScoreControlLine yxHistoryScoreControlLine = yxHistoryScoreControlLineService.getByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), professionalCategory, activeCurrentUserScore.getCognitioPolyclinic(), activeCurrentUserScore.getBatch());
|
||||
BigDecimal culturalControlLine = yxHistoryScoreControlLine.getCulturalScore();//文化分省控线
|
||||
BigDecimal specialControlLine = yxHistoryScoreControlLine.getSpecialScore();//专业分省控线
|
||||
Map<String, YxHistoryScoreControlLine> batchControlLineMaps = yxHistoryScoreControlLineService.mapsBatchByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), professionalCategory, activeCurrentUserScore.getCognitioPolyclinic());
|
||||
BigDecimal culturalControlLine = null;
|
||||
BigDecimal specialControlLine = null;
|
||||
BigDecimal nowYearProvincialControlLine = null;//当前年省控线
|
||||
BigDecimal historyThreeYearDiff = null;//近三年平均差值
|
||||
BigDecimal enrollProbability = null;//录取率
|
||||
|
|
@ -112,6 +112,10 @@ public class MusicService {
|
|||
//取出往年的分数信息, 算出 三年平均差值
|
||||
historyMajorEnrollList = recommendMajorDTO.getHistoryMajorEnrollList();
|
||||
probabilityOperator = recommendMajorDTO.getProbabilityOperator();
|
||||
|
||||
culturalControlLine = batchControlLineMaps.get(recommendMajorDTO.getBatch()).getCulturalScore();
|
||||
specialControlLine = batchControlLineMaps.get(recommendMajorDTO.getBatch()).getSpecialScore();
|
||||
|
||||
//没有计算方式 跳过
|
||||
if (StringUtils.isBlank(rulesEnrollProbability)) {
|
||||
continue;
|
||||
|
|
@ -139,7 +143,7 @@ public class MusicService {
|
|||
mainSubjects = recommendMajorDTO.getMainSubjects();
|
||||
|
||||
if (!"高职高专".equals(activeCurrentUserScore.getBatch())) {
|
||||
if ("文过专排主科".equals(recommendMajorDTO.getRulesEnrollProbability())) {
|
||||
if (recommendMajorDTO.getRulesEnrollProbability().equals("文过专排主科")) {
|
||||
professionalScore2 = activeCurrentUserScore.getProfessionalScore();
|
||||
professionalScore3 = activeCurrentUserScore.getProfessionalScore().multiply(YxConstant.bigDecimal05);
|
||||
} else if ("1".equals(recommendMajorDTO.getCheckMaster())) {
|
||||
|
|
@ -186,7 +190,7 @@ public class MusicService {
|
|||
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, activeCurrentUserScore.getCulturalScore(), professionalScore3, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
|
||||
//recommendMajorDTO.setStudentConvertedScore(ScoreUtil.convertIntoScore(rulesEnrollProbability, activeCurrentUserScore.getCulturalScore(), professionalScore2, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator));
|
||||
recommendMajorDTO.setStudentConvertedScore(studentScore);
|
||||
recommendMajorDTO.setStudentScore(studentScore);
|
||||
recommendMajorDTO.setStudentScore(professionalScore2);
|
||||
if ("文过专排主科".equals(rulesEnrollProbability)) {
|
||||
if (culturalScore.compareTo(culturalControlLine) < 0) {
|
||||
//小于文化分省控线
|
||||
|
|
@ -303,6 +307,9 @@ public class MusicService {
|
|||
BigDecimal a2 = null;
|
||||
BigDecimal divide = null;
|
||||
for (ArtTestCulturalDTO artTestCulturalDTO : artTestCulturalDtoList) {
|
||||
if (artTestCulturalDTO.getScore()==null) {
|
||||
continue;
|
||||
}
|
||||
rulesEnrollProbability = artTestCulturalDTO.getRulesEnrollProbability();
|
||||
probabilityOperator = artTestCulturalDTO.getProbabilityOperator();
|
||||
probabilityOperators = probabilityOperator.split("\\+");
|
||||
|
|
@ -321,14 +328,24 @@ public class MusicService {
|
|||
if("文过专排主科".equals(rulesEnrollProbability)){
|
||||
professionalScore3 = professionalScore.multiply(YxConstant.bigDecimal05);
|
||||
}else if ("音乐表演".equals(majorTypeChild)) {
|
||||
if (mainSubjects.contains("器乐") && activeCurrentUserScore.getProfessionalCategoryChildren().contains("器乐")) {
|
||||
if (mainSubjects.contains("器乐") && activeCurrentUserScore.getProfessionalCategoryChildren().contains("器乐") && yybyqy.compareTo(YxConstant.bigDecimal0)>0) {
|
||||
professionalScore3 = yybyqy;
|
||||
} else {
|
||||
} else if(yybysy.compareTo(YxConstant.bigDecimal0)>0){
|
||||
professionalScore3 = yybysy;
|
||||
}else{
|
||||
professionalScore3 = yyjy;
|
||||
}
|
||||
} else {
|
||||
//音乐教育
|
||||
professionalScore3 = yyjy;
|
||||
if (yyjy.compareTo(YxConstant.bigDecimal0)<=0) {
|
||||
if (mainSubjects.contains("器乐") && activeCurrentUserScore.getProfessionalCategoryChildren().contains("器乐") && yybyqy.compareTo(YxConstant.bigDecimal0)>0) {
|
||||
professionalScore3 = yybyqy;
|
||||
} else {
|
||||
professionalScore3 = yybysy;
|
||||
}
|
||||
}else{
|
||||
professionalScore3 = yyjy;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(("文过专排主科".equals(artTestCulturalDTO.getRulesEnrollProbability())||"1".equals(artTestCulturalDTO.getCheckMaster()))){
|
||||
|
|
|
|||
|
|
@ -44,23 +44,19 @@ public class WuDaoService {
|
|||
try {
|
||||
//专业类别
|
||||
String professionalCategory = activeCurrentUserScore.getProfessionalCategory();
|
||||
//String cognitioPolyclinic = activeCurrentUserScore.getCognitioPolyclinic();
|
||||
String rulesEnrollProbability = null;
|
||||
String probabilityOperator = null;
|
||||
//String majorType = null;//专业类别
|
||||
//String majorTypeChild = null;
|
||||
String mainSubjects = null;
|
||||
String nowBatch = activeCurrentUserScore.getBatch();
|
||||
BigDecimal studentScore = null;//学生折合分
|
||||
BigDecimal culturalScore = activeCurrentUserScore.getCulturalScore();//学生的文化分
|
||||
BigDecimal professionalScore = activeCurrentUserScore.getProfessionalScore();//学生的文化分
|
||||
BigDecimal professionalScore2 = null;//对应主考成绩
|
||||
BigDecimal professionalScore3 = null;//对应主考成绩 换算去年成绩后
|
||||
BigDecimal nowYearDiff = null;//当前年分差
|
||||
YxHistoryScoreControlLine yswdControlLine = yxHistoryScoreControlLineService.getByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), "艺术舞蹈类", activeCurrentUserScore.getCognitioPolyclinic(), activeCurrentUserScore.getBatch());
|
||||
YxHistoryScoreControlLine gjbzwControlLine = yxHistoryScoreControlLineService.getByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), "国际标准舞类", activeCurrentUserScore.getCognitioPolyclinic(), activeCurrentUserScore.getBatch());
|
||||
BigDecimal culturalControlLine = yswdControlLine.getCulturalScore();//文化分省控线
|
||||
BigDecimal specialControlLine = yswdControlLine.getSpecialScore();//专业分省控线
|
||||
Map<String, YxHistoryScoreControlLine> yswdHistoryScoreControlLineMap = yxHistoryScoreControlLineService.mapsBatchByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), "艺术舞蹈类", activeCurrentUserScore.getCognitioPolyclinic());
|
||||
Map<String, YxHistoryScoreControlLine> gjbzwHistoryScoreControlLineMap = yxHistoryScoreControlLineService.mapsBatchByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), "国际标准舞类", activeCurrentUserScore.getCognitioPolyclinic());
|
||||
BigDecimal culturalControlLine = null;//文化分省控线
|
||||
BigDecimal specialControlLine = null;//专业分省控线
|
||||
BigDecimal nowYearProvincialControlLine = null;//当前年省控线
|
||||
BigDecimal historyThreeYearDiff = null;//近三年平均差值
|
||||
BigDecimal enrollProbability = null;//录取率
|
||||
|
|
@ -111,12 +107,12 @@ public class WuDaoService {
|
|||
mainSubjects = recommendMajorDTO.getMainSubjects();
|
||||
if ("艺术舞蹈".equals(mainSubjects)) {
|
||||
professionalScore3 = yswd;
|
||||
culturalControlLine = yswdControlLine.getCulturalScore();
|
||||
specialControlLine = yswdControlLine.getSpecialScore();
|
||||
culturalControlLine = yswdHistoryScoreControlLineMap.get(recommendMajorDTO.getBatch()).getCulturalScore();
|
||||
specialControlLine = yswdHistoryScoreControlLineMap.get(recommendMajorDTO.getBatch()).getSpecialScore();
|
||||
} else if ("国际标准舞".equals(mainSubjects)) {
|
||||
professionalScore3 = gjbzw;
|
||||
culturalControlLine = gjbzwControlLine.getCulturalScore();
|
||||
specialControlLine = gjbzwControlLine.getSpecialScore();
|
||||
culturalControlLine = gjbzwHistoryScoreControlLineMap.get(recommendMajorDTO.getBatch()).getCulturalScore();
|
||||
specialControlLine = gjbzwHistoryScoreControlLineMap.get(recommendMajorDTO.getBatch()).getSpecialScore();
|
||||
} else {
|
||||
log.error("当前专业有问题,不清楚主考科目:" + JSONObject.toJSONString(recommendMajorDTO));
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,318 @@
|
|||
package org.jeecg.modules.yx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.modules.art.dto.RecommendMajorDTO;
|
||||
import org.jeecg.modules.art.vo.QueryRecommendMajorVO;
|
||||
import org.jeecg.modules.yx.constant.YxConstant;
|
||||
import org.jeecg.modules.yx.entity.YxCalculationMajor;
|
||||
import org.jeecg.modules.yx.entity.YxHistoryMajorEnroll;
|
||||
import org.jeecg.modules.yx.entity.YxHistoryScoreControlLine;
|
||||
import org.jeecg.modules.yx.entity.YxUserScore;
|
||||
import org.jeecg.modules.yx.mapper.YxCalculationMajorMapper;
|
||||
import org.jeecg.modules.yx.mapper.YxHistoryMajorEnrollMapper;
|
||||
import org.jeecg.modules.yx.mapper.YxSchoolMajorMapper;
|
||||
import org.jeecg.modules.yx.service.IYxCalculationMajorService;
|
||||
import org.jeecg.modules.yx.service.IYxHistoryScoreControlLineService;
|
||||
import org.jeecg.modules.yx.service.IYxSchoolMajorService;
|
||||
import org.jeecg.modules.yx.util.ScoreUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 用户可报专业折合关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-03-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class YxCalculationMajorServiceImpl extends ServiceImpl<YxCalculationMajorMapper, YxCalculationMajor> implements IYxCalculationMajorService {
|
||||
@Resource
|
||||
private IYxSchoolMajorService yxSchoolMajorService;
|
||||
@Resource
|
||||
private IYxHistoryScoreControlLineService yxHistoryScoreControlLineService;
|
||||
@Resource
|
||||
private ZhuanService zhuanService;
|
||||
@Resource
|
||||
private MusicService musicService;
|
||||
@Resource
|
||||
private TiyuService tiyuService;
|
||||
@Resource
|
||||
private BiaoyanService biaoyanService;
|
||||
@Resource
|
||||
private WuDaoService wuDaoService;
|
||||
@Resource
|
||||
private BoYinService boYinService;
|
||||
|
||||
@Resource
|
||||
private YxHistoryMajorEnrollMapper yxHistoryMajorEnrollMapper;
|
||||
@Resource
|
||||
private YxSchoolMajorMapper yxSchoolMajorMapper;
|
||||
|
||||
@Override
|
||||
public void calculationMajor(YxUserScore userScore) {
|
||||
if (userScore != null) {
|
||||
String batch = userScore.getBatch();
|
||||
String professionalCategory = userScore.getProfessionalCategory();
|
||||
String professionalCategoryChildren = userScore.getProfessionalCategoryChildren();
|
||||
QueryRecommendMajorVO queryRecommendMajorVO = new QueryRecommendMajorVO();
|
||||
queryRecommendMajorVO.setProfessionalCategory(professionalCategory);//专业类别
|
||||
queryRecommendMajorVO.setCognitioPolyclinic(userScore.getCognitioPolyclinic());//文理分科
|
||||
//有子级专业
|
||||
if (StringUtils.isNotBlank(professionalCategoryChildren)) {
|
||||
queryRecommendMajorVO.setPCategoryChildrenList(new ArrayList<>(Arrays.asList(professionalCategoryChildren.split(","))));
|
||||
}
|
||||
//查询专业
|
||||
long startTime = new Date().getTime();
|
||||
List<RecommendMajorDTO> recommendMajorDTOList = yxSchoolMajorMapper.recommendMajorList(queryRecommendMajorVO);
|
||||
//将历史录取信息合并到专业信息里
|
||||
if (CollectionUtils.isNotEmpty(recommendMajorDTOList)) {
|
||||
//获取上一年的招生人数
|
||||
List<YxHistoryMajorEnroll> historyMajorEnrollList = null;
|
||||
//获取历年的招生计划
|
||||
LambdaQueryWrapper<YxHistoryMajorEnroll> hmeWrapper = new LambdaQueryWrapper<>();
|
||||
Set<String> majorNameList = recommendMajorDTOList.stream().map(RecommendMajorDTO::getMajorName).collect(Collectors.toSet());
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getYear, YxConstant.oldYearList);
|
||||
hmeWrapper.eq(YxHistoryMajorEnroll::getCategory, queryRecommendMajorVO.getCognitioPolyclinic());//文科/理科
|
||||
hmeWrapper.isNotNull(YxHistoryMajorEnroll::getRulesEnrollProbability);
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getMajorName, majorNameList);
|
||||
hmeWrapper.orderByDesc(YxHistoryMajorEnroll::getYear);
|
||||
List<YxHistoryMajorEnroll> yxHistoryMajorEnrollList = yxHistoryMajorEnrollMapper.selectList(hmeWrapper);
|
||||
//获取院校信息
|
||||
String a_ = "_";
|
||||
String key = null;
|
||||
//将历年计划 组合成map对象
|
||||
Map<String, YxHistoryMajorEnroll> majorEnrollMap = new LinkedHashMap<>();
|
||||
for (YxHistoryMajorEnroll h : yxHistoryMajorEnrollList) {
|
||||
key = h.getYear() + a_ + h.getSchoolCode() + a_ + h.getMajorName() + a_ + h.getCategory() + a_ + h.getBatch();
|
||||
majorEnrollMap.put(key, h);
|
||||
}
|
||||
//遍历,获取历年数据 添加到专业 的历年信息中
|
||||
Map<String, YxHistoryMajorEnroll> yearMajorEnrollMap;
|
||||
YxHistoryMajorEnroll yxHistoryMajorEnroll;
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorDTOList) {
|
||||
historyMajorEnrollList = new ArrayList<>();
|
||||
yearMajorEnrollMap = new LinkedHashMap<>();
|
||||
//2022年
|
||||
for (String year : YxConstant.oldYearList) {
|
||||
key = recommendMajorDTO.getSchoolCode() + a_ + recommendMajorDTO.getMajorName() + a_ + recommendMajorDTO.getCategory() + a_ + recommendMajorDTO.getBatch();
|
||||
yxHistoryMajorEnroll = majorEnrollMap.get(year + a_ + key);
|
||||
if (yxHistoryMajorEnroll != null) {
|
||||
yearMajorEnrollMap.put(yxHistoryMajorEnroll.getYear(), yxHistoryMajorEnroll);
|
||||
historyMajorEnrollList.add(yxHistoryMajorEnroll);
|
||||
}
|
||||
}
|
||||
|
||||
recommendMajorDTO.setHistoryMajorEnrollMap(yearMajorEnrollMap);
|
||||
recommendMajorDTO.setHistoryMajorEnrollList(historyMajorEnrollList);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
checkEnrollProbability(recommendMajorDTOList, userScore);
|
||||
//计算录取率
|
||||
////计算录取概率
|
||||
if ("高职高专".equals(queryRecommendMajorVO.getBatch())) {
|
||||
zhuanService.zhuanRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
} else {
|
||||
if (YxConstant.betaMajorTypeList.contains(professionalCategory)) {
|
||||
//如果当前专业是(美术设计类,书法类,体育类)
|
||||
//不需要换算为往年分数
|
||||
betaRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
} else {
|
||||
if ("音乐类".equals(professionalCategory)) {
|
||||
//音乐类的
|
||||
musicService.musicRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
} else if ("表演类".equals(professionalCategory)) {
|
||||
biaoyanService.biaoyanRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
} else if ("舞蹈类".equals(professionalCategory)) {
|
||||
wuDaoService.wudaoRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
} else if ("播音与主持类".equals(professionalCategory)) {
|
||||
boYinService.boYinRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
}
|
||||
}
|
||||
}
|
||||
long endTime = new Date().getTime();
|
||||
log.warn("耗费时长:" + (endTime - startTime));
|
||||
YxCalculationMajor yxCalculationMajor = null;
|
||||
List<YxCalculationMajor> calculationMajorList = new ArrayList<>();
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorDTOList) {
|
||||
yxCalculationMajor = new YxCalculationMajor();
|
||||
BeanUtils.copyProperties(recommendMajorDTO, yxCalculationMajor);
|
||||
yxCalculationMajor.setScoreId(userScore.getId());
|
||||
calculationMajorList.add(yxCalculationMajor);
|
||||
}
|
||||
long saveStartTime = new Date().getTime();
|
||||
super.saveBatch(calculationMajorList);
|
||||
long saveEndTime = new Date().getTime();
|
||||
log.warn("插入数据耗费时长:" + (saveEndTime - saveStartTime));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一测算录取率方法
|
||||
* @param recommendMajorDTOList
|
||||
* @param userScore
|
||||
*/
|
||||
private void checkEnrollProbability(List<RecommendMajorDTO> recommendMajorDTOList, YxUserScore userScore) {
|
||||
String professionalCategory = null;
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorDTOList) {
|
||||
professionalCategory = recommendMajorDTO.getMajorType();
|
||||
if ("高职高专".equals(recommendMajorDTO.getBatch())) {
|
||||
zhuanService.calculateEnrollProbability(recommendMajorDTO,userScore);
|
||||
} else {
|
||||
//判断 专业类别
|
||||
if (YxConstant.betaMajorTypeList.contains(professionalCategory)) {
|
||||
//如果当前专业是(美术设计类,书法类,体育类)
|
||||
//不需要换算为往年分数
|
||||
betaRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
} else if ("音乐类".equals(professionalCategory)) {
|
||||
//音乐类的
|
||||
musicService.musicRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
} else if ("表演类".equals(professionalCategory)) {
|
||||
biaoyanService.biaoyanRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
} else if ("舞蹈类".equals(professionalCategory)) {
|
||||
wuDaoService.wudaoRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
} else if ("播音与主持类".equals(professionalCategory)) {
|
||||
boYinService.boYinRecommendMajorListSetEnrollProbability(recommendMajorDTOList, userScore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 美术与设计类,书法类,体育类 按这个走 获取录取率
|
||||
*/
|
||||
private void betaRecommendMajorListSetEnrollProbability(List<RecommendMajorDTO> recommendMajorList, YxUserScore activeCurrentUserScore) {
|
||||
try {
|
||||
long startTime = new Date().getTime();
|
||||
//专业类别
|
||||
String professionalCategory = activeCurrentUserScore.getProfessionalCategory();
|
||||
String cognitioPolyclinic = activeCurrentUserScore.getCognitioPolyclinic();
|
||||
String rulesEnrollProbability = null;
|
||||
String probabilityOperator = null;
|
||||
String majorType = null;//专业类别
|
||||
String majorTypeChild = null;//专业类别子项
|
||||
String mainSubjects = null;//主考科目
|
||||
String nowBatch = activeCurrentUserScore.getBatch();
|
||||
BigDecimal studentScore = null;//学生折合分
|
||||
BigDecimal culturalScore = activeCurrentUserScore.getCulturalScore();//学生的文化分
|
||||
BigDecimal professionalScore = activeCurrentUserScore.getProfessionalScore();//学生的专业分
|
||||
BigDecimal professionalScore2 = null;
|
||||
BigDecimal nowYearDiff = null;//当前年分差
|
||||
YxHistoryScoreControlLine yxHistoryScoreControlLine = yxHistoryScoreControlLineService.getByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), professionalCategory, activeCurrentUserScore.getCognitioPolyclinic(), activeCurrentUserScore.getBatch());
|
||||
BigDecimal culturalControlLine = yxHistoryScoreControlLine.getCulturalScore();//文化分省控线
|
||||
BigDecimal specialControlLine = yxHistoryScoreControlLine.getSpecialScore();//专业分省控线
|
||||
BigDecimal nowYearProvincialControlLine = null;//当前年省控线
|
||||
BigDecimal historyThreeYearDiff = null;//近三年平均差值
|
||||
BigDecimal enrollProbability = null;//录取率
|
||||
Map<String, Object> differenceMap = null;
|
||||
List<YxHistoryMajorEnroll> historyMajorEnrollList = null;//历年录取信息
|
||||
|
||||
int index = 0;
|
||||
if (CollectionUtils.isNotEmpty(recommendMajorList)) {
|
||||
//遍历专业列表
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorList) {
|
||||
rulesEnrollProbability = recommendMajorDTO.getRulesEnrollProbability();
|
||||
//专业类别
|
||||
//majorType = recommendMajorDTO.getMajorType();
|
||||
//取出往年的分数信息, 算出 三年平均差值
|
||||
historyMajorEnrollList = recommendMajorDTO.getHistoryMajorEnrollList();
|
||||
probabilityOperator = recommendMajorDTO.getProbabilityOperator();
|
||||
//没有计算方式 跳过
|
||||
if (StringUtils.isBlank(rulesEnrollProbability)) {
|
||||
continue;
|
||||
}
|
||||
//没有往年录取分数线信息
|
||||
if (CollectionUtils.isEmpty(historyMajorEnrollList) || !(ScoreUtil.hasComputeEnrollProbabilityPermissions(nowBatch, recommendMajorDTO.getBatch()))) {
|
||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||
continue;
|
||||
}
|
||||
|
||||
//不是体育类的专业,如果是文过专排,并且没有录取计算运算符时,文过专排是文*0+专*1,专过文排是文*1+专*0
|
||||
if ("文过专排".equals(rulesEnrollProbability) && StringUtils.isBlank(probabilityOperator)) {
|
||||
probabilityOperator = "文*0+专*1";
|
||||
} else if ("专过文排".equals(rulesEnrollProbability) && StringUtils.isBlank(probabilityOperator)) {
|
||||
probabilityOperator = "文*1+专*0";
|
||||
}
|
||||
if (StringUtils.isBlank(probabilityOperator)) {
|
||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||
continue;
|
||||
}
|
||||
//判断其他录取要求
|
||||
if (!ScoreUtil.otherScoreJudge(professionalScore, activeCurrentUserScore, recommendMajorDTO)) {
|
||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||
continue;
|
||||
}
|
||||
//判断录取方式,分数是否过省控线
|
||||
if (!ScoreUtil.crossingControlLine(rulesEnrollProbability, culturalScore, professionalScore, culturalControlLine, specialControlLine)) {
|
||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||
continue;
|
||||
}
|
||||
|
||||
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, activeCurrentUserScore.getCulturalScore(), activeCurrentUserScore.getProfessionalScore(), recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
|
||||
recommendMajorDTO.setStudentConvertedScore(studentScore);
|
||||
recommendMajorDTO.setStudentScore(studentScore);
|
||||
|
||||
|
||||
//录取方式计算
|
||||
if ("文过专排主科".equals(rulesEnrollProbability)) {
|
||||
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
|
||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||
continue;
|
||||
} else {
|
||||
YxHistoryMajorEnroll yxHistoryMajorEnroll = historyMajorEnrollList.get(0);
|
||||
BigDecimal admissionLine = yxHistoryMajorEnroll.getAdmissionLine();
|
||||
enrollProbability = studentScore.multiply(admissionLine).multiply(YxConstant.bigDecimal075);
|
||||
if (studentScore.compareTo(admissionLine) < 0) {
|
||||
//如果当前主项成绩<近一年的录取分数,录取概率*0.5
|
||||
enrollProbability = enrollProbability.multiply(YxConstant.bigDecimal05);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
nowYearProvincialControlLine = ScoreUtil.covertIntoControlLine(rulesEnrollProbability, culturalControlLine, specialControlLine, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
|
||||
if (nowYearProvincialControlLine == null) {
|
||||
continue;
|
||||
}
|
||||
differenceMap = ScoreUtil.computeHistoryMajorEnrollScoreLineDifferenceWithRulesEnrollProbability(rulesEnrollProbability, historyMajorEnrollList);
|
||||
historyThreeYearDiff = (BigDecimal) differenceMap.get("scoreDifference");
|
||||
//historyThreeYearDiff = sum.divide(new BigDecimal(size), 4, RoundingMode.HALF_UP);
|
||||
nowYearDiff = studentScore.subtract(nowYearProvincialControlLine);
|
||||
if (historyThreeYearDiff == null || historyThreeYearDiff.doubleValue() == 0) {
|
||||
continue;
|
||||
}
|
||||
enrollProbability = nowYearDiff.divide(historyThreeYearDiff, 4, RoundingMode.HALF_UP).multiply(YxConstant.bigDecimal100);
|
||||
}
|
||||
|
||||
//录取率*0.75
|
||||
enrollProbability = enrollProbability.multiply(YxConstant.bigDecimal075);
|
||||
if (enrollProbability.compareTo(YxConstant.bigDecimal150) > 0) {
|
||||
enrollProbability = YxConstant.bigDecimal95x;
|
||||
} else if (enrollProbability.compareTo(YxConstant.bigDecimal100) > 0) {
|
||||
enrollProbability = YxConstant.bigDecimal85x;
|
||||
} else if (enrollProbability.compareTo(YxConstant.bigDecimal0) <= 0) {
|
||||
enrollProbability = YxConstant.bigDecimal0;
|
||||
}
|
||||
recommendMajorDTO.setEnrollProbability(enrollProbability);
|
||||
recommendMajorDTO.setRulesEnrollProbability(ScoreUtil.replaceLastZeroChar(rulesEnrollProbability));
|
||||
recommendMajorDTO.setProbabilityOperator(ScoreUtil.replaceLastZeroChar(probabilityOperator));
|
||||
//==============================================
|
||||
}
|
||||
}
|
||||
long endTime = new Date().getTime();
|
||||
log.warn("用时:" + (endTime - startTime) + "毫秒");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.yx.service.impl;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.modules.yx.entity.YxHistoryScoreControlLine;
|
||||
import org.jeecg.modules.yx.mapper.YxHistoryScoreControlLineMapper;
|
||||
import org.jeecg.modules.yx.service.IYxHistoryScoreControlLineService;
|
||||
|
|
@ -14,6 +15,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 历年各专业省控分数线
|
||||
|
|
@ -61,6 +64,24 @@ public class YxHistoryScoreControlLineServiceImpl extends ServiceImpl<YxHistoryS
|
|||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory,professionalCategory);
|
||||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getCategory,category);
|
||||
lambdaQueryWrapper.orderByDesc(YxHistoryScoreControlLine::getBatch);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
List<YxHistoryScoreControlLine> newList = new ArrayList<>();
|
||||
List<YxHistoryScoreControlLine> list = this.list(lambdaQueryWrapper);
|
||||
YxHistoryScoreControlLine yxHistoryScoreControlLine1 = null;
|
||||
for (YxHistoryScoreControlLine yxHistoryScoreControlLine : list) {
|
||||
if (yxHistoryScoreControlLine.getBatch().equals("本科A段")) {
|
||||
yxHistoryScoreControlLine1 = new YxHistoryScoreControlLine();
|
||||
BeanUtils.copyProperties(yxHistoryScoreControlLine,yxHistoryScoreControlLine1);
|
||||
yxHistoryScoreControlLine1.setBatch("提前批");
|
||||
newList.add(yxHistoryScoreControlLine1);
|
||||
}
|
||||
newList.add(yxHistoryScoreControlLine);
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, YxHistoryScoreControlLine> mapsBatchByProfessionalCategoryOfYear(int year, String professionalCategory, String category) {
|
||||
List<YxHistoryScoreControlLine> yxHistoryScoreControlLines = this.listByProfessionalCategoryOfYear(year, professionalCategory, category);
|
||||
return yxHistoryScoreControlLines.stream().collect(Collectors.toMap(y -> y.getBatch(), y -> y));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
hmeWrapper.in(YxHistoryMajorEnroll::getYear, YxConstant.oldYearList);
|
||||
hmeWrapper.eq(YxHistoryMajorEnroll::getCategory, queryRecommendMajorVO.getCognitioPolyclinic());//文科/理科
|
||||
hmeWrapper.isNotNull(YxHistoryMajorEnroll::getRulesEnrollProbability);
|
||||
hmeWrapper.eq(YxHistoryMajorEnroll::getMajorType,queryRecommendMajorVO.getProfessionalCategory());
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getMajorName, majorNameList);
|
||||
hmeWrapper.orderByDesc(YxHistoryMajorEnroll::getYear);
|
||||
List<YxHistoryMajorEnroll> yxHistoryMajorEnrollList = yxHistoryMajorEnrollService.list(hmeWrapper);
|
||||
|
|
@ -259,7 +260,6 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
String paneName = queryRecommendMajorVO.getPaneName();
|
||||
|
||||
////计算录取概率
|
||||
|
||||
if ("高职高专".equals(queryRecommendMajorVO.getBatch())) {
|
||||
zhuanService.zhuanRecommendMajorListSetEnrollProbability(recommendMajorList, activeCurrentUserScore);
|
||||
} else {
|
||||
|
|
@ -297,7 +297,7 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
//难
|
||||
nan++;
|
||||
}
|
||||
}
|
||||
}
|
||||
recommendMajorList.sort((a, b) -> b.getEnrollProbability().compareTo(a.getEnrollProbability()));
|
||||
|
||||
//判断 paneName
|
||||
|
|
@ -416,37 +416,32 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
long startTime = new Date().getTime();
|
||||
//专业类别
|
||||
String professionalCategory = activeCurrentUserScore.getProfessionalCategory();
|
||||
String cognitioPolyclinic = activeCurrentUserScore.getCognitioPolyclinic();
|
||||
String rulesEnrollProbability = null;
|
||||
String probabilityOperator = null;
|
||||
String majorType = null;//专业类别
|
||||
String majorTypeChild = null;//专业类别子项
|
||||
String mainSubjects = null;//主考科目
|
||||
String nowBatch = activeCurrentUserScore.getBatch();
|
||||
BigDecimal studentScore = null;//学生折合分
|
||||
BigDecimal culturalScore = activeCurrentUserScore.getCulturalScore();//学生的文化分
|
||||
BigDecimal professionalScore = activeCurrentUserScore.getProfessionalScore();//学生的专业分
|
||||
BigDecimal professionalScore2 = null;
|
||||
BigDecimal nowYearDiff = null;//当前年分差
|
||||
YxHistoryScoreControlLine yxHistoryScoreControlLine = yxHistoryScoreControlLineService.getByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), professionalCategory, activeCurrentUserScore.getCognitioPolyclinic(), activeCurrentUserScore.getBatch());
|
||||
BigDecimal culturalControlLine = yxHistoryScoreControlLine.getCulturalScore();//文化分省控线
|
||||
BigDecimal specialControlLine = yxHistoryScoreControlLine.getSpecialScore();//专业分省控线
|
||||
Map<String, YxHistoryScoreControlLine> historyScoreControlLineMap = yxHistoryScoreControlLineService.mapsBatchByProfessionalCategoryOfYear(Integer.parseInt(YxConstant.historyControlLineYear), professionalCategory, activeCurrentUserScore.getCognitioPolyclinic());
|
||||
BigDecimal culturalControlLine = null;//文化分省控线
|
||||
BigDecimal specialControlLine = null;//专业分省控线
|
||||
BigDecimal nowYearProvincialControlLine = null;//当前年省控线
|
||||
BigDecimal historyThreeYearDiff = null;//近三年平均差值
|
||||
BigDecimal enrollProbability = null;//录取率
|
||||
Map<String, Object> differenceMap = null;
|
||||
List<YxHistoryMajorEnroll> historyMajorEnrollList = null;//历年录取信息
|
||||
|
||||
int index = 0;
|
||||
if (CollectionUtils.isNotEmpty(recommendMajorList)) {
|
||||
//遍历专业列表
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorList) {
|
||||
rulesEnrollProbability = recommendMajorDTO.getRulesEnrollProbability();
|
||||
//专业类别
|
||||
//majorType = recommendMajorDTO.getMajorType();
|
||||
//取出往年的分数信息, 算出 三年平均差值
|
||||
historyMajorEnrollList = recommendMajorDTO.getHistoryMajorEnrollList();
|
||||
probabilityOperator = recommendMajorDTO.getProbabilityOperator();
|
||||
culturalControlLine = historyScoreControlLineMap.get(recommendMajorDTO.getBatch()).getCulturalScore();
|
||||
specialControlLine = historyScoreControlLineMap.get(recommendMajorDTO.getBatch()).getSpecialScore();
|
||||
//没有计算方式 跳过
|
||||
if (StringUtils.isBlank(rulesEnrollProbability)) {
|
||||
continue;
|
||||
|
|
@ -484,7 +479,7 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
|
||||
|
||||
//录取方式计算
|
||||
if ("文过专排主科".equals(rulesEnrollProbability)) {
|
||||
if (rulesEnrollProbability.equals("文过专排主科")) {
|
||||
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
|
||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
package org.jeecg.modules.yx.service.impl;
|
||||
|
||||
import org.jeecg.modules.yx.entity.YxUserCalculationMajor;
|
||||
import org.jeecg.modules.yx.mapper.YxUserCalculationMajorMapper;
|
||||
import org.jeecg.modules.yx.service.IYxUserCalculationMajorService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 计算用户专业分数关联表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-03-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class YxUserCalculationMajorServiceImpl extends ServiceImpl<YxUserCalculationMajorMapper, YxUserCalculationMajor> implements IYxUserCalculationMajorService {
|
||||
|
||||
}
|
||||
|
|
@ -175,4 +175,10 @@ public class ZhuanService {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void calculateEnrollProbability(RecommendMajorDTO recommendMajorDTO, YxUserScore userScore) {
|
||||
String professionalCategory = userScore.getProfessionalCategory();
|
||||
String cognitioPolyclinic = userScore.getCognitioPolyclinic();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ spring:
|
|||
datasource:
|
||||
master:
|
||||
# url: jdbc:mysql://127.0.0.1:3306/yitisheng-test?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://43.138.41.85:50996/yitisheng-test5?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://43.138.41.85:50996/yitisheng-test5?allowMultiQueries=true&rewriteBatchedStatements=true&characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
# password: root
|
||||
password: Wang5322570
|
||||
|
|
|
|||
Loading…
Reference in New Issue