mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
Compare commits
9 Commits
zcwy1021-l
...
yx1107-bug
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acc62c85e0 | ||
|
|
ec00f55606 | ||
|
|
fc94e4aedd | ||
|
|
ae75aedff9 | ||
|
|
5b691c5bb8 | ||
|
|
b0f01c6300 | ||
|
|
e51d4dd8cb | ||
|
|
bbda82b8f5 | ||
|
|
fec28f5baf |
@@ -15,7 +15,7 @@ public class CaseScheduledTasks {
|
|||||||
/**
|
/**
|
||||||
* 每月的第一天的1:00执行
|
* 每月的第一天的1:00执行
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 1 1 * ?")
|
// @Scheduled(cron = "0 0 1 1 * ?")
|
||||||
public void refreshViewsRankOfMajor() {
|
public void refreshViewsRankOfMajor() {
|
||||||
casesService.refreshViewsRankOfMajor();
|
casesService.refreshViewsRankOfMajor();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import com.xboe.core.orm.FieldFilters;
|
|||||||
import com.xboe.module.course.dto.CourseQueryDto;
|
import com.xboe.module.course.dto.CourseQueryDto;
|
||||||
import com.xboe.module.course.dto.CourseTeacherDto;
|
import com.xboe.module.course.dto.CourseTeacherDto;
|
||||||
import com.xboe.module.course.dto.RankingDto;
|
import com.xboe.module.course.dto.RankingDto;
|
||||||
import com.xboe.module.course.dto.TeacherCourseDto;
|
|
||||||
import com.xboe.module.course.entity.*;
|
import com.xboe.module.course.entity.*;
|
||||||
import com.xboe.module.course.service.ICourseContentService;
|
import com.xboe.module.course.service.ICourseContentService;
|
||||||
import com.xboe.module.course.service.ICourseSectionService;
|
import com.xboe.module.course.service.ICourseSectionService;
|
||||||
@@ -29,8 +28,6 @@ import com.xboe.school.study.entity.StudyHomeWork;
|
|||||||
import com.xboe.school.study.service.IStudyCourseService;
|
import com.xboe.school.study.service.IStudyCourseService;
|
||||||
import com.xboe.school.study.service.IStudyHomeWorkService;
|
import com.xboe.school.study.service.IStudyHomeWorkService;
|
||||||
import com.xboe.school.study.service.IStudyService;
|
import com.xboe.school.study.service.IStudyService;
|
||||||
import com.xboe.system.user.entity.User;
|
|
||||||
import com.xboe.system.user.service.IUserService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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;
|
||||||
@@ -63,8 +60,7 @@ public class CoursePortalApi extends ApiBaseController{
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ICourseService courseService;
|
private ICourseService courseService;
|
||||||
@Resource
|
|
||||||
private IUserService userService;
|
|
||||||
@Resource
|
@Resource
|
||||||
private ITeacherService teacherService;
|
private ITeacherService teacherService;
|
||||||
|
|
||||||
@@ -282,7 +278,7 @@ public class CoursePortalApi extends ApiBaseController{
|
|||||||
if (!Objects.isNull(studyCourse)){
|
if (!Objects.isNull(studyCourse)){
|
||||||
pass = true;
|
pass = true;
|
||||||
}
|
}
|
||||||
if (Objects.isNull(studyCourse) && !courseCrowdList.isEmpty()) {
|
if (Objects.isNull(studyCourse) && !courseCrowdList.isEmpty() && !StringUtils.isEmpty(audiences)) {
|
||||||
List<String> audienceList = Arrays.asList(audiences.split(",")); // 此用户所在受众组
|
List<String> audienceList = Arrays.asList(audiences.split(",")); // 此用户所在受众组
|
||||||
log.error("---------------参数------------ audienceList = " + audienceList);
|
log.error("---------------参数------------ audienceList = " + audienceList);
|
||||||
for (CourseCrowd c : courseCrowdList) {
|
for (CourseCrowd c : courseCrowdList) {
|
||||||
@@ -305,30 +301,17 @@ public class CoursePortalApi extends ApiBaseController{
|
|||||||
List<CourseContent> cclist=contentService.getByCourseId(id);
|
List<CourseContent> cclist=contentService.getByCourseId(id);
|
||||||
List<CourseSection> sectionlist=sectionService.getByCourseId(id);
|
List<CourseSection> sectionlist=sectionService.getByCourseId(id);
|
||||||
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
|
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
|
||||||
List<TeacherCourseDto> teacherCourseDtos = new ArrayList<>();
|
|
||||||
|
|
||||||
//获取教师的介绍信息,因为一门课程 的教师不会太多,所以这里简单直接遍历查询,后续再优化
|
//获取教师的介绍信息,因为一门课程 的教师不会太多,所以这里简单直接遍历查询,后续再优化
|
||||||
for(CourseTeacher ct : teachers) {
|
for(CourseTeacher ct : teachers) {
|
||||||
TeacherCourseDto teacherCourseDto = new TeacherCourseDto();
|
|
||||||
Teacher t = teacherService.get(ct.getTeacherId());
|
Teacher t = teacherService.get(ct.getTeacherId());
|
||||||
User user = userService.get(ct.getTeacherId());
|
|
||||||
if(t!=null) {
|
if(t!=null) {
|
||||||
ct.setRemark(t.getDescription());
|
ct.setRemark(t.getDescription());
|
||||||
if(redisTemplate.opsForValue().get(ct.getTeacherId())!=null){
|
if(redisTemplate.opsForValue().get(ct.getTeacherId())!=null){
|
||||||
if(Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
|
if(Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
|
||||||
ct.setTeacherName("BOE教师");
|
ct.setTeacherName("BOE教师");
|
||||||
}
|
}
|
||||||
teacherCourseDto.setCourseId(ct.getCourseId());
|
|
||||||
teacherCourseDto.setTeacherName(ct.getTeacherName());
|
|
||||||
teacherCourseDto.setTeacherId(ct.getTeacherId());
|
|
||||||
teacherCourseDto.setCode(ct.getCode());
|
|
||||||
teacherCourseDto.setRemark(ct.getRemark());
|
|
||||||
teacherCourseDto.setSysCreateAid(ct.getSysCreateAid());
|
|
||||||
teacherCourseDto.setSysCreateBy(ct.getSysCreateBy());
|
|
||||||
teacherCourseDto.setSysCreateTime(ct.getSysCreateTime());
|
|
||||||
teacherCourseDto.setId(ct.getId());
|
|
||||||
teacherCourseDto.setUserNo(user.getUserNo());
|
|
||||||
teacherCourseDtos.add(teacherCourseDto);
|
|
||||||
}else if (redisTemplate.opsForValue().get(ct.getTeacherId())==null){
|
}else if (redisTemplate.opsForValue().get(ct.getTeacherId())==null){
|
||||||
List<String> list=new ArrayList<>();
|
List<String> list=new ArrayList<>();
|
||||||
list.add(ct.getTeacherId());
|
list.add(ct.getTeacherId());
|
||||||
@@ -336,17 +319,6 @@ public class CoursePortalApi extends ApiBaseController{
|
|||||||
if(Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
|
if(Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
|
||||||
ct.setTeacherName("BOE教师");
|
ct.setTeacherName("BOE教师");
|
||||||
}
|
}
|
||||||
teacherCourseDto.setCourseId(ct.getCourseId());
|
|
||||||
teacherCourseDto.setTeacherName(ct.getTeacherName());
|
|
||||||
teacherCourseDto.setTeacherId(ct.getTeacherId());
|
|
||||||
teacherCourseDto.setCode(ct.getCode());
|
|
||||||
teacherCourseDto.setRemark(ct.getRemark());
|
|
||||||
teacherCourseDto.setSysCreateAid(ct.getSysCreateAid());
|
|
||||||
teacherCourseDto.setSysCreateBy(ct.getSysCreateBy());
|
|
||||||
teacherCourseDto.setSysCreateTime(ct.getSysCreateTime());
|
|
||||||
teacherCourseDto.setId(ct.getId());
|
|
||||||
teacherCourseDto.setUserNo(user.getUserNo());
|
|
||||||
teacherCourseDtos.add(teacherCourseDto);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,7 +327,7 @@ public class CoursePortalApi extends ApiBaseController{
|
|||||||
rs.put("isCrowd",pass);
|
rs.put("isCrowd",pass);
|
||||||
rs.put("contents", cclist);
|
rs.put("contents", cclist);
|
||||||
rs.put("sections",sectionlist);
|
rs.put("sections",sectionlist);
|
||||||
rs.put("teachers",teacherCourseDtos);
|
rs.put("teachers",teachers);
|
||||||
//查询课程
|
//查询课程
|
||||||
return success(rs);
|
return success(rs);
|
||||||
|
|
||||||
|
|||||||
@@ -141,11 +141,11 @@ public class CourseWareApi extends ApiBaseController {
|
|||||||
String time = signStr.substring(0, signStr.indexOf("/"));// 时间字符中,long
|
String time = signStr.substring(0, signStr.indexOf("/"));// 时间字符中,long
|
||||||
String cfid = signStr.substring(index+1);// 文件路径
|
String cfid = signStr.substring(index+1);// 文件路径
|
||||||
|
|
||||||
if (!time.equals(cookieTime)) {
|
// if (!time.equals(cookieTime)) {
|
||||||
log.info("请求头时间和解析后的时间对比:"+"解析时间:"+time+" 请求头时间:"+cookieTime);
|
// log.info("请求头时间和解析后的时间对比:"+"解析时间:"+time+" 请求头时间:"+cookieTime);
|
||||||
log.info("解密后的字符串的时间拼接:"+signStr);
|
// log.info("解密后的字符串的时间拼接:"+signStr);
|
||||||
return badRequest("验证错误");
|
// return badRequest("验证错误");
|
||||||
}
|
// }
|
||||||
if(StringUtils.isBlank(cfid) || cfid.length()<10) {
|
if(StringUtils.isBlank(cfid) || cfid.length()<10) {
|
||||||
log.info("查看时间文件路径:"+cfid);
|
log.info("查看时间文件路径:"+cfid);
|
||||||
log.info("解密后的字符串的时间拼接:"+signStr);
|
log.info("解密后的字符串的时间拼接:"+signStr);
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.xboe.module.course.dto;
|
|
||||||
|
|
||||||
import com.xboe.module.course.entity.CourseTeacher;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class TeacherCourseDto extends CourseTeacher {
|
|
||||||
private String userNo;
|
|
||||||
}
|
|
||||||
@@ -177,7 +177,7 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
if (!Objects.isNull(studyCourse)){
|
if (!Objects.isNull(studyCourse)){
|
||||||
pass = true;
|
pass = true;
|
||||||
}
|
}
|
||||||
if (Objects.isNull(studyCourse) && !courseCrowdList.isEmpty()) {
|
if (Objects.isNull(studyCourse) && !courseCrowdList.isEmpty() && !StringUtils.isEmpty(audiences)) {
|
||||||
List<String> audienceList = Arrays.asList(audiences.split(",")); // 此用户所在受众组
|
List<String> audienceList = Arrays.asList(audiences.split(",")); // 此用户所在受众组
|
||||||
log.error("---------------参数------------ audienceList = " + audienceList);
|
log.error("---------------参数------------ audienceList = " + audienceList);
|
||||||
for (CourseCrowd c : courseCrowdList) {
|
for (CourseCrowd c : courseCrowdList) {
|
||||||
@@ -228,7 +228,7 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
|
|
||||||
//检查是否已报名
|
//检查是否已报名
|
||||||
StudyCourse sc=service.findByCourseIdAndAid(cid, aid);
|
StudyCourse sc=service.findByCourseIdAndAid(cid, aid);
|
||||||
if(pass==true && sc==null) {
|
if(sc==null) {
|
||||||
//未报名,这里直接报名
|
//未报名,这里直接报名
|
||||||
StudySignup signup=new StudySignup();
|
StudySignup signup=new StudySignup();
|
||||||
signup.setCourseId(cid);
|
signup.setCourseId(cid);
|
||||||
@@ -246,13 +246,14 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
signup.setSignTime(LocalDateTime.now());
|
signup.setSignTime(LocalDateTime.now());
|
||||||
sc=service.autoSignup(signup);
|
sc=service.autoSignup(signup);
|
||||||
}
|
}
|
||||||
if (sc !=null){
|
|
||||||
rs.put("studyId", sc.getId());//学习id
|
rs.put("signup",true);
|
||||||
rs.put("progress", sc.getProgress());
|
rs.put("studyId", sc.getId());//学习id
|
||||||
//查询上次学习的是什么资源。查询用户的学习情况
|
rs.put("progress", sc.getProgress());
|
||||||
List<StudyCourseItem> items=studyService.findByStudyId(sc.getId());
|
//查询上次学习的是什么资源。查询用户的学习情况
|
||||||
rs.put("contentStudys",items);//学习的内容
|
List<StudyCourseItem> items=studyService.findByStudyId(sc.getId());
|
||||||
}
|
rs.put("contentStudys",items);//学习的内容
|
||||||
|
|
||||||
return success(rs);
|
return success(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,14 @@ package com.xboe.school.study.dao;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import com.xboe.api.ThirdApi;
|
import com.xboe.api.ThirdApi;
|
||||||
|
import com.xboe.constants.CacheName;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.xboe.core.orm.BaseDao;
|
import com.xboe.core.orm.BaseDao;
|
||||||
@@ -26,6 +30,9 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
StudyCourseItemDao scItemDao;
|
StudyCourseItemDao scItemDao;
|
||||||
|
@Autowired
|
||||||
|
StringRedisTemplate redisTemplate;
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ThirdApi thirdApi;
|
private ThirdApi thirdApi;
|
||||||
@@ -36,6 +43,11 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
|||||||
* @param total
|
* @param total
|
||||||
*/
|
*/
|
||||||
public void finishCheck(String studyId,String courseId,Integer total,String token){
|
public void finishCheck(String studyId,String courseId,Integer total,String token){
|
||||||
|
|
||||||
|
if(StringUtils.isNotEmpty(redisTemplate.opsForValue().get(studyId + "_" + courseId + "_" + total))){
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
log.info("------1.完成情况检查---------------studyId = " + studyId + " , courseId = " + courseId + " , total = " + total );
|
log.info("------1.完成情况检查---------------studyId = " + studyId + " , courseId = " + courseId + " , total = " + total );
|
||||||
LocalDateTime now=LocalDateTime.now();
|
LocalDateTime now=LocalDateTime.now();
|
||||||
//已完成的内容
|
//已完成的内容
|
||||||
@@ -51,6 +63,8 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
|||||||
log.info("------3.完成情况检查---------------studyId = " + studyId + " , courseId = " + courseId + " , total = " + total );
|
log.info("------3.完成情况检查---------------studyId = " + studyId + " , courseId = " + courseId + " , total = " + total );
|
||||||
//以下注意,float类型,是否等于100对应
|
//以下注意,float类型,是否等于100对应
|
||||||
float percent=n*100/total;
|
float percent=n*100/total;
|
||||||
|
|
||||||
|
|
||||||
if(n>=total) {
|
if(n>=total) {
|
||||||
//自主报名的课程,代表学习完成
|
//自主报名的课程,代表学习完成
|
||||||
super.updateMultiFieldById(studyId,
|
super.updateMultiFieldById(studyId,
|
||||||
@@ -58,11 +72,13 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
|||||||
UpdateBuilder.create("lastTime",now),
|
UpdateBuilder.create("lastTime",now),
|
||||||
UpdateBuilder.create("finishTime",now),
|
UpdateBuilder.create("finishTime",now),
|
||||||
UpdateBuilder.create("status",StudyCourse.STATUS_FINISH));
|
UpdateBuilder.create("status",StudyCourse.STATUS_FINISH));
|
||||||
|
redisTemplate.opsForValue().set(studyId + "_" + courseId + "_" + total, "100", 24, TimeUnit.HOURS);
|
||||||
}else {
|
}else {
|
||||||
super.updateMultiFieldById(studyId,
|
super.updateMultiFieldById(studyId,
|
||||||
UpdateBuilder.create("progress",percent),
|
UpdateBuilder.create("progress",percent),
|
||||||
UpdateBuilder.create("lastTime",LocalDateTime.now()),
|
UpdateBuilder.create("lastTime",LocalDateTime.now()),
|
||||||
UpdateBuilder.create("status",StudyCourse.STATUS_STUDYING));
|
UpdateBuilder.create("status",StudyCourse.STATUS_STUDYING));
|
||||||
|
// redisTemplate.opsForValue().set(studyId, String.valueOf(percent), 10, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.xboe.system.api;
|
package com.xboe.system.api;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
@@ -11,12 +14,6 @@ import java.util.Set;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.xboe.core.SysConstant;
|
|
||||||
import com.xboe.standard.BaseConstant;
|
|
||||||
import com.xboe.system.assist.entity.XUploadResultDto;
|
|
||||||
import it.sauronsoftware.jave.Encoder;
|
|
||||||
import it.sauronsoftware.jave.MultimediaInfo;
|
|
||||||
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;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -118,17 +115,8 @@ public class SysUploaderApi extends ApiBaseController{
|
|||||||
// ex.printStackTrace();
|
// ex.printStackTrace();
|
||||||
log.error("处理失败",ex);
|
log.error("处理失败",ex);
|
||||||
}
|
}
|
||||||
XUploadResultDto dto=new XUploadResultDto();
|
|
||||||
String fileFullPath = SysConstant.getConfigValue(BaseConstant.CONFIG_UPLOAD_FILES_SAVEPATH) + xur.getFilePath();
|
return wrap(xur);
|
||||||
Encoder encoder = new Encoder();
|
|
||||||
MultimediaInfo m = encoder.getInfo(new File(fileFullPath));
|
|
||||||
Long ls = m.getDuration() / 1000;//秒
|
|
||||||
dto.setDuration(ls);
|
|
||||||
dto.setDisplayName(xur.getDisplayName());
|
|
||||||
dto.setFilePath(xur.getFilePath());
|
|
||||||
dto.setFileType(xur.getFileType());
|
|
||||||
dto.setHttpPath(xur.getHttpPath());
|
|
||||||
return wrap(dto);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("upload file error ",e);
|
log.error("upload file error ",e);
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
package com.xboe.system.assist.entity;
|
|
||||||
|
|
||||||
import com.xboe.core.upload.XUploadResult;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class XUploadResultDto extends XUploadResult {
|
|
||||||
private Long duration;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user