updates
This commit is contained in:
parent
f0548cb551
commit
1a4522621e
|
|
@ -0,0 +1,153 @@
|
|||
package org.jeecg.modules.api.controller;
|
||||
|
||||
|
||||
import java.security.AlgorithmParameters;
|
||||
import java.security.Key;
|
||||
import java.security.Security;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xkcoding.http.HttpUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.*;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.model.WxModel;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.yx.service.IYxUserScoreService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author ZhouWenTao
|
||||
* @Date 2024/2/6 21:19
|
||||
*/
|
||||
@RequestMapping("/wx")
|
||||
@RestController
|
||||
@Api(tags = "微信接口")
|
||||
public class WxController {
|
||||
@Value("${wx.appId}")
|
||||
private String wxAppId;
|
||||
@Value("${wx.appSecret}")
|
||||
private String wxAppSecret;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IYxUserScoreService yxUserScoreService;
|
||||
public static final String AES = "AES";
|
||||
public static final String AES_CBC_PADDING = "AES/CBC/PKCS7Padding";
|
||||
|
||||
@PostMapping("/login")
|
||||
public Result<?> wechatLogin(@RequestBody WxModel wxModel) {
|
||||
String url = "https://api.weixin.qq.com/sns/jscode2session" +
|
||||
"?appid=" + wxAppId +
|
||||
"&secret=" + wxAppSecret +
|
||||
"&grant_type=authorization_code" +
|
||||
"&js_code=" + wxModel.code;
|
||||
String s = HttpUtil.get(url);
|
||||
JSONObject jsonObject = JSONObject.parseObject(s);
|
||||
AssertUtils.notNull(jsonObject, "登录失败");
|
||||
String openId = jsonObject.getString("openid");
|
||||
String sessionKey = jsonObject.getString("session_key");
|
||||
SysUser user = sysUserService.getByWxOpenId(openId);
|
||||
if (user == null) {
|
||||
String salt = oConvertUtils.randomGen(8);
|
||||
//新用户
|
||||
user = new SysUser();
|
||||
user.setWxOpenId(openId);
|
||||
user.setUsername(salt);
|
||||
user.setRealname("用户+" + salt);
|
||||
user.setSalt(salt);
|
||||
String encryptPassword = PasswordUtil.encrypt(salt, "123456", salt);
|
||||
user.setPassword(encryptPassword);
|
||||
user.setStatus(1);
|
||||
//解密手机号
|
||||
user.setPhone(phoneDecrypt(wxModel.getEncryptedData(), sessionKey, wxModel.getIv()));
|
||||
user.setUserIdentity(CommonConstant.USER_IDENTITY_1);
|
||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
user.setOrgCode(null);
|
||||
sysUserService.saveUser(user, null, null, null);
|
||||
//默认用户有一个 分数信息
|
||||
yxUserScoreService.setDefaultScore(user.getId());
|
||||
}
|
||||
String username = user.getUsername();
|
||||
String syspassword = user.getPassword();
|
||||
//1.生成token
|
||||
String token = JwtUtil.sign(username, syspassword);
|
||||
// 设置token缓存有效时间
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("token", token);
|
||||
obj.put("openId",openId);
|
||||
obj.put("sessionKey",sessionKey);
|
||||
obj.put("userInfo", user);
|
||||
return Result.OK(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密手机号
|
||||
*/
|
||||
@PostMapping("/phoneNumberDecrypt")
|
||||
public Result<?> phoneDecrypt(@RequestBody WxModel wxModel){
|
||||
//判断密文信息是否为空
|
||||
if (StringUtils.isNotBlank(wxModel.getSessionKey()) && StringUtils.isNotBlank(wxModel.getEncryptedData()) && StringUtils.isNotBlank(wxModel.getIv())) {
|
||||
//解密出手机号
|
||||
String phoneNumber = phoneDecrypt(wxModel.getEncryptedData(), wxModel.getSessionKey(), wxModel.getIv());
|
||||
//获取该用户
|
||||
SysUser sysUser = sysUserService.getByWxOpenId(wxModel.getOpenId());
|
||||
if (sysUser!=null) {
|
||||
//更新用户手机号
|
||||
sysUser.setPhone(phoneNumber);
|
||||
sysUserService.updateById(sysUser);
|
||||
}
|
||||
}
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
public static String phoneDecrypt(String encrypted, String sessionKey, String iv) {
|
||||
String phoneNumber = null;
|
||||
try {
|
||||
byte[] encrypdata = cn.hutool.core.codec.Base64.decode(encrypted);
|
||||
byte[] ivData = cn.hutool.core.codec.Base64.decode(iv);
|
||||
byte[] sessionKeyByte = cn.hutool.core.codec.Base64.decode(sessionKey);
|
||||
AlgorithmParameterSpec ivSpec = new IvParameterSpec(ivData);
|
||||
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
|
||||
SecretKeySpec keySpec = new SecretKeySpec(sessionKeyByte, "AES");
|
||||
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
|
||||
//解析解密后的手机号
|
||||
String data = new String(cipher.doFinal(encrypdata), "UTF-8");
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
phoneNumber = jsonObject.getString("phoneNumber");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("解密与微信绑定的手机号失败", e);
|
||||
}
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* * 初始化密钥
|
||||
*/
|
||||
public static void init() throws Exception {
|
||||
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
|
||||
KeyGenerator.getInstance(AES).init(128);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -30,4 +30,13 @@ public class ArtMajorController {
|
|||
String majorCode = queryRecommendMajorVO.getMajorCode();
|
||||
return Result.OK(yxMajorService.findByMajorCode(majorCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序端 查专业 列表
|
||||
*/
|
||||
@ApiOperation(value = "小程序端查专业列表")
|
||||
@GetMapping("/miniMajorList")
|
||||
public Result<?> miniMajorList(QueryRecommendMajorVO queryRecommendMajorVO){
|
||||
return Result.OK(yxMajorService.miniMajorList(queryRecommendMajorVO));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,37 @@
|
|||
package org.jeecg.modules.art.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.AssertUtils;
|
||||
import org.jeecg.modules.art.dto.ArtCalculateInvestmentDTO;
|
||||
import org.jeecg.modules.art.dto.ArtRecommendMajorBaseDTO;
|
||||
import org.jeecg.modules.art.dto.ArtTestCulturalDTO;
|
||||
import org.jeecg.modules.art.dto.RecommendMajorDTO;
|
||||
import org.jeecg.modules.art.vo.QueryCalculateInvestmentVO;
|
||||
import org.jeecg.modules.art.vo.QueryRecommendMajorVO;
|
||||
import org.jeecg.modules.yx.entity.YxHistoryMajorEnroll;
|
||||
import org.jeecg.modules.yx.entity.YxHistoryScoreControlLine;
|
||||
import org.jeecg.modules.yx.entity.YxSchool;
|
||||
import org.jeecg.modules.yx.entity.YxSchoolMajor;
|
||||
import org.jeecg.modules.yx.service.IYxHistoryMajorEnrollService;
|
||||
import org.jeecg.modules.yx.service.IYxHistoryScoreControlLineService;
|
||||
import org.jeecg.modules.yx.service.IYxSchoolMajorService;
|
||||
import org.jeecg.modules.yx.util.ScoreUtil;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description 艺术类接口
|
||||
|
|
@ -28,17 +44,132 @@ import java.util.List;
|
|||
public class ArtRecommendMajorController {
|
||||
@Resource
|
||||
IYxSchoolMajorService yxSchoolMajorService;
|
||||
@Resource
|
||||
IYxHistoryMajorEnrollService yxHistoryMajorEnrollService;
|
||||
@Resource
|
||||
IYxHistoryScoreControlLineService yxHistoryScoreControlLineService;
|
||||
|
||||
@ApiOperation(value = "小程序端-推荐专业列表")
|
||||
@GetMapping("/mini/page")
|
||||
public Result<?> miniRecommendMajorPage(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
if (StringUtils.isNotBlank(queryRecommendMajorVO.getProvince())) {
|
||||
queryRecommendMajorVO.setAddressList(Collections.singletonList(queryRecommendMajorVO.getProvince()));
|
||||
}
|
||||
ArtRecommendMajorBaseDTO artRecommendMajorBaseDTO = yxSchoolMajorService.recommendMajorPage(queryRecommendMajorVO);
|
||||
return Result.OK(artRecommendMajorBaseDTO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "推荐专业列表")
|
||||
@GetMapping("/page")
|
||||
public Result<?> recommendMajorPage(QueryRecommendMajorVO queryRecommendMajorVO){
|
||||
public Result<?> recommendMajorPage(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
ArtRecommendMajorBaseDTO artRecommendMajorBaseDTO = yxSchoolMajorService.recommendMajorPage(queryRecommendMajorVO);
|
||||
return Result.OK(artRecommendMajorBaseDTO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "学院专业列表")
|
||||
@GetMapping("/list")
|
||||
public Result<?> recommendMajorList(QueryRecommendMajorVO queryRecommendMajorVO){
|
||||
public Result<?> recommendMajorList(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
return Result.OK(yxSchoolMajorService.otherMajorList(queryRecommendMajorVO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "投档分测算")
|
||||
@GetMapping("/calculateInvestment")
|
||||
public Result<?> calculateInvestment(QueryCalculateInvestmentVO queryCalculateInvestmentVO) {
|
||||
//获取 院校专业信息列表,录取方式notnull
|
||||
LambdaQueryWrapper<YxSchoolMajor> yxSchoolMajorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
yxSchoolMajorLambdaQueryWrapper.isNotNull(YxSchoolMajor::getRulesEnrollProbability);
|
||||
//字段匹配: batch 批次,category 文理分科,majorType 专业类型
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(StringUtils.isNotBlank(queryCalculateInvestmentVO.getBatch()), YxSchoolMajor::getBatch, queryCalculateInvestmentVO.getBatch());
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(StringUtils.isNotBlank(queryCalculateInvestmentVO.getCategory()), YxSchoolMajor::getCategory, queryCalculateInvestmentVO.getCategory());
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(StringUtils.isNotBlank(queryCalculateInvestmentVO.getProfessionalCategory()), YxSchoolMajor::getMajorType, queryCalculateInvestmentVO.getProfessionalCategory());
|
||||
List<YxSchoolMajor> schooMajorList = yxSchoolMajorService.list(yxSchoolMajorLambdaQueryWrapper);
|
||||
List<ArtCalculateInvestmentDTO> calculateInvestmentDTOList = new ArrayList<>();
|
||||
try {
|
||||
if (CollectionUtils.isEmpty(schooMajorList)) {
|
||||
return Result.OK();
|
||||
}
|
||||
ArtCalculateInvestmentDTO artCalculateInvestmentDTO = null;
|
||||
Integer schoolNum = 0;
|
||||
//遍历 院校专业列表,将录取方式,院校代码储存起来
|
||||
//map,key:录取方式,value: array[院校代码]
|
||||
Map<String, Set<String>> maps = new LinkedHashMap<>();
|
||||
Set<String> schoolCodeSet = null;
|
||||
for (YxSchoolMajor yxSchoolMajor : schooMajorList) {
|
||||
schoolCodeSet = maps.getOrDefault(yxSchoolMajor.getRulesEnrollProbability(), new HashSet<>());
|
||||
schoolCodeSet.add(yxSchoolMajor.getSchoolCode());
|
||||
maps.put(yxSchoolMajor.getRulesEnrollProbability(), schoolCodeSet);
|
||||
}
|
||||
if (maps.isEmpty()) {
|
||||
return Result.OK();
|
||||
}
|
||||
BigDecimal culturalScore = new BigDecimal(queryCalculateInvestmentVO.getCulturalScore());
|
||||
BigDecimal professionalScore = new BigDecimal(queryCalculateInvestmentVO.getProfessionalScore());
|
||||
//根据录取方式,计算折合分数
|
||||
for (String rulesEnrollProbability : maps.keySet()) {
|
||||
Optional<YxSchoolMajor> any = schooMajorList.stream().filter(s -> s.getRulesEnrollProbability().equals(rulesEnrollProbability)).findAny();
|
||||
if (any.isPresent()) {
|
||||
YxSchoolMajor yxSchoolMajor = any.get();
|
||||
artCalculateInvestmentDTO = new ArtCalculateInvestmentDTO();
|
||||
artCalculateInvestmentDTO.setSchoolNum(maps.get(rulesEnrollProbability).size());
|
||||
artCalculateInvestmentDTO.setRulesEnrollProbability(rulesEnrollProbability);
|
||||
artCalculateInvestmentDTO.setProbabilityOperator(yxSchoolMajor.getProbabilityOperator());
|
||||
artCalculateInvestmentDTO.setScore(ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore, null, yxSchoolMajor.getProbabilityOperator()));
|
||||
calculateInvestmentDTOList.add(artCalculateInvestmentDTO);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return Result.error("计算折合分出错,请联系管理员");
|
||||
}
|
||||
return Result.OK(calculateInvestmentDTOList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "文化分测算")
|
||||
@GetMapping(value = "/testCultural")
|
||||
public Result<?> testCultural(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
//根据 院校代码,获取 院校的招生专业,计算各专业的录取分数
|
||||
String schoolCode = queryRecommendMajorVO.getSchoolCode();
|
||||
String year = queryRecommendMajorVO.getYear();
|
||||
AssertUtils.notNull(year, "请选择年份");
|
||||
String a_ = "_";
|
||||
List<YxSchoolMajor> yxSchoolMajorList = yxSchoolMajorService.list(new LambdaQueryWrapper<YxSchoolMajor>().eq(YxSchoolMajor::getSchoolCode, schoolCode));
|
||||
Set<String> majorNameSet = yxSchoolMajorList.stream().map(YxSchoolMajor::getMajorName).collect(Collectors.toSet());
|
||||
|
||||
//获取 历年分数信息
|
||||
List<YxHistoryMajorEnroll> yxHistoryMajorEnrollList = yxHistoryMajorEnrollService.list(new LambdaQueryWrapper<YxHistoryMajorEnroll>().eq(YxHistoryMajorEnroll::getYear, year).eq(YxHistoryMajorEnroll::getSchoolCode, schoolCode).in(YxHistoryMajorEnroll::getMajorName, majorNameSet));
|
||||
Map<String, YxHistoryMajorEnroll> historyMajorEnrollMap = yxHistoryMajorEnrollList.stream().collect(Collectors.toMap(h -> h.getCategory() + a_ + h.getMajorName() + a_ + h.getBatch(), h -> h));
|
||||
|
||||
//获取 省控线
|
||||
List<YxHistoryScoreControlLine> historyScoreControlLineList = yxHistoryScoreControlLineService.list(new LambdaQueryWrapper<YxHistoryScoreControlLine>().eq(YxHistoryScoreControlLine::getYear, year));
|
||||
Map<String, YxHistoryScoreControlLine> yxHistoryScoreControlLineMap = new LinkedHashMap<>();//key:文科_美术学_提前批
|
||||
String key = null;
|
||||
YxHistoryScoreControlLine yxHistoryScoreControlLine = null;
|
||||
if (CollectionUtils.isNotEmpty(historyScoreControlLineList)) {
|
||||
yxHistoryScoreControlLineMap = historyScoreControlLineList.stream().collect(Collectors.toMap(h -> h.getCategory() + a_ + h.getProfessionalCategory() + a_ + h.getBatch(), h -> h));
|
||||
}
|
||||
List<ArtTestCulturalDTO> artTestCulturalDtoList = new ArrayList<>();
|
||||
ArtTestCulturalDTO artTestCulturalDto = new ArtTestCulturalDTO();
|
||||
for (YxSchoolMajor yxSchoolMajor : yxSchoolMajorList) {
|
||||
artTestCulturalDto = new ArtTestCulturalDTO();
|
||||
key = yxSchoolMajor.getCategory() + a_ + yxSchoolMajor.getMajorType() + a_ + (yxSchoolMajor.getBatch().equals("提前批")?"本科A段":yxSchoolMajor.getBatch());
|
||||
yxHistoryScoreControlLine = yxHistoryScoreControlLineMap.get(key);
|
||||
if (yxHistoryScoreControlLine != null) {
|
||||
//文化分控线
|
||||
artTestCulturalDto.setCulturalScore(yxHistoryScoreControlLine.getCulturalScore());
|
||||
//专业分控线
|
||||
artTestCulturalDto.setSpecialScore(yxHistoryScoreControlLine.getSpecialScore());
|
||||
}
|
||||
artTestCulturalDto.setYear(year);
|
||||
artTestCulturalDto.setMajorName(yxSchoolMajor.getMajorName());
|
||||
artTestCulturalDto.setCategory(yxSchoolMajor.getCategory());
|
||||
artTestCulturalDto.setBatch(yxSchoolMajor.getBatch());
|
||||
artTestCulturalDto.setDetail(yxSchoolMajor.getDetail());
|
||||
artTestCulturalDto.setProbabilityOperator(yxSchoolMajor.getProbabilityOperator());
|
||||
artTestCulturalDto.setRulesEnrollProbability(yxSchoolMajor.getRulesEnrollProbability());
|
||||
key = yxSchoolMajor.getCategory() + a_ + yxSchoolMajor.getMajorName() + a_ + yxSchoolMajor.getBatch();
|
||||
artTestCulturalDto.setMajorNameAll(yxSchoolMajor.getMajorName()+"["+yxSchoolMajor.getCategory()+"]"+"("+yxSchoolMajor.getBatch()+")");
|
||||
artTestCulturalDto.setScore(historyMajorEnrollMap.get(key).getAdmissionLine());
|
||||
artTestCulturalDtoList.add(artTestCulturalDto);
|
||||
}
|
||||
return Result.OK(artTestCulturalDtoList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,16 +41,16 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 填报志愿表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-10-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="前台-填报志愿")
|
||||
* @Description: 填报志愿表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-10-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "前台-填报志愿")
|
||||
@RestController
|
||||
@RequestMapping("/art/volunteer")
|
||||
@Slf4j
|
||||
public class ArtVolunteerController{
|
||||
public class ArtVolunteerController {
|
||||
@Autowired
|
||||
private IYxUserScoreService yxUserScoreService;
|
||||
@Autowired
|
||||
|
|
@ -61,117 +61,128 @@ public class ArtVolunteerController{
|
|||
private TemplateEngine templateEngine;
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param yxVolunteer
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "分页列表查询")
|
||||
@ApiOperation(value="分页列表查询", notes="分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<List<VolunteerDTO>> queryPageList(YxVolunteer yxVolunteer,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
List<VolunteerDTO> list = yxVolunteerService.artVolunteerList(yxVolunteer);
|
||||
return Result.OK(list);
|
||||
}
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param yxVolunteer
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "分页列表查询")
|
||||
@ApiOperation(value = "分页列表查询", notes = "分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<List<VolunteerDTO>> queryPageList(YxVolunteer yxVolunteer,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
List<VolunteerDTO> list = yxVolunteerService.artVolunteerList(yxVolunteer);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "获取当前用户的志愿表")
|
||||
@GetMapping(value = "/info")
|
||||
public Result<?> info(YxVolunteerRecord yxVolunteerRecord){
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser,"请先登录!");
|
||||
yxVolunteerRecord.setCreateBy(sysUser.getId());
|
||||
return Result.OK(yxVolunteerService.getActiveByCreate(sysUser.getId()));
|
||||
}
|
||||
@ApiOperation(value = "获取当前用户的志愿表")
|
||||
@GetMapping(value = "/info")
|
||||
public Result<?> info(YxVolunteerRecord yxVolunteerRecord) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
yxVolunteerRecord.setCreateBy(sysUser.getId());
|
||||
return Result.OK(yxVolunteerService.getActiveByCreate(sysUser.getId()));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据志愿表id获取志愿信息")
|
||||
@GetMapping(value = "/artVolunteerDetail")
|
||||
public Result<?> artVolunteerDetail(YxVolunteer volunteer){
|
||||
public Result<?> artVolunteerDetail(YxVolunteer volunteer) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser,"请先登录!");
|
||||
VolunteerDTO volunteerDTO=null;
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
VolunteerDTO volunteerDTO = null;
|
||||
if (StringUtils.isNotBlank(volunteer.getId())) {
|
||||
//根据id获取志愿单
|
||||
volunteerDTO = yxVolunteerService.findById(volunteer.getId());
|
||||
}else{
|
||||
} else {
|
||||
//如果没有传id,则直接获取当前激活的志愿表
|
||||
volunteerDTO = yxVolunteerService.getActiveByCreate(sysUser.getId());
|
||||
}
|
||||
return Result.OK(volunteerDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存志愿
|
||||
* @param saveVolunteerVO
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="保存", notes="保存")
|
||||
@PostMapping(value = "/save")
|
||||
public Result<String> save(@RequestBody SaveVolunteerVO saveVolunteerVO) {
|
||||
AssertUtils.notNull(saveVolunteerVO.getMajorCode(),"专业编码不可为空");
|
||||
AssertUtils.notNull(saveVolunteerVO.getSchoolCode(),"学校编码不可为空");
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser,"请先登录!");
|
||||
saveVolunteerVO.setCreateBy(sysUser.getId());
|
||||
boolean b = yxVolunteerService.artVolunteerSave(saveVolunteerVO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
/**
|
||||
* 保存志愿
|
||||
*
|
||||
* @param saveVolunteerVO
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "保存", notes = "保存")
|
||||
@PostMapping(value = "/save")
|
||||
public Result<String> save(@RequestBody SaveVolunteerVO saveVolunteerVO) {
|
||||
AssertUtils.notNull(saveVolunteerVO.getMajorCode(), "专业编码不可为空");
|
||||
AssertUtils.notNull(saveVolunteerVO.getSchoolCode(), "学校编码不可为空");
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
saveVolunteerVO.setCreateBy(sysUser.getId());
|
||||
return Result.OK(yxVolunteerService.artVolunteerSave(saveVolunteerVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建志愿
|
||||
*/
|
||||
@ApiOperation(value = "新建志愿", notes = "新建志愿")
|
||||
@PostMapping(value = "/addNew")
|
||||
public Result<YxVolunteer> addNew() {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
return Result.OK(yxVolunteerService.addNew());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除志愿明细")
|
||||
@DeleteMapping("/delete")
|
||||
public Result<?> delete(YxVolunteer volunteer){
|
||||
public Result<?> delete(YxVolunteer volunteer) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser,"请先登录!");
|
||||
AssertUtils.notNull(volunteer.getId(),"请求参数有误!");
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
AssertUtils.notNull(volunteer.getId(), "请求参数有误!");
|
||||
yxVolunteerService.deleteById(volunteer.getId());
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换志愿顺序
|
||||
* 替换志愿顺序
|
||||
*/
|
||||
@ApiOperation(value="保存", notes="保存")
|
||||
@ApiOperation(value = "保存", notes = "保存")
|
||||
@PostMapping(value = "/replaceVolunteer")
|
||||
public Result<String> replaceVolunteer(@RequestBody SaveVolunteerVO saveVolunteerVO) {
|
||||
AssertUtils.notNull(saveVolunteerVO.getIndexs(),"志愿顺序不可为空");
|
||||
AssertUtils.notNull(saveVolunteerVO.getBatch(),"学校批次不可为空");
|
||||
AssertUtils.notNull(saveVolunteerVO.getMajorCode(),"专业编码不可为空");
|
||||
AssertUtils.notNull(saveVolunteerVO.getSchoolCode(),"学校编码不可为空");
|
||||
AssertUtils.notNull(saveVolunteerVO.getIndexs(), "志愿顺序不可为空");
|
||||
AssertUtils.notNull(saveVolunteerVO.getBatch(), "学校批次不可为空");
|
||||
AssertUtils.notNull(saveVolunteerVO.getMajorCode(), "专业编码不可为空");
|
||||
AssertUtils.notNull(saveVolunteerVO.getSchoolCode(), "学校编码不可为空");
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser,"请先登录!");
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
saveVolunteerVO.setCreateBy(sysUser.getId());
|
||||
//根据batch,indexs,替换 majorCode,schoolCode
|
||||
LambdaUpdateWrapper<YxVolunteerRecord> yxVolunteerRecordLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
yxVolunteerRecordLambdaUpdateWrapper.eq(YxVolunteerRecord::getBatch,saveVolunteerVO.getBatch());
|
||||
yxVolunteerRecordLambdaUpdateWrapper.eq(YxVolunteerRecord::getIndexs,saveVolunteerVO.getIndexs());
|
||||
yxVolunteerRecordLambdaUpdateWrapper.set(YxVolunteerRecord::getMajorCode,saveVolunteerVO.getMajorCode());
|
||||
yxVolunteerRecordLambdaUpdateWrapper.set(YxVolunteerRecord::getSchoolCode,saveVolunteerVO.getSchoolCode());
|
||||
yxVolunteerRecordLambdaUpdateWrapper.eq(YxVolunteerRecord::getBatch, saveVolunteerVO.getBatch());
|
||||
yxVolunteerRecordLambdaUpdateWrapper.eq(YxVolunteerRecord::getIndexs, saveVolunteerVO.getIndexs());
|
||||
yxVolunteerRecordLambdaUpdateWrapper.set(YxVolunteerRecord::getMajorCode, saveVolunteerVO.getMajorCode());
|
||||
yxVolunteerRecordLambdaUpdateWrapper.set(YxVolunteerRecord::getSchoolCode, saveVolunteerVO.getSchoolCode());
|
||||
yxVolunteerRecordService.update(yxVolunteerRecordLambdaUpdateWrapper);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除志愿明细")
|
||||
@DeleteMapping("/recordDel")
|
||||
public Result<?> volunteerRecordDel(@RequestBody SaveVolunteerVO saveVolunteerVO){
|
||||
public Result<?> volunteerRecordDel(@RequestBody SaveVolunteerVO saveVolunteerVO) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser,"请先登录!");
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
VolunteerDTO volunteerDTO = yxVolunteerService.getActiveByCreate(sysUser.getId());
|
||||
AssertUtils.notNull(volunteerDTO,"删除失败,未找到志愿单");
|
||||
AssertUtils.notNull(saveVolunteerVO.getIndexs(),"删除失败,请选择志愿意向");
|
||||
AssertUtils.notNull(volunteerDTO, "删除失败,未找到志愿单");
|
||||
AssertUtils.notNull(saveVolunteerVO.getIndexs(), "删除失败,请选择志愿意向");
|
||||
try {
|
||||
LambdaQueryWrapper<YxVolunteerRecord> lambdaQueryWrapper=new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId,volunteerDTO.getId());
|
||||
lambdaQueryWrapper.eq(YxVolunteerRecord::getIndexs,saveVolunteerVO.getIndexs());
|
||||
LambdaQueryWrapper<YxVolunteerRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId, volunteerDTO.getId());
|
||||
lambdaQueryWrapper.eq(YxVolunteerRecord::getIndexs, saveVolunteerVO.getIndexs());
|
||||
yxVolunteerRecordService.remove(lambdaQueryWrapper);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
throw new JeecgBootException(e);
|
||||
}
|
||||
return Result.OK("删除成功!");
|
||||
|
|
@ -179,51 +190,51 @@ public class ArtVolunteerController{
|
|||
|
||||
@ApiOperation(value = "删除志愿明细")
|
||||
@DeleteMapping("/volunteerRecordDelete")
|
||||
public Result<?> volunteerRecordDelete(SaveVolunteerVO saveVolunteerVO){
|
||||
public Result<?> volunteerRecordDelete(SaveVolunteerVO saveVolunteerVO) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser,"请先登录!");
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
/*String volunteerId = saveVolunteerVO.getVolunteerId();
|
||||
Integer indexs = saveVolunteerVO.getIndexs();
|
||||
String batch = saveVolunteerVO.getBatch();
|
||||
AssertUtils.notNull(volunteerId,"请求参数有误");*/
|
||||
String id = saveVolunteerVO.getId();
|
||||
AssertUtils.notNull(id,"请求参数有误");
|
||||
AssertUtils.notNull(id, "请求参数有误");
|
||||
try {
|
||||
yxVolunteerRecordService.removeById(id);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
throw new JeecgBootException(e);
|
||||
}
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/preview")
|
||||
public void preview(@RequestParam(value = "id") String id,HttpServletResponse response) throws IOException {
|
||||
VolunteerDTO volunteerDTO= yxVolunteerService.findById(id);
|
||||
if (volunteerDTO==null) {
|
||||
public void preview(@RequestParam(value = "id") String id, HttpServletResponse response) throws IOException {
|
||||
VolunteerDTO volunteerDTO = yxVolunteerService.findById(id);
|
||||
if (volunteerDTO == null) {
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
response.getWriter().print("未找到志愿表!");
|
||||
}else{
|
||||
} else {
|
||||
String scoreId = volunteerDTO.getScoreId();
|
||||
YxUserScore yxUserScore = yxUserScoreService.findById(scoreId);
|
||||
Date date = new Date();
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
// 构造freemarker模板引擎参数,listVars.size()个数对应pdf页数
|
||||
List<Map<String, Object>> listVars = new ArrayList<>();
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
BigDecimal professionalScore = yxUserScore.getProfessionalScore();
|
||||
BigDecimal culturalScore = yxUserScore.getCulturalScore();
|
||||
variables.put("professionalScore",professionalScore);
|
||||
variables.put("culturalScore",culturalScore);
|
||||
variables.put("professionalScore", professionalScore);
|
||||
variables.put("culturalScore", culturalScore);
|
||||
//获取用户信息
|
||||
SysUser sysUser = sysUserService.getById(yxUserScore.getCreateBy());
|
||||
variables.put("userName",sysUser.getRealname());
|
||||
variables.put("userName", sysUser.getRealname());
|
||||
|
||||
String apply = "";
|
||||
variables.put("nowDate",sdf.format(date));
|
||||
variables.put("lastUpdateDate",sdf.format(volunteerDTO.getUpdateTime()==null?volunteerDTO.getCreateTime():volunteerDTO.getUpdateTime()));
|
||||
variables.put("nowDate", sdf.format(date));
|
||||
variables.put("lastUpdateDate", sdf.format(volunteerDTO.getUpdateTime() == null ? volunteerDTO.getCreateTime() : volunteerDTO.getUpdateTime()));
|
||||
|
||||
variables.put("apply", apply);
|
||||
variables.put("volunteer",volunteerDTO);
|
||||
variables.put("volunteer", volunteerDTO);
|
||||
listVars.add(variables);
|
||||
PdfUtil.preview(templateEngine, "preview.html", listVars, response);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package org.jeecg.modules.art.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description 投档分测算 返回参数
|
||||
* @Author ZhouWenTao
|
||||
* @Date 2024/2/18 16:58
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "投档分测算返回参数")
|
||||
public class ArtCalculateInvestmentDTO implements Serializable {
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String rulesEnrollProbability;
|
||||
@ApiModelProperty(value = "分数运算符")
|
||||
private String probabilityOperator;
|
||||
@ApiModelProperty("综合分")
|
||||
private BigDecimal score;
|
||||
@ApiModelProperty(value = "院校数量")
|
||||
private Integer schoolNum = 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package org.jeecg.modules.art.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecg.modules.yx.entity.YxMajor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 小程序端专业列表返回对象
|
||||
* @Author ZhouWenTao
|
||||
* @Date 2024/2/10 20:55
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "小程序端专业列表返回对象")
|
||||
public class ArtMiniMajorDTO implements Serializable {
|
||||
@ApiModelProperty(value = "学科类型")
|
||||
private String majorTypeName;
|
||||
@ApiModelProperty(value = "专业列表")
|
||||
private List<MiniMajorDTO> majorList;
|
||||
|
||||
public ArtMiniMajorDTO() {
|
||||
}
|
||||
|
||||
public ArtMiniMajorDTO(String majorTypeName, List<MiniMajorDTO> majorList) {
|
||||
this.majorTypeName = majorTypeName;
|
||||
this.majorList = majorList;
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ public class ArtRecommendMajorBaseDTO implements Serializable {
|
|||
private IPage<RecommendMajorDTO> pageList;
|
||||
private List<RecommendMajorDTO> list;
|
||||
@ApiModelProperty(value = "是否是vip 0-否,1-是")
|
||||
private Integer isVip=0;//是否是vip
|
||||
private Integer isVip=1;//是否是vip
|
||||
private Integer kcj=0;//可冲击
|
||||
private Integer jwt=0;//较稳妥
|
||||
private Integer kbd=0;//可保底
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
package org.jeecg.modules.art.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author ZhouWenTao
|
||||
* @Date 2024/2/19 11:10
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "文化分测算数据对象")
|
||||
public class ArtTestCulturalDTO implements Serializable {
|
||||
@ApiModelProperty(value = "年份")
|
||||
private String year;
|
||||
@ApiModelProperty("专业名称")
|
||||
private String majorName;
|
||||
@ApiModelProperty("专业名称+文理+批次")
|
||||
private String majorNameAll;
|
||||
@ApiModelProperty("文理分科")
|
||||
private String category;
|
||||
@ApiModelProperty("批次")
|
||||
private String batch;
|
||||
@ApiModelProperty("院校限制")
|
||||
private String detail;
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String rulesEnrollProbability;
|
||||
@ApiModelProperty(value = "分数运算符")
|
||||
private String probabilityOperator;
|
||||
@ApiModelProperty("综合分")
|
||||
private BigDecimal score;
|
||||
@ApiModelProperty("省文化分控线")
|
||||
private BigDecimal culturalScore;
|
||||
@ApiModelProperty("省专业分控线")
|
||||
private BigDecimal SpecialScore;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package org.jeecg.modules.art.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecg.modules.yx.entity.YxMajor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author ZhouWenTao
|
||||
* @Date 2024/2/11 15:44
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "小程序端专业信息对象")
|
||||
public class MiniMajorDTO extends YxMajor {
|
||||
@ApiModelProperty(value = "开设院校数量")
|
||||
private Integer schoolNum;
|
||||
//@ApiModelProperty(value = "开设院校数量")
|
||||
//private IPage<ArtSchoolDTO> schoolList;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package org.jeecg.modules.art.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description 投档分测算 请求参数
|
||||
* @Author ZhouWenTao
|
||||
* @Date 2024/2/18 16:53
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "投档分测算")
|
||||
public class QueryCalculateInvestmentVO implements Serializable {
|
||||
@ApiModelProperty(value = "文化分")
|
||||
private Integer culturalScore;
|
||||
@ApiModelProperty(value = "统考分")
|
||||
private Integer professionalScore;
|
||||
@ApiModelProperty(value = "省份")
|
||||
private String province;
|
||||
@ApiModelProperty(value = "批次")
|
||||
private String batch;
|
||||
@ApiModelProperty(value = "文理分科")
|
||||
private String category;
|
||||
@ApiModelProperty(value = "专业类型")
|
||||
private String professionalCategory;
|
||||
}
|
||||
|
|
@ -20,10 +20,14 @@ import java.util.List;
|
|||
@Data
|
||||
@ApiModel(value = "查询学院专业列表对象")
|
||||
public class QueryRecommendMajorVO extends ArtBaseDTO {
|
||||
@ApiModelProperty(value = "年份")
|
||||
private String year;
|
||||
@ApiModelProperty(value = "专业编码")
|
||||
private String majorCode;
|
||||
@ApiModelProperty(value = "专业名称")
|
||||
private String majorName;
|
||||
@ApiModelProperty(value = "地区")
|
||||
private String province;
|
||||
@ApiModelProperty(value = "专业类别")
|
||||
private String professionalCategory;
|
||||
@ApiModelProperty(value = "学历层次")
|
||||
|
|
@ -32,8 +36,9 @@ public class QueryRecommendMajorVO extends ArtBaseDTO {
|
|||
private List<String> addressList;
|
||||
@ApiModelProperty(value = "标签")
|
||||
private List<String> tagsList;
|
||||
|
||||
@ApiModelProperty(value = "办学性质")
|
||||
private String schoolNature;
|
||||
@ApiModelProperty(value = "办学性质List")
|
||||
private List<String> schoolNatureList;
|
||||
|
||||
@ApiModelProperty(value = "院校类型")
|
||||
|
|
|
|||
|
|
@ -19,12 +19,15 @@ import org.jeecg.modules.base.service.BaseCommonService;
|
|||
import org.jeecg.modules.system.entity.SysThirdAccount;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.model.ThirdLoginModel;
|
||||
import org.jeecg.modules.system.model.WxModel;
|
||||
import org.jeecg.modules.system.service.ISysDictService;
|
||||
import org.jeecg.modules.system.service.ISysThirdAccountService;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl;
|
||||
import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl;
|
||||
import org.jeecg.modules.yx.service.IYxUserScoreService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -64,13 +67,8 @@ public class ThirdLoginController {
|
|||
private ThirdAppWechatEnterpriseServiceImpl thirdAppWechatEnterpriseService;
|
||||
@Autowired
|
||||
private ThirdAppDingtalkServiceImpl thirdAppDingtalkService;
|
||||
|
||||
|
||||
|
||||
@RequestMapping("/wechat/login")
|
||||
public void wechatLogin(){
|
||||
|
||||
}
|
||||
@Autowired
|
||||
private IYxUserScoreService yxUserScoreService;
|
||||
|
||||
@RequestMapping("/render/{source}")
|
||||
public void render(@PathVariable("source") String source, HttpServletResponse response) throws IOException {
|
||||
|
|
|
|||
|
|
@ -204,4 +204,9 @@ public class SysUser implements Serializable {
|
|||
* 流程状态
|
||||
*/
|
||||
private String bpmStatus;
|
||||
|
||||
/**
|
||||
* 微信openId
|
||||
*/
|
||||
private String wxOpenId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.system.model;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 操作
|
||||
*/
|
||||
@Data
|
||||
public class WxModel implements Serializable {
|
||||
public String code;
|
||||
public String sessionKey;
|
||||
public String encryptedData;
|
||||
public String iv;
|
||||
|
||||
public String openId;
|
||||
}
|
||||
|
|
@ -31,10 +31,13 @@ import java.util.Set;
|
|||
* @since 2018-12-20
|
||||
*/
|
||||
public interface ISysUserService extends IService<SysUser> {
|
||||
|
||||
/**
|
||||
* 根据openId获取
|
||||
*/
|
||||
SysUser getByWxOpenId(String wxOpenId);
|
||||
/**
|
||||
* 查询用户数据列表
|
||||
*
|
||||
*
|
||||
* @param req
|
||||
* @param queryWrapper
|
||||
* @param pageSize
|
||||
|
|
@ -42,7 +45,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||
* @return
|
||||
*/
|
||||
Result<IPage<SysUser>> queryPageList(HttpServletRequest req, QueryWrapper<SysUser> queryWrapper, Integer pageSize, Integer pageNo);
|
||||
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*
|
||||
|
|
@ -82,15 +85,15 @@ public interface ISysUserService extends IService<SysUser> {
|
|||
* @return SysUser
|
||||
*/
|
||||
public SysUser getUserByName(String username);
|
||||
|
||||
|
||||
/**
|
||||
* 添加用户和用户角色关系
|
||||
* @param user
|
||||
* @param roles
|
||||
*/
|
||||
public void addUserWithRole(SysUser user,String roles);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改用户和用户角色关系
|
||||
* @param user
|
||||
|
|
@ -113,7 +116,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||
* @return
|
||||
*/
|
||||
public SysRoleIndex getDynamicIndexByUserRole(String username,String version);
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户信息包括 部门信息
|
||||
* @param username
|
||||
|
|
@ -193,14 +196,14 @@ public interface ISysUserService extends IService<SysUser> {
|
|||
* @return 权限集合
|
||||
*/
|
||||
Set<String> getUserPermissionsSet(String username);
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户名设置部门ID
|
||||
* @param username
|
||||
* @param orgCode
|
||||
*/
|
||||
void updateUserDepart(String username,String orgCode,Integer loginTenantId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据手机号获取用户名和密码
|
||||
* @param phone 手机号
|
||||
|
|
@ -230,7 +233,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||
* @param departs
|
||||
*/
|
||||
void editUserWithDepart(SysUser user, String departs);
|
||||
|
||||
|
||||
/**
|
||||
* 校验用户是否有效
|
||||
* @param sysUser
|
||||
|
|
@ -381,7 +384,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||
*/
|
||||
void changeDepartChargePerson(JSONObject json);
|
||||
//--- author:taoyan date:20221231 for: QQYUN-3515【应用】应用下的组织机构管理功能,细节实现 ---
|
||||
|
||||
|
||||
/**
|
||||
* 编辑租户用户
|
||||
* @param sysUser
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
@Slf4j
|
||||
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper userMapper;
|
||||
@Autowired
|
||||
|
|
@ -96,7 +96,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
private SysUserTenantMapper relationMapper;
|
||||
@Autowired
|
||||
private SysUserTenantMapper userTenantMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public SysUser getByWxOpenId(String wxOpenId) {
|
||||
return this.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getWxOpenId,wxOpenId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<IPage<SysUser>> queryPageList(HttpServletRequest req, QueryWrapper<SysUser> queryWrapper, Integer pageSize, Integer pageNo) {
|
||||
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>();
|
||||
|
|
@ -224,8 +229,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
}
|
||||
return sysUser;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addUserWithRole(SysUser user, String roles) {
|
||||
|
|
@ -286,7 +291,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
roleIndex = list.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//如果componentUrl为空,则返回空
|
||||
if(oConvertUtils.isEmpty(roleIndex.getComponent())){
|
||||
return null;
|
||||
|
|
@ -352,7 +357,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
info.setSysUserName(sysUser.getRealname());
|
||||
info.setSysOrgCode(sysUser.getOrgCode());
|
||||
}
|
||||
|
||||
|
||||
//多部门支持in查询
|
||||
List<SysDepart> list = sysDepartMapper.queryUserDeparts(sysUser.getId());
|
||||
List<String> sysMultiOrgCode = new ArrayList<String>();
|
||||
|
|
@ -368,7 +373,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
}
|
||||
}
|
||||
info.setSysMultiOrgCode(sysMultiOrgCode);
|
||||
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
|
|
@ -586,7 +591,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
|
||||
//6. 删除租户用户中间表的数据
|
||||
line += userTenantMapper.delete(new LambdaQueryWrapper<SysUserTenant>().in(SysUserTenant::getUserId,userIds));
|
||||
|
||||
|
||||
return line != 0;
|
||||
}
|
||||
|
||||
|
|
@ -788,7 +793,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
queryWrapper.eq(SysTenant::getStatus, Integer.valueOf(CommonConstant.STATUS_1));
|
||||
tenantList = sysTenantMapper.selectList(queryWrapper);
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
if (tenantList.size() == 0) {
|
||||
return result.error500("与该用户关联的租户均已被冻结,无法登录!");
|
||||
} else {
|
||||
|
|
@ -896,7 +901,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
//找到新的租户id与原来的租户id不同之处,进行删除
|
||||
String[] relTenantIdArray = relTenantIds.split(SymbolConstant.COMMA);
|
||||
List<String> relTenantIdList = Arrays.asList(relTenantIdArray);
|
||||
|
||||
|
||||
List<Integer> deleteTenantIdList = oldTenantIds.stream().filter(item -> !relTenantIdList.contains(item.toString())).collect(Collectors.toList());
|
||||
for (Integer tenantId : deleteTenantIdList) {
|
||||
this.deleteTenantByUserId(userId, tenantId);
|
||||
|
|
@ -964,9 +969,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
.in(SysUserDepart::getUserId, idList)
|
||||
.in(SysUserDepart::getDepId, departIdList);
|
||||
sysUserDepartMapper.delete(query);
|
||||
|
||||
|
||||
String[] arr = selecteddeparts.split(",");
|
||||
|
||||
|
||||
//再新增
|
||||
for (String deaprtId : arr) {
|
||||
for(String userId: idList){
|
||||
|
|
@ -1104,7 +1109,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1135,7 +1140,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 变更父级部门 修改编码
|
||||
* @param parentId
|
||||
|
|
@ -1208,7 +1213,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
getParentDepart(temp, orgName, orgId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
|
||||
|
|
@ -1221,7 +1226,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
//修改租户用户下的部门
|
||||
this.updateTenantDepart(user, tenantId, departs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改租户下的部门
|
||||
* @param departs
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package org.jeecg.modules.yx.controller;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -11,6 +15,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.yx.dto.MajorImport;
|
||||
import org.jeecg.modules.yx.entity.YxFirstLevelDisciplines;
|
||||
import org.jeecg.modules.yx.entity.YxMajor;
|
||||
import org.jeecg.modules.yx.service.IYxFirstLevelDisciplinesService;
|
||||
|
|
@ -24,6 +29,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
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.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
|
@ -234,4 +240,63 @@ public class YxMajorController extends JeecgController<YxMajor, IYxMajorService>
|
|||
}
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("yx:yx_major:importExcel")
|
||||
@RequestMapping(value = "/importExcel2", method = RequestMethod.POST)
|
||||
public Result<?> importExcel2(HttpServletRequest request, HttpServletResponse response) throws FileNotFoundException {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(0);
|
||||
params.setNeedSave(true);
|
||||
FileInputStream fileInputStream = new FileInputStream(new File("C:\\Users\\Denim\\Desktop\\艺术本科.xlsx"));
|
||||
try {
|
||||
List<MajorImport> list = ExcelImportUtil.importExcel(fileInputStream, MajorImport.class, params);
|
||||
Map<String, MajorImport> majorMap = list.stream().collect(Collectors.toMap(MajorImport::getMajorCode, l -> l));
|
||||
List<YxMajor> majorList = yxMajorService.list();
|
||||
Map<String, YxMajor> yxMajorMap = majorList.stream().collect(Collectors.toMap(m -> m.getMajorName() + "_" + m.getMajorCode(), m -> m));
|
||||
MajorImport yxMajor1=null;
|
||||
List<MajorImport> list2=new ArrayList<>();
|
||||
List<YxMajor> list3=new ArrayList<>();
|
||||
/*for (YxMajor yxMajor : majorList) {
|
||||
yxMajor1 = majorMap.get(yxMajor.getMajorCode());
|
||||
if (yxMajor1==null) {
|
||||
list3.add(yxMajor);
|
||||
continue;
|
||||
}
|
||||
BeanUtils.copyProperties(yxMajor1,yxMajor);
|
||||
}*/
|
||||
|
||||
for (MajorImport majorImport : list) {
|
||||
YxMajor yxMajor = yxMajorMap.get(majorImport.getMajorName() + "_" + majorImport.getMajorCode());
|
||||
if (yxMajor == null) {
|
||||
list2.add(majorImport);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
yxMajorService.updateBatchById(majorList);
|
||||
return Result.ok("文件导入成功!数据行数:" + list.size());
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
log.error(msg, e);
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,256 @@
|
|||
package org.jeecg.modules.yx.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.AssertUtils;
|
||||
import org.jeecg.modules.yx.dto.HistoryScoreSegmentDTO;
|
||||
import org.jeecg.modules.yx.entity.YxScoreSegment;
|
||||
import org.jeecg.modules.yx.service.IYxScoreSegmentService;
|
||||
|
||||
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.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
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-02-16
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "分数段位表")
|
||||
@RestController
|
||||
@RequestMapping("/yx/yxScoreSegment")
|
||||
@Slf4j
|
||||
public class YxScoreSegmentController extends JeecgController<YxScoreSegment, IYxScoreSegmentService> {
|
||||
@Autowired
|
||||
private IYxScoreSegmentService yxScoreSegmentService;
|
||||
|
||||
|
||||
/**
|
||||
* 分数段位表-根据专业分数查询
|
||||
*/
|
||||
@ApiOperation(value = "分数段位表-根据专业分数查询")
|
||||
@GetMapping(value = "/searchByScore")
|
||||
public Result<List<HistoryScoreSegmentDTO>> searchByScore(YxScoreSegment yxScoreSegment,
|
||||
HttpServletRequest req) {
|
||||
AssertUtils.notNull(yxScoreSegment.getProvince(), "请选择省份");
|
||||
|
||||
List<String> yearList = Arrays.asList("2024", "2023", "2022", "2021");
|
||||
BigDecimal userScore = yxScoreSegment.getScore();//用户输入的分数
|
||||
BigDecimal one = null;
|
||||
BigDecimal two = null;
|
||||
BigDecimal three = null;
|
||||
BigDecimal bigDecimal1 = new BigDecimal("1");
|
||||
BigDecimal bigDecimal100 = new BigDecimal("100");
|
||||
BigDecimal bigDecimal5 = new BigDecimal("5");
|
||||
List<HistoryScoreSegmentDTO> historyScoreSegmentDTOList = new ArrayList<>();
|
||||
HistoryScoreSegmentDTO historyScoreSegmentDto = null;
|
||||
for (String year : yearList) {
|
||||
//当前年所有分数
|
||||
LambdaQueryWrapper<YxScoreSegment> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(YxScoreSegment::getYear, year);
|
||||
lambdaQueryWrapper.eq(YxScoreSegment::getProvince, yxScoreSegment.getProvince());
|
||||
lambdaQueryWrapper.eq(YxScoreSegment::getProfessionalCategory, yxScoreSegment.getProfessionalCategory());
|
||||
lambdaQueryWrapper.orderByDesc(YxScoreSegment::getScore);
|
||||
List<YxScoreSegment> list = yxScoreSegmentService.list(lambdaQueryWrapper);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
continue;
|
||||
}
|
||||
//获取最低分
|
||||
lambdaQueryWrapper.clear();
|
||||
lambdaQueryWrapper.eq(YxScoreSegment::getYear, year);
|
||||
lambdaQueryWrapper.eq(YxScoreSegment::getProvince, yxScoreSegment.getProvince());
|
||||
lambdaQueryWrapper.eq(YxScoreSegment::getProfessionalCategory, yxScoreSegment.getProfessionalCategory());
|
||||
lambdaQueryWrapper.orderByAsc(YxScoreSegment::getScore);
|
||||
lambdaQueryWrapper.last("limit 0,1");
|
||||
YxScoreSegment lowScoreSegment = yxScoreSegmentService.getOne(lambdaQueryWrapper);
|
||||
historyScoreSegmentDto = new HistoryScoreSegmentDTO();
|
||||
historyScoreSegmentDto.setYear(year);
|
||||
historyScoreSegmentDto.setType(1);
|
||||
//循环分段信息
|
||||
int i = 0;
|
||||
for (YxScoreSegment scoreSegment : list) {
|
||||
//当前分数~当前分数+5 是否包含 输入的分数
|
||||
one = scoreSegment.getScore();
|
||||
two = scoreSegment.getScore().add(bigDecimal5);
|
||||
// 如果分数
|
||||
// 例: one:285,two:290, userScore:286
|
||||
if (one.compareTo(userScore)<=0 && i==0) {
|
||||
historyScoreSegmentDto.setBeginScore(one);//开始分数
|
||||
historyScoreSegmentDto.setRank(scoreSegment.getPersonNum());//排名
|
||||
// 算占比
|
||||
BigDecimal divide = new BigDecimal(scoreSegment.getPersonNum()).divide(new BigDecimal(lowScoreSegment.getPersonNum()), 4, RoundingMode.HALF_UP);
|
||||
historyScoreSegmentDto.setRate(bigDecimal1.subtract(divide).multiply(bigDecimal100));
|
||||
break;
|
||||
}else if (one.compareTo(userScore)<=0 || (one.compareTo(userScore)<=0 && two.compareTo(userScore)>=0)) {
|
||||
historyScoreSegmentDto.setBeginScore(one);//开始分数
|
||||
historyScoreSegmentDto.setEndScore(two);//结束分数
|
||||
historyScoreSegmentDto.setRank(scoreSegment.getPersonNum());//排名
|
||||
// 算占比
|
||||
BigDecimal divide = new BigDecimal(scoreSegment.getPersonNum()).divide(new BigDecimal(lowScoreSegment.getPersonNum()), 4, RoundingMode.HALF_UP);
|
||||
historyScoreSegmentDto.setRate(bigDecimal1.subtract(divide).multiply(bigDecimal100));
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (historyScoreSegmentDto.getRank()==null) {
|
||||
//低于历年分
|
||||
historyScoreSegmentDto.setType(2);
|
||||
historyScoreSegmentDto.setBeginScore(lowScoreSegment.getScore());
|
||||
historyScoreSegmentDto.setRank(lowScoreSegment.getPersonNum());
|
||||
}
|
||||
historyScoreSegmentDTOList.add(historyScoreSegmentDto);
|
||||
}
|
||||
|
||||
|
||||
//计算百分占比
|
||||
return Result.OK(historyScoreSegmentDTOList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param yxScoreSegment
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "分数段位表-分页列表查询")
|
||||
@ApiOperation(value = "分数段位表-分页列表查询", notes = "分数段位表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<YxScoreSegment>> queryPageList(YxScoreSegment yxScoreSegment,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<YxScoreSegment> queryWrapper = QueryGenerator.initQueryWrapper(yxScoreSegment, req.getParameterMap());
|
||||
Page<YxScoreSegment> page = new Page<YxScoreSegment>(pageNo, pageSize);
|
||||
IPage<YxScoreSegment> pageList = yxScoreSegmentService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param yxScoreSegment
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "分数段位表-添加")
|
||||
@ApiOperation(value = "分数段位表-添加", notes = "分数段位表-添加")
|
||||
@RequiresPermissions("yx:yx_score_segment:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody YxScoreSegment yxScoreSegment) {
|
||||
yxScoreSegmentService.save(yxScoreSegment);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param yxScoreSegment
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "分数段位表-编辑")
|
||||
@ApiOperation(value = "分数段位表-编辑", notes = "分数段位表-编辑")
|
||||
@RequiresPermissions("yx:yx_score_segment:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody YxScoreSegment yxScoreSegment) {
|
||||
yxScoreSegmentService.updateById(yxScoreSegment);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "分数段位表-通过id删除")
|
||||
@ApiOperation(value = "分数段位表-通过id删除", notes = "分数段位表-通过id删除")
|
||||
@RequiresPermissions("yx:yx_score_segment:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
yxScoreSegmentService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "分数段位表-批量删除")
|
||||
@ApiOperation(value = "分数段位表-批量删除", notes = "分数段位表-批量删除")
|
||||
@RequiresPermissions("yx:yx_score_segment:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.yxScoreSegmentService.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<YxScoreSegment> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
YxScoreSegment yxScoreSegment = yxScoreSegmentService.getById(id);
|
||||
if (yxScoreSegment == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(yxScoreSegment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param yxScoreSegment
|
||||
*/
|
||||
@RequiresPermissions("yx:yx_score_segment:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, YxScoreSegment yxScoreSegment) {
|
||||
return super.exportXls(request, yxScoreSegment, YxScoreSegment.class, "分数段位表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("yx:yx_score_segment:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, YxScoreSegment.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package org.jeecg.modules.yx.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author ZhouWenTao
|
||||
* @Date 2024/2/16 20:08
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "检索历年统考排名对象")
|
||||
public class HistoryScoreSegmentDTO implements Serializable {
|
||||
@ApiModelProperty(value = "年份")
|
||||
private String year;
|
||||
@ApiModelProperty(value = "开始分数")
|
||||
private BigDecimal beginScore;
|
||||
@ApiModelProperty(value = "结束分数")
|
||||
private BigDecimal endScore;
|
||||
@ApiModelProperty(value = "超越占比")
|
||||
private BigDecimal rate;
|
||||
|
||||
@ApiModelProperty(value = "排名")
|
||||
private Integer rank;
|
||||
|
||||
private Integer type;
|
||||
}
|
||||
|
|
@ -24,6 +24,9 @@ public class LiNianShuJuDTO implements Serializable {
|
|||
@Excel(name = "院校", width = 15)
|
||||
@ApiModelProperty(value = "院校")
|
||||
private java.lang.String yuanxiao;
|
||||
@Excel(name = "院校代码", width = 15)
|
||||
@ApiModelProperty(value = "院校代码")
|
||||
private java.lang.String yuanxiaoCode;
|
||||
@Excel(name = "科类", width = 15)
|
||||
@ApiModelProperty(value = "科类")
|
||||
private java.lang.String kelei;
|
||||
|
|
@ -33,6 +36,9 @@ public class LiNianShuJuDTO implements Serializable {
|
|||
@Excel(name = "专业", width = 15)
|
||||
@ApiModelProperty(value = "专业")
|
||||
private java.lang.String zhuanye;
|
||||
@Excel(name = "专业代码", width = 15)
|
||||
@ApiModelProperty(value = "专业代码")
|
||||
private java.lang.String zhuanyeCode;
|
||||
@Excel(name = "排序方法", width = 15)
|
||||
@ApiModelProperty(value = "排序方法")
|
||||
private java.lang.String sortType;
|
||||
|
|
@ -73,4 +79,7 @@ public class LiNianShuJuDTO implements Serializable {
|
|||
@ApiModelProperty(value = "一志愿最低排序成绩")
|
||||
private java.lang.String yizhiyuanzuidipaixuchengji;
|
||||
|
||||
@Excel(name = "专业备注", width = 15)
|
||||
@ApiModelProperty(value = "专业备注")
|
||||
private String detail;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
package org.jeecg.modules.yx.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author ZhouWenTao
|
||||
* @Date 2024/2/10 17:27
|
||||
*/
|
||||
@Data
|
||||
public class MajorImport implements Serializable {
|
||||
/**专业名称*/
|
||||
@ApiModelProperty(value = "专业名称")
|
||||
@Excel(name = "专业名称")
|
||||
private java.lang.String majorName;
|
||||
/**专业代码*/
|
||||
@ApiModelProperty(value = "专业代码")
|
||||
@Excel(name = "专业代码")
|
||||
private java.lang.String majorCode;
|
||||
@Excel(name = "选考(学科)建议")
|
||||
private String subjectAdvice;
|
||||
@Excel(name = "第一印象")
|
||||
private String firstImpression;
|
||||
@Excel(name = "性别比例")
|
||||
private String sexRatio;
|
||||
@Excel(name = "就业率")
|
||||
private String employmentRate;
|
||||
@Excel(name = "是什么")
|
||||
private String ssm;
|
||||
@Excel(name = "学什么")
|
||||
private String xsm;
|
||||
@Excel(name = "干什么")
|
||||
private String gsm;
|
||||
@Excel(name = "就业去向")
|
||||
private String employmentDestination;
|
||||
@Excel(name = "就业地区分布")
|
||||
private String regionDistribution;
|
||||
@Excel(name = "就业行业分布")
|
||||
private String industryDistribution;
|
||||
@Excel(name = "就业岗位分布")
|
||||
private String jobDistribution;
|
||||
|
||||
}
|
||||
|
|
@ -107,22 +107,39 @@ public class YxMajor implements Serializable {
|
|||
/**是否是职教*/
|
||||
@ApiModelProperty(value = "是否是职教(1-是,0-否)")
|
||||
private Integer isVte;
|
||||
public static void main(String[] args) {
|
||||
String ss="军事\n" +
|
||||
"综合\n" +
|
||||
"师范\n" +
|
||||
"理工\n" +
|
||||
"其他\n" +
|
||||
"农林\n" +
|
||||
"医药\n" +
|
||||
"语言\n" +
|
||||
"财经\n" +
|
||||
"政法\n" +
|
||||
"体育\n" +
|
||||
"艺术\n" +
|
||||
"民族";
|
||||
for (String s : ss.split("\n")) {
|
||||
System.out.println("{name:\""+s+"\",code:\""+s+"\"},");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**选考(学科)建议*/
|
||||
@ApiModelProperty(value = "选考(学科)建议")
|
||||
private String subjectAdvice;
|
||||
/**第一印象*/
|
||||
@ApiModelProperty(value = "第一印象")
|
||||
private String firstImpression;
|
||||
/**性别比例*/
|
||||
@ApiModelProperty(value = "性别比例")
|
||||
private String sexRatio;
|
||||
/**就业率*/
|
||||
@ApiModelProperty(value = "就业率")
|
||||
private String employmentRate;
|
||||
/**是什么*/
|
||||
@ApiModelProperty(value = "是什么")
|
||||
private String ssm;
|
||||
/**学什么*/
|
||||
@ApiModelProperty(value = "学什么")
|
||||
private String xsm;
|
||||
/**干什么*/
|
||||
@ApiModelProperty(value = "干什么")
|
||||
private String gsm;
|
||||
/**就业去向*/
|
||||
@ApiModelProperty(value = "就业去向")
|
||||
private String employmentDestination;
|
||||
/**就业地区分布*/
|
||||
@ApiModelProperty(value = "就业地区分布")
|
||||
private String regionDistribution;
|
||||
/**就业行业分布*/
|
||||
@ApiModelProperty(value = "就业行业分布")
|
||||
private String industryDistribution;
|
||||
/**就业岗位分布*/
|
||||
@ApiModelProperty(value = "就业岗位分布")
|
||||
private String jobDistribution;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,4 +106,9 @@ public class YxSchoolMajor implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value = "专业类型")
|
||||
private String majorType;
|
||||
/**
|
||||
* 计划招生人数
|
||||
*/
|
||||
@ApiModelProperty(value = "计划招生人数")
|
||||
private Integer planNum;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
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-02-16
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("yx_score_segment")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="yx_score_segment对象", description="分数段位表")
|
||||
public class YxScoreSegment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
/**创建人*/
|
||||
@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;
|
||||
/**分数*/
|
||||
@Excel(name = "分数", width = 15)
|
||||
@ApiModelProperty(value = "分数")
|
||||
private java.math.BigDecimal score;
|
||||
/**省份*/
|
||||
@Excel(name = "省份", width = 15)
|
||||
@ApiModelProperty(value = "省份")
|
||||
private java.lang.String province;
|
||||
/**专业类别*/
|
||||
@Excel(name = "专业类别", width = 15)
|
||||
@ApiModelProperty(value = "专业类别")
|
||||
private java.lang.String professionalCategory;
|
||||
/**年份*/
|
||||
@Excel(name = "年份", width = 15)
|
||||
@ApiModelProperty(value = "年份")
|
||||
private java.lang.String year;
|
||||
/**累计人数*/
|
||||
@Excel(name = "累计人数", width = 15)
|
||||
@ApiModelProperty(value = "累计人数")
|
||||
private java.lang.Integer personNum;
|
||||
}
|
||||
|
|
@ -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.YxScoreSegment;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 分数段位表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-02-16
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface YxScoreSegmentMapper extends BaseMapper<YxScoreSegment> {
|
||||
|
||||
}
|
||||
|
|
@ -11,12 +11,12 @@
|
|||
s.school_nature as propertyName,
|
||||
s.institution_type as institutionType,
|
||||
s.school_icon as schoolIcon,
|
||||
sm.major_name,
|
||||
sm.detail as majorDetail,
|
||||
m.major_desc as majorRemarks,
|
||||
m.semester as studyYear,
|
||||
m.first_level_discipline as firstLevelDiscipline,
|
||||
|
||||
sm.major_name,
|
||||
sm.detail as majorDetail,
|
||||
sm.school_code,
|
||||
sm.batch as batch,
|
||||
sm.enrollment_code as enrollmentCode,
|
||||
|
|
@ -29,7 +29,8 @@
|
|||
sm.batch as batch,
|
||||
sm.enrollment_code as enrollmentCode,
|
||||
sm.major_code,
|
||||
sm.tuition as studyCost
|
||||
sm.tuition as studyCost,
|
||||
sm.plan_num as planNum
|
||||
FROM yx_school_major sm
|
||||
LEFT JOIN yx_major m ON m.major_code = sm.major_code
|
||||
LEFT JOIN yx_school s ON s.school_code = sm.school_code
|
||||
|
|
@ -101,6 +102,10 @@
|
|||
<if test="queryvo.institutionType!=null and queryvo.institutionType!=''">
|
||||
AND s.institution_type= #{queryvo.institutionType}
|
||||
</if>
|
||||
/*办学性质*/
|
||||
<if test="queryvo.schoolNature!=null and queryvo.schoolNature!=''">
|
||||
AND s.school_nature= #{queryvo.schoolNature}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="recommendMajorPage" resultType="org.jeecg.modules.art.dto.RecommendMajorDTO">
|
||||
|
|
|
|||
|
|
@ -24,9 +24,21 @@
|
|||
<if test="qvo.schoolName!=null and qvo.schoolName!=''">
|
||||
AND school_name like concat('%',#{qvo.schoolName},'%')
|
||||
</if>
|
||||
<if test="qvo.province!=null and qvo.province!=''">
|
||||
AND province like concat('%',#{qvo.province},'%')
|
||||
</if>
|
||||
<if test="qvo.institutionType!=null and qvo.institutionType!=''">
|
||||
AND institution_type = #{qvo.institutionType}
|
||||
</if>
|
||||
<if test="qvo.schoolNature!=null and qvo.schoolNature!=''">
|
||||
AND school_nature = #{qvo.schoolNature}
|
||||
</if>
|
||||
<if test="qvo.schoolNatureList!=null and qvo.schoolNatureList.size>0">
|
||||
AND school_nature in
|
||||
<foreach collection="qvo.schoolNatureList" index="index" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="qvo.schoolType!=null and qvo.schoolType!=''">
|
||||
<choose>
|
||||
<when test="qvo.schoolType=='普通本科'">
|
||||
|
|
@ -86,6 +98,9 @@
|
|||
FROM yx_school s
|
||||
LEFT JOIN (select major_code,school_code from yx_school_major group by major_code,school_code) sm ON sm.school_code = s.school_code
|
||||
where 1=1
|
||||
<if test="qvo.schoolName!=null and qvo.schoolName!=''">
|
||||
AND s.school_name like concat('%',#{qvo.schoolName},'%')
|
||||
</if>
|
||||
<if test="qvo.majorCode!=null and qvo.majorCode!=''">
|
||||
AND sm.major_code = #{qvo.majorCode}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -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.YxScoreSegmentMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -54,21 +54,22 @@
|
|||
s.school_nature as propertyName,
|
||||
s.institution_type as institutionType,
|
||||
sm.school_code,
|
||||
sm.major_code,
|
||||
sm.major_name,
|
||||
sm.batch as batch,
|
||||
sm.category as category,
|
||||
sm.enrollment_code as enrollmentCode,
|
||||
sm.rules_enroll_probability as rulesEnrollProbability,
|
||||
sm.probability_operator as probabilityOperator,
|
||||
sm.cultural_control_line as culturalControlLine,
|
||||
sm.special_control_line as specialControlLine,
|
||||
sm.major_code,
|
||||
sm.detail as majorDetail,
|
||||
sm.tuition as studyCost,
|
||||
m.first_level_discipline as firstLevelDiscipline,
|
||||
m.major_name,
|
||||
m.major_desc as majorRemarks,
|
||||
m.semester as studyYear
|
||||
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
|
||||
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 s ON s.school_code = sm.school_code
|
||||
WHERE vr.volunteer_id = #{volunteerId}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package org.jeecg.modules.yx.service;
|
||||
|
||||
import org.jeecg.modules.art.dto.ArtMiniMajorDTO;
|
||||
import org.jeecg.modules.art.vo.QueryRecommendMajorVO;
|
||||
import org.jeecg.modules.yx.entity.YxMajor;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 专业信息表
|
||||
* @Author: jeecg-boot
|
||||
|
|
@ -13,4 +17,5 @@ public interface IYxMajorService extends IService<YxMajor> {
|
|||
|
||||
YxMajor findByMajorCode(String majorCode);
|
||||
|
||||
List<ArtMiniMajorDTO> miniMajorList(QueryRecommendMajorVO queryRecommendMajorVO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,4 +46,12 @@ public interface IYxSchoolMajorService extends IService<YxSchoolMajor> {
|
|||
*/
|
||||
IPage<YxSchoolMajorDTO> dtoPage(Page<YxSchoolMajorDTO> page, YxSchoolMajor yxSchoolMajor);
|
||||
|
||||
/**
|
||||
* 根据majorCode获取列表数据
|
||||
*/
|
||||
List<YxSchoolMajor> listByMajorCodeList(List<String> majorCodeList);
|
||||
/**
|
||||
* 根据majorCode获取列表数据
|
||||
*/
|
||||
List<YxSchoolMajor> listByMajorCode(String majorCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package org.jeecg.modules.yx.service;
|
||||
|
||||
import org.jeecg.modules.yx.entity.YxScoreSegment;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 分数段位表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-02-16
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IYxScoreSegmentService extends IService<YxScoreSegment> {
|
||||
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
|
|||
/**
|
||||
* 填报 志愿单
|
||||
*/
|
||||
boolean artVolunteerSave(SaveVolunteerVO saveVolunteerVO);
|
||||
String artVolunteerSave(SaveVolunteerVO saveVolunteerVO);
|
||||
|
||||
/**
|
||||
* 获取志愿信息及分数信息
|
||||
|
|
@ -42,4 +42,6 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
|
|||
* 根据志愿id 获取志愿详情
|
||||
*/
|
||||
VolunteerDTO artVolunteerDTO(String volunteerId);
|
||||
|
||||
YxVolunteer addNew();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,16 +2,27 @@ package org.jeecg.modules.yx.service.impl;
|
|||
|
||||
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.modules.art.dto.ArtMiniMajorDTO;
|
||||
import org.jeecg.modules.art.dto.MiniMajorDTO;
|
||||
import org.jeecg.modules.art.vo.QueryRecommendMajorVO;
|
||||
import org.jeecg.modules.yx.entity.YxFirstLevelDisciplines;
|
||||
import org.jeecg.modules.yx.entity.YxMajor;
|
||||
import org.jeecg.modules.yx.entity.YxSchoolMajor;
|
||||
import org.jeecg.modules.yx.mapper.YxMajorMapper;
|
||||
import org.jeecg.modules.yx.service.IYxFirstLevelDisciplinesService;
|
||||
import org.jeecg.modules.yx.service.IYxMajorService;
|
||||
import org.jeecg.modules.yx.service.IYxSchoolMajorService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 专业信息表
|
||||
|
|
@ -21,7 +32,10 @@ import java.util.Map;
|
|||
*/
|
||||
@Service
|
||||
public class YxMajorServiceImpl extends ServiceImpl<YxMajorMapper, YxMajor> implements IYxMajorService {
|
||||
|
||||
@Resource
|
||||
private IYxFirstLevelDisciplinesService yxFirstLevelDisciplinesService;
|
||||
@Resource
|
||||
private IYxSchoolMajorService yxSchoolMajorService;
|
||||
@Override
|
||||
public YxMajor findByMajorCode(String majorCode) {
|
||||
YxMajor yxMajor = new YxMajor();
|
||||
|
|
@ -30,4 +44,53 @@ public class YxMajorServiceImpl extends ServiceImpl<YxMajorMapper, YxMajor> impl
|
|||
YxMajor one = getOne(queryWrapper);
|
||||
return one;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArtMiniMajorDTO> miniMajorList(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
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.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());
|
||||
//有数据,根据一级学科分类id获取学科分类
|
||||
Set<String> firstLevelDisciplineList = yxMajorList.stream().map(YxMajor::getFirstLevelDiscipline).collect(Collectors.toSet());
|
||||
|
||||
//获取 专业与院校关联数据
|
||||
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<YxFirstLevelDisciplines> yxFirstLevelDisciplinesList = yxFirstLevelDisciplinesService.listByIds(firstLevelDisciplineList);
|
||||
//组合成返回对象
|
||||
Map<String, String> firstLevelDisciplinesNameMaps = yxFirstLevelDisciplinesList.stream().collect(Collectors.toMap(YxFirstLevelDisciplines::getId, YxFirstLevelDisciplines::getDisciplinesName));
|
||||
String firstLevelDisciplinesName=null;
|
||||
List<MiniMajorDTO> majorList2=null;
|
||||
ArtMiniMajorDTO nextArtMiniMajorDto=null;
|
||||
for (String firstLevelDisciplines : firstLevelDisciplinesNameMaps.keySet()) {
|
||||
firstLevelDisciplinesName = firstLevelDisciplinesNameMaps.get(firstLevelDisciplines);
|
||||
majorList2 = miniMajorDtoList.stream().filter(y -> y.getFirstLevelDiscipline().equals(firstLevelDisciplines)).collect(Collectors.toList());
|
||||
nextArtMiniMajorDto = new ArtMiniMajorDTO(firstLevelDisciplinesName,majorList2);
|
||||
resultList.add(nextArtMiniMajorDto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,19 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
IYxUserScoreService yxUserScoreService;
|
||||
|
||||
|
||||
|
||||
static BigDecimal bigDecimal0 = new BigDecimal(0);
|
||||
//100倍率
|
||||
static BigDecimal bigDecimal100 = new BigDecimal(100);
|
||||
static BigDecimal bigDecimal100 = new BigDecimal("100");
|
||||
|
||||
static BigDecimal bigDecimal150 = new BigDecimal("150");
|
||||
|
||||
static BigDecimal bigDecimal200 = new BigDecimal("200");
|
||||
|
||||
static BigDecimal bigDecimal95x = new BigDecimal("95");
|
||||
|
||||
static BigDecimal bigDecimal85x = new BigDecimal("85");
|
||||
|
||||
static BigDecimal bigDecimal80x = new BigDecimal("80");
|
||||
|
||||
static BigDecimal bigDecimal075 = new BigDecimal("0.75");
|
||||
|
||||
|
|
@ -71,6 +80,7 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
|
||||
@Override
|
||||
public List<RecommendMajorDTO> recommendMajorList(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
List<String> historyYearList = Arrays.asList("2022", "2021", "2020");
|
||||
//如果没有算出录取批次,则返回空数据
|
||||
if (StringUtils.isBlank(queryRecommendMajorVO.getBatch()) && CollectionUtils.isEmpty(queryRecommendMajorVO.getBatchList())) {
|
||||
return new ArrayList<>();
|
||||
|
|
@ -98,52 +108,41 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
List<YxHistoryMajorEnroll> historyMajorEnrollList = null;
|
||||
//获取历年的招生计划
|
||||
LambdaQueryWrapper<YxHistoryMajorEnroll> hmeWrapper = new LambdaQueryWrapper<>();
|
||||
List<String> majorNameList = recommendMajorDTOS.stream().map(RecommendMajorDTO::getMajorName).collect(Collectors.toList());
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getYear,"2022","2021","2020");
|
||||
hmeWrapper.eq(YxHistoryMajorEnroll::getCategory,queryRecommendMajorVO.getCognitioPolyclinic());//文科/理科
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getMajorName,majorNameList);
|
||||
Set<String> majorNameList = recommendMajorDTOS.stream().map(RecommendMajorDTO::getMajorName).collect(Collectors.toSet());
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getYear, "2022", "2021", "2020");
|
||||
hmeWrapper.eq(YxHistoryMajorEnroll::getCategory, queryRecommendMajorVO.getCognitioPolyclinic());//文科/理科
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getMajorName, majorNameList);
|
||||
hmeWrapper.orderByDesc(YxHistoryMajorEnroll::getYear);
|
||||
List<YxHistoryMajorEnroll> yxHistoryMajorEnrollList = yxHistoryMajorEnrollService.list(hmeWrapper);
|
||||
|
||||
String schoolCode;
|
||||
String majorCode;
|
||||
String majorName;
|
||||
String sm;
|
||||
String a_="_";
|
||||
String a_ = "_";
|
||||
String key = null;
|
||||
//将历年计划 组合成map对象
|
||||
Map<String,YxHistoryMajorEnroll> majorEnrollMap = new LinkedHashMap<>();
|
||||
Map<String, YxHistoryMajorEnroll> majorEnrollMap = new LinkedHashMap<>();
|
||||
for (YxHistoryMajorEnroll h : yxHistoryMajorEnrollList) {
|
||||
majorEnrollMap.put(h.getSchoolCode() + a_ + h.getMajorName() + a_ + h.getYear(),h);
|
||||
key = h.getYear() + a_ + h.getSchoolCode() + a_ + h.getMajorName() + a_ + h.getCategory() + a_ + h.getBatch();
|
||||
majorEnrollMap.put(key, h);
|
||||
}
|
||||
//遍历,获取历年数据 添加到专业 的历年信息中
|
||||
Map<String,YxHistoryMajorEnroll> yearMajorEnrollMap;
|
||||
Map<String, YxHistoryMajorEnroll> yearMajorEnrollMap;
|
||||
YxHistoryMajorEnroll yxHistoryMajorEnroll;
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorDTOS) {
|
||||
historyMajorEnrollList = new ArrayList<>();
|
||||
schoolCode = recommendMajorDTO.getSchoolCode();
|
||||
majorName = recommendMajorDTO.getMajorName();
|
||||
yearMajorEnrollMap = new LinkedHashMap<>();
|
||||
sm = schoolCode+a_+majorName;
|
||||
//2022年
|
||||
yxHistoryMajorEnroll = majorEnrollMap.get(sm + a_ + "2022");
|
||||
if (yxHistoryMajorEnroll != null) {
|
||||
yearMajorEnrollMap.put(yxHistoryMajorEnroll.getYear(),yxHistoryMajorEnroll);
|
||||
historyMajorEnrollList.add(yxHistoryMajorEnroll);
|
||||
for (String year : historyYearList) {
|
||||
key = recommendMajorDTO.getSchoolCode() + a_ + recommendMajorDTO.getMajorName() + a_ + recommendMajorDTO.getCategory() + a_ + recommendMajorDTO.getBatch();
|
||||
yxHistoryMajorEnroll = majorEnrollMap.get(year + a_ + key);
|
||||
if (yxHistoryMajorEnroll != null) {
|
||||
yearMajorEnrollMap.put(yxHistoryMajorEnroll.getYear(), yxHistoryMajorEnroll);
|
||||
historyMajorEnrollList.add(yxHistoryMajorEnroll);
|
||||
}
|
||||
}
|
||||
//2021年
|
||||
yxHistoryMajorEnroll = majorEnrollMap.get(sm + a_ + "2021");
|
||||
if (yxHistoryMajorEnroll != null) {
|
||||
yearMajorEnrollMap.put(yxHistoryMajorEnroll.getYear(),yxHistoryMajorEnroll);
|
||||
historyMajorEnrollList.add(yxHistoryMajorEnroll);
|
||||
}
|
||||
|
||||
//2020年
|
||||
yxHistoryMajorEnroll = majorEnrollMap.get(sm + a_ + "2020");
|
||||
if (yxHistoryMajorEnroll != null) {
|
||||
yearMajorEnrollMap.put(yxHistoryMajorEnroll.getYear(),yxHistoryMajorEnroll);
|
||||
historyMajorEnrollList.add(yxHistoryMajorEnroll);
|
||||
}
|
||||
|
||||
recommendMajorDTO.setHistoryMajorEnrollMap(yearMajorEnrollMap);
|
||||
recommendMajorDTO.setHistoryMajorEnrollList(historyMajorEnrollList);
|
||||
}
|
||||
|
|
@ -163,15 +162,15 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
queryRecommendMajorVO.setCognitioPolyclinic(cognitioPolyclinic);
|
||||
List<RecommendMajorDTO> recommendMajorList = recommendMajorList(queryRecommendMajorVO);
|
||||
//计算录取概率
|
||||
recommendMajorListSetEnrollProbability(recommendMajorList,activeCurrentUserScore);
|
||||
return new ArtRecommendMajorBaseDTO(recommendMajorList,false);
|
||||
recommendMajorListSetEnrollProbability(recommendMajorList, activeCurrentUserScore);
|
||||
return new ArtRecommendMajorBaseDTO(recommendMajorList, false);
|
||||
}
|
||||
|
||||
public static List<String> checkBatch(String batch){
|
||||
public static List<String> checkBatch(String batch) {
|
||||
if ("本科A段".equals(batch)) {
|
||||
return Arrays.asList("提前批","本科A段","本科B段","高职高专");
|
||||
}else if ("本科B段".equals(batch)) {
|
||||
return Arrays.asList("提前批","本科A段","本科B段","高职高专");
|
||||
return Arrays.asList("提前批", "本科A段", "本科B段", "高职高专");
|
||||
} else if ("本科B段".equals(batch)) {
|
||||
return Arrays.asList("提前批", "本科A段", "本科B段", "高职高专");
|
||||
}
|
||||
return Collections.singletonList("高职高专");
|
||||
}
|
||||
|
|
@ -189,7 +188,7 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
YxUserScore activeCurrentUserScore = null;
|
||||
if (StringUtils.isNotBlank(queryRecommendMajorVO.getScoreId())) {
|
||||
activeCurrentUserScore = yxUserScoreService.findById(queryRecommendMajorVO.getScoreId());
|
||||
}else{
|
||||
} else {
|
||||
activeCurrentUserScore = yxUserScoreService.getActiveCurrentUserScore();
|
||||
}
|
||||
|
||||
|
|
@ -199,27 +198,27 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
queryRecommendMajorVO.setCognitioPolyclinic(cognitioPolyclinic);
|
||||
List<RecommendMajorDTO> recommendMajorList = this.recommendMajorList(queryRecommendMajorVO);
|
||||
//记录总数
|
||||
Integer kcj=0;//可冲击
|
||||
Integer jwt=0;//较稳妥
|
||||
Integer kbd=0;//可保底
|
||||
Integer nan=0;//难
|
||||
Integer number=0;//全部
|
||||
Integer kcj = 0;//可冲击
|
||||
Integer jwt = 0;//较稳妥
|
||||
Integer kbd = 0;//可保底
|
||||
Integer nan = 0;//难
|
||||
Integer number = 0;//全部
|
||||
String paneName = queryRecommendMajorVO.getPaneName();
|
||||
//计算录取概率
|
||||
recommendMajorListSetEnrollProbability(recommendMajorList,activeCurrentUserScore);
|
||||
recommendMajorListSetEnrollProbability(recommendMajorList, activeCurrentUserScore);
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorList) {
|
||||
number++;
|
||||
double enrollProbabilityDouble = recommendMajorDTO.getEnrollProbability().doubleValue();
|
||||
//保底
|
||||
if (enrollProbabilityDouble>=80) {
|
||||
if (enrollProbabilityDouble >= 93) {
|
||||
kbd++;
|
||||
}else if(enrollProbabilityDouble<80 && enrollProbabilityDouble>=50){
|
||||
} else if (enrollProbabilityDouble < 92 && enrollProbabilityDouble >= 74) {
|
||||
//较稳妥
|
||||
jwt++;
|
||||
}else if(enrollProbabilityDouble<50 && enrollProbabilityDouble>=20){
|
||||
} else if (enrollProbabilityDouble < 73 && enrollProbabilityDouble >= 60) {
|
||||
//可冲击
|
||||
kcj++;
|
||||
}else{
|
||||
} else {
|
||||
//难
|
||||
nan++;
|
||||
}
|
||||
|
|
@ -228,22 +227,27 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
|
||||
|
||||
//判断 paneName
|
||||
if(StringUtils.isNotBlank(paneName) && !paneName.equals("全部")){
|
||||
if (StringUtils.isNotBlank(paneName) && !paneName.equals("全部")) {
|
||||
BigDecimal bigDecimal80 = new BigDecimal("80");
|
||||
BigDecimal bigDecimal50 = new BigDecimal("50");
|
||||
BigDecimal bigDecimal30 = new BigDecimal("30");
|
||||
switch (paneName){
|
||||
BigDecimal bigDecimal93 = new BigDecimal("93");
|
||||
BigDecimal bigDecimal92 = new BigDecimal("92");
|
||||
BigDecimal bigDecimal74 = new BigDecimal("74");
|
||||
BigDecimal bigDecimal73 = new BigDecimal("73");
|
||||
BigDecimal bigDecimal60 = new BigDecimal("60");
|
||||
switch (paneName) {
|
||||
case "可保底":
|
||||
recommendMajorList = recommendMajorList.stream().filter(r->r.getEnrollProbability().compareTo(bigDecimal80)>=0).collect(Collectors.toList());
|
||||
recommendMajorList = recommendMajorList.stream().filter(r -> r.getEnrollProbability().compareTo(bigDecimal93) >= 0).collect(Collectors.toList());
|
||||
break;
|
||||
case "较稳妥":
|
||||
recommendMajorList = recommendMajorList.stream().filter(r->r.getEnrollProbability().compareTo(bigDecimal80)<0 && r.getEnrollProbability().compareTo(bigDecimal50)>=0).collect(Collectors.toList());
|
||||
recommendMajorList = recommendMajorList.stream().filter(r -> r.getEnrollProbability().compareTo(bigDecimal92) < 0 && r.getEnrollProbability().compareTo(bigDecimal74) >= 0).collect(Collectors.toList());
|
||||
break;
|
||||
case "可冲击":
|
||||
recommendMajorList = recommendMajorList.stream().filter(r->r.getEnrollProbability().compareTo(bigDecimal50)<0 && r.getEnrollProbability().compareTo(bigDecimal30)>=0).collect(Collectors.toList());
|
||||
recommendMajorList = recommendMajorList.stream().filter(r -> r.getEnrollProbability().compareTo(bigDecimal73) < 0 && r.getEnrollProbability().compareTo(bigDecimal60) >= 0).collect(Collectors.toList());
|
||||
break;
|
||||
case "难录取":
|
||||
recommendMajorList = recommendMajorList.stream().filter(r->r.getEnrollProbability().compareTo(bigDecimal50)<0 && r.getEnrollProbability().compareTo(bigDecimal30)<=0).collect(Collectors.toList());
|
||||
recommendMajorList = recommendMajorList.stream().filter(r -> r.getEnrollProbability().compareTo(bigDecimal60) < 0).collect(Collectors.toList());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -264,9 +268,9 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
pageList.setCurrent(pageNum);
|
||||
|
||||
//判断是不是vip,不是vip 则只显示一部分数据
|
||||
if (activeCurrentUserScore.getIsVip()==0) {
|
||||
pageList.setRecords(recommendMajorDTOList.subList(0,total<=5?total:5));
|
||||
}else{
|
||||
if (activeCurrentUserScore.getIsVip() == 0 && CollectionUtils.isNotEmpty(recommendMajorDTOList)) {
|
||||
pageList.setRecords(recommendMajorDTOList.subList(0, total <= 5 ? total : 5));
|
||||
} else {
|
||||
pageList.setRecords(recommendMajorDTOList);
|
||||
}
|
||||
artRecommendMajorBaseDTO.setPageList(pageList);
|
||||
|
|
@ -277,10 +281,26 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
|
||||
@Override
|
||||
public IPage<YxSchoolMajorDTO> dtoPage(Page<YxSchoolMajorDTO> page, YxSchoolMajor yxSchoolMajor) {
|
||||
IPage<YxSchoolMajorDTO> dtoPageList= baseMapper.dtoPage(page,yxSchoolMajor);
|
||||
IPage<YxSchoolMajorDTO> dtoPageList = baseMapper.dtoPage(page, yxSchoolMajor);
|
||||
return dtoPageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YxSchoolMajor> listByMajorCodeList(List<String> majorCodeList) {
|
||||
if (CollectionUtils.isEmpty(majorCodeList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<YxSchoolMajor>().in(YxSchoolMajor::getMajorCode, majorCodeList));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YxSchoolMajor> listByMajorCode(String majorCode) {
|
||||
if (StringUtils.isEmpty(majorCode)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<YxSchoolMajor>().eq(YxSchoolMajor::getMajorCode, majorCode));
|
||||
}
|
||||
|
||||
|
||||
//先出的省控线,然后才可以填报志愿,录取线是高考之后出的,也就是今年只能看到往年的录取线
|
||||
//分差值: 指定年份的录取线-那一年的省控线
|
||||
|
|
@ -307,11 +327,10 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 给志愿列表计算录取概率
|
||||
*/
|
||||
public static void recommendMajorListSetEnrollProbability(List<RecommendMajorDTO> recommendMajorList,YxUserScore activeCurrentUserScore) {
|
||||
public static void recommendMajorListSetEnrollProbability(List<RecommendMajorDTO> recommendMajorList, YxUserScore activeCurrentUserScore) {
|
||||
/*String cognitioPolyclinic = activeCurrentUserScore.getCognitioPolyclinic();
|
||||
String professionalCategory = activeCurrentUserScore.getProfessionalCategory();//专业类别*/
|
||||
//文化成绩
|
||||
|
|
@ -326,56 +345,69 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
BigDecimal historyThreeYearDiff = null;//三年平均差值
|
||||
BigDecimal nowYearProvincialControlLine = null;
|
||||
BigDecimal enrollProbability = null;
|
||||
BigDecimal bigDecimal99x = new BigDecimal("95");
|
||||
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorList) {
|
||||
String rulesEnrollProbability = recommendMajorDTO.getRulesEnrollProbability();
|
||||
//取出往年的分数信息, 算出 三年平均差值
|
||||
List<YxHistoryMajorEnroll> historyMajorEnrollList = recommendMajorDTO.getHistoryMajorEnrollList();
|
||||
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
|
||||
continue;
|
||||
}
|
||||
//折合分数
|
||||
if (rulesEnrollProbability != null) {
|
||||
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore,recommendMajorDTO.getFirstLevelDiscipline(),recommendMajorDTO.getProbabilityOperator());
|
||||
recommendMajorDTO.setStudentConvertedScore(studentScore);
|
||||
//文过专排/专过文排
|
||||
if ("文过专排".equals(rulesEnrollProbability)) {
|
||||
if (culturalScore.compareTo(recommendMajorDTO.getCulturalControlLine()) < 0) {
|
||||
//学生 文化分小于 专业 文化省控分
|
||||
continue;
|
||||
}
|
||||
}else if ("专过文排".equals(rulesEnrollProbability)) {
|
||||
if (professionalScore.compareTo(recommendMajorDTO.getSpecialControlLine()) < 0) {
|
||||
//学生 专业分小于 专业省控分
|
||||
continue;
|
||||
}
|
||||
int i = 0;
|
||||
try {
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorList) {
|
||||
i++;
|
||||
String rulesEnrollProbability = recommendMajorDTO.getRulesEnrollProbability();
|
||||
//取出往年的分数信息, 算出 三年平均差值
|
||||
List<YxHistoryMajorEnroll> historyMajorEnrollList = recommendMajorDTO.getHistoryMajorEnrollList();
|
||||
if (CollectionUtils.isEmpty(historyMajorEnrollList)) {
|
||||
continue;
|
||||
}
|
||||
nowYearProvincialControlLine = ScoreUtil.covertIntoControlLine(rulesEnrollProbability,recommendMajorDTO.getCulturalControlLine(),recommendMajorDTO.getSpecialControlLine(),recommendMajorDTO.getFirstLevelDiscipline(),recommendMajorDTO.getProbabilityOperator());
|
||||
}else{
|
||||
//获取今年的分差
|
||||
nowYearProvincialControlLine = recommendMajorDTO.getCulturalControlLine();
|
||||
}
|
||||
sum = ScoreUtil.computeHistoryMajorEnrollScoreLineDifferenceWithRulesEnrollProbability(rulesEnrollProbability,historyMajorEnrollList);
|
||||
//historyThreeYearDiff = sum.divide(new BigDecimal(size), 4, RoundingMode.HALF_UP);
|
||||
historyThreeYearDiff = sum;//
|
||||
if (nowYearProvincialControlLine == null) {
|
||||
continue;
|
||||
}
|
||||
BigDecimal nowYearDiff = studentScore.subtract(nowYearProvincialControlLine);
|
||||
if (historyThreeYearDiff == null || historyThreeYearDiff.doubleValue() == 0) {
|
||||
continue;
|
||||
}
|
||||
//获取录取率
|
||||
enrollProbability = nowYearDiff.divide(historyThreeYearDiff, 4, RoundingMode.HALF_UP).multiply(bigDecimal100);
|
||||
if (enrollProbability.compareTo(bigDecimal100) > 0) {
|
||||
//enrollProbability = bigDecimal99x;
|
||||
}else if(enrollProbability.compareTo(bigDecimal0)<=0){
|
||||
enrollProbability = bigDecimal0;
|
||||
}
|
||||
recommendMajorDTO.setEnrollProbability(enrollProbability.multiply(bigDecimal075));
|
||||
//折合分数
|
||||
if (rulesEnrollProbability != null) {
|
||||
if (StringUtils.isBlank(recommendMajorDTO.getProbabilityOperator())) {
|
||||
recommendMajorDTO.setEnrollProbability(bigDecimal0);
|
||||
continue;
|
||||
}
|
||||
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore, recommendMajorDTO.getFirstLevelDiscipline(), recommendMajorDTO.getProbabilityOperator());
|
||||
recommendMajorDTO.setStudentConvertedScore(studentScore);
|
||||
//文过专排/专过文排
|
||||
if ("文过专排".equals(rulesEnrollProbability)) {
|
||||
if (culturalScore.compareTo(recommendMajorDTO.getCulturalControlLine()) < 0) {
|
||||
//学生 文化分小于 专业 文化省控分
|
||||
continue;
|
||||
}
|
||||
} else if ("专过文排".equals(rulesEnrollProbability)) {
|
||||
if (professionalScore.compareTo(recommendMajorDTO.getSpecialControlLine()) < 0) {
|
||||
//学生 专业分小于 专业省控分
|
||||
continue;
|
||||
}
|
||||
}
|
||||
nowYearProvincialControlLine = ScoreUtil.covertIntoControlLine(rulesEnrollProbability, recommendMajorDTO.getCulturalControlLine(), recommendMajorDTO.getSpecialControlLine(), recommendMajorDTO.getFirstLevelDiscipline(), recommendMajorDTO.getProbabilityOperator());
|
||||
} else {
|
||||
//获取今年的分差
|
||||
nowYearProvincialControlLine = recommendMajorDTO.getCulturalControlLine();
|
||||
}
|
||||
sum = ScoreUtil.computeHistoryMajorEnrollScoreLineDifferenceWithRulesEnrollProbability(rulesEnrollProbability, historyMajorEnrollList);
|
||||
//historyThreeYearDiff = sum.divide(new BigDecimal(size), 4, RoundingMode.HALF_UP);
|
||||
historyThreeYearDiff = sum;//
|
||||
if (nowYearProvincialControlLine == null) {
|
||||
continue;
|
||||
}
|
||||
BigDecimal nowYearDiff = studentScore.subtract(nowYearProvincialControlLine);
|
||||
if (historyThreeYearDiff == null || historyThreeYearDiff.doubleValue() == 0) {
|
||||
continue;
|
||||
}
|
||||
//获取录取率
|
||||
enrollProbability = nowYearDiff.divide(historyThreeYearDiff, 4, RoundingMode.HALF_UP).multiply(bigDecimal100);
|
||||
enrollProbability =enrollProbability.multiply(bigDecimal075);
|
||||
if (enrollProbability.compareTo(bigDecimal150) > 0) {
|
||||
enrollProbability = bigDecimal95x;
|
||||
}else if (enrollProbability.compareTo(bigDecimal100) > 0) {
|
||||
enrollProbability = bigDecimal85x;
|
||||
} else if (enrollProbability.compareTo(bigDecimal0) <= 0) {
|
||||
enrollProbability = bigDecimal0;
|
||||
}
|
||||
recommendMajorDTO.setEnrollProbability(enrollProbability);
|
||||
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("错误索引:" + i);
|
||||
e.printStackTrace();
|
||||
}
|
||||
recommendMajorList.sort((a, b) -> b.getEnrollProbability().compareTo(a.getEnrollProbability()));
|
||||
}
|
||||
|
|
@ -396,7 +428,7 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
BigDecimal historyThreeYearDiff = null;//三年平均差值
|
||||
BigDecimal nowYearProvincialControlLine = null;
|
||||
BigDecimal enrollProbability = null;
|
||||
BigDecimal bigDecimal99x = new BigDecimal("95");
|
||||
BigDecimal bigDecimal95x = new BigDecimal("95");
|
||||
|
||||
for (RecommendMajorDTO recommendMajorDTO : recommendMajorList) {
|
||||
String rulesEnrollProbability = recommendMajorDTO.getRulesEnrollProbability();
|
||||
|
|
@ -407,7 +439,7 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
}
|
||||
//折合分数
|
||||
if (rulesEnrollProbability != null) {
|
||||
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore,recommendMajorDTO.getFirstLevelDiscipline(),recommendMajorDTO.getProbabilityOperator());
|
||||
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, culturalScore, professionalScore, recommendMajorDTO.getFirstLevelDiscipline(), recommendMajorDTO.getProbabilityOperator());
|
||||
recommendMajorDTO.setStudentConvertedScore(studentScore);
|
||||
//文过专排/专过文排
|
||||
if ("文过专排".equals(rulesEnrollProbability)) {
|
||||
|
|
@ -415,18 +447,18 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
//学生 文化分小于 专业 文化省控分
|
||||
continue;
|
||||
}
|
||||
}else if ("专过文排".equals(rulesEnrollProbability)) {
|
||||
} else if ("专过文排".equals(rulesEnrollProbability)) {
|
||||
if (professionalScore.compareTo(recommendMajorDTO.getSpecialControlLine()) < 0) {
|
||||
//学生 专业分小于 专业省控分
|
||||
continue;
|
||||
}
|
||||
}
|
||||
nowYearProvincialControlLine = ScoreUtil.covertIntoControlLine(rulesEnrollProbability,recommendMajorDTO.getCulturalControlLine(),recommendMajorDTO.getSpecialControlLine(),recommendMajorDTO.getFirstLevelDiscipline(),recommendMajorDTO.getProbabilityOperator());
|
||||
}else{
|
||||
nowYearProvincialControlLine = ScoreUtil.covertIntoControlLine(rulesEnrollProbability, recommendMajorDTO.getCulturalControlLine(), recommendMajorDTO.getSpecialControlLine(), recommendMajorDTO.getFirstLevelDiscipline(), recommendMajorDTO.getProbabilityOperator());
|
||||
} else {
|
||||
//获取今年的分差
|
||||
nowYearProvincialControlLine = recommendMajorDTO.getCulturalControlLine();
|
||||
}
|
||||
sum = ScoreUtil.computeHistoryMajorEnrollScoreLineDifferenceWithRulesEnrollProbability(rulesEnrollProbability,historyMajorEnrollList);
|
||||
sum = ScoreUtil.computeHistoryMajorEnrollScoreLineDifferenceWithRulesEnrollProbability(rulesEnrollProbability, historyMajorEnrollList);
|
||||
//historyThreeYearDiff = sum.divide(new BigDecimal(size), 4, RoundingMode.HALF_UP);
|
||||
historyThreeYearDiff = sum;
|
||||
if (nowYearProvincialControlLine == null) {
|
||||
|
|
@ -438,9 +470,12 @@ public class YxSchoolMajorServiceImpl extends ServiceImpl<YxSchoolMajorMapper, Y
|
|||
}
|
||||
//获取录取率
|
||||
enrollProbability = nowYearDiff.divide(historyThreeYearDiff, 4, RoundingMode.HALF_UP).multiply(bigDecimal100);
|
||||
if (enrollProbability.compareTo(bigDecimal100) > 0) {
|
||||
enrollProbability = bigDecimal99x;
|
||||
}else if(enrollProbability.compareTo(bigDecimal0)<=0){
|
||||
enrollProbability =enrollProbability.multiply(bigDecimal075);
|
||||
if (enrollProbability.compareTo(bigDecimal150) > 0) {
|
||||
enrollProbability = bigDecimal95x;
|
||||
}else if (enrollProbability.compareTo(bigDecimal100) > 0) {
|
||||
enrollProbability = bigDecimal85x;
|
||||
} else if (enrollProbability.compareTo(bigDecimal0) <= 0) {
|
||||
enrollProbability = bigDecimal0;
|
||||
}
|
||||
recommendMajorDTO.setEnrollProbability(enrollProbability);
|
||||
|
|
|
|||
|
|
@ -38,10 +38,11 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
|
|||
}else{
|
||||
dtoPage = baseMapper.search(page, queryRecommendMajorVO);
|
||||
}
|
||||
if (dtoPage != null && CollectionUtils.isNotEmpty(dtoPage.getRecords())) {
|
||||
if (CollectionUtils.isNotEmpty(dtoPage.getRecords())) {
|
||||
String tags = null;
|
||||
Set<String> tagsList;
|
||||
List<String> list985211 = Arrays.asList("211", "985");
|
||||
long startTime = new Date().getTime();
|
||||
for (ArtSchoolDTO record : dtoPage.getRecords()) {
|
||||
tagsList = new LinkedHashSet<>();
|
||||
//处理 标签,字符串转 array
|
||||
|
|
@ -61,10 +62,10 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
|
|||
|
||||
//判断 是否是 985,211
|
||||
if (record.getIs211().equals("1")) {
|
||||
tagsList.add("211工程");
|
||||
tagsList.add("211");
|
||||
}
|
||||
if (record.getIs985().equals("1")) {
|
||||
tagsList.add("985工程");
|
||||
tagsList.add("985");
|
||||
}
|
||||
if (tagsList.containsAll(list985211)) {
|
||||
tagsList.add("双一流");
|
||||
|
|
@ -72,6 +73,8 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
|
|||
|
||||
record.setTagsList(tagsList);
|
||||
}
|
||||
long endTime = new Date().getTime();
|
||||
log.warn("获取院校信息处理用时:"+(endTime-startTime)/1000+"秒");
|
||||
}
|
||||
|
||||
return dtoPage;
|
||||
|
|
@ -103,10 +106,10 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
|
|||
}
|
||||
//判断 是否是 985,211
|
||||
if (yxSchool.getIs211().equals(1)) {
|
||||
tagsList.add("211工程");
|
||||
tagsList.add("211");
|
||||
}
|
||||
if (yxSchool.getIs985().equals(1)) {
|
||||
tagsList.add("985工程");
|
||||
tagsList.add("985");
|
||||
}
|
||||
if (tagsList.containsAll(list985211)) {
|
||||
tagsList.add("双一流");
|
||||
|
|
@ -169,10 +172,10 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
|
|||
|
||||
//判断 是否是 985,211
|
||||
if (record.getIs211().equals(1)) {
|
||||
tagsList.add("211工程");
|
||||
tagsList.add("211");
|
||||
}
|
||||
if (record.getIs985().equals(1)) {
|
||||
tagsList.add("985工程");
|
||||
tagsList.add("985");
|
||||
}
|
||||
if (tagsList.containsAll(list985211)) {
|
||||
tagsList.add("双一流");
|
||||
|
|
@ -199,10 +202,10 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
|
|||
|
||||
//判断 是否是 985,211
|
||||
if (record.getIs211().equals(1)) {
|
||||
tagsList.add("211工程");
|
||||
tagsList.add("211");
|
||||
}
|
||||
if (record.getIs985().equals(1)) {
|
||||
tagsList.add("985工程");
|
||||
tagsList.add("985");
|
||||
}
|
||||
if (tagsList.containsAll(list985211)) {
|
||||
tagsList.add("双一流");
|
||||
|
|
@ -229,10 +232,10 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
|
|||
|
||||
//判断 是否是 985,211
|
||||
if (record.getIs211().equals(1)) {
|
||||
tagsList.add("211工程");
|
||||
tagsList.add("211");
|
||||
}
|
||||
if (record.getIs985().equals(1)) {
|
||||
tagsList.add("985工程");
|
||||
tagsList.add("985");
|
||||
}
|
||||
if (tagsList.containsAll(list985211)) {
|
||||
tagsList.add("双一流");
|
||||
|
|
@ -259,10 +262,10 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
|
|||
|
||||
//判断 是否是 985,211
|
||||
if (record.getIs211().equals(1)) {
|
||||
tagsList.add("211工程");
|
||||
tagsList.add("211");
|
||||
}
|
||||
if (record.getIs985().equals(1)) {
|
||||
tagsList.add("985工程");
|
||||
tagsList.add("985");
|
||||
}
|
||||
if (tagsList.containsAll(list985211)) {
|
||||
tagsList.add("双一流");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.yx.service.impl;
|
||||
|
||||
import org.jeecg.modules.yx.entity.YxScoreSegment;
|
||||
import org.jeecg.modules.yx.mapper.YxScoreSegmentMapper;
|
||||
import org.jeecg.modules.yx.service.IYxScoreSegmentService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 分数段位表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-02-16
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class YxScoreSegmentServiceImpl extends ServiceImpl<YxScoreSegmentMapper, YxScoreSegment> implements IYxScoreSegmentService {
|
||||
|
||||
}
|
||||
|
|
@ -71,5 +71,7 @@ public class YxUserScoreServiceImpl extends ServiceImpl<YxUserScoreMapper, YxUse
|
|||
yxUserScore.setEnglishScore(bigDecimalZERO);
|
||||
yxUserScore.setChineseScore(bigDecimalZERO);
|
||||
this.save(yxUserScore);
|
||||
//创建一个志愿
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.yx.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
|
@ -147,6 +148,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
|
|||
|
||||
@Override
|
||||
public VolunteerDTO findById(String id) {
|
||||
List<String> historyYearList = Arrays.asList("2022","2021","2020");
|
||||
YxVolunteer volunteer = this.getById(id);
|
||||
if (volunteer==null) {
|
||||
return null;
|
||||
|
|
@ -171,48 +173,41 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
|
|||
List<YxHistoryMajorEnroll> historyMajorEnrollList=null;
|
||||
//获取历年的招生计划
|
||||
LambdaQueryWrapper<YxHistoryMajorEnroll> hmeWrapper = new LambdaQueryWrapper<>();
|
||||
List<String> majorNameList = recordDTOList.stream().map(VolunteerRecordDTO::getMajorName).collect(Collectors.toList());
|
||||
Set<String> majorNameList = recordDTOList.stream().map(VolunteerRecordDTO::getMajorName).collect(Collectors.toSet());
|
||||
Set<String> schoolCodeList = recordDTOList.stream().map(VolunteerRecordDTO::getSchoolCode).collect(Collectors.toSet());
|
||||
if (CollectionUtils.isNotEmpty(majorNameList)) {
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getYear,"2022","2021","2020");
|
||||
hmeWrapper.eq(YxHistoryMajorEnroll::getCategory,cognitioPolyclinic);//文科/理科
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getMajorName,majorNameList);
|
||||
hmeWrapper.in(YxHistoryMajorEnroll::getSchoolCode,schoolCodeList);
|
||||
hmeWrapper.orderByDesc(YxHistoryMajorEnroll::getYear);
|
||||
List<YxHistoryMajorEnroll> yxHistoryMajorEnrollList = yxHistoryMajorEnrollService.list(hmeWrapper);
|
||||
//将历年计划 组合成map对象
|
||||
String a_="_";
|
||||
String key = null;
|
||||
Map<String,YxHistoryMajorEnroll> majorEnrollMap = new LinkedHashMap<>();
|
||||
for (YxHistoryMajorEnroll h : yxHistoryMajorEnrollList) {
|
||||
majorEnrollMap.put(h.getSchoolCode() + a_ + h.getMajorName() + a_ + h.getYear(),h);
|
||||
key = h.getYear() +a_+h.getSchoolCode() + a_ + h.getMajorName() + a_+h.getCategory() +a_ +h.getBatch();
|
||||
majorEnrollMap.put(key,h);
|
||||
}
|
||||
//遍历,获取历年数据 添加到专业 的历年信息中
|
||||
Map<String,YxHistoryMajorEnroll> yearMajorEnrollMap;
|
||||
YxHistoryMajorEnroll yxHistoryMajorEnroll;
|
||||
for (RecommendMajorDTO recommendMajorDTO : recordDTOList) {
|
||||
if (recommendMajorDTO.getSchoolName().contains("桂林学院")) {
|
||||
System.out.println("11");
|
||||
}
|
||||
historyMajorEnrollList = new ArrayList<>();
|
||||
schoolCode = recommendMajorDTO.getSchoolCode();
|
||||
majorName = recommendMajorDTO.getMajorName();
|
||||
yearMajorEnrollMap = new LinkedHashMap<>();
|
||||
sm = schoolCode+a_+majorName;
|
||||
//2022年
|
||||
yxHistoryMajorEnroll = majorEnrollMap.get(sm + a_ + "2022");
|
||||
if (yxHistoryMajorEnroll != null) {
|
||||
yearMajorEnrollMap.put(yxHistoryMajorEnroll.getYear(),yxHistoryMajorEnroll);
|
||||
historyMajorEnrollList.add(yxHistoryMajorEnroll);
|
||||
key = recommendMajorDTO.getSchoolCode() + a_ + recommendMajorDTO.getMajorName() + a_+recommendMajorDTO.getCategory() +a_ +recommendMajorDTO.getBatch();
|
||||
//2022~2020年
|
||||
for (String year : historyYearList) {
|
||||
yxHistoryMajorEnroll = majorEnrollMap.get(year+a_+key);
|
||||
if (yxHistoryMajorEnroll != null) {
|
||||
yearMajorEnrollMap.put(yxHistoryMajorEnroll.getYear(),yxHistoryMajorEnroll);
|
||||
historyMajorEnrollList.add(yxHistoryMajorEnroll);
|
||||
}
|
||||
}
|
||||
//2021年
|
||||
yxHistoryMajorEnroll = majorEnrollMap.get(sm + a_ + "2021");
|
||||
if (yxHistoryMajorEnroll != null) {
|
||||
yearMajorEnrollMap.put(yxHistoryMajorEnroll.getYear(),yxHistoryMajorEnroll);
|
||||
historyMajorEnrollList.add(yxHistoryMajorEnroll);
|
||||
}
|
||||
|
||||
//2020年
|
||||
yxHistoryMajorEnroll = majorEnrollMap.get(sm + a_ + "2020");
|
||||
if (yxHistoryMajorEnroll != null) {
|
||||
yearMajorEnrollMap.put(yxHistoryMajorEnroll.getYear(),yxHistoryMajorEnroll);
|
||||
historyMajorEnrollList.add(yxHistoryMajorEnroll);
|
||||
}
|
||||
|
||||
recommendMajorDTO.setHistoryMajorEnrollMap(yearMajorEnrollMap);
|
||||
recommendMajorDTO.setHistoryMajorEnrollList(historyMajorEnrollList);
|
||||
}
|
||||
|
|
@ -239,7 +234,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean artVolunteerSave(SaveVolunteerVO saveVolunteerVO) {
|
||||
public String artVolunteerSave(SaveVolunteerVO saveVolunteerVO) {
|
||||
String createBy = saveVolunteerVO.getCreateBy();
|
||||
VolunteerDTO volunteerDTO = null;
|
||||
YxUserScore userScore = null;
|
||||
|
|
@ -247,7 +242,8 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
|
|||
// 如果传了一个 volunteerId
|
||||
volunteerDTO = findById(saveVolunteerVO.getVolunteerId());
|
||||
userScore = volunteerDTO.getUserScoreInfo();
|
||||
}else{
|
||||
}
|
||||
else{
|
||||
//没传
|
||||
volunteerDTO = getActiveByCreate(createBy);
|
||||
if (volunteerDTO!=null && StringUtils.isNotBlank(volunteerDTO.getId())) {
|
||||
|
|
@ -270,7 +266,37 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
|
|||
}
|
||||
}
|
||||
saveVolunteerVO.setCategory(userScore.getCognitioPolyclinic());//文理分科
|
||||
return yxVolunteerRecordService.artVolunteerSave(saveVolunteerVO);
|
||||
yxVolunteerRecordService.artVolunteerSave(saveVolunteerVO);
|
||||
//更新 志愿顺序
|
||||
if (volunteerDTO!=null && StringUtils.isNotBlank(volunteerDTO.getId())) {
|
||||
LambdaQueryWrapper<YxVolunteerRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId, volunteerDTO.getId());
|
||||
lambdaQueryWrapper.orderByAsc(YxVolunteerRecord::getCreateTime);
|
||||
List<YxVolunteerRecord> volunteerRecordList = yxVolunteerRecordService.list(lambdaQueryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(volunteerRecordList)) {
|
||||
int tiqian=0,bena=0,benb=0,ben=0,zhuan=0;
|
||||
for (YxVolunteerRecord yxVolunteerRecord : volunteerRecordList) {
|
||||
if ("提前批".equals(yxVolunteerRecord.getBatch())) {
|
||||
tiqian++;
|
||||
yxVolunteerRecord.setIndexs(tiqian);
|
||||
}else if ("本科A段".equals(yxVolunteerRecord.getBatch())) {
|
||||
bena++;
|
||||
yxVolunteerRecord.setIndexs(bena);
|
||||
}else if ("本科B段".equals(yxVolunteerRecord.getBatch())) {
|
||||
benb++;
|
||||
yxVolunteerRecord.setIndexs(benb);
|
||||
}else if ("本科".equals(yxVolunteerRecord.getBatch())) {
|
||||
ben++;
|
||||
yxVolunteerRecord.setIndexs(ben);
|
||||
}else if ("高职高专".equals(yxVolunteerRecord.getBatch())) {
|
||||
zhuan++;
|
||||
yxVolunteerRecord.setIndexs(zhuan);
|
||||
}
|
||||
}
|
||||
yxVolunteerRecordService.updateBatchById(volunteerRecordList);
|
||||
}
|
||||
}
|
||||
return saveVolunteerVO.getVolunteerId();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -317,4 +343,31 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
|
|||
public VolunteerDTO artVolunteerDTO(String volunteerId) {
|
||||
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.创建新的志愿单
|
||||
YxVolunteer yxVolunteer = new YxVolunteer();
|
||||
if (StringUtils.isNotBlank(activeCurrentUserScore.getCreateBy())) {
|
||||
yxVolunteer.setCreateBy(activeCurrentUserScore.getCreateBy());
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@ public class ScoreUtil {
|
|||
yearNum++;
|
||||
}
|
||||
}
|
||||
if (yearNum==0) {
|
||||
System.out.println("111");
|
||||
}
|
||||
return sum.divide(new BigDecimal(yearNum),4,RoundingMode.HALF_UP);
|
||||
/*if (wenFlag) {
|
||||
//文科生
|
||||
|
|
|
|||
Loading…
Reference in New Issue