diff --git a/servers/boe-server-course/pom.xml b/servers/boe-server-course/pom.xml
deleted file mode 100644
index 870fe683..00000000
--- a/servers/boe-server-course/pom.xml
+++ /dev/null
@@ -1,201 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.6.3
-
-
- com.xboe
- boe-server-course
- 1.0.0
- boe-server-course
- 已经独立出去不在这里维护
-
- 1.8
-
-
-
-
- com.xboe
- xboe-core
- 1.0.0
-
-
- com.xboe
- xboe-redis
- 1.0.0
-
-
- com.boe
- httpsdk
- system
- 1.0.0
- ${project.basedir}/src/main/resources/libs/httpsdk-1.0.0.jar
-
-
-
- com.auth0
- java-jwt
- 3.18.3
-
-
-
-
- com.google.code.gson
- gson
- 2.8.6
-
-
-
-
- org.apache.commons
- commons-lang3
-
-
- commons-codec
- commons-codec
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.springframework.boot
- spring-boot-starter-data-redis
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.session
- spring-session-data-redis
-
-
-
- mysql
- mysql-connector-java
- 5.1.27
-
-
-
- org.projectlombok
- lombok
- true
-
-
-
- com.aspose
- slides
- 15.9.0
- system
- ${project.basedir}/src/main/resources/aspose/aspose.slides-15.9.0.jar
-
-
- com.aspose
- words
- 15.8.0
- system
- ${project.basedir}/src/main/resources/aspose/aspose-words-15.8.0.jar
-
-
- com.aspose
- cells
- 18.11
- system
- ${project.basedir}/src/main/resources/aspose/aspose-cells-java-18.11.jar
-
-
-
-
- com.github.ulisesbocchio
- jasypt-spring-boot-starter
- 3.0.3
-
-
-
-
-
- true
- src/main/resources
-
- application-${profileActive}.properties
- application.properties
-
-
-
- false
- src/main/resources
-
- *.properties
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
- 1.8
- 1.8
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
- org.projectlombok
- lombok
-
-
- true
-
-
-
-
-
-
- pro
-
- pro
-
-
-
- pre
-
- pre
-
-
-
- test
-
- test
-
-
-
- dev
-
- dev
-
-
- true
-
-
-
-
diff --git a/servers/boe-server-course/src/main/java/com/xboe/BoeServerCourseApplication.java b/servers/boe-server-course/src/main/java/com/xboe/BoeServerCourseApplication.java
deleted file mode 100644
index f9508d4d..00000000
--- a/servers/boe-server-course/src/main/java/com/xboe/BoeServerCourseApplication.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.xboe;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.annotation.PostConstruct;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.system.ApplicationPid;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-@SpringBootApplication
-@EnableCaching
-public class BoeServerCourseApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(BoeServerCourseApplication.class, args);
- }
-
-
-
-}
diff --git a/servers/boe-server-course/src/main/java/com/xboe/course/ApplicationStartRunner.java b/servers/boe-server-course/src/main/java/com/xboe/course/ApplicationStartRunner.java
deleted file mode 100644
index f37a3c9a..00000000
--- a/servers/boe-server-course/src/main/java/com/xboe/course/ApplicationStartRunner.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.xboe.course;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.stereotype.Component;
-
-/**
- * 本地测试时使用
- * @author seastar
- *
- */
-@Component
-public class ApplicationStartRunner implements ApplicationRunner {
-
- @Autowired
- CourseJsonRunner runner;
-
- @Override
- public void run(ApplicationArguments args) throws Exception {
-
-
- }
-
-}
diff --git a/servers/boe-server-course/src/main/java/com/xboe/course/CourseJsonRunner.java b/servers/boe-server-course/src/main/java/com/xboe/course/CourseJsonRunner.java
deleted file mode 100644
index 0ddade1d..00000000
--- a/servers/boe-server-course/src/main/java/com/xboe/course/CourseJsonRunner.java
+++ /dev/null
@@ -1,408 +0,0 @@
-package com.xboe.course;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.system.ApplicationHome;
-import org.springframework.stereotype.Component;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.type.CollectionType;
-import com.xboe.common.utils.StringUtil;
-import com.xboe.core.utils.OkHttpUtil;
-import com.xboe.course.entity.old.Chapter;
-import com.xboe.course.entity.old.CourseOld;
-import com.xboe.course.entity.old.CourseOldTeacher;
-import com.xboe.course.entity.old.Resource;
-import com.xboe.course.newCourse.course.dao.CourseDao;
-import com.xboe.course.newCourse.course.dao.UserDao;
-import com.xboe.course.newCourse.course.dao.UserGroupDao;
-import com.xboe.course.newCourse.course.entity.CourseImportLog;
-import com.xboe.course.newCourse.course.entity.User;
-import com.xboe.course.newCourse.course.service.ICourseOldService;
-
-import lombok.extern.slf4j.Slf4j;
-
-@Slf4j
-@Component
-public class CourseJsonRunner {
-
- private static Map CourseContentTypeMap=new HashMap();
-
- @Autowired
- CourseDao courseDao;
-
- @Autowired
- UserDao userDao;
-
- @Autowired
- ICourseOldService courseOldService;
-
- @Autowired
- OkHttpUtil okHttpUtil;
-
- @Autowired
- UserGroupDao userGroupDao;
-
- static{
- CourseContentTypeMap.put("video","视频");
- CourseContentTypeMap.put("pdf","pdf");
- CourseContentTypeMap.put("audio","音频");
- CourseContentTypeMap.put("office","office文件已转化为pdf");
- CourseContentTypeMap.put("html-courseware","HTML非标课件");
- //CourseContentTypeMap.put("html","html内容");
-// CourseContentTypeMap.put("html","html内容");
- CourseContentTypeMap.put("homework","作业");
- CourseContentTypeMap.put("examination","考试");
- }
-
-
- public void run(String kid) throws Exception {
-
- ApplicationHome home = new ApplicationHome(getClass());
-
- File jarFile = home.getSource();
- String dataFile = jarFile.getParentFile().toString() + "/course.json";
- Reader reader = new InputStreamReader(new FileInputStream(dataFile),"utf-8");
-
- int ch=0;
- StringBuffer stringBuffer = new StringBuffer();
- while ((ch=reader.read()) !=-1){
- stringBuffer.append((char) ch);
- }
- reader.close();
-
- //josn字符串
- String json = stringBuffer.toString();
-// System.out.println(json);
-
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY,true);
- mapper.configure(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT,true);
- mapper.enable(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT);
-
- CollectionType collectionType = mapper.getTypeFactory().constructCollectionType(ArrayList.class, CourseOld.class);
-
- List list=mapper.readValue(json,collectionType);
-
- //单个导入
- List courseOlds = new ArrayList<>();
- if(StringUtil.isNotBlank(kid)){
- for (CourseOld c:list) {
- if(c.getKid().equals(kid)){
- courseOlds.add(c);
- list=courseOlds;
- }else{
- log.error("未读取到本门课程"+kid);
- list=courseOlds;
- }
- }
- }
- log.info("共读取【"+list.size()+"】门课程");
- if (list != null && !list.isEmpty()) {
- log.info("开始执行导入课程");
- this.verify(list);
- log.info("执行导入课程完成");
- }else{
- log.error("无任何课程信息");
- System.out.println("无任何课程信息");
- }
- //List verify = this.verify(list1);
-
-
- }
-
- private CourseImportLog addErrorLogs(CourseOld cold,String error) {
- CourseImportLog courseImportLog = new CourseImportLog();
- courseImportLog.setKid(cold.getKid());
- courseImportLog.setName(cold.getName());
- courseImportLog.setMess(error);
- courseImportLog.setTime(LocalDateTime.now());
- return courseImportLog;
- }
-
-// private String checkAudience(CourseOld cold) {
-// String url = SysConstant.getConfigValue(BaseConstant.CONFIG_EXTERNALINTERFACE_URL_SYSTEM) + "/xboe/old/data/audience/detail";
-// String error=null;
-// if (cold.getAudienceId() != null && !cold.getAudienceId().isEmpty()) {
-// try {
-// for (String s : cold.getAudienceId()) {
-// UserGroup userGroup = userGroupDao.findOne(FieldFilters.eq("kid", s));
-// if(userGroup==null) {
-// userGroup = new UserGroup();
-// }else{
-//// error="已有该受众";
-// log.error("已存在受众,不在重复导入[kid:]"+userGroup.getKid()+"[name]"+userGroup.getName());
-// continue;
-// }
-// Map map = new HashMap<>();
-// map.put("kid", s);
-// String responseStr = okHttpUtil.doPost(url, map);
-// if (StringUtils.isNotBlank(responseStr)) {
-// ObjectMapper mapper = new ObjectMapper();
-// JsonResponse audience = mapper.readValue(responseStr, new TypeReference>() {
-// });
-// if (audience.getStatus() == HttpStatus.SC_OK && audience.getResult() != null) {
-// Audience result = audience.getResult();
-// if (result != null) {
-// if (StringUtil.isBlank(result.getAudienceName())) {
-// error = "受众名称为空,不能导入";
-// break;
-// }
-// if (result.getType().equals('1')) {
-// error = "受众类型为自由受众,不能导入";
-// break;
-// }
-// if (StringUtil.isNotBlank(result.getAudienceName())) {
-// if (StringUtil.isBlank(result.getCreatedBy())) {
-// //赋予默认
-//// result.setCreatedBy("965341999643234304");
-// userGroup.setSysCreateBy("965341999643234304");
-// userGroup.setSysCreateBy("董瑞华");
-// userGroup.setKid(result.getKid());
-// userGroup.setName(result.getAudienceName());
-// userGroup.setGtype(1);
-// userGroup.setDescription(result.getDescription());
-// if (result.getStatus().equals('0')) {
-// userGroup.setStatus(0);
-// }
-// if (result.getStatus().equals('1')) {
-// userGroup.setStatus(1);
-// }
-// if (result.getStatus().equals('2')) {
-// userGroup.setStatus(2);
-// }
-// if (cold.getUserGroupList() == null) {
-// cold.setUserGroupList(new ArrayList<>());
-// }
-//
-//
-// } else {
-// User user = userDao.getBySysId(result.getCreatedBy());
-// if (user == null) {
-//// result.setCreatedBy("965341999643234304");
-// userGroup.setSysCreateBy("965341999643234304");
-// userGroup.setSysCreateBy("董瑞华");
-// userGroup.setKid(result.getKid());
-// userGroup.setName(result.getAudienceName());
-// userGroup.setGtype(1);
-// userGroup.setDescription(result.getDescription());
-// if (result.getStatus().equals('0')) {
-// userGroup.setStatus(0);
-// }
-// if (result.getStatus().equals('1')) {
-// userGroup.setStatus(1);
-// }
-// if (result.getStatus().equals('2')) {
-// userGroup.setStatus(2);
-// }
-// if (cold.getUserGroupList() == null) {
-// cold.setUserGroupList(new ArrayList<>());
-// }
-//// cold.getAudienceList().add(result);
-// log.error("受众【" + result.getAudienceName() + "】的创建人未匹配到,系统设计为默认人员【965341999643234304】");
-// } else {
-// userGroup.setSysCreateBy(user.getId());
-// userGroup.setSysCreateBy(user.getName());
-// userGroup.setKid(result.getKid());
-// userGroup.setName(result.getAudienceName());
-// userGroup.setGtype(1);
-// userGroup.setDescription(result.getDescription());
-// if (result.getStatus().equals('0')) {
-// userGroup.setStatus(0);
-// }
-// if (result.getStatus().equals('1')) {
-// userGroup.setStatus(1);
-// }
-// if (result.getStatus().equals('2')) {
-// userGroup.setStatus(2);
-// }
-// if (cold.getUserGroupList() == null) {
-// cold.setUserGroupList(new ArrayList<>());
-// }
-// }
-// }
-// cold.getUserGroupList().add(userGroup);
-// }
-//
-// }
-// }
-//
-// }else {
-// CourseImportLog courseImportLog = new CourseImportLog();
-// courseImportLog.setKid(cold.getKid());
-// courseImportLog.setName(cold.getName());
-// courseImportLog.setMess("查询受众【"+s+"】失败,无返回结果");
-// error="查询受众【"+s+"】失败,无返回结果";
-// break;
-// }
-// }
-// } catch (Exception e) {
-// error="受众类型为自由受众,不能导入,详细错误查看日志";
-// log.error("处理课程受众失败",e);
-//
-// }
-//
-// }
-// return error;
-// }
-
- //入库前校验
- private void verify(List list) {
- //可以导入的课程
- List courseOlds = new ArrayList<>();
- //不能导放的课程
- List importLogs = new ArrayList<>();
- List strings = new ArrayList<>();
- //自身过滤
- for (CourseOld c : list) {
-// if(StringUtil.isNotBlank(c.getCoverImg())){
-// String substring=null;
-// if(c.getCoverImg().contains("upload")) {
-// substring = c.getCoverImg().substring(23, c.getCoverImg().length());
-// }else{
-// substring=c.getCoverImg().substring(16,c.getCoverImg().length());
-// }
-// String sql = "update boe_course set cover_img='" + substring + "' where kid='" + c.getKid() + "';";
-// strings.add(sql);
-// }
-
-
- //判断数据库中是否已存在
- String mess = courseDao.detailOld(c.getKid());
- if (mess != null) {
- importLogs.add(addErrorLogs(c,mess));
- continue;
- }
-
- //课程内容的检查
- boolean hasScorm=false;//是否包含score包
- List impChapter=new ArrayList<>();//课程可以导入的章节
- for (Chapter chapter : c.getChapterList()) {
-
- if (chapter.getResourceList() != null && !chapter.getResourceList().isEmpty()) {
-
- Chapter newChapter=new Chapter();
- newChapter.setName(chapter.getName());
- newChapter.setResourceList(new ArrayList<>());
-
- for (Resource r : chapter.getResourceList()) {
- if (r.getTypeCode().equals("scorm")) {
- hasScorm=true;//只要有scorm就不导入
- break;
- }
- else if(CourseContentTypeMap.containsKey(r.getTypeCode())){
- newChapter.getResourceList().add(r);
- }
- }
- //有可导入的资源的才可以添加到章中
- if(!newChapter.getResourceList().isEmpty()) {
- impChapter.add(newChapter);
- }
-
- }
-
- }
- if(hasScorm) {
- importLogs.add(addErrorLogs(c,"该课程有scorm包"));
- continue;//课程不能导入,验证下一个
- }
- if(impChapter.isEmpty()) {
- importLogs.add(addErrorLogs(c,"该课程无可导入内容"));
- continue;//课程不能导入,验证下一个
- }
- else {
- c.setChapterList(impChapter);
- }
-
- //对教师的检查
- boolean teacherError=false;
- if(c.getTeachers()!=null && !c.getTeachers().isEmpty()){
- for (CourseOldTeacher ct: c.getTeachers()){
- User user = userDao.getBySysId(ct.getUser_id());
- if(user==null){
- log.error("新系统没有这个用户"+"kid:"+c.getKid()+"用户id:"+ct.getUser_id());
- importLogs.add(addErrorLogs(c,"无课程教师,"+"kid:"+c.getKid()+"用户id:"+ct.getUser_id()));
- teacherError=true;
- break;
- }else{
- ct.setNewId(user.getId());//新的教师的id
- }
- }
- }
-// else { //无课程教师,指定默认教师
-// importLogs.add(addErrorLogs(c,"无课程教师"));
-// teacherError=true;
-// }
- if(teacherError) {
- continue;
- }
- //对受众的检查,普通受众的课程添加,自动受众的课程不添加
-
-// String checkRs=this.checkAudience(c);
-// if(StringUtils.isNotBlank(checkRs)) {
-// importLogs.add(addErrorLogs(c,checkRs));
-// continue;
-// }
-
- //没有错误,再添加列表中
- courseOlds.add(c);
- }
- courseOldService.saveList(importLogs);
-
-// for (String s:strings) {
-// System.out.println(s);
-// }
- //去除html标签
-
- int success=0;
- for (CourseOld c : courseOlds) {
- String htmlStr = c.getSummary();
- //定义script的正则表达式,去除js可以防止注入
- String scriptRegex = "