change 4 лет назад
Родитель
Сommit
ca7f49819b

+ 12 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseHandoutsServiceImpl.java

@@ -9,6 +9,7 @@ import com.zhongzheng.modules.course.domain.CourseEducationTier;
 import com.zhongzheng.modules.course.domain.CourseHandoutsBusiness;
 import com.zhongzheng.modules.course.service.ICourseHandoutsBusinessService;
 import com.zhongzheng.modules.course.vo.CourseHandoutsBusinessVo;
+import org.apache.commons.math3.distribution.AbstractMultivariateRealDistribution;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -22,6 +23,7 @@ import com.zhongzheng.modules.course.domain.CourseHandouts;
 import com.zhongzheng.modules.course.mapper.CourseHandoutsMapper;
 import com.zhongzheng.modules.course.vo.CourseHandoutsVo;
 import com.zhongzheng.modules.course.service.ICourseHandoutsService;
+import org.springframework.util.CollectionUtils;
 
 import java.util.Collection;
 import java.util.Collections;
@@ -42,8 +44,16 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
 
     @Override
     public CourseHandoutsVo queryById(Long handoutsId){
-        CourseHandouts db = this.baseMapper.selectById(handoutsId);
-        return BeanUtil.toBean(db, CourseHandoutsVo.class);
+        CourseHandoutsQueryBo courseHandoutsQueryBo = new CourseHandoutsQueryBo();
+        courseHandoutsQueryBo.setId(handoutsId);
+        List<CourseHandoutsVo> courseHandoutsVos = entity2Vo(baseMapper.queryList(courseHandoutsQueryBo));
+        if (CollectionUtils.isEmpty(courseHandoutsVos)){
+            return null;
+        }
+        CourseHandoutsVo courseHandoutsVo = courseHandoutsVos.get(0);
+        List<CourseHandoutsBusinessVo> courseHandoutsBusinessVos = baseMapper.selectEntity(courseHandoutsVo.getHandoutsId());
+        courseHandoutsVo.setCourseHandoutsBusinessVo(courseHandoutsBusinessVos);
+        return courseHandoutsVo;
     }
 
     @Override