|
@@ -15,6 +15,7 @@ import com.yf.exam.modules.course.dto.ext.CourseDetailExtDTO;
|
|
|
import com.yf.exam.modules.course.dto.ext.CourseRefDirExtDTO;
|
|
|
import com.yf.exam.modules.course.dto.ext.CourseRefFileExtDTO;
|
|
|
import com.yf.exam.modules.course.dto.request.UserCourseReqDTO;
|
|
|
+import com.yf.exam.modules.course.dto.response.UserCourseProcessDTO;
|
|
|
import com.yf.exam.modules.course.dto.response.UserCourseRespDTO;
|
|
|
import com.yf.exam.modules.course.entity.Course;
|
|
|
import com.yf.exam.modules.course.entity.CourseRefDir;
|
|
@@ -34,6 +35,8 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -215,7 +218,15 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
|
|
|
@Override
|
|
|
public IPage<UserCourseRespDTO> userPaging(PagingReqDTO<UserCourseReqDTO> reqDTO) {
|
|
|
- return baseMapper.userPaging(reqDTO.toPage(), reqDTO.getParams());
|
|
|
+ IPage<UserCourseRespDTO> page = baseMapper.userPaging(reqDTO.toPage(), reqDTO.getParams());
|
|
|
+ Map<String,UserCourseProcessDTO> map = baseMapper.userPagingToal(reqDTO.toPage(), reqDTO.getParams()).stream().collect(Collectors.toMap(UserCourseProcessDTO::getId,userCourseProcessDTO -> userCourseProcessDTO));
|
|
|
+ page.getRecords().stream().forEach(i->{
|
|
|
+ i.setNeedLearnCount(map.get(i.getId()).getNeedLearn());
|
|
|
+ i.setLearnMinCount(map.get(i.getId()).getLearnMin());
|
|
|
+ i.setProportion(map.get(i.getId()).getProportion());
|
|
|
+
|
|
|
+ });
|
|
|
+ return page;
|
|
|
}
|
|
|
|
|
|
@Override
|