mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-08 02:16:49 +08:00
Compare commits
24 Commits
250701-add
...
20251024-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f5e8fe08d | ||
|
|
6fe6f7c6e5 | ||
|
|
249a8d81a6 | ||
|
|
7abb00772b | ||
|
|
04e11f2e71 | ||
|
|
2feb149e92 | ||
|
|
16fa9cb028 | ||
|
|
cac466ba73 | ||
|
|
30d2a0cde2 | ||
|
|
541e542d9b | ||
|
|
aa04e16209 | ||
|
|
57e22492e5 | ||
|
|
1917647a99 | ||
|
|
f5f7ab3bc5 | ||
|
|
413a2ebc33 | ||
|
|
22db916abf | ||
|
|
8ce284ea7e | ||
|
|
c485757061 | ||
|
|
9a00b41cde | ||
|
|
59beaa5b74 | ||
|
|
9b9e97a8d4 | ||
|
|
200ec38038 | ||
|
|
7613f30ca7 | ||
|
|
248e0799bd |
@@ -45,10 +45,7 @@ import javax.annotation.Resource;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.concurrent.ForkJoinPool;
|
import java.util.concurrent.ForkJoinPool;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
@@ -407,4 +404,20 @@ public class ThirdApi {
|
|||||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||||
log.info("-------delOnLineById = " + resp);
|
log.info("-------delOnLineById = " + resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取字典信息
|
||||||
|
public List<Dict> getDictItems(CommonSearchVo searcher) {
|
||||||
|
try {
|
||||||
|
List<Dict> dictList = dictRemoteClient.getList(searcher);
|
||||||
|
if(!Objects.isNull(dictList) && dictList.size() > 0){
|
||||||
|
// List<String> dicts = dictList.stream().map(Dict::getValue).collect(Collectors.toList());
|
||||||
|
return dictList;
|
||||||
|
}else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("-------获取字典信息 = " + e.getMessage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,14 @@
|
|||||||
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.boe.feign.api.infrastructure.entity.CommonSearchVo;
|
||||||
|
import com.boe.feign.api.infrastructure.entity.Dict;
|
||||||
import com.xboe.api.ThirdApi;
|
import com.xboe.api.ThirdApi;
|
||||||
import com.xboe.module.course.dto.*;
|
import com.xboe.module.course.dto.*;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -169,19 +172,48 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
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<CourseCrowd> crowds=courseService.findCrowdByCourseId(id);
|
List<CourseCrowd> crowds=courseService.findCrowdByCourseId(id);
|
||||||
|
|
||||||
//
|
CommonSearchVo searcher = new CommonSearchVo();
|
||||||
|
searcher.setPid(637L);
|
||||||
|
searcher.setType(1);
|
||||||
|
List<Dict> dictList = thirdApi.getDictItems(searcher);
|
||||||
|
boolean isPermission = false;
|
||||||
|
if(dictList != null && dictList.size() > 0){
|
||||||
|
List<String> dicts = dictList.stream().map(Dict::getValue).collect(Collectors.toList());
|
||||||
|
isPermission = dicts.contains(course.getOrgId());
|
||||||
|
rs.put("dicts",dicts);
|
||||||
|
}
|
||||||
|
log.error("-------是否仅内网查看 = " + isPermission);
|
||||||
rs.put("course",course);
|
rs.put("course",course);
|
||||||
rs.put("contents",cclist);
|
rs.put("contents",cclist);
|
||||||
rs.put("sections",sectionlist);
|
rs.put("sections",sectionlist);
|
||||||
rs.put("teachers",teachers);
|
rs.put("teachers",teachers);
|
||||||
rs.put("crowds",crowds);
|
rs.put("crowds",crowds);
|
||||||
|
rs.put("isPermission",isPermission);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return success(rs);
|
return success(rs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@GetMapping("/getDictIds")
|
||||||
|
public JsonResponse<Map<String,Object>> getDictIds(Long pid,Integer type){
|
||||||
|
CommonSearchVo searcher = new CommonSearchVo();
|
||||||
|
if(pid==null || type ==null){
|
||||||
|
return badRequest("参数错误");
|
||||||
|
}
|
||||||
|
Map<String,Object> rs=new HashMap<String,Object>();
|
||||||
|
searcher.setPid(pid);
|
||||||
|
searcher.setType(type);
|
||||||
|
List<Dict> dictList = thirdApi.getDictItems(searcher);
|
||||||
|
rs.put("dicts",null);
|
||||||
|
if(dictList != null && dictList.size() > 0){
|
||||||
|
List<String> dicts = dictList.stream().map(Dict::getValue).collect(Collectors.toList());
|
||||||
|
rs.put("dicts",dicts);
|
||||||
|
}
|
||||||
|
return success(rs);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理员审核列表,教师的审核不在这里,此审核也应该移动CourseAuditApi中去
|
* 管理员审核列表,教师的审核不在这里,此审核也应该移动CourseAuditApi中去
|
||||||
* @param pager
|
* @param pager
|
||||||
|
|||||||
@@ -33,7 +33,10 @@ public class Course extends BaseEntity {
|
|||||||
|
|
||||||
/**所有的设备*/
|
/**所有的设备*/
|
||||||
public static int DEVICE_ALL=3;
|
public static int DEVICE_ALL=3;
|
||||||
|
|
||||||
|
/**仅内网*/
|
||||||
|
public static int DEVICE_INTERNAL=4;
|
||||||
|
|
||||||
/**未提交,草稿*/
|
/**未提交,草稿*/
|
||||||
public static final int STATUS_NONE=1;
|
public static final int STATUS_NONE=1;
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,8 @@ public class CourseServiceImpl implements ICourseService {
|
|||||||
filters.add(FieldFilters.in("device", Course.DEVICE_MOBILE, Course.DEVICE_ALL));
|
filters.add(FieldFilters.in("device", Course.DEVICE_MOBILE, Course.DEVICE_ALL));
|
||||||
} else if (dto.getDevice() == Course.DEVICE_ALL) {
|
} else if (dto.getDevice() == Course.DEVICE_ALL) {
|
||||||
filters.add(FieldFilters.eq("device", Course.DEVICE_ALL));
|
filters.add(FieldFilters.eq("device", Course.DEVICE_ALL));
|
||||||
|
}else if (dto.getDevice() == Course.DEVICE_INTERNAL) {
|
||||||
|
filters.add(FieldFilters.eq("device", Course.DEVICE_INTERNAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.xboe.module.popup.entity;
|
package com.xboe.module.popup.entity;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.xboe.core.SysConstant;
|
import com.xboe.core.SysConstant;
|
||||||
import com.xboe.core.orm.IdEntity;
|
import com.xboe.core.orm.IdEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -24,12 +25,14 @@ public class Popup extends IdEntity {
|
|||||||
* 开始时间
|
* 开始时间
|
||||||
* */
|
* */
|
||||||
@Column(name = "start_time")
|
@Column(name = "start_time")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime startTime;
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
* */
|
* */
|
||||||
@Column(name = "end_time")
|
@Column(name = "end_time")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime endTime;
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.alibaba.nacos.shaded.com.google.common.util.concurrent.RateLimiter;
|
import com.alibaba.nacos.shaded.com.google.common.util.concurrent.RateLimiter;
|
||||||
|
import com.boe.feign.api.infrastructure.entity.CommonSearchVo;
|
||||||
|
import com.boe.feign.api.infrastructure.entity.Dict;
|
||||||
import com.xboe.api.ThirdApi;
|
import com.xboe.api.ThirdApi;
|
||||||
import com.xboe.constants.CacheName;
|
import com.xboe.constants.CacheName;
|
||||||
import com.xboe.module.course.vo.TeacherVo;
|
import com.xboe.module.course.vo.TeacherVo;
|
||||||
@@ -233,7 +235,30 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
rs.put("contents",cclist);
|
rs.put("contents",cclist);
|
||||||
rs.put("sections",sectionlist);
|
rs.put("sections",sectionlist);
|
||||||
rs.put("teachers",teachers);
|
rs.put("teachers",teachers);
|
||||||
|
// 未选择仅内网时isPermission = false,不用区分内外网
|
||||||
|
boolean isPermission = false;
|
||||||
|
if(course.getDevice() ==4){
|
||||||
|
CommonSearchVo searcher = new CommonSearchVo();
|
||||||
|
searcher.setPid(637L);
|
||||||
|
searcher.setType(1);
|
||||||
|
List<Dict> dictList = thirdApi.getDictItems(searcher);
|
||||||
|
if(dictList != null && dictList.size() > 0){
|
||||||
|
List<String> dicts = dictList.stream().map(Dict::getValue).collect(Collectors.toList());
|
||||||
|
// 选择仅内网 并且字典中配置了此课程资源归属,那么只能内网观看 返回 truw
|
||||||
|
isPermission = dicts.contains(course.getOrgId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rs.put("isPermission",isPermission);
|
||||||
|
|
||||||
|
CommonSearchVo warn = new CommonSearchVo();
|
||||||
|
warn.setCode("course_warn");
|
||||||
|
warn.setType(1);
|
||||||
|
List<Dict> warns = thirdApi.getDictItems(warn);
|
||||||
|
if(warns != null && warns.size() > 0){
|
||||||
|
rs.put("warn",warns.get(0).getValue());
|
||||||
|
rs.put("warnTitle",warns.get(0).getName());
|
||||||
|
}
|
||||||
|
|
||||||
//检查是否已报名
|
//检查是否已报名
|
||||||
StudyCourse sc=service.findByCourseIdAndAid(cid, aid);
|
StudyCourse sc=service.findByCourseIdAndAid(cid, aid);
|
||||||
if(pass==true && sc==null) {
|
if(pass==true && sc==null) {
|
||||||
@@ -567,8 +592,8 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
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);
|
||||||
return success(true);
|
return success(true);
|
||||||
}catch(Exception e) {
|
}catch(Exception e) {
|
||||||
log.error("记录内容学习完成错误",e);
|
log.error("记录内容学习完成错误",e);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.xboe.module.course.entity.CourseExam;
|
|||||||
import com.xboe.school.study.dao.StudyCourseDao;
|
import com.xboe.school.study.dao.StudyCourseDao;
|
||||||
import com.xboe.school.study.dao.StudyCourseItemDao;
|
import com.xboe.school.study.dao.StudyCourseItemDao;
|
||||||
import com.xboe.school.study.dao.StudyExamDao;
|
import com.xboe.school.study.dao.StudyExamDao;
|
||||||
|
import com.xboe.school.study.entity.StudyCourse;
|
||||||
import com.xboe.school.study.entity.StudyCourseItem;
|
import com.xboe.school.study.entity.StudyCourseItem;
|
||||||
import com.xboe.school.study.entity.StudyExam;
|
import com.xboe.school.study.entity.StudyExam;
|
||||||
import com.xboe.school.study.service.IStudyExamService;
|
import com.xboe.school.study.service.IStudyExamService;
|
||||||
@@ -170,15 +171,32 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
|||||||
}
|
}
|
||||||
builder.addGroupBy("studyId");
|
builder.addGroupBy("studyId");
|
||||||
List<StudyExam> list1 = dao.findList(builder.builder());
|
List<StudyExam> list1 = dao.findList(builder.builder());
|
||||||
log.info("------------QueryBuilder list1.size = " + list1.size() + ",0 = " + list1.get(0));
|
if(list1 != null && list1.size() > 0){
|
||||||
|
log.info("----------StudyExam--QueryBuilder list1.size = " + list1.size() + ",0 = " + list1.get(0));
|
||||||
for(StudyExam item : list1){
|
for(StudyExam item : list1){
|
||||||
log.info("-----------------CourseId = " + item.getCourseId() + " , StudyId = " + item.getStudyId() + " , StudentId = " + item.getStudentId());
|
log.info("--------------StudyExam---CourseId = " + item.getCourseId() + " , StudyId = " + item.getStudyId() + " , StudentId = " + item.getStudentId());
|
||||||
int totalContent = courseContentDao.getCount(item.getCourseId());
|
int totalContent = courseContentDao.getCount(item.getCourseId());
|
||||||
log.info("----------准备判断进度-------totalContent = " + totalContent);
|
log.info("--------StudyExam--准备判断进度-------totalContent = " + totalContent);
|
||||||
scDao.finishCheck1(item.getStudyId(),item.getCourseId(),totalContent);
|
scDao.finishCheck1(item.getStudyId(),item.getCourseId(),totalContent);
|
||||||
log.info("----------判断进度完毕----------------------");
|
log.info("--------StudyExam--判断进度完毕----------------------");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
QueryBuilder builder1 = QueryBuilder.from(StudyCourse.class);
|
||||||
|
if (StringUtils.isEmpty(courseId)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
builder1.addFilter(FieldFilters.eq("courseId", courseId));
|
||||||
|
List<StudyCourse> list2 = scDao.findList(builder1.builder());
|
||||||
|
log.info("------------StudyCourse list2.size = " + list2.size() + ",0 = " + list2.get(0));
|
||||||
|
for(StudyCourse item : list2){
|
||||||
|
log.info("-------------StudyCourse----CourseId = " + item.getCourseId() + " , StudyId = " + item.getId() + " , StudentId = " + item.getAid());
|
||||||
|
int totalContent = courseContentDao.getCount(item.getCourseId());
|
||||||
|
log.info("--------StudyCourse--准备判断进度-------totalContent = " + totalContent);
|
||||||
|
scDao.finishCheck1(item.getId(),item.getCourseId(),totalContent);
|
||||||
|
log.info("--------StudyCourse--判断进度完毕----------------------");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
log.info("------异常----------------------:" +exception.getMessage());
|
log.info("------异常----------------------:" +exception.getMessage());
|
||||||
|
|||||||
@@ -282,11 +282,12 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String sql = "select a.id, a.course_id, a.course_name, a.aname, " +
|
String sql = "select a.id, a.course_id, a.course_name, a.aname, " +
|
||||||
"IFNULL(b.finish_time, '0') as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " +
|
"IFNULL(b.finish_time, '0') as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status,b.score " +
|
||||||
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "' and aname like '%"+name+"%') a " +
|
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "' and aname like '%"+name+"%') a " +
|
||||||
"left join " +
|
"left join " +
|
||||||
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
|
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status,MAX(item.score) score " +
|
||||||
"from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " +
|
"from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " +
|
||||||
"where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' and item.aname like '%"+name+"%' group by bsc.id) b " +
|
"where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' and item.aname like '%"+name+"%' group by bsc.id) b " +
|
||||||
"on a.course_id = b.course_id and a.id = b.id " +
|
"on a.course_id = b.course_id and a.id = b.id " +
|
||||||
@@ -315,6 +316,9 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
sc.setProgress(Integer.valueOf(objs[5].toString()));
|
sc.setProgress(Integer.valueOf(objs[5].toString()));
|
||||||
sc.setStatus(Integer.valueOf(objs[6].toString()));
|
sc.setStatus(Integer.valueOf(objs[6].toString()));
|
||||||
sc.setAname(objs[3].toString());
|
sc.setAname(objs[3].toString());
|
||||||
|
if(objs[7] != null){
|
||||||
|
sc.setScore(Float.valueOf(objs[7].toString()));
|
||||||
|
}
|
||||||
item.add(sc);
|
item.add(sc);
|
||||||
}
|
}
|
||||||
log.info("资源完成情况人员"+item);
|
log.info("资源完成情况人员"+item);
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ xboe:
|
|||||||
api:
|
api:
|
||||||
cross_filter: true
|
cross_filter: true
|
||||||
local:
|
local:
|
||||||
dev: true
|
dev: false
|
||||||
upload:
|
upload:
|
||||||
file:
|
file:
|
||||||
temp_path: /tmp
|
temp_path: /tmp
|
||||||
|
|||||||
Reference in New Issue
Block a user