diff --git a/src/main/java/com/teaching/backend/controller/records/LearningRecordsController.java b/src/main/java/com/teaching/backend/controller/records/LearningRecordsController.java index 2e5248d..0dc4fc0 100644 --- a/src/main/java/com/teaching/backend/controller/records/LearningRecordsController.java +++ b/src/main/java/com/teaching/backend/controller/records/LearningRecordsController.java @@ -43,13 +43,13 @@ public class LearningRecordsController { long total = cs.size(); // 总记录数 Page pageInfo = new Page<>(pagenum,pagesize,total); pageInfo.setRecords(pageCs); - System.out.println("总记录数"+pageInfo.getTotal()); - System.out.println("当前页面:"+pagenum); - System.out.println("当前页面大小:"+pagesize); - System.out.println("当前页面内容:"+pageCs); - System.out.println("页面数:"+pageInfo.getPages()); +// System.out.println("总记录数"+pageInfo.getTotal()); +// System.out.println("当前页面:"+pagenum); +// System.out.println("当前页面大小:"+pagesize); +// System.out.println("当前页面内容:"+pageCs); +// System.out.println("页面数:"+pageInfo.getPages()); pageInfo.setPages((int)(Math.ceil((double) total / pagesize)));//设置总页数 - System.out.println(pageInfo.getPages()); +// System.out.println(pageInfo.getPages()); return ResultUtils.success(pageInfo); } diff --git a/src/main/java/com/teaching/backend/model/entity/records/LearningRecords.java b/src/main/java/com/teaching/backend/model/entity/records/LearningRecords.java index 69842e1..067e2e8 100644 --- a/src/main/java/com/teaching/backend/model/entity/records/LearningRecords.java +++ b/src/main/java/com/teaching/backend/model/entity/records/LearningRecords.java @@ -60,7 +60,7 @@ public class LearningRecords { private String download; /** *视频学习时长 - */ + * private String videoDuration; /** diff --git a/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java index f5157b6..912d839 100644 --- a/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java @@ -26,6 +26,8 @@ import com.teaching.backend.model.vo.courses.CoursesVO; import com.teaching.backend.service.courses.ICoursesService; import com.teaching.backend.utils.CourseCode; import org.apache.poi.xwpf.usermodel.XWPFDocument; +import org.apache.poi.xwpf.usermodel.XWPFParagraph; +import org.apache.poi.xwpf.usermodel.XWPFRun; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -123,7 +125,6 @@ public class CoursesServiceImpl extends ServiceImpl impl } else { throw new BusinessException(ErrorCode.OPERATION_ERROR, "这个课程已经存在了!请联系系统相关人员为您导入课程数据!"); } - } @Override @@ -341,7 +342,7 @@ public class CoursesServiceImpl extends ServiceImpl impl //总目标 StringBuilder overall_goal = new StringBuilder(); for (ObjectiveContents content : courseObjectivesTreeVO.get(0).getContents()) { - overall_goal.append(content.getContent()); + overall_goal.append("\r\n").append(content.getContent()); } System.out.println(overall_goal); @@ -350,24 +351,26 @@ public class CoursesServiceImpl extends ServiceImpl impl StringBuilder knowledge_goals = new StringBuilder(); StringBuilder political_goals = new StringBuilder(); StringBuilder value_goals = new StringBuilder(); + + for (int i = 0; i < courseObjectivesTreeVO.get(0).getCourseObjectivesTrees().size(); i++){ CourseObjectivesTreeVO content = courseObjectivesTreeVO.get(0).getCourseObjectivesTrees().get(i); //知识目标 if (i == 0){ for (ObjectiveContents c : content.getContents()) { - knowledge_goals.append(c.getContent()).append("\n"); + knowledge_goals.append("\r\n").append(c.getContent()); } } //思政目标 if (i == 1){ for (ObjectiveContents c : content.getContents()) { - political_goals.append(c.getContent()).append("\n"); + political_goals.append("\r\n").append(c.getContent()); } } //价值目标 if (i == 2){ for (ObjectiveContents c : content.getContents()) { - value_goals.append(c.getContent()).append("\n"); + value_goals.append("\r\n").append(c.getContent()); } } } @@ -389,8 +392,13 @@ public class CoursesServiceImpl extends ServiceImpl impl params.put("political_goals", political_goals); params.put("value_goals", value_goals); - + //导出图片 + params.put("img","wyii\t"); //根据模板+数据 导出文档 + + + + XWPFDocument xwpfDocument = WordExportUtil.exportWord07(templatePath.getPath(), params); diff --git a/src/main/java/com/teaching/backend/service/impl/records/LearningRecordsServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/records/LearningRecordsServiceImpl.java index 9da33fe..c27b144 100644 --- a/src/main/java/com/teaching/backend/service/impl/records/LearningRecordsServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/records/LearningRecordsServiceImpl.java @@ -106,6 +106,7 @@ public class LearningRecordsServiceImpl extends ServiceImpl