mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-12 04:16:51 +08:00
Merge branch 'zcwy0716-llf' into master-0705
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.xboe.school.study.service.impl;
|
package com.xboe.school.study.service.impl;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -182,15 +183,57 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
}
|
}
|
||||||
if(status!=null) {
|
if(status!=null) {
|
||||||
if(status==3) {
|
if(status==3) {
|
||||||
query.addFilter(FieldFilters.eq("progress", 1));
|
query.addFilter(FieldFilters.eq("status", 2));
|
||||||
|
return scItemDao.findPage(query.builder());
|
||||||
}else if(status==2){
|
}else if(status==2){
|
||||||
query.addFilter(FieldFilters.eq("progress",100));
|
query.addFilter(FieldFilters.eq("status",9));
|
||||||
}else if(status == 1){
|
return scItemDao.findPage(query.builder());
|
||||||
query.addFilter(FieldFilters.eq("progress",0));
|
}else if (status == 1) {
|
||||||
|
String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname from boe_study_course bsc " +
|
||||||
|
" where bsc.course_id = '"+courseId+"' and bsc.id != (" +
|
||||||
|
" 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+"'" +
|
||||||
|
" )";
|
||||||
|
List<Object[]> list = scDao.sqlFindList(sql);
|
||||||
|
List<StudyCourseItem> item = new ArrayList<>();
|
||||||
|
for (Object[] objs : list) {
|
||||||
|
String sql2 = "select id, course_id, content_name, aname from boe_study_course_item where `status` !=2 and `status` !=9 and course_id = '" + courseId + "' and content_id = '"+contentId +"'";
|
||||||
|
List<Object[]> itemList = scItemDao.sqlFindList(sql2);// 执行查询
|
||||||
|
if (itemList.isEmpty()) {
|
||||||
|
StudyCourseItem sc = new StudyCourseItem();
|
||||||
|
sc.setProgress(0);
|
||||||
|
sc.setStatus(1);
|
||||||
|
sc.setAname(objs[3].toString());
|
||||||
|
item.add(sc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PageList<StudyCourseItem> pageList = new PageList<>(item);
|
||||||
|
return pageList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String sql2 = "select * from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status from boe_study_course bsc left join " +
|
||||||
return scItemDao.findPage(query.builder());
|
"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+"' " +
|
||||||
|
"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 != (" +
|
||||||
|
" 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+"'" +
|
||||||
|
" )) a group by a.id";
|
||||||
|
List<Object[]> list = scDao.sqlFindList(sql2);
|
||||||
|
List<StudyCourseItem> item = new ArrayList<>();
|
||||||
|
for (Object[] objs : list) {
|
||||||
|
StudyCourseItem sc = new StudyCourseItem();
|
||||||
|
sc.setProgress(Integer.valueOf(objs[4].toString()));
|
||||||
|
sc.setStatus(Integer.valueOf(objs[5].toString()));
|
||||||
|
sc.setAname(objs[3].toString());
|
||||||
|
item.add(sc);
|
||||||
|
}
|
||||||
|
PageList<StudyCourseItem> pageList = new PageList<>(item);
|
||||||
|
return pageList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class StudySignupServiceImpl implements IStudySignupService{
|
|||||||
//用于管理员添加报名
|
//用于管理员添加报名
|
||||||
for(StudySignup ss : list) {
|
for(StudySignup ss : list) {
|
||||||
addSignup(ss);
|
addSignup(ss);
|
||||||
addStudyCourseItem(ss);
|
// addStudyCourseItem(ss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user