| | |
| | | package com.qxueyou.scc.admin.classes.service.impl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.qxueyou.scc.teach.subject.model.view.MyLectureV; |
| | | import com.qxueyou.scc.teach.subject.model.view.MySubjectV; |
| | | import com.qxueyou.scc.teach.subject.service.ILectureService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | |
| | | import com.qxueyou.scc.teach.subject.model.Subject; |
| | | |
| | | /** |
| | | * 班级服务类 |
| | | * 班级服务类 |
| | | * |
| | | * @author xiadehu |
| | | */ |
| | |
| | | @Autowired |
| | | ITeacherService teacherService; |
| | | |
| | | @Autowired |
| | | ILectureService lectureService; |
| | | |
| | | /** |
| | | * 添加班级 |
| | | * 添加班级 |
| | | */ |
| | | @Override |
| | | public Result insertClass(String className, String classNumber, Date startTime, Date endTime, String subjectId, |
| | | String teacherId) { |
| | | String teacherId,String chargeClassName) { |
| | | |
| | | ClsClass cls = new ClsClass(); |
| | | |
| | |
| | | cls.setStartTime(startTime); |
| | | cls.setEndTime(endTime); |
| | | cls.setTeacherId(teacherId); |
| | | cls.setChargeClassName(chargeClassName); |
| | | cls.setOrgId(ClientUtils.getOrgId()); |
| | | save(cls); |
| | | return new Result(true, "success",CollectionUtils.newStringMap("classId",cls.getClassId())); |
| | | } |
| | | /** |
| | | * 添加补考班级班级 |
| | | * 添加补考班级班级 |
| | | */ |
| | | @Override |
| | | public Result insertReClass(String className, String classNumber, Date startTime, Date endTime, String subjectId, |
| | | String teacherId,String classTypes) { |
| | | String teacherId,String classTypes) { |
| | | |
| | | ClsClass cls = new ClsClass(); |
| | | |
| | |
| | | save(cls); |
| | | return new Result(true, "success",CollectionUtils.newStringMap("classId",cls.getClassId())); |
| | | } |
| | | @Override |
| | | public ClsClass getReClass(String classTypes) { |
| | | String hql = "select c from ClsClass c where c.deleteFlag is false and c.classTypes=? "; |
| | | @Override |
| | | public ClsClass getReClass(String classTypes) { |
| | | String hql = "select c from ClsClass c where c.deleteFlag is false and c.classTypes=? "; |
| | | |
| | | ClsClass cls = findUnique(hql, CollectionUtils.newList(classTypes), |
| | | ClsClass.class); |
| | | return cls; |
| | | } |
| | | ClsClass cls = findUnique(hql, CollectionUtils.newList(classTypes), |
| | | ClsClass.class); |
| | | return cls; |
| | | } |
| | | |
| | | @Override |
| | | public Result updateClass(String classId, String className, String classNumber, Date startTime, Date endTime, |
| | | String subjectId, boolean needJoinAudit, boolean needQuitAudit, boolean showAnalysisAfterExer, |
| | | boolean canMultiExer, boolean needForum, String teacherId) { |
| | | boolean canMultiExer, boolean needForum, String teacherId, String chargeClassName) { |
| | | |
| | | ClsClass cls = read(ClsClass.class, classId); |
| | | |
| | |
| | | cls.setShowAnalysisAfterExer(showAnalysisAfterExer); |
| | | cls.setCanMultiExer(canMultiExer); |
| | | cls.setNeedForum(needForum); |
| | | cls.setChargeClassName(chargeClassName); |
| | | cls.setTeacherId(teacherId); |
| | | save(cls); |
| | | |
| | |
| | | public ClsClass read(String classId) { |
| | | return read(ClsClass.class, classId); |
| | | } |
| | | // |
| | | // /** |
| | | // * 原始:获取班级列表 |
| | | // */ |
| | | // @Override |
| | | // public List<ClsClass> getClassLst(String keyword, String teacherId, Integer pageSize, Integer pageNum, Integer pageType) { |
| | | // String keyword_ = StringUtils.isBlank(keyword) ? "" : keyword; |
| | | //// System.out.println(keyword_); |
| | | // StringBuffer hql = new StringBuffer("from ClsClass c where c.deleteFlag is false and c.orgId=? and c.name like ? and c.createId=?"); |
| | | // |
| | | // if (pageType == 1) { |
| | | // hql.append(" and c.endTime >= sysdate() "); |
| | | // }else if(pageType == 2) { |
| | | // hql.append(" and c.endTime < sysdate() "); |
| | | // } |
| | | //// System.out.println("vvvvv"+ClientUtils.getOrgId()+"333333333"+ClientUtils.getUserId()); |
| | | // List<Object> args = CollectionUtils.newList(ClientUtils.getOrgId(),keyword_ + "%",ClientUtils.getUserId()); |
| | | //// System.out.println(args); |
| | | // if (!StringUtils.isEmpty(teacherId)) { |
| | | // hql.append(" and exists( select 1 from ClsClassReSubject r,Subject t where r.subjectId=t.subjectId and c.classId= r.classId and t.teacherId=? and r.deleteFlag is false and t.deleteFlag is false)"); |
| | | // args.add(teacherId); |
| | | // } |
| | | // |
| | | // hql.append(" order by c.createTime desc"); |
| | | //// System.out.println(hql.toString()); |
| | | //// System.out.println(findList(hql.toString(), new Pager(pageSize, pageNum), args, ClsClass.class)); |
| | | // return findList(hql.toString(), new Pager(pageSize, pageNum), args, ClsClass.class); |
| | | // } |
| | | |
| | | /** |
| | | * 获取班级列表 |
| | | * 优化获取班级列表 |
| | | * @param keyword |
| | | * @param teacherId |
| | | * @param pageSize |
| | | * @param pageNum |
| | | * @param pageType |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ClsClass> getClassLst(String keyword, String teacherId, Integer pageSize, Integer pageNum, Integer pageType) { |
| | | String keyword_ = StringUtils.isBlank(keyword) ? "" : keyword; |
| | | // System.out.println(keyword_); |
| | | StringBuffer hql = new StringBuffer("from ClsClass c where c.deleteFlag is false and c.orgId=? and c.name like ? and c.createId=?"); |
| | | StringBuffer hql = new StringBuffer("from ClsClass c where c.deleteFlag is false and c.orgId=? and c.name like ? "); |
| | | |
| | | if (pageType == 1) { |
| | | hql.append(" and c.endTime >= sysdate() "); |
| | | }else if(pageType == 2) { |
| | | hql.append(" and c.endTime < sysdate() "); |
| | | } |
| | | // System.out.println("vvvvv"+ClientUtils.getOrgId()+"333333333"+ClientUtils.getUserId()); |
| | | List<Object> args = CollectionUtils.newList(ClientUtils.getOrgId(),keyword_ + "%","40288a1261d106ba0161d1072e260000"); |
| | | // if (!StringUtils.isEmpty(teacherId)) { |
| | | // hql.append("and c.createId=?)"); |
| | | // } |
| | | // System.out.println("vvvvv"+ClientUtils.getOrgId()+"333333333"+ClientUtils.getUserId()); ,ClientUtils.getUserId() |
| | | List<Object> args = CollectionUtils.newList(ClientUtils.getOrgId(),keyword_ + "%"); |
| | | // System.out.println(args); |
| | | if (!StringUtils.isEmpty(teacherId)) { |
| | | hql.append(" and exists( select 1 from ClsClassReSubject r,Subject t where r.subjectId=t.subjectId and c.classId= r.classId and t.teacherId=? and r.deleteFlag is false and t.deleteFlag is false)"); |
| | |
| | | if (pageType == 1) { |
| | | hql.append(" and c.endTime >= sysdate() "); |
| | | }else if(pageType == 2) { |
| | | hql.append(" and c.endTime < sysdate() "); |
| | | hql.append(" and c.endTime < sysdate() "); |
| | | } |
| | | |
| | | List<Object> args = CollectionUtils.newList(ClientUtils.getOrgId(),keyword + "%"); |
| | | |
| | | if (!StringUtils.isEmpty(teacherId)) { |
| | | hql.append(" and exists( select 1 from ClsClassReSubject r,Subject t where r.subjectId=t.subjectId and c.classId= r.classId and t.teacherId=? and r.deleteFlag is false and t.deleteFlag is false)"); |
| | | hql.append(" and exists( select 1 from ClsClassReSubject r,Subject t where r.subjectId=t.subjectId and c.classId= r.classId and t.teacherId=? and r.deleteFlag is false and t.deleteFlag is false)"); |
| | | args.add(teacherId); |
| | | } |
| | | |
| | |
| | | |
| | | String hql = "select c from ClsClass c,StuStudent s where c.classId=s.classId and s.userId=? and s.status=?"; |
| | | |
| | | System.out.println(ClientUtils.getUserId()); |
| | | |
| | | List<ClsClass> result = find(hql, CollectionUtils.newList(ClientUtils.getUserId(), StuStudent.STATUS_ACTIVE), |
| | | ClsClass.class); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除班级 |
| | | * 删除班级 |
| | | */ |
| | | @Override |
| | | public Result deleteClass(String[] classIds) { |
| | | for (String classId : classIds) { |
| | | deleteClass(classId); |
| | | //删除班级学员 |
| | | //删除班级学员 |
| | | this.deleteStudent(classId); |
| | | //删除班级课程 |
| | | //删除班级课程 |
| | | this.deleteClassSubject(classId); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除班级学员 |
| | | * 删除班级学员 |
| | | */ |
| | | private void deleteStudent(String classId) { |
| | | this.bulkUpdate("update StuStudent set deleteFlag = 1 where classId = ?", new Object[] {classId}); |
| | | } |
| | | |
| | | /** |
| | | * 删除班级课程 |
| | | * 删除班级课程 |
| | | */ |
| | | private void deleteClassSubject(String classId) { |
| | | this.bulkUpdate("delete from ClsClassReSubject where classId=?", new Object[] {classId}); |
| | | } |
| | | |
| | | /** |
| | | * @param classId 班级id |
| | | * @param classId 班级id |
| | | * @return |
| | | */ |
| | | private Result deleteClass(String classId) { |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getSubjectLstByClsId(String classId) { |
| | | String hql = "from MySubjectV where classId = ?"; |
| | | List<MySubjectV> mySubjectVList = find(hql,CollectionUtils.newList(classId),MySubjectV.class); |
| | | List<Map<String,Object>> maps = new ArrayList<>(); |
| | | for(MySubjectV mySubjectV : mySubjectVList){ |
| | | List<MyLectureV> myLectureVList = lectureService.listLectureVBySubjectId(mySubjectV.getId().getUserId(),mySubjectV.getId().getSubjectId(), "", 1000, 1, null); |
| | | Double percent = 0.0; |
| | | Double progressValue = 0.0; |
| | | Double percentAvg = 0.0; |
| | | if(!myLectureVList.isEmpty()) { |
| | | for (MyLectureV myLectureV : myLectureVList) { |
| | | if (myLectureV.getPercent() != null && myLectureV.getProgressValue() != null) { |
| | | percent += myLectureV.getPercent(); |
| | | progressValue += myLectureV.getProgressValue().intValue(); |
| | | } |
| | | } |
| | | percentAvg = percent / myLectureVList.size(); |
| | | if (percentAvg.isNaN()) { |
| | | percentAvg = 0.0; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<Map<String,Object>> queryAvailableClassIdAndName(String teacherId,String subjectId) { |
| | | StringBuffer hql = new StringBuffer(1000); |
| | | // and c.endTime>=sysdate() 增加条件过滤掉历史班级 |
| | | hql.append("select c.classId as classId ,c.name as className from ClsClass c where c.deleteFlag is false and c.orgId=:orgId and c.createId=:createId " ); |
| | | Map<String,Object> queryParam = new HashMap<String,Object>(); |
| | | queryParam.put("orgId", ClientUtils.getOrgId()); |
| | | queryParam.put("createId", ClientUtils.getUserId()); |
| | | StringBuffer hql = new StringBuffer(1000); |
| | | // and c.endTime>=sysdate() 增加条件过滤掉历史班级 and c.createId=:createId |
| | | hql.append("select c.classId as classId ,c.name as className from ClsClass c where c.deleteFlag is false and c.orgId=:orgId " ); |
| | | Map<String,Object> queryParam = new HashMap<String,Object>(); |
| | | queryParam.put("orgId", ClientUtils.getOrgId()); |
| | | // queryParam.put("createId", ClientUtils.getUserId()); |
| | | |
| | | if(StringUtils.isNotEmpty(teacherId)||StringUtils.isNotEmpty(subjectId)){ |
| | | hql.append(" and exists (select 1 from ClsClassReSubject r ,Subject s where r.subjectId=s.subjectId and r.classId =c.classId and r.deleteFlag is false "); |
| | | } |
| | | if(StringUtils.isNotEmpty(teacherId)||StringUtils.isNotEmpty(subjectId)){ |
| | | hql.append(" and exists (select 1 from ClsClassReSubject r ,Subject s where r.subjectId=s.subjectId and r.classId =c.classId and r.deleteFlag is false "); |
| | | } |
| | | |
| | | if(!StringUtils.isEmpty(teacherId)){ |
| | | hql.append(" and s.teacherId=:teacherId "); |
| | | queryParam.put("teacherId", teacherId); |
| | | } |
| | | if(!StringUtils.isEmpty(teacherId)){ |
| | | hql.append(" and s.teacherId=:teacherId "); |
| | | queryParam.put("teacherId", teacherId); |
| | | } |
| | | |
| | | if(!StringUtils.isEmpty(subjectId)){ |
| | | hql.append(" and s.origSubjectId=:subjectId "); |
| | | queryParam.put("subjectId", subjectId); |
| | | } |
| | | if(!StringUtils.isEmpty(subjectId)){ |
| | | hql.append(" and s.origSubjectId=:subjectId "); |
| | | queryParam.put("subjectId", subjectId); |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(teacherId)||StringUtils.isNotEmpty(subjectId)){ |
| | | hql.append(")"); |
| | | } |
| | | if(StringUtils.isNotEmpty(teacherId)||StringUtils.isNotEmpty(subjectId)){ |
| | | hql.append(")"); |
| | | } |
| | | |
| | | return this.findListWithMapByHql(hql.toString(), queryParam); |
| | | return this.findListWithMapByHql(hql.toString(), queryParam); |
| | | } |
| | | |
| | | @Override |
| | | @Override |
| | | public List<Map<String,Object>> queryAllClassIdAndName() { |
| | | StringBuffer hql = new StringBuffer(500); |
| | | StringBuffer hql = new StringBuffer(500); |
| | | // c.deleteFlag is false and |
| | | hql.append("select c.classId as classId ,c.name as className from ClsClass c where c.endTime>=:endTime and c.orgId=:orgId " ); |
| | | hql.append("select c.classId as classId ,c.name as className from ClsClass c where c.endTime>=:endTime and deleteFlag is false and c.orgId=:orgId " ); |
| | | |
| | | return this.findListWithMapByHql(hql.toString(), CollectionUtils.newObjectMap("endTime",new Date(),"orgId",ClientUtils.getOrgId())); |
| | | return this.findListWithMapByHql(hql.toString(), CollectionUtils.newObjectMap("endTime",new Date(),"orgId",ClientUtils.getOrgId())); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询班级 |
| | | * |
| | | * type 1正常班級,2历史班級 |
| | | */ |
| | | public Result classList(String keyword, Pager pager, int type) { |
| | | //获取老师id |
| | | String teacherId = teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); |
| | | if (StringUtils.isEmpty(teacherId)) { |
| | | return new Result(false, "非老师角色无法查看班级"); |
| | | } |
| | | QClsClass qClsClass = QClsClass.clsClass; |
| | | QSubject qSubject = QSubject.subject; |
| | | QClsClassReSubject qClsClassReSubject = QClsClassReSubject.clsClassReSubject; |
| | | QSubjectProgressTreeV qSubjectProgressTreeV = QSubjectProgressTreeV.subjectProgressTreeV; |
| | | /** |
| | | * 查询班级 |
| | | * |
| | | * type 1正常班級,2历史班級 |
| | | */ |
| | | public Result classList(String keyword, Pager pager, int type) { |
| | | //获取老师id |
| | | String teacherId = teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); |
| | | if (StringUtils.isEmpty(teacherId)) { |
| | | return new Result(false, "非老师角色无法查看班级"); |
| | | } |
| | | QClsClass qClsClass = QClsClass.clsClass; |
| | | QSubject qSubject = QSubject.subject; |
| | | QClsClassReSubject qClsClassReSubject = QClsClassReSubject.clsClassReSubject; |
| | | QSubjectProgressTreeV qSubjectProgressTreeV = QSubjectProgressTreeV.subjectProgressTreeV; |
| | | |
| | | //查询脚本 |
| | | JPAQuery<Tuple> queryDsl = this.getQueryFactory() |
| | | .select(qClsClass.name, qClsClass.classId, qClsClass.classNumber, qClsClass.studentCount, |
| | | qClsClass.createTime, qClsClass.startTime, qClsClass.endTime, qSubject) |
| | | .from(qClsClass, qSubject, qClsClassReSubject) |
| | | .where(qClsClass.deleteFlag.isFalse().and((type == 2 ? qClsClass.endTime.lt(new Date()) : qClsClass.endTime.gt(new Date()))).and(qClsClass.name.like("%" + keyword + "%")) |
| | | .and(qSubject.teacherId.eq(teacherId)).and(qSubject.deleteFlag.isFalse()) |
| | | .and(qClsClassReSubject.deleteFlag.isFalse()) |
| | | .and(qClsClassReSubject.classId.eq(qClsClass.classId)) |
| | | .and(qClsClassReSubject.subjectId.eq(qSubject.subjectId))) |
| | | .groupBy(qClsClass.classId); |
| | | //查询脚本 |
| | | JPAQuery<Tuple> queryDsl = this.getQueryFactory() |
| | | .select(qClsClass.name, qClsClass.classId, qClsClass.classNumber, qClsClass.studentCount, |
| | | qClsClass.createTime, qClsClass.startTime, qClsClass.endTime, qSubject) |
| | | .from(qClsClass, qSubject, qClsClassReSubject) |
| | | .where(qClsClass.deleteFlag.isFalse().and((type == 2 ? qClsClass.endTime.lt(new Date()) : qClsClass.endTime.gt(new Date()))).and(qClsClass.name.like("%" + keyword + "%")) |
| | | .and(qSubject.teacherId.eq(teacherId)).and(qSubject.deleteFlag.isFalse()) |
| | | .and(qClsClassReSubject.deleteFlag.isFalse()) |
| | | .and(qClsClassReSubject.classId.eq(qClsClass.classId)) |
| | | .and(qClsClassReSubject.subjectId.eq(qSubject.subjectId))) |
| | | .groupBy(qClsClass.classId); |
| | | |
| | | //总数 |
| | | long count = queryDsl.fetchCount(); |
| | | //总数 |
| | | long count = queryDsl.fetchCount(); |
| | | |
| | | //listData |
| | | List<Map<String, Object>> listData = queryDsl.limit(pager.getPageSize()).offset(pager.getOffset()) |
| | | .orderBy(qClsClass.createTime.desc(), qSubject.createTime.desc()).fetch().stream().map(tuple -> { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Subject subject = tuple.get(qSubject); |
| | | //listData |
| | | List<Map<String, Object>> listData = queryDsl.limit(pager.getPageSize()).offset(pager.getOffset()) |
| | | .orderBy(qClsClass.createTime.desc(), qSubject.createTime.desc()).fetch().stream().map(tuple -> { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | Subject subject = tuple.get(qSubject); |
| | | |
| | | map.put("className", tuple.get(qClsClass.name)); |
| | | map.put("classId", tuple.get(qClsClass.classId)); |
| | | map.put("classNumber", tuple.get(qClsClass.classNumber)); |
| | | map.put("studentCount", tuple.get(qClsClass.studentCount)); |
| | | map.put("createTime", tuple.get(qClsClass.createTime)); |
| | | map.put("startTime", tuple.get(qClsClass.startTime)); |
| | | map.put("endTime", tuple.get(qClsClass.endTime)); |
| | | if (subject != null) { |
| | | map.put("subjectName", subject.getName()); |
| | | map.put("progressPercent", |
| | | this.getQueryFactory().select(qSubjectProgressTreeV.percent.avg()) |
| | | .from(qSubjectProgressTreeV) |
| | | .where(qSubjectProgressTreeV.id.nodeId.eq(subject.getSubjectId()) |
| | | .and(qSubjectProgressTreeV.nodeType.eq(Progress.PROGRESS_TYPE_SUBJECT))) |
| | | .groupBy(qSubjectProgressTreeV.id.nodeId).fetchOne()); |
| | | } else { |
| | | map.put("subjectName", "暂无开班课程"); |
| | | map.put("progressPercent", 0); |
| | | } |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | map.put("className", tuple.get(qClsClass.name)); |
| | | map.put("classId", tuple.get(qClsClass.classId)); |
| | | map.put("classNumber", tuple.get(qClsClass.classNumber)); |
| | | map.put("studentCount", tuple.get(qClsClass.studentCount)); |
| | | map.put("createTime", tuple.get(qClsClass.createTime)); |
| | | map.put("startTime", tuple.get(qClsClass.startTime)); |
| | | map.put("endTime", tuple.get(qClsClass.endTime)); |
| | | if (subject != null) { |
| | | map.put("subjectName", subject.getName()); |
| | | map.put("progressPercent", |
| | | this.getQueryFactory().select(qSubjectProgressTreeV.percent.avg()) |
| | | .from(qSubjectProgressTreeV) |
| | | .where(qSubjectProgressTreeV.id.nodeId.eq(subject.getSubjectId()) |
| | | .and(qSubjectProgressTreeV.nodeType.eq(Progress.PROGRESS_TYPE_SUBJECT))) |
| | | .groupBy(qSubjectProgressTreeV.id.nodeId).fetchOne()); |
| | | } else { |
| | | map.put("subjectName", "暂无开班课程"); |
| | | map.put("progressPercent", 0); |
| | | } |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | return new Result(true, "success", CollectionUtils.newObjectMap("count", count, "listData", listData)); |
| | | } |
| | | return new Result(true, "success", CollectionUtils.newObjectMap("count", count, "listData", listData)); |
| | | } |
| | | |
| | | @Override |
| | | public String [] queryClassNamesByIds(String[] classIds){ |
| | | if(classIds!=null && classIds.length==0){ |
| | | return null; |
| | | } |
| | | if(classIds!=null && classIds.length==0){ |
| | | return null; |
| | | } |
| | | |
| | | String [] classNames = null; |
| | | String [] classNames = null; |
| | | |
| | | List<Map<String,Object>> lstResult= this.findListWithMapByHql("select c.classId as classId ,c.name as className from ClsClass c where c.classId in (:classIds) ", |
| | | CollectionUtils.newObjectMap("classIds",classIds)); |
| | | List<Map<String,Object>> lstResult= this.findListWithMapByHql("select c.classId as classId ,c.name as className from ClsClass c where c.classId in (:classIds) ", |
| | | CollectionUtils.newObjectMap("classIds",classIds)); |
| | | |
| | | if(lstResult!=null && lstResult.size()==classIds.length){ |
| | | Map<String,String> map= new HashMap<String,String>(lstResult.size()); |
| | | classNames =new String [classIds.length]; |
| | | if(lstResult!=null && lstResult.size()==classIds.length){ |
| | | Map<String,String> map= new HashMap<String,String>(lstResult.size()); |
| | | classNames =new String [classIds.length]; |
| | | |
| | | for(Map<String,Object> item:lstResult){ |
| | | map.put((String)item.get("classId"), (String)item.get("className")); |
| | | } |
| | | for(Map<String,Object> item:lstResult){ |
| | | map.put((String)item.get("classId"), (String)item.get("className")); |
| | | } |
| | | |
| | | for(int i=0;i<classIds.length;i++){ |
| | | classNames[i]= map.get(classIds[i]); |
| | | } |
| | | } |
| | | for(int i=0;i<classIds.length;i++){ |
| | | classNames[i]= map.get(classIds[i]); |
| | | } |
| | | } |
| | | |
| | | return classNames; |
| | | return classNames; |
| | | } |
| | | |
| | | @Override |
| | | public List<ClsClass> queryStudentClassesByUserId(String userId) { |
| | | return this.find("from ClsClass c where c.deleteFlag is false and exists( select 1 from StuStudent t where t.classId = c.classId and t.userId=? and t.status=? ) ", |
| | | CollectionUtils.newList(userId,StuStudent.STATUS_ACTIVE),ClsClass.class); |
| | | return this.find("from ClsClass c where c.deleteFlag is false and exists( select 1 from StuStudent t where t.classId = c.classId and t.userId=? and t.status=? ) ", |
| | | CollectionUtils.newList(userId,StuStudent.STATUS_ACTIVE),ClsClass.class); |
| | | } |
| | | |
| | | |