|
|
@ -26,6 +26,8 @@ import com.teaching.backend.model.vo.courses.CoursesVO; |
|
|
|
import com.teaching.backend.service.courses.ICoursesService; |
|
|
|
import com.teaching.backend.service.courses.ICoursesService; |
|
|
|
import com.teaching.backend.utils.CourseCode; |
|
|
|
import com.teaching.backend.utils.CourseCode; |
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument; |
|
|
|
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.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -123,7 +125,6 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw new BusinessException(ErrorCode.OPERATION_ERROR, "这个课程已经存在了!请联系系统相关人员为您导入课程数据!"); |
|
|
|
throw new BusinessException(ErrorCode.OPERATION_ERROR, "这个课程已经存在了!请联系系统相关人员为您导入课程数据!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -341,7 +342,7 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
//总目标
|
|
|
|
//总目标
|
|
|
|
StringBuilder overall_goal = new StringBuilder(); |
|
|
|
StringBuilder overall_goal = new StringBuilder(); |
|
|
|
for (ObjectiveContents content : courseObjectivesTreeVO.get(0).getContents()) { |
|
|
|
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); |
|
|
|
System.out.println(overall_goal); |
|
|
|
|
|
|
|
|
|
|
@ -350,24 +351,26 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
StringBuilder knowledge_goals = new StringBuilder(); |
|
|
|
StringBuilder knowledge_goals = new StringBuilder(); |
|
|
|
StringBuilder political_goals = new StringBuilder(); |
|
|
|
StringBuilder political_goals = new StringBuilder(); |
|
|
|
StringBuilder value_goals = new StringBuilder(); |
|
|
|
StringBuilder value_goals = new StringBuilder(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < courseObjectivesTreeVO.get(0).getCourseObjectivesTrees().size(); i++){ |
|
|
|
for (int i = 0; i < courseObjectivesTreeVO.get(0).getCourseObjectivesTrees().size(); i++){ |
|
|
|
CourseObjectivesTreeVO content = courseObjectivesTreeVO.get(0).getCourseObjectivesTrees().get(i); |
|
|
|
CourseObjectivesTreeVO content = courseObjectivesTreeVO.get(0).getCourseObjectivesTrees().get(i); |
|
|
|
//知识目标
|
|
|
|
//知识目标
|
|
|
|
if (i == 0){ |
|
|
|
if (i == 0){ |
|
|
|
for (ObjectiveContents c : content.getContents()) { |
|
|
|
for (ObjectiveContents c : content.getContents()) { |
|
|
|
knowledge_goals.append(c.getContent()).append("\n"); |
|
|
|
knowledge_goals.append("\r\n").append(c.getContent()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//思政目标
|
|
|
|
//思政目标
|
|
|
|
if (i == 1){ |
|
|
|
if (i == 1){ |
|
|
|
for (ObjectiveContents c : content.getContents()) { |
|
|
|
for (ObjectiveContents c : content.getContents()) { |
|
|
|
political_goals.append(c.getContent()).append("\n"); |
|
|
|
political_goals.append("\r\n").append(c.getContent()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//价值目标
|
|
|
|
//价值目标
|
|
|
|
if (i == 2){ |
|
|
|
if (i == 2){ |
|
|
|
for (ObjectiveContents c : content.getContents()) { |
|
|
|
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<CoursesMapper, Courses> impl |
|
|
|
params.put("political_goals", political_goals); |
|
|
|
params.put("political_goals", political_goals); |
|
|
|
params.put("value_goals", value_goals); |
|
|
|
params.put("value_goals", value_goals); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//导出图片
|
|
|
|
|
|
|
|
params.put("img","wyii\t"); |
|
|
|
//根据模板+数据 导出文档
|
|
|
|
//根据模板+数据 导出文档
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XWPFDocument xwpfDocument = WordExportUtil.exportWord07(templatePath.getPath(), params); |
|
|
|
XWPFDocument xwpfDocument = WordExportUtil.exportWord07(templatePath.getPath(), params); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|