updates
This commit is contained in:
parent
45f3157477
commit
8ab52ce68c
|
|
@ -79,6 +79,7 @@ public class ShiroConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filterChainDefinitionMap.put("/api/static/data/**","anon");
|
||||||
filterChainDefinitionMap.put("/web/user/login/**","anon");//前台页面登录
|
filterChainDefinitionMap.put("/web/user/login/**","anon");//前台页面登录
|
||||||
filterChainDefinitionMap.put("/web/user/getQRStatus/**","anon");//前台查询redis中当前小程序码的状态
|
filterChainDefinitionMap.put("/web/user/getQRStatus/**","anon");//前台查询redis中当前小程序码的状态
|
||||||
filterChainDefinitionMap.put("/wx/getQRCode/**","anon");//前台获取微信登录码
|
filterChainDefinitionMap.put("/wx/getQRCode/**","anon");//前台获取微信登录码
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
package org.jeecg.modules.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ZhouWenTao
|
||||||
|
* @create 2024-06-24-20:23
|
||||||
|
*/
|
||||||
|
@Api(tags = "静态参数接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/static/data")
|
||||||
|
@Slf4j
|
||||||
|
public class StaticDataController {
|
||||||
|
@RequestMapping(value = "/getJson",method = RequestMethod.POST)
|
||||||
|
public Result<?> getJson(@RequestBody JSONObject params, HttpServletRequest request){
|
||||||
|
String key = params.getStr("key");
|
||||||
|
if (StringUtils.isNotBlank(key)) {
|
||||||
|
JSONObject responseData = new JSONObject();
|
||||||
|
switch (key){
|
||||||
|
case "reload_major_modal_message":
|
||||||
|
responseData.set("message1","刷新专业是用来获取最新的专业录取规则,刷新后已填报志愿单将移除,需要手动再次添加。");
|
||||||
|
responseData.set("message2","可刷新专业来获取最新的专业录取规则");
|
||||||
|
// 刷新专业提示
|
||||||
|
return Result.OK(responseData);
|
||||||
|
case "volunteer_preview":
|
||||||
|
// 查看志愿单按钮
|
||||||
|
// 查看方式 1.跳转浏览器下载,2.web-view预览
|
||||||
|
responseData.set("type","1");
|
||||||
|
//附件地址
|
||||||
|
responseData.set("filePrefixUrl","https://www.yitisheng.vip/volunteer/preview");
|
||||||
|
responseData.set("webViewUrl","/");
|
||||||
|
responseData.set("message","目前不支持小程序打印。已自动复制网址,请在手机浏览器里粘贴该网址进行打印。");
|
||||||
|
return Result.OK(responseData);
|
||||||
|
|
||||||
|
}
|
||||||
|
if ("reloadMajorModalMessage".equals(key)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.OK();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -147,14 +147,14 @@ public class RecommendMajorDTO implements Serializable {
|
||||||
private String xkfl;
|
private String xkfl;
|
||||||
@ApiModelProperty(value = "专业类")
|
@ApiModelProperty(value = "专业类")
|
||||||
private String zyl;
|
private String zyl;
|
||||||
|
|
||||||
@ApiModelProperty(value = "内部折合分数")
|
@ApiModelProperty(value = "内部折合分数")
|
||||||
private BigDecimal privateStudentScore;
|
private BigDecimal privateStudentScore;
|
||||||
@ApiModelProperty(value = "内部录取方式")
|
@ApiModelProperty(value = "内部录取方式")
|
||||||
private String privateRulesEnrollProbability;
|
private String privateRulesEnrollProbability;
|
||||||
@ApiModelProperty(value = "内部录取方式运算符")
|
@ApiModelProperty(value = "内部录取方式运算符")
|
||||||
private String privateProbabilityOperator;
|
private String privateProbabilityOperator;
|
||||||
|
|
||||||
@ApiModelProperty(value = "线差")
|
@ApiModelProperty(value = "线差")
|
||||||
private BigDecimal scoreLineDifference;
|
private BigDecimal scoreLineDifference;
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private String state;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.yx.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -13,6 +14,7 @@ import org.jeecg.common.util.AssertUtils;
|
||||||
import org.jeecg.modules.web.dto.ArtRecommendMajorBaseDTO;
|
import org.jeecg.modules.web.dto.ArtRecommendMajorBaseDTO;
|
||||||
import org.jeecg.modules.web.dto.RecommendMajorDTO;
|
import org.jeecg.modules.web.dto.RecommendMajorDTO;
|
||||||
import org.jeecg.modules.yx.constant.YxConstant;
|
import org.jeecg.modules.yx.constant.YxConstant;
|
||||||
|
import org.jeecg.modules.yx.dto.VolunteerDTO;
|
||||||
import org.jeecg.modules.yx.entity.*;
|
import org.jeecg.modules.yx.entity.*;
|
||||||
import org.jeecg.modules.yx.service.*;
|
import org.jeecg.modules.yx.service.*;
|
||||||
import org.jeecg.modules.yx.service.impl.UserScoreService;
|
import org.jeecg.modules.yx.service.impl.UserScoreService;
|
||||||
|
|
@ -43,6 +45,8 @@ public class YxScoreController {
|
||||||
private IYxCalculationMajorService yxCalculationMajorService;
|
private IYxCalculationMajorService yxCalculationMajorService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IYxVolunteerService yxVolunteerService;
|
private IYxVolunteerService yxVolunteerService;
|
||||||
|
@Resource
|
||||||
|
private IYxVolunteerRecordService yxVolunteerRecordService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IYxHistoryScoreControlLineService yxHistoryScoreControlLineService;
|
private IYxHistoryScoreControlLineService yxHistoryScoreControlLineService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -215,6 +219,62 @@ public class YxScoreController {
|
||||||
return Result.OK(responseBody);
|
return Result.OK(responseBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/reloadCalMajor")
|
||||||
|
@ApiOperation(value = "根据当前成绩刷新专业信息")
|
||||||
|
public Result<?> reloadScore(@RequestBody cn.hutool.json.JSONObject jsonObject){
|
||||||
|
String userId = jsonObject.getStr("zwsrqutuserId");
|
||||||
|
if (StringUtils.isBlank(userId)) {
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
AssertUtils.notNull(sysUser, "请先登录!");
|
||||||
|
userId = sysUser.getId();
|
||||||
|
}
|
||||||
|
YxUserScore yxUserScore = yxUserScoreService.getActiveUserScore(userId);
|
||||||
|
LambdaQueryWrapper<YxCalculationMajor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(YxCalculationMajor::getScoreId, yxUserScore.getId());
|
||||||
|
String scoreId = yxUserScore.getId();
|
||||||
|
// 将当前成绩单的计算专业scoreId 改成加_ 当前时间戳
|
||||||
|
String bakScoreId = scoreId+"_"+new Date().getTime();
|
||||||
|
LambdaUpdateWrapper<YxCalculationMajor> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(YxCalculationMajor::getScoreId,scoreId);
|
||||||
|
updateWrapper.set(YxCalculationMajor::getScoreId,bakScoreId);
|
||||||
|
yxCalculationMajorService.update(updateWrapper);
|
||||||
|
try {
|
||||||
|
// 重新计算专业
|
||||||
|
List<RecommendMajorDTO> recommendMajorDTOList = yxCalculationMajorService.calculationMajor(yxUserScore);
|
||||||
|
|
||||||
|
// 清空当前成绩的志愿单列表
|
||||||
|
List<YxVolunteer> list = yxVolunteerService.list(new LambdaQueryWrapper<YxVolunteer>().eq(YxVolunteer::getScoreId, scoreId));
|
||||||
|
for (YxVolunteer yxVolunteer : list) {
|
||||||
|
LambdaQueryWrapper<YxVolunteerRecord> yxVolunteerRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
yxVolunteerRecordLambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId,yxVolunteer.getId());
|
||||||
|
yxVolunteerRecordService.remove(yxVolunteerRecordLambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
VolunteerDTO yxVolunteer = yxVolunteerService.getActiveByCreate(userId);
|
||||||
|
|
||||||
|
//获取志愿单推荐数量
|
||||||
|
ArtRecommendMajorBaseDTO artRecommendMajorBaseDTO = yxCalculationMajorService.checkLevelNum(recommendMajorDTOList);
|
||||||
|
yxUserScore.setJwtNum(artRecommendMajorBaseDTO.getJwt());
|
||||||
|
yxUserScore.setKcjNum(artRecommendMajorBaseDTO.getKcj());
|
||||||
|
yxUserScore.setKbdNum(artRecommendMajorBaseDTO.getKbd());
|
||||||
|
yxUserScore.setNlqNum(artRecommendMajorBaseDTO.getNan());
|
||||||
|
yxUserScoreService.updateById(yxUserScore);
|
||||||
|
|
||||||
|
// 删除之前的专业
|
||||||
|
yxCalculationMajorService.remove(new LambdaQueryWrapper<YxCalculationMajor>().eq(YxCalculationMajor::getScoreId,bakScoreId));
|
||||||
|
//返回对象
|
||||||
|
JSONObject responseBody = JSONObject.parseObject(JSONObject.toJSONString(yxUserScore));
|
||||||
|
responseBody.put("volunteer", yxVolunteer);
|
||||||
|
return Result.OK(responseBody);
|
||||||
|
}catch (Exception e){
|
||||||
|
// 报错了,恢复计算专业
|
||||||
|
updateWrapper.clear();
|
||||||
|
updateWrapper.set(YxCalculationMajor::getScoreId,scoreId);
|
||||||
|
updateWrapper.eq(YxCalculationMajor::getScoreId,bakScoreId);
|
||||||
|
yxCalculationMajorService.update(updateWrapper);
|
||||||
|
return Result.error("操作失败,请联系管理员");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/getUserScoreInfo")
|
@GetMapping(value = "/getUserScoreInfo")
|
||||||
public Result<?> getUserScoreInfo() {
|
public Result<?> getUserScoreInfo() {
|
||||||
//获取分数信息
|
//获取分数信息
|
||||||
|
|
|
||||||
|
|
@ -144,4 +144,6 @@ public class YxCalculationMajor implements Serializable {
|
||||||
@Excel(name = "内部折合分数", width = 15)
|
@Excel(name = "内部折合分数", width = 15)
|
||||||
@ApiModelProperty(value = "内部折合分数")
|
@ApiModelProperty(value = "内部折合分数")
|
||||||
private java.math.BigDecimal privateStudentConvertedScore;
|
private java.math.BigDecimal privateStudentConvertedScore;
|
||||||
|
|
||||||
|
private String state;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
INSERT INTO ${tableName} (id,score_id, school_code, major_code, major_name, enrollment_code, tuition,
|
INSERT INTO ${tableName} (id,score_id, school_code, major_code, major_name, enrollment_code, tuition,
|
||||||
detail, category, rules_enroll_probability, batch, student_old_converted_score, student_converted_score,
|
detail, category, rules_enroll_probability, batch, student_old_converted_score, student_converted_score,
|
||||||
enroll_probability, probability_operator, major_type, major_type_child, plan_num, main_subjects,
|
enroll_probability, probability_operator, major_type, major_type_child, plan_num, main_subjects,
|
||||||
limitation, other_score_limitation,rules_enroll_probability_sx,kslx,private_student_converted_score,private_rules_enroll_probability,private_probability_operator)
|
limitation, other_score_limitation,rules_enroll_probability_sx,kslx,private_student_converted_score,private_rules_enroll_probability,private_probability_operator,state)
|
||||||
VALUES
|
VALUES
|
||||||
<foreach collection="list" item="item" index="index" separator=",">
|
<foreach collection="list" item="item" index="index" separator=",">
|
||||||
(#{item.id},#{item.scoreId}, #{item.schoolCode}, #{item.majorCode}, #{item.majorName},
|
(#{item.id},#{item.scoreId}, #{item.schoolCode}, #{item.majorCode}, #{item.majorName},
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
#{item.batch}, #{item.studentOldConvertedScore}, #{item.studentConvertedScore}, #{item.enrollProbability},
|
#{item.batch}, #{item.studentOldConvertedScore}, #{item.studentConvertedScore}, #{item.enrollProbability},
|
||||||
#{item.probabilityOperator}, #{item.majorType}, #{item.majorTypeChild}, #{item.planNum},
|
#{item.probabilityOperator}, #{item.majorType}, #{item.majorTypeChild}, #{item.planNum},
|
||||||
#{item.mainSubjects}, #{item.limitation}, #{item.otherScoreLimitation},#{item.rulesEnrollProbabilitySx},#{item.kslx},
|
#{item.mainSubjects}, #{item.limitation}, #{item.otherScoreLimitation},#{item.rulesEnrollProbabilitySx},#{item.kslx},
|
||||||
#{item.privateStudentConvertedScore},#{item.privateRulesEnrollProbability},#{item.privateProbabilityOperator}
|
#{item.privateStudentConvertedScore},#{item.privateRulesEnrollProbability},#{item.privateProbabilityOperator},#{item.state}
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
cm.id,
|
cm.id,
|
||||||
s.school_name,
|
s.school_name,
|
||||||
s.school_icon,
|
s.school_icon,
|
||||||
|
cm.state,
|
||||||
cm.school_code,
|
cm.school_code,
|
||||||
cm.major_code,
|
cm.major_code,
|
||||||
cm.major_name,
|
cm.major_name,
|
||||||
|
|
|
||||||
|
|
@ -89,23 +89,39 @@ public class UserScoreService {
|
||||||
* 获取当前用户今天剩余可保存成绩次数
|
* 获取当前用户今天剩余可保存成绩次数
|
||||||
*/
|
*/
|
||||||
public JSONObject todayOfEditScoreCount() {
|
public JSONObject todayOfEditScoreCount() {
|
||||||
|
long useCount = 0;
|
||||||
|
long residueCount = 0;
|
||||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
AssertUtils.notNull(loginUser, "请先登录!");
|
AssertUtils.notNull(loginUser, "请先登录!");
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
String format = YxConstant.sdf.format(date);
|
if (date.getTime()>=1719244800000l) {
|
||||||
String startTime = format + " 00:00:00";
|
// 2024-06-25 00:00:00 之后,仅可修改一次成绩
|
||||||
String endTime = format + " 23:59:59";
|
LambdaQueryWrapper<YxUserScore> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
LambdaQueryWrapper<YxUserScore> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
lambdaQueryWrapper.ge(YxUserScore::getCreateTime,"2024-06-25 00:00:00");
|
||||||
lambdaQueryWrapper.between(YxUserScore::getCreateTime, startTime, endTime);
|
lambdaQueryWrapper.eq(YxUserScore::getCreateBy, loginUser.getId());
|
||||||
lambdaQueryWrapper.eq(YxUserScore::getCreateBy, loginUser.getId());
|
// 已修改次数
|
||||||
long useCount = yxUserScoreMapper.selectCount(lambdaQueryWrapper);
|
useCount = yxUserScoreMapper.selectCount(lambdaQueryWrapper);
|
||||||
long residueCount = 0;
|
//设置可修改次数
|
||||||
if (YxConstant.todayMaxEditScoreCount > useCount) {
|
if (useCount>0) {
|
||||||
//当天没有超过更改次数
|
residueCount = 0;
|
||||||
residueCount = YxConstant.todayMaxEditScoreCount - useCount;
|
}else{
|
||||||
|
residueCount = 1;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
String format = YxConstant.sdf.format(date);
|
||||||
|
String startTime = format + " 00:00:00";
|
||||||
|
String endTime = format + " 23:59:59";
|
||||||
|
LambdaQueryWrapper<YxUserScore> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.between(YxUserScore::getCreateTime, startTime, endTime);
|
||||||
|
lambdaQueryWrapper.eq(YxUserScore::getCreateBy, loginUser.getId());
|
||||||
|
useCount = yxUserScoreMapper.selectCount(lambdaQueryWrapper);
|
||||||
|
residueCount = 0;
|
||||||
|
if (YxConstant.todayMaxEditScoreCount > useCount) {
|
||||||
|
//当天没有超过更改次数
|
||||||
|
residueCount = YxConstant.todayMaxEditScoreCount - useCount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonObject.put("useCount", useCount);
|
jsonObject.put("useCount", useCount);
|
||||||
jsonObject.put("residueCount", residueCount);
|
jsonObject.put("residueCount", residueCount);
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue