| | |
| | | where(qSubjectProgressTreeV.id.userId.eq(qUser.userId).and(qSubjectProgressTreeV.nodeType.eq(nodeType)) |
| | | .and(qSubjectProgressTreeV.id.nodeId.eq(nodeId))).orderBy(order).fetch().stream().map(tuple -> { |
| | | |
| | | List<ClsClassReSubject> clsClassReSubjects = find("from ClsClassReSubject where classId = ?",CollectionUtils.newList(nodeId),ClsClassReSubject.class); |
| | | Double percent = 0.0; |
| | | Double progressValue = 0.0; |
| | | Double percentAvg = 0.0; |
| | | int size = 0; |
| | | for(ClsClassReSubject c : clsClassReSubjects) { |
| | | List<MyLectureV> myLectureVList = lectureService.listLectureVBySubjectId(tuple.get(qUser.userId), c.getSubjectId(), "", 1000, 1, null); |
| | | if (!myLectureVList.isEmpty()) { |
| | | for (MyLectureV myLectureV : myLectureVList) { |
| | | if (myLectureV.getPercent() != null && myLectureV.getProgressValue() != null) { |
| | | percent += myLectureV.getPercent(); |
| | | progressValue += myLectureV.getProgressValue().intValue(); |
| | | } |
| | | } |
| | | size += myLectureVList.size(); |
| | | if (percentAvg.isNaN()) { |
| | | percentAvg += 0.0; |
| | | } |
| | | } |
| | | } |
| | | percentAvg += percent / size; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("userName", tuple.get(qUser.name)); |
| | | map.put("userId", tuple.get(qUser.userId)); |
| | | map.put("classId", tuple.get(qSubjectProgressTreeV.id.nodeId)); |
| | | map.put("percent", tuple.get(qSubjectProgressTreeV.percent)); |
| | | map.put("progressValue", tuple.get(qSubjectProgressTreeV.progressValue)); |
| | | map.put("percent", percentAvg); |
| | | map.put("progressValue", progressValue); |
| | | // map.put("percent", tuple.get(qSubjectProgressTreeV.percent)); |
| | | // map.put("progressValue", tuple.get(qSubjectProgressTreeV.progressValue)); |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | return lstMap; |