Compare commits

...

54 Commits

Author SHA1 Message Date
Wangxxz
fec28f5baf 讲师管理-查询讲师时加启用条件判断 2024-10-20 14:24:04 +08:00
nisen
18bb8a434a Merge branch 'master-0705' into 121-master 2024-09-05 14:57:17 +08:00
nisen
2ae3d99f21 Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 19:44:02 +08:00
zhaolongfei
89573debef 在线课考试添加任务计算,redis放开 2024-08-23 19:43:18 +08:00
nisen
457597eabc Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 19:28:25 +08:00
zhaolongfei
24ae3c0ec6 在线课考试添加任务计算,暂时注释redis 2024-08-23 19:27:31 +08:00
zhaolongfei
fffa12344a 在线课考试添加任务计算,回退 2024-08-23 18:54:38 +08:00
nisen
52a58a6c6f Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 18:45:46 +08:00
zhaolongfei
a4b034752d 在线课考试添加任务计算 2024-08-23 18:45:10 +08:00
nisen
23e63062e9 Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 18:30:42 +08:00
zhaolongfei
06415d58ac 在线课考试添加任务计算 2024-08-23 18:30:05 +08:00
nisen
3fc8ce614d Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 18:00:57 +08:00
zhaolongfei
bebe36d39e 在线课考试添加任务计算 2024-08-23 18:00:26 +08:00
nisen
d4af5ba8d5 Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 17:59:12 +08:00
zhaolongfei
d42d1b2e83 处理study接口,添加接口访问限制次数 2024-08-23 17:55:53 +08:00
nisen
cf64f0406f Merge branch 'zcwy0815-llf' into master-0705 2024-08-15 20:20:14 +08:00
zhaolongfei
df3b0b95c1 处理study接口,studyitemid返回值为空的问题 2024-08-15 20:19:27 +08:00
nisen
f5ff666c07 Merge branch 'zcwy0815-llf' into master-0705 2024-08-15 19:57:23 +08:00
zhaolongfei
731e62c89f 处理study接口,studyitemid返回值为空的问题 2024-08-15 19:44:23 +08:00
zhaolongfei
7fe53c026e 处理study接口,studyitemid返回值为空的问题 2024-08-15 19:26:10 +08:00
zhaolongfei
6492e3b0dd 处理study接口,studyitemid返回值为空的问题 2024-08-15 19:18:28 +08:00
zhaolongfei
30aab6eab4 处理study接口,studyitemid返回值为空的问题 2024-08-15 19:03:11 +08:00
670788339
61754d3852 放开redis 2024-08-15 16:26:47 +08:00
670788339
a26ee1c707 放开注释 2024-08-15 15:42:45 +08:00
670788339
1f0060c4dc 放开注释 2024-08-15 15:27:41 +08:00
670788339
6b0050286c 放开注释 2024-08-15 15:19:59 +08:00
670788339
2b07029aca 注释 2024-08-15 12:09:40 +08:00
670788339
d2d7fab96c 注释 2024-08-15 12:03:05 +08:00
670788339
be3bae969c study接口加redis过滤 2024-08-15 11:35:02 +08:00
670788339
8e1b7519ef study接口加redis过滤 2024-08-15 11:31:17 +08:00
670788339
bddb11caf8 study接口加redis过滤 2024-08-15 10:53:26 +08:00
nisen
f0fe015561 Merge branch 'zcwy0731-llf' into master-0705 2024-08-06 17:52:08 +08:00
zhaolongfei
91bcec00ef 修复同步到item表没有名称问题 2024-08-06 14:42:05 +08:00
nisen
7a210ec701 Merge branch 'zcwy0731-llf' into master-0705 2024-08-05 19:03:09 +08:00
zhaolongfei
6c616a1163 在线课作业重复提交报错修复 2024-08-05 15:12:54 +08:00
zhaolongfei
939325d5bd 在线课作业重复提交报错修复 2024-08-05 15:05:28 +08:00
zhaolongfei
4eddbc8e8f 在线管理资源完成情况名称搜索修复 2024-08-05 11:21:14 +08:00
zhaolongfei
50bdd59a26 在线管理资源完成情况名称搜索修复 2024-08-05 11:11:12 +08:00
zhaolongfei
b85eb97bc1 在线管理资源完成情况名称搜索修复 2024-08-05 10:57:14 +08:00
zhaolongfei
28b58a73cf 在线管理资源完成情况名称搜索修复 2024-08-05 10:29:36 +08:00
zhaolongfei
b9adf4c45f 作业多次点击提交报错修复 2024-08-02 17:08:00 +08:00
zhaolongfei
49aab74463 作业多次点击提交报错修复 2024-08-02 13:19:08 +08:00
zhaolongfei
9f30910d04 作业多次点击提交报错修复 2024-08-02 11:32:14 +08:00
zhaolongfei
6658b8c04b 作业多次点击提交报错修复 2024-08-02 11:03:13 +08:00
zhaolongfei
19df4224a9 作业多次点击提交报错修复 2024-08-02 10:16:05 +08:00
zhaolongfei
95ddc9f5d5 作业多次点击提交报错修复 2024-08-02 09:36:36 +08:00
nisen
f3b6bb6fee Merge branch 'zcwy0731-llf' into master-0705
# Conflicts:
#	servers/boe-server-all/src/main/java/com/xboe/module/exam/entity/ExamTest.java
2024-08-01 17:43:07 +08:00
zhaolongfei
64965f5ec6 考试管理删除不同步 2024-07-31 19:01:53 +08:00
zhaolongfei
a407ca2dad 考试管理删除不同步 2024-07-31 18:35:49 +08:00
nisen
16f1c2337b Merge branch 'zcwy0716-llf' into master-0705 2024-07-30 15:46:41 +08:00
zhaolongfei
bf476a23a0 在线管理状态完成情况 2024-07-30 14:05:06 +08:00
joshen
92a4e509ef Merge branch 'master-0705' into 'master'
Master 0705

See merge request !116
2024-07-30 11:58:33 +08:00
nisen
0f0edaf2cd Merge branch 'zcwy0729-llf' into master-0705 2024-07-30 11:56:45 +08:00
nisen
68d00e8c51 Merge branch 'zcwy0716-llf' into master-0705 2024-07-29 19:56:17 +08:00
10 changed files with 57 additions and 48 deletions

View File

@@ -12,13 +12,10 @@ import com.xboe.module.dict.entity.DictDto;
import com.xboe.module.exam.entity.ExamTest;
import com.xboe.school.study.entity.StudyCourse;
import com.xboe.system.user.dao.UserDao;
import com.xboe.system.user.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;

View File

@@ -178,6 +178,4 @@ public class ExamTest extends BaseEntity {
@Transient
private String paperName;
}

View File

@@ -95,7 +95,7 @@ public class ExamTestServiceImpl implements IExamTestService {
@Override
public Boolean has(String paperId) {
ExamTest et=examTestDao.findOne(FieldFilters.eq("paperId", paperId));
ExamTest et=examTestDao.findOne(FieldFilters.eq("paperId", paperId),FieldFilters.eq("deleted", false));
//String etId= (String)examTestDao.findField("id", FieldFilters.eq("paperId", paperId));
if(et==null){
return true;

View File

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

View File

@@ -11,6 +11,7 @@ import com.xboe.api.vo.*;
import com.xboe.module.course.vo.TeacherVo;
import com.xboe.module.usergroup.entity.UserGroupItem;
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.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -65,7 +66,9 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping(value="/xboe/school/study/course")
public class StudyCourseApi extends ApiBaseController{
@Autowired
IStudyCourseService service;
@@ -321,8 +324,19 @@ public class StudyCourseApi extends ApiBaseController{
if (StringUtils.isEmpty(token)) {
token = request.getHeader("token");
}
//检查是否已存在
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) {
//如果记录存在但是进度不100无成情况就更新进度一期不会有这种情况
if(item.getProgress()<100 && sci.getProgress()>item.getProgress()) {
@@ -407,6 +421,14 @@ public class StudyCourseApi extends ApiBaseController{
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
if(item!=null) {
//如果记录存在但是进度不到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) {
studyService.updateProcess(item.getId(),sci.getStudyId(),sci.getCourseId(), sci.getContentTotal(),100,token);
}
@@ -512,6 +534,14 @@ public class StudyCourseApi extends ApiBaseController{
token = request.getHeader("token");
}
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);
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
log.info("在线课学习记录"+allUserList);
@@ -693,9 +723,10 @@ public class StudyCourseApi extends ApiBaseController{
return error("查询失败",e.getMessage());
}
}
@RequestMapping(value="/study-course-content",method = {RequestMethod.GET,RequestMethod.POST})
public JsonResponse<StudyCourseItem> findStudyCourseItem(String studyId,String contentId){
public JsonResponse<StudyCourseItem> findStudyCourseItem(String studyId,String contentId, HttpServletRequest request){
if(StringUtils.isBlank(studyId)){
return error("无学习信息");
}

View File

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

View File

@@ -44,7 +44,7 @@ public class StudyAssessServiceImpl implements IStudyAssessService{
LocalDateTime ldt=LocalDateTime.now();
sci.setStudyId(assess.getStudyId());
sci.setContentId(assess.getContentId());
//sci.setContentName(homework.getContentName());
sci.setContentName("评估");
sci.setCourseId(assess.getCourseId());
//sci.setCsectionId(homework.getCsectionId());
sci.setProgress(100);//直接设置为学习完成

View File

@@ -82,7 +82,7 @@ public class StudyExamServiceImpl implements IStudyExamService{
LocalDateTime ldt=LocalDateTime.now();
sci.setStudyId(exam.getStudyId());
sci.setContentId(exam.getContentId());
//sci.setContentName(homework.getContentName());
sci.setContentName("考试");
sci.setCourseId(exam.getCourseId());
//sci.setCsectionId(homework.getCsectionId());
sci.setProgress(prog);//直接设置为学习完成

View File

@@ -46,7 +46,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
LocalDateTime ldt=LocalDateTime.now();
sci.setStudyId(homework.getStudyId());
sci.setContentId(homework.getContentId());
//sci.setContentName(homework.getContentName());
sci.setContentName(homework.getHwName());
sci.setCourseId(homework.getCourseId());
//sci.setCsectionId(homework.getCsectionId());
sci.setProgress(100);//直接设置为学习完成
@@ -67,7 +67,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
//只是保留一条作业记录,不再保存多条记录了
//dao.save(homework);
//设置id。然后进行悠
homework.setId(obj.toString());
homework.setId(homework.getStudyItemId());
dao.update(homework);
}
}

View File

@@ -98,8 +98,12 @@ public class StudyServiceImpl implements IStudyService{
//sci.setProgress(100);//直接设置为学习完成
sci.setLastTime(ldt);
scItemDao.saveOrUpdate(sci);
dto.setStudyItemId(sci.getId());
if (sci.getId() != null){
dto.setStudyItemId(sci.getId());
}else {
log.info("学习记录插入失败"+sci.getId());
throw new IllegalArgumentException("学习记录插入失败");
}
//检查是否全部学习完成
scDao.finishCheck(dto.getStudyId(),dto.getCourseId(),dto.getContentTotal(),token);
@@ -182,7 +186,7 @@ public class StudyServiceImpl implements IStudyService{
if(StringUtils.isNotBlank(name)) {
query.addFilter(FieldFilters.eq("aname", name));
}
int pageIndex2 = pageIndex-1;
int pageIndex2 = (pageIndex-1)*10;
if(status!=null) {
if(status==3) {
query.addFilter(FieldFilters.eq("status", 2));
@@ -193,16 +197,16 @@ public class StudyServiceImpl implements IStudyService{
}else if (status == 1) {
String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " +
" left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" +
" where bsc.course_id = '"+courseId+"' and bsc.id not in(" +
" where bsc.course_id = '"+courseId+"' and bsc.aname like '%"+name+"%' and bsc.id not in(" +
" select item.study_id from boe_study_course_item item " +
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" +
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.aname like '%"+name+"%' group by item.study_id" +
" ) group by bsc.id limit "+ pageIndex2+","+ pageSize+";";
String sql2 = "select count(*) as total from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " +
" left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" +
" where bsc.course_id = '"+courseId+"' and bsc.id not in(" +
" where bsc.course_id = '"+courseId+"' and bsc.aname like '%"+name+"%' and bsc.id not in(" +
" select item.study_id from boe_study_course_item item " +
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" +
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.aname like '%"+name+"%' group by item.study_id" +
" ) group by bsc.id) as total";
log.info("资源完成情况未开始sql"+sql);
List<Object[]> list = scDao.sqlFindList(sql);
@@ -224,46 +228,22 @@ public class StudyServiceImpl implements IStudyService{
return pageList;
}
}
// String sql = "select * from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status 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.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id " +
// " UNION ALL " +
// " select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " +
// " LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " +
// " where bsc.course_id = '"+courseId+"' and bsc.id not in (" +
// " select 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+"' group by bsc.id" +
// " )group by bsc.id) a group by a.id limit "+ pageIndex+","+ pageSize+";";
// String sql2 = "select count(*) from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status 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.`status` in (2,9) and bsc.course_id = '"+ courseId+"' group by bsc.id " +
// " UNION ALL " +
// " select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " +
// " LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " +
// " where bsc.course_id = '"+courseId+"' and bsc.id not in (" +
// " select 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+"' group by bsc.id" +
// " )group by bsc.id) a group by a.id";
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 " +
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') 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 " +
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
"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 + "' 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 " +
"group by a.id limit "+ pageIndex2+","+ pageSize+";";
String sql2 = "select count(*) as total from (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 " +
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') 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 " +
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
"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 + "' 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 " +
"group by a.id) as total";
log.info("资源完成情况全部sql"+sql);