This commit is contained in:
zhouwentao 2024-03-07 15:53:43 +08:00
parent 8812c7fdce
commit dfe96567ea
57 changed files with 2420 additions and 694 deletions

View File

@ -1,5 +1,7 @@
package org.jeecg.modules.art.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
@ -8,6 +10,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.AssertUtils;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.art.dto.ArtCalculateInvestmentDTO;
import org.jeecg.modules.art.dto.ArtRecommendMajorBaseDTO;
import org.jeecg.modules.art.dto.ArtTestCulturalDTO;
@ -44,6 +47,39 @@ public class ArtRecommendMajorController {
IYxHistoryMajorEnrollService yxHistoryMajorEnrollService;
@Resource
IYxHistoryScoreControlLineService yxHistoryScoreControlLineService;
@Resource
private RedisUtil redisUtil;
@ApiOperation(value = "获取可报专业总数")
@GetMapping("/rulesEnrollrobabilityMenuList")
public Result<?> rulesEnrollrobabilityMenuList(QueryRecommendMajorVO queryRecommendMajorVO){
String key = "rulesEnrollrobabilityMenuList_professionalCategory_"+queryRecommendMajorVO.getProfessionalCategory();
String json = null;
List<Map> dataList =new ArrayList<>();
Map<String,String> data=null;
if (redisUtil.hasKey(key)) {
json = (String)redisUtil.get(key);
dataList = JSONArray.parseArray(json,Map.class);
}else{
LambdaQueryWrapper<YxSchoolMajor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.select(YxSchoolMajor::getRulesEnrollProbability);
lambdaQueryWrapper.eq(YxSchoolMajor::getMajorType,queryRecommendMajorVO.getProfessionalCategory());
lambdaQueryWrapper.last("order by field(rules_enroll_probability,'','文过专排','专过文排')");
lambdaQueryWrapper.isNotNull(YxSchoolMajor::getRulesEnrollProbability);
lambdaQueryWrapper.groupBy(YxSchoolMajor::getRulesEnrollProbability);
List<YxSchoolMajor> yxSchoolMajorList = yxSchoolMajorService.list(lambdaQueryWrapper);
for (YxSchoolMajor yxSchoolMajor : yxSchoolMajorList) {
data = new LinkedHashMap<>();
data.put("label",yxSchoolMajor.getRulesEnrollProbability());
data.put("value",yxSchoolMajor.getRulesEnrollProbability());
dataList.add(data);
}
json = JSONObject.toJSONString(dataList);
redisUtil.set(key,json,3600);
}
return Result.OK(dataList);
}
@ApiOperation(value = "获取可报专业总数")
@GetMapping("/recommendMajorCount")
@ -84,6 +120,29 @@ public class ArtRecommendMajorController {
@ApiOperation(value = "投档分测算")
@GetMapping("/calculateInvestment")
public Result<?> calculateInvestment(QueryCalculateInvestmentVO queryCalculateInvestmentVO) {
/*List<YxHistoryMajorEnroll> list = yxHistoryMajorEnrollService.list(new LambdaQueryWrapper<YxHistoryMajorEnroll>().eq(YxHistoryMajorEnroll::getYear,"2020"));
Map<String,YxHistoryMajorEnroll> maps1=new LinkedHashMap<>();
String key = null;
for (YxHistoryMajorEnroll yxHistoryMajorEnroll : list) {
key = yxHistoryMajorEnroll.getMajorType()+"_"+yxHistoryMajorEnroll.getCategory()+"_"+yxHistoryMajorEnroll.getSchoolCode()+"_"+yxHistoryMajorEnroll.getMajorName()+"_"+yxHistoryMajorEnroll.getBatch();
maps1.put(key,yxHistoryMajorEnroll);
}*/
//List<YxSchoolMajor> yxSchoolMajorList = yxSchoolMajorService.list(new LambdaQueryWrapper<YxSchoolMajor>().isNotNull(YxSchoolMajor::getRulesEnrollProbability).like(YxSchoolMajor::getRulesEnrollProbability,"").notLike(YxSchoolMajor::getRulesEnrollProbability,"+"));
/*YxHistoryMajorEnroll yxHistoryMajorEnroll = null;
for (YxSchoolMajor yxSchoolMajor : yxSchoolMajorList) {
*//*key = yxSchoolMajor.getMajorType()+"_"+yxSchoolMajor.getCategory()+"_"+yxSchoolMajor.getSchoolCode()+"_"+yxSchoolMajor.getMajorName()+"_"+yxSchoolMajor.getBatch();
yxHistoryMajorEnroll = maps1.get(key);*//*
*//*if (yxHistoryMajorEnroll!=null) {
yxSchoolMajor.setRulesEnrollProbability(ScoreUtil.replaceLastZeroChar(yxHistoryMajorEnroll.getRulesEnrollProbability()));
yxSchoolMajor.setProbabilityOperator(ScoreUtil.replaceLastZeroChar(yxHistoryMajorEnroll.getProbabilityOperator()));
}*//*
String rulesEnrollProbability = yxSchoolMajor.getRulesEnrollProbability();
*//*yxSchoolMajor.setRulesEnrollProbability(ScoreUtil.replaceLastZeroChar(yxSchoolMajor.getRulesEnrollProbability()));
yxSchoolMajor.setProbabilityOperator(ScoreUtil.replaceLastZeroChar(yxSchoolMajor.getProbabilityOperator()));*//*
}*/
//yxSchoolMajorService.updateBatchById(yxSchoolMajorList);
//获取 院校专业信息列表,录取方式notnull
LambdaQueryWrapper<YxSchoolMajor> yxSchoolMajorLambdaQueryWrapper = new LambdaQueryWrapper<>();
yxSchoolMajorLambdaQueryWrapper.isNotNull(YxSchoolMajor::getRulesEnrollProbability);
@ -122,6 +181,9 @@ public class ArtRecommendMajorController {
artCalculateInvestmentDTO.setSchoolNum(maps.get(rulesEnrollProbability).size());
artCalculateInvestmentDTO.setRulesEnrollProbability(rulesEnrollProbability);
artCalculateInvestmentDTO.setProbabilityOperator(yxSchoolMajor.getProbabilityOperator());
if (rulesEnrollProbability.contains("文*0.133+专*0")) {
System.out.println("111");
}
artCalculateInvestmentDTO.setScore(ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore, null, yxSchoolMajor.getProbabilityOperator()));
calculateInvestmentDTOList.add(artCalculateInvestmentDTO);
}

View File

@ -106,17 +106,6 @@ public class ArtVolunteerController {
volunteerDTO = yxVolunteerService.getActiveByCreate(sysUser.getId());
}
//if (this.scoreInfo.professionalCategory === '音乐类') {
// let categorychildrenList = []
// let professionalCategoryChildren = this.scoreInfo.professionalCategoryChildren
// if (professionalCategoryChildren.includes('音乐表演声乐')) {
// categorychildrenList.push({childName:'音乐表演声乐',score: this.scoreInfo.yybysy})
// }else if (professionalCategoryChildren.includes('音乐表演器乐')) {
// categorychildrenList.push({childName:'音乐表演声乐',score: this.scoreInfo.yybysy})
// }else if (professionalCategoryChildren.includes('音乐教育')) {
// categorychildrenList.push({childName:'音乐表演声乐',score: this.scoreInfo.yybysy})
// }
// }
return Result.OK(volunteerDTO);
}
@ -156,10 +145,10 @@ public class ArtVolunteerController {
*/
@ApiOperation(value = "新建志愿", notes = "新建志愿")
@PostMapping(value = "/addNew")
public Result<YxVolunteer> addNew() {
public Result<YxVolunteer> addNew(@RequestBody YxVolunteer yxVolunteer) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
AssertUtils.notNull(sysUser, "请先登录!");
return Result.OK(yxVolunteerService.addNew());
return Result.OK(yxVolunteerService.addNew(yxVolunteer));
}
@ApiOperation(value = "删除志愿明细")
@ -233,6 +222,99 @@ public class ArtVolunteerController {
return Result.OK("删除成功!");
}
/**
* 移动志愿序号
*/
@ApiOperation(value = "移动志愿序号", notes = "移动志愿序号")
@PostMapping(value = "/moveIndexs")
public Result<String> moveIndexs(@RequestBody SaveVolunteerVO saveVolunteerVO) {
String batch = saveVolunteerVO.getBatch();
String volunteerId = saveVolunteerVO.getVolunteerId();
Integer indexs = saveVolunteerVO.getIndexs();
String id = saveVolunteerVO.getId();
//当前选择的志愿
YxVolunteerRecord nowRecord = yxVolunteerRecordService.getById(id);
//获取移动志愿志愿
LambdaQueryWrapper<YxVolunteerRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId,volunteerId);
lambdaQueryWrapper.eq(YxVolunteerRecord::getIndexs,indexs);
lambdaQueryWrapper.eq(YxVolunteerRecord::getBatch,batch);
YxVolunteerRecord recordServiceOne = yxVolunteerRecordService.getOne(lambdaQueryWrapper);
return Result.OK();
}
/**
* 交换志愿序号
*/
@ApiOperation(value = "交换志愿序号", notes = "交换志愿序号")
@PostMapping(value = "/exchangeIndexs")
public Result<String> exchangeIndexs(@RequestBody SaveVolunteerVO saveVolunteerVO) {
String batch = saveVolunteerVO.getBatch();
String volunteerId = saveVolunteerVO.getVolunteerId();
Integer indexs = saveVolunteerVO.getIndexs();
String id = saveVolunteerVO.getId();
//当前选择的志愿
YxVolunteerRecord nowRecord = yxVolunteerRecordService.getById(id);
//获取交换志愿志愿
LambdaQueryWrapper<YxVolunteerRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId,volunteerId);
lambdaQueryWrapper.eq(YxVolunteerRecord::getIndexs,indexs);
lambdaQueryWrapper.eq(YxVolunteerRecord::getBatch,batch);
YxVolunteerRecord recordServiceOne = yxVolunteerRecordService.getOne(lambdaQueryWrapper);
if (recordServiceOne!=null) {
recordServiceOne.setIndexs(nowRecord.getIndexs());
yxVolunteerRecordService.updateById(recordServiceOne);
}
nowRecord.setIndexs(indexs);
yxVolunteerRecordService.updateById(nowRecord);
return Result.OK("操作成功");
}
/**
* updateFctj
*/
@ApiOperation(value = "修改服从调剂", notes = "修改服从调剂")
@PostMapping(value = "/updateFctj")
public Result<String> updateFctj(@RequestBody SaveVolunteerVO saveVolunteerVO) {
String id = saveVolunteerVO.getId();
YxVolunteerRecord yxVolunteerRecord = yxVolunteerRecordService.getById(id);
if (yxVolunteerRecord!=null) {
Integer fctj = yxVolunteerRecord.getFctj();
if (fctj==null || fctj==0) {
yxVolunteerRecord.setFctj(1);
}else{
yxVolunteerRecord.setFctj(0);
}
yxVolunteerRecordService.updateById(yxVolunteerRecord);
}
return Result.OK("操作成功");
}
@ApiOperation(value = "切换志愿单", notes = "切换志愿单")
@PostMapping(value = "/switchVolunteer")
public Result<String> switchVolunteer(@RequestBody SaveVolunteerVO saveVolunteerVO) {
String id = saveVolunteerVO.getId();
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
YxVolunteer volunteer = yxVolunteerService.getById(id);
if (volunteer!=null) {
String scoreId = volunteer.getScoreId();
if (StringUtils.isNotBlank(scoreId)) {
//修改当前用户的所有志愿单状态 0
yxVolunteerService.update(new LambdaUpdateWrapper<YxVolunteer>().eq(YxVolunteer::getCreateBy,user.getId()).set(YxVolunteer::getState,0));
//修改当前用户的成绩状态 0
yxUserScoreService.update(new LambdaUpdateWrapper<YxUserScore>().eq(YxUserScore::getCreateBy,user.getId()).set(YxUserScore::getState,0));
//开启志愿单及成绩
//修改当前用户志愿单状态 1
yxVolunteerService.update(new LambdaUpdateWrapper<YxVolunteer>().eq(YxVolunteer::getCreateBy,user.getId()).eq(YxVolunteer::getId,id).set(YxVolunteer::getState,1));
//修改当前用户的成绩状态 0
yxUserScoreService.update(new LambdaUpdateWrapper<YxUserScore>().eq(YxUserScore::getCreateBy,user.getId()).eq(YxUserScore::getId,scoreId).set(YxUserScore::getState,1));
}
}
return Result.OK("操作成功");
}
@GetMapping(value = "/preview")
public void preview(@RequestParam(value = "id") String id, HttpServletResponse response) throws IOException {
VolunteerDTO volunteerDTO = yxVolunteerService.findById(id);

View File

@ -3,13 +3,7 @@ package org.jeecg.modules.art.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang.StringUtils;
import org.jeecg.modules.art.dto.ArtBaseDTO;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**

View File

@ -5,6 +5,7 @@ import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
@ -72,4 +73,7 @@ public class SaveVolunteerVO implements Serializable {
*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
private BigDecimal enrollProbability;
private BigDecimal studentConvertedScore;
}

View File

@ -0,0 +1,308 @@
package org.jeecg.modules.mini.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.mini.service.MiniArticleService;
import org.jeecg.modules.mini.vo.ImportArticleVO;
import org.jeecg.modules.mini.vo.QueryArticleVO;
import org.jeecg.modules.yx.dto.LiNianShuJuDTO;
import org.jeecg.modules.yx.dto.SchoolMajorImport3;
import org.jeecg.modules.yx.entity.*;
import org.jeecg.modules.yx.service.*;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description 文章接口
* @Author ZhouWenTao
* @Date 2024/3/6 16:52
*/
@Api(tags = "小程序端-文章接口")
@RestController
@Slf4j
@RequestMapping("/mini/article")
public class MiniArticleController {
@Autowired
private RedisUtil redisUtil;
@Autowired
private IYxSchoolService yxSchoolService;
@Autowired
private IYxSchoolMajorService yxSchoolMajorService;
@Autowired
private IYxHistoryMajorEnrollService yxHistoryMajorEnrollService;
@Autowired
private IYxArticleService yxArticleService;
@Autowired
private IYxArticleContentService yxArticleContentService;
@Autowired
private MiniArticleService miniArticleService;
public static void main(String[] args) {
String rulesEnrollProbability = "文1+专0.66700";
String[] split = rulesEnrollProbability.split("\\+");
String w=null,z=null;
BigDecimal wb=null;
BigDecimal zb=null;
for (String s : split) {
w = null;
z = null;
if (s.contains("")) {
wb = new BigDecimal(s.replace("",""));
}
if (s.contains("")) {
zb = new BigDecimal(s.replace("",""));
}
}
System.out.println("文*"+wb.stripTrailingZeros().toPlainString()+"+专*"+zb.stripTrailingZeros().toPlainString());
}
@ApiOperation(value = "文章列表")
@GetMapping(value = "/page")
public Result<?> articlePage(QueryArticleVO queryArticleVO) {
if(false){
LambdaQueryWrapper<YxSchoolMajor> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.isNotNull(YxSchoolMajor::getRulesEnrollProbability);
queryWrapper.like(YxSchoolMajor::getRulesEnrollProbability,"");
queryWrapper.like(YxSchoolMajor::getRulesEnrollProbability,"");
queryWrapper.notLike(YxSchoolMajor::getRulesEnrollProbability,"+");
queryWrapper.notLike(YxSchoolMajor::getRulesEnrollProbability,"文过专排");
queryWrapper.notLike(YxSchoolMajor::getRulesEnrollProbability,"专过文排");
//queryWrapper.notIn(YxHistoryMajorEnroll::getRulesEnrollProbability,"文+专","专+文");
List<YxSchoolMajor> list = yxSchoolMajorService.list(queryWrapper);
for (YxSchoolMajor yxSchoolMajor : list) {
String[] split = yxSchoolMajor.getRulesEnrollProbability().split("");
String w=null,z=null;
BigDecimal wb=null;
BigDecimal zb=null;
for (String s : split) {
w = null;
z = null;
if (s.contains("")) {
wb = new BigDecimal(s.replace("",""));
}else{
zb = new BigDecimal(s.replace("",""));
}
}
System.out.println(yxSchoolMajor.getRulesEnrollProbability()+":");
System.out.print("文*"+wb.stripTrailingZeros().toPlainString()+"+专*"+zb.stripTrailingZeros().toPlainString());
System.out.println();
yxSchoolMajor.setRulesEnrollProbability("文*"+wb.stripTrailingZeros().toPlainString()+"+专*"+zb.stripTrailingZeros().toPlainString());
}
yxSchoolMajorService.updateBatchById(list);
return Result.OK();
}
if(false){
LambdaQueryWrapper<YxHistoryMajorEnroll> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.isNotNull(YxHistoryMajorEnroll::getRulesEnrollProbability);
queryWrapper.like(YxHistoryMajorEnroll::getRulesEnrollProbability,"");
queryWrapper.like(YxHistoryMajorEnroll::getRulesEnrollProbability,"");
queryWrapper.notLike(YxHistoryMajorEnroll::getRulesEnrollProbability,"+");
queryWrapper.notLike(YxHistoryMajorEnroll::getRulesEnrollProbability,"文过专排");
queryWrapper.notLike(YxHistoryMajorEnroll::getRulesEnrollProbability,"专过文排");
//queryWrapper.notIn(YxHistoryMajorEnroll::getRulesEnrollProbability,"文+专","专+文");
List<YxHistoryMajorEnroll> list = yxHistoryMajorEnrollService.list(queryWrapper);
for (YxHistoryMajorEnroll yxSchoolMajor : list) {
String[] split = yxSchoolMajor.getRulesEnrollProbability().split("");
String w=null,z=null;
BigDecimal wb=null;
BigDecimal zb=null;
for (String s : split) {
w = null;
z = null;
if (s.contains("")) {
wb = new BigDecimal(s.replace("",""));
}else{
zb = new BigDecimal(s.replace("",""));
}
}
System.out.println(yxSchoolMajor.getRulesEnrollProbability()+":");
System.out.print("文*"+wb.stripTrailingZeros().toPlainString()+"+专*"+zb.stripTrailingZeros().toPlainString());
System.out.println();
yxSchoolMajor.setRulesEnrollProbability("文*"+wb.stripTrailingZeros().toPlainString()+"+专*"+zb.stripTrailingZeros().toPlainString());
}
yxHistoryMajorEnrollService.updateBatchById(list);
return Result.OK();
}
if(false){
LambdaQueryWrapper<YxSchoolMajor> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.isNotNull(YxSchoolMajor::getRulesEnrollProbability);
queryWrapper.like(YxSchoolMajor::getRulesEnrollProbability,"+");
queryWrapper.notLike(YxSchoolMajor::getRulesEnrollProbability,"*");
queryWrapper.notIn(YxSchoolMajor::getRulesEnrollProbability,"文+专","专+文");
List<YxSchoolMajor> yxSchoolMajorList = yxSchoolMajorService.list(queryWrapper);
for (YxSchoolMajor yxSchoolMajor : yxSchoolMajorList) {
System.out.println(yxSchoolMajor.getRulesEnrollProbability()+":");
String[] split = yxSchoolMajor.getRulesEnrollProbability().split("\\+");
String w=null,z=null;
BigDecimal wb=null;
BigDecimal zb=null;
for (String s : split) {
w = null;
z = null;
try {
if (s.contains("")) {
wb = new BigDecimal(s.replace("",""));
}
}catch (Exception e){
System.out.println("--"+yxSchoolMajor.getRulesEnrollProbability());
e.printStackTrace();
}
if (s.contains("")) {
zb = new BigDecimal(s.replace("",""));
}
}
System.out.print("文*"+wb.stripTrailingZeros().toPlainString()+"+专*"+zb.stripTrailingZeros().toPlainString());
System.out.println();
yxSchoolMajor.setRulesEnrollProbability("文*"+wb.stripTrailingZeros().toPlainString()+"+专*"+zb.stripTrailingZeros().toPlainString());
}
yxSchoolMajorService.updateBatchById(yxSchoolMajorList);
return Result.OK();
}
//分页
Integer pageNum = queryArticleVO.getPageNum();
Integer pageSize = queryArticleVO.getPageSize();
Integer type = queryArticleVO.getType();
if (null == type) {
type = 0;
}
//先从redis中获取是否有该文章信息
String key = "miniArticlePage_type" + type + "_pageNum_" + pageNum + "pageSize_" + pageSize;
String json = null;
IPage<YxArticle> pageList = null;
if (false) {
redisUtil.hasKey(key);
//redis中存在
json = (String) redisUtil.get(key);
Gson gson = new Gson();
pageList = gson.fromJson(json,new TypeToken<IPage<YxArticle>>(){}.getType());
} else {
//redis不存在从数据库获取
LambdaQueryWrapper<YxArticle> yxArticleLambdaQueryWrapper = new LambdaQueryWrapper<>();
yxArticleLambdaQueryWrapper.eq(YxArticle::getType, type);
yxArticleLambdaQueryWrapper.orderByDesc(YxArticle::getCreateTime, YxArticle::getUpdateTime);
pageList = yxArticleService.page(new Page<>(pageNum, pageSize), yxArticleLambdaQueryWrapper);
//json = JSONArray.toJSONString(pageList);
//存到redis中
//redisUtil.set(key, json, 3600);
}
return Result.OK(pageList);
// 获取上传文件对象
/*File file = new File("C:\\Users\\Denim\\Desktop\\艺体志愿宝数据\\2招生章程2022.xlsx");
FileInputStream fileInputStream = null;
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setNeedSave(true);
int index = 0;
String type = null;
try {
fileInputStream = new FileInputStream(file);
List<ImportArticleVO> list = ExcelImportUtil.importExcel(fileInputStream, ImportArticleVO.class, params);
Map<String, YxSchool> yxSchoolMap = yxSchoolService.list().stream().collect(Collectors.toMap(YxSchool::getSchoolName, y -> y));
Set<String> notSchoolNameList = new HashSet<>();
YxSchool yxSchool = null;
String shijian = null;
SimpleDateFormat inputFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a");
SimpleDateFormat inputFormat2 = new SimpleDateFormat("M/d/yyyy h:mm:ss a", Locale.ENGLISH);
SimpleDateFormat inputFormat3 = new SimpleDateFormat("MH/dd/yyyy HH:mm:ss a", Locale.ENGLISH);
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date =null;
String schoolName = null;
List<YxArticle> yxArticleList = new ArrayList<>();
YxArticle yxArticle = null;
YxArticleContent yxArticleContent = null;
for (ImportArticleVO importArticleVO : list) {
schoolName = importArticleVO.getSchoolName();
date = null;
schoolName = schoolName.replace("(","").replace(")","");
if(StringUtils.isNotBlank(importArticleVO.getShijian())){
shijian = importArticleVO.getShijian().replace(" "," ");
try {
date = inputFormat.parse(shijian);
}
catch (ParseException e) {
try {
date = inputFormat2.parse(shijian);
}catch (ParseException e2){
try {
date = inputFormat3.parse(shijian);
}catch (ParseException e3){
try {
date = outputFormat.parse(shijian);
}catch (ParseException e4){
e4.printStackTrace();
}
}
}
}
}
//长春光华学院2022年招生章程 //2022/4/28 0:52
//南昌师范学院2022年招生章程 //2022/5/12 0:42
//河南水利与环境职业学院2022年三年制高职招生章程 //2022/5/11 0:03
//平顶山工业职业技术学院2022年招生章程 //2022/5/11 0:17
//漯河医学高等专科学校2022年普通专科招生章程 //2022/5/11 0:05
//湘南学院2022年招生章程 //2022/5/1 0:59
//宝鸡中北职业学院2022年招生章程 //2022/5/12 0:05
index++;
YxSchool school = yxSchoolMap.get(schoolName);
if (school==null) {
notSchoolNameList.add(importArticleVO.getSchoolName());
continue;
}
yxArticle = new YxArticle();
BeanUtils.copyProperties(importArticleVO,yxArticle);
yxArticle.setReleaseTime(date);
yxArticle.setSchoolId(school.getId());
yxArticleService.save(yxArticle);
yxArticleContent = new YxArticleContent();
yxArticleContent.setArticleId(yxArticle.getId());
yxArticleContent.setContentType("1");
yxArticleContent.setContent(importArticleVO.getContent());
yxArticleContentService.save(yxArticleContent);
}
for (String s : notSchoolNameList) {
System.out.println(s);
}
} catch (FileNotFoundException fileNotFoundException) {
log.error("文件不存在," + file.getAbsolutePath());
throw new RuntimeException(fileNotFoundException);
} catch (StringIndexOutOfBoundsException e) {
} catch (Exception e) {
System.out.println(index);
throw new RuntimeException(e);
}*/
}
@ApiOperation(value = "获取文章详细信息")
@GetMapping(value = "/articleContent/{articleId}")
public Result<?> articleContent(@PathVariable String articleId) {
return Result.OK(miniArticleService.getArticleDtoById(articleId));
}
}

View File

@ -0,0 +1,66 @@
package org.jeecg.modules.mini.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description 小程序端 文章返回对象
* @Author ZhouWenTao
* @Date 2024/3/6 17:20
*/
@Data
@ApiModel(value = "小程序端-文章返回对象")
public class MiniArticleDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**文章id*/
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
private java.lang.String title;
/**文章内容*/
@Excel(name = "文章内容", width = 15)
@ApiModelProperty(value = "文章内容")
private java.lang.String content;
/**内容类型1.纯文本2.富文本)*/
@Excel(name = "内容类型1.纯文本2.富文本)", width = 15)
@ApiModelProperty(value = "内容类型1.纯文本2.富文本)")
private java.lang.String contentType;
/**院校id*/
@Excel(name = "院校id", width = 15)
@ApiModelProperty(value = "院校id")
private java.lang.String schoolId;
/**院校名称*/
@Excel(name = "院校名称", width = 15)
@ApiModelProperty(value = "院校名称")
private java.lang.String schoolName;
/**发布者*/
@Excel(name = "发布者", width = 15)
@ApiModelProperty(value = "发布者")
private java.lang.String author;
/**类型(1.招生章程)*/
@Excel(name = "类型(1.招生章程)", width = 15)
@ApiModelProperty(value = "类型(1.招生章程)")
private java.lang.String type;
/**发布日期*/
@Excel(name = "发布日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@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 releaseTime;
/**阅读量*/
@Excel(name = "阅读量", width = 15)
@ApiModelProperty(value = "阅读量")
private java.lang.Integer viewCount;
}

View File

@ -0,0 +1,21 @@
package org.jeecg.modules.mini.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author ZhouWenTao
* @Date 2023/9/18 17:29
*/
@Data
public class MiniBaseDTO implements Serializable {
@ApiModelProperty(value = "当前页")
private Integer pageNum=0;
@ApiModelProperty(value = "分页页面大小")
private Integer pageSize=10;
private String schoolName;
private String schoolCode;
}

View File

@ -55,6 +55,10 @@ public class MiniSchoolDTO implements Serializable {
@ApiModelProperty(value = "学校类型(本科/专科)")
private String schoolType;
/**软科排名*/
@ApiModelProperty(value = "软科排名")
private String arwuRanking;
/**省份*/
@ApiModelProperty(value = "省份")
private String province;

View File

@ -0,0 +1,46 @@
package org.jeecg.modules.mini.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.mini.dto.MiniArticleDTO;
import org.jeecg.modules.yx.entity.YxArticle;
import org.jeecg.modules.yx.entity.YxArticleContent;
import org.jeecg.modules.yx.service.IYxArticleContentService;
import org.jeecg.modules.yx.service.IYxArticleService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description 文章Service
* @Author ZhouWenTao
* @Date 2024/3/6 17:21
*/
@Service
public class MiniArticleService {
@Autowired
private IYxArticleService yxArticleService;
@Autowired
private IYxArticleContentService yxArticleContentService;
/**
* 获取详细文章信息
* @param articleId 文章id
*/
public MiniArticleDTO getArticleDtoById(String articleId) {
//先获取文章信息
YxArticle yxArticle = yxArticleService.getById(articleId);
if (yxArticle == null) {
return null;
}
MiniArticleDTO miniArticleDTO = new MiniArticleDTO();
BeanUtils.copyProperties(yxArticle,miniArticleDTO);
LambdaQueryWrapper<YxArticleContent> yxArticleContentLambdaQueryWrapper = new LambdaQueryWrapper<>();
yxArticleContentLambdaQueryWrapper.eq(YxArticleContent::getArticleId,articleId);
YxArticleContent yxArticleContent = yxArticleContentService.getOne(yxArticleContentLambdaQueryWrapper);
if (yxArticleContent!=null) {
miniArticleDTO.setContent(yxArticleContent.getContent());
miniArticleDTO.setContentType(yxArticleContent.getContentType());
}
return miniArticleDTO;
}
}

View File

@ -0,0 +1,51 @@
package org.jeecg.modules.mini.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description
* @Author ZhouWenTao
* @Date 2024/3/6 18:48
*/
@Data
public class ImportArticleVO implements Serializable{
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
private java.lang.String title;
/**院校id*/
@Excel(name = "院校id", width = 15)
@ApiModelProperty(value = "院校id")
private java.lang.String schoolId;
/**院校名称*/
@Excel(name = "院校名称", width = 15)
@ApiModelProperty(value = "院校名称")
private java.lang.String schoolName;
/**内容*/
@Excel(name = "内容", width = 15)
@ApiModelProperty(value = "内容")
private java.lang.String content;
/**发布者*/
@Excel(name = "发布者", width = 15)
@ApiModelProperty(value = "发布者")
private java.lang.String author;
/**类型(1.招生章程)*/
@Excel(name = "类型(1.招生章程)", width = 15)
@ApiModelProperty(value = "类型(1.招生章程)")
private java.lang.String type;
/**发布日期*/
@Excel(name = "时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@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 releaseTime;
@Excel(name = "时间")
private String shijian;
}

View File

@ -0,0 +1,24 @@
package org.jeecg.modules.mini.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.modules.mini.dto.MiniBaseDTO;
/**
* @Description
* @Author ZhouWenTao
* @Date 2024/3/6 16:54
*/
@Data
@ApiModel(value = "查询文章信息对象")
public class QueryArticleVO extends MiniBaseDTO {
@ApiModelProperty(value = "文章id")
private String articleId;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "院校id")
private String schoolId;
@ApiModelProperty(value = "文章类型(1.招生章程)")
private Integer type;
}

View File

@ -46,4 +46,17 @@ public class YxConstant {
public static BigDecimal bigDecimal05 = new BigDecimal("0.5");
public static BigDecimal bigDecimal075 = new BigDecimal("0.75");
public static BigDecimal bigDecimal2 = new BigDecimal("2");
public static BigDecimal bigDecimal750 = new BigDecimal(750);
public static BigDecimal bigDecimal300 = new BigDecimal(300);
//默认的录取方式类型
public static String culturalControlLineGuo= "文过专排";
public static String specialControlLineGuo= "专过文排";
//默认的录取方式类型
public static String culturalControlLineGuo2= "文过专排主科";
public static List<String> defaultRulesEnrollProbabilityList =Arrays.asList("文过专排","专过文排");
}

View File

@ -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.YxArticleContent;
import org.jeecg.modules.yx.service.IYxArticleContentService;
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-06
* @Version: V1.0
*/
@Api(tags="文章内容表")
@RestController
@RequestMapping("/yx/yxArticleContent")
@Slf4j
public class YxArticleContentController extends JeecgController<YxArticleContent, IYxArticleContentService> {
@Autowired
private IYxArticleContentService yxArticleContentService;
/**
* 分页列表查询
*
* @param yxArticleContent
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "文章内容表-分页列表查询")
@ApiOperation(value="文章内容表-分页列表查询", notes="文章内容表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<YxArticleContent>> queryPageList(YxArticleContent yxArticleContent,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<YxArticleContent> queryWrapper = QueryGenerator.initQueryWrapper(yxArticleContent, req.getParameterMap());
Page<YxArticleContent> page = new Page<YxArticleContent>(pageNo, pageSize);
IPage<YxArticleContent> pageList = yxArticleContentService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param yxArticleContent
* @return
*/
@AutoLog(value = "文章内容表-添加")
@ApiOperation(value="文章内容表-添加", notes="文章内容表-添加")
@RequiresPermissions("yx:yx_article_content:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody YxArticleContent yxArticleContent) {
yxArticleContentService.save(yxArticleContent);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param yxArticleContent
* @return
*/
@AutoLog(value = "文章内容表-编辑")
@ApiOperation(value="文章内容表-编辑", notes="文章内容表-编辑")
@RequiresPermissions("yx:yx_article_content:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody YxArticleContent yxArticleContent) {
yxArticleContentService.updateById(yxArticleContent);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "文章内容表-通过id删除")
@ApiOperation(value="文章内容表-通过id删除", notes="文章内容表-通过id删除")
@RequiresPermissions("yx:yx_article_content:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
yxArticleContentService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "文章内容表-批量删除")
@ApiOperation(value="文章内容表-批量删除", notes="文章内容表-批量删除")
@RequiresPermissions("yx:yx_article_content:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.yxArticleContentService.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<YxArticleContent> queryById(@RequestParam(name="id",required=true) String id) {
YxArticleContent yxArticleContent = yxArticleContentService.getById(id);
if(yxArticleContent==null) {
return Result.error("未找到对应数据");
}
return Result.OK(yxArticleContent);
}
/**
* 导出excel
*
* @param request
* @param yxArticleContent
*/
@RequiresPermissions("yx:yx_article_content:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, YxArticleContent yxArticleContent) {
return super.exportXls(request, yxArticleContent, YxArticleContent.class, "文章内容表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("yx:yx_article_content:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, YxArticleContent.class);
}
}

View File

@ -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.YxArticle;
import org.jeecg.modules.yx.service.IYxArticleService;
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-06
* @Version: V1.0
*/
@Api(tags="文章表")
@RestController
@RequestMapping("/yx/yxArticle")
@Slf4j
public class YxArticleController extends JeecgController<YxArticle, IYxArticleService> {
@Autowired
private IYxArticleService yxArticleService;
/**
* 分页列表查询
*
* @param yxArticle
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "文章表-分页列表查询")
@ApiOperation(value="文章表-分页列表查询", notes="文章表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<YxArticle>> queryPageList(YxArticle yxArticle,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<YxArticle> queryWrapper = QueryGenerator.initQueryWrapper(yxArticle, req.getParameterMap());
Page<YxArticle> page = new Page<YxArticle>(pageNo, pageSize);
IPage<YxArticle> pageList = yxArticleService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param yxArticle
* @return
*/
@AutoLog(value = "文章表-添加")
@ApiOperation(value="文章表-添加", notes="文章表-添加")
@RequiresPermissions("yx:yx_article:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody YxArticle yxArticle) {
yxArticleService.save(yxArticle);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param yxArticle
* @return
*/
@AutoLog(value = "文章表-编辑")
@ApiOperation(value="文章表-编辑", notes="文章表-编辑")
@RequiresPermissions("yx:yx_article:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody YxArticle yxArticle) {
yxArticleService.updateById(yxArticle);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "文章表-通过id删除")
@ApiOperation(value="文章表-通过id删除", notes="文章表-通过id删除")
@RequiresPermissions("yx:yx_article:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
yxArticleService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "文章表-批量删除")
@ApiOperation(value="文章表-批量删除", notes="文章表-批量删除")
@RequiresPermissions("yx:yx_article:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.yxArticleService.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<YxArticle> queryById(@RequestParam(name="id",required=true) String id) {
YxArticle yxArticle = yxArticleService.getById(id);
if(yxArticle==null) {
return Result.error("未找到对应数据");
}
return Result.OK(yxArticle);
}
/**
* 导出excel
*
* @param request
* @param yxArticle
*/
@RequiresPermissions("yx:yx_article:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, YxArticle yxArticle) {
return super.exportXls(request, yxArticle, YxArticle.class, "文章表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("yx:yx_article:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, YxArticle.class);
}
}

View File

@ -8,16 +8,13 @@ import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang.StringUtils;
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.dto.ArwuImportTestDTO;
import org.jeecg.modules.yx.dto.LiNianShuJuDTO;
import org.jeecg.modules.yx.dto.SchoolMajorImport3;
import org.jeecg.modules.yx.entity.*;
import org.jeecg.modules.yx.entity.YxArwu;
import org.jeecg.modules.yx.entity.YxSchool;
import org.jeecg.modules.yx.service.IYxArwuService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -25,7 +22,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.yx.service.IYxSchoolChildService;
import org.jeecg.modules.yx.service.IYxSchoolService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@ -44,129 +40,127 @@ 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-03
* @Date: 2024-03-06
* @Version: V1.0
*/
@Api(tags="软科排名表")
@Api(tags = "软科排名表")
@RestController
@RequestMapping("/yx/yxArwu")
@Slf4j
public class YxArwuController extends JeecgController<YxArwu, IYxArwuService> {
@Autowired
private IYxArwuService yxArwuService;
@Autowired
private IYxArwuService yxArwuService;
@Autowired
private IYxSchoolService yxSchoolService;
@Autowired
private IYxSchoolChildService yxSchoolChildService;
/**
* 分页列表查询
*
* @param yxArwu
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "软科排名表-分页列表查询")
@ApiOperation(value="软科排名表-分页列表查询", notes="软科排名表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<YxArwu>> queryPageList(YxArwu yxArwu,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<YxArwu> queryWrapper = QueryGenerator.initQueryWrapper(yxArwu, req.getParameterMap());
Page<YxArwu> page = new Page<YxArwu>(pageNo, pageSize);
IPage<YxArwu> pageList = yxArwuService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param yxArwu
* @return
*/
@AutoLog(value = "软科排名表-添加")
@ApiOperation(value="软科排名表-添加", notes="软科排名表-添加")
@RequiresPermissions("yx:yx_arwu:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody YxArwu yxArwu) {
yxArwuService.save(yxArwu);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param yxArwu
* @return
*/
@AutoLog(value = "软科排名表-编辑")
@ApiOperation(value="软科排名表-编辑", notes="软科排名表-编辑")
@RequiresPermissions("yx:yx_arwu:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody YxArwu yxArwu) {
yxArwuService.updateById(yxArwu);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "软科排名表-通过id删除")
@ApiOperation(value="软科排名表-通过id删除", notes="软科排名表-通过id删除")
@RequiresPermissions("yx:yx_arwu:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
yxArwuService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "软科排名表-批量删除")
@ApiOperation(value="软科排名表-批量删除", notes="软科排名表-批量删除")
@RequiresPermissions("yx:yx_arwu:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.yxArwuService.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<YxArwu> queryById(@RequestParam(name="id",required=true) String id) {
YxArwu yxArwu = yxArwuService.getById(id);
if(yxArwu==null) {
return Result.error("未找到对应数据");
}
return Result.OK(yxArwu);
}
/**
* 导出excel
*
* @param request
* @param yxArwu
*/
* 分页列表查询
*
* @param yxArwu
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "软科排名表-分页列表查询")
@ApiOperation(value = "软科排名表-分页列表查询", notes = "软科排名表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<YxArwu>> queryPageList(YxArwu yxArwu,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<YxArwu> queryWrapper = QueryGenerator.initQueryWrapper(yxArwu, req.getParameterMap());
Page<YxArwu> page = new Page<YxArwu>(pageNo, pageSize);
IPage<YxArwu> pageList = yxArwuService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param yxArwu
* @return
*/
@AutoLog(value = "软科排名表-添加")
@ApiOperation(value = "软科排名表-添加", notes = "软科排名表-添加")
@RequiresPermissions("yx:yx_arwu:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody YxArwu yxArwu) {
yxArwuService.save(yxArwu);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param yxArwu
* @return
*/
@AutoLog(value = "软科排名表-编辑")
@ApiOperation(value = "软科排名表-编辑", notes = "软科排名表-编辑")
@RequiresPermissions("yx:yx_arwu:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody YxArwu yxArwu) {
yxArwuService.updateById(yxArwu);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "软科排名表-通过id删除")
@ApiOperation(value = "软科排名表-通过id删除", notes = "软科排名表-通过id删除")
@RequiresPermissions("yx:yx_arwu:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
yxArwuService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "软科排名表-批量删除")
@ApiOperation(value = "软科排名表-批量删除", notes = "软科排名表-批量删除")
@RequiresPermissions("yx:yx_arwu:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.yxArwuService.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<YxArwu> queryById(@RequestParam(name = "id", required = true) String id) {
YxArwu yxArwu = yxArwuService.getById(id);
if (yxArwu == null) {
return Result.error("未找到对应数据");
}
return Result.OK(yxArwu);
}
/**
* 导出excel
*
* @param request
* @param yxArwu
*/
@RequiresPermissions("yx:yx_arwu:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, YxArwu yxArwu) {
@ -174,58 +168,73 @@ public class YxArwuController extends JeecgController<YxArwu, IYxArwuService> {
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("yx:yx_arwu:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, YxArwu.class);
}
@RequestMapping(value = "/importTest", method = RequestMethod.POST)
public Result<?> importTest() {
// 获取上传文件对象
File file = new File("C:\\Users\\Denim\\Desktop\\2023软科排名总榜.xlsx");
FileInputStream fileInputStream = null;
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setNeedSave(true);
int index = 0;
String type = null;
try {
fileInputStream = new FileInputStream(file);
List<ArwuImportTestDTO> list = ExcelImportUtil.importExcel(fileInputStream, ArwuImportTestDTO.class, params);
YxArwu yxArwu = new YxArwu();
List<YxArwu> yxArwuList = new ArrayList<>();
List<YxSchool> yxSchoolList = yxSchoolService.list();
Map<String,YxSchool> schoolMap=new LinkedHashMap<>();
for (YxSchool yxSchool : yxSchoolList) {
schoolMap.put(yxSchool.getSchoolName(),yxSchool);
}
String xxmc = null;
YxSchool yxSchool=null;
for (ArwuImportTestDTO arwuImportTestDTO : list) {
xxmc = arwuImportTestDTO.getXxmc();
yxSchool = schoolMap.get(xxmc);
if (yxSchool==null) {
System.out.println(xxmc);
continue;
}
}
//System.out.println(JSONArray.toJSONString(notlist));
} catch (FileNotFoundException fileNotFoundException) {
log.error("文件不存在," + file.getAbsolutePath());
throw new RuntimeException(fileNotFoundException);
} catch (StringIndexOutOfBoundsException e) {
} catch (Exception e) {
System.out.println(index);
throw new RuntimeException(e);
}
return Result.ok("文件导入成功!");
}
@RequestMapping(value = "/importTest", method = RequestMethod.POST)
public Result<?> importTest() {
// 获取上传文件对象
File file = new File("C:\\Users\\Denim\\Desktop\\2023软科排名总榜.xlsx");
FileInputStream fileInputStream = null;
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setNeedSave(true);
int index = 0;
String type = null;
try {
fileInputStream = new FileInputStream(file);
List<ArwuImportTestDTO> list = ExcelImportUtil.importExcel(fileInputStream, ArwuImportTestDTO.class, params);
YxArwu yxArwu =null;
List<YxArwu> yxArwuList = new ArrayList<>();
List<YxSchool> yxSchoolList = yxSchoolService.list();
Map<String, YxSchool> schoolMap = new LinkedHashMap<>();
for (YxSchool yxSchool : yxSchoolList) {
schoolMap.put(yxSchool.getSchoolName(), yxSchool);
}
String xxmc = null;
YxSchool yxSchool = null;
for (ArwuImportTestDTO arwuImportTestDTO : list) {
String pm = arwuImportTestDTO.getPm();//排名
String yxbq = arwuImportTestDTO.getYxbq();//院校标签
String dq = arwuImportTestDTO.getDq();//地区
String lx = arwuImportTestDTO.getLx();//类型
String fs = arwuImportTestDTO.getFs();//分数
xxmc = arwuImportTestDTO.getXxmc();
yxSchool = schoolMap.get(xxmc);
if (yxSchool == null) {
System.out.println(xxmc);
continue;
}
yxArwu = new YxArwu();
yxArwu.setSchoolId(yxSchool.getId());
yxArwu.setRanking(pm);
if (StringUtils.isNotBlank(fs)) {
yxArwu.setScore(new BigDecimal(fs));
}
yxArwu.setYear("2023");
yxArwu.setType(lx);
yxArwu.setSchoolName(xxmc);
yxArwuList.add(yxArwu);
}
yxArwuService.saveBatch(yxArwuList);
System.out.println(yxArwuList.size());
} catch (FileNotFoundException fileNotFoundException) {
log.error("文件不存在," + file.getAbsolutePath());
throw new RuntimeException(fileNotFoundException);
} catch (StringIndexOutOfBoundsException e) {
} catch (Exception e) {
System.out.println(index);
throw new RuntimeException(e);
}
return Result.ok("文件导入成功!");
}
}

View File

@ -7,6 +7,8 @@ import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.yx.constant.YxConstant;
import org.jeecg.modules.yx.entity.YxHistoryScoreControlLine;
import org.jeecg.modules.yx.service.IYxHistoryScoreControlLineService;
@ -38,6 +40,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class YxHistoryScoreControlLineController extends JeecgController<YxHistoryScoreControlLine, IYxHistoryScoreControlLineService> {
@Autowired
private IYxHistoryScoreControlLineService yxHistoryScoreControlLineService;
@Autowired
private RedisUtil redisUtil;
/**
* 分页列表查询
@ -67,26 +71,49 @@ public class YxHistoryScoreControlLineController extends JeecgController<YxHisto
@ApiOperation(value="历年录取控制分数线-分页列表查询", notes="历年录取控制分数线-分页列表查询")
@GetMapping(value = "/listGroupByYear")
public Result<Map<String,List<YxHistoryScoreControlLine>>> listGroupByYear(YxHistoryScoreControlLine yxHistoryScoreControlLine) {
LambdaQueryWrapper<YxHistoryScoreControlLine> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory,yxHistoryScoreControlLine.getProfessionalCategory());
queryWrapper.eq(YxHistoryScoreControlLine::getCategory,yxHistoryScoreControlLine.getCategory());
queryWrapper.last("ORDER BY year DESC,field(batch,'提前批','本科A段','本科B段','本科','高职高专')");
List<YxHistoryScoreControlLine> historyScoreControlLineList = yxHistoryScoreControlLineService.list(queryWrapper);
JSONObject responseBody=new JSONObject();
Map<String,List<YxHistoryScoreControlLine>> dataMaps=new LinkedHashMap<>();
List<YxHistoryScoreControlLine> list;
String year=null;
for (YxHistoryScoreControlLine historyScoreControlLine : historyScoreControlLineList) {
year = historyScoreControlLine.getYear();
list = dataMaps.getOrDefault(year,new ArrayList<>());
if ("本科A段".equals(historyScoreControlLine.getBatch())) {
YxHistoryScoreControlLine yxHistoryScoreControlLine1 = new YxHistoryScoreControlLine();
BeanUtils.copyProperties(historyScoreControlLine,yxHistoryScoreControlLine1);
yxHistoryScoreControlLine1.setBatch("本科提前批");
list.add(yxHistoryScoreControlLine1);
//判断redis中是否存储过历年省控线信息
String professionalCategory = yxHistoryScoreControlLine.getProfessionalCategory();
String category = yxHistoryScoreControlLine.getCategory();
String key = "yxHistoryScoreControlLine_listGroupByYear_professionalCategory_"+professionalCategory+"_category"+category;
String json = null;
if (redisUtil.hasKey(key)) {
//redis中有
json = (String) redisUtil.get(key);
dataMaps = JSONObject.parseObject(json,Map.class);
}else{
//redis中没有
LambdaQueryWrapper<YxHistoryScoreControlLine> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory,yxHistoryScoreControlLine.getProfessionalCategory());
queryWrapper.eq(YxHistoryScoreControlLine::getCategory,yxHistoryScoreControlLine.getCategory());
queryWrapper.last("ORDER BY year DESC,field(batch,'提前批','本科A段','本科B段','本科','高职高专')");
List<YxHistoryScoreControlLine> historyScoreControlLineList = yxHistoryScoreControlLineService.list(queryWrapper);
List<YxHistoryScoreControlLine> list;
String year=null;
String batch = null;
for (YxHistoryScoreControlLine historyScoreControlLine : historyScoreControlLineList) {
year = historyScoreControlLine.getYear();
batch = historyScoreControlLine.getBatch();
if (YxConstant.nowYear.equals(year)) {
if (!"高职高专".equals(batch)) {
historyScoreControlLine.setCulturalScore(YxConstant.bigDecimal0);
historyScoreControlLine.setCulturalScoreXk(YxConstant.bigDecimal0);
historyScoreControlLine.setSpecialScore(YxConstant.bigDecimal0);
historyScoreControlLine.setSpecialScoreXk(YxConstant.bigDecimal0);
}
}
list = dataMaps.getOrDefault(year,new ArrayList<>());
if ("本科A段".equals(batch)) {
YxHistoryScoreControlLine yxHistoryScoreControlLine1 = new YxHistoryScoreControlLine();
BeanUtils.copyProperties(historyScoreControlLine,yxHistoryScoreControlLine1);
yxHistoryScoreControlLine1.setBatch("本科提前批");
list.add(yxHistoryScoreControlLine1);
}
list.add(historyScoreControlLine);
dataMaps.put(year,list);
}
list.add(historyScoreControlLine);
dataMaps.put(year,list);
json = JSONObject.toJSONString(dataMaps);
redisUtil.set(key,json,3600);
}
return Result.OK(dataMaps);
}

View File

@ -481,7 +481,8 @@ public class YxSchoolMajorController extends JeecgController<YxSchoolMajor, IYxS
@RequestMapping(value = "/importExcel3",method = RequestMethod.POST)
public Result<?> importExcel3(){
service.updateRulesEnrollProbabilityByOldLastYearData();
//service.updateRulesEnrollProbabilityByOldLastYearData();
service.updateRulesEnrollProbabilityByOldLastYearData2();
return Result.OK();
}

View File

@ -43,103 +43,103 @@ 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-03
* @Date: 2024-03-03
* @Version: V1.0
*/
@Api(tags="院校硕士研究生信息")
@Api(tags = "院校硕士研究生信息")
@RestController
@RequestMapping("/yx/yxSchoolMasterDegree")
@Slf4j
public class YxSchoolMasterDegreeController extends JeecgController<YxSchoolMasterDegree, IYxSchoolMasterDegreeService> {
@Autowired
private IYxSchoolMasterDegreeService yxSchoolMasterDegreeService;
@Autowired
private IYxSchoolService yxSchoolService;
/**
* 分页列表查询
*/
//@AutoLog(value = "院校硕士研究生信息-分页列表查询")
@ApiOperation(value="院校硕士研究生信息-分页列表查询", notes="院校硕士研究生信息-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<YxSchoolMasterDegree>> queryPageList(YxSchoolMasterDegree yxSchoolMasterDegree,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<YxSchoolMasterDegree> queryWrapper = QueryGenerator.initQueryWrapper(yxSchoolMasterDegree, req.getParameterMap());
Page<YxSchoolMasterDegree> page = new Page<YxSchoolMasterDegree>(pageNo, pageSize);
IPage<YxSchoolMasterDegree> pageList = yxSchoolMasterDegreeService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*/
@AutoLog(value = "院校硕士研究生信息-添加")
@ApiOperation(value="院校硕士研究生信息-添加", notes="院校硕士研究生信息-添加")
@RequiresPermissions("yx:yx_school_master_degree:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody YxSchoolMasterDegree yxSchoolMasterDegree) {
yxSchoolMasterDegreeService.save(yxSchoolMasterDegree);
return Result.OK("添加成功!");
}
/**
* 编辑
*/
@AutoLog(value = "院校硕士研究生信息-编辑")
@ApiOperation(value="院校硕士研究生信息-编辑", notes="院校硕士研究生信息-编辑")
@RequiresPermissions("yx:yx_school_master_degree:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody YxSchoolMasterDegree yxSchoolMasterDegree) {
yxSchoolMasterDegreeService.updateById(yxSchoolMasterDegree);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*/
@AutoLog(value = "院校硕士研究生信息-通过id删除")
@ApiOperation(value="院校硕士研究生信息-通过id删除", notes="院校硕士研究生信息-通过id删除")
@RequiresPermissions("yx:yx_school_master_degree:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
yxSchoolMasterDegreeService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*/
@AutoLog(value = "院校硕士研究生信息-批量删除")
@ApiOperation(value="院校硕士研究生信息-批量删除", notes="院校硕士研究生信息-批量删除")
@RequiresPermissions("yx:yx_school_master_degree:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.yxSchoolMasterDegreeService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*/
//@AutoLog(value = "院校硕士研究生信息-通过id查询")
@ApiOperation(value="院校硕士研究生信息-通过id查询", notes="院校硕士研究生信息-通过id查询")
@GetMapping(value = "/queryById")
public Result<YxSchoolMasterDegree> queryById(@RequestParam(name="id",required=true) String id) {
YxSchoolMasterDegree yxSchoolMasterDegree = yxSchoolMasterDegreeService.getById(id);
if(yxSchoolMasterDegree==null) {
return Result.error("未找到对应数据");
}
return Result.OK(yxSchoolMasterDegree);
}
@Autowired
private IYxSchoolMasterDegreeService yxSchoolMasterDegreeService;
@Autowired
private IYxSchoolService yxSchoolService;
/**
* 导出excel
*/
* 分页列表查询
*/
//@AutoLog(value = "院校硕士研究生信息-分页列表查询")
@ApiOperation(value = "院校硕士研究生信息-分页列表查询", notes = "院校硕士研究生信息-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<YxSchoolMasterDegree>> queryPageList(YxSchoolMasterDegree yxSchoolMasterDegree,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<YxSchoolMasterDegree> queryWrapper = QueryGenerator.initQueryWrapper(yxSchoolMasterDegree, req.getParameterMap());
Page<YxSchoolMasterDegree> page = new Page<YxSchoolMasterDegree>(pageNo, pageSize);
IPage<YxSchoolMasterDegree> pageList = yxSchoolMasterDegreeService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*/
@AutoLog(value = "院校硕士研究生信息-添加")
@ApiOperation(value = "院校硕士研究生信息-添加", notes = "院校硕士研究生信息-添加")
@RequiresPermissions("yx:yx_school_master_degree:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody YxSchoolMasterDegree yxSchoolMasterDegree) {
yxSchoolMasterDegreeService.save(yxSchoolMasterDegree);
return Result.OK("添加成功!");
}
/**
* 编辑
*/
@AutoLog(value = "院校硕士研究生信息-编辑")
@ApiOperation(value = "院校硕士研究生信息-编辑", notes = "院校硕士研究生信息-编辑")
@RequiresPermissions("yx:yx_school_master_degree:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody YxSchoolMasterDegree yxSchoolMasterDegree) {
yxSchoolMasterDegreeService.updateById(yxSchoolMasterDegree);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*/
@AutoLog(value = "院校硕士研究生信息-通过id删除")
@ApiOperation(value = "院校硕士研究生信息-通过id删除", notes = "院校硕士研究生信息-通过id删除")
@RequiresPermissions("yx:yx_school_master_degree:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
yxSchoolMasterDegreeService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*/
@AutoLog(value = "院校硕士研究生信息-批量删除")
@ApiOperation(value = "院校硕士研究生信息-批量删除", notes = "院校硕士研究生信息-批量删除")
@RequiresPermissions("yx:yx_school_master_degree:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.yxSchoolMasterDegreeService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*/
//@AutoLog(value = "院校硕士研究生信息-通过id查询")
@ApiOperation(value = "院校硕士研究生信息-通过id查询", notes = "院校硕士研究生信息-通过id查询")
@GetMapping(value = "/queryById")
public Result<YxSchoolMasterDegree> queryById(@RequestParam(name = "id", required = true) String id) {
YxSchoolMasterDegree yxSchoolMasterDegree = yxSchoolMasterDegreeService.getById(id);
if (yxSchoolMasterDegree == null) {
return Result.error("未找到对应数据");
}
return Result.OK(yxSchoolMasterDegree);
}
/**
* 导出excel
*/
@RequiresPermissions("yx:yx_school_master_degree:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, YxSchoolMasterDegree yxSchoolMasterDegree) {
@ -147,62 +147,85 @@ public class YxSchoolMasterDegreeController extends JeecgController<YxSchoolMast
}
/**
* 通过excel导入数据
*/
* 通过excel导入数据
*/
@RequiresPermissions("yx:yx_school_master_degree:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, YxSchoolMasterDegree.class);
}
/**
* 刷新专业信息
*/
@RequestMapping(value = "/importExcel1", method = RequestMethod.POST)
public Result<?> importExcel1(HttpServletRequest request, HttpServletResponse response) {
// 获取上传文件对象
File file = new File("C:\\Users\\Denim\\Desktop\\硕士研究生.xlsx");
FileInputStream fileInputStream = null;
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setNeedSave(true);
int index = 0;
/**
* 刷新专业信息
*/
@RequestMapping(value = "/importExcel1", method = RequestMethod.POST)
public Result<?> importExcel1(HttpServletRequest request, HttpServletResponse response) {
// 获取上传文件对象
File file = new File("C:\\Users\\Denim\\Desktop\\硕士研究生.xlsx");
FileInputStream fileInputStream = null;
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setNeedSave(true);
int index = 0;
try {
fileInputStream = new FileInputStream(file);
List<YxSchoolMasterDegree> list = ExcelImportUtil.importExcel(fileInputStream, YxSchoolMasterDegree.class, params);
try {
fileInputStream = new FileInputStream(file);
List<YxSchoolMasterDegree> list = ExcelImportUtil.importExcel(fileInputStream, YxSchoolMasterDegree.class, params);
List<String> schoolNameList=new ArrayList<>();
List<YxSchool> yxSchoolList = null;
LambdaQueryWrapper<YxSchool> queryWrapper = new LambdaQueryWrapper<>();
String schoolName = null;
String sn=null;
int khLast=0;
for (YxSchoolMasterDegree yxSchoolMasterDegree : list) {
schoolName = yxSchoolMasterDegree.getSchoolName();
khLast = schoolName.indexOf(")");
if (khLast!=-1) {
sn = schoolName.substring(khLast+1);
}
queryWrapper.clear();
queryWrapper.eq(YxSchool::getSchoolName,sn);
yxSchoolList = yxSchoolService.list(queryWrapper);
if (CollectionUtils.isEmpty(yxSchoolList)) {
schoolNameList.add(sn);
continue;
}
}
System.out.println("缺少院校编码");
System.out.println(schoolNameList.size());
} catch (FileNotFoundException fileNotFoundException) {
log.error("文件不存在," + file.getAbsolutePath());
throw new RuntimeException(fileNotFoundException);
} catch (StringIndexOutOfBoundsException e) {
} catch (Exception e) {
System.out.println(index);
throw new RuntimeException(e);
}
return Result.ok("文件导入成功!");
}
Set<String> schoolNameList = new HashSet<>();
List<YxSchool> yxSchoolList = yxSchoolService.list();
Map<String, YxSchool> schoolMap = new LinkedHashMap<>();
for (YxSchool yxSchool : yxSchoolList) {
schoolMap.put(yxSchool.getSchoolName(), yxSchool);
}
LambdaQueryWrapper<YxSchool> queryWrapper = new LambdaQueryWrapper<>();
String schoolName = null;
String majorName = null;
String sn = null;
String mn = null;
int khLast = 0;
int mrLast = 0;
YxSchool yxSchool = null;
for (YxSchoolMasterDegree yxSchoolMasterDegree : list) {
majorName = yxSchoolMasterDegree.getMajorName();
majorName = majorName.replace("(","").replace(")","");
mrLast = majorName.indexOf("");
//专业名称
if (mrLast!=-1) {
mn = majorName.substring(mrLast+1);
}
yxSchoolMasterDegree.setMajorCode(yxSchoolMasterDegree.getMajorName().substring(1,7));
yxSchoolMasterDegree.setMajorName(mn);
schoolName = yxSchoolMasterDegree.getSchoolName();
schoolName = schoolName.replace("(","").replace(")","");
khLast = schoolName.indexOf("");
if (khLast != -1) {
sn = schoolName.substring(khLast + 1);
}
yxSchool = schoolMap.get(sn);
if (yxSchool==null) {
schoolNameList.add(sn);
continue;
}
yxSchoolMasterDegree.setSchoolMasterCode(schoolName.substring(1,6));
yxSchoolMasterDegree.setSchoolName(sn);
yxSchoolMasterDegree.setSchoolId(yxSchool.getId());
}
System.out.println("缺少院校编码");
for (String s : schoolNameList) {
System.out.println(s);
}
yxSchoolMasterDegreeService.saveBatch(list);
} catch (FileNotFoundException fileNotFoundException) {
log.error("文件不存在," + file.getAbsolutePath());
throw new RuntimeException(fileNotFoundException);
} catch (StringIndexOutOfBoundsException e) {
} catch (Exception e) {
System.out.println(index);
throw new RuntimeException(e);
}
return Result.ok("文件导入成功!");
}
}

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.yx.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.service.impl.ServiceImpl;
import com.google.gson.JsonObject;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
@ -13,6 +14,8 @@ 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.art.dto.ArtRecommendMajorBaseDTO;
import org.jeecg.modules.art.vo.QueryRecommendMajorVO;
import org.jeecg.modules.yx.constant.YxConstant;
import org.jeecg.modules.yx.entity.*;
import org.jeecg.modules.yx.service.*;
@ -21,6 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -37,6 +42,8 @@ public class YxScoreController {
@Autowired
private IYxUserScoreService yxUserScoreService;
@Autowired
private IYxSchoolMajorService yxSchoolMajorService;
@Autowired
private IYxVolunteerService yxVolunteerService;
@Autowired
private IYxHistoryScoreBatchService yxHistoryScoreBatchService;
@ -52,7 +59,11 @@ public class YxScoreController {
// 入参
String professionalCategory = yxUserScore.getProfessionalCategory();
String cognitioPolyclinic = yxUserScore.getCognitioPolyclinic();//文科/理科
AssertUtils.notNull(cognitioPolyclinic, "请选择[文科/理科]");
BigDecimal culturalScore = yxUserScore.getCulturalScore();
BigDecimal professionalScore = yxUserScore.getProfessionalScore();
String professionalCategoryChildren = yxUserScore.getProfessionalCategoryChildren();
AssertUtils.notNull(professionalCategory, "请选择[专业类别]");
AssertUtils.notNull(cognitioPolyclinic, "请选择[选考科目]");
//先判断当前用户是否直接提交过得分
List<YxUserScore> oldScoreList = yxUserScoreService.list(new LambdaQueryWrapper<YxUserScore>().eq(YxUserScore::getState, "1").eq(YxUserScore::getCreateBy, sysUser.getId()));
if (CollectionUtils.isNotEmpty(oldScoreList)) {
@ -75,6 +86,20 @@ public class YxScoreController {
}
//保存新的分数信息
yxUserScore.setType("2");//报考类型 1.普通类 2.艺术类
yxUserScore.setRanking(0);//位次
yxUserScore.setCreateBy(userId);
AssertUtils.notTrue(culturalScore.compareTo(YxConstant.bigDecimal750) > 0,"[文化成绩]最高分为750");
AssertUtils.notTrue(culturalScore.compareTo(YxConstant.bigDecimal0) < 0,"[文化成绩]最低分为0");
if ("音乐类".equals(professionalCategory)) {
AssertUtils.notTrue(professionalScore.compareTo(YxConstant.bigDecimal300) > 0,"[主项成绩]最高分为300");
AssertUtils.notTrue(professionalScore.compareTo(YxConstant.bigDecimal0) < 0,"[主项成绩]最低分为0");
}else{
AssertUtils.notTrue(professionalScore.compareTo(YxConstant.bigDecimal300) > 0,"[统考成绩]最高分为300");
AssertUtils.notTrue(professionalScore.compareTo(YxConstant.bigDecimal0) < 0,"[统考成绩]最低分为0");
}
/*String professionalScore = requestBody.getString("professionalScore");String culturalScore = requestBody.getString("culturalScore");String chineseScore = requestBody.getString("chineseScore");String englishScore = requestBody.getString("englishScore");
if (!StringUtils.isNumeric(professionalScore)) {return Result.error("统考成绩仅可输入数字");}if (!StringUtils.isNumeric(culturalScore)) {return Result.error("文化成绩仅可输入数字");}
if (!StringUtils.isNumeric(chineseScore)) {return Result.error("语文成绩仅可输入数字");}if (!StringUtils.isNumeric(englishScore)) {return Result.error("英语成绩仅可输入数字");}
@ -82,12 +107,7 @@ public class YxScoreController {
yxUserScore.setCulturalScore(new BigDecimal(culturalScore));//文化成绩分
yxUserScore.setChineseScore(new BigDecimal(chineseScore));//语文成绩
yxUserScore.setEnglishScore(new BigDecimal(englishScore));//英语成绩*/
yxUserScore.setRanking(0);//位次
yxUserScore.setCreateBy(userId);
BigDecimal culturalScore = yxUserScore.getCulturalScore();
BigDecimal professionalScore = yxUserScore.getProfessionalScore();
String professionalCategoryChildren = yxUserScore.getProfessionalCategoryChildren();
if (StringUtils.isBlank(professionalCategoryChildren)) {
if (!professionalCategoryChildren.contains("音乐表演声乐")) {
yxUserScore.setYybysy(YxConstant.bigDecimal0);
@ -106,9 +126,8 @@ public class YxScoreController {
//==============判断 批次 start
LambdaQueryWrapper<YxHistoryScoreControlLine> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getYear,YxConstant.nowYear);//用23年省控线
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getYear,YxConstant.nowYear);//24年省控线
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getCategory,yxUserScore.getCognitioPolyclinic());
//TODO 目前没有24年省控线用的是23年省控线
//表演类型的方向
if ("舞蹈类".equals(professionalCategory)) {
//舞蹈类使用艺术舞蹈的省控线判定批次
@ -117,79 +136,111 @@ public class YxScoreController {
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory,professionalCategory);
}
lambdaQueryWrapper.last("ORDER BY year DESC,field(batch,'提前批','本科A段','本科B段','本科','高职高专')");
// List<YxHistoryScoreControlLine> historyScoreControlLineList = yxHistoryScoreControlLineService.list(lambdaQueryWrapper);
// if (!YxConstant.cankaoMajorTypeList.contains(professionalCategory)) {
// //24年分数转换折合23年分数
// YxScoreSegment scoreSegment = null;
// if ("舞蹈类".equals(professionalCategory)) {
// scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, professionalScore, professionalCategory,"艺术舞蹈", yxUserScore.getProvince());
// professionalScore = scoreSegment.getScore();
// }else if("音乐类".equals(professionalCategory)){
// BigDecimal yybysy = yxUserScore.getYybysy();//音乐表演声乐成绩
// BigDecimal yybyqy = yxUserScore.getYybyqy();//音乐表演器乐成绩
// BigDecimal yyjy = yxUserScore.getYyjy();//音乐教育成绩
//
// if (yybysy.compareTo(YxConstant.bigDecimal0) > 0) {
// //音乐表演声乐
// scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yybysy, professionalCategory,"音乐表演声乐", yxUserScore.getProvince());
// yybysy = scoreSegment.getScore();
// }else if(yybysy.compareTo(YxConstant.bigDecimal0) > 0){
// //音乐表演器乐成绩
// scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yybyqy, professionalCategory,"音乐表演器乐", yxUserScore.getProvince());
// yybysy = scoreSegment.getScore();
// }else if(yyjy.compareTo(YxConstant.bigDecimal0) > 0){
// //音乐教育成绩
// scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yyjy, professionalCategory,"音乐教育", yxUserScore.getProvince());
// yyjy = scoreSegment.getScore();
// }
// professionalScore = yybysy.max(yybyqy).max(yyjy);
// }else if("播音与主持类".equals(professionalCategory)){
// scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, professionalScore, professionalCategory,null, yxUserScore.getProvince());
// professionalScore = scoreSegment.getScore();
// }else if("表演类".equals(professionalCategory)){
// BigDecimal xjysby = yxUserScore.getXjysby();//影视戏剧表演
// BigDecimal xjysdy = yxUserScore.getXjysdy();//影视戏剧导演
// BigDecimal fzby = yxUserScore.getFzby();//服装表演
// if (xjysby.compareTo(YxConstant.bigDecimal0) > 0) {
// scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, xjysby, professionalCategory,"影视戏剧表演", yxUserScore.getProvince());
// xjysby = scoreSegment.getScore();
// }else if(xjysdy.compareTo(YxConstant.bigDecimal0) > 0){
// //音乐表演器乐成绩
// scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, xjysdy, professionalCategory,"影视戏剧导演", yxUserScore.getProvince());
// xjysdy = scoreSegment.getScore();
// }else if(fzby.compareTo(YxConstant.bigDecimal0) > 0){
// //音乐教育成绩
// scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, fzby, professionalCategory,"服装表演", yxUserScore.getProvince());
// fzby = scoreSegment.getScore();
// }
// professionalScore = xjysby.max(xjysdy).max(fzby);
// }
// }
//
// String batch = "高职高专";
// if (professionalScore!=null && professionalScore.compareTo(YxConstant.bigDecimal0) > 0) {
// batch = ScoreUtil.conversionScoreBatch(culturalScore, professionalScore, historyScoreControlLineList);
// }
List<YxHistoryScoreControlLine> historyScoreControlLineList = yxHistoryScoreControlLineService.list(lambdaQueryWrapper);
if (YxConstant.cankaoMajorTypeList.contains(professionalCategory)) {
//24年分数转换折合23年分数
YxScoreSegment scoreSegment = null;
if ("舞蹈类".equals(professionalCategory)) {
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, professionalScore, professionalCategory,"艺术舞蹈", yxUserScore.getProvince());
professionalScore = scoreSegment.getScore();
}else if("音乐类".equals(professionalCategory)){
BigDecimal yybysy = yxUserScore.getYybysy();//音乐表演声乐成绩
BigDecimal yybyqy = yxUserScore.getYybyqy();//音乐表演器乐成绩
BigDecimal yyjy = yxUserScore.getYyjy();//音乐教育成绩
if (yybysy!=null && yybysy.compareTo(YxConstant.bigDecimal0) > 0) {
//音乐表演声乐
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yybysy, professionalCategory,"音乐表演声乐", yxUserScore.getProvince());
yybysy = scoreSegment.getScore();
}
if(yybyqy!=null && yybyqy.compareTo(YxConstant.bigDecimal0) > 0){
//音乐表演器乐成绩
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yybyqy, professionalCategory,"音乐表演器乐", yxUserScore.getProvince());
yybyqy = scoreSegment.getScore();
}else{
}
if(yyjy!=null && yyjy.compareTo(YxConstant.bigDecimal0) > 0){
//音乐教育成绩
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yyjy, professionalCategory,"音乐教育", yxUserScore.getProvince());
yyjy = scoreSegment.getScore();
}
professionalScore = yybysy.max(yybyqy).max(yyjy);
}else if("播音与主持类".equals(professionalCategory)){
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, professionalScore, professionalCategory,null, yxUserScore.getProvince());
professionalScore = scoreSegment.getScore();
}else if("表演类".equals(professionalCategory)){
BigDecimal xjysby = yxUserScore.getXjysby();//影视戏剧表演
BigDecimal xjysdy = yxUserScore.getXjysdy();//影视戏剧导演
BigDecimal fzby = yxUserScore.getFzby();//服装表演
if (xjysby!=null && xjysby.compareTo(YxConstant.bigDecimal0) > 0) {
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, xjysby, professionalCategory,"影视戏剧表演", yxUserScore.getProvince());
xjysby = scoreSegment.getScore();
}
if(xjysdy!=null && xjysdy.compareTo(YxConstant.bigDecimal0) > 0){
//音乐表演器乐成绩
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, xjysdy, professionalCategory,"影视戏剧导演", yxUserScore.getProvince());
xjysdy = scoreSegment.getScore();
}
if(fzby!=null && fzby.compareTo(YxConstant.bigDecimal0) > 0){
//音乐教育成绩
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, fzby, professionalCategory,"服装表演", yxUserScore.getProvince());
fzby = scoreSegment.getScore();
}
professionalScore = xjysby.max(xjysdy).max(fzby);
}
}
String batch = "高职高专";
if (professionalScore!=null && professionalScore.compareTo(YxConstant.bigDecimal0) > 0) {
batch = ScoreUtil.conversionScoreBatch(culturalScore, professionalScore, historyScoreControlLineList);
}
//================批次 end
//根据批次判断 本科/高职高专
yxUserScore.setEducationalLevel("1");
//yxUserScore.setEducationalLevel(batch.contains("") ? "1" : "2");
if ("体育类".equals(professionalCategory)) {
yxUserScore.setBatch(batch);
/*if ("体育类".equals(professionalCategory)) {
yxUserScore.setBatch("本科");
}else{
yxUserScore.setBatch("本科A段");
}
}*/
yxUserScore.setId(null);
yxUserScore.setCreateTime(null);
yxUserScore.setUpdateTime(null);
//保存当前用户的得分
yxUserScoreService.save(yxUserScore);
return Result.OK();
//创建新的志愿单信息
YxVolunteer yxVolunteer = new YxVolunteer();
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
yxVolunteer.setVolunteerName(sdf.format(new Date())+"志愿表");
yxVolunteer.setScoreId(yxUserScore.getId());
yxVolunteer = yxVolunteerService.addNew(yxVolunteer);
JSONObject responseBody=JSONObject.parseObject(JSONObject.toJSONString(yxUserScore));
responseBody.put("volunteer",yxVolunteer);
return Result.OK(responseBody);
}
@GetMapping(value = "/getUserScoreInfo")
public Result<?> getUserScoreInfo() {
return Result.OK(yxUserScoreService.getActiveCurrentUserScore());
//获取分数信息
YxUserScore activeCurrentUserScore = yxUserScoreService.getActiveCurrentUserScore();
if (activeCurrentUserScore==null) {
return Result.OK();
}
//获取当前成绩下的第志愿单
LambdaQueryWrapper<YxVolunteer> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(YxVolunteer::getScoreId,activeCurrentUserScore.getId());
lambdaQueryWrapper.eq(YxVolunteer::getState,1);
lambdaQueryWrapper.last("limit 1");
YxVolunteer yxVolunteer = yxVolunteerService.getOne(lambdaQueryWrapper);
//获取可报院校数量
QueryRecommendMajorVO queryRecommendMajorVO = new QueryRecommendMajorVO();
queryRecommendMajorVO.setBatch(activeCurrentUserScore.getBatch());
ArtRecommendMajorBaseDTO artRecommendMajorBaseDTO = yxSchoolMajorService.recommendMajorCount(queryRecommendMajorVO);
String jsonString = JSONObject.toJSONString(activeCurrentUserScore);
JSONObject jsonObject = JSONObject.parseObject(jsonString);
jsonObject.put("fillVolunteer",artRecommendMajorBaseDTO);
jsonObject.put("volunteer",yxVolunteer);
return Result.OK(jsonObject);
}
}

View File

@ -0,0 +1,85 @@
package org.jeecg.modules.yx.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @Description
* @Author ZhouWenTao
* @Date 2023/11/28 15:15
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class LiNianShuJuZhuan2DTO implements Serializable {
private static final long serialVersionUID = 1L;
@Excel(name = "院校编码", width = 15)
@ApiModelProperty(value = "院校编码")
private String yuanxiaoCode;
@Excel(name = "院校", width = 15)
@ApiModelProperty(value = "院校")
private String yuanxiao;
@Excel(name = "文理分科", width = 15)
@ApiModelProperty(value = "文理分科")
private String kelei;
@Excel(name = "年份", width = 15)
@ApiModelProperty(value = "年份")
private String nianfen;
@Excel(name = "批次")
@ApiModelProperty(value = "批次")
private String batch;
@Excel(name = "专业名称", width = 15)
@ApiModelProperty(value = "专业名称")
private String zhuanye;
@Excel(name = "专业编码", width = 15)
@ApiModelProperty(value = "专业编码")
private String zhuanyeCode;
@Excel(name = "排序方法", width = 15)
@ApiModelProperty(value = "排序方法")
private String sortType;
@Excel(name = "专业类别",width = 15)
private String zhuanyeleibie;
@Excel(name = "招生专业代码")
private String zhaoshengdaima;
@Excel(name = "录取率计算规则")
private String luqulvguize;
@Excel(name = "文化\n" +
"成绩\n" +
"比例/%", width = 15)
@ApiModelProperty(value = "文化成绩比例/%")
private String wenhuaBili;
@Excel(name = "专业\n" +
"成绩\n" +
"比例/%", width = 15)
@ApiModelProperty(value = "专业成绩比例/%")
private String zhuanyeBili;
@Excel(name = "计划\n" +
"", width = 15)
@ApiModelProperty(value = "计划数")
private String jihuashu;
@Excel(name = "实际\n" +
"投档\n" +
"人数",width = 15)
@ApiModelProperty(value = "实际投档人数")
private String shijitoudangrenshu;
@Excel(name = "一志愿\n" +
"最低排\n" +
"序成绩", width = 15)
@ApiModelProperty(value = "投档最低分")
private String yizhiyuanzuidipaixuchengji;
@Excel(name = "专业备注", width = 15)
@ApiModelProperty(value = "专业备注")
private String detail;
}

View File

@ -25,4 +25,7 @@ public class VolunteerRecordDTO extends RecommendMajorDTO {
@Excel(name = "志愿顺序", width = 15)
@ApiModelProperty(value = "志愿顺序")
private java.lang.Integer indexs;
@Excel(name = "服从调剂", width = 15)
@ApiModelProperty(value = "服从调剂")
private Integer fctj;
}

View File

@ -0,0 +1,91 @@
package org.jeecg.modules.yx.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 文章表
* @Author: jeecg-boot
* @Date: 2024-03-06
* @Version: V1.0
*/
@Data
@TableName("yx_article")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="yx_article对象", description="文章表")
public class YxArticle 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 title;
/**院校id*/
@Excel(name = "院校id", width = 15)
@ApiModelProperty(value = "院校id")
private java.lang.String schoolId;
/**院校名称*/
@Excel(name = "院校名称", width = 15)
@ApiModelProperty(value = "院校名称")
private java.lang.String schoolName;
/**发布者*/
@Excel(name = "发布者", width = 15)
@ApiModelProperty(value = "发布者")
private java.lang.String author;
/**类型(1.招生章程)*/
@Excel(name = "类型(1.招生章程)", width = 15)
@ApiModelProperty(value = "类型(1.招生章程)")
private java.lang.String type;
/**发布日期*/
@Excel(name = "发布日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@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 releaseTime;
/**阅读量*/
@Excel(name = "阅读量", width = 15)
@ApiModelProperty(value = "阅读量")
private java.lang.Integer viewCount;
/**年份*/
@ApiModelProperty(value = "年份")
private java.lang.String year;
/**创建人*/
@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;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
}

View File

@ -0,0 +1,51 @@
package org.jeecg.modules.yx.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 文章内容表
* @Author: jeecg-boot
* @Date: 2024-03-06
* @Version: V1.0
*/
@Data
@TableName("yx_article_content")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="yx_article_content对象", description="文章内容表")
public class YxArticleContent implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**文章id*/
@Excel(name = "文章id", width = 15)
@ApiModelProperty(value = "文章id")
private java.lang.String articleId;
/**文章内容*/
@Excel(name = "文章内容", width = 15)
@ApiModelProperty(value = "文章内容")
private java.lang.String content;
/**内容类型1.纯文本2.富文本)*/
@Excel(name = "内容类型1.纯文本2.富文本)", width = 15)
@ApiModelProperty(value = "内容类型1.纯文本2.富文本)")
private java.lang.String contentType;
}

View File

@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 软科排名表
* @Author: jeecg-boot
* @Date: 2024-03-03
* @Date: 2024-03-06
* @Version: V1.0
*/
@Data
@ -35,11 +35,19 @@ public class YxArwu implements Serializable {
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.Integer id;
private java.lang.String id;
/**院校编码*/
@Excel(name = "院校编码", width = 15)
@ApiModelProperty(value = "院校编码")
private java.lang.String schoolCode;
/**院校id*/
@Excel(name = "院校id", width = 15)
@ApiModelProperty(value = "院校id")
private java.lang.String schoolId;
/**院校名称*/
@Excel(name = "院校名称", width = 15)
@ApiModelProperty(value = "院校名称")
private java.lang.String schoolName;
/**排名*/
@Excel(name = "排名", width = 15)
@ApiModelProperty(value = "排名")

View File

@ -60,6 +60,10 @@ public class YxSchoolMasterDegree implements Serializable {
@Excel(name = "学位性质", width = 15)
@ApiModelProperty(value = "学位性质")
private java.lang.String degreeNature;
/**专业编码*/
@Excel(name = "专业编码", width = 15)
@ApiModelProperty(value = "专业编码")
private java.lang.String majorCode;
/**专业名称*/
@Excel(name = "专业名称", width = 15)
@ApiModelProperty(value = "专业名称")
@ -133,8 +137,8 @@ public class YxSchoolMasterDegree implements Serializable {
@ApiModelProperty(value = "接收退役")
private java.lang.String acceptRetirement;
/**详情链接*/
@Excel(name = "链接", width = 15)
@ApiModelProperty(value = "链接")
@Excel(name = "链接", width = 15)
@ApiModelProperty(value = "链接")
private java.lang.String detailedLink;
/**备注*/
@Excel(name = "备注", width = 15)

View File

@ -86,4 +86,12 @@ public class YxScoreSegment implements Serializable {
@ApiModelProperty(value = "是否是固定段位")
private Integer fixedRank;
public YxScoreSegment() {
}
public YxScoreSegment(BigDecimal score) {
this.score = score;
}
}

View File

@ -35,7 +35,7 @@ public class YxUserScore implements Serializable {
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**使用状态(0-未使用,1-使用中)*/
@ApiModelProperty(value = "使用状态(0-未使用,1-使用中)")
@ApiModelProperty(value = "使用状态(0-未使用,1-使用中,2-草表)")
private java.lang.String state;
/**填报类型(1-普通类 2-艺术类)*/
@Excel(name = "填报类型(1-普通类 2-艺术类)", width = 15)

View File

@ -72,6 +72,11 @@ public class YxVolunteerRecord implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**服从调剂*/
@Excel(name = "服从调剂", width = 15)
@ApiModelProperty(value = "服从调剂")
private Integer fctj;
//=========================
/*文理分科*/
@TableField(exist = false)

View File

@ -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.YxArticleContent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 文章内容表
* @Author: jeecg-boot
* @Date: 2024-03-06
* @Version: V1.0
*/
public interface YxArticleContentMapper extends BaseMapper<YxArticleContent> {
}

View File

@ -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.YxArticle;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 文章表
* @Author: jeecg-boot
* @Date: 2024-03-06
* @Version: V1.0
*/
public interface YxArticleMapper extends BaseMapper<YxArticle> {
}

View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 软科排名表
* @Author: jeecg-boot
* @Date: 2024-03-03
* @Date: 2024-03-06
* @Version: V1.0
*/
public interface YxArwuMapper extends BaseMapper<YxArwu> {

View File

@ -0,0 +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.YxArticleContentMapper">
</mapper>

View File

@ -0,0 +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.YxArticleMapper">
</mapper>

View File

@ -42,7 +42,7 @@
LEFT JOIn yx_first_level_disciplines fld ON fld.id = m.first_level_discipline
WHERE sm.rules_enroll_probability is not null
<if test="queryvo.schoolName!=null and queryvo.schoolName!=''">
AND (s.school_name like concat('%',#{queryvo.schoolName},'%') or sm.major_name like
AND (s.school_name like concat('%',#{queryvo.schoolName},'%') or sc.schooL_code like concat('%',#{queryvo.schoolName},'%') or sm.major_name like
concat('%',#{queryvo.schoolName},'%'))
</if>
<if test="queryvo.schoolCode!=null and queryvo.schoolCode!=''">
@ -132,6 +132,9 @@
</if>
)
</when>
<when test="queryvo.pCategoryChildrenList.contains('音乐教育')">
sm.major_type_child = '音乐教育'
</when>
</choose>
)
</if>

View File

@ -33,7 +33,7 @@
LEFT JOIN yx_school_child sc ON s.id = sc.school_id
where 1=1 AND s.is_ys = 1
<if test="qvo.schoolName!=null and qvo.schoolName!=''">
AND s.school_name like concat('%',#{qvo.schoolName},'%')
AND (s.school_name like concat('%',#{qvo.schoolName},'%') or sc.school_code like concat('%',#{qvo.schoolName},'%'))
</if>
<if test="qvo.province!=null and qvo.province!=''">
AND s.province like concat('%',#{qvo.province},'%')
@ -133,7 +133,7 @@
LEFT JOIN (select major_code,school_code from yx_school_major group by major_code,school_code) sm ON sm.school_code = sc.school_code
where 1=1 AND s.is_ys = 1
<if test="qvo.schoolName!=null and qvo.schoolName!=''">
AND s.school_name like concat('%',#{qvo.schoolName},'%')
AND (s.school_name like concat('%',#{qvo.schoolName},'%') or sc.school_code like concat('%',#{qvo.schoolName},'%'))
</if>
<if test="qvo.majorCode!=null and qvo.majorCode!=''">
AND sm.major_code = #{qvo.majorCode}
@ -229,7 +229,7 @@
) sm ON sm.school_code = sc.school_code
where 1=1 AND s.is_ys = 1
<if test="qvo.schoolName!=null and qvo.schoolName!=''">
AND s.school_name like concat('%',#{qvo.schoolName},'%')
AND (s.school_name like concat('%',#{qvo.schoolName},'%') or sc.school_code like concat('%',#{qvo.schoolName},'%'))
</if>
<!--<if test="qvo.province!=null and qvo.province!=''">
AND s.province like concat('%',#{qvo.province},'%')
@ -326,7 +326,7 @@
LEFT JOIN yx_school_major sm ON sm.school_code = sc.school_code
where 1=1 AND s.is_ys = 1
<if test="qvo.schoolName!=null and qvo.schoolName!=''">
AND s.school_name like concat('%',#{qvo.schoolName},'%')
AND (s.school_name like concat('%',#{qvo.schoolName},'%') or sc.school_code like concat('%',#{qvo.schoolName},'%'))
</if>
<!--<if test="qvo.province!=null and qvo.province!=''">
AND s.province like concat('%',#{qvo.province},'%')

View File

@ -30,7 +30,7 @@
sm.tuition as studyCost
FROM yx_school_major sm
LEFT JOIN yx_major m ON m.major_code = sm.major_code
LEFT JOIN yx_school_child sc ON sc.school_code = sm.school_code
LEFT JOIN (SELECT school_id,school_code,school_name FROM yx_school_child group by school_code) sc ON sc.school_code = sm.school_code
LEFT JOIN yx_school s ON s.id = sc.school_id
WHERE 1=1
<if test="queryvo.schoolName!=null and queryvo.schoolName!=''">
@ -54,6 +54,7 @@
vr.enroll_probability,
vr.student_converted_score,
vr.batch as batch,
vr.fctj as fctj,
sc.school_name,
s.province as province,
s.school_nature as propertyName,
@ -72,9 +73,10 @@
FROM yx_volunteer_record vr
LEFT JOIN yx_school_major sm ON sm.major_code = vr.major_code AND sm.school_code = vr.school_code AND sm.enrollment_code = vr.enrollment_code
LEFT JOIN yx_major m ON m.major_code = sm.major_code
LEFT JOIN yx_school_child sc ON sc.school_code = sm.school_code
LEFT JOIN (SELECT school_id,school_code,school_name FROM yx_school_child group by school_code) sc ON sc.school_code = sm.school_code
LEFT JOIN yx_school s ON s.id = sc.school_id
WHERE vr.volunteer_id = #{volunteerId}
group by vr.id
ORDER BY vr.indexs asc
</select>
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.yx.service;
import org.jeecg.modules.yx.entity.YxArticleContent;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 文章内容表
* @Author: jeecg-boot
* @Date: 2024-03-06
* @Version: V1.0
*/
public interface IYxArticleContentService extends IService<YxArticleContent> {
}

View File

@ -0,0 +1,13 @@
package org.jeecg.modules.yx.service;
import org.jeecg.modules.yx.entity.YxArticle;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 文章表
* @Author: jeecg-boot
* @Date: 2024-03-06
* @Version: V1.0
*/
public interface IYxArticleService extends IService<YxArticle> {
}

View File

@ -2,13 +2,18 @@ package org.jeecg.modules.yx.service;
import org.jeecg.modules.yx.entity.YxArwu;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.yx.entity.YxSchoolChild;
/**
* @Description: 软科排名表
* @Author: jeecg-boot
* @Date: 2024-03-03
* @Date: 2024-03-06
* @Version: V1.0
*/
public interface IYxArwuService extends IService<YxArwu> {
/**
* 根据院校id获取最新一年的软科排名
*/
YxArwu getBySchoolId(String schoolId);
}

View File

@ -76,6 +76,8 @@ public interface IYxSchoolMajorService extends IService<YxSchoolMajor> {
*/
void updateRulesEnrollProbabilityByOldLastYearData();
void updateRulesEnrollProbabilityByOldLastYearData2();
/*
计算录取率
*/

View File

@ -43,7 +43,7 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
*/
VolunteerDTO artVolunteerDTO(String volunteerId);
YxVolunteer addNew();
YxVolunteer addNew(YxVolunteer yxVolunteer);
/**
* 志愿单 另存

View File

@ -47,6 +47,7 @@ public class BiaoyanService {
String probabilityOperator = null;
//String majorType = null;//专业类别
//String majorTypeChild = null;
String nowBatch = activeCurrentUserScore.getBatch();
String mainSubjects = null;
BigDecimal studentScore = null;//学生折合分
BigDecimal culturalScore = activeCurrentUserScore.getCulturalScore();//学生的文化分
@ -110,7 +111,7 @@ public class BiaoyanService {
continue;
}
//没有往年录取分数线信息
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
if (CollectionUtils.isEmpty(historyMajorEnrollList) || !ScoreUtil.hasComputeEnrollProbabilityPermissions(nowBatch,recommendMajorDTO.getBatch())) {
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
@ -148,20 +149,17 @@ public class BiaoyanService {
continue;
}
//分数是否过省控线
if(!ScoreUtil.crossingControlLine(rulesEnrollProbability,culturalScore,professionalScore,culturalControlLine,specialControlLine)){
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
//使用主考科目成绩将当期成绩按照专业录取分数方式折算
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) && culturalScore.compareTo(culturalControlLine) < 0) {
//学生 文化分小于文化省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("专过文排".equals(rulesEnrollProbability) && professionalScore.compareTo(specialControlLine) < 0) {
//学生 专业分小于专业省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("文过专排主科".equals(rulesEnrollProbability)) {
if ("文过专排主科".equals(rulesEnrollProbability)) {
if (culturalScore.compareTo(culturalControlLine) < 0) {
//小于文化分省控线
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);

View File

@ -48,6 +48,7 @@ public class BoYinService {
//String majorType = null;//专业类别
//String majorTypeChild = null;
String mainSubjects = null;
String nowBatch = activeCurrentUserScore.getBatch();
BigDecimal studentScore = null;//学生折合分
BigDecimal culturalScore = activeCurrentUserScore.getCulturalScore();//学生的文化分
BigDecimal professionalScore = activeCurrentUserScore.getProfessionalScore();//学生的文化分
@ -63,7 +64,7 @@ public class BoYinService {
Map<String, Object> differenceMap = null;
List<YxHistoryMajorEnroll> historyMajorEnrollList = null;//历年录取信息
BigDecimal by= new BigDecimal(0);//
BigDecimal by = new BigDecimal(0);//
//=====================分数转换 start
if ("2024".equals(YxConstant.nowYear)) {
YxScoreSegment scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, professionalScore, professionalCategory, null, activeCurrentUserScore.getProvince());
@ -84,11 +85,11 @@ public class BoYinService {
continue;
}
//没有往年录取分数线信息
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
if (CollectionUtils.isEmpty(historyMajorEnrollList) || !ScoreUtil.hasComputeEnrollProbabilityPermissions(nowBatch, recommendMajorDTO.getBatch())) {
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
historyMajorEnrollList = historyMajorEnrollList.stream().filter(h->YxConstant.cankaoYearList.contains(h.getYear())).collect(Collectors.toList());
historyMajorEnrollList = historyMajorEnrollList.stream().filter(h -> YxConstant.cankaoYearList.contains(h.getYear())).collect(Collectors.toList());
//不是体育类的专业如果是文过专排并且没有录取计算运算符时文过专排是文*0+*1,专过文排是文*1+*0
if ("文过专排".equals(rulesEnrollProbability) && StringUtils.isBlank(probabilityOperator)) {
@ -100,20 +101,18 @@ public class BoYinService {
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
//分数是否过省控线
if(!ScoreUtil.crossingControlLine(rulesEnrollProbability,culturalScore,by,culturalControlLine,specialControlLine)){
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
//将当期成绩按照专业录取分数方式折算
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, by, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
recommendMajorDTO.setStudentConvertedScore(ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator));
recommendMajorDTO.setStudentScore(studentScore);
//判断录取方式分数是否过省控线
if ("文过专排".equals(rulesEnrollProbability) && culturalScore.compareTo(culturalControlLine) < 0) {
//学生 文化分小于文化省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("专过文排".equals(rulesEnrollProbability) && professionalScore.compareTo(specialControlLine) < 0) {
//学生 专业分小于专业省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("文过专排主科".equals(rulesEnrollProbability)) {
//判断录取方式
if ("文过专排主科".equals(rulesEnrollProbability)) {
if (culturalScore.compareTo(culturalControlLine) < 0) {
//小于文化分省控线
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
@ -129,8 +128,8 @@ public class BoYinService {
recommendMajorDTO.setEnrollProbability(enrollProbability);
recommendMajorDTO.setRulesEnrollProbability(ScoreUtil.replaceLastZeroChar(rulesEnrollProbability));
recommendMajorDTO.setProbabilityOperator(ScoreUtil.replaceLastZeroChar(probabilityOperator));
}else{
nowYearProvincialControlLine = ScoreUtil.covertIntoControlLine(rulesEnrollProbability,culturalControlLine, specialControlLine, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
} else {
nowYearProvincialControlLine = ScoreUtil.covertIntoControlLine(rulesEnrollProbability, culturalControlLine, specialControlLine, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
if (nowYearProvincialControlLine == null) {
continue;
}

View File

@ -45,6 +45,7 @@ public class MusicService{
String majorType = null;//专业类别
String majorTypeChild = null;
String mainSubjects = null;
String nowBatch = activeCurrentUserScore.getBatch();
BigDecimal studentScore = null;//学生折合分
BigDecimal culturalScore = activeCurrentUserScore.getCulturalScore();//学生的文化分
BigDecimal professionalScore = activeCurrentUserScore.getProfessionalScore();//学生的文化分
@ -114,7 +115,7 @@ public class MusicService{
continue;
}
//没有往年录取分数线信息
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
if (CollectionUtils.isEmpty(historyMajorEnrollList)||!ScoreUtil.hasComputeEnrollProbabilityPermissions(nowBatch,recommendMajorDTO.getBatch())) {
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
@ -130,12 +131,16 @@ public class MusicService{
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
//将当期成绩按照专业录取分数方式折算
majorTypeChild = recommendMajorDTO.getMajorTypeChild();
mainSubjects = recommendMajorDTO.getMainSubjects();
if (!"高职高专".equals(activeCurrentUserScore.getBatch())) {
if ("1".equals(recommendMajorDTO.getCheckMaster())) {
if ("文过专排主科".equals(recommendMajorDTO.getRulesEnrollProbability())) {
professionalScore2 = activeCurrentUserScore.getProfessionalScore();
professionalScore3 = zxcj;
}if ("1".equals(recommendMajorDTO.getCheckMaster())) {
professionalScore2 = activeCurrentUserScore.getProfessionalScore();
professionalScore3 = zxcj;
}else{
@ -154,21 +159,19 @@ public class MusicService{
}
}
}
//分数是否过省控线
if(!ScoreUtil.crossingControlLine(rulesEnrollProbability,culturalScore,professionalScore,culturalControlLine,specialControlLine)){
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
//使用主考科目成绩将当期成绩按照专业录取分数方式折算
recommendMajorDTO.setStudentConvertedScore(ScoreUtil.convertIntoScore(rulesEnrollProbability, activeCurrentUserScore.getCulturalScore(), professionalScore2, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator));
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);
//判断录取方式分数是否过省控线
if ("文过专排".equals(rulesEnrollProbability) && culturalScore.compareTo(culturalControlLine) < 0) {
//学生 文化分小于文化省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("专过文排".equals(rulesEnrollProbability) && professionalScore.compareTo(specialControlLine) < 0) {
//学生 专业分小于专业省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("文过专排主科".equals(rulesEnrollProbability)) {
if ("文过专排主科".equals(rulesEnrollProbability)) {
if (culturalScore.compareTo(culturalControlLine) < 0) {
//小于文化分省控线
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);

View File

@ -49,6 +49,7 @@ public class WuDaoService {
//String majorType = null;//专业类别
//String majorTypeChild = null;
String mainSubjects = null;
String nowBatch = activeCurrentUserScore.getBatch();
BigDecimal studentScore = null;//学生折合分
BigDecimal culturalScore = activeCurrentUserScore.getCulturalScore();//学生的文化分
BigDecimal professionalScore = activeCurrentUserScore.getProfessionalScore();//学生的文化分
@ -89,7 +90,7 @@ public class WuDaoService {
continue;
}
//没有往年录取分数线信息
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
if (CollectionUtils.isEmpty(historyMajorEnrollList) || !ScoreUtil.hasComputeEnrollProbabilityPermissions(nowBatch,recommendMajorDTO.getBatch())) {
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
@ -119,19 +120,18 @@ public class WuDaoService {
log.error("当前专业有问题,不清楚主考科目:" + JSONObject.toJSONString(recommendMajorDTO));
continue;
}
//分数是否过省控线
if(!ScoreUtil.crossingControlLine(rulesEnrollProbability,culturalScore,professionalScore,culturalControlLine,specialControlLine)){
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore3, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
recommendMajorDTO.setStudentConvertedScore(ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator));
recommendMajorDTO.setStudentScore(studentScore);
//判断录取方式分数是否过省控线
if ("文过专排".equals(rulesEnrollProbability) && culturalScore.compareTo(culturalControlLine) < 0) {
//学生 文化分小于文化省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("专过文排".equals(rulesEnrollProbability) && professionalScore.compareTo(specialControlLine) < 0) {
//学生 专业分小于专业省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("文过专排主科".equals(rulesEnrollProbability)) {
if ("文过专排主科".equals(rulesEnrollProbability)) {
if (culturalScore.compareTo(culturalControlLine) < 0) {
//小于文化分省控线
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.yx.service.impl;
import org.jeecg.modules.yx.entity.YxArticleContent;
import org.jeecg.modules.yx.mapper.YxArticleContentMapper;
import org.jeecg.modules.yx.service.IYxArticleContentService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 文章内容表
* @Author: jeecg-boot
* @Date: 2024-03-06
* @Version: V1.0
*/
@Service
public class YxArticleContentServiceImpl extends ServiceImpl<YxArticleContentMapper, YxArticleContent> implements IYxArticleContentService {
}

View File

@ -0,0 +1,20 @@
package org.jeecg.modules.yx.service.impl;
import org.jeecg.modules.yx.entity.YxArticle;
import org.jeecg.modules.yx.mapper.YxArticleMapper;
import org.jeecg.modules.yx.service.IYxArticleService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
/**
* @Description: 文章表
* @Author: jeecg-boot
* @Date: 2024-03-06
* @Version: V1.0
*/
@Service
public class YxArticleServiceImpl extends ServiceImpl<YxArticleMapper, YxArticle> implements IYxArticleService {
}

View File

@ -1,6 +1,8 @@
package org.jeecg.modules.yx.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.yx.entity.YxArwu;
import org.jeecg.modules.yx.entity.YxSchoolChild;
import org.jeecg.modules.yx.mapper.YxArwuMapper;
import org.jeecg.modules.yx.service.IYxArwuService;
import org.springframework.stereotype.Service;
@ -10,10 +12,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 软科排名表
* @Author: jeecg-boot
* @Date: 2024-03-03
* @Date: 2024-03-06
* @Version: V1.0
*/
@Service
public class YxArwuServiceImpl extends ServiceImpl<YxArwuMapper, YxArwu> implements IYxArwuService {
@Override
public YxArwu getBySchoolId(String schoolId) {
LambdaQueryWrapper<YxArwu> yxArwuLambdaQueryWrapper = new LambdaQueryWrapper<>();
yxArwuLambdaQueryWrapper.last("limit 1");
yxArwuLambdaQueryWrapper.eq(YxArwu::getSchoolId,schoolId);
yxArwuLambdaQueryWrapper.orderByDesc(YxArwu::getYear);
return this.getOne(yxArwuLambdaQueryWrapper);
}
}

View File

@ -1,10 +1,13 @@
package org.jeecg.modules.yx.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.art.dto.ArtMiniMajorDTO;
import org.jeecg.modules.art.dto.MiniMajorDTO;
import org.jeecg.modules.art.dto.RecommendMajorDTO;
@ -42,6 +45,8 @@ public class YxMajorServiceImpl extends ServiceImpl<YxMajorMapper, YxMajor> impl
private IYxSchoolMajorService yxSchoolMajorService;
@Resource
private IYxHistoryMajorEnrollService yxHistoryMajorEnrollService;
@Resource
private RedisUtil redisUtil;
@Override
public YxMajor findByMajorCode(String majorCode) {
YxMajor yxMajor = new YxMajor();
@ -60,41 +65,54 @@ public class YxMajorServiceImpl extends ServiceImpl<YxMajorMapper, YxMajor> impl
List<ArtMiniMajorDTO> resultList=new ArrayList<>();
//根据专业名称 查询
String majorName = queryRecommendMajorVO.getMajorName();
LambdaQueryWrapper<YxMajor> lambdaQueryWrapper=new LambdaQueryWrapper<>();
if (StringUtils.isNotBlank(majorName)) {
lambdaQueryWrapper.like(YxMajor::getMajorName,majorName);
}
lambdaQueryWrapper.eq(StringUtils.isNotBlank(queryRecommendMajorVO.getEducationalLevel()),YxMajor::getEducationalLevel,queryRecommendMajorVO.getEducationalLevel());
lambdaQueryWrapper.isNotNull(YxMajor::getXkfl).isNotNull(YxMajor::getZyl);
//lambdaQueryWrapper.notLike(YxMajor::getMajorName,"");//不要***类的
List<YxMajor> yxMajorList = this.list(lambdaQueryWrapper);
//没有数据返回空集合
if (CollectionUtils.isEmpty(yxMajorList)) {
return resultList;
}
//筛选出专业编号
List<String> majorCodeList = yxMajorList.stream().map(YxMajor::getMajorCode).collect(Collectors.toList());
//获取 专业与院校关联数据
List<YxSchoolMajor> yxSchoolMajorList = yxSchoolMajorService.listByMajorCodeList(majorCodeList);
MiniMajorDTO miniMajorDto=null;
List<MiniMajorDTO> miniMajorDtoList=new ArrayList<>();
for (YxMajor yxMajor : yxMajorList) {
miniMajorDto = new MiniMajorDTO();
BeanUtils.copyProperties(yxMajor,miniMajorDto);
miniMajorDto.setSchoolNum(yxSchoolMajorList.stream().filter(y->y.getMajorCode().equals(yxMajor.getMajorCode())).collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(YxSchoolMajor::getSchoolCode))), ArrayList::new)).size());
miniMajorDtoList.add(miniMajorDto);
//先判断redis缓存中是否有数据
String key="miniMajorList_"+majorName+"_"+queryRecommendMajorVO.getEducationalLevel();
String miniMajorListStr= (String) redisUtil.get(key);
if (StringUtils.isNotBlank(miniMajorListStr)) {
resultList = JSONArray.parseArray(miniMajorListStr,ArtMiniMajorDTO.class);
}
//组合成返回对象
List<MiniMajorDTO> majorList2=null;
ArtMiniMajorDTO nextArtMiniMajorDto=null;
Set<String> zylList = yxMajorList.stream().map(YxMajor::getZyl).collect(Collectors.toSet());
for (String majorTypeName : zylList) {
majorList2 = miniMajorDtoList.stream().filter(y -> y.getZyl().equals(majorTypeName)).collect(Collectors.toList());
nextArtMiniMajorDto = new ArtMiniMajorDTO(majorTypeName,majorList2);
resultList.add(nextArtMiniMajorDto);
//如果从缓存中没有取到则查数据库
if (CollectionUtils.isEmpty(resultList)) {
LambdaQueryWrapper<YxMajor> lambdaQueryWrapper=new LambdaQueryWrapper<>();
if (StringUtils.isNotBlank(majorName)) {
lambdaQueryWrapper.like(YxMajor::getMajorName,majorName);
}
lambdaQueryWrapper.eq(StringUtils.isNotBlank(queryRecommendMajorVO.getEducationalLevel()),YxMajor::getEducationalLevel,queryRecommendMajorVO.getEducationalLevel());
lambdaQueryWrapper.isNotNull(YxMajor::getXkfl).isNotNull(YxMajor::getZyl);
//lambdaQueryWrapper.notLike(YxMajor::getMajorName,"");//不要***类的
List<YxMajor> yxMajorList = this.list(lambdaQueryWrapper);
//没有数据返回空集合
if (CollectionUtils.isEmpty(yxMajorList)) {
return resultList;
}
//筛选出专业编号
List<String> majorCodeList = yxMajorList.stream().map(YxMajor::getMajorCode).collect(Collectors.toList());
//获取 专业与院校关联数据
List<YxSchoolMajor> yxSchoolMajorList = yxSchoolMajorService.listByMajorCodeList(majorCodeList);
MiniMajorDTO miniMajorDto=null;
List<MiniMajorDTO> miniMajorDtoList=new ArrayList<>();
for (YxMajor yxMajor : yxMajorList) {
miniMajorDto = new MiniMajorDTO();
BeanUtils.copyProperties(yxMajor,miniMajorDto);
miniMajorDto.setSchoolNum(yxSchoolMajorList.stream().filter(y->y.getMajorCode().equals(yxMajor.getMajorCode())).collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(YxSchoolMajor::getSchoolCode))), ArrayList::new)).size());
miniMajorDtoList.add(miniMajorDto);
}
//组合成返回对象
List<MiniMajorDTO> majorList2=null;
ArtMiniMajorDTO nextArtMiniMajorDto=null;
Set<String> zylList = yxMajorList.stream().map(YxMajor::getZyl).collect(Collectors.toSet());
for (String majorTypeName : zylList) {
majorList2 = miniMajorDtoList.stream().filter(y -> y.getZyl().equals(majorTypeName)).collect(Collectors.toList());
nextArtMiniMajorDto = new ArtMiniMajorDTO(majorTypeName,majorList2);
resultList.add(nextArtMiniMajorDto);
}
//将数据转成json存储到redis
miniMajorListStr = JSONArray.toJSONString(resultList);
redisUtil.set(key,miniMajorListStr,3600);
}
return resultList;
}
@ -127,7 +145,10 @@ public class YxMajorServiceImpl extends ServiceImpl<YxMajorMapper, YxMajor> impl
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
continue;
}
historyMajorEnrollList = historyMajorEnrollList.stream().filter(h->StringUtils.isNotBlank(h.getRulesEnrollProbability())).collect(Collectors.toList());
historyMajorEnrollList.forEach(h->h.setDetail(yxSchoolMajor.getDetail()));
recommendMajorDTO.setHistoryMajorEnrollList(historyMajorEnrollList);
recommendMajorDTO.setMajorDetail(yxSchoolMajor.getDetail());
list.add(recommendMajorDTO);
}
return list;

View File

@ -3,16 +3,21 @@ package org.jeecg.modules.yx.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.art.dto.ArtRecommendMajorBaseDTO;
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.dto.LiNianShuJuZhuan2DTO;
import org.jeecg.modules.yx.dto.LiNianShuJuZhuanDTO;
import org.jeecg.modules.yx.dto.VolunteerRecordDTO;
import org.jeecg.modules.yx.dto.YxSchoolMajorDTO;
import org.jeecg.modules.yx.entity.*;
@ -20,11 +25,16 @@ import org.jeecg.modules.yx.mapper.YxSchoolMajorMapper;
import org.jeecg.modules.yx.mapper.YxSchoolMapper;
import org.jeecg.modules.yx.service.*;
import org.jeecg.modules.yx.util.ScoreUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
@ -386,6 +396,7 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
String majorType = null;//专业类别
String majorTypeChild = null;//专业类别子项
String mainSubjects = null;//主考科目
String nowBatch = activeCurrentUserScore.getBatch();
BigDecimal studentScore = null;//学生折合分
BigDecimal culturalScore = activeCurrentUserScore.getCulturalScore();//学生的文化分
BigDecimal professionalScore = activeCurrentUserScore.getProfessionalScore();//学生的专业分
@ -415,7 +426,7 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
continue;
}
//没有往年录取分数线信息
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
if (CollectionUtils.isEmpty(historyMajorEnrollList) ||!ScoreUtil.hasComputeEnrollProbabilityPermissions(nowBatch,recommendMajorDTO.getBatch())) {
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
@ -430,23 +441,17 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
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) && culturalScore.compareTo(culturalControlLine) < 0) {
//学生 文化分小于 专业 文化省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("专过文排".equals(rulesEnrollProbability) && professionalScore.compareTo(specialControlLine) < 0) {
//学生 专业分小于 专业省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("文过专排主科".equals(rulesEnrollProbability) && culturalScore.compareTo(culturalControlLine) < 0) {
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)) {
@ -744,6 +749,79 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
return artRecommendMajorBaseDTO;
}
@Override
public void updateRulesEnrollProbabilityByOldLastYearData2(){
File file = new File("C:\\Users\\Denim\\Desktop\\未关联上的专业录取率38条(1).xls");
FileInputStream fileInputStream = null;
int i = 0;
try {
fileInputStream = new FileInputStream(file);
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setNeedSave(true);
List<LiNianShuJuZhuan2DTO> list = ExcelImportUtil.importExcel(fileInputStream, LiNianShuJuZhuan2DTO.class, params);
BigDecimal bigDecimal100 = new BigDecimal(100);
//没有找到的数据
List<String> notMajorList = new ArrayList<>();
List<String> notHistoryList = new ArrayList<>();
List<YxHistoryMajorEnroll> historyMajorEnrollList = new ArrayList<>();
LambdaQueryWrapper<YxHistoryMajorEnroll> yxHistoryMajorEnrollLambdaQueryWrapper =new LambdaQueryWrapper<>();
if(true){
String majorType = "";
String majorTypeChild = "";
String fileName = file.getName();
String yuanxiaoCode = null;
String yuanxiao = null;
String kelei = null;
String nianfen = null;
String zhuanyeCode = null;
String zhuanye = null;
String sortType = null;
String wenhuaBili = null;
String zhuanyeBili = null;
String jihuashu = null;
String luqushu = null;
String yizhiyuanluqushu = null;
String yizhiyuanzuidipaixuchengji = null;
String majorName = null;
int i3 = 0;
YxHistoryScoreControlLine yxHistoryScoreControlLine = null;
YxHistoryMajorEnroll yxHistoryMajorEnroll = null;
YxMajor yxMajor = null;
for (LiNianShuJuZhuan2DTO liNianShuJuDTO : list) {
i++;
yuanxiaoCode = liNianShuJuDTO.getYuanxiaoCode();
zhuanyeCode = liNianShuJuDTO.getZhaoshengdaima();
if (zhuanyeCode.length()<2) {
zhuanyeCode = "0"+zhuanyeCode;
}
kelei = liNianShuJuDTO.getKelei();//科类
LambdaUpdateWrapper<YxSchoolMajor> queryWrapper = new LambdaUpdateWrapper<>();
queryWrapper.eq(YxSchoolMajor::getSchoolCode,yuanxiaoCode);
queryWrapper.eq(YxSchoolMajor::getEnrollmentCode,zhuanyeCode);
queryWrapper.eq(YxSchoolMajor::getMajorName,liNianShuJuDTO.getZhuanye());
queryWrapper.eq(YxSchoolMajor::getCategory,kelei);
queryWrapper.eq(YxSchoolMajor::getBatch,liNianShuJuDTO.getBatch());
queryWrapper.set(YxSchoolMajor::getRulesEnrollProbability,liNianShuJuDTO.getLuqulvguize());
update(queryWrapper);
}
}
} catch (Exception e) {
System.out.println("索引:" + i);
String msg = e.getMessage();
log.error(msg, e);
} finally {
try {
fileInputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
public void updateRulesEnrollProbabilityByOldLastYearData() {
LambdaQueryWrapper<YxSchoolMajor> schoolMajorLambdaQueryWrapper = new LambdaQueryWrapper<YxSchoolMajor>().isNull(YxSchoolMajor::getRulesEnrollProbability);

View File

@ -42,7 +42,8 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
private IYxSchoolMajorService yxSchoolMajorService;
@Resource
private IYxUserScoreService yxUserScoreService;
@Resource
private IYxArwuService yxArwuService;
///=========================小程序
@Override
public IPage<MiniSchoolDTO> miniSchoolSearch(QueryRecommendMajorVO queryRecommendMajorVO) {
@ -147,13 +148,21 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
if (schoolChild == null) {
throw new JeecgBootException("未获取到院校信息,请联系管理员");
}
YxSchool yxSchool = super.getById(schoolChild.getSchoolId());
String schoolId = schoolChild.getSchoolId();
YxSchool yxSchool = super.getById(schoolId);
if (yxSchool == null) {
return null;
}
MiniSchoolDTO miniSchoolDTO = new MiniSchoolDTO();
BeanUtils.copyProperties(yxSchool, miniSchoolDTO);
miniSchoolDTO.setSchoolCode(schoolCode);
//软科排名
YxArwu yxArwu = yxArwuService.getBySchoolId(schoolId);
if (yxArwu!=null) {
miniSchoolDTO.setArwuRanking(yxArwu.getRanking());
}
Set<String> tagsList = new LinkedHashSet<>();
if (StringUtils.isNotBlank(yxSchool.getSchoolType())) {
tagsList.add(yxSchool.getSchoolType());//学校层次

View File

@ -111,7 +111,7 @@ public class YxScoreSegmentServiceImpl extends ServiceImpl<YxScoreSegmentMapper,
score = nowYearScoreSegmentList.get(0).getScore();
}else if(score.compareTo(nowYearScoreSegmentList.get(nowYearScoreSegmentList.size()-1).getScore()) <0){
//当前成绩未上榜
score = new BigDecimal(0);
score = YxConstant.bigDecimal0;
}
//获取该成绩的占比
YxScoreSegment nowScoreSegment = null;
@ -124,7 +124,7 @@ public class YxScoreSegmentServiceImpl extends ServiceImpl<YxScoreSegmentMapper,
if (nowScoreSegment == null) {
//没有获取到当前次位
//throw new JeecgBootException("未在今年的次位中获取到该分数,请联系管理员");
return null;
return new YxScoreSegment(YxConstant.bigDecimal0);
}
//今年当前成绩所在的人数占比
BigDecimal nowRate = nowScoreSegment.getRate();

View File

@ -9,6 +9,7 @@ import org.jeecg.common.util.AssertUtils;
import org.jeecg.modules.yx.dto.ProfessionalCategoryChildrenDTO;
import org.jeecg.modules.yx.entity.YxUserScore;
import org.jeecg.modules.yx.mapper.YxUserScoreMapper;
import org.jeecg.modules.yx.service.IYxSchoolMajorService;
import org.jeecg.modules.yx.service.IYxUserScoreService;
import org.jeecg.modules.yx.service.IYxVipCardService;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,7 +46,12 @@ public class YxUserScoreServiceImpl extends ServiceImpl<YxUserScoreMapper, YxUse
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
AssertUtils.notNull(sysUser,"请先登录!");
String userId = sysUser.getId();
//查询成绩
YxUserScore userScore = getActiveUserScore(userId);
if (userScore==null) {
return null;
}
//获取vip信息
if (CollectionUtils.isNotEmpty(yxVipCardService.selectByUserId(userId))) {
userScore.setIsVip(1);
@ -77,26 +83,28 @@ public class YxUserScoreServiceImpl extends ServiceImpl<YxUserScoreMapper, YxUse
@Override
public YxUserScore findById(String id) {
YxUserScore userScore = this.getById(id);
//组合 子项专业
String professionalCategoryChildren = userScore.getProfessionalCategoryChildren();
if (StringUtils.isNotBlank(professionalCategoryChildren)) {
List<ProfessionalCategoryChildrenDTO> professionalCategoryChildrenList=new ArrayList<>();
for (String s : professionalCategoryChildren.split(",")) {
if (s.contains("音乐表演声乐")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getYybysy()));
} else if (s.contains("音乐表演器乐")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getYybyqy()));
} else if (s.contains("音乐教育")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getYyjy()));
} else if (s.contains("服装表演")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getFzby()));
} else if (s.contains("戏剧影视导演")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getXjysdy()));
} else if (s.contains("戏剧影视表演")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getXjysby()));
if (userScore!=null) {
//组合 子项专业
String professionalCategoryChildren = userScore.getProfessionalCategoryChildren();
if (StringUtils.isNotBlank(professionalCategoryChildren)) {
List<ProfessionalCategoryChildrenDTO> professionalCategoryChildrenList=new ArrayList<>();
for (String s : professionalCategoryChildren.split(",")) {
if (s.contains("音乐表演声乐")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getYybysy()));
} else if (s.contains("音乐表演器乐")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getYybyqy()));
} else if (s.contains("音乐教育")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getYyjy()));
} else if (s.contains("服装表演")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getFzby()));
} else if (s.contains("戏剧影视导演")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getXjysdy()));
} else if (s.contains("戏剧影视表演")) {
professionalCategoryChildrenList.add(new ProfessionalCategoryChildrenDTO(s,userScore.getXjysby()));
}
}
userScore.setProfessionalCategoryChildrenList(professionalCategoryChildrenList);
}
userScore.setProfessionalCategoryChildrenList(professionalCategoryChildrenList);
}
return userScore;
}

View File

@ -327,30 +327,48 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
return null;
}
/**
* 创建新的志愿单
*/
@Override
public YxVolunteer addNew() {
//1.先获取当前分数信息
YxUserScore activeCurrentUserScore = yxUserScoreService.getActiveCurrentUserScore();
//更改状态为未启用
activeCurrentUserScore.setState("0");
yxUserScoreService.updateById(activeCurrentUserScore);
//将当前用户的志愿单状态都设置为 0
this.update(new LambdaUpdateWrapper<YxVolunteer>().eq(YxVolunteer::getScoreId, activeCurrentUserScore.getId()).set(YxVolunteer::getState, 0));
//2.再创建新的分数信息
activeCurrentUserScore.setId(null);
activeCurrentUserScore.setState("1");
yxUserScoreService.save(activeCurrentUserScore);
//3.创建新的志愿单
@Deprecated
public YxVolunteer addNew(YxVolunteer volunteer) {
YxVolunteer yxVolunteer = new YxVolunteer();
if (StringUtils.isNotBlank(activeCurrentUserScore.getCreateBy())) {
yxVolunteer.setCreateBy(activeCurrentUserScore.getCreateBy());
yxVolunteer.setScoreId(volunteer.getScoreId());
YxUserScore yxUserScore = null;
//如果参数里有scoreId直接id查询
if (StringUtils.isNotBlank(volunteer.getScoreId())) {
yxUserScore = yxUserScoreService.findById(volunteer.getScoreId());
} else {
//否则获取最新成绩信息
yxUserScore = yxUserScoreService.getActiveCurrentUserScore();
}
//1.先获取当前分数信息
if (yxUserScore != null) {
//更改状态为未启用
//activeCurrentUserScore.setState("0");
//yxUserScoreService.updateById(activeCurrentUserScore);
//将当前用户的志愿单状态都设置为 0
this.update(new LambdaUpdateWrapper<YxVolunteer>().eq(YxVolunteer::getScoreId, yxUserScore.getId()).set(YxVolunteer::getState, 0));
//2.再创建新的分数信息
//activeCurrentUserScore.setId(null);
//activeCurrentUserScore.setState("1");
//yxUserScoreService.save(activeCurrentUserScore);
//3.创建新的志愿单
if (StringUtils.isNotBlank(yxUserScore.getCreateBy())) {
yxVolunteer.setCreateBy(yxUserScore.getCreateBy());
}
yxVolunteer.setScoreId(yxUserScore.getId());
yxVolunteer.setState("1");
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
if (StringUtils.isNotBlank(volunteer.getVolunteerName())) {
yxVolunteer.setVolunteerName(volunteer.getVolunteerName());
} else {
yxVolunteer.setVolunteerName(sdf.format(date) + "志愿单");
}
this.save(yxVolunteer);
}
yxVolunteer.setScoreId(activeCurrentUserScore.getId());
yxVolunteer.setState("1");
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
yxVolunteer.setVolunteerName(sdf.format(date) + " 方案");
this.save(yxVolunteer);
return yxVolunteer;
}
@ -360,11 +378,11 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
//先保存一个志愿单
String volunteerName = saveVolunteerVO.getVolunteerName();
long count = count(new LambdaQueryWrapper<YxVolunteer>().eq(YxVolunteer::getVolunteerName, volunteerName).eq(YxVolunteer::getCreateBy,saveVolunteerVO.getCreateBy()));
if (count>0) {
long count = count(new LambdaQueryWrapper<YxVolunteer>().eq(YxVolunteer::getVolunteerName, volunteerName).eq(YxVolunteer::getCreateBy, saveVolunteerVO.getCreateBy()));
if (count > 0) {
throw new JeecgBootException("志愿单名称已存在!请更换");
}
AssertUtils.notNull(volunteerName,"请输入志愿单名称");
AssertUtils.notNull(volunteerName, "请输入志愿单名称");
String scoreId = saveVolunteerVO.getScoreId();
YxVolunteer yxVolunteer = new YxVolunteer();
@ -374,26 +392,26 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
yxVolunteer.setCreateBy(saveVolunteerVO.getCreateBy());
save(yxVolunteer);
String volunteerId = yxVolunteer.getId();
int tqpIndex=0,bkaIndex=0,bkbIndex=0,bkIndex=0,gzgzIndex=0;
List<YxVolunteerRecord> yxVolunteerRecordList=new ArrayList<>();
YxVolunteerRecord yxVolunteerRecord=null;
for (SaveVolunteerRecordVO v: volunteerRecordList) {
int tqpIndex = 0, bkaIndex = 0, bkbIndex = 0, bkIndex = 0, gzgzIndex = 0;
List<YxVolunteerRecord> yxVolunteerRecordList = new ArrayList<>();
YxVolunteerRecord yxVolunteerRecord = null;
for (SaveVolunteerRecordVO v : volunteerRecordList) {
yxVolunteerRecord = new YxVolunteerRecord();
BeanUtils.copyProperties(v,yxVolunteerRecord);
BeanUtils.copyProperties(v, yxVolunteerRecord);
yxVolunteerRecord.setVolunteerId(volunteerId);
if ("提前批".equals(v.getBatch())) {
tqpIndex++;
yxVolunteerRecord.setIndexs(tqpIndex);
}else if("本科A段".equals(v.getBatch())){
} else if ("本科A段".equals(v.getBatch())) {
bkaIndex++;
yxVolunteerRecord.setIndexs(bkaIndex);
}else if("本科B段".equals(v.getBatch())){
} else if ("本科B段".equals(v.getBatch())) {
bkbIndex++;
yxVolunteerRecord.setIndexs(bkbIndex);
}else if("本科".equals(v.getBatch())){
} else if ("本科".equals(v.getBatch())) {
bkIndex++;
yxVolunteerRecord.setIndexs(bkIndex);
}else{
} else {
gzgzIndex++;
yxVolunteerRecord.setIndexs(gzgzIndex);
}

View File

@ -45,6 +45,7 @@ public class ZhuanService {
String majorType = null;//专业类别
String majorTypeChild = null;
String mainSubjects = null;
String nowBatch = activeCurrentUserScore.getBatch();
BigDecimal studentScore = null;//学生折合分
BigDecimal culturalScore = activeCurrentUserScore.getCulturalScore();//学生的文化分
BigDecimal professionalScore = activeCurrentUserScore.getProfessionalScore();//学生的文化分
@ -85,7 +86,7 @@ public class ZhuanService {
continue;
}
//没有往年录取分数线信息
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
if (CollectionUtils.isEmpty(historyMajorEnrollList) || !ScoreUtil.hasComputeEnrollProbabilityPermissions(nowBatch,recommendMajorDTO.getBatch())) {
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
@ -113,20 +114,19 @@ public class ZhuanService {
} else {
professionalScore3 = professionalScore;
}
//判断是否省控线
if(!ScoreUtil.crossingControlLine(rulesEnrollProbability,culturalScore,professionalScore,culturalControlLine,specialControlLine)){
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
}
//使用主考科目成绩将当期成绩按照专业录取分数方式折算
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, activeCurrentUserScore.getCulturalScore(), professionalScore3, recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
recommendMajorDTO.setStudentConvertedScore(studentScore);
recommendMajorDTO.setStudentScore(studentScore);
//判断录取方式分数是否过省控线
if ("文过专排".equals(rulesEnrollProbability) && culturalScore.compareTo(culturalControlLine) < 0) {
//学生 文化分小于文化省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("专过文排".equals(rulesEnrollProbability) && professionalScore.compareTo(specialControlLine) < 0) {
//学生 专业分小于专业省控分
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
continue;
} else if ("文过专排主科".equals(rulesEnrollProbability)) {
if ("文过专排主科".equals(rulesEnrollProbability)) {
if (culturalScore.compareTo(culturalControlLine) < 0) {
//小于文化分省控线
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);

View File

@ -114,6 +114,21 @@ public class ScoreUtil {
}
/**
* 判断批次是否有权限计算
* @param nowBatch 当前成绩批次
* @param majorBatch 专业批次
*/
public static boolean hasComputeEnrollProbabilityPermissions(String nowBatch,String majorBatch){
if (StringUtils.isBlank(nowBatch) || StringUtils.isBlank(majorBatch)) {
return false;
}
//将两个批次设置为数字等级数字越小 权限越多 1st.
int nowLevel = "本科A段".equals(nowBatch) ? 1 : "本科B段".equals(nowBatch) ? 2 : "本科".equals(nowBatch) ? 3 : 4;
int majorLevel = "本科A段".equals(majorBatch) ? 1 : "本科B段".equals(majorBatch) ? 2 : "本科".equals(majorBatch) ? 3 : 4;
return nowLevel<=majorLevel;
}
/**
* 删除末尾的0
* @param input *0.05756700+*0.1254200
@ -124,7 +139,7 @@ public class ScoreUtil {
return null;
}
input = input.replaceAll("(\\d+\\.\\d*?)0+(\\D|$)", "$1$2");
input = input.replace("1.","1");
input = input.replace("1.","1").replace("文0.+","");
if (YxConstant.w1z1.equals(input)||YxConstant.w1jiaz1.equals(input)) {
return "文+专";
}
@ -228,66 +243,80 @@ public class ScoreUtil {
if (rulesEnrollProbability==null || culturalScore==null || professionalScore==null) {
return score;
}
switch (rulesEnrollProbability){
case "专过文排":
score = "1722224567122784257".equals(firstLevelDiscipline)?culturalScore.multiply(decimal0133):culturalScore;
break;
case "文过专排":
score = "1722224567122784257".equals(firstLevelDiscipline)?professionalScore.multiply(decimal0667):professionalScore;
break;
case "专7文3":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
score = culturalScore.multiply(decimal004).add(professionalScore.multiply(decimal0467));
if(StringUtils.isNotBlank(operator)){
score = new BigDecimal("0");
String[] operators = operator.split("\\+");
for (String d : operators) {
String[] split = d.split("\\*");
if (split[0].contains("")) {
score = score.add(culturalScore.multiply(new BigDecimal(split[1])));
}else{
score = culturalScore.multiply(decimal07).add(professionalScore.multiply(decimal03));
score = score.add(professionalScore.multiply(new BigDecimal(split[1])));
}
break;
case "文5专5":
case "专5文5":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
score = culturalScore.multiply(decimal0067).add(professionalScore.multiply(decimal0333));
}else{
score = culturalScore.multiply(decimal05).add(professionalScore.multiply(decimal05));
}
break;
case "专3文7":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
score = culturalScore.multiply(decimal0093).add(professionalScore.multiply(decimal02));
}else{
score = culturalScore.multiply(decimal07).add(professionalScore.multiply(decimal03));
}
break;
case "专6文4":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
score = culturalScore.multiply(decimal0093).add(professionalScore.multiply(decimal02));
}else{
score = culturalScore.multiply(decimal04).add(professionalScore.multiply(decimal06));
}
break;
case "文+专":
score = culturalScore.add(professionalScore);
break;
case "文过专排主科":
//主项成绩 *0.
score = professionalScore.multiply(decimal05);
break;
default:
if (operator==null) {
}
}else{
switch (rulesEnrollProbability){
case "专过文排":
score = "1722224567122784257".equals(firstLevelDiscipline)?culturalScore.multiply(decimal0133):culturalScore;
break;
case "文过专排":
score = "1722224567122784257".equals(firstLevelDiscipline)?professionalScore.multiply(decimal0667):professionalScore;
break;
case "专7文3":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
score = culturalScore.multiply(decimal004).add(professionalScore.multiply(decimal0467));
}else{
score = culturalScore.multiply(decimal07).add(professionalScore.multiply(decimal03));
}
break;
case "文5专5":
case "专5文5":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
score = culturalScore.multiply(decimal0067).add(professionalScore.multiply(decimal0333));
}else{
score = culturalScore.multiply(decimal05).add(professionalScore.multiply(decimal05));
}
break;
case "专3文7":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
score = culturalScore.multiply(decimal0093).add(professionalScore.multiply(decimal02));
}else{
score = culturalScore.multiply(decimal07).add(professionalScore.multiply(decimal03));
}
break;
case "专6文4":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
score = culturalScore.multiply(decimal0093).add(professionalScore.multiply(decimal02));
}else{
score = culturalScore.multiply(decimal04).add(professionalScore.multiply(decimal06));
}
break;
case "文+专":
score = culturalScore.add(professionalScore);
}else{
//System.out.println(operator);
score = new BigDecimal("0");
String[] operators = operator.split("\\+");
for (String d : operators) {
String[] split = d.split("\\*");
if (split[0].contains("")) {
score = score.add(culturalScore.multiply(new BigDecimal(split[1])));
}else{
score = score.add(professionalScore.multiply(new BigDecimal(split[1])));
break;
case "文过专排主科":
//主项成绩 *0.
score = professionalScore.multiply(decimal05);
break;
default:
if (operator==null) {
score = culturalScore.add(professionalScore);
}else{
//System.out.println(operator);
score = new BigDecimal("0");
String[] operators = operator.split("\\+");
for (String d : operators) {
String[] split = d.split("\\*");
if (split[0].contains("")) {
score = score.add(culturalScore.multiply(new BigDecimal(split[1])));
}else{
score = score.add(professionalScore.multiply(new BigDecimal(split[1])));
}
}
}
}
break;
break;
}
}
score = score.divide(decimal1,4, RoundingMode.HALF_UP);
return score;
@ -302,61 +331,74 @@ public class ScoreUtil {
*/
public static BigDecimal covertIntoControlLine(String rulesEnrollProbability,BigDecimal controlLine,BigDecimal specialControlLine,String firstLevelDiscipline,String operator){
BigDecimal provincialControlLine=null;
switch (rulesEnrollProbability){
case "专过文排":
provincialControlLine = controlLine.multiply(decimal0133);
provincialControlLine = "1722224567122784257".equals(firstLevelDiscipline)?controlLine.multiply(decimal0133):controlLine;
break;
case "文过专排":
provincialControlLine = "1722224567122784257".equals(firstLevelDiscipline)?specialControlLine.multiply(decimal0667):specialControlLine;
break;
case "专7文3":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
provincialControlLine = controlLine.multiply(decimal004).add(specialControlLine.multiply(decimal0467));
if (StringUtils.isNotBlank(operator)) {
provincialControlLine = new BigDecimal("0");
String[] operators = operator.split("\\+");
for (String d : operators) {
String[] split = d.split("\\*");
if (split[0].contains("")) {
provincialControlLine = provincialControlLine.add(controlLine.multiply(new BigDecimal(split[1])));
}else{
provincialControlLine = controlLine.multiply(decimal07).add(specialControlLine.multiply(decimal03));
provincialControlLine = provincialControlLine.add(specialControlLine.multiply(new BigDecimal(split[1])));
}
break;
case "文5专5":
case "专5文5":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
provincialControlLine = controlLine.multiply(decimal0067).add(specialControlLine.multiply(decimal0333));
}else{
provincialControlLine = controlLine.multiply(decimal05).add(specialControlLine.multiply(decimal05));
}
break;
case "专3文7":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
provincialControlLine = controlLine.multiply(decimal0093).add(specialControlLine.multiply(decimal02));
}else{
provincialControlLine = controlLine.multiply(decimal07).add(specialControlLine.multiply(decimal03));
}
break;
case "专6文4":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
provincialControlLine = controlLine.multiply(decimal0093).add(specialControlLine.multiply(decimal02));
}else{
provincialControlLine = controlLine.multiply(decimal04).add(specialControlLine.multiply(decimal06));
}
break;
case "文+专":
provincialControlLine = controlLine.add(specialControlLine);
break;
default:
if (operator==null) {
}
}else{
switch (rulesEnrollProbability){
case "专过文排":
provincialControlLine = controlLine.multiply(decimal0133);
provincialControlLine = "1722224567122784257".equals(firstLevelDiscipline)?controlLine.multiply(decimal0133):controlLine;
break;
case "文过专排":
provincialControlLine = "1722224567122784257".equals(firstLevelDiscipline)?specialControlLine.multiply(decimal0667):specialControlLine;
break;
case "专7文3":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
provincialControlLine = controlLine.multiply(decimal004).add(specialControlLine.multiply(decimal0467));
}else{
provincialControlLine = controlLine.multiply(decimal07).add(specialControlLine.multiply(decimal03));
}
break;
case "文5专5":
case "专5文5":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
provincialControlLine = controlLine.multiply(decimal0067).add(specialControlLine.multiply(decimal0333));
}else{
provincialControlLine = controlLine.multiply(decimal05).add(specialControlLine.multiply(decimal05));
}
break;
case "专3文7":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
provincialControlLine = controlLine.multiply(decimal0093).add(specialControlLine.multiply(decimal02));
}else{
provincialControlLine = controlLine.multiply(decimal07).add(specialControlLine.multiply(decimal03));
}
break;
case "专6文4":
if ("1722224567122784257".equals(firstLevelDiscipline)) {
provincialControlLine = controlLine.multiply(decimal0093).add(specialControlLine.multiply(decimal02));
}else{
provincialControlLine = controlLine.multiply(decimal04).add(specialControlLine.multiply(decimal06));
}
break;
case "文+专":
provincialControlLine = controlLine.add(specialControlLine);
}else{
provincialControlLine = new BigDecimal("0");
String[] operators = operator.split("\\+");
for (String d : operators) {
String[] split = d.split("\\*");
if (split[0].contains("")) {
provincialControlLine = provincialControlLine.add(controlLine.multiply(new BigDecimal(split[1])));
}else{
provincialControlLine = provincialControlLine.add(specialControlLine.multiply(new BigDecimal(split[1])));
break;
default:
if (operator==null) {
provincialControlLine = controlLine.add(specialControlLine);
}else{
provincialControlLine = new BigDecimal("0");
String[] operators = operator.split("\\+");
for (String d : operators) {
String[] split = d.split("\\*");
if (split[0].contains("")) {
provincialControlLine = provincialControlLine.add(controlLine.multiply(new BigDecimal(split[1])));
}else{
provincialControlLine = provincialControlLine.add(specialControlLine.multiply(new BigDecimal(split[1])));
}
}
}
}
}
}
provincialControlLine = provincialControlLine.divide(decimal1,4, RoundingMode.HALF_UP);
return provincialControlLine;
@ -371,7 +413,7 @@ public class ScoreUtil {
public static String conversionScoreBatch(BigDecimal culturalScore, BigDecimal professionalScore, List<YxHistoryScoreControlLine> historyScoreControlLineList){
double wenScore = culturalScore.doubleValue();
double zhuanScore = professionalScore.doubleValue();
String batch="";
String batch="高职高专";
if (CollectionUtils.isNotEmpty(historyScoreControlLineList)) {
for (YxHistoryScoreControlLine yxHistoryScoreControlLine : historyScoreControlLineList) {
@ -384,6 +426,27 @@ public class ScoreUtil {
return batch;
}
/**
* 判断是否过省控线
* @param rulesEnrollProbability 录取方式
* @param culturalScore 当前文化分
* @param professionalScore 当前专业分
* @param culturalControlLine 当前文化省控线
* @param specialControlLine 当前专业省控线
* @return true/false /没过
*/
public static boolean crossingControlLine(String rulesEnrollProbability,BigDecimal culturalScore,BigDecimal professionalScore,BigDecimal culturalControlLine,BigDecimal specialControlLine){
if (YxConstant.culturalControlLineGuo.equals(rulesEnrollProbability)) {
return culturalScore.compareTo(culturalControlLine)>0;
}else if(YxConstant.specialControlLineGuo.equals(rulesEnrollProbability)){
return professionalScore.compareTo(specialControlLine)>0;
}else if(YxConstant.culturalControlLineGuo2.equals(rulesEnrollProbability)){
return culturalScore.compareTo(specialControlLine)>0;
}
return culturalScore.compareTo(culturalControlLine)>0 && professionalScore.compareTo(specialControlLine)>0;
}
/**
* 将专业类别转为 子类别
*/

View File

@ -131,11 +131,11 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
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-test?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
# 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
username: root
password: root
#password: Wang5322570
# password: root
password: Wang5322570
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
#multi-datasource1: