updates
This commit is contained in:
parent
bb1f350a92
commit
ac355a8cdc
|
|
@ -0,0 +1,271 @@
|
|||
package org.jeecg.modules.mini.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.AssertUtils;
|
||||
import org.jeecg.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.UserScoreDto;
|
||||
import org.jeecg.modules.yx.entity.YxHistoryScoreControlLine;
|
||||
import org.jeecg.modules.yx.entity.YxScoreSegment;
|
||||
import org.jeecg.modules.yx.entity.YxUserScore;
|
||||
import org.jeecg.modules.yx.entity.YxVolunteer;
|
||||
import org.jeecg.modules.yx.service.*;
|
||||
import org.jeecg.modules.yx.util.ScoreUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author ZhouWenTao
|
||||
* @Date 2024/3/18 9:36
|
||||
*/
|
||||
@RequestMapping("/mini/user/score")
|
||||
@RestController
|
||||
@Api(tags = "小程序用户分数接口")
|
||||
public class MiniUserScoreController {
|
||||
@Autowired
|
||||
private IYxUserScoreService yxUserScoreService;
|
||||
@Autowired
|
||||
private IYxCalculationMajorService yxCalculationMajorService;
|
||||
@Autowired
|
||||
private IYxVolunteerService yxVolunteerService;
|
||||
@Autowired
|
||||
private IYxHistoryScoreControlLineService yxHistoryScoreControlLineService;
|
||||
@Autowired
|
||||
private IYxScoreSegmentService yxScoreSegmentService;
|
||||
|
||||
@PostMapping(value = "/save")
|
||||
public Result<?> save(@NotNull @RequestBody YxUserScore yxUserScore) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
String userId = sysUser.getId();
|
||||
// 入参
|
||||
String professionalCategory = yxUserScore.getProfessionalCategory();
|
||||
String cognitioPolyclinic = yxUserScore.getCognitioPolyclinic();//文科/理科
|
||||
BigDecimal culturalScore = yxUserScore.getCulturalScore();
|
||||
BigDecimal professionalScore = yxUserScore.getProfessionalScore();
|
||||
BigDecimal oldProfessionalScore = yxUserScore.getProfessionalScore();
|
||||
String professionalCategoryChildren = yxUserScore.getProfessionalCategoryChildren();
|
||||
|
||||
AssertUtils.notNull(professionalCategory, "请选择[专业类别]");
|
||||
AssertUtils.notNull(cognitioPolyclinic, "请选择[选考科目]");
|
||||
|
||||
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 if (!"表演类".equals(professionalCategory)) {
|
||||
AssertUtils.notTrue(professionalScore.compareTo(YxConstant.bigDecimal300) > 0, "[统考成绩]最高分为300");
|
||||
AssertUtils.notTrue(professionalScore.compareTo(YxConstant.bigDecimal0) < 0, "[统考成绩]最低分为0");
|
||||
}
|
||||
//将多于的子项成绩清空
|
||||
if (StringUtils.isNotBlank(professionalCategoryChildren)) {
|
||||
if (!professionalCategoryChildren.contains("音乐表演声乐")) {
|
||||
yxUserScore.setYybysy(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("音乐表演器乐")) {
|
||||
yxUserScore.setXjysby(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("音乐教育")) {
|
||||
yxUserScore.setYyjy(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("服装表演")) {
|
||||
yxUserScore.setXjysby(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("戏剧影视导演")) {
|
||||
yxUserScore.setXjysby(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("戏剧影视表演")) {
|
||||
yxUserScore.setXjysby(YxConstant.bigDecimal0);
|
||||
}
|
||||
}
|
||||
//==============判断 批次 start
|
||||
LambdaQueryWrapper<YxHistoryScoreControlLine> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getYear, YxConstant.nowYear);//24年省控线
|
||||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getCategory, yxUserScore.getCognitioPolyclinic());
|
||||
//表演类型的方向
|
||||
//舞蹈类使用艺术舞蹈的省控线判定批次
|
||||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory, "舞蹈类".equals(professionalCategory)?"舞蹈类":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, null, yxUserScore.getProvince());
|
||||
professionalScore = scoreSegment.getScore();
|
||||
} else if ("音乐类".equals(professionalCategory)) {
|
||||
if (!professionalCategoryChildren.contains("器乐")) {
|
||||
yxUserScore.setYybyqy(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("声乐")) {
|
||||
yxUserScore.setYybysy(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("音乐教育")) {
|
||||
yxUserScore.setYyjy(YxConstant.bigDecimal0);
|
||||
}
|
||||
|
||||
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();//服装表演
|
||||
oldProfessionalScore = xjysby.max(xjysdy).max(fzby);
|
||||
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);
|
||||
yxUserScore.setProfessionalScore(oldProfessionalScore);
|
||||
}
|
||||
}
|
||||
String batch = "高职高专";
|
||||
if (professionalScore != null && professionalScore.compareTo(YxConstant.bigDecimal0) > 0) {
|
||||
batch = ScoreUtil.conversionScoreBatch(culturalScore, professionalScore, historyScoreControlLineList);
|
||||
}
|
||||
//================批次 end
|
||||
//根据批次,判断 本科/高职高专
|
||||
|
||||
//关闭当前用户之前的分数和志愿单
|
||||
yxUserScoreService.closeUserScore(userId);
|
||||
yxVolunteerService.closeUserVolunteer(userId);
|
||||
//保存新的分数信息
|
||||
yxUserScore.setType("2");//报考类型 1.普通类 2.艺术类
|
||||
yxUserScore.setRanking(0);//位次
|
||||
yxUserScore.setCreateBy(userId);
|
||||
yxUserScore.setEducationalLevel("1");
|
||||
yxUserScore.setBatch(batch);
|
||||
yxUserScore.setId(null);
|
||||
yxUserScore.setCreateTime(null);
|
||||
yxUserScore.setUpdateTime(null);
|
||||
yxUserScore.setCalculationTableName("yx_calculation_major");
|
||||
//保存当前用户的得分
|
||||
yxUserScoreService.save(yxUserScore);
|
||||
|
||||
List<RecommendMajorDTO> recommendMajorDTOList = yxCalculationMajorService.calculationMajor(yxUserScore);
|
||||
|
||||
//创建新的志愿单信息
|
||||
YxVolunteer yxVolunteer = new YxVolunteer();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
yxVolunteer.setVolunteerName(sdf.format(new Date()) + "志愿表");
|
||||
yxVolunteer.setScoreId(yxUserScore.getId());
|
||||
yxVolunteer.setCreateBy(userId);
|
||||
yxVolunteer = yxVolunteerService.addNew(yxVolunteer);
|
||||
//获取志愿单推荐数量
|
||||
ArtRecommendMajorBaseDTO artRecommendMajorBaseDTO = yxCalculationMajorService.checkLevelNum(recommendMajorDTOList);
|
||||
yxUserScore.setJwtNum(artRecommendMajorBaseDTO.getJwt());
|
||||
yxUserScore.setKcjNum(artRecommendMajorBaseDTO.getKcj());
|
||||
yxUserScore.setKbdNum(artRecommendMajorBaseDTO.getKbd());
|
||||
yxUserScore.setNlqNum(artRecommendMajorBaseDTO.getNan());
|
||||
yxUserScoreService.updateById(yxUserScore);
|
||||
//返回对象
|
||||
JSONObject responseBody = JSONObject.parseObject(JSONObject.toJSONString(yxUserScore));
|
||||
responseBody.put("volunteer", yxVolunteer);
|
||||
return Result.OK(responseBody);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getUserScoreInfo")
|
||||
public Result<?> getUserScoreInfo() {
|
||||
//获取分数信息
|
||||
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 = new ArtRecommendMajorBaseDTO();
|
||||
artRecommendMajorBaseDTO.setKbd(activeCurrentUserScore.getKbdNum());
|
||||
artRecommendMajorBaseDTO.setJwt(activeCurrentUserScore.getJwtNum());
|
||||
artRecommendMajorBaseDTO.setKcj(activeCurrentUserScore.getKcjNum());
|
||||
artRecommendMajorBaseDTO.setNan(activeCurrentUserScore.getNlqNum());
|
||||
artRecommendMajorBaseDTO.setAllNumber(activeCurrentUserScore.getKbdNum() + activeCurrentUserScore.getJwtNum() + activeCurrentUserScore.getKcjNum());
|
||||
UserScoreDto userScoreDto = new UserScoreDto();
|
||||
userScoreDto.setScoreInfo(activeCurrentUserScore);
|
||||
userScoreDto.setVolunteer(yxVolunteer);
|
||||
userScoreDto.setFillVolunteer(artRecommendMajorBaseDTO);
|
||||
return Result.OK(userScoreDto);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "今日编辑成绩的次数")
|
||||
@GetMapping(value = "/todayOfEditScoreCount")
|
||||
public Result<?> todayOfEditScoreCount() {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Date date = new Date();
|
||||
String format = YxConstant.sdf.format(date);
|
||||
String startTime = format + " 00:00:00";
|
||||
String endTime = format + " 23:59:59";
|
||||
LambdaQueryWrapper<YxUserScore> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.between(YxUserScore::getCreateTime, startTime, endTime);
|
||||
lambdaQueryWrapper.eq(YxUserScore::getCreateBy, loginUser.getId());
|
||||
long useCount = yxUserScoreService.count(lambdaQueryWrapper);
|
||||
long residueCount = 0;
|
||||
if (YxConstant.todayMaxEditScoreCount > useCount) {
|
||||
//当天没有超过更改次数
|
||||
residueCount = YxConstant.todayMaxEditScoreCount - useCount;
|
||||
}
|
||||
|
||||
jsonObject.put("useCount", useCount);
|
||||
jsonObject.put("residueCount", residueCount);
|
||||
return Result.OK(jsonObject);
|
||||
}
|
||||
}
|
||||
|
|
@ -48,12 +48,8 @@ public class YxScoreController {
|
|||
@Autowired
|
||||
private IYxCalculationMajorService yxCalculationMajorService;
|
||||
@Autowired
|
||||
private IYxSchoolMajorService yxSchoolMajorService;
|
||||
@Autowired
|
||||
private IYxVolunteerService yxVolunteerService;
|
||||
@Autowired
|
||||
private IYxHistoryScoreBatchService yxHistoryScoreBatchService;
|
||||
@Autowired
|
||||
private IYxHistoryScoreControlLineService yxHistoryScoreControlLineService;
|
||||
@Autowired
|
||||
private IYxScoreSegmentService yxScoreSegmentService;
|
||||
|
|
@ -73,26 +69,6 @@ public class YxScoreController {
|
|||
|
||||
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)) {
|
||||
// 将之前的分数信息,改为未使用状态
|
||||
LambdaUpdateWrapper<YxUserScore> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(YxUserScore::getState, "1");
|
||||
updateWrapper.eq(YxUserScore::getCreateBy, userId);
|
||||
updateWrapper.set(YxUserScore::getState, "0");
|
||||
yxUserScoreService.update(updateWrapper);
|
||||
}
|
||||
//判断之前的填报单
|
||||
List<YxVolunteer> oldVolunteerList = yxVolunteerService.list(new LambdaQueryWrapper<YxVolunteer>().eq(YxVolunteer::getCreateBy, userId).eq(YxVolunteer::getState, "1"));
|
||||
if (CollectionUtils.isNotEmpty(oldVolunteerList)) {
|
||||
// 将之前的志愿单 改为未使用
|
||||
LambdaUpdateWrapper<YxVolunteer> volunteerUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
volunteerUpdateWrapper.eq(YxVolunteer::getState, "1");
|
||||
volunteerUpdateWrapper.eq(YxVolunteer::getCreateBy, userId);
|
||||
volunteerUpdateWrapper.set(YxVolunteer::getState, "0");
|
||||
yxVolunteerService.update(volunteerUpdateWrapper);
|
||||
}
|
||||
|
||||
AssertUtils.notTrue(culturalScore.compareTo(YxConstant.bigDecimal750) > 0, "[文化成绩]最高分为750");
|
||||
AssertUtils.notTrue(culturalScore.compareTo(YxConstant.bigDecimal0) < 0, "[文化成绩]最低分为0");
|
||||
|
|
@ -104,18 +80,24 @@ public class YxScoreController {
|
|||
AssertUtils.notTrue(professionalScore.compareTo(YxConstant.bigDecimal300) > 0, "[统考成绩]最高分为300");
|
||||
AssertUtils.notTrue(professionalScore.compareTo(YxConstant.bigDecimal0) < 0, "[统考成绩]最低分为0");
|
||||
}
|
||||
if (StringUtils.isBlank(professionalCategoryChildren)) {
|
||||
//将多于的子项成绩清空
|
||||
if (StringUtils.isNotBlank(professionalCategoryChildren)) {
|
||||
if (!professionalCategoryChildren.contains("音乐表演声乐")) {
|
||||
yxUserScore.setYybysy(YxConstant.bigDecimal0);
|
||||
} else if (!professionalCategoryChildren.contains("音乐表演器乐")) {
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("音乐表演器乐")) {
|
||||
yxUserScore.setXjysby(YxConstant.bigDecimal0);
|
||||
} else if (!professionalCategoryChildren.contains("音乐教育")) {
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("音乐教育")) {
|
||||
yxUserScore.setYyjy(YxConstant.bigDecimal0);
|
||||
} else if (!professionalCategoryChildren.contains("服装表演")) {
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("服装表演")) {
|
||||
yxUserScore.setXjysby(YxConstant.bigDecimal0);
|
||||
} else if (!professionalCategoryChildren.contains("戏剧影视导演")) {
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("戏剧影视导演")) {
|
||||
yxUserScore.setXjysby(YxConstant.bigDecimal0);
|
||||
} else if (!professionalCategoryChildren.contains("戏剧影视表演")) {
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("戏剧影视表演")) {
|
||||
yxUserScore.setXjysby(YxConstant.bigDecimal0);
|
||||
}
|
||||
}
|
||||
|
|
@ -124,12 +106,8 @@ public class YxScoreController {
|
|||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getYear, YxConstant.nowYear);//24年省控线
|
||||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getCategory, yxUserScore.getCognitioPolyclinic());
|
||||
//表演类型的方向
|
||||
if ("舞蹈类".equals(professionalCategory)) {
|
||||
//舞蹈类使用艺术舞蹈的省控线判定批次
|
||||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory, "舞蹈类");
|
||||
} else {
|
||||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory, professionalCategory);
|
||||
}
|
||||
//舞蹈类使用艺术舞蹈的省控线判定批次
|
||||
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory, "舞蹈类".equals(professionalCategory)?"舞蹈类":professionalCategory);
|
||||
lambdaQueryWrapper.last("ORDER BY year DESC,field(batch,'提前批','本科A段','本科B段','本科','高职高专')");
|
||||
List<YxHistoryScoreControlLine> historyScoreControlLineList = yxHistoryScoreControlLineService.list(lambdaQueryWrapper);
|
||||
if (YxConstant.cankaoMajorTypeList.contains(professionalCategory)) {
|
||||
|
|
@ -203,18 +181,15 @@ public class YxScoreController {
|
|||
//================批次 end
|
||||
//根据批次,判断 本科/高职高专
|
||||
|
||||
|
||||
//关闭当前用户之前的分数和志愿单
|
||||
yxUserScoreService.closeUserScore(userId);
|
||||
yxVolunteerService.closeUserVolunteer(userId);
|
||||
//保存新的分数信息
|
||||
yxUserScore.setType("2");//报考类型 1.普通类 2.艺术类
|
||||
yxUserScore.setRanking(0);//位次
|
||||
yxUserScore.setCreateBy(userId);
|
||||
yxUserScore.setEducationalLevel("1");
|
||||
yxUserScore.setBatch(batch);
|
||||
/*if ("体育类".equals(professionalCategory)) {
|
||||
yxUserScore.setBatch("本科");
|
||||
}else{
|
||||
yxUserScore.setBatch("本科A段");
|
||||
}*/
|
||||
yxUserScore.setId(null);
|
||||
yxUserScore.setCreateTime(null);
|
||||
yxUserScore.setUpdateTime(null);
|
||||
|
|
@ -229,8 +204,8 @@ public class YxScoreController {
|
|||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
yxVolunteer.setVolunteerName(sdf.format(new Date()) + "志愿表");
|
||||
yxVolunteer.setScoreId(yxUserScore.getId());
|
||||
yxVolunteer.setCreateBy(userId);
|
||||
yxVolunteer = yxVolunteerService.addNew(yxVolunteer);
|
||||
|
||||
//获取志愿单推荐数量
|
||||
ArtRecommendMajorBaseDTO artRecommendMajorBaseDTO = yxCalculationMajorService.checkLevelNum(recommendMajorDTOList);
|
||||
yxUserScore.setJwtNum(artRecommendMajorBaseDTO.getJwt());
|
||||
|
|
@ -238,10 +213,9 @@ public class YxScoreController {
|
|||
yxUserScore.setKbdNum(artRecommendMajorBaseDTO.getKbd());
|
||||
yxUserScore.setNlqNum(artRecommendMajorBaseDTO.getNan());
|
||||
yxUserScoreService.updateById(yxUserScore);
|
||||
|
||||
//返回对象
|
||||
JSONObject responseBody = JSONObject.parseObject(JSONObject.toJSONString(yxUserScore));
|
||||
responseBody.put("volunteer",yxVolunteer);
|
||||
responseBody.put("volunteer", yxVolunteer);
|
||||
return Result.OK(responseBody);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,4 +47,10 @@ public interface IYxUserScoreService extends IService<YxUserScore> {
|
|||
* @param id
|
||||
*/
|
||||
YxUserScore copyById(String id);
|
||||
|
||||
/**
|
||||
* 将当前用户下的分数全部关闭
|
||||
* @param userId
|
||||
*/
|
||||
void closeUserScore(String userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,4 +50,8 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
|
|||
*/
|
||||
String saveAs(SaveVolunteerVO saveVolunteerVO);
|
||||
|
||||
/**
|
||||
* 关闭当前用户的志愿单
|
||||
*/
|
||||
void closeUserVolunteer(String userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import org.jeecg.common.system.vo.LoginUser;
|
|||
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.entity.YxVolunteer;
|
||||
import org.jeecg.modules.yx.mapper.YxUserScoreMapper;
|
||||
import org.jeecg.modules.yx.service.IYxSchoolMajorService;
|
||||
import org.jeecg.modules.yx.service.IYxUserScoreService;
|
||||
|
|
@ -151,4 +152,13 @@ public class YxUserScoreServiceImpl extends ServiceImpl<YxUserScoreMapper, YxUse
|
|||
this.save(userScore);
|
||||
return userScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeUserScore(String userId) {
|
||||
LambdaUpdateWrapper<YxUserScore> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(YxUserScore::getCreateBy,userId);
|
||||
lambdaUpdateWrapper.eq(YxUserScore::getState,"1");
|
||||
lambdaUpdateWrapper.set(YxUserScore::getState,"0");
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -391,4 +391,13 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
|
|||
yxVolunteerRecordService.saveBatch(yxVolunteerRecordList);
|
||||
return volunteerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeUserVolunteer(String userId) {
|
||||
LambdaUpdateWrapper<YxVolunteer> yxVolunteerLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
yxVolunteerLambdaUpdateWrapper.eq(YxVolunteer::getCreateBy,userId);
|
||||
yxVolunteerLambdaUpdateWrapper.eq(YxVolunteer::getState,"1");
|
||||
yxVolunteerLambdaUpdateWrapper.set(YxVolunteer::getState,"0");
|
||||
this.update(yxVolunteerLambdaUpdateWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue