|
@@ -1,12 +1,21 @@
|
|
|
package com.zhongzheng.modules.grade.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.SecurityUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
+import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
|
|
|
+import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
|
|
|
+import com.zhongzheng.modules.course.bo.CourseProjectTypeQueryBo;
|
|
|
+import com.zhongzheng.modules.course.service.ICourseBusinessService;
|
|
|
+import com.zhongzheng.modules.course.service.ICourseEducationTierService;
|
|
|
+import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
|
|
|
+import com.zhongzheng.modules.course.service.ICourseProjectTypeService;
|
|
|
+import com.zhongzheng.modules.course.vo.*;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.*;
|
|
@@ -55,6 +64,15 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
@Autowired
|
|
|
private IGoodsService iGoodsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICourseEducationTypeService courseEducationTypeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICourseProjectTypeService courseProjectTypeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICourseBusinessService courseBusinessService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IClassGradeSysService classGradeSysService;
|
|
|
|
|
@@ -259,4 +277,61 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
public List<ClassGradeStudentVo> listGradeStudy(ClassGradeQueryBo bo) {
|
|
|
return baseMapper.listGradeStudy(bo);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<CourseUserEducationTypeVo> listGradeService(ClassGradeQueryBo bo) {
|
|
|
+ CourseEducationTypeQueryBo courseEducationTypeQueryBo = new CourseEducationTypeQueryBo();
|
|
|
+ courseEducationTypeQueryBo.setStatus(bo.getStatus());
|
|
|
+ List<CourseUserEducationTypeVo> courseUserEducationTypeVos = entity2EducationVo(courseEducationTypeService.queryList(courseEducationTypeQueryBo));
|
|
|
+ for (CourseUserEducationTypeVo courseUserEducationTypeVo : courseUserEducationTypeVos) {
|
|
|
+ CourseProjectTypeQueryBo courseProjectTypeQueryBo = new CourseProjectTypeQueryBo();
|
|
|
+ courseProjectTypeQueryBo.setStatus(bo.getStatus());
|
|
|
+ courseProjectTypeQueryBo.setEducationId(Convert.toInt(courseUserEducationTypeVo.getId()));
|
|
|
+ List<CourseUserProjectTypeVo> courseUserProjectTypeVos = entity2ServiceProjectVo(courseProjectTypeService.queryList(courseProjectTypeQueryBo));
|
|
|
+ if (CollectionUtils.isNotEmpty(courseUserProjectTypeVos)) {
|
|
|
+ for (CourseUserProjectTypeVo courseUserProjectTypeVo : courseUserProjectTypeVos) {
|
|
|
+ CourseBusinessQueryBo courseBusinessQueryBo = new CourseBusinessQueryBo();
|
|
|
+ courseBusinessQueryBo.setStatus(bo.getStatus());
|
|
|
+ courseBusinessQueryBo.setProjectId(Convert.toInt(courseUserProjectTypeVo.getId()));
|
|
|
+ List<CourseUserBusinessVo> courseUserBusinessVos = entity2ServiceBusinessVo(courseBusinessService.queryList(courseBusinessQueryBo));
|
|
|
+ if (CollectionUtils.isNotEmpty(courseUserBusinessVos)) {
|
|
|
+ for (CourseUserBusinessVo courseUserBusinessVo : courseUserBusinessVos) {
|
|
|
+ List<ClassGradeStudentVo> classGradeStudentVos = baseMapper.listGradeService(courseUserBusinessVo.getId());
|
|
|
+ courseUserBusinessVo.setClassGradeStudentVos(classGradeStudentVos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ courseUserProjectTypeVo.setCourseUserBusiness(courseUserBusinessVos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ courseUserEducationTypeVo.setCourseUserProjectTypeVo(courseUserProjectTypeVos);
|
|
|
+ }
|
|
|
+ return courseUserEducationTypeVos;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 实体类转化成视图对象
|
|
|
+ *
|
|
|
+ * @param collection 实体类集合
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<CourseUserEducationTypeVo> entity2EducationVo(Collection<CourseEducationTypeVo> collection) {
|
|
|
+ List<CourseUserEducationTypeVo> voList = collection.stream()
|
|
|
+ .map(any -> BeanUtil.toBean(any, CourseUserEducationTypeVo.class))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ return voList;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<CourseUserProjectTypeVo> entity2ServiceProjectVo(Collection<CourseProjectTypeVo> collection) {
|
|
|
+ List<CourseUserProjectTypeVo> voList = collection.stream()
|
|
|
+ .map(any -> BeanUtil.toBean(any, CourseUserProjectTypeVo.class))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ return voList;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<CourseUserBusinessVo> entity2ServiceBusinessVo(Collection<CourseBusinessVo> collection) {
|
|
|
+ List<CourseUserBusinessVo> voList = collection.stream()
|
|
|
+ .map(any -> BeanUtil.toBean(any, CourseUserBusinessVo.class))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ return voList;
|
|
|
+ }
|
|
|
}
|