parent
00efbf53f9
commit
a7996dbdae
|
|
@ -55,7 +55,6 @@ public class BaseCommonServiceImpl implements BaseCommonService {
|
|||
HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
|
||||
//设置IP地址
|
||||
sysLog.setIp(IpUtils.getIpAddr(request));
|
||||
System.out.println("IP地址:"+ sysLog.getIp());
|
||||
} catch (Exception e) {
|
||||
sysLog.setIp("127.0.0.1");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import org.jeecg.common.exception.JeecgBootException;
|
|||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
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.DouYinTiyuConfig;
|
||||
import org.jeecg.modules.mini.douyin.vo.DyLoginVo;
|
||||
|
|
@ -68,14 +69,14 @@ public class MiniUserController {
|
|||
private String wxAppId;
|
||||
@Value("${wx.appSecret}")
|
||||
private String wxAppSecret;
|
||||
@Autowired
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Autowired
|
||||
public RedisTemplate redisTemplate;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private MiniUserService miniUserService;
|
||||
@Resource
|
||||
private BaseCommonService baseCommonService;
|
||||
public static final String AES = "AES";
|
||||
public static final String AES_CBC_PADDING = "AES/CBC/PKCS7Padding";
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ import org.jeecg.common.system.vo.LoginUser;
|
|||
import org.jeecg.common.util.AssertUtils;
|
||||
import org.jeecg.modules.web.dto.ArtRecommendMajorBaseDTO;
|
||||
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.dto.UserScoreDTO;
|
||||
import org.jeecg.modules.yx.entity.YxHistoryScoreControlLine;
|
||||
import org.jeecg.modules.yx.entity.YxScoreSegment;
|
||||
import org.jeecg.modules.yx.entity.YxUserScore;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public interface SysLogMapper extends BaseMapper<SysLog> {
|
|||
*/
|
||||
Long findTodayIp(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);
|
||||
//update-end--Author:zhangweijian Date:20190428 for:传入开始时间,结束时间参数
|
||||
|
||||
|
||||
/**
|
||||
* 首页:根据时间统计访问数量/ip数量
|
||||
* @param dayStart
|
||||
|
|
@ -57,4 +57,6 @@ public interface SysLogMapper extends BaseMapper<SysLog> {
|
|||
* @return
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<delete id="removeAll">
|
||||
DELETE FROM sys_log
|
||||
</delete>
|
||||
|
||||
|
||||
<!-- 获取访问总数 -->
|
||||
<select id="findTotalVisitCount" resultType="long">
|
||||
select count(1) from sys_log where log_type = 1
|
||||
|
|
@ -14,14 +14,14 @@
|
|||
|
||||
<!-- 获取今日访问总数 -->
|
||||
<select id="findTodayVisitCount" resultType="long">
|
||||
select count(1) from sys_log where log_type = 1 and create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
select count(1) from sys_log where create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 获取今日访问总IP数 -->
|
||||
<select id="findTodayIp" resultType="long">
|
||||
select count(distinct(ip)) from sys_log where log_type = 1 and create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
select count(distinct(ip)) from sys_log where create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 首页访问统计 -->
|
||||
<select id="findVisitCount" resultType="java.util.HashMap">
|
||||
<if test="dbType == 'mysql' || dbType == 'mariadb' || dbType == 'clickhouse'|| dbType == 'sqlite'">
|
||||
|
|
@ -29,8 +29,8 @@
|
|||
,count(distinct(ip)) as ip
|
||||
,DATE_FORMAT(create_time, '%Y-%m-%d') as tian
|
||||
,DATE_FORMAT(create_time, '%m-%d') as type
|
||||
from sys_log
|
||||
where log_type = 1 and create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
from sys_log
|
||||
where create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
group by tian,type
|
||||
order by tian asc
|
||||
</if>
|
||||
|
|
@ -39,9 +39,9 @@
|
|||
,count(distinct(ip)) as ip
|
||||
,to_char(create_time, 'yyyy-mm-dd') as tian
|
||||
,to_char(create_time, 'mm-dd') as type
|
||||
from sys_log
|
||||
where log_type = 1 and create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
group by to_char(create_time, 'yyyy-mm-dd'),to_char(create_time, 'mm-dd')
|
||||
from sys_log
|
||||
where create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
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
|
||||
</if>
|
||||
<if test="dbType == 'postgresql' || dbType == 'kingbasees' || dbType == 'zenith'">
|
||||
|
|
@ -49,21 +49,34 @@
|
|||
,count(distinct(ip)) as ip
|
||||
,to_char(create_time, 'yyyy-mm-dd') as tian
|
||||
,to_char(create_time, 'mm-dd') as type
|
||||
from sys_log
|
||||
where log_type = 1 and create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
group by tian,type
|
||||
order by tian asc
|
||||
from sys_log
|
||||
where create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
group by tian,type
|
||||
order by tian asc
|
||||
</if>
|
||||
<if test="dbType == 'sqlserver' || dbType == 'sqlserver2005'">
|
||||
select count(*) as visit
|
||||
,count(distinct(ip)) as ip
|
||||
,CONVERT(varchar(100), create_time, 23) as tian
|
||||
,RIGHT(CONVERT(varchar(100), create_time, 23),5) as type
|
||||
from sys_log
|
||||
where log_type = 1 and create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
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
|
||||
from sys_log
|
||||
where create_time >= #{dayStart} and create_time < #{dayEnd}
|
||||
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
|
||||
</if>
|
||||
</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 >= #{dayStart} and create_time < #{dayEnd}
|
||||
group by tian,type
|
||||
order by tian asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import org.jeecg.modules.system.entity.SysLog;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.xml.crypto.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志表 服务类
|
||||
|
|
@ -22,7 +24,7 @@ public interface ISysLogService extends IService<SysLog> {
|
|||
* 清空所有日志记录
|
||||
*/
|
||||
public void removeAll();
|
||||
|
||||
|
||||
/**
|
||||
* 获取系统总访问次数
|
||||
*
|
||||
|
|
@ -47,7 +49,7 @@ public interface ISysLogService extends IService<SysLog> {
|
|||
*/
|
||||
Long findTodayIp(Date dayStart, Date dayEnd);
|
||||
//update-end--Author:zhangweijian Date:20190428 for:传入开始时间,结束时间参数
|
||||
|
||||
|
||||
/**
|
||||
* 首页:根据时间统计访问数量/ip数量
|
||||
* @param dayStart
|
||||
|
|
@ -55,4 +57,10 @@ public interface ISysLogService extends IService<SysLog> {
|
|||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> findVisitCount(Date dayStart, Date dayEnd);
|
||||
|
||||
/**
|
||||
* 首页:访问量统计
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> findLogStatistics(String type, Date dayStart,Date dayEnd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||
import javax.annotation.Resource;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.util.CommonUtils;
|
||||
import org.jeecg.modules.system.entity.SysLog;
|
||||
|
|
@ -31,7 +32,7 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
|
|||
|
||||
@Resource
|
||||
private SysLogMapper sysLogMapper;
|
||||
|
||||
|
||||
/**
|
||||
* @功能:清空所有日志记录
|
||||
*/
|
||||
|
|
@ -62,4 +63,9 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
|
|||
DbType dbType = CommonUtils.getDatabaseTypeEnum();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.yx.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.RecommendMajorDTO;
|
||||
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.entity.*;
|
||||
import org.jeecg.modules.yx.service.*;
|
||||
|
|
@ -55,20 +57,20 @@ public class YxScoreController {
|
|||
private UserScoreService userScoreService;
|
||||
|
||||
@PostMapping(value = "/save")
|
||||
public Result<?> save(@NotNull @RequestBody YxUserScore yxUserScore) {
|
||||
public Result<?> save(@NotNull @RequestBody UserScoreUpdateDTO userScoreUpdateDTO) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
AssertUtils.notNull(sysUser, "请先登录!");
|
||||
String userId = sysUser.getId();
|
||||
// 入参
|
||||
String professionalCategory = yxUserScore.getProfessionalCategory();
|
||||
String cognitioPolyclinic = yxUserScore.getCognitioPolyclinic();//文科/理科
|
||||
BigDecimal culturalScore = yxUserScore.getCulturalScore();
|
||||
BigDecimal professionalScore = yxUserScore.getProfessionalScore();
|
||||
BigDecimal oldProfessionalScore = yxUserScore.getProfessionalScore();
|
||||
String professionalCategoryChildren = yxUserScore.getProfessionalCategoryChildren();
|
||||
|
||||
String professionalCategory = userScoreUpdateDTO.getProfessionalCategory();
|
||||
String cognitioPolyclinic = userScoreUpdateDTO.getCognitioPolyclinic();//文科/理科
|
||||
BigDecimal culturalScore = userScoreUpdateDTO.getCulturalScore();
|
||||
BigDecimal professionalScore = userScoreUpdateDTO.getProfessionalScore();
|
||||
BigDecimal oldProfessionalScore = userScoreUpdateDTO.getProfessionalScore();
|
||||
String professionalCategoryChildren = userScoreUpdateDTO.getProfessionalCategoryChildren();
|
||||
AssertUtils.notNull(professionalCategory, "请选择[专业类别]");
|
||||
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.bigDecimal0) < 0, "[文化成绩]最低分为0");
|
||||
|
|
@ -83,28 +85,28 @@ public class YxScoreController {
|
|||
//将多于的子项成绩清空
|
||||
if (StringUtils.isNotBlank(professionalCategoryChildren)) {
|
||||
if (!professionalCategoryChildren.contains("音乐表演声乐")) {
|
||||
yxUserScore.setYybysy(YxConstant.bigDecimal0);
|
||||
userScoreUpdateDTO.setYybysy(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("音乐表演器乐")) {
|
||||
yxUserScore.setYybyqy(YxConstant.bigDecimal0);
|
||||
userScoreUpdateDTO.setYybyqy(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("音乐教育")) {
|
||||
yxUserScore.setYyjy(YxConstant.bigDecimal0);
|
||||
userScoreUpdateDTO.setYyjy(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("服装表演")) {
|
||||
yxUserScore.setFzby(YxConstant.bigDecimal0);
|
||||
userScoreUpdateDTO.setFzby(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("戏剧影视表演")) {
|
||||
yxUserScore.setXjysby(YxConstant.bigDecimal0);
|
||||
userScoreUpdateDTO.setXjysby(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("戏剧影视导演")) {
|
||||
yxUserScore.setXjysdy(YxConstant.bigDecimal0);
|
||||
userScoreUpdateDTO.setXjysdy(YxConstant.bigDecimal0);
|
||||
}
|
||||
}
|
||||
//==============判断 批次 start
|
||||
LambdaQueryWrapper<YxHistoryScoreControlLine> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
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);
|
||||
|
|
@ -114,64 +116,62 @@ public class YxScoreController {
|
|||
//24年分数转换折合23年分数
|
||||
YxScoreSegment scoreSegment = null;
|
||||
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();
|
||||
} else if ("音乐类".equals(professionalCategory)) {
|
||||
if (!professionalCategoryChildren.contains("器乐")) {
|
||||
yxUserScore.setYybyqy(YxConstant.bigDecimal0);
|
||||
userScoreUpdateDTO.setYybyqy(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("声乐")) {
|
||||
yxUserScore.setYybysy(YxConstant.bigDecimal0);
|
||||
userScoreUpdateDTO.setYybysy(YxConstant.bigDecimal0);
|
||||
}
|
||||
if (!professionalCategoryChildren.contains("音乐教育")) {
|
||||
yxUserScore.setYyjy(YxConstant.bigDecimal0);
|
||||
userScoreUpdateDTO.setYyjy(YxConstant.bigDecimal0);
|
||||
}
|
||||
|
||||
BigDecimal yybysy = yxUserScore.getYybysy();//音乐表演声乐成绩
|
||||
BigDecimal yybyqy = yxUserScore.getYybyqy();//音乐表演器乐成绩
|
||||
BigDecimal yyjy = yxUserScore.getYyjy();//音乐教育成绩
|
||||
|
||||
BigDecimal yybysy = userScoreUpdateDTO.getYybysy();//音乐表演声乐成绩
|
||||
BigDecimal yybyqy = userScoreUpdateDTO.getYybyqy();//音乐表演器乐成绩
|
||||
BigDecimal yyjy = userScoreUpdateDTO.getYyjy();//音乐教育成绩
|
||||
|
||||
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();
|
||||
}
|
||||
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();
|
||||
} else {
|
||||
|
||||
}
|
||||
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();
|
||||
}
|
||||
professionalScore = yybysy.max(yybyqy).max(yyjy);
|
||||
} 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();
|
||||
} else if ("表演类".equals(professionalCategory)) {
|
||||
BigDecimal xjysby = yxUserScore.getXjysby();//戏剧影视表演
|
||||
BigDecimal xjysdy = yxUserScore.getXjysdy();//戏剧影视导演
|
||||
BigDecimal fzby = yxUserScore.getFzby();//服装表演
|
||||
BigDecimal xjysby = userScoreUpdateDTO.getXjysby();//戏剧影视表演
|
||||
BigDecimal xjysdy = userScoreUpdateDTO.getXjysdy();//戏剧影视导演
|
||||
BigDecimal fzby = userScoreUpdateDTO.getFzby();//服装表演
|
||||
oldProfessionalScore = xjysby.max(xjysdy).max(fzby);
|
||||
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();
|
||||
}
|
||||
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();
|
||||
}
|
||||
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();
|
||||
}
|
||||
professionalScore = xjysby.max(xjysdy).max(fzby);
|
||||
yxUserScore.setProfessionalScore(oldProfessionalScore);
|
||||
userScoreUpdateDTO.setProfessionalScore(oldProfessionalScore);
|
||||
}
|
||||
}
|
||||
String batch = "本科A段";
|
||||
|
|
@ -183,25 +183,21 @@ public class YxScoreController {
|
|||
}*/
|
||||
//================批次 end
|
||||
//根据批次,判断 本科/高职高专
|
||||
|
||||
//关闭当前用户之前的分数和志愿单
|
||||
yxUserScoreService.closeUserScore(userId);
|
||||
yxVolunteerService.closeUserVolunteer(userId);
|
||||
//保存新的分数信息
|
||||
yxUserScore.setType("2");//报考类型 1.普通类 2.艺术类
|
||||
yxUserScore.setRanking(0);//位次
|
||||
yxUserScore.setCreateBy(userId);
|
||||
yxUserScore.setEducationalLevel("1");
|
||||
yxUserScore.setBatch(batch);
|
||||
yxUserScore.setId(null);
|
||||
yxUserScore.setCreateTime(null);
|
||||
yxUserScore.setUpdateTime(null);
|
||||
yxUserScore.setCalculationTableName("yx_calculation_major");
|
||||
//保存当前用户的得分
|
||||
yxUserScoreService.save(yxUserScore);
|
||||
userScoreUpdateDTO.setType("2");//报考类型 1.普通类 2.艺术类
|
||||
userScoreUpdateDTO.setRanking(0);//位次
|
||||
userScoreUpdateDTO.setCreateBy(userId);
|
||||
userScoreUpdateDTO.setEducationalLevel("1");
|
||||
userScoreUpdateDTO.setBatch(batch);
|
||||
userScoreUpdateDTO.setId(null);
|
||||
userScoreUpdateDTO.setCreateTime(null);
|
||||
userScoreUpdateDTO.setUpdateTime(null);
|
||||
|
||||
YxUserScore yxUserScore = yxUserScoreService.saveUserScore(userScoreUpdateDTO);
|
||||
List<RecommendMajorDTO> recommendMajorDTOList = yxCalculationMajorService.calculationMajor(yxUserScore);
|
||||
|
||||
//创建新的志愿单信息
|
||||
YxVolunteer yxVolunteer = new YxVolunteer();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ZhouWenTao
|
||||
|
|
@ -81,6 +83,12 @@ public class UserScoreInfo implements Serializable {
|
|||
@ApiModelProperty(value = "录取批次")
|
||||
private String batch;
|
||||
|
||||
@JsonIgnore
|
||||
private String subjects;
|
||||
/**选考科目明细*/
|
||||
@ApiModelProperty(value = "选考科目明细")
|
||||
private List<String> subjectList = new ArrayList<>();
|
||||
|
||||
/**语文成绩*/
|
||||
@Excel(name = "语文成绩", width = 15)
|
||||
@ApiModelProperty(value = "语文成绩")
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -60,9 +60,9 @@ public class YxUserScore implements Serializable {
|
|||
private java.lang.String professionalCategoryChildren;
|
||||
|
||||
/**选课*/
|
||||
/*@Excel(name = "选课", width = 15)
|
||||
// @Excel(name = "选课", width = 15)
|
||||
@ApiModelProperty(value = "选课")
|
||||
private java.lang.String subjects;*/
|
||||
private java.lang.String subjects;
|
||||
/**专业成绩分(语文,数学,英语...)*/
|
||||
@Excel(name = "专业成绩分(语文,数学,英语...)", width = 15)
|
||||
@ApiModelProperty(value = "专业成绩分(语文,数学,英语...)")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.yx.service;
|
||||
|
||||
import org.jeecg.modules.yx.dto.UserScoreUpdateDTO;
|
||||
import org.jeecg.modules.yx.entity.YxUserScore;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
|
@ -54,4 +55,5 @@ public interface IYxUserScoreService extends IService<YxUserScore> {
|
|||
*/
|
||||
void closeUserScore(String userId);
|
||||
|
||||
YxUserScore saveUserScore(UserScoreUpdateDTO userScoreUpdateDTO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@ import org.springframework.beans.BeanUtils;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.jeecg.modules.yx.constant.YxConstant;
|
||||
|
|
@ -86,7 +84,12 @@ public class UserScoreService {
|
|||
if (StringUtils.isBlank(createBy)) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
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.update.LambdaUpdateWrapper;
|
||||
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.util.AssertUtils;
|
||||
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.YxUserScore;
|
||||
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.YxVolunteerMapper;
|
||||
import org.jeecg.modules.yx.service.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -163,4 +166,16 @@ public class YxUserScoreServiceImpl extends ServiceImpl<YxUserScoreMapper, YxUse
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue