|
@@ -6,6 +6,7 @@ import cn.hutool.core.util.NumberUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ynfy.buss.course.coursecatalog.entity.CourseCatalog;
|
|
|
+import com.ynfy.buss.course.coursecatalog.service.ICourseCatalogService;
|
|
|
import com.ynfy.buss.course.usercoursecatalog.entity.UserCourseCatalog;
|
|
|
import com.ynfy.buss.course.usercoursecatalog.entity.vo.CatalogTimeVO;
|
|
|
import com.ynfy.buss.course.usercoursecatalog.mapper.UserCourseCatalogMapper;
|
|
@@ -13,10 +14,14 @@ import com.ynfy.buss.course.usercoursecatalog.service.IUserCourseCatalogService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: 用户课程任务学习情况
|
|
@@ -27,6 +32,10 @@ import java.util.Objects;
|
|
|
@Service
|
|
|
public class UserCourseCatalogServiceImpl extends ServiceImpl<UserCourseCatalogMapper, UserCourseCatalog> implements IUserCourseCatalogService {
|
|
|
|
|
|
+ @Lazy
|
|
|
+ @Autowired
|
|
|
+ private ICourseCatalogService courseCatalogService;
|
|
|
+
|
|
|
/**
|
|
|
* 计算任务学习时长
|
|
|
*
|
|
@@ -73,4 +82,19 @@ public class UserCourseCatalogServiceImpl extends ServiceImpl<UserCourseCatalogM
|
|
|
.eq(UserCourseCatalog::getUserId, userId).eq(UserCourseCatalog::getCourseCatalogId, courseCatalogId);
|
|
|
return getOne(query);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取课程任务学习进度
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<UserCourseCatalog> getCourseStudyProcess(String courseId) {
|
|
|
+ List<CourseCatalog> catalogList = courseCatalogService.listCourseCatalog(courseId);
|
|
|
+ List<String> courseCatalogIdList = catalogList.stream().map(CourseCatalog::getId).collect(Collectors.toList());
|
|
|
+ LambdaQueryWrapper<UserCourseCatalog> query = new LambdaQueryWrapper<UserCourseCatalog>()
|
|
|
+ .in(UserCourseCatalog::getCourseCatalogId, courseCatalogIdList);
|
|
|
+ return list(query);
|
|
|
+ }
|
|
|
}
|