小程序增加 选考科目(地理,政治,化学,生物)四选二
This commit is contained in:
zhouwentao 2024-10-31 11:36:52 +08:00
parent 00efbf53f9
commit a7996dbdae
15 changed files with 279 additions and 85 deletions

View File

@ -55,7 +55,6 @@ public class BaseCommonServiceImpl implements BaseCommonService {
HttpServletRequest request = SpringContextUtils.getHttpServletRequest(); HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
//设置IP地址 //设置IP地址
sysLog.setIp(IpUtils.getIpAddr(request)); sysLog.setIp(IpUtils.getIpAddr(request));
System.out.println("IP地址"+ sysLog.getIp());
} catch (Exception e) { } catch (Exception e) {
sysLog.setIp("127.0.0.1"); sysLog.setIp("127.0.0.1");
} }

View File

@ -17,6 +17,7 @@ import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.util.JwtUtil; import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.*; import org.jeecg.common.util.*;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.mini.douyin.config.DouYinConfig; import org.jeecg.modules.mini.douyin.config.DouYinConfig;
import org.jeecg.modules.mini.douyin.config.DouYinTiyuConfig; import org.jeecg.modules.mini.douyin.config.DouYinTiyuConfig;
import org.jeecg.modules.mini.douyin.vo.DyLoginVo; import org.jeecg.modules.mini.douyin.vo.DyLoginVo;
@ -68,14 +69,14 @@ public class MiniUserController {
private String wxAppId; private String wxAppId;
@Value("${wx.appSecret}") @Value("${wx.appSecret}")
private String wxAppSecret; private String wxAppSecret;
@Autowired @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Autowired @Resource
public RedisTemplate redisTemplate;
@Autowired
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired @Resource
private MiniUserService miniUserService; private MiniUserService miniUserService;
@Resource
private BaseCommonService baseCommonService;
public static final String AES = "AES"; public static final String AES = "AES";
public static final String AES_CBC_PADDING = "AES/CBC/PKCS7Padding"; public static final String AES_CBC_PADDING = "AES/CBC/PKCS7Padding";

View File

@ -11,9 +11,7 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.AssertUtils; 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.web.vo.QueryRecommendMajorVO;
import org.jeecg.modules.yx.constant.YxConstant; import org.jeecg.modules.yx.constant.YxConstant;
import org.jeecg.modules.yx.dto.UserScoreDTO;
import org.jeecg.modules.yx.entity.YxHistoryScoreControlLine; import org.jeecg.modules.yx.entity.YxHistoryScoreControlLine;
import org.jeecg.modules.yx.entity.YxScoreSegment; import org.jeecg.modules.yx.entity.YxScoreSegment;
import org.jeecg.modules.yx.entity.YxUserScore; import org.jeecg.modules.yx.entity.YxUserScore;

View File

@ -208,6 +208,17 @@ public class LoginController {
} }
} }
@PostMapping("/logStatistics")
public Result<JSONObject> logStatistics(@RequestBody JSONObject params){
JSONObject result = new JSONObject();
String type = params.getString("type");
Date dayStart = params.getDate("dayStart");
Date dayEnd = params.getDate("dayEnd");
List<Map<String, Object>> logStatistics = logService.findLogStatistics(type, dayStart, dayEnd);
result.put("logStatistics",logStatistics);
return Result.OK(result);
}
/** /**
* 获取访问量 * 获取访问量
* @return * @return

View File

@ -57,4 +57,6 @@ public interface SysLogMapper extends BaseMapper<SysLog> {
* @return * @return
*/ */
List<Map<String,Object>> findVisitCount(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd, @Param("dbType") String dbType); List<Map<String,Object>> findVisitCount(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd, @Param("dbType") String dbType);
List<Map<String, Object>> findLogStatistics(@Param("type") String type, @Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);
} }

View File

@ -14,12 +14,12 @@
<!-- 获取今日访问总数 --> <!-- 获取今日访问总数 -->
<select id="findTodayVisitCount" resultType="long"> <select id="findTodayVisitCount" resultType="long">
select count(1) from sys_log where log_type = 1 and create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd} select count(1) from sys_log where create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd}
</select> </select>
<!-- 获取今日访问总IP数 --> <!-- 获取今日访问总IP数 -->
<select id="findTodayIp" resultType="long"> <select id="findTodayIp" resultType="long">
select count(distinct(ip)) from sys_log where log_type = 1 and create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd} select count(distinct(ip)) from sys_log where create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd}
</select> </select>
<!-- 首页访问统计 --> <!-- 首页访问统计 -->
@ -30,7 +30,7 @@
,DATE_FORMAT(create_time, '%Y-%m-%d') as tian ,DATE_FORMAT(create_time, '%Y-%m-%d') as tian
,DATE_FORMAT(create_time, '%m-%d') as type ,DATE_FORMAT(create_time, '%m-%d') as type
from sys_log from sys_log
where log_type = 1 and create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd} where create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd}
group by tian,type group by tian,type
order by tian asc order by tian asc
</if> </if>
@ -40,7 +40,7 @@
,to_char(create_time, 'yyyy-mm-dd') as tian ,to_char(create_time, 'yyyy-mm-dd') as tian
,to_char(create_time, 'mm-dd') as type ,to_char(create_time, 'mm-dd') as type
from sys_log from sys_log
where log_type = 1 and create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd} where create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd}
group by to_char(create_time, 'yyyy-mm-dd'),to_char(create_time, 'mm-dd') group by to_char(create_time, 'yyyy-mm-dd'),to_char(create_time, 'mm-dd')
order by to_char(create_time, 'yyyy-mm-dd') asc order by to_char(create_time, 'yyyy-mm-dd') asc
</if> </if>
@ -50,7 +50,7 @@
,to_char(create_time, 'yyyy-mm-dd') as tian ,to_char(create_time, 'yyyy-mm-dd') as tian
,to_char(create_time, 'mm-dd') as type ,to_char(create_time, 'mm-dd') as type
from sys_log from sys_log
where log_type = 1 and create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd} where create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd}
group by tian,type group by tian,type
order by tian asc order by tian asc
</if> </if>
@ -60,10 +60,23 @@
,CONVERT(varchar(100), create_time, 23) as tian ,CONVERT(varchar(100), create_time, 23) as tian
,RIGHT(CONVERT(varchar(100), create_time, 23),5) as type ,RIGHT(CONVERT(varchar(100), create_time, 23),5) as type
from sys_log from sys_log
where log_type = 1 and create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd} where create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd}
group by CONVERT(varchar(100), create_time, 23),RIGHT(CONVERT(varchar(100), create_time, 23),5) group by CONVERT(varchar(100), create_time, 23),RIGHT(CONVERT(varchar(100), create_time, 23),5)
order by CONVERT(varchar(100), create_time, 23) asc order by CONVERT(varchar(100), create_time, 23) asc
</if> </if>
</select> </select>
<select id="findLogStatistics" resultType="java.util.Map">
select count(*) as visit
,count(distinct(ip)) as ip
<if test="type == 'YEAR' || type == 'year'">
,Month(DATE_FORMAT(create_time, '%Y-%m-%d')) as tian
</if>
,DATE_FORMAT(create_time, '%Y-%m-%d') as tian
,DATE_FORMAT(create_time, '%m-%d') as type
from sys_log
where create_time &gt;= #{dayStart} and create_time &lt; #{dayEnd}
group by tian,type
order by tian asc
</select>
</mapper> </mapper>

View File

@ -8,6 +8,8 @@ import org.jeecg.modules.system.entity.SysLog;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import javax.xml.crypto.Data;
/** /**
* <p> * <p>
* 系统日志表 服务类 * 系统日志表 服务类
@ -55,4 +57,10 @@ public interface ISysLogService extends IService<SysLog> {
* @return * @return
*/ */
List<Map<String,Object>> findVisitCount(Date dayStart, Date dayEnd); List<Map<String,Object>> findVisitCount(Date dayStart, Date dayEnd);
/**
* 首页访问量统计
* @return
*/
List<Map<String,Object>> findLogStatistics(String type, Date dayStart,Date dayEnd);
} }

View File

@ -8,6 +8,7 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.annotation.DbType;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.system.api.ISysBaseAPI; import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.util.CommonUtils; import org.jeecg.common.util.CommonUtils;
import org.jeecg.modules.system.entity.SysLog; import org.jeecg.modules.system.entity.SysLog;
@ -62,4 +63,9 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
DbType dbType = CommonUtils.getDatabaseTypeEnum(); DbType dbType = CommonUtils.getDatabaseTypeEnum();
return sysLogMapper.findVisitCount(dayStart, dayEnd,dbType.getDb()); return sysLogMapper.findVisitCount(dayStart, dayEnd,dbType.getDb());
} }
@Override
public List<Map<String, Object>> findLogStatistics(String type, Date dayStart, Date dayEnd) {
return sysLogMapper.findLogStatistics(type,dayStart,dayEnd);
}
} }

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.yx.controller; package org.jeecg.modules.yx.controller;
import cn.hutool.core.collection.CollectionUtil;
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 com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@ -14,6 +15,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.UserScoreUpdateDTO;
import org.jeecg.modules.yx.dto.VolunteerDTO; 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.*;
@ -55,20 +57,20 @@ public class YxScoreController {
private UserScoreService userScoreService; private UserScoreService userScoreService;
@PostMapping(value = "/save") @PostMapping(value = "/save")
public Result<?> save(@NotNull @RequestBody YxUserScore yxUserScore) { public Result<?> save(@NotNull @RequestBody UserScoreUpdateDTO userScoreUpdateDTO) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
AssertUtils.notNull(sysUser, "请先登录!"); AssertUtils.notNull(sysUser, "请先登录!");
String userId = sysUser.getId(); String userId = sysUser.getId();
// 入参 String professionalCategory = userScoreUpdateDTO.getProfessionalCategory();
String professionalCategory = yxUserScore.getProfessionalCategory(); String cognitioPolyclinic = userScoreUpdateDTO.getCognitioPolyclinic();//文科/理科
String cognitioPolyclinic = yxUserScore.getCognitioPolyclinic();//文科/理科 BigDecimal culturalScore = userScoreUpdateDTO.getCulturalScore();
BigDecimal culturalScore = yxUserScore.getCulturalScore(); BigDecimal professionalScore = userScoreUpdateDTO.getProfessionalScore();
BigDecimal professionalScore = yxUserScore.getProfessionalScore(); BigDecimal oldProfessionalScore = userScoreUpdateDTO.getProfessionalScore();
BigDecimal oldProfessionalScore = yxUserScore.getProfessionalScore(); String professionalCategoryChildren = userScoreUpdateDTO.getProfessionalCategoryChildren();
String professionalCategoryChildren = yxUserScore.getProfessionalCategoryChildren();
AssertUtils.notNull(professionalCategory, "请选择[专业类别]"); AssertUtils.notNull(professionalCategory, "请选择[专业类别]");
AssertUtils.notNull(cognitioPolyclinic, "请选择[选考科目]"); AssertUtils.notNull(cognitioPolyclinic, "请选择[选考科目]");
AssertUtils.hasSize(userScoreUpdateDTO.getSubjectList(),"请选择[选考科目]");
AssertUtils.notTrue(userScoreUpdateDTO.getSubjectList().size() != 2,"选考科目必须选两项");
AssertUtils.notTrue(culturalScore.compareTo(YxConstant.bigDecimal750) > 0, "[文化成绩]最高分为750"); AssertUtils.notTrue(culturalScore.compareTo(YxConstant.bigDecimal750) > 0, "[文化成绩]最高分为750");
AssertUtils.notTrue(culturalScore.compareTo(YxConstant.bigDecimal0) < 0, "[文化成绩]最低分为0"); AssertUtils.notTrue(culturalScore.compareTo(YxConstant.bigDecimal0) < 0, "[文化成绩]最低分为0");
@ -83,28 +85,28 @@ public class YxScoreController {
//将多于的子项成绩清空 //将多于的子项成绩清空
if (StringUtils.isNotBlank(professionalCategoryChildren)) { if (StringUtils.isNotBlank(professionalCategoryChildren)) {
if (!professionalCategoryChildren.contains("音乐表演声乐")) { if (!professionalCategoryChildren.contains("音乐表演声乐")) {
yxUserScore.setYybysy(YxConstant.bigDecimal0); userScoreUpdateDTO.setYybysy(YxConstant.bigDecimal0);
} }
if (!professionalCategoryChildren.contains("音乐表演器乐")) { if (!professionalCategoryChildren.contains("音乐表演器乐")) {
yxUserScore.setYybyqy(YxConstant.bigDecimal0); userScoreUpdateDTO.setYybyqy(YxConstant.bigDecimal0);
} }
if (!professionalCategoryChildren.contains("音乐教育")) { if (!professionalCategoryChildren.contains("音乐教育")) {
yxUserScore.setYyjy(YxConstant.bigDecimal0); userScoreUpdateDTO.setYyjy(YxConstant.bigDecimal0);
} }
if (!professionalCategoryChildren.contains("服装表演")) { if (!professionalCategoryChildren.contains("服装表演")) {
yxUserScore.setFzby(YxConstant.bigDecimal0); userScoreUpdateDTO.setFzby(YxConstant.bigDecimal0);
} }
if (!professionalCategoryChildren.contains("戏剧影视表演")) { if (!professionalCategoryChildren.contains("戏剧影视表演")) {
yxUserScore.setXjysby(YxConstant.bigDecimal0); userScoreUpdateDTO.setXjysby(YxConstant.bigDecimal0);
} }
if (!professionalCategoryChildren.contains("戏剧影视导演")) { if (!professionalCategoryChildren.contains("戏剧影视导演")) {
yxUserScore.setXjysdy(YxConstant.bigDecimal0); userScoreUpdateDTO.setXjysdy(YxConstant.bigDecimal0);
} }
} }
//==============判断 批次 start //==============判断 批次 start
LambdaQueryWrapper<YxHistoryScoreControlLine> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<YxHistoryScoreControlLine> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getYear, YxConstant.nowYear);//24年省控线 lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getYear, YxConstant.nowYear);//24年省控线
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getCategory, yxUserScore.getCognitioPolyclinic()); lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getCategory, userScoreUpdateDTO.getCognitioPolyclinic());
//表演类型的方向 //表演类型的方向
//舞蹈类使用艺术舞蹈的省控线判定批次 //舞蹈类使用艺术舞蹈的省控线判定批次
lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory, "舞蹈类".equals(professionalCategory)?"舞蹈类":professionalCategory); lambdaQueryWrapper.eq(YxHistoryScoreControlLine::getProfessionalCategory, "舞蹈类".equals(professionalCategory)?"舞蹈类":professionalCategory);
@ -114,64 +116,62 @@ public class YxScoreController {
//24年分数转换折合23年分数 //24年分数转换折合23年分数
YxScoreSegment scoreSegment = null; YxScoreSegment scoreSegment = null;
if ("舞蹈类".equals(professionalCategory)) { if ("舞蹈类".equals(professionalCategory)) {
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, professionalScore, professionalCategory, null, yxUserScore.getProvince()); scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, professionalScore, professionalCategory, null, userScoreUpdateDTO.getProvince());
professionalScore = scoreSegment.getScore(); professionalScore = scoreSegment.getScore();
} else if ("音乐类".equals(professionalCategory)) { } else if ("音乐类".equals(professionalCategory)) {
if (!professionalCategoryChildren.contains("器乐")) { if (!professionalCategoryChildren.contains("器乐")) {
yxUserScore.setYybyqy(YxConstant.bigDecimal0); userScoreUpdateDTO.setYybyqy(YxConstant.bigDecimal0);
} }
if (!professionalCategoryChildren.contains("声乐")) { if (!professionalCategoryChildren.contains("声乐")) {
yxUserScore.setYybysy(YxConstant.bigDecimal0); userScoreUpdateDTO.setYybysy(YxConstant.bigDecimal0);
} }
if (!professionalCategoryChildren.contains("音乐教育")) { if (!professionalCategoryChildren.contains("音乐教育")) {
yxUserScore.setYyjy(YxConstant.bigDecimal0); userScoreUpdateDTO.setYyjy(YxConstant.bigDecimal0);
} }
BigDecimal yybysy = userScoreUpdateDTO.getYybysy();//音乐表演声乐成绩
BigDecimal yybysy = yxUserScore.getYybysy();//音乐表演声乐成绩 BigDecimal yybyqy = userScoreUpdateDTO.getYybyqy();//音乐表演器乐成绩
BigDecimal yybyqy = yxUserScore.getYybyqy();//音乐表演器乐成绩 BigDecimal yyjy = userScoreUpdateDTO.getYyjy();//音乐教育成绩
BigDecimal yyjy = yxUserScore.getYyjy();//音乐教育成绩
if (yybysy != null && yybysy.compareTo(YxConstant.bigDecimal0) > 0) { if (yybysy != null && yybysy.compareTo(YxConstant.bigDecimal0) > 0) {
//音乐表演声乐 //音乐表演声乐
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yybysy, professionalCategory, "音乐表演声乐", yxUserScore.getProvince()); scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yybysy, professionalCategory, "音乐表演声乐", userScoreUpdateDTO.getProvince());
yybysy = scoreSegment.getScore(); yybysy = scoreSegment.getScore();
} }
if (yybyqy != null && yybyqy.compareTo(YxConstant.bigDecimal0) > 0) { if (yybyqy != null && yybyqy.compareTo(YxConstant.bigDecimal0) > 0) {
//音乐表演器乐成绩 //音乐表演器乐成绩
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yybyqy, professionalCategory, "音乐表演器乐", yxUserScore.getProvince()); scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yybyqy, professionalCategory, "音乐表演器乐", userScoreUpdateDTO.getProvince());
yybyqy = scoreSegment.getScore(); yybyqy = scoreSegment.getScore();
} else { } else {
} }
if (yyjy != null && yyjy.compareTo(YxConstant.bigDecimal0) > 0) { if (yyjy != null && yyjy.compareTo(YxConstant.bigDecimal0) > 0) {
//音乐教育成绩 //音乐教育成绩
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yyjy, professionalCategory, "音乐教育", yxUserScore.getProvince()); scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, yyjy, professionalCategory, "音乐教育", userScoreUpdateDTO.getProvince());
yyjy = scoreSegment.getScore(); yyjy = scoreSegment.getScore();
} }
professionalScore = yybysy.max(yybyqy).max(yyjy); professionalScore = yybysy.max(yybyqy).max(yyjy);
} else if ("播音与主持类".equals(professionalCategory)) { } else if ("播音与主持类".equals(professionalCategory)) {
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, professionalScore, professionalCategory, null, yxUserScore.getProvince()); scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, professionalScore, professionalCategory, null, userScoreUpdateDTO.getProvince());
professionalScore = scoreSegment.getScore(); professionalScore = scoreSegment.getScore();
} else if ("表演类".equals(professionalCategory)) { } else if ("表演类".equals(professionalCategory)) {
BigDecimal xjysby = yxUserScore.getXjysby();//戏剧影视表演 BigDecimal xjysby = userScoreUpdateDTO.getXjysby();//戏剧影视表演
BigDecimal xjysdy = yxUserScore.getXjysdy();//戏剧影视导演 BigDecimal xjysdy = userScoreUpdateDTO.getXjysdy();//戏剧影视导演
BigDecimal fzby = yxUserScore.getFzby();//服装表演 BigDecimal fzby = userScoreUpdateDTO.getFzby();//服装表演
oldProfessionalScore = xjysby.max(xjysdy).max(fzby); oldProfessionalScore = xjysby.max(xjysdy).max(fzby);
if (xjysby != null && xjysby.compareTo(YxConstant.bigDecimal0) > 0) { if (xjysby != null && xjysby.compareTo(YxConstant.bigDecimal0) > 0) {
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, xjysby, professionalCategory, "戏剧影视表演", yxUserScore.getProvince()); scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, xjysby, professionalCategory, "戏剧影视表演", userScoreUpdateDTO.getProvince());
xjysby = scoreSegment.getScore(); xjysby = scoreSegment.getScore();
} }
if (xjysdy != null && xjysdy.compareTo(YxConstant.bigDecimal0) > 0) { if (xjysdy != null && xjysdy.compareTo(YxConstant.bigDecimal0) > 0) {
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, xjysdy, professionalCategory, "戏剧影视导演", yxUserScore.getProvince()); scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, xjysdy, professionalCategory, "戏剧影视导演", userScoreUpdateDTO.getProvince());
xjysdy = scoreSegment.getScore(); xjysdy = scoreSegment.getScore();
} }
if (fzby != null && fzby.compareTo(YxConstant.bigDecimal0) > 0) { if (fzby != null && fzby.compareTo(YxConstant.bigDecimal0) > 0) {
scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, fzby, professionalCategory, "服装表演", yxUserScore.getProvince()); scoreSegment = yxScoreSegmentService.checkOldYearScore(YxConstant.nowYear, fzby, professionalCategory, "服装表演", userScoreUpdateDTO.getProvince());
fzby = scoreSegment.getScore(); fzby = scoreSegment.getScore();
} }
professionalScore = xjysby.max(xjysdy).max(fzby); professionalScore = xjysby.max(xjysdy).max(fzby);
yxUserScore.setProfessionalScore(oldProfessionalScore); userScoreUpdateDTO.setProfessionalScore(oldProfessionalScore);
} }
} }
String batch = "本科A段"; String batch = "本科A段";
@ -183,25 +183,21 @@ public class YxScoreController {
}*/ }*/
//================批次 end //================批次 end
//根据批次判断 本科/高职高专 //根据批次判断 本科/高职高专
//关闭当前用户之前的分数和志愿单 //关闭当前用户之前的分数和志愿单
yxUserScoreService.closeUserScore(userId); yxUserScoreService.closeUserScore(userId);
yxVolunteerService.closeUserVolunteer(userId); yxVolunteerService.closeUserVolunteer(userId);
//保存新的分数信息 //保存新的分数信息
yxUserScore.setType("2");//报考类型 1.普通类 2.艺术类 userScoreUpdateDTO.setType("2");//报考类型 1.普通类 2.艺术类
yxUserScore.setRanking(0);//位次 userScoreUpdateDTO.setRanking(0);//位次
yxUserScore.setCreateBy(userId); userScoreUpdateDTO.setCreateBy(userId);
yxUserScore.setEducationalLevel("1"); userScoreUpdateDTO.setEducationalLevel("1");
yxUserScore.setBatch(batch); userScoreUpdateDTO.setBatch(batch);
yxUserScore.setId(null); userScoreUpdateDTO.setId(null);
yxUserScore.setCreateTime(null); userScoreUpdateDTO.setCreateTime(null);
yxUserScore.setUpdateTime(null); userScoreUpdateDTO.setUpdateTime(null);
yxUserScore.setCalculationTableName("yx_calculation_major");
//保存当前用户的得分
yxUserScoreService.save(yxUserScore);
YxUserScore yxUserScore = yxUserScoreService.saveUserScore(userScoreUpdateDTO);
List<RecommendMajorDTO> recommendMajorDTOList = yxCalculationMajorService.calculationMajor(yxUserScore); List<RecommendMajorDTO> recommendMajorDTOList = yxCalculationMajorService.calculationMajor(yxUserScore);
//创建新的志愿单信息 //创建新的志愿单信息
YxVolunteer yxVolunteer = new YxVolunteer(); YxVolunteer yxVolunteer = new YxVolunteer();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");

View File

@ -13,7 +13,9 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author ZhouWenTao * @author ZhouWenTao
@ -81,6 +83,12 @@ public class UserScoreInfo implements Serializable {
@ApiModelProperty(value = "录取批次") @ApiModelProperty(value = "录取批次")
private String batch; private String batch;
@JsonIgnore
private String subjects;
/**选考科目明细*/
@ApiModelProperty(value = "选考科目明细")
private List<String> subjectList = new ArrayList<>();
/**语文成绩*/ /**语文成绩*/
@Excel(name = "语文成绩", width = 15) @Excel(name = "语文成绩", width = 15)
@ApiModelProperty(value = "语文成绩") @ApiModelProperty(value = "语文成绩")

View File

@ -0,0 +1,132 @@
package org.jeecg.modules.yx.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Description 修改用户成绩DTO
* @author ZhouWenTao
* @create 2024-10-31 10:11
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="修改用户成绩DTO对象", description="修改用户成绩DTO")
public class UserScoreUpdateDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
/**使用状态(0-未使用,1-使用中)*/
@ApiModelProperty(value = "使用状态(0-未使用,1-使用中,2-草表)")
private java.lang.String state;
/**填报类型(1-普通类 2-艺术类)*/
@ApiModelProperty(value = "填报类型(1-普通类 2-艺术类)")
private java.lang.String type;
/**学历层次(1-本科,2-专科)*/
@ApiModelProperty(value = "学历层次(1-本科,2-专科)")
private java.lang.String educationalLevel;
/**文理分科*/
@ApiModelProperty(value = "文理分科")
private java.lang.String cognitioPolyclinic;
/**专业类别(美术类/...)*/
@ApiModelProperty(value = "专业类别(美术类/...)")
private java.lang.String professionalCategory;
/**子级专业类别*/
@ApiModelProperty(value = "子级专业类别")
private java.lang.String professionalCategoryChildren;
/**选课*/
@ApiModelProperty(value = "选课")
private java.lang.String subjects;
private List<String> subjectList;
/**专业成绩分(语文,数学,英语...)*/
@ApiModelProperty(value = "专业成绩分(语文,数学,英语...)")
private java.math.BigDecimal professionalScore;
/**文化成绩分*/
@ApiModelProperty(value = "文化成绩分")
private java.math.BigDecimal culturalScore;
/**位次*/
@ApiModelProperty(value = "位次")
private java.lang.Integer ranking;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**高考省份*/
@ApiModelProperty(value = "高考省份")
private String province;
/**录取批次*/
@ApiModelProperty(value = "录取批次")
private String batch;
/**语文成绩*/
@ApiModelProperty(value = "语文成绩")
private java.math.BigDecimal chineseScore;
/**英语成绩*/
@ApiModelProperty(value = "英语成绩")
private java.math.BigDecimal englishScore;
/**音乐表演声乐*/
@ApiModelProperty(value = "音乐表演声乐")
private BigDecimal yybysy;
/**音乐表演器乐*/
@ApiModelProperty(value = "音乐表演器乐")
private BigDecimal yybyqy;
/**音乐教育 */
@ApiModelProperty(value = "音乐教育")
private BigDecimal yyjy;
/**服装表演 */
@ApiModelProperty(value = "服装表演")
private BigDecimal fzby;
/**戏剧影视导演 */
@ApiModelProperty(value = "戏剧影视导演")
private BigDecimal xjysdy;
/**戏剧影视表演 */
@ApiModelProperty(value = "戏剧影视表演")
private BigDecimal xjysby;
@ApiModelProperty(value = "可保底专业数量")
private Integer kbdNum;
@ApiModelProperty(value = "较稳妥专业数量")
private Integer jwtNum;
@ApiModelProperty(value = "可冲击专业数量")
private Integer kcjNum;
@ApiModelProperty(value = "难录取专业数量")
private Integer nlqNum;
//===================
@ApiModelProperty(value = "子级专业列表")
private List<ProfessionalCategoryChildrenDTO> professionalCategoryChildrenList;
/*转换为上一年的分数*/
@JsonFormat
private BigDecimal convertOldScore;
/**艺术舞蹈 */
@ApiModelProperty(value = "艺术舞蹈")
private BigDecimal yswd;
/**国际标准舞 */
@ApiModelProperty(value = "国际标准舞")
private BigDecimal gjbzw;
}

View File

@ -60,9 +60,9 @@ public class YxUserScore implements Serializable {
private java.lang.String professionalCategoryChildren; private java.lang.String professionalCategoryChildren;
/**选课*/ /**选课*/
/*@Excel(name = "选课", width = 15) // @Excel(name = "选课", width = 15)
@ApiModelProperty(value = "选课") @ApiModelProperty(value = "选课")
private java.lang.String subjects;*/ private java.lang.String subjects;
/**专业成绩分(语文,数学,英语...)*/ /**专业成绩分(语文,数学,英语...)*/
@Excel(name = "专业成绩分(语文,数学,英语...)", width = 15) @Excel(name = "专业成绩分(语文,数学,英语...)", width = 15)
@ApiModelProperty(value = "专业成绩分(语文,数学,英语...)") @ApiModelProperty(value = "专业成绩分(语文,数学,英语...)")

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.yx.service; package org.jeecg.modules.yx.service;
import org.jeecg.modules.yx.dto.UserScoreUpdateDTO;
import org.jeecg.modules.yx.entity.YxUserScore; import org.jeecg.modules.yx.entity.YxUserScore;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -54,4 +55,5 @@ public interface IYxUserScoreService extends IService<YxUserScore> {
*/ */
void closeUserScore(String userId); void closeUserScore(String userId);
YxUserScore saveUserScore(UserScoreUpdateDTO userScoreUpdateDTO);
} }

View File

@ -22,9 +22,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.jeecg.modules.yx.constant.YxConstant; import org.jeecg.modules.yx.constant.YxConstant;
@ -86,7 +84,12 @@ public class UserScoreService {
if (StringUtils.isBlank(createBy)) { if (StringUtils.isBlank(createBy)) {
return null; return null;
} }
return yxUserScoreMapper.getByCreateByLast1(createBy); // 选科
UserScoreInfo userScoreInfo = yxUserScoreMapper.getByCreateByLast1(createBy);
if (StringUtils.isNotBlank(userScoreInfo.getSubjects())) {
userScoreInfo.setSubjectList(Arrays.asList(userScoreInfo.getSubjects().split(",")));
}
return userScoreInfo;
} }
/** /**

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.yx.service.impl; package org.jeecg.modules.yx.service.impl;
import cn.hutool.core.collection.CollectionUtil;
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 com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
@ -8,6 +9,7 @@ import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.AssertUtils; import org.jeecg.common.util.AssertUtils;
import org.jeecg.modules.yx.dto.ProfessionalCategoryChildrenDTO; import org.jeecg.modules.yx.dto.ProfessionalCategoryChildrenDTO;
import org.jeecg.modules.yx.dto.UserScoreUpdateDTO;
import org.jeecg.modules.yx.entity.YxCalculationMajor; import org.jeecg.modules.yx.entity.YxCalculationMajor;
import org.jeecg.modules.yx.entity.YxUserScore; import org.jeecg.modules.yx.entity.YxUserScore;
import org.jeecg.modules.yx.entity.YxVolunteer; import org.jeecg.modules.yx.entity.YxVolunteer;
@ -15,6 +17,7 @@ import org.jeecg.modules.yx.mapper.YxCalculationMajorMapper;
import org.jeecg.modules.yx.mapper.YxUserScoreMapper; import org.jeecg.modules.yx.mapper.YxUserScoreMapper;
import org.jeecg.modules.yx.mapper.YxVolunteerMapper; import org.jeecg.modules.yx.mapper.YxVolunteerMapper;
import org.jeecg.modules.yx.service.*; import org.jeecg.modules.yx.service.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -163,4 +166,16 @@ public class YxUserScoreServiceImpl extends ServiceImpl<YxUserScoreMapper, YxUse
this.update(lambdaUpdateWrapper); this.update(lambdaUpdateWrapper);
} }
@Override
public YxUserScore saveUserScore(UserScoreUpdateDTO userScoreUpdateDTO) {
YxUserScore yxUserScore = new YxUserScore();
BeanUtils.copyProperties(userScoreUpdateDTO,yxUserScore);
if (CollectionUtil.isNotEmpty(userScoreUpdateDTO.getSubjectList())) {
yxUserScore.setSubjects(userScoreUpdateDTO.getSubjectList().stream().collect(Collectors.joining(",")));
}
yxUserScore.setCalculationTableName("yx_calculation_major");
this.save(yxUserScore);
return yxUserScore;
}
} }