mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 01:46:47 +08:00
Compare commits
26 Commits
250701-add
...
20251030-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20e3b001d5 | ||
|
|
a37f90aeaa | ||
|
|
e767345c1e | ||
|
|
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 java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
@@ -407,4 +404,20 @@ public class ThirdApi {
|
||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,8 +358,10 @@ public class CourseAuditApi extends ApiBaseController{
|
||||
//修改在线课开课状态=已开课
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
CourseParam param = new CourseParam();
|
||||
param.setId(courseId);
|
||||
thirdApi.updateOnLineStatua(param,token);
|
||||
param.setId(c.getId());
|
||||
param.setOrgId(c.getOrgId());
|
||||
param.setOrgName(c.getOrgName());
|
||||
thirdApi.updateOrSaveCourse(param,token);
|
||||
}
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
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.module.course.dto.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -169,19 +172,48 @@ public class CourseManageApi extends ApiBaseController{
|
||||
List<CourseSection> sectionlist=sectionService.getByCourseId(id);
|
||||
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(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("contents",cclist);
|
||||
rs.put("sections",sectionlist);
|
||||
rs.put("teachers",teachers);
|
||||
rs.put("crowds",crowds);
|
||||
|
||||
rs.put("isPermission",isPermission);
|
||||
|
||||
|
||||
|
||||
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中去
|
||||
* @param pager
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xboe.module.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.module.course.entity.CourseTeacherDeletedRecord;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseTeacherDeletedRecordDao extends BaseDao<CourseTeacherDeletedRecord> {
|
||||
}
|
||||
@@ -33,7 +33,10 @@ public class Course extends BaseEntity {
|
||||
|
||||
/**所有的设备*/
|
||||
public static int DEVICE_ALL=3;
|
||||
|
||||
|
||||
/**仅内网*/
|
||||
public static int DEVICE_INTERNAL=4;
|
||||
|
||||
/**未提交,草稿*/
|
||||
public static final int STATUS_NONE=1;
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.xboe.module.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* 课程任课教师删除记录
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE + "course_teacher_deleted_record")
|
||||
public class CourseTeacherDeletedRecord extends IdBaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 课程id
|
||||
*/
|
||||
@Column(name = "course_id", nullable = false, length = 20)
|
||||
private String courseId;
|
||||
|
||||
/**
|
||||
* 教师id,实际上就是aid
|
||||
*
|
||||
*/
|
||||
@Column(name = "teacher_id", nullable = false, length = 20)
|
||||
private String teacherId;
|
||||
|
||||
/**
|
||||
* 教师姓名
|
||||
*
|
||||
*/
|
||||
@Column(name = "teacher_name", length = 30)
|
||||
private String teacherName;
|
||||
|
||||
}
|
||||
@@ -15,9 +15,12 @@ import java.util.stream.Stream;
|
||||
import javax.annotation.Resource;
|
||||
import javax.management.Query;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.xboe.api.ThirdApi;
|
||||
import com.xboe.core.orm.*;
|
||||
import com.xboe.module.course.dao.*;
|
||||
import com.xboe.module.course.entity.*;
|
||||
import com.xboe.school.study.dao.StudyCourseDao;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -41,24 +44,9 @@ import com.xboe.common.beans.KeyValue;
|
||||
import com.xboe.common.utils.IDGenerator;
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.event.IEventDataSender;
|
||||
import com.xboe.module.course.dao.CourseContentDao;
|
||||
import com.xboe.module.course.dao.CourseCrowdDao;
|
||||
import com.xboe.module.course.dao.CourseDao;
|
||||
import com.xboe.module.course.dao.CourseExamDao;
|
||||
import com.xboe.module.course.dao.CourseHRBPAuditDao;
|
||||
import com.xboe.module.course.dao.CourseHomeWorkDao;
|
||||
import com.xboe.module.course.dao.CourseSectionDao;
|
||||
import com.xboe.module.course.dao.CourseTeacherDao;
|
||||
import com.xboe.module.course.dao.CourseUpdateLogDao;
|
||||
import com.xboe.module.course.dto.CourseFullDto;
|
||||
import com.xboe.module.course.dto.CourseQueryDto;
|
||||
import com.xboe.module.course.dto.RankingDto;
|
||||
import com.xboe.module.course.entity.Course;
|
||||
import com.xboe.module.course.entity.CourseCrowd;
|
||||
import com.xboe.module.course.entity.CourseHRBPAudit;
|
||||
import com.xboe.module.course.entity.CourseSection;
|
||||
import com.xboe.module.course.entity.CourseTeacher;
|
||||
import com.xboe.module.course.entity.CourseUpdateLog;
|
||||
import com.xboe.module.course.service.ICourseFullTextSearch;
|
||||
import com.xboe.module.course.service.ICourseService;
|
||||
import com.xboe.module.interaction.service.ICourseGradeService;
|
||||
@@ -125,8 +113,9 @@ public class CourseServiceImpl implements ICourseService {
|
||||
@Resource
|
||||
RestHighLevelClient restHighLevelClient;
|
||||
|
||||
@Resource
|
||||
private CourseTeacherDeletedRecordDao courseTeacherDeletedRecordDao;
|
||||
|
||||
|
||||
/**
|
||||
* 生成过滤条件
|
||||
*
|
||||
@@ -183,6 +172,8 @@ public class CourseServiceImpl implements ICourseService {
|
||||
filters.add(FieldFilters.in("device", Course.DEVICE_MOBILE, Course.DEVICE_ALL));
|
||||
} else if (dto.getDevice() == 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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -279,13 +270,13 @@ public class CourseServiceImpl implements ICourseService {
|
||||
//// Set<String>list=new HashSet<>();
|
||||
//// if(s!=null&&!s.isEmpty()){
|
||||
//// list=Arrays.stream(s.split(",")).collect(Collectors.toSet());
|
||||
//// }else {
|
||||
//// }else {
|
||||
//// Set<String> ss = getSeache(dto);
|
||||
//// String courseSearch=String.join(",",ss);
|
||||
//// redisTemplate.opsForValue().set("course_search",courseSearch);
|
||||
//// //设置过期时间为1分钟
|
||||
//// redisTemplate.expire("course_search", 1, TimeUnit.MINUTES);
|
||||
//// }
|
||||
//// }
|
||||
// Set<String> list = getSeache(dto);
|
||||
// //有权限的查询,也同时查询出创建人的数据,在权限上
|
||||
// if(TempFilterConfig.Manager_CourseFile_ByOrgIds) {
|
||||
@@ -365,8 +356,9 @@ public class CourseServiceImpl implements ICourseService {
|
||||
// // 使用distinct()配合自定义的去重条件
|
||||
// .filter(distinctByKey(c -> c.getId()))
|
||||
// .collect(Collectors.toList());
|
||||
//// PageList<Course> rs=courseDao.findPage(pageIndex, pageSize, filters, oc);
|
||||
//// long endTime = System.nanoTime();
|
||||
|
||||
/// / PageList<Course> rs=courseDao.findPage(pageIndex, pageSize, filters, oc);
|
||||
/// / long endTime = System.nanoTime();
|
||||
// //log.info("查询出的条数:"+rs.getCount());
|
||||
// if(!mergedList.isEmpty()){
|
||||
// //去掉未发布的课程
|
||||
@@ -423,30 +415,30 @@ public class CourseServiceImpl implements ICourseService {
|
||||
if (TempFilterConfig.Manager_CourseFile_ByOrgIds) {
|
||||
if (dto.getIsSystemAdmin() == null || !dto.getIsSystemAdmin()) {
|
||||
List<String> finalStrings = strings;
|
||||
log.info("dto为"+dto);
|
||||
if(dto.getIsCreateCourse()!=null&&dto.getIsCreateCourse()){
|
||||
log.info("dto为" + dto);
|
||||
if (dto.getIsCreateCourse() != null && dto.getIsCreateCourse()) {
|
||||
listByFilters2.removeIf(e -> {
|
||||
//去掉未发布的课程
|
||||
if (!e.getPublished() && seache.contains(e.getId()) && !finalStrings.contains(e.getOrgId()) && !dto.getOrgAid().equals(e.getSysCreateAid())) {
|
||||
return true;
|
||||
}
|
||||
//去掉所有条件都不符合的课程
|
||||
if(!seache.contains(e.getId())&&!dto.getReadIds().contains(e.getId())&& !finalStrings.contains(e.getOrgId()) && !dto.getOrgAid().equals(e.getSysCreateAid())){
|
||||
if (!seache.contains(e.getId()) && !dto.getReadIds().contains(e.getId()) && !finalStrings.contains(e.getOrgId()) && !dto.getOrgAid().equals(e.getSysCreateAid())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
//将需要隐藏的做标记
|
||||
listByFilters2.forEach(e -> {
|
||||
if ((seache.contains(e.getId())||dto.getReadIds().contains(e.getOrgId())) && !finalStrings.contains(e.getOrgId()) && !dto.getOrgAid().equals(e.getSysCreateAid())) {
|
||||
if ((seache.contains(e.getId()) || dto.getReadIds().contains(e.getOrgId())) && !finalStrings.contains(e.getOrgId()) && !dto.getOrgAid().equals(e.getSysCreateAid())) {
|
||||
e.setIsPermission(false);
|
||||
} else {
|
||||
e.setIsPermission(true);
|
||||
}
|
||||
});
|
||||
listByFilters2.sort(Comparator.comparing(Course::getIsPermission).reversed());
|
||||
}else{
|
||||
List<Course> collect = listByFilters2.stream().filter(e ->dto.getReadIds().contains(e.getOrgId())||dto.getOrgAid().equals(e.getSysCreateAid())||finalStrings.contains(e.getOrgId())).collect(Collectors.toList());
|
||||
} else {
|
||||
List<Course> collect = listByFilters2.stream().filter(e -> dto.getReadIds().contains(e.getOrgId()) || dto.getOrgAid().equals(e.getSysCreateAid()) || finalStrings.contains(e.getOrgId())).collect(Collectors.toList());
|
||||
List<Course> paginate = paginate(collect, pageIndex, pageSize);
|
||||
PageList<Course> rs = new PageList<>();
|
||||
rs.setCount(collect.size());
|
||||
@@ -866,7 +858,7 @@ public class CourseServiceImpl implements ICourseService {
|
||||
}
|
||||
|
||||
// 删除ES数据
|
||||
deletedStudyResourceBatchByCourseIdAndType(id,c.getType());
|
||||
deletedStudyResourceBatchByCourseIdAndType(id, c.getType());
|
||||
} else {
|
||||
//彻底删除,课件设置为无课程状态
|
||||
courseDao.setDeleted(id);
|
||||
@@ -1000,6 +992,8 @@ public class CourseServiceImpl implements ICourseService {
|
||||
c.setSysVersion(courseDao.getVersion(c.getId()));
|
||||
full.getCourse().setSysVersion(c.getSysVersion());
|
||||
|
||||
// 兼容处理,记录下删除的关联数据
|
||||
createCourseTeacherDeletedRecord(c.getId());
|
||||
//先清空教师信息, 教师信息如果不一样了,也要加入到日志中
|
||||
courseTeacherDao.deleteByField("courseId", c.getId());
|
||||
if (full.getTeachers() != null && !full.getTeachers().isEmpty()) {
|
||||
@@ -1054,6 +1048,8 @@ public class CourseServiceImpl implements ICourseService {
|
||||
c.setSysVersion(courseDao.getVersion(c.getId()));
|
||||
full.getCourse().setSysVersion(c.getSysVersion());
|
||||
|
||||
// 兼容处理,记录下删除的关联数据
|
||||
createCourseTeacherDeletedRecord(c.getId());
|
||||
//先清空教师信息, 教师信息如果不一样了,也要加入到日志中
|
||||
courseTeacherDao.deleteByField("courseId", c.getId());
|
||||
if (full.getTeachers() != null && !full.getTeachers().isEmpty()) {
|
||||
@@ -1089,6 +1085,8 @@ public class CourseServiceImpl implements ICourseService {
|
||||
c.setPublishTime(LocalDateTime.now());
|
||||
courseDao.update(c);
|
||||
|
||||
// 兼容处理,记录下删除的关联数据
|
||||
createCourseTeacherDeletedRecord(c.getId());
|
||||
//先清空教师信息, 教师信息如果不一样了,也要加入到日志中
|
||||
courseTeacherDao.deleteByField("courseId", c.getId());
|
||||
if (full.getTeachers() != null && !full.getTeachers().isEmpty()) {
|
||||
@@ -2011,4 +2009,25 @@ public class CourseServiceImpl implements ICourseService {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除boe_course_teacher数据时把删除的数据储存到boe_course_teacher_deleted_record表
|
||||
* boe_course_teacher表没有deleted字段,兼容处理
|
||||
*
|
||||
* @param courseId 课程ID
|
||||
*/
|
||||
private void createCourseTeacherDeletedRecord(String courseId) {
|
||||
List<CourseTeacherDeletedRecord> courseTeacherList = courseTeacherDao.findList(FieldFilters.eq("courseId", courseId)).stream().map(ct -> {
|
||||
CourseTeacherDeletedRecord courseTeacherDeletedRecord = new CourseTeacherDeletedRecord();
|
||||
courseTeacherDeletedRecord.setCourseId(ct.getCourseId());
|
||||
courseTeacherDeletedRecord.setTeacherId(ct.getTeacherId());
|
||||
courseTeacherDeletedRecord.setTeacherName(ct.getTeacherName());
|
||||
return courseTeacherDeletedRecord;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if (CollUtil.isNotEmpty(courseTeacherList)) {
|
||||
courseTeacherDeletedRecordDao.saveList(courseTeacherList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xboe.module.popup.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import lombok.Data;
|
||||
@@ -24,12 +25,14 @@ public class Popup extends IdEntity {
|
||||
* 开始时间
|
||||
* */
|
||||
@Column(name = "start_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
* */
|
||||
@Column(name = "end_time")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class QuestionServiceImpl implements IQuestionService {
|
||||
// filters.add(FieldFilters.or(FieldFilters.like("title", questionDto.getKeyword()), FieldFilters.like("content", questionDto.getKeyword())));
|
||||
List<IFieldFilter> iFieldFilters = new ArrayList<>();
|
||||
iFieldFilters.add(FieldFilters.like("title", questionDto.getKeyword()));
|
||||
iFieldFilters.add(FieldFilters.like("title", questionDto.getKeyword()));
|
||||
iFieldFilters.add(FieldFilters.like("content", questionDto.getKeyword()));
|
||||
iFieldFilters.add(FieldFilters.like("sysCreateBy", questionDto.getKeyword()));
|
||||
filters.add(FieldFilters.or(iFieldFilters));
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
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.constants.CacheName;
|
||||
import com.xboe.module.course.vo.TeacherVo;
|
||||
@@ -233,7 +235,30 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
rs.put("contents",cclist);
|
||||
rs.put("sections",sectionlist);
|
||||
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);
|
||||
if(pass==true && sc==null) {
|
||||
@@ -567,8 +592,8 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
}
|
||||
try {
|
||||
studyService.finishVideoStudyItem(itemId, studyId,courseId,cnum,token);
|
||||
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
||||
log.info("在线课学习记录"+allUserList);
|
||||
// List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
||||
// log.info("在线课学习记录"+allUserList);
|
||||
return success(true);
|
||||
}catch(Exception 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.StudyCourseItemDao;
|
||||
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.StudyExam;
|
||||
import com.xboe.school.study.service.IStudyExamService;
|
||||
@@ -170,15 +171,32 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
||||
}
|
||||
builder.addGroupBy("studyId");
|
||||
List<StudyExam> list1 = dao.findList(builder.builder());
|
||||
log.info("------------QueryBuilder list1.size = " + list1.size() + ",0 = " + list1.get(0));
|
||||
|
||||
for(StudyExam item : list1){
|
||||
log.info("-----------------CourseId = " + item.getCourseId() + " , StudyId = " + item.getStudyId() + " , StudentId = " + item.getStudentId());
|
||||
int totalContent = courseContentDao.getCount(item.getCourseId());
|
||||
log.info("----------准备判断进度-------totalContent = " + totalContent);
|
||||
scDao.finishCheck1(item.getStudyId(),item.getCourseId(),totalContent);
|
||||
log.info("----------判断进度完毕----------------------");
|
||||
if(list1 != null && list1.size() > 0){
|
||||
log.info("----------StudyExam--QueryBuilder list1.size = " + list1.size() + ",0 = " + list1.get(0));
|
||||
for(StudyExam item : list1){
|
||||
log.info("--------------StudyExam---CourseId = " + item.getCourseId() + " , StudyId = " + item.getStudyId() + " , StudentId = " + item.getStudentId());
|
||||
int totalContent = courseContentDao.getCount(item.getCourseId());
|
||||
log.info("--------StudyExam--准备判断进度-------totalContent = " + totalContent);
|
||||
scDao.finishCheck1(item.getStudyId(),item.getCourseId(),totalContent);
|
||||
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) {
|
||||
exception.printStackTrace();
|
||||
log.info("------异常----------------------:" +exception.getMessage());
|
||||
|
||||
@@ -282,11 +282,12 @@ public class StudyServiceImpl implements IStudyService{
|
||||
return pageList;
|
||||
}
|
||||
}
|
||||
|
||||
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 " +
|
||||
"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 " +
|
||||
"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 " +
|
||||
@@ -315,6 +316,9 @@ public class StudyServiceImpl implements IStudyService{
|
||||
sc.setProgress(Integer.valueOf(objs[5].toString()));
|
||||
sc.setStatus(Integer.valueOf(objs[6].toString()));
|
||||
sc.setAname(objs[3].toString());
|
||||
if(objs[7] != null){
|
||||
sc.setScore(Float.valueOf(objs[7].toString()));
|
||||
}
|
||||
item.add(sc);
|
||||
}
|
||||
log.info("资源完成情况人员"+item);
|
||||
|
||||
Reference in New Issue
Block a user