Compare commits

..

2 Commits

Author SHA1 Message Date
zhaolongfei
163425cad2 审计漏洞 2024-08-29 14:56:32 +08:00
zhaolongfei
3735c38001 删除考试根据名称条件筛选 2024-08-29 14:56:05 +08:00
5 changed files with 7 additions and 43 deletions

View File

@@ -125,7 +125,9 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<version>2.7.18</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.session</groupId> <groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId> <artifactId>spring-session-data-redis</artifactId>

View File

@@ -101,7 +101,7 @@ public class TeacherServiceImpl implements ITeacherService {
@Override @Override
public List<Teacher> findByName(String name) { public List<Teacher> findByName(String name) {
String hql="Select t.id,t.name,u.userNo from "+Teacher.class.getSimpleName()+" t,"+User.class.getSimpleName()+" u "; String hql="Select t.id,t.name,u.userNo from "+Teacher.class.getSimpleName()+" t,"+User.class.getSimpleName()+" u ";
hql+=" where t.id=u.id and t.status = 1 and (t.name like '%"+name+"%' or u.userNo=?1)"; hql+=" where t.id=u.id and (t.name like '%"+name+"%' or u.userNo=?1)";
List<Teacher> teachers=new ArrayList<Teacher>(); List<Teacher> teachers=new ArrayList<Teacher>();
try { try {
List<Object[]> list =dao.findListFields(hql,name); List<Object[]> list =dao.findListFields(hql,name);

View File

@@ -11,7 +11,6 @@ import com.xboe.api.vo.*;
import com.xboe.module.course.vo.TeacherVo; import com.xboe.module.course.vo.TeacherVo;
import com.xboe.module.usergroup.entity.UserGroupItem; import com.xboe.module.usergroup.entity.UserGroupItem;
import com.xboe.module.usergroup.service.IUserGroupService; import com.xboe.module.usergroup.service.IUserGroupService;
import com.xboe.school.study.dao.StudyCourseDao;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -67,8 +66,6 @@ import javax.servlet.http.HttpServletRequest;
@RequestMapping(value="/xboe/school/study/course") @RequestMapping(value="/xboe/school/study/course")
public class StudyCourseApi extends ApiBaseController{ public class StudyCourseApi extends ApiBaseController{
@Autowired @Autowired
IStudyCourseService service; IStudyCourseService service;
@@ -324,19 +321,8 @@ public class StudyCourseApi extends ApiBaseController{
if (StringUtils.isEmpty(token)) { if (StringUtils.isEmpty(token)) {
token = request.getHeader("token"); token = request.getHeader("token");
} }
//检查是否已存在 //检查是否已存在
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId()); StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
// 20240815 特训营结营考试 临时代码
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
// redisTemplate.opsForValue().set(item.getId(),item.getId());
// //设置过期时间为1天
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
// }else{
// return success("");
// }
if(item!=null) { if(item!=null) {
//如果记录存在但是进度不100无成情况就更新进度一期不会有这种情况 //如果记录存在但是进度不100无成情况就更新进度一期不会有这种情况
if(item.getProgress()<100 && sci.getProgress()>item.getProgress()) { if(item.getProgress()<100 && sci.getProgress()>item.getProgress()) {
@@ -421,14 +407,6 @@ public class StudyCourseApi extends ApiBaseController{
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId()); StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
if(item!=null) { if(item!=null) {
//如果记录存在但是进度不到100未完成情况就更新进度一期不会有这种情况 //如果记录存在但是进度不到100未完成情况就更新进度一期不会有这种情况
// 20240815 特训营结营考试 临时代码
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
// redisTemplate.opsForValue().set(item.getId(),item.getId());
// //设置过期时间为1天
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
// }else{
// return success("");
// }
if(item.getProgress()<100) { if(item.getProgress()<100) {
studyService.updateProcess(item.getId(),sci.getStudyId(),sci.getCourseId(), sci.getContentTotal(),100,token); studyService.updateProcess(item.getId(),sci.getStudyId(),sci.getCourseId(), sci.getContentTotal(),100,token);
} }
@@ -534,14 +512,6 @@ public class StudyCourseApi extends ApiBaseController{
token = request.getHeader("token"); token = request.getHeader("token");
} }
try { try {
// 20240815 特训营结营考试 临时代码
// if(itemId != null && redisTemplate.opsForValue().get(itemId)==null){
// redisTemplate.opsForValue().set(itemId,itemId);
// //设置过期时间为1天
// redisTemplate.expire(itemId, 60, TimeUnit.SECONDS);
// }else{
// return success(true);
// }
studyService.finishVideoStudyItem(itemId, studyId,courseId,cnum,token); studyService.finishVideoStudyItem(itemId, studyId,courseId,cnum,token);
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token); List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
log.info("在线课学习记录"+allUserList); log.info("在线课学习记录"+allUserList);
@@ -724,9 +694,8 @@ public class StudyCourseApi extends ApiBaseController{
} }
} }
@RequestMapping(value="/study-course-content",method = {RequestMethod.GET,RequestMethod.POST}) @RequestMapping(value="/study-course-content",method = {RequestMethod.GET,RequestMethod.POST})
public JsonResponse<StudyCourseItem> findStudyCourseItem(String studyId,String contentId, HttpServletRequest request){ public JsonResponse<StudyCourseItem> findStudyCourseItem(String studyId,String contentId){
if(StringUtils.isBlank(studyId)){ if(StringUtils.isBlank(studyId)){
return error("无学习信息"); return error("无学习信息");
} }

View File

@@ -7,7 +7,6 @@ import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import com.xboe.api.ThirdApi; import com.xboe.api.ThirdApi;
import com.xboe.school.study.dao.StudyCourseDao;
import com.xboe.school.study.entity.StudyCourse; import com.xboe.school.study.entity.StudyCourse;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -33,8 +32,6 @@ import javax.servlet.http.HttpServletRequest;
@RestController @RestController
@RequestMapping(value="/xboe/school/study/exam") @RequestMapping(value="/xboe/school/study/exam")
public class StudyExamApi extends ApiBaseController{ public class StudyExamApi extends ApiBaseController{
@Autowired
StudyCourseDao scDao;
@Autowired @Autowired
IStudyExamService sexamService; IStudyExamService sexamService;

View File

@@ -98,12 +98,8 @@ public class StudyServiceImpl implements IStudyService{
//sci.setProgress(100);//直接设置为学习完成 //sci.setProgress(100);//直接设置为学习完成
sci.setLastTime(ldt); sci.setLastTime(ldt);
scItemDao.saveOrUpdate(sci); scItemDao.saveOrUpdate(sci);
if (sci.getId() != null){
dto.setStudyItemId(sci.getId()); dto.setStudyItemId(sci.getId());
}else {
log.info("学习记录插入失败"+sci.getId());
throw new IllegalArgumentException("学习记录插入失败");
}
//检查是否全部学习完成 //检查是否全部学习完成
scDao.finishCheck(dto.getStudyId(),dto.getCourseId(),dto.getContentTotal(),token); scDao.finishCheck(dto.getStudyId(),dto.getCourseId(),dto.getContentTotal(),token);