mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 19:36:50 +08:00
清理不用的模块
This commit is contained in:
@@ -1,201 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.6.3</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>boe-server-course</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>boe-server-course</name>
|
||||
<description>已经独立出去不在这里维护</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>xboe-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>xboe-redis</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.boe</groupId>
|
||||
<artifactId>httpsdk</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>1.0.0</version>
|
||||
<systemPath>${project.basedir}/src/main/resources/libs/httpsdk-1.0.0.jar</systemPath>
|
||||
</dependency>
|
||||
<!-- java-jwt -->
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.18.3</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.6</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.bitbucket.b_c</groupId>
|
||||
<artifactId>jose4j</artifactId>
|
||||
<version>0.7.9</version>
|
||||
</dependency>
|
||||
-->
|
||||
<!-- apache commons -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.27</version>
|
||||
<!-- <scope>runtime</scope> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- aspose -->
|
||||
<dependency>
|
||||
<groupId>com.aspose</groupId>
|
||||
<artifactId>slides</artifactId>
|
||||
<version>15.9.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/resources/aspose/aspose.slides-15.9.0.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aspose</groupId>
|
||||
<artifactId>words</artifactId>
|
||||
<version>15.8.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/resources/aspose/aspose-words-15.8.0.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aspose</groupId>
|
||||
<artifactId>cells</artifactId>
|
||||
<version>18.11</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/resources/aspose/aspose-cells-java-18.11.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!--加密配置文件-->
|
||||
<dependency>
|
||||
<groupId>com.github.ulisesbocchio</groupId>
|
||||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>application-${profileActive}.properties</include>
|
||||
<include>application.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>false</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<!-- <version>3.8.0</version> -->
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>pro</id>
|
||||
<properties>
|
||||
<profileActive>pro</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>pre</id>
|
||||
<properties>
|
||||
<profileActive>pre</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<profileActive>test</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<profileActive>dev</profileActive>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<String,String> CourseContentTypeMap=new HashMap<String,String>();
|
||||
|
||||
@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<CourseOld> list=mapper.readValue(json,collectionType);
|
||||
|
||||
//单个导入
|
||||
List<CourseOld> 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<CourseOld> 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<String, String> map = new HashMap<>();
|
||||
// map.put("kid", s);
|
||||
// String responseStr = okHttpUtil.doPost(url, map);
|
||||
// if (StringUtils.isNotBlank(responseStr)) {
|
||||
// ObjectMapper mapper = new ObjectMapper();
|
||||
// JsonResponse<Audience> audience = mapper.readValue(responseStr, new TypeReference<JsonResponse<Audience>>() {
|
||||
// });
|
||||
// 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<CourseOld> list) {
|
||||
//可以导入的课程
|
||||
List<CourseOld> courseOlds = new ArrayList<>();
|
||||
//不能导放的课程
|
||||
List<CourseImportLog> importLogs = new ArrayList<>();
|
||||
List<String> 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<Chapter> 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 = "<script[^>]*?>[\\s\\S]*?<\\/script>";
|
||||
//定义style的正则表达式,去除style样式,防止css代码过多时只截取到css样式代码
|
||||
String styleRegex = "<style[^>]*?>[\\s\\S]*?<\\/style>";
|
||||
//定义HTML标签的正则表达式,去除标签,只提取文字内容
|
||||
String htmlRegex = "<[^>]+>";
|
||||
//定义空格,回车,换行符,制表符
|
||||
String spaceRegex = "\\s*|\t|\r|\n";
|
||||
|
||||
// 过滤script标签
|
||||
htmlStr = htmlStr.replaceAll(scriptRegex, "");
|
||||
// 过滤style标签
|
||||
htmlStr = htmlStr.replaceAll(styleRegex, "");
|
||||
// 过滤html标签
|
||||
htmlStr = htmlStr.replaceAll(htmlRegex, "");
|
||||
// 过滤空格等
|
||||
htmlStr = htmlStr.replaceAll(spaceRegex, "");
|
||||
// 过滤
|
||||
htmlStr = htmlStr.replaceAll(" ", "");
|
||||
// 过滤所有的空格
|
||||
htmlStr = htmlStr.replaceAll(" ", "");
|
||||
|
||||
c.setSummary(htmlStr);
|
||||
try {
|
||||
courseOldService.save(c);
|
||||
success++;
|
||||
}catch(Exception e) {
|
||||
CourseImportLog impError=addErrorLogs(c,"保存课程失败:"+e.getMessage());
|
||||
courseOldService.saveError(impError);
|
||||
log.error("保存课程信息失败",e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
log.info("共导入课程【"+success+"】 ,未导入【"+importLogs.size()+"】");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.xboe.course;
|
||||
|
||||
import com.xboe.course.newCourse.course.service.ICourseOldService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DeleteCourseRunner {
|
||||
|
||||
@Autowired
|
||||
private ICourseOldService courseOldService;
|
||||
/**
|
||||
* 清空
|
||||
* */
|
||||
public void run(){
|
||||
courseOldService.delete();
|
||||
}
|
||||
}
|
||||
@@ -1,592 +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.apache.commons.lang3.StringUtils;
|
||||
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.core.orm.FieldFilters;
|
||||
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.CourseContentDao;
|
||||
import com.xboe.course.newCourse.course.dao.CourseCrowdDao;
|
||||
import com.xboe.course.newCourse.course.dao.CourseDao;
|
||||
import com.xboe.course.newCourse.course.dao.CourseExamDao;
|
||||
import com.xboe.course.newCourse.course.dao.CourseHomeWorkDao;
|
||||
import com.xboe.course.newCourse.course.dao.UserDao;
|
||||
import com.xboe.course.newCourse.course.dao.UserGroupDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseCrowd;
|
||||
import com.xboe.course.newCourse.course.entity.CourseImportLog;
|
||||
import com.xboe.course.newCourse.course.entity.User;
|
||||
import com.xboe.course.newCourse.course.entity.UserGroup;
|
||||
import com.xboe.course.newCourse.course.service.ICourseOldService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class UserGroupRunner {
|
||||
|
||||
private static Map<String,String> CourseContentTypeMap=new HashMap<String,String>();
|
||||
|
||||
@Autowired
|
||||
CourseDao courseDao;
|
||||
|
||||
@Autowired
|
||||
UserDao userDao;
|
||||
|
||||
@Autowired
|
||||
ICourseOldService courseOldService;
|
||||
|
||||
@Autowired
|
||||
OkHttpUtil okHttpUtil;
|
||||
|
||||
@Autowired
|
||||
UserGroupDao userGroupDao;
|
||||
|
||||
@Autowired
|
||||
CourseContentDao courseContentDao;
|
||||
|
||||
@Autowired
|
||||
CourseExamDao courseExamDao;
|
||||
|
||||
@Autowired
|
||||
CourseCrowdDao courseCrowdDao;
|
||||
|
||||
@Autowired
|
||||
CourseHomeWorkDao courseHomeWorkDao;
|
||||
|
||||
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 runUserGroup() 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<CourseOld> list=mapper.readValue(json,collectionType);
|
||||
|
||||
List<CourseCrowd> courseCrowds = new ArrayList<>();
|
||||
|
||||
List<String> needAdds=new ArrayList<String>();
|
||||
//受众导进去了,但是重复,先删除受众重复的数据,根据kid分组删除,直接使用sql删除
|
||||
for(CourseOld c:list) {
|
||||
//文件与已添加进去的课程做比较
|
||||
String s = courseDao.detail(c.getKid());
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
if(c.getAudienceId()!=null && !c.getAudienceId().isEmpty()){
|
||||
for (String a:c.getAudienceId()) {
|
||||
//检查受众是否存在
|
||||
UserGroup userGroup = userGroupDao.findOne(FieldFilters.eq("kid", a));
|
||||
if(userGroup==null) {
|
||||
needAdds.add(a);
|
||||
continue;
|
||||
}
|
||||
//查询课程受众
|
||||
CourseCrowd one = courseCrowdDao.findOne(FieldFilters.and(FieldFilters.eq("courseId", s), FieldFilters.eq("groupId", userGroup.getId())));
|
||||
if(one!=null){
|
||||
continue;
|
||||
}else{
|
||||
CourseCrowd courseCrowd = new CourseCrowd();
|
||||
courseCrowd.setCourseId(s);
|
||||
courseCrowd.setGroupId(userGroup.getId());
|
||||
courseCrowd.setGroupName(userGroup.getName());
|
||||
courseCrowds.add(courseCrowd);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(needAdds.size()>0) {
|
||||
log.info("未导入受众的kids");
|
||||
log.info(StringUtils.join(needAdds,","));
|
||||
}
|
||||
|
||||
courseOldService.saveCourseCrowd(courseCrowds);
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// 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<CourseOld> list=mapper.readValue(json,collectionType);
|
||||
//
|
||||
// //单个导入
|
||||
// List<CourseOld> 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<CourseOld> 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<String, String> map = new HashMap<>();
|
||||
// map.put("kid", s);
|
||||
// String responseStr = okHttpUtil.doPost(url, map);
|
||||
// if (StringUtils.isNotBlank(responseStr)) {
|
||||
// ObjectMapper mapper = new ObjectMapper();
|
||||
// JsonResponse<Audience> audience = mapper.readValue(responseStr, new TypeReference<JsonResponse<Audience>>() {
|
||||
// });
|
||||
// if (audience.getStatus() == HttpStatus.SC_OK && audience.getResult() != null) {
|
||||
// Audience result = audience.getResult();
|
||||
// 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<CourseOld> list) {
|
||||
//可以导入的课程
|
||||
List<CourseOld> courseOlds = new ArrayList<>();
|
||||
List<String> list1 = new ArrayList<>();
|
||||
List<String> list2 = new ArrayList<>();
|
||||
//不能导放的课程
|
||||
List<CourseImportLog> importLogs = new ArrayList<>();
|
||||
//自身过滤
|
||||
for (CourseOld c : list) {
|
||||
|
||||
// String sql="update boe_course set name='"+c.getName()+"' where kid='"+c.getKid()+"';";
|
||||
// list1.add(sql);
|
||||
|
||||
//判断数据库中是否已存在
|
||||
String mess = courseDao.detailOld(c.getKid());
|
||||
if (mess != null) {
|
||||
importLogs.add(addErrorLogs(c,mess));
|
||||
continue;
|
||||
}
|
||||
|
||||
//课程内容的检查
|
||||
boolean hasScorm=false;//是否包含score包
|
||||
List<Chapter> 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()) {
|
||||
// String sql1="update boe_course_content set content_name='"+r.getName()+"' where rid='"+r.getId()+"';";
|
||||
//
|
||||
// list2.add(sql1);
|
||||
// if(r.getExamData()!=null && StringUtil.isNotBlank(r.getExamData().getId())){
|
||||
// ExamData examData = r.getExamData();
|
||||
// String sql2="update boe_course_exam set test_name='"+examData.getTitle()+"' where kid='"+examData.getId()+"';";
|
||||
//
|
||||
// list2.add(sql2);
|
||||
// }
|
||||
// if(r.getHomeworkData()!=null && StringUtil.isNotBlank(r.getHomeworkData().getKid())){
|
||||
// HomeWorkData homeworkData = r.getHomeworkData();
|
||||
// String sql3="update boe_course_homework set name='"+homeworkData.getTitle()+"' where kid='"+homeworkData.getKid()+"';";
|
||||
//
|
||||
// list2.add(sql3);
|
||||
// }
|
||||
// if(r.getFileData()!=null && StringUtil.isNotBlank(r.getFileData().getFilePath())) {
|
||||
// if(r.getTypeCode().equals("html-courseware")) {
|
||||
// String contentJson = "{" +
|
||||
// "\"url\":\"" + r.getFileData().getFilePath() + "\"," +
|
||||
// "\"isDrag\": true," +
|
||||
// "\"completeSetup\": 0," +
|
||||
// "\"second\": 5," +
|
||||
// "\"setupTage\": 0" +
|
||||
// "}";
|
||||
// String sql = "update boe_course_content set content='" + contentJson + "' where rid='" + r.getId() + "';";
|
||||
// list1.add(sql);
|
||||
// }
|
||||
// }
|
||||
// if(r.getHomeworkData()!=null && StringUtil.isNotBlank(r.getHomeworkData().getKid())) {
|
||||
// if (r.getHomeworkData().getMode().equals("0")) {
|
||||
// String sql = "update boe_course_homework set submitMode=1 where kid='" + r.getHomeworkData().getKid() + "';";
|
||||
// list1.add(sql);
|
||||
// }
|
||||
// if (r.getHomeworkData().getMode()!=null && r.getHomeworkData().getMode().equals("1")) {
|
||||
// String sql = "update boe_course_homework set submitMode=2 where kid='" + r.getHomeworkData().getKid() + "';";
|
||||
// list1.add(sql);
|
||||
// }
|
||||
// if (r.getHomeworkData().getMode()!=null && r.getHomeworkData().getMode().equals("2")) {
|
||||
// String sql = "update boe_course_homework set submitMode=3 where kid='" + r.getHomeworkData().getKid() + "';";
|
||||
// list1.add(sql);
|
||||
// }
|
||||
// }
|
||||
// if(r.getExamData()!=null) {
|
||||
// if (r.getExamData().getQuestionList() != null && !r.getExamData().getQuestionList().isEmpty()) {
|
||||
// StringBuffer jsonQuestion = new StringBuffer("{\"items\":[");
|
||||
// for (Question q:r.getExamData().getQuestionList()){
|
||||
// Integer type = null;
|
||||
// if (StringUtil.isNotBlank(q.getExamination_question_type())) {
|
||||
// if (q.getExamination_question_type().equals("0")) {
|
||||
// type = 101;
|
||||
// }
|
||||
// if (q.getExamination_question_type().equals("1")) {
|
||||
// type = 102;
|
||||
// }
|
||||
// if (q.getExamination_question_type().equals("3")) {
|
||||
// type = 103;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// StringBuffer stringBuffer = new StringBuffer();
|
||||
// stringBuffer.append(
|
||||
// "{" +
|
||||
// "\"id\":\"" + q.getKid() + "\"," +
|
||||
// "\"type\":" + type + "," +
|
||||
// "\"score\":" + q.getDefault_score() + "," +
|
||||
// "\"checked\":" + false + "," +
|
||||
// "\"optShow\":" + false + "," +
|
||||
// "\"content\":\"" + q.getTitle() + "\"," +
|
||||
// "" + "\"options\": [");
|
||||
// if (q.getOptions() != null && !q.getOptions().isEmpty()) {
|
||||
// for (Options options : q.getOptions()) {
|
||||
// Boolean answer = false;
|
||||
// if (options.getIs_right_option().equals("1")) {
|
||||
// answer = true;
|
||||
// }
|
||||
// stringBuffer.append("{" +
|
||||
// "\"id\":\"" + options.getKid() + "\"," +
|
||||
// "\"content\":\"" + options.getOption_title() + "\"," +
|
||||
// "\"answer\":" + answer + "" +
|
||||
// "},");
|
||||
// }
|
||||
// stringBuffer.deleteCharAt(stringBuffer.length() - 1);
|
||||
// stringBuffer.append("]},");
|
||||
// jsonQuestion.append(stringBuffer);
|
||||
// }
|
||||
//
|
||||
// jsonQuestion.deleteCharAt(jsonQuestion.length() - 1);
|
||||
// jsonQuestion.append("]}");
|
||||
// jsonQuestion.toString().replaceAll("\\\\n", "").replaceAll("\\\\t", "");
|
||||
// String sql="update boe_course_exam set paper_content='"+jsonQuestion+"' where kid='"+q.getKid()+"';";
|
||||
// list1.add(sql);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
// for(int i=0;i<list1.size();i++){
|
||||
// Ceshi ceshi = new Ceshi();
|
||||
// ceshi.setContent(list1.get(i));
|
||||
// courseOldService.save1(ceshi);
|
||||
// }
|
||||
|
||||
courseOldService.saveList(importLogs);
|
||||
//去除html标签
|
||||
|
||||
int success=0;
|
||||
for (CourseOld c : courseOlds) {
|
||||
String htmlStr = c.getSummary();
|
||||
//定义script的正则表达式,去除js可以防止注入
|
||||
String scriptRegex = "<script[^>]*?>[\\s\\S]*?<\\/script>";
|
||||
//定义style的正则表达式,去除style样式,防止css代码过多时只截取到css样式代码
|
||||
String styleRegex = "<style[^>]*?>[\\s\\S]*?<\\/style>";
|
||||
//定义HTML标签的正则表达式,去除标签,只提取文字内容
|
||||
String htmlRegex = "<[^>]+>";
|
||||
//定义空格,回车,换行符,制表符
|
||||
String spaceRegex = "\\s*|\t|\r|\n";
|
||||
|
||||
// 过滤script标签
|
||||
htmlStr = htmlStr.replaceAll(scriptRegex, "");
|
||||
// 过滤style标签
|
||||
htmlStr = htmlStr.replaceAll(styleRegex, "");
|
||||
// 过滤html标签
|
||||
htmlStr = htmlStr.replaceAll(htmlRegex, "");
|
||||
// 过滤空格等
|
||||
htmlStr = htmlStr.replaceAll(spaceRegex, "");
|
||||
// 过滤
|
||||
htmlStr = htmlStr.replaceAll(" ", "");
|
||||
// 过滤所有的空格
|
||||
htmlStr = htmlStr.replaceAll(" ", "");
|
||||
|
||||
c.setSummary(htmlStr);
|
||||
try {
|
||||
// courseOldService.save(c);
|
||||
// courseOldService.saveUserGroup(c.getAudienceId());
|
||||
success++;
|
||||
}catch(Exception e) {
|
||||
CourseImportLog impError=addErrorLogs(c,"保存受众失败:"+e.getMessage());
|
||||
courseOldService.saveError(impError);
|
||||
log.error("保存受众信息失败",e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
log.info("共导入课程【"+success+"】 ,未导入【"+importLogs.size()+"】");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
//@EqualsAndHashCode(callSuper = false)
|
||||
//@Entity
|
||||
//@Table(name = "eln_so_audience")
|
||||
public class Audience implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 受众id
|
||||
* */
|
||||
@Id
|
||||
@Column(name = "kid",length = 50)
|
||||
private String kid;
|
||||
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
* */
|
||||
@Column(name = "company_id",length = 50)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 所有者id
|
||||
* */
|
||||
@Column(name = "owner_id",length = 50)
|
||||
private String ownerId;
|
||||
|
||||
/**
|
||||
* 受众目录id
|
||||
* */
|
||||
@Column(name = "category_id",length = 50)
|
||||
private String cateGoryId;
|
||||
|
||||
/**
|
||||
* 受众编码
|
||||
* */
|
||||
@Column(name = "audience_code",length = 50)
|
||||
private String audienceCode;
|
||||
|
||||
/**
|
||||
* 受众名称
|
||||
* */
|
||||
@Column(name = "audience_name",length = 200)
|
||||
private String audienceName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* */
|
||||
@Column(name = "description",columnDefinition = "mediumtext")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 来源id
|
||||
* */
|
||||
@Column(name = "source_id",length = 50)
|
||||
private String sourceId;
|
||||
|
||||
/**
|
||||
* 受众类型 0名单列表 1课程
|
||||
* */
|
||||
@Column(name = "audience_type",length = 1)
|
||||
private Character audienceType;
|
||||
|
||||
/**
|
||||
* 受众类型
|
||||
* */
|
||||
@Column(name = "type",length = 1)
|
||||
private Character type;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* */
|
||||
// @Column(name = "status",length = 1)
|
||||
private Character status;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
* */
|
||||
// @Column(name = "version",length = 11)
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Column(name = "created_by", length = 150)
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "created_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建来源
|
||||
*/
|
||||
@Column(name = "created_from", length = 150)
|
||||
private String createdFrom;
|
||||
|
||||
/**
|
||||
* 创建IP
|
||||
*/
|
||||
@Column(name = "created_ip", length = 150)
|
||||
private String createdIp;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
@Column(name = "updated_by", length = 150)
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "updated_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新来源
|
||||
*/
|
||||
@Column(name = "updated_from", length = 150)
|
||||
private String updatedFrom;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
@Column(name = "updated_ip", length = 150)
|
||||
private String updatedIp;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_so_audience_member")
|
||||
public class AudienceMember implements Serializable {
|
||||
|
||||
/**
|
||||
* 受众成员id
|
||||
* */
|
||||
@Id
|
||||
@Column(name = "kid",length = 50)
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 受众id
|
||||
* */
|
||||
@Column(name = "audience_id",length = 50)
|
||||
private String audienceId;
|
||||
|
||||
/**
|
||||
* 受众条件id
|
||||
* */
|
||||
@Column(name = "condition_id",length = 50)
|
||||
private String conditionId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
* */
|
||||
@Column(name = "user_id",length = 50)
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 状态 0临时 1正常 2停用
|
||||
* */
|
||||
@Column(name = "status",length = 1)
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
|
||||
// /**
|
||||
// * 状态 0临时 1正常 2停用
|
||||
// * */
|
||||
// @Column(name = "status",length = 1)
|
||||
// private Character status;
|
||||
//
|
||||
// /**
|
||||
// * 关系生效时间
|
||||
// * */
|
||||
// @Column(name = "start_at",nullable = false,length = 11)
|
||||
// private Integer startAt;
|
||||
//
|
||||
// /**
|
||||
// *'关系失效时间,如果为空,表示无截止时间限制',
|
||||
// * */
|
||||
// @Column(name = "end_at",length = 11)
|
||||
// private Integer endAt;
|
||||
//
|
||||
// /**
|
||||
// * 版本号
|
||||
// */
|
||||
// @Column(name = "version", length = 11)
|
||||
// private Integer version;
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 创建人ID
|
||||
// */
|
||||
// @Column(name = "created_by", length = 150)
|
||||
// private String createdBy;
|
||||
//
|
||||
// /**
|
||||
// * 创建时间
|
||||
// */
|
||||
// @Column(name = "created_at")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// private Date createdAt;
|
||||
//
|
||||
// /**
|
||||
// * 创建来源
|
||||
// */
|
||||
// @Column(name = "created_from", length = 150)
|
||||
// private String createdFrom;
|
||||
//
|
||||
// /**
|
||||
// * 创建IP
|
||||
// */
|
||||
// @Column(name = "created_ip", length = 150)
|
||||
// private String createdIp;
|
||||
//
|
||||
// /**
|
||||
// * 更新人ID
|
||||
// */
|
||||
// @Column(name = "updated_by", length = 150)
|
||||
// private String updatedBy;
|
||||
//
|
||||
// /**
|
||||
// * 更新时间
|
||||
// */
|
||||
// @Column(name = "updated_at")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// private Date updatedAt;
|
||||
//
|
||||
// /**
|
||||
// * 更新来源
|
||||
// */
|
||||
// @Column(name = "updated_from", length = 150)
|
||||
// private String updatedFrom;
|
||||
//
|
||||
// /**
|
||||
// * 更新IP
|
||||
// */
|
||||
// @Column(name = "updated_ip", length = 150)
|
||||
// private String updatedIp;
|
||||
//
|
||||
// /**
|
||||
// * 删除标记;0:正常,1:已删除
|
||||
// */
|
||||
// @Column(name = "is_deleted", length = 3)
|
||||
// private String isDeleted;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class Chapter implements Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
private List<Resource> resourceList;
|
||||
|
||||
// private Boolean isImport=true;
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
|
||||
import com.xboe.course.newCourse.course.entity.CourseCrowd;
|
||||
import com.xboe.course.newCourse.course.entity.UserGroup;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class CourseOld implements Serializable {
|
||||
|
||||
|
||||
private String kid;
|
||||
|
||||
|
||||
private String name;
|
||||
|
||||
private String summary;
|
||||
|
||||
|
||||
private Integer type;
|
||||
|
||||
|
||||
private Float score;
|
||||
|
||||
|
||||
private String companyId;
|
||||
|
||||
|
||||
private String coverImg;
|
||||
|
||||
/**教师信息*/
|
||||
private List<CourseOldTeacher> teachers;
|
||||
|
||||
|
||||
private Integer studys;
|
||||
|
||||
/**转换*/
|
||||
private String publishTime;
|
||||
|
||||
|
||||
private String forUsers;
|
||||
|
||||
private String forScene;
|
||||
|
||||
private String ctype1;
|
||||
|
||||
private String ctype2;
|
||||
|
||||
private String ctype3;
|
||||
|
||||
private ResOwner resOwner;
|
||||
|
||||
private List<Tags> tags;
|
||||
|
||||
|
||||
|
||||
private String value;
|
||||
|
||||
|
||||
private Integer device;
|
||||
|
||||
|
||||
private String source;
|
||||
|
||||
private List<Chapter> chapterList;
|
||||
|
||||
private List<String> audienceId;
|
||||
|
||||
private List<UserGroup> userGroupList;
|
||||
|
||||
private List<CourseCrowd> courseCrowdList;
|
||||
|
||||
private Integer duration;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CourseOld{" +
|
||||
"kid='" + kid + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", summary='" + summary + '\'' +
|
||||
", type=" + type +
|
||||
", score=" + score +
|
||||
", commpanyId='" + companyId + '\'' +
|
||||
", coverImg='" + coverImg + '\'' +
|
||||
", teachers=" + teachers +
|
||||
", studys=" + studys +
|
||||
", publishTime='" + publishTime + '\'' +
|
||||
", forUsers='" + forUsers + '\'' +
|
||||
", forScene='" + forScene + '\'' +
|
||||
", ctype1='" + ctype1 + '\'' +
|
||||
", ctype2='" + ctype2 + '\'' +
|
||||
", ctype3='" + ctype3 + '\'' +
|
||||
", resOwner=" + resOwner +
|
||||
", tags=" + tags +
|
||||
", value='" + value + '\'' +
|
||||
", device=" + device +
|
||||
", source='" + source + '\'' +
|
||||
", chapterList=" + chapterList +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@Data
|
||||
public class CourseOldTeacher implements Serializable {
|
||||
|
||||
private String teacher_id;
|
||||
|
||||
/**
|
||||
* 新的教师的id
|
||||
*/
|
||||
private String newId;
|
||||
|
||||
private String user_id;
|
||||
|
||||
private String teacher_time;
|
||||
|
||||
private String teacher_level;
|
||||
|
||||
private String teacher_name;
|
||||
|
||||
private String teacher_no;
|
||||
|
||||
private String teacher_title;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class EQption implements Serializable {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EQuestion implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private String description;
|
||||
|
||||
private String type;
|
||||
|
||||
private String title;
|
||||
|
||||
private String lowTip;
|
||||
|
||||
private String highTip;
|
||||
|
||||
private List<EQption> optionList;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EvaluationData implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String desc;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
private List<EQuestion> questionList;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ExamData implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private String resId;
|
||||
|
||||
private String title;
|
||||
|
||||
private String desc;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
private Integer limitTime;
|
||||
|
||||
private Integer attemptNumber;
|
||||
|
||||
private String randomNumber;
|
||||
|
||||
private String passGrade;
|
||||
|
||||
private String isShowParse;
|
||||
|
||||
private String isShowAnswer;
|
||||
|
||||
private String examinationPaperCopyId;
|
||||
|
||||
private List<Question> questionList;
|
||||
|
||||
private String isShowResult;
|
||||
|
||||
private String course_id;
|
||||
|
||||
private List<Record> recordList;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class FileData implements Serializable {
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String filePath;
|
||||
|
||||
private String mimeType;
|
||||
|
||||
private Integer duration;
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HomeWorkData implements Serializable {
|
||||
|
||||
private String kid;
|
||||
|
||||
private String title;
|
||||
|
||||
private String mode;
|
||||
|
||||
private String state;
|
||||
|
||||
private String endAt;
|
||||
|
||||
private String desc;
|
||||
|
||||
private List<InfoAttach> infoAttachList;
|
||||
|
||||
private List<Submit> submitList;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class InfoAttach implements Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
private String content;
|
||||
|
||||
private String submitTime;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class Options implements Serializable {
|
||||
|
||||
|
||||
private String kid;
|
||||
|
||||
private String examination_question_copy_id;
|
||||
|
||||
private String examination_question_option_id;
|
||||
|
||||
private String option_title;
|
||||
|
||||
private String option_description;
|
||||
|
||||
private String default_score;
|
||||
|
||||
private String is_right_option;
|
||||
|
||||
private String option_stand_result;
|
||||
|
||||
private String sequence_number;
|
||||
|
||||
private String option_version;
|
||||
|
||||
private String version;
|
||||
|
||||
private String created_by;
|
||||
|
||||
private String created_at;
|
||||
|
||||
private String created_from;
|
||||
|
||||
private String created_ip;
|
||||
|
||||
private String updated_by;
|
||||
|
||||
private String updated_at;
|
||||
|
||||
private String updated_from;
|
||||
|
||||
private String updated_ip;
|
||||
|
||||
private String is_deleted;
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class Orangeizations implements Serializable {
|
||||
|
||||
private String identifier;
|
||||
|
||||
private List<Organization> organization;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@Data
|
||||
public class Organization implements Serializable {
|
||||
|
||||
private String scoId;
|
||||
|
||||
private String title;
|
||||
|
||||
private String identifier;
|
||||
|
||||
private String identifierref;
|
||||
|
||||
private String isvisible;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Question implements Serializable {
|
||||
|
||||
private String kid;
|
||||
|
||||
private String examination_paper_copy_id;
|
||||
|
||||
private String examination_question_copy_id;
|
||||
|
||||
private String default_score;
|
||||
|
||||
private String relation_type;
|
||||
|
||||
private String sequence_number;
|
||||
|
||||
private String status;
|
||||
|
||||
private String start_at;
|
||||
|
||||
private String end_at;
|
||||
|
||||
private String version;
|
||||
|
||||
private String created_by;
|
||||
|
||||
private String created_at;
|
||||
|
||||
private String created_from;
|
||||
|
||||
private String created_ip;
|
||||
|
||||
private String updated_by;
|
||||
|
||||
private String updated_at;
|
||||
|
||||
private String updated_from;
|
||||
|
||||
private String updated_ip;
|
||||
|
||||
private String is_deleted;
|
||||
|
||||
private String examination_question_type;
|
||||
|
||||
private String title;
|
||||
|
||||
private String qu_kid;
|
||||
|
||||
private List<Options> options;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class Record implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private String score;
|
||||
|
||||
private String duration;
|
||||
|
||||
private String submitTime;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@Data
|
||||
public class ResOwner implements Serializable {
|
||||
|
||||
|
||||
private String res_group;
|
||||
|
||||
private String res_group_code;
|
||||
|
||||
private String res_bg;
|
||||
|
||||
private String res_bg_code;
|
||||
|
||||
private String res_location;
|
||||
|
||||
private String res_location_code;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@Data
|
||||
public class Resou implements Serializable {
|
||||
|
||||
private String scoId;
|
||||
|
||||
private String identifier;
|
||||
|
||||
private String identifierref;
|
||||
|
||||
private String href;
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Resource implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private Integer lastPlayAt;
|
||||
|
||||
private String itemId;
|
||||
|
||||
private String name;
|
||||
|
||||
private String publishStatus;
|
||||
|
||||
private String typeId;
|
||||
|
||||
private String typeCode;
|
||||
|
||||
private String typeName;
|
||||
|
||||
private String isClick;
|
||||
|
||||
private String trySee;
|
||||
|
||||
private String state;
|
||||
|
||||
private ScormData scormData;
|
||||
|
||||
private String homeworkMode;
|
||||
|
||||
private String isWatermark;
|
||||
|
||||
private Integer courseware_complete_rule;
|
||||
|
||||
private String url;
|
||||
|
||||
private ExamData examData;
|
||||
|
||||
private FileData fileData;
|
||||
|
||||
private EvaluationData evaluationData;
|
||||
|
||||
private HomeWorkData homeworkData;
|
||||
|
||||
private Boolean isImport=true;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class ScormData implements Serializable {
|
||||
|
||||
private Orangeizations organizations;
|
||||
|
||||
private List<Resou> resource;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class Submit implements Serializable {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.xboe.course.entity.old;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@Data
|
||||
public class Tags implements Serializable {
|
||||
|
||||
private String keyword;
|
||||
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.api;
|
||||
|
||||
import com.xboe.course.DeleteCourseRunner;
|
||||
import com.xboe.course.UserGroupRunner;
|
||||
import com.xboe.course.newCourse.course.dao.UserGroupDao;
|
||||
import com.xboe.course.newCourse.course.entity.UserGroup;
|
||||
import com.xboe.course.newCourse.course.service.ICourseOldService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.course.CourseJsonRunner;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value="/inner/course/import")
|
||||
public class RunnerApi extends ApiBaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
CourseJsonRunner runner;
|
||||
|
||||
@Autowired
|
||||
DeleteCourseRunner deleteCourseRunner;
|
||||
|
||||
@Autowired
|
||||
ICourseOldService service;
|
||||
|
||||
@Autowired
|
||||
UserGroupRunner userGroupRunner;
|
||||
|
||||
@Autowired
|
||||
UserGroupDao userGroupDao;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导入课程相关信息和受众,不到受众人员
|
||||
*/
|
||||
@GetMapping("/run")
|
||||
public JsonResponse<Boolean> run(String kid) throws Exception {
|
||||
runner.run(kid);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/clear")
|
||||
public JsonResponse<Boolean> clear(){
|
||||
deleteCourseRunner.run();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入受众人员,导入之前,先把已有的用户清空一下
|
||||
* */
|
||||
@GetMapping("/audience-user-run")
|
||||
public JsonResponse<Boolean> userRun() throws Exception{
|
||||
|
||||
List<UserGroup> userGroupList = userGroupDao.findList(FieldFilters.isNotNull("kid"),FieldFilters.ne("kid",""));
|
||||
|
||||
for(UserGroup ug : userGroupList) {
|
||||
log.info("开始导入受众【"+ug.getName()+"】人员信息...");
|
||||
try {
|
||||
service.userGroupItem(ug);
|
||||
log.info("导入受众【"+ug.getName()+"】人员信息完成");
|
||||
}catch(Exception e) {
|
||||
log.error("导入受众【"+ug.getId()+","+ug.getName()+"】人员信息失败",e);
|
||||
}
|
||||
}
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程受众出错,重新导入
|
||||
* */
|
||||
|
||||
@GetMapping("/course-audience-run")
|
||||
public JsonResponse<Boolean> courseCrod() throws Exception{
|
||||
|
||||
|
||||
|
||||
userGroupRunner.runUserGroup();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.IFieldFilter;
|
||||
import com.xboe.course.newCourse.course.entity.Account;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账号信息DAO
|
||||
*/
|
||||
@Repository
|
||||
public class AccountDao extends BaseDao<Account> {
|
||||
|
||||
/**
|
||||
* 按登录名查询账号
|
||||
*
|
||||
* @param loginName
|
||||
* @return
|
||||
*/
|
||||
public Account findByLoginName(String loginName) {
|
||||
return this.findOne(FieldFilters.eq("loginName", loginName), FieldFilters.eq("deleted", false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查账号是否存在
|
||||
*
|
||||
* @param sysId
|
||||
* @return
|
||||
*/
|
||||
public boolean checkAccount(String sysId) {
|
||||
return this.count(FieldFilters.eq("sysId", sysId)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有相同的账号名,不包括删除的记录
|
||||
*
|
||||
* @param loginName 被检查的账号名称
|
||||
* @param excludeId 需要排除的ID,可以是多个
|
||||
* @return 返回查询到的数据,有则表示有冲突
|
||||
*/
|
||||
public Account check(String loginName, String excludeId) {
|
||||
List<IFieldFilter> filters = new ArrayList<>();
|
||||
filters.add(FieldFilters.eq("deleted", false));
|
||||
if (StringUtil.isNotBlank(loginName)) {
|
||||
filters.add(FieldFilters.eq("loginName", loginName));
|
||||
}
|
||||
if (StringUtil.isNotBlank(excludeId)) {
|
||||
filters.add(FieldFilters.notIn("id", Arrays.asList(excludeId)));
|
||||
}
|
||||
List<Account> list = this.findList(filters.toArray(new IFieldFilter[filters.size()]));
|
||||
if (list != null && !list.isEmpty()) {
|
||||
return list.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据旧系统ID查询数据
|
||||
*
|
||||
* @param sysId
|
||||
* @return
|
||||
*/
|
||||
public Account getBySysId(String sysId) {
|
||||
return this.findOne(FieldFilters.eq("sysId", sysId));
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.AssessContent;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class AssessContentDao extends BaseDao<AssessContent>{
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseAssess;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseAssessDao extends BaseDao<CourseAssess> {
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseAudit;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseAuditDao extends BaseDao<CourseAudit>{
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseContent;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseContentDao extends BaseDao<CourseContent> {
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseCrowd;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseCrowdDao extends BaseDao<CourseCrowd>{
|
||||
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.core.orm.*;
|
||||
import com.xboe.course.newCourse.course.entity.Course;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class CourseDao extends BaseDao<Course> {
|
||||
/**
|
||||
* 课程分页 搜索查询
|
||||
* */
|
||||
public PageList<Course> queryCoursePageLike(int pageIndex, int pageSize, String keyWord, OrderCondition order, List<IFieldFilter> filters){
|
||||
PageList<Course> page = this.getGenericDao().findPage(pageIndex, pageSize, getEntityClass(), filters, order);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 课程分页 资源归属,分类,名称,创建人查询
|
||||
* */
|
||||
public PageList<Course> queryCoursePageType(int pageIndex, int pageSize,List<IFieldFilter> filters,OrderCondition order){
|
||||
PageList<Course> page = this.getGenericDao().findPage(pageIndex, pageSize, getEntityClass(), filters, order);
|
||||
return page;
|
||||
}
|
||||
|
||||
// public List<RankingDto> statRanking(int num,Integer type, Integer time) throws Exception{
|
||||
//
|
||||
// QueryBuilder query=QueryBuilder.from(Course.class);
|
||||
// query.setPageSize(num);
|
||||
// query.addFields("id","name","type","studys","score");
|
||||
// query.addFilter(FieldFilters.eq("deleted",false));
|
||||
// query.addFilter(FieldFilters.eq("status",Course.STATUS_AUDIT_FINISH));
|
||||
// query.addFilter(FieldFilters.eq("published", true));
|
||||
// query.addFilter(FieldFilters.eq("enabled",true));
|
||||
// query.addOrder(OrderCondition.desc("studys"));
|
||||
//// query.addOrder(OrderCondition.desc("score"));
|
||||
// List<Object[]> list=this.findListFields(query.builder());
|
||||
// List<RankingDto> rs=new ArrayList<RankingDto>();
|
||||
// for(Object[] objs : list) {
|
||||
// RankingDto dto=new RankingDto();
|
||||
// dto.setId((String) objs[0]);
|
||||
// dto.setName((String)objs[1]);
|
||||
// dto.setType((Integer) objs[2]);
|
||||
// dto.setStudys((Integer)objs[3]);
|
||||
// dto.setScore((Float)objs[4]);
|
||||
// rs.add(dto);
|
||||
// }
|
||||
// return rs;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 根据kid查询
|
||||
* */
|
||||
public String detailOld(String kid){
|
||||
String mess=null;
|
||||
Course kid1 = this.getGenericDao().findOne(Course.class, FieldFilters.eq("kid", kid));
|
||||
if(kid1!=null){
|
||||
mess="有重复的课程kid,不能添加";
|
||||
}
|
||||
return mess;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据kid查询
|
||||
* */
|
||||
public String detail(String kid){
|
||||
String id=null;
|
||||
Object field = findField("id", FieldFilters.eq("kid", kid));
|
||||
if(field!=null){
|
||||
id= (String) field;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据kid in查询
|
||||
* */
|
||||
public List<String> list(List<String> ids){
|
||||
QueryBuilder builder = QueryBuilder.from(Course.class);
|
||||
builder.addFilter(FieldFilters.in("kid",ids));
|
||||
builder.addFields("kid");
|
||||
List<String> listFields = null;
|
||||
try {
|
||||
List<Object[]> listFields1 = this.getGenericDao().findListFields(builder.builder());
|
||||
for (Object[] o:listFields1) {
|
||||
String s= (String) o[0];
|
||||
listFields.add(s);
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return listFields;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseExam;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseExamDao extends BaseDao<CourseExam> {
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.IFieldFilter;
|
||||
import com.xboe.course.newCourse.course.entity.CourseFile;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Repository
|
||||
public class CourseFileDao extends BaseDao<CourseFile> {
|
||||
/**
|
||||
* 查询视频,图文,音频,文档,外部连接
|
||||
* 关键词搜索
|
||||
* */
|
||||
public PageList<CourseFile> queryPage(int pageIndex, int pageSize, OrderCondition order, List<IFieldFilter> filters, PageList<CourseFile> page1){
|
||||
PageList<CourseFile> page = page1;
|
||||
return page;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseHomeWork;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseHomeWorkDao extends BaseDao<CourseHomeWork> {
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseImportLog;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseImportLogDao extends BaseDao<CourseImportLog> {
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseSection;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseSectionDao extends BaseDao<CourseSection> {
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseTeacher;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class CourseTeacherDao extends BaseDao<CourseTeacher> {
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.CourseUpdateLog;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 课程更新记录,单独的记录,与统一日志分开
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class CourseUpdateLogDao extends BaseDao<CourseUpdateLog>{
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.GroupUserLog;
|
||||
|
||||
@Repository
|
||||
public class GroupUserLogDao extends BaseDao<GroupUserLog>{
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.course.newCourse.course.entity.ScoreRule;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class ScoreRuleDao extends BaseDao<ScoreRule> {
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.IFieldFilter;
|
||||
import com.xboe.core.orm.QueryBuilder;
|
||||
import com.xboe.course.newCourse.course.entity.Type;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分类管理DAO
|
||||
*/
|
||||
@Repository
|
||||
public class TypeDao extends BaseDao<Type> {
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public List<Type> findList(Type type) {
|
||||
QueryBuilder qb = QueryBuilder.from(this.getEntityClass());
|
||||
qb.addFilter(FieldFilters.eq("deleted", false));
|
||||
if (type != null) {
|
||||
if (type.getSysResType() != null) {
|
||||
qb.addFilter(FieldFilters.eq("sysResType", type.getSysResType()));
|
||||
}
|
||||
if (type.getFilter() != null) {
|
||||
qb.addFilter(FieldFilters.eq("filter", type.getFilter()));
|
||||
}
|
||||
if (type.getStatus() != null) {
|
||||
qb.addFilter(FieldFilters.eq("status", type.getStatus()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(type.getParentId())) {
|
||||
qb.addFilter(FieldFilters.eq("parentId", type.getParentId()));
|
||||
}
|
||||
}
|
||||
qb.addOrder(OrderCondition.asc("parentId"));
|
||||
qb.addOrder(OrderCondition.asc("orderIndex"));
|
||||
return this.findList(qb.builder());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类数量
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public Integer getTypeCount(Type type) {
|
||||
List<IFieldFilter> filters = new ArrayList<>();
|
||||
filters.add(FieldFilters.eq("deleted", false));
|
||||
if (type != null) {
|
||||
if (type.getSysResType() != null) {
|
||||
filters.add(FieldFilters.eq("sysResType", type.getSysResType()));
|
||||
}
|
||||
if (StringUtil.isNotBlank(type.getParentId())) {
|
||||
filters.add(FieldFilters.eq("parentId", type.getParentId()));
|
||||
}
|
||||
}
|
||||
return this.count(filters.toArray(new IFieldFilter[filters.size()]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查唯一性
|
||||
*
|
||||
* @param name
|
||||
* @param parentId
|
||||
* @param sysResType
|
||||
* @param excludeId
|
||||
* @return
|
||||
*/
|
||||
public Type checkOnly(String name, String parentId, Integer sysResType, String excludeId) {
|
||||
List<IFieldFilter> filters = new ArrayList<>();
|
||||
filters.add(FieldFilters.eq("deleted", false));
|
||||
if (StringUtil.isNotBlank(parentId)) {
|
||||
filters.add(FieldFilters.eq("parentId", parentId));
|
||||
}
|
||||
if (sysResType != null) {
|
||||
filters.add(FieldFilters.eq("sysResType", sysResType));
|
||||
}
|
||||
filters.add(FieldFilters.eq("name", name));
|
||||
if (StringUtil.isNotBlank(excludeId)) {
|
||||
List<String> excludeIds = new ArrayList<>();
|
||||
excludeIds.add(excludeId);
|
||||
filters.add(FieldFilters.notIn("id", excludeIds));
|
||||
}
|
||||
return findOne(filters.toArray(new IFieldFilter[filters.size()]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称查出id
|
||||
* */
|
||||
public String selectByName(String name){
|
||||
String mess=null;
|
||||
Type type = this.findOne(FieldFilters.eq("name", name));
|
||||
if(type!=null){
|
||||
mess=type.getId();
|
||||
}
|
||||
return mess;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.course.newCourse.course.entity.User;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 用户DAO
|
||||
*/
|
||||
@Slf4j
|
||||
@Repository
|
||||
public class UserDao extends BaseDao<User> {
|
||||
//
|
||||
// /**
|
||||
// * 分页查询
|
||||
// *
|
||||
// * @param pageIndex
|
||||
// * @param pageSize
|
||||
// * @param user
|
||||
// * @param order
|
||||
// * @return
|
||||
// */
|
||||
// public PageList<User> query(int pageIndex, int pageSize, UserVo user, OrderCondition order) {
|
||||
// List<IFieldFilter> filters = new ArrayList<>();
|
||||
//
|
||||
// if (user != null) {
|
||||
// if (StringUtils.isNotBlank(user.getKeyWord())) {
|
||||
// filters.add(FieldFilters.or(FieldFilters.like("name", user.getKeyWord()), FieldFilters.like("userNo", user.getKeyWord())));
|
||||
// }else {
|
||||
// if (StringUtils.isNotBlank(user.getName())) {
|
||||
// filters.add(FieldFilters.like("name", LikeMatchMode.ANYWHERE, user.getName()));
|
||||
// }
|
||||
// if (StringUtils.isNotBlank(user.getUserNo())) {
|
||||
// filters.add(FieldFilters.like("userNo", LikeMatchMode.ANYWHERE, user.getUserNo()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (StringUtils.isNotBlank(user.getDepartId())) {
|
||||
// filters.add(FieldFilters.eq("departId", user.getDepartId()));
|
||||
// }
|
||||
// }
|
||||
// return this.findPage(pageIndex, pageSize,filters, order);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 按用户编号查询
|
||||
// *
|
||||
// * @param userNos
|
||||
// * @return
|
||||
// */
|
||||
// public List<User> getListByUserNos(List<String> userNos) {
|
||||
// return this.findList(FieldFilters.in("userNo", userNos));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据旧系统ID查询数据
|
||||
// *
|
||||
// * @param sysId
|
||||
// * @return
|
||||
// */
|
||||
// public User getBySysId(String sysId) {
|
||||
// return this.findOne(FieldFilters.eq("sysId", sysId));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 按姓名查询用户信息
|
||||
// *
|
||||
// * @param keyword
|
||||
// * @return
|
||||
// */
|
||||
// public List<UserSimpleVo> getListByName(String keyword) {
|
||||
//
|
||||
// String hql = "Select a.id,a.avatar,u.name,u.userNo,org.namePath from Account a left join User u on a.id=u.id left join Organization org on u.departId=org.id where u.name=?1";
|
||||
// List<UserSimpleVo> results = null;
|
||||
// try {
|
||||
// List<Object[]> list = this.findListFields(hql, keyword);
|
||||
// if (list != null && !list.isEmpty()) {
|
||||
// results = new ArrayList<>();
|
||||
// for (Object[] objs : list) {
|
||||
// results.add(resultToVo(objs));
|
||||
// }
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
//// e.printStackTrace();
|
||||
// log.error("查询失败",e);
|
||||
// }
|
||||
// return results;
|
||||
// }
|
||||
//
|
||||
// private UserSimpleVo resultToVo(Object[] objs) {
|
||||
// String id = (String) objs[0];
|
||||
// String avatar = (String) objs[1];
|
||||
// String name = (String) objs[2];
|
||||
// String code = (String) objs[3];
|
||||
// String namePath = (String) objs[4];
|
||||
// UserSimpleVo usv = new UserSimpleVo();
|
||||
// usv.setAid(id);
|
||||
// usv.setAvatar(avatar);
|
||||
// usv.setName(name);
|
||||
// usv.setCode(code);
|
||||
// usv.setOrgInfo(namePath);
|
||||
// return usv;
|
||||
// }
|
||||
|
||||
public User getBySysId(String sysId){
|
||||
return this.findOne(FieldFilters.eq("sysId",sysId));
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.IFieldFilter;
|
||||
import com.xboe.core.orm.LikeMatchMode;
|
||||
import com.xboe.course.newCourse.course.entity.UserGroup;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 受众管理DAO
|
||||
*/
|
||||
@Repository
|
||||
public class UserGroupDao extends BaseDao<UserGroup> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageIndex
|
||||
* @param pageSize
|
||||
* @param userGroup
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
public PageList<UserGroup> query(int pageIndex, int pageSize, UserGroup userGroup, OrderCondition order) {
|
||||
List<IFieldFilter> filters = new ArrayList<>();
|
||||
if (userGroup != null) {
|
||||
if (StringUtils.isNotBlank(userGroup.getName())) {
|
||||
filters.add(FieldFilters.like("name", LikeMatchMode.ANYWHERE, userGroup.getName()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(userGroup.getSysCreateAid())) {
|
||||
filters.add(FieldFilters.eq("sysCreateAid", userGroup.getSysCreateAid()));
|
||||
}
|
||||
if (userGroup.getGtype() != null) {
|
||||
filters.add(FieldFilters.eq("gtype", userGroup.getGtype()));
|
||||
}
|
||||
if (userGroup.getStatus() != null) {
|
||||
filters.add(FieldFilters.eq("status", userGroup.getStatus()));
|
||||
}
|
||||
}
|
||||
return this.getGenericDao().findPage(pageIndex, pageSize, getEntityClass(), filters, order);
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.QueryBuilder;
|
||||
import com.xboe.course.newCourse.course.entity.UserGroupItem;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 受众人员DAO
|
||||
*/
|
||||
@Repository
|
||||
public class UserGroupItemDao extends BaseDao<UserGroupItem> {
|
||||
|
||||
/**
|
||||
* 查询受众人员
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public List<UserGroupItem> findList(UserGroupItem entity) {
|
||||
QueryBuilder qb = QueryBuilder.from(this.getEntityClass());
|
||||
if (entity != null) {
|
||||
if (StringUtils.isNotBlank(entity.getGroupId())) {
|
||||
qb.addFilter(FieldFilters.eq("groupId", entity.getGroupId()));
|
||||
}
|
||||
|
||||
}
|
||||
return this.findList(qb.builder());
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import com.xboe.core.orm.annotation.MetaInfo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 账号表,只是记录登录的账号信息,无任务业务实名类的信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE + "account")
|
||||
public class Account extends IdEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@MetaInfo("原系统中的id")
|
||||
@Column(name = "sys_id", length = 36)
|
||||
private String sysId;
|
||||
|
||||
@MetaInfo("登录名")
|
||||
@Column(name = "login_name", nullable = true, length = 30)
|
||||
private String loginName;
|
||||
|
||||
@MetaInfo("用户头像地址")
|
||||
@Column(name = "avatar", nullable = true, length = 100)
|
||||
private String avatar;
|
||||
|
||||
@MetaInfo("手机号")
|
||||
@Column(name = "mobile", length = 11)
|
||||
private String mobile;
|
||||
|
||||
@Column(name = "email", length = 100)
|
||||
private String email;
|
||||
|
||||
@Column(name = "nick_name", length = 20)
|
||||
private String nickName;
|
||||
|
||||
@Column(name = "pass_key", length = 6)
|
||||
private String passKey;
|
||||
|
||||
@Column(name = "pass_value", length = 32)
|
||||
private String passValue;
|
||||
|
||||
@Column(name = "reg_time" )
|
||||
private LocalDateTime regTime;
|
||||
|
||||
@MetaInfo("关联的公司id")
|
||||
@Column(name = "company_id", length = 36)
|
||||
private String companyId;
|
||||
|
||||
// 状态1, 正常,2停用
|
||||
@Column(name = "status", length = 1)
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "deleted", length = 1)
|
||||
private Boolean deleted;
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* 评估内容表,可以设置多个评估,与相应的内容关联
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"assess_content")
|
||||
public class AssessContent extends IdEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 旧系统的id
|
||||
* */
|
||||
@Column(name = "kid")
|
||||
private String kid;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 组名称 同一个评估卷,名称可以一样,用于选择
|
||||
* */
|
||||
@Column(name = "gname",length = 50)
|
||||
private String gName;
|
||||
|
||||
/**
|
||||
* 问题
|
||||
* */
|
||||
@Column(name = "question",length = 50)
|
||||
private String question;
|
||||
/**
|
||||
* 形式 问题的形势,单选,多选
|
||||
* */
|
||||
@Column(name = "qtype")
|
||||
private Integer qType;
|
||||
/**
|
||||
* 顺序 显示顺序
|
||||
* */
|
||||
@Column(name = "order_index")
|
||||
private String orderIndex;
|
||||
|
||||
/**
|
||||
* 答案 多个答案,每个答案对应的值,json
|
||||
* */
|
||||
@Column(name = "answers")
|
||||
private String answers;
|
||||
|
||||
/**
|
||||
* 关联类型
|
||||
* */
|
||||
@Column(name = "ref_type",length=30)
|
||||
private String refType;
|
||||
/**
|
||||
* 关联id 分类id,标签id
|
||||
* */
|
||||
@Column(name = "ref_id")
|
||||
private String refId;
|
||||
|
||||
}
|
||||
@@ -1,305 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 课程基本信息表
|
||||
* */
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE+"course")
|
||||
public class Course extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**pc端课程*/
|
||||
public static int DEVICE_PC=1;
|
||||
|
||||
/**移动端课程*/
|
||||
public static int DEVICE_MOBILE=2;
|
||||
|
||||
/**所有的设备*/
|
||||
public static int DEVICE_ALL=3;
|
||||
|
||||
/**未提交,草稿*/
|
||||
public static final int STATUS_NONE=1;
|
||||
|
||||
/**已提交,待审核*/
|
||||
public static final int STATUS_SUBMIT=2;
|
||||
|
||||
/**审核不通过*/
|
||||
public static final int STATUS_AUDIT_NOPASS=3;
|
||||
|
||||
/**审核完成,审核通过*/
|
||||
public static final int STATUS_AUDIT_FINISH=5;
|
||||
|
||||
public Course() {
|
||||
|
||||
}
|
||||
|
||||
public Course(String id,Integer type,String name,String coverImg, Float score,Integer studys,Integer comments,Integer shares,Integer praises,Integer favorites
|
||||
,String forUsers,String value,String summary,LocalDateTime publishTime,Boolean isTop) {
|
||||
this.setId(id);
|
||||
this.setType(type);
|
||||
this.setName(name);
|
||||
this.setCoverImg(coverImg);
|
||||
this.setScore(score);
|
||||
this.setComments(comments);
|
||||
this.setStudys(studys);
|
||||
this.setShares(shares);
|
||||
this.setPraises(praises);
|
||||
this.setFavorites(praises);
|
||||
this.forUsers=forUsers;
|
||||
this.value=value;
|
||||
this.summary=summary;
|
||||
this.publishTime=publishTime;
|
||||
this.isTop=isTop;
|
||||
}
|
||||
|
||||
@Column(name = "kid")
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 课程名称
|
||||
* */
|
||||
@Column(name = "name",nullable=false, length = 100)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 课程类型,10微课,21在线课(直播);20:在线课(录播);30:面授课;90:混合式 BoedxCourseType
|
||||
* */
|
||||
@Column(name = "type",nullable=false,length = 1)
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 企业ID, 多企业使用
|
||||
*/
|
||||
@Column(name = "company_id", length = 36)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 课程封面
|
||||
* */
|
||||
@Column(name = "cover_img",length = 400)
|
||||
private String coverImg;
|
||||
|
||||
@Column(name = "sys_type1",length = 19)
|
||||
private String sysType1;
|
||||
|
||||
@Column(name = "sys_type2",length = 19)
|
||||
private String sysType2;
|
||||
|
||||
@Column(name = "sys_type3",length = 19)
|
||||
private String sysType3;
|
||||
|
||||
/**资源归属 1级*/
|
||||
@Column(name = "res_owner1",length = 19)
|
||||
private String resOwner1;
|
||||
|
||||
/**资源归属 2级*/
|
||||
@Column(name = "res_owner2",length = 19)
|
||||
private String resOwner2;
|
||||
|
||||
/**资源归属 3级*/
|
||||
@Column(name = "res_owner3",length = 19)
|
||||
private String resOwner3;
|
||||
|
||||
/**
|
||||
* 目标人群
|
||||
* */
|
||||
@Column(name = "for_users",length = 50)
|
||||
private String forUsers;
|
||||
|
||||
/**应用场景*/
|
||||
@Column(name = "for_scene",length = 50)
|
||||
private String forScene;
|
||||
|
||||
/**
|
||||
* 课程价值
|
||||
* */
|
||||
@Column(name = "value",length = 200)
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
* */
|
||||
@Column(name = "tags",length = 200)
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
* */
|
||||
@Column(name = "keywords",length = 100)
|
||||
private String keywords;
|
||||
|
||||
/**
|
||||
* 观看设置原browsesetting字段,改为设备 1:PC端可见;2:移动端可见;3:多端可见
|
||||
* 查询时,可以根据不等于查询出移动端或pc端的课程
|
||||
* */
|
||||
@Column(name = "device",length = 1)
|
||||
private Integer device;
|
||||
|
||||
/**
|
||||
* 课程状态,多人审核机制,所以这里并没有审核通过与不通过的状态了
|
||||
* 课程状态 1:未提交(草稿);2:已提交;3: 审核未通过,5审核完成
|
||||
* */
|
||||
@Column(name = "status",length = 1)
|
||||
private Integer status;//因为是多
|
||||
|
||||
/**
|
||||
* 发布状态 ,是否已发布
|
||||
*/
|
||||
@Column(name = "published",length = 1)
|
||||
private Boolean published;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
* */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Column(name = "publish_time")
|
||||
private LocalDateTime publishTime;
|
||||
|
||||
/**
|
||||
* 截止时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Column(name = "dead_time")
|
||||
private LocalDateTime deadTime;
|
||||
|
||||
/**
|
||||
* 开放权限
|
||||
* */
|
||||
@Column(name = "open_object",length = 400)
|
||||
private String openObject;
|
||||
|
||||
/**
|
||||
* 课程来源 1:内部;2;外部
|
||||
* */
|
||||
@Column(name = "source",length = 1)
|
||||
private Integer source;
|
||||
|
||||
@Column(name = "views", nullable = false)
|
||||
private Integer views;
|
||||
|
||||
@Column(name = "comments", nullable = false)
|
||||
private Integer comments;
|
||||
|
||||
@Column(name = "praises", nullable = false)
|
||||
private Integer praises;
|
||||
|
||||
@Column(name = "shares", nullable = false)
|
||||
private Integer shares;
|
||||
|
||||
@Column(name = "favorites", nullable = false)
|
||||
private Integer favorites;
|
||||
|
||||
/**学习人数*/
|
||||
@Column(name = "studys", nullable = false)
|
||||
private Integer studys;
|
||||
|
||||
/**得分*/
|
||||
@Column(name = "score", nullable = false)
|
||||
private Float score;
|
||||
|
||||
/**
|
||||
*建议学习时长
|
||||
* */
|
||||
@Column(name = "study_time",length = 11)
|
||||
private Integer studyTime;
|
||||
|
||||
/*
|
||||
* 课程摘要
|
||||
* */
|
||||
@Column(name = "summary",length = 2000)
|
||||
private String summary;
|
||||
|
||||
/*
|
||||
* 课程概述
|
||||
* */
|
||||
@Column(name = "overview",columnDefinition = "text")
|
||||
private String overview;
|
||||
|
||||
|
||||
//页面中存在置顶,启用/停用操作,在这里还没有加字段
|
||||
|
||||
/**启用的,上架*/
|
||||
@Column(name = "enabled", nullable = false, length = 1)
|
||||
private Boolean enabled;
|
||||
|
||||
/**启用禁用说明*/
|
||||
@Column(name = "enable_remark", nullable = true, length = 200)
|
||||
private String enableRemark;
|
||||
|
||||
/**是否置顶*/
|
||||
@Column(name = "is_top", nullable = false, length = 1)
|
||||
private Boolean isTop;
|
||||
|
||||
@Column(name = "top_time", nullable = true)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime topTime;
|
||||
|
||||
/**
|
||||
* 是否可物理删除,在课程从来没有发布过intint时是可以物理删除的,如果已发布过,就不能再物理删除
|
||||
*/
|
||||
@Column(name = "erasable")
|
||||
private Boolean erasable;
|
||||
|
||||
//下面两项暂时先放在此处,以后优化处理
|
||||
|
||||
/**
|
||||
* 分数计算公式,应用分数计算规则时处理
|
||||
*/
|
||||
@Column(name = "score_formula",length = 200)
|
||||
private String scoreFormula;
|
||||
|
||||
/**
|
||||
* 是否通过的计算,返回boolean的计算结果
|
||||
*/
|
||||
@Column(name = "pass_formula",length = 200)
|
||||
private String passFormula;
|
||||
|
||||
/**
|
||||
* 是否按顺序学习
|
||||
*/
|
||||
@Column(name = "order_study",nullable = true)
|
||||
private Boolean orderStudy;
|
||||
|
||||
/**
|
||||
* 踩
|
||||
*/
|
||||
@Column(name = "trample_count",nullable = false)
|
||||
private Integer trampleCount;
|
||||
|
||||
/**
|
||||
* 指定审核时,审核人的id, 具体的审核转发事件记录在审核日志表中
|
||||
* CourseAudit 表
|
||||
*/
|
||||
@Column(name = "audit_aid",nullable = true,length=19)
|
||||
private String auditAid;
|
||||
|
||||
/**审核说明,用于显示*/
|
||||
@Column(name = "audit_info",nullable = true,length=100)
|
||||
private String auditInfo;
|
||||
|
||||
public Course(String id,String name,String summary,String coverImg,String sysCreateAid,String sysCreateBy,Integer type,LocalDateTime publishTime){
|
||||
super.setId(id);
|
||||
this.name=name;
|
||||
this.summary=summary;
|
||||
this.coverImg=coverImg;
|
||||
super.setSysCreateAid(sysCreateAid);
|
||||
super.setSysCreateBy(sysCreateBy);
|
||||
this.type=type;
|
||||
this.publishTime=publishTime;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_assess")
|
||||
public class CourseAssess extends IdEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 旧系统id
|
||||
* */
|
||||
@Column(name = "kid")
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 评估问题
|
||||
* */
|
||||
@Column(name = "assess_id")
|
||||
private String assessId;
|
||||
|
||||
/**
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id")
|
||||
private String courseId;
|
||||
|
||||
/*
|
||||
* 内容表id
|
||||
* */
|
||||
@Column(name = "content_id",nullable=false,length=19)
|
||||
private String contentId;
|
||||
|
||||
/**
|
||||
* 问题
|
||||
* */
|
||||
@Column(name = "question",length = 50)
|
||||
private String question;
|
||||
|
||||
/**
|
||||
* 形式 问题的形势,单选,多选
|
||||
* */
|
||||
@Column(name = "qtype")
|
||||
private Integer qType;
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 新增加的课程邀请审核,管理员邀请教师审核
|
||||
* 需要与课程表联查
|
||||
* 因为邀请的情况,所以这里不做处理
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_audit")
|
||||
public class CourseAudit extends IdBaseEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**未审核*/
|
||||
public static int AUDITSTATE_NULL=1;
|
||||
|
||||
/**审核通过*/
|
||||
public static int AUDITSTATE_PASS=3;
|
||||
|
||||
/**审核不通过*/
|
||||
public static int AUDITSTATE_NOPASS=2;
|
||||
|
||||
/**课程id*/
|
||||
@Column(name = "course_id",nullable=false, length=18)
|
||||
private String courseId;
|
||||
|
||||
@Column(name = "teacher_id",nullable=false, length=18)
|
||||
private String teacherId;
|
||||
|
||||
@Column(name = "teacher_name",nullable=false, length=30)
|
||||
private String teacherName;
|
||||
|
||||
@Column(name = "audit_time",nullable=true)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
@Column(name = "audit_remark",nullable=true, length=200)
|
||||
private String auditRemark;
|
||||
|
||||
@Column(name = "audit_state",nullable=false, length=1)
|
||||
private Integer auditState;
|
||||
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
/**
|
||||
* 课程内容表
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_content")
|
||||
public class CourseContent extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//public static final int contentType
|
||||
|
||||
/**
|
||||
* 对应旧课程资源里的id
|
||||
* */
|
||||
@Column(name = "rid")
|
||||
private String rid;
|
||||
/**
|
||||
* 对应旧课程*/
|
||||
@Column(name = "type_id")
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 旧课程的发布状态
|
||||
* */
|
||||
@Column(name = "publishStatus")
|
||||
private String publishStatus;
|
||||
|
||||
/**
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length=19)
|
||||
private String courseId;
|
||||
|
||||
/**
|
||||
* 章节id
|
||||
* */
|
||||
@Column(name = "csection_id",nullable=true,length=19)
|
||||
private String csectionId;
|
||||
|
||||
/**
|
||||
* 顺序号
|
||||
* */
|
||||
@Column(name = "sort_index",nullable=false,length = 2)
|
||||
private Integer sortIndex;
|
||||
|
||||
/**
|
||||
* 内容类型
|
||||
* BoedxContentType
|
||||
* */
|
||||
@Column(name = "content_type",length = 2)
|
||||
private Integer contentType;
|
||||
|
||||
/**
|
||||
* 内容名称
|
||||
* */
|
||||
@Column(name = "content_name",length = 100)
|
||||
private String contentName;
|
||||
|
||||
/**
|
||||
* 内容的关联id
|
||||
* */
|
||||
@Column(name = "content_refid")
|
||||
private String contentRefId;
|
||||
|
||||
/**
|
||||
* 内容 具体的内容
|
||||
* */
|
||||
@Column(name = "content",columnDefinition = "mediumtext")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
*时长,建议学习时长
|
||||
* */
|
||||
@Column(name = "duration")
|
||||
private Integer duration;
|
||||
|
||||
|
||||
/**用于学习时的状态显示,非存储字段*/
|
||||
@Transient
|
||||
private Integer status;
|
||||
|
||||
public CourseContent() {
|
||||
|
||||
}
|
||||
|
||||
public CourseContent(String id,Integer sortIndex,String contentName,Integer contentType, String contentRefId) {
|
||||
this.setId(id);
|
||||
this.sortIndex=sortIndex;
|
||||
this.contentName=contentName;
|
||||
this.contentType=contentType;
|
||||
this.contentRefId=contentRefId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* 课程的受众,允许查看的人群
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_crowd")
|
||||
public class CourseCrowd extends IdBaseEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 课程id
|
||||
*/
|
||||
@Column(name = "course_id",nullable=false,length=19)
|
||||
private String courseId;
|
||||
|
||||
/**
|
||||
* 群组,受众id
|
||||
*/
|
||||
@Column(name = "group_id",nullable=false,length=19)
|
||||
private String groupId;
|
||||
|
||||
/**
|
||||
* 群组,受众的规则
|
||||
*/
|
||||
@Column(name = "group_rule",nullable=true,length=500)
|
||||
private String groupRule;
|
||||
|
||||
/**
|
||||
* 群组,受众名称
|
||||
*/
|
||||
@Column(name = "group_name",nullable=false,length=50)
|
||||
private String groupName;
|
||||
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* 课程考试信息,如果是从题库中选择的考试,需要把考试做一下复制存储在这个表里面
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_exam")
|
||||
public class CourseExam extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final int SCORINGTYPE_MAX=1;
|
||||
|
||||
public static final int SCORINGTYPE_LAST=2;
|
||||
|
||||
/**
|
||||
* 旧系统id
|
||||
* */
|
||||
@Column(name = "kid")
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 旧系统resid*/
|
||||
@Column(name = "res_id")
|
||||
private String resId;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length=19)
|
||||
private String courseId;
|
||||
|
||||
/*
|
||||
* 内容表id
|
||||
* */
|
||||
@Column(name = "content_id",nullable=false,length=19)
|
||||
private String contentId;
|
||||
|
||||
/*
|
||||
* 考试名称
|
||||
* */
|
||||
@Column(name = "test_name",nullable=false,length = 50)
|
||||
private String testName;
|
||||
|
||||
|
||||
/*
|
||||
* 考试时长 分钟
|
||||
* */
|
||||
@Column(name = "test_duration",nullable=true)
|
||||
private Integer testDuration;
|
||||
|
||||
/*
|
||||
* 显示解析,按boolean类型显示
|
||||
* */
|
||||
@Column(name = "show_analysis",nullable=false,length=1)
|
||||
private Boolean showAnalysis;
|
||||
|
||||
/*
|
||||
* 显示答案
|
||||
* */
|
||||
@Column(name = "show_answer",nullable=false,length=1)
|
||||
private Boolean showAnswer;
|
||||
/*
|
||||
* 尝试次数 默认是0无限制
|
||||
* */
|
||||
@Column(name = "times")
|
||||
private Integer times;
|
||||
/*
|
||||
* 试题排列 0表不乱序,1试题乱序,2选项乱序,3全部乱序
|
||||
* */
|
||||
@Column(name = "arrange",nullable=false,length=1)
|
||||
private Integer arrange;
|
||||
/*
|
||||
* 评分方式 1最高一次,2最后一次
|
||||
* */
|
||||
@Column(name = "scoring_type",nullable=false,length=1)
|
||||
private Integer scoringType;
|
||||
/*
|
||||
* 及格线
|
||||
* */
|
||||
@Column(name = "pass_line")
|
||||
private Integer passLine;
|
||||
/*
|
||||
* 随机模型
|
||||
* */
|
||||
@Column(name = "random_mode",nullable=false,length=1)
|
||||
private Boolean randomMode;
|
||||
|
||||
/**
|
||||
* 随机生成试题的数量 ,只是随机生成试题模式下才会启作用
|
||||
*/
|
||||
@Column(name = "qnum",nullable=true)
|
||||
private Integer qnum;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column(name = "qscore",nullable=true)
|
||||
private Float qscore;
|
||||
|
||||
/*
|
||||
* 试卷类型 1自定义,2使用已有试卷
|
||||
* */
|
||||
@Column(name = "paper_type",nullable=false,length=1)
|
||||
private Integer paperType;
|
||||
|
||||
/**
|
||||
* 是否是百分制显示,默认是
|
||||
*/
|
||||
@Column(name = "percent_score",length=1)
|
||||
private Boolean percentScore;
|
||||
|
||||
/**
|
||||
* 试题的id,使用已有试卷时保存选择试卷的id
|
||||
*/
|
||||
@Column(name = "paper_id",nullable=true,length=19)
|
||||
private String paperId;
|
||||
|
||||
/*
|
||||
* 试卷内容 json数据
|
||||
* */
|
||||
@Column(name = "paper_content",columnDefinition = "mediumtext")
|
||||
private String paperContent;
|
||||
|
||||
/**考试说明,比如考试注意事项*/
|
||||
@Column(name = "info",nullable=true,length=500)
|
||||
private String info;
|
||||
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* 课件资源表,对应的课件的资源
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_file")
|
||||
public class CourseFile extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 名称
|
||||
* */
|
||||
@Column(name = "name",nullable=false,length = 100)
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 课程id,可以为空,管理员直接上传的课件,属于非课程课件
|
||||
* */
|
||||
@Column(name = "course_id",nullable=true,length=19)
|
||||
private String courseId;
|
||||
|
||||
/**
|
||||
* 资源类型 10视频,20音频,30图片, 40文档,41表图文,50表scrom包,...., 90表其它。对应 枚举BoedxCourseFileType
|
||||
* 用于选择资源时查询
|
||||
* */
|
||||
@Column(name = "res_type",nullable=false,length=1)
|
||||
private Integer resType;
|
||||
|
||||
/**资源归属 1级*/
|
||||
@Column(name = "res_owner1",length = 19)
|
||||
private String resOwner1;
|
||||
|
||||
/**资源归属 2级*/
|
||||
@Column(name = "res_owner2",length = 19)
|
||||
private String resOwner2;
|
||||
|
||||
/**资源归属 3级*/
|
||||
@Column(name = "res_owner3",length = 19)
|
||||
private String resOwner3;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
* */
|
||||
@Column(name = "file_name",nullable=false,length = 100)
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件类型。以后缀格式为准,比如 mp4
|
||||
* */
|
||||
@Column(name = "file_type",nullable=false,length = 20)
|
||||
private String fileType;
|
||||
|
||||
/**
|
||||
* 文件大小 kb
|
||||
* */
|
||||
@Column(name = "file_size")
|
||||
private Integer fileSize;
|
||||
|
||||
/**
|
||||
* 时长 秒
|
||||
* */
|
||||
@Column(name = "duration")
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 编码格式
|
||||
* */
|
||||
@Column(name = "decoder",length = 20)
|
||||
private String decoder;
|
||||
|
||||
/**
|
||||
* 视频宽
|
||||
* */
|
||||
@Column(name = "video_width")
|
||||
private Integer videoWidth;
|
||||
|
||||
/**
|
||||
* 视频高
|
||||
* */
|
||||
@Column(name = "video_height")
|
||||
private Integer videoHeight;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
* */
|
||||
@Column(name = "file_path",nullable=false,length =200 )
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 文件预览地址
|
||||
* */
|
||||
@Column(name = "preview_file_path",length =200 )
|
||||
private String previewFilePath;
|
||||
|
||||
/**
|
||||
* 转化状态 ,0表未转化,1表转化中,2表转化成功,3表转化失败
|
||||
*/
|
||||
@Column(name = "conver_status",length =1 )
|
||||
private Integer converStatus;
|
||||
|
||||
/**转化失败的原因*/
|
||||
@Column(name = "conver_error",length =200)
|
||||
private String converError;
|
||||
|
||||
/**显示设备,1pc端,2 移动端,3全部*/
|
||||
@Column(name = "device",length =1 )
|
||||
private Integer device;
|
||||
|
||||
/**是否允许下载*/
|
||||
@Column(name = "down",nullable=false, length =1 )
|
||||
private Boolean down;
|
||||
|
||||
/**资源归属,资源归属是三级,这里存储的只能是最后一级了 1级*/
|
||||
@Column(name = "ownership1",length = 50)
|
||||
private String ownership1;
|
||||
|
||||
/**资源归属,资源归属是三级,这里存储的只能是最后一级了 2级*/
|
||||
@Column(name = "ownership2",length = 50)
|
||||
private String ownership2;
|
||||
|
||||
/**资源归属,资源归属是三级,这里存储的只能是最后一级了 3级*/
|
||||
@Column(name = "ownership3",length = 50)
|
||||
private String ownership3;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
* */
|
||||
@Column(name = "remark",length = 200)
|
||||
private String remark;
|
||||
|
||||
public CourseFile() {
|
||||
|
||||
}
|
||||
|
||||
// public CourseFile(String id,String name,String fileType,String filePath,String sysCreateBy,Integer device) {
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 课程作业表
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_homework")
|
||||
public class CourseHomeWork extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 旧系统id*/
|
||||
@Column(name = "kid")
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length=19)
|
||||
private String courseId;
|
||||
|
||||
/**
|
||||
* 内容表id
|
||||
*/
|
||||
@Column(name = "content_id",nullable=false,length=19)
|
||||
private String contentId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
* */
|
||||
@Column(name = "name",length = 100)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
* */
|
||||
@Column(name = "content",columnDefinition = "text")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
* */
|
||||
@Column(name = "file",length = 200)
|
||||
private String file;
|
||||
|
||||
|
||||
/**
|
||||
* 截至时间
|
||||
* */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Column(name = "dead_time")
|
||||
private LocalDateTime deadTime;
|
||||
|
||||
|
||||
/**
|
||||
* 提交模式 1提交附件,2填写,3两者都可以
|
||||
* */
|
||||
@Column(name = "submit_mode")
|
||||
private Integer submitMode;
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_import_log")
|
||||
public class CourseImportLog extends IdEntity {
|
||||
|
||||
|
||||
@Column(name = "kid")
|
||||
private String kid;
|
||||
|
||||
@Column(name = "name")
|
||||
private String name;
|
||||
|
||||
@Column(name = "mess")
|
||||
private String mess;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Column(name = "time")
|
||||
private LocalDateTime time;
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
||||
/**
|
||||
* 课程分数规则表,用于计算课程的学习完成分数,或叫完成状态
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
public class CourseScoreRule{
|
||||
|
||||
/**
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length=19)
|
||||
private String courseId;
|
||||
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
@Column(name = "rule_name",nullable=false,length=30)
|
||||
private Integer ruleName;
|
||||
|
||||
/**
|
||||
* 规则类型,1表课程学习完,2表作业,3表考试,。。。。
|
||||
* */
|
||||
@Column(name = "rule_type",nullable=false)
|
||||
private Integer ruleType;
|
||||
|
||||
/**
|
||||
* 分数计算公式。
|
||||
* 参数:a 表本项的得分
|
||||
* */
|
||||
@Column(name = "score_formula",length = 200)
|
||||
private String scoreFormula;
|
||||
|
||||
/**
|
||||
* 通过条件,返回boolean的计算公式。
|
||||
* 参数:score 表上面分数计算公式的计算结果
|
||||
*/
|
||||
@Column(name = "pass_formula",length = 200)
|
||||
private String passFormula;
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
/*
|
||||
* 课程章节表
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_section")
|
||||
public class CourseSection extends IdEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// @Column(name = "kid")
|
||||
// private String kid;
|
||||
|
||||
/*
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length=19)
|
||||
private String courseId;
|
||||
|
||||
/*
|
||||
* 章节名称
|
||||
* */
|
||||
@Column(name = "name",length = 200)
|
||||
private String name;
|
||||
|
||||
/*
|
||||
* 章节描述
|
||||
* */
|
||||
@Column(name = "description")
|
||||
private String description;
|
||||
|
||||
/*
|
||||
* 上级id 顶级值是-1
|
||||
* */
|
||||
@Column(name = "parent_id")
|
||||
private String parentId;
|
||||
|
||||
/*
|
||||
* 顺序号
|
||||
* */
|
||||
@Column(name = "order_index",length = 2)
|
||||
private Integer orderIndex;
|
||||
|
||||
|
||||
/**用于学习时的状态显示,非存储字段*/
|
||||
@Transient
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
/**
|
||||
* 课程任课教师
|
||||
* */
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_teacher")
|
||||
public class CourseTeacher extends IdBaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 课程id
|
||||
* */
|
||||
@Column(name = "course_id",nullable=false,length=19)
|
||||
private String courseId;
|
||||
|
||||
/**
|
||||
* 教师id,实际上就是aid
|
||||
* */
|
||||
@Column(name = "teacher_id",nullable=false,length=19)
|
||||
private String teacherId;
|
||||
|
||||
/**
|
||||
* 教师姓名
|
||||
* */
|
||||
@Column(name = "teacher_name",nullable=true,length=30)
|
||||
private String teacherName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
* */
|
||||
@Transient
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 课程基本信息表
|
||||
* */
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE+"course_updatelog")
|
||||
public class CourseUpdateLog extends IdBaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@Column(name = "course_id", nullable = false,length=19)
|
||||
private String courseId;
|
||||
|
||||
/**
|
||||
* 修改前
|
||||
*/
|
||||
@Column(name = "before_data",columnDefinition = "text")
|
||||
private String beforeData;
|
||||
|
||||
/**
|
||||
* 修改后
|
||||
*/
|
||||
@Column(name = "log_data", nullable = false,columnDefinition = "text")
|
||||
private String logData;
|
||||
|
||||
|
||||
public CourseUpdateLog() {
|
||||
|
||||
}
|
||||
|
||||
public CourseUpdateLog(String id,String sysCreateAid,String sysCreateBy,LocalDateTime sysCreateTime) {
|
||||
this.setId(id);
|
||||
this.setSysCreateAid(sysCreateAid);
|
||||
this.setSysCreateBy(sysCreateBy);
|
||||
this.setSysCreateTime(sysCreateTime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 受从人员未导入的日志,本地用户没有匹配上的
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE + "user_group_log")
|
||||
public class GroupUserLog extends IdEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "group_id",length = 36)
|
||||
private String groupId;
|
||||
|
||||
@Column(name = "user_kid",length = 36)
|
||||
private String userKid;
|
||||
|
||||
@Column(name = "remark",length = 100)
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* 课程分数规则设置
|
||||
* */
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = SysConstant.TABLE_PRE+"score_rule")
|
||||
public class ScoreRule extends IdEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
@Column(name = "rule_name",nullable=false,length=30)
|
||||
private Integer ruleName;
|
||||
|
||||
/**
|
||||
* 规则类型,1表课程学习完,2表作业,3表考试,。。。。
|
||||
* */
|
||||
@Column(name = "rule_type",nullable=false)
|
||||
private Integer ruleType;
|
||||
|
||||
/**
|
||||
* 分数计算公式
|
||||
* */
|
||||
@Column(name = "score_formula",length = 200)
|
||||
private String scoreFormula;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
* */
|
||||
@Column(name = "remark",length = 200)
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* 分类实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE + "sys_type")
|
||||
public class Type extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Column(name = "name", nullable = false, length = 20)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 上级ID
|
||||
*/
|
||||
@Column(name = "parent_id", nullable = false, length = 18)
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 筛选项 0表不是 1表是
|
||||
*/
|
||||
@Column(name = "filter", nullable = false, length = 1)
|
||||
private Boolean filter;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@Column(name = "order_index", nullable = false, length = 5)
|
||||
private Integer orderIndex;
|
||||
|
||||
/**
|
||||
* 来源 1同步,2新建
|
||||
*/
|
||||
@Column(name = "origin", nullable = false, length = 1)
|
||||
private Integer origin;
|
||||
|
||||
/**
|
||||
* 1表启用,0表停用
|
||||
*/
|
||||
@Column(name = "status", nullable = false, length = 1)
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 绑定的资源数
|
||||
*/
|
||||
@Column(name = "total", length = 5)
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 有效性 1课程,2文章,3案例,4问答
|
||||
*/
|
||||
@Column(name = "sys_res_type", nullable = false, length = 1)
|
||||
private Integer sysResType;
|
||||
}
|
||||
@@ -1,229 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户信息表
|
||||
* 存储所有的用户信息,原表中的部分信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE + "user")
|
||||
public class User extends IdEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 旧系统id
|
||||
*/
|
||||
@Column(name = "sys_id", length = 36)
|
||||
private String sysId;
|
||||
|
||||
/**
|
||||
* 旧系统机构id
|
||||
*/
|
||||
@Column(name = "sys_depart_id", length = 36)
|
||||
private String sysDepartId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Column(name = "name", length = 30)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 员工编号
|
||||
*/
|
||||
@Column(name = "user_no", length = 30)
|
||||
private String userNo;
|
||||
|
||||
/**
|
||||
* 性别 1:男 2:女
|
||||
*/
|
||||
@Column(name = "gender", length = 1)
|
||||
private Integer gender;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@Column(name = "birthday")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate birthday;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@Column(name = "id_number", length = 18)
|
||||
private String idNumber;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Column(name = "mobile_no", length = 11)
|
||||
private String mobileNo;
|
||||
|
||||
/**
|
||||
* 家庭电话
|
||||
*/
|
||||
@Column(name = "home_phone_no", length = 50)
|
||||
private String homePhoneNo;
|
||||
|
||||
/**
|
||||
* 国籍
|
||||
*/
|
||||
@Column(name = "nationality", length = 50)
|
||||
private String nationality;
|
||||
|
||||
/**
|
||||
* 毕业院校
|
||||
*/
|
||||
@Column(name = "graduated_from", length = 50)
|
||||
private String graduatedFrom;
|
||||
|
||||
/**
|
||||
* 毕业专业
|
||||
*/
|
||||
@Column(name = "graduated_major", length = 50)
|
||||
private String graduatedMajor;
|
||||
|
||||
/**
|
||||
* 最高学历
|
||||
*/
|
||||
@Column(name = "highest_education", length = 50)
|
||||
private String highestEducation;
|
||||
|
||||
/**
|
||||
* 办公电话
|
||||
*/
|
||||
@Column(name = "telephone_no", length = 50)
|
||||
private String telephoneNo;
|
||||
|
||||
/**发薪地*/
|
||||
@Column(name = "payroll_place", length = 150)
|
||||
private String payrollPlace;
|
||||
|
||||
/**管理序列职级*/
|
||||
@Column(name = "position_mgr_level", length = 150)
|
||||
private String positionMgrLevel;
|
||||
|
||||
/**
|
||||
* 职务
|
||||
*/
|
||||
@Column(name = "duty", length = 50)
|
||||
private String duty;
|
||||
|
||||
/**
|
||||
* 职级
|
||||
*/
|
||||
@Column(name = "rank", length = 50)
|
||||
private String rank;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Column(name = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 所在公司
|
||||
*/
|
||||
@Column(name = "company_id", length = 36)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 所在部门
|
||||
*/
|
||||
@Column(name = "depart_id", length = 18)
|
||||
private String departId;
|
||||
|
||||
@Transient
|
||||
private String departName;
|
||||
|
||||
|
||||
/**
|
||||
* 所在域
|
||||
*/
|
||||
@Column(name = "domain_id", length = 36)
|
||||
private String domainId;
|
||||
|
||||
/**
|
||||
* 扩展字段,多租户系统的标识值
|
||||
*/
|
||||
@Column(name = "sass_id", length = 18)
|
||||
private String sassId;
|
||||
|
||||
/**
|
||||
* 用户类型,1表学员,2表教师,3表管理员
|
||||
* 该字段暂用于表示是否前台管理员
|
||||
*/
|
||||
@Column(name = "user_type", length = 1)
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
* 学习总时长
|
||||
*/
|
||||
@Column(name = "study_total", length = 11)
|
||||
private Integer studyTotal;
|
||||
|
||||
/**
|
||||
* boe的时长,和系统时长单独保存
|
||||
*/
|
||||
@Column(name = "learning_Duration", length = 11)
|
||||
private Integer learningDuration;
|
||||
|
||||
/**
|
||||
* 最近一次登录时间
|
||||
*/
|
||||
@Column(name = "last_login_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastLoginAt;
|
||||
|
||||
/**
|
||||
* 最近一次登录IP
|
||||
*/
|
||||
@Column(name = "last_login_ip", length = 30)
|
||||
private String lastLoginIp;
|
||||
|
||||
/**
|
||||
* 最近一次登录MAC地址
|
||||
*/
|
||||
@Column(name = "last_login_mac", length = 30)
|
||||
private String lastLoginMac;
|
||||
|
||||
/**
|
||||
* 最近一次操作时间
|
||||
*/
|
||||
@Column(name = "last_action_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastActionAt;
|
||||
|
||||
/**
|
||||
* 最近一次操作IP
|
||||
*/
|
||||
@Column(name = "last_action_ip", length = 30)
|
||||
private String lastActionIp;
|
||||
|
||||
/**
|
||||
* 最近一次操作MAC地址
|
||||
*/
|
||||
@Column(name = "last_action_mac", length = 30)
|
||||
private String lastActionMac;
|
||||
|
||||
/**
|
||||
* 在线状态;
|
||||
* 0:离线,1:在线
|
||||
*/
|
||||
@Column(name = "online", length = 1)
|
||||
private Boolean online;
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 受众实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE + "user_group")
|
||||
public class UserGroup extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**未发布*/
|
||||
public static final int STATUS_NONE=0;
|
||||
|
||||
/**已发布*/
|
||||
public static final int STATUS_PUBLISH=1;
|
||||
|
||||
/**停用*/
|
||||
public static final int STATUS_STOP=2;
|
||||
|
||||
@Column(name = "kid",length = 36)
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Column(name = "name",nullable=false,length = 50)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否导入成功
|
||||
*/
|
||||
@Column(name = "imported",length = 1)
|
||||
private Boolean imported;
|
||||
|
||||
/**
|
||||
* 人数
|
||||
*/
|
||||
@Column(name = "users")
|
||||
private Integer users;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
* 1表普通受众,2表自动受众
|
||||
*/
|
||||
@Column(name = "gtype", length = 2)
|
||||
private Integer gtype;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Column(name = "description", length = 200)
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 过滤条件
|
||||
*/
|
||||
@Column(name = "filter_json")
|
||||
private String filterJson;
|
||||
|
||||
/**
|
||||
* 状态 是否发布
|
||||
* 1表发布,0表未发布,2表已停用
|
||||
*/
|
||||
@Column(name = "status", length = 2)
|
||||
private Integer status;
|
||||
|
||||
@Transient
|
||||
private List<UserGroupItem> userGroupItems;
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.entity;
|
||||
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.IdEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* 受众人员
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = SysConstant.TABLE_PRE + "user_group_item")
|
||||
public class UserGroupItem extends IdEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 受众ID
|
||||
*/
|
||||
@Column(name = "groupId", nullable = false, length = 18)
|
||||
private String groupId;
|
||||
|
||||
/**
|
||||
* 账号ID
|
||||
*/
|
||||
@Column(name = "aid", nullable = false, length = 18)
|
||||
private String aid;
|
||||
|
||||
/**
|
||||
* 受众姓名
|
||||
*/
|
||||
@Column(name = "name", length = 30)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 工号
|
||||
*/
|
||||
@Column(name = "user_no", length = 20)
|
||||
private String userNo;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Column(name = "depart_id", length = 18)
|
||||
private String departId;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@Column(name = "depart_name", length = 50)
|
||||
private String departName;
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
@Column(name = "position", length = 30)
|
||||
private String position;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.service;
|
||||
|
||||
import com.xboe.course.entity.old.CourseOld;
|
||||
import com.xboe.course.newCourse.course.entity.CourseCrowd;
|
||||
import com.xboe.course.newCourse.course.entity.CourseImportLog;
|
||||
import com.xboe.course.newCourse.course.entity.UserGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ICourseOldService {
|
||||
|
||||
/**
|
||||
* 添加课程相关信息
|
||||
* */
|
||||
void save(CourseOld courseOld) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 添加课程日志
|
||||
* */
|
||||
void saveList(List<CourseImportLog> courseImportLogs);
|
||||
|
||||
|
||||
void saveError(CourseImportLog courseImportLog);
|
||||
|
||||
|
||||
/**
|
||||
* 清空课程相关信息
|
||||
* */
|
||||
void delete();
|
||||
|
||||
/**
|
||||
* 导入受众人员,一个受众一个受众的导
|
||||
* */
|
||||
void userGroupItem(UserGroup ug) throws Exception;
|
||||
|
||||
/**
|
||||
* 添加课程受众
|
||||
* */
|
||||
void saveCourseCrowd(List<CourseCrowd> list);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,772 +0,0 @@
|
||||
package com.xboe.course.newCourse.course.service.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xboe.common.utils.IDGenerator;
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.SysConstant;
|
||||
import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.utils.OkHttpUtil;
|
||||
import com.xboe.course.entity.old.*;
|
||||
import com.xboe.course.newCourse.course.dao.*;
|
||||
import com.xboe.course.newCourse.course.entity.*;
|
||||
import com.xboe.course.newCourse.course.service.ICourseOldService;
|
||||
import com.xboe.standard.BaseConstant;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CourseOldServiceImpl implements ICourseOldService {
|
||||
|
||||
@Autowired
|
||||
CourseDao courseDao;
|
||||
|
||||
@Autowired
|
||||
CourseSectionDao courseSectionDao;
|
||||
|
||||
@Autowired
|
||||
CourseContentDao courseContentDao;
|
||||
|
||||
@Autowired
|
||||
CourseExamDao courseExamDao;
|
||||
|
||||
@Autowired
|
||||
CourseHomeWorkDao courseHomeWorkDao;
|
||||
|
||||
@Autowired
|
||||
CourseFileDao courseFileDao;
|
||||
|
||||
|
||||
@Autowired
|
||||
CourseImportLogDao courseImportLogDao;
|
||||
|
||||
@Autowired
|
||||
OkHttpUtil okHttpUtil;
|
||||
|
||||
@Autowired
|
||||
UserGroupDao userGroupDao;
|
||||
|
||||
@Autowired
|
||||
CourseCrowdDao courseCrowdDao;
|
||||
|
||||
|
||||
@Autowired
|
||||
UserDao userDao;
|
||||
|
||||
@Autowired
|
||||
UserGroupItemDao userGroupItemDao;
|
||||
|
||||
@Autowired
|
||||
GroupUserLogDao GroupUserLogDao;
|
||||
|
||||
@Autowired
|
||||
CourseTeacherDao courseTeacherDao;
|
||||
|
||||
@Autowired
|
||||
TypeDao typeDao;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(CourseOld courseOld) throws Exception {
|
||||
|
||||
// try {
|
||||
Course course = new Course();
|
||||
course.setKid(courseOld.getKid());
|
||||
course.setName(courseOld.getName());
|
||||
course.setSummary(courseOld.getSummary());
|
||||
course.setType(courseOld.getType());
|
||||
course.setScore(courseOld.getScore());
|
||||
course.setCompanyId(courseOld.getCompanyId());
|
||||
course.setCoverImg(courseOld.getCoverImg());
|
||||
course.setComments(0);
|
||||
course.setDeleted(false);
|
||||
course.setEnabled(true);//是否可用,上下架
|
||||
course.setFavorites(0);
|
||||
course.setIsTop(false);
|
||||
course.setPraises(0);
|
||||
course.setPublished(true);
|
||||
course.setStatus(5);
|
||||
course.setShares(0);
|
||||
course.setViews(0);
|
||||
course.setStudyTime(0);
|
||||
course.setStudys(0);
|
||||
course.setScore(0f);
|
||||
course.setTrampleCount(0);
|
||||
course.setSource(2);
|
||||
course.setErasable(false);
|
||||
//先这样写,后续调整
|
||||
if (StringUtils.isNotBlank(courseOld.getCtype1())) {
|
||||
String byId = typeDao.selectByName(courseOld.getCtype1());
|
||||
if (StringUtils.isNotBlank(byId)) {
|
||||
course.setSysType1(byId);
|
||||
} else {
|
||||
log.info("当前数据库没有该内容分类" + courseOld.getCtype1());
|
||||
}
|
||||
} else {
|
||||
course.setSysType1("966458675698257920");
|
||||
}
|
||||
if (StringUtils.isNotBlank(courseOld.getCtype2())) {
|
||||
String byId = typeDao.selectByName(courseOld.getCtype2());
|
||||
if (StringUtils.isNotBlank(byId)) {
|
||||
course.setSysType2(byId);
|
||||
} else {
|
||||
log.info("当前数据库没有该内容分类" + courseOld.getCtype2());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(courseOld.getCtype3())) {
|
||||
String byId = typeDao.selectByName(courseOld.getCtype3());
|
||||
if (StringUtils.isNotBlank(byId)) {
|
||||
course.setSysType3(byId);
|
||||
} else {
|
||||
log.info("当前数据库没有该内容分类" + courseOld.getCtype3());
|
||||
}
|
||||
}
|
||||
if (courseOld.getDuration() != null) {
|
||||
course.setStudyTime(courseOld.getDuration());
|
||||
} else {
|
||||
course.setStudyTime(0);
|
||||
}
|
||||
course.setForScene("952957859775635456");
|
||||
course.setForUsers("全体员工");
|
||||
|
||||
|
||||
course.setStudys(courseOld.getStudys());
|
||||
|
||||
Long aLong = Long.valueOf(courseOld.getPublishTime()) * 1000;
|
||||
|
||||
LocalDateTime localDateTime = Instant.ofEpochMilli(aLong).atZone(ZoneOffset.ofHours(8)).toLocalDateTime();
|
||||
|
||||
course.setPublishTime(localDateTime);
|
||||
// course.setForUsers(courseOld.getForUsers());
|
||||
// course.setForScene(courseOld.getForScene());
|
||||
|
||||
//存资源归属
|
||||
course.setResOwner1("GC0001");
|
||||
course.setResOwner2("GC0002");
|
||||
|
||||
if (courseOld.getTags() != null && !courseOld.getTags().isEmpty()) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
for (Tags t : courseOld.getTags()) {
|
||||
stringBuffer.append(t.getKeyword() + ",");
|
||||
}
|
||||
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
|
||||
course.setTags(stringBuffer.toString());
|
||||
}
|
||||
course.setValue(courseOld.getValue());
|
||||
if (courseOld.getDevice() != null) {
|
||||
course.setDevice(courseOld.getDevice());
|
||||
} else {
|
||||
course.setDevice(3);
|
||||
}
|
||||
if (StringUtil.isNotBlank(courseOld.getSource())) {
|
||||
course.setSource(Integer.valueOf(courseOld.getSource()));
|
||||
} else {
|
||||
course.setSource(1);
|
||||
}
|
||||
//添加课程基本信息
|
||||
courseDao.save(course);
|
||||
if (courseOld.getTeachers() != null && !courseOld.getTeachers().isEmpty()) {
|
||||
//去重
|
||||
// List<CourseOldTeacher> collect = courseOld.getTeachers().stream().distinct().collect(Collectors.toList());
|
||||
HashSet<CourseOldTeacher> collect = new HashSet<>(courseOld.getTeachers());
|
||||
for (CourseOldTeacher c : collect) {
|
||||
if (StringUtils.isNotBlank(c.getNewId())) {
|
||||
CourseTeacher courseTeacher = new CourseTeacher();
|
||||
courseTeacher.setCourseId(course.getId());
|
||||
courseTeacher.setTeacherId(c.getNewId());
|
||||
courseTeacher.setTeacherName(c.getTeacher_name());
|
||||
courseTeacherDao.save(courseTeacher);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CourseTeacher courseTeacher = new CourseTeacher();
|
||||
courseTeacher.setCourseId(course.getId());
|
||||
courseTeacher.setTeacherId("973887183374249096");
|
||||
courseTeacher.setTeacherName("BOE教师");
|
||||
courseTeacherDao.save(courseTeacher);
|
||||
}
|
||||
|
||||
// 添加课程受众
|
||||
if (courseOld.getAudienceId() != null && !courseOld.getAudienceId().isEmpty()) {
|
||||
//受众成员
|
||||
String url = SysConstant.getConfigValue(BaseConstant.CONFIG_EXTERNALINTERFACE_URL_SYSTEM) + "/xboe/old/data/audience/detail";
|
||||
|
||||
// if (courseOld.getUserGroupList() != null && !courseOld.getUserGroupList().isEmpty()) {
|
||||
// ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
for (String s : courseOld.getAudienceId()) {
|
||||
// //受众添加
|
||||
//先查询该受众是否已添加
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("kid", s);
|
||||
String response = okHttpUtil.doPost(url, map);
|
||||
if (StringUtils.isNotBlank(response)) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
System.out.println(response);
|
||||
JsonResponse<Audience> audience = mapper.readValue(response, new TypeReference<JsonResponse<Audience>>() {
|
||||
});
|
||||
if (audience.getStatus() == HttpStatus.SC_OK && audience.getResult() != null) {
|
||||
Audience result = audience.getResult();
|
||||
if (StringUtil.isBlank(result.getAudienceName())) {
|
||||
// error = "受众名称为空,不能导入";
|
||||
log.error("受众名称为空,不能导入受众"+result.getKid());
|
||||
continue;
|
||||
}
|
||||
if (result.getType()=='1') {
|
||||
// error = "受众类型为自由受众,不能导入";
|
||||
log.error("受众类型为自由受众"+result.getKid());
|
||||
continue;
|
||||
}
|
||||
UserGroup userGroup = userGroupDao.findOne(FieldFilters.eq("kid", s));
|
||||
CourseCrowd courseCrowd = new CourseCrowd();
|
||||
if (userGroup != null) {
|
||||
courseCrowd.setCourseId(course.getId());
|
||||
courseCrowd.setGroupId(userGroup.getId());
|
||||
courseCrowd.setGroupName(userGroup.getName());
|
||||
courseCrowdDao.save(courseCrowd);
|
||||
} else {
|
||||
userGroup= new UserGroup();
|
||||
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()=='0') {
|
||||
userGroup.setStatus(0);
|
||||
}
|
||||
if (result.getStatus()=='1') {
|
||||
userGroup.setStatus(1);
|
||||
}
|
||||
if (result.getStatus()=='2') {
|
||||
userGroup.setStatus(2);
|
||||
|
||||
}
|
||||
userGroupDao.save(userGroup);
|
||||
courseCrowd.setCourseId(course.getId());
|
||||
courseCrowd.setGroupId(userGroup.getId());
|
||||
courseCrowd.setGroupName(userGroup.getName());
|
||||
|
||||
} 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()=='0') {
|
||||
userGroup.setStatus(0);
|
||||
}
|
||||
if (result.getStatus()=='1') {
|
||||
userGroup.setStatus(1);
|
||||
}
|
||||
if (result.getStatus()=='2') {
|
||||
userGroup.setStatus(2);
|
||||
|
||||
}
|
||||
userGroupDao.save(userGroup);
|
||||
courseCrowd.setCourseId(course.getId());
|
||||
courseCrowd.setGroupId(userGroup.getId());
|
||||
courseCrowd.setGroupName(userGroup.getName());
|
||||
|
||||
// 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()=='0') {
|
||||
userGroup.setStatus(0);
|
||||
}
|
||||
if (result.getStatus()=='1') {
|
||||
userGroup.setStatus(1);
|
||||
}
|
||||
if (result.getStatus()=='2') {
|
||||
userGroup.setStatus(2);
|
||||
|
||||
}
|
||||
userGroupDao.save(userGroup);
|
||||
courseCrowd.setCourseId(course.getId());
|
||||
courseCrowd.setGroupId(userGroup.getId());
|
||||
courseCrowd.setGroupName(userGroup.getName());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
courseCrowdDao.save(courseCrowd);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// UserGroup userGroup = userGroupDao.findOne(FieldFilters.eq("kid", s));
|
||||
//
|
||||
// if (userGroup != null) {
|
||||
// CourseCrowd courseCrowd = new CourseCrowd();
|
||||
// courseCrowd.setCourseId(course.getId());
|
||||
// courseCrowd.setGroupId(userGroup.getId());
|
||||
// courseCrowd.setGroupName(userGroup.getName());
|
||||
// } else {
|
||||
// UserGroup userGroup1 = new UserGroup();
|
||||
// }
|
||||
|
||||
}
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
//添加课程章节
|
||||
for (Chapter chapter : courseOld.getChapterList()) {
|
||||
//章
|
||||
CourseSection courseSection = new CourseSection();
|
||||
courseSection.setId(IDGenerator.generate());
|
||||
courseSection.setCourseId(course.getId());
|
||||
|
||||
courseSection.setName(chapter.getName());
|
||||
courseSection.setParentId("-1");
|
||||
|
||||
|
||||
if (chapter.getResourceList() != null && !chapter.getResourceList().isEmpty()) {
|
||||
for (Resource r : chapter.getResourceList()) {
|
||||
CourseContent courseContent = new CourseContent();
|
||||
courseContent.setId(IDGenerator.generate());
|
||||
courseContent.setCourseId(course.getId());
|
||||
courseContent.setRid(r.getId());
|
||||
courseContent.setPublishStatus(r.getPublishStatus());
|
||||
courseContent.setTypeId(r.getTypeId());
|
||||
|
||||
courseContent.setSortIndex(1);
|
||||
courseContent.setContentName(r.getName());
|
||||
courseContent.setCsectionId(courseSection.getId());
|
||||
if (r.getFileData() != null && StringUtil.isNotBlank(r.getFileData().getFileName())) {
|
||||
CourseFile courseFile = new CourseFile();
|
||||
// courseFile.setResType(10);
|
||||
courseFile.setId(IDGenerator.generate());
|
||||
courseFile.setDown(true);
|
||||
courseFile.setCourseId(course.getId());
|
||||
courseFile.setResOwner1("GC0001");
|
||||
courseFile.setResOwner2("GC0001");
|
||||
courseFile.setFileName(r.getFileData().getFileName());
|
||||
if (r.getFileData().getDuration() != null) {
|
||||
courseFile.setDuration(r.getFileData().getDuration());
|
||||
courseContent.setDuration(r.getFileData().getDuration());
|
||||
} else {
|
||||
courseFile.setDuration(0);
|
||||
courseContent.setDuration(0);
|
||||
}
|
||||
if (StringUtil.isNotBlank(r.getFileData().getFilePath())) {
|
||||
String substring = r.getFileData().getFilePath().substring(7, r.getFileData().getFilePath().length());
|
||||
courseFile.setFilePath(substring);
|
||||
}
|
||||
|
||||
|
||||
// 后缀
|
||||
if (StringUtil.isNotBlank(r.getFileData().getFileName())) {
|
||||
int lastOf = r.getFileData().getFileName().lastIndexOf(".");
|
||||
String substring = r.getFileData().getFileName().substring(lastOf + 1);
|
||||
courseFile.setFileType(substring);
|
||||
}
|
||||
|
||||
|
||||
//名称
|
||||
if (StringUtil.isNotBlank(r.getFileData().getFileName())) {
|
||||
courseFile.setName(r.getFileData().getFileName().substring(0, r.getFileData().getFileName().indexOf(".")));
|
||||
}
|
||||
String contentJson = "{" +
|
||||
"\"url\":\"" + courseFile.getFilePath() + "\"," +
|
||||
"\"isDrag\": true," +
|
||||
"\"completeSetup\": 0," +
|
||||
"\"second\": 5," +
|
||||
"\"setupTage\": 0" +
|
||||
"}";
|
||||
|
||||
courseContent.setContent(contentJson);
|
||||
if (r.getTypeCode().equals("video")) {
|
||||
courseContent.setContentType(10);
|
||||
courseFile.setResType(10);
|
||||
|
||||
}
|
||||
if (r.getTypeCode().equals("pdf") || r.getTypeCode().equals("office")) {
|
||||
courseContent.setContentType(40);
|
||||
courseFile.setResType(40);
|
||||
courseContent.setContent(courseFile.getFilePath());
|
||||
}
|
||||
if (r.getTypeCode().equals("audio")) {
|
||||
courseFile.setResType(20);
|
||||
courseContent.setContentType(20);
|
||||
}
|
||||
if (r.getTypeCode().equals("html-courseware")) {
|
||||
courseFile.setFilePath(r.getFileData().getFilePath());
|
||||
courseFile.setResType(41);
|
||||
courseContent.setContentType(52);
|
||||
String urlJson = "{\"url\":\"" + courseFile.getFilePath() + "\",\"openType\":1}";
|
||||
courseContent.setContent(urlJson);
|
||||
|
||||
}
|
||||
courseContent.setContentRefId(courseFile.getId());
|
||||
courseFileDao.save(courseFile);
|
||||
}
|
||||
//考试
|
||||
if (r.getExamData() != null) {
|
||||
courseContent.setContentType(61);
|
||||
courseContent.setContent(null);
|
||||
|
||||
CourseExam courseExam = new CourseExam();
|
||||
courseExam.setCourseId(course.getId());
|
||||
courseContent.setContentRefId(courseExam.getId());
|
||||
courseExam.setContentId(courseContent.getId());
|
||||
courseExam.setTestName(r.getExamData().getTitle());
|
||||
courseExam.setResId(r.getExamData().getResId());
|
||||
courseExam.setKid(r.getExamData().getId());
|
||||
if (r.getExamData().getLimitTime() != null) {
|
||||
if (r.getExamData().getLimitTime() == 0) {
|
||||
courseExam.setTestDuration(30);
|
||||
} else {
|
||||
courseExam.setTestDuration(r.getExamData().getLimitTime());
|
||||
}
|
||||
} else {
|
||||
courseExam.setTestDuration(30);
|
||||
}
|
||||
courseExam.setTimes(r.getExamData().getAttemptNumber());
|
||||
courseExam.setRandomMode(false);
|
||||
courseExam.setPercentScore(true);
|
||||
courseExam.setArrange(0);
|
||||
//可能会变
|
||||
courseExam.setPaperType(2);
|
||||
courseExam.setScoringType(1);
|
||||
if (r.getExamData().getIsShowParse().equals("0")) {
|
||||
courseExam.setShowAnalysis(false);
|
||||
} else {
|
||||
courseExam.setShowAnalysis(true);
|
||||
}
|
||||
if (r.getExamData().getIsShowAnswer().equals("0")) {
|
||||
courseExam.setShowAnswer(false);
|
||||
} else {
|
||||
courseExam.setShowAnswer(true);
|
||||
}
|
||||
|
||||
if (StringUtil.isNotBlank(r.getExamData().getPassGrade())) {
|
||||
courseExam.setQscore(Float.valueOf(r.getExamData().getPassGrade()));
|
||||
}
|
||||
|
||||
if (r.getExamData().getQuestionList() != null && !r.getExamData().getQuestionList().isEmpty()) {
|
||||
StringBuffer jsonQuestion = new StringBuffer("{\"items\":[");
|
||||
for (Question q : r.getExamData().getQuestionList()) {
|
||||
Integer type = null;
|
||||
if (StringUtil.isNotBlank(q.getExamination_question_type())) {
|
||||
if (q.getExamination_question_type().equals("0")) {
|
||||
type = 102;
|
||||
}
|
||||
if (q.getExamination_question_type().equals("1")) {
|
||||
type = 101;
|
||||
}
|
||||
if (q.getExamination_question_type().equals("3")) {
|
||||
type = 103;
|
||||
}
|
||||
}
|
||||
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(
|
||||
"{" +
|
||||
"\"id\":\"" + q.getKid() + "\"," +
|
||||
"\"type\":" + type + "," +
|
||||
"\"score\":" + q.getDefault_score() + "," +
|
||||
"\"checked\":" + false + "," +
|
||||
"\"optShow\":" + false + "," +
|
||||
"\"content\":\"" + q.getTitle() + "\"," +
|
||||
"" + "\"options\": [");
|
||||
if (q.getOptions() != null && !q.getOptions().isEmpty()) {
|
||||
for (Options options : q.getOptions()) {
|
||||
String str1 = "错误";
|
||||
Boolean answers = false;
|
||||
if (!q.getExamination_question_type().equals("3")) {
|
||||
if (options.getIs_right_option().equals("1")) {
|
||||
str1 = options.getOption_title();
|
||||
answers = true;
|
||||
} else {
|
||||
str1 = options.getOption_title();
|
||||
answers = false;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (StringUtil.isNotBlank(options.getOption_stand_result())) {
|
||||
if (options.getIs_right_option().equals("1")) {
|
||||
str1 = "正确";
|
||||
if (options.getIs_right_option().equals(options.getOption_stand_result())) {
|
||||
answers = true;
|
||||
}
|
||||
else{
|
||||
answers = false;
|
||||
}
|
||||
} else {
|
||||
str1 = "错误";
|
||||
if (options.getIs_right_option().equals(options.getOption_stand_result())) {
|
||||
answers = true;
|
||||
}
|
||||
else{
|
||||
answers = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stringBuffer.append("{" +
|
||||
"\"id\":\"" + options.getKid() + "\"," +
|
||||
"\"content\":\"" + str1 + "\"," +
|
||||
"\"answer\":" + answers + "" +
|
||||
"},");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
|
||||
stringBuffer.append("]},");
|
||||
jsonQuestion.append(stringBuffer);
|
||||
}
|
||||
jsonQuestion.deleteCharAt(jsonQuestion.length() - 1);
|
||||
jsonQuestion.append("]}");
|
||||
courseExam.setPaperContent(jsonQuestion.toString().replaceAll(" ", "").replaceAll("\\\\n", "").replaceAll("\\\\t", ""));
|
||||
courseExamDao.save(courseExam);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//作业
|
||||
if (r.getHomeworkData() != null) {
|
||||
courseContent.setContent(null);
|
||||
courseContent.setContentType(60);
|
||||
CourseHomeWork courseHomeWork = new CourseHomeWork();
|
||||
courseContent.setContentRefId(courseHomeWork.getId());
|
||||
courseHomeWork.setKid(r.getHomeworkData().getKid());
|
||||
courseHomeWork.setCourseId(course.getId());
|
||||
courseHomeWork.setContentId(courseContent.getId());
|
||||
if (StringUtil.isNotBlank(r.getHomeworkData().getTitle())) {
|
||||
courseHomeWork.setName(r.getHomeworkData().getTitle());
|
||||
}
|
||||
if (StringUtil.isNotBlank(r.getHomeworkData().getDesc())) {
|
||||
String wipe = this.wipe(r.getHomeworkData().getDesc());
|
||||
courseHomeWork.setContent(wipe);
|
||||
}
|
||||
|
||||
if (r.getHomeworkData().getMode().equals("0")) {
|
||||
courseHomeWork.setSubmitMode(1);
|
||||
}
|
||||
if (r.getHomeworkData().getMode().equals("1")) {
|
||||
courseHomeWork.setSubmitMode(2);
|
||||
}
|
||||
if (r.getHomeworkData().getMode().equals("2")) {
|
||||
courseHomeWork.setSubmitMode(3);
|
||||
}
|
||||
|
||||
courseHomeWork.setDeadTime(LocalDateTime.parse(r.getHomeworkData().getEndAt(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
courseHomeWorkDao.save(courseHomeWork);
|
||||
}
|
||||
//保存课程内容
|
||||
courseContentDao.save(courseContent);
|
||||
}
|
||||
}
|
||||
courseSectionDao.save(courseSection);
|
||||
|
||||
}
|
||||
// }
|
||||
// } catch (NumberFormatException e) {
|
||||
// log.error("保存导入课程失败",e);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
private String wipe(String htmlStr) {
|
||||
// String htmlStr = c.getSummary();
|
||||
//定义script的正则表达式,去除js可以防止注入
|
||||
String scriptRegex = "<script[^>]*?>[\\s\\S]*?<\\/script>";
|
||||
//定义style的正则表达式,去除style样式,防止css代码过多时只截取到css样式代码
|
||||
String styleRegex = "<style[^>]*?>[\\s\\S]*?<\\/style>";
|
||||
//定义HTML标签的正则表达式,去除标签,只提取文字内容
|
||||
String htmlRegex = "<[^>]+>";
|
||||
//定义空格,回车,换行符,制表符
|
||||
String spaceRegex = "\\s*|\t|\r|\n";
|
||||
|
||||
// 过滤script标签
|
||||
htmlStr = htmlStr.replaceAll(scriptRegex, "");
|
||||
// 过滤style标签
|
||||
htmlStr = htmlStr.replaceAll(styleRegex, "");
|
||||
// 过滤html标签
|
||||
htmlStr = htmlStr.replaceAll(htmlRegex, "");
|
||||
// 过滤空格等
|
||||
htmlStr = htmlStr.replaceAll(spaceRegex, "");
|
||||
// 过滤
|
||||
htmlStr = htmlStr.replaceAll(" ", "");
|
||||
// htmlStr = htmlStr.replaceAll("&", "");
|
||||
// 过滤所有的空格
|
||||
htmlStr = htmlStr.replaceAll(" ", "");
|
||||
return htmlStr;
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void saveList(List<CourseImportLog> courseImportLogs) {
|
||||
courseImportLogDao.saveList(courseImportLogs);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void delete() {
|
||||
|
||||
//insert table() select() ('1','2','3','4')
|
||||
//先查出导入课程的课程id关联表删除需要
|
||||
List<Course> courseList = courseDao.findList(FieldFilters.isNotNull("kid"), FieldFilters.ne("kid", ""));
|
||||
|
||||
//提醒课程内容
|
||||
List<String> courseIds = courseList.stream().map(Course::getId).collect(Collectors.toList());
|
||||
|
||||
//检查是否有学习记录
|
||||
//点赞
|
||||
|
||||
//删除课程基本信息
|
||||
//select * from boe_course where id in();
|
||||
courseDao.deleteByFilter(FieldFilters.isNotNull("kid"), FieldFilters.ne("kid", ""));
|
||||
|
||||
//删除课程添加日志
|
||||
courseImportLogDao.deleteByFilter(FieldFilters.isNotNull("id"));
|
||||
|
||||
//删除课程教师
|
||||
//select * from boe_course_teacher where course_id in()
|
||||
courseTeacherDao.deleteByFilter(FieldFilters.in("courseId", courseIds));
|
||||
|
||||
//删除课程章节
|
||||
//select * from boe_course_section where course_id in()
|
||||
courseSectionDao.deleteByFilter(FieldFilters.in("courseId", courseIds));
|
||||
|
||||
//删除课程内容
|
||||
//select * from boe_course_content where course_id in()
|
||||
courseContentDao.deleteByFilter(FieldFilters.in("courseId", courseIds));
|
||||
|
||||
//删除课件
|
||||
//select * from boe_course_file where course_id in()
|
||||
courseFileDao.deleteByFilter(FieldFilters.in("courseId", courseIds));
|
||||
|
||||
//删除考试
|
||||
//select * from boe_course_exam where course_id in()
|
||||
courseExamDao.deleteByFilter(FieldFilters.in("courseId", courseIds));
|
||||
|
||||
//删除作业
|
||||
//select * from boe_course_homework where course_id in()
|
||||
courseHomeWorkDao.deleteByFilter(FieldFilters.in("courseId", courseIds));
|
||||
|
||||
//受众删除
|
||||
List<UserGroup> userGroupDaoList = userGroupDao.findList(FieldFilters.isNotNull("kid"), FieldFilters.ne("kid", ""));
|
||||
List<String> userGroupList = userGroupDaoList.stream().map(UserGroup::getId).collect(Collectors.toList());
|
||||
|
||||
userGroupDao.deleteByFilter(FieldFilters.isNotNull("kid"), FieldFilters.ne("kid", ""));
|
||||
|
||||
//课程受众删除
|
||||
courseCrowdDao.deleteByFilter(FieldFilters.in("courseId", courseIds));
|
||||
|
||||
//受众组删除
|
||||
userGroupItemDao.deleteByFilter(FieldFilters.in("groupId", userGroupList));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void userGroupItem(UserGroup ug) throws Exception {
|
||||
String url= SysConstant.getConfigValue(BaseConstant.CONFIG_EXTERNALINTERFACE_URL_SYSTEM) +"/xboe/old/data/audience/all";
|
||||
//提取出所有的受众
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Map<String, String> map = null;
|
||||
|
||||
map = new HashMap<>();
|
||||
map.put("audienceId",ug.getKid());
|
||||
String response = okHttpUtil.doPost(url, map);
|
||||
//System.out.println(response);
|
||||
JsonResponse<List<AudienceMember>> audienceMember= mapper.readValue(response, new TypeReference<JsonResponse<List<AudienceMember>>>(){
|
||||
});
|
||||
List<AudienceMember> result1 = audienceMember.getResult();
|
||||
if(result1!=null && !result1.isEmpty()) {
|
||||
int num=0;
|
||||
for (AudienceMember a : result1) {
|
||||
User user = userDao.getBySysId(a.getUserId());
|
||||
if (user == null) {
|
||||
//log.error("用户id:" + a.getUserId());
|
||||
GroupUserLog gulog=new GroupUserLog();
|
||||
gulog.setGroupId(ug.getId());
|
||||
gulog.setUserKid(a.getUserId());
|
||||
gulog.setRemark("导入未匹配到的用户");
|
||||
GroupUserLogDao.save(gulog);
|
||||
} else {
|
||||
UserGroupItem userGroupItem = new UserGroupItem();
|
||||
userGroupItem.setGroupId(ug.getId());
|
||||
userGroupItem.setAid(user.getId());
|
||||
userGroupItem.setUserNo(user.getUserNo());
|
||||
userGroupItem.setName(user.getName());
|
||||
userGroupItem.setDepartId(user.getDepartId());
|
||||
userGroupItem.setDepartName(user.getDepartName());
|
||||
userGroupItemDao.save(userGroupItem);
|
||||
num++;
|
||||
}
|
||||
|
||||
}
|
||||
//更新受众组人员
|
||||
userGroupDao.updateFieldById(ug.getId(), "users", num);
|
||||
}else {
|
||||
log.info("受众【"+ug.getName()+","+ug.getKid()+"】无人员信息");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void saveCourseCrowd(List<CourseCrowd> list) {
|
||||
if(list!=null && !list.isEmpty()){
|
||||
courseCrowdDao.saveList(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void saveError(CourseImportLog courseImportLog) {
|
||||
|
||||
courseImportLogDao.save(courseImportLog);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
spring.jpa.show-sql = false
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base4?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
# logging.level.org.hibernate.SQL=DEBUG
|
||||
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
spring.web.resources.static-locations=file:E:/Projects/BOE/java/static
|
||||
|
||||
## xboe config
|
||||
xboe.api.cross_filter=true
|
||||
|
||||
## 上传相磁的路径配置
|
||||
xboe.upload.file.temp_path=E:/Projects/BOE/java/static/temp
|
||||
xboe.upload.file.save_path=E:/Projects/BOE/java/static/upload
|
||||
xboe.upload.file.http_path=http://localhost:9090/cdn/upload
|
||||
|
||||
## 外部接口调用地址 旧系统机构及用户数据接口
|
||||
xboe.externalinterface.url.system=http://localhost:9091
|
||||
|
||||
## 案例接口配置,init 是否需要初始化
|
||||
xboe.case.sync.init=true
|
||||
xboe.case.sync.api.url=https://csb-broker.boe.com.cn:8086/test
|
||||
xboe.case.sync.api.name=BoeCaseQueryService
|
||||
xboe.case.sync.api.version=1.0.0
|
||||
xboe.case.sync.api.method=POST
|
||||
xboe.case.sync.api.ak=2fc434b249a9402baa070f4cf162bd01
|
||||
xboe.case.sync.api.sk=HSrZqDJfkQg2LmHP1uwOi5BOA2I=
|
||||
|
||||
#加密盐
|
||||
jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
@@ -1,45 +0,0 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||
|
||||
logging.level.org.hibernate.SQL=ERROR
|
||||
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
spring.web.resources.static-locations=file:E:/Projects/BOE/java/static
|
||||
|
||||
## xboe config
|
||||
xboe.api.cross_filter=true
|
||||
|
||||
## 上传相磁的路径配置
|
||||
xboe.upload.file.temp_path=E:/Projects/BOE/java/static/temp
|
||||
xboe.upload.file.save_path=E:/Projects/BOE/java/static/upload
|
||||
xboe.upload.file.http_path=http://localhost:9090/cdn/upload
|
||||
|
||||
## 外部接口调用地址 旧系统机构及用户数据接口
|
||||
xboe.externalinterface.url.system=http://localhost:9091
|
||||
|
||||
## 案例接口配置
|
||||
## 案例接口配置,init 是否需要初始化
|
||||
xboe.case.sync.init=false
|
||||
xboe.case.sync.api.url=https://api-csb-broker.boe.com.cn:8086/test
|
||||
xboe.case.sync.api.name=BoeCaseQueryService
|
||||
xboe.case.sync.api.version=1.0.0
|
||||
xboe.case.sync.api.method=POST
|
||||
xboe.case.sync.api.ak=62f60d4cde0c4e8aa08517081649fdb7
|
||||
xboe.case.sync.api.sk=Qg9sVwQI55vmU3/EQ0yPJJxU92E=
|
||||
|
||||
#加密盐
|
||||
jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=10.251.88.214
|
||||
spring.redis.password=qwert!W588
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql:/10.251.88.216:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=admin
|
||||
spring.datasource.password=boeRds01
|
||||
|
||||
logging.level.org.hibernate.SQL=ERROR
|
||||
# logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
spring.web.resources.static-locations=file:E:/Projects/BOE/java/static
|
||||
|
||||
## xboe config
|
||||
xboe.api.cross_filter=true
|
||||
|
||||
## 上传相磁的路径配置
|
||||
xboe.upload.file.temp_path=E:/Projects/BOE/java/static/temp
|
||||
xboe.upload.file.save_path=E:/Projects/BOE/java/static/upload
|
||||
xboe.upload.file.http_path=http://localhost:9090/cdn/upload
|
||||
|
||||
## 外部接口调用地址 旧系统机构及用户数据接口
|
||||
xboe.externalinterface.url.system=http://localhost:9091
|
||||
|
||||
## 案例接口配置
|
||||
## 案例接口配置,init 是否需要初始化
|
||||
xboe.case.sync.init=false
|
||||
xboe.case.sync.api.url=https://api-csb-broker.boe.com.cn:8086/test
|
||||
xboe.case.sync.api.name=BoeCaseQueryService
|
||||
xboe.case.sync.api.version=1.0.0
|
||||
xboe.case.sync.api.method=POST
|
||||
xboe.case.sync.api.ak=62f60d4cde0c4e8aa08517081649fdb7
|
||||
xboe.case.sync.api.sk=Qg9sVwQI55vmU3/EQ0yPJJxU92E=
|
||||
|
||||
#加密盐
|
||||
jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
## redis
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=ENC(zA5LNV8xw3yEx6LMwdGGBGgNsOaD3Cg+)
|
||||
spring.redis.port=6379
|
||||
|
||||
## datasource config
|
||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||
spring.datasource.username=boe_base
|
||||
spring.datasource.password=ENC(MaC28GJw2JcbH8Lil0CrqSDTYxX49FJ0rxcmHH2pX0k=)
|
||||
|
||||
logging.level.org.hibernate.SQL=DEBUG
|
||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
||||
|
||||
|
||||
## xboe config
|
||||
xboe.api.cross_filter=true
|
||||
|
||||
## 上传相磁的路径配置
|
||||
xboe.upload.file.temp_path=/www/wwwroot/file/temp
|
||||
xboe.upload.file.save_path=/www/wwwroot/file/upload
|
||||
xboe.upload.file.http_path=http://114.115.162.187/file/upload
|
||||
|
||||
## 外部接口调用地址 旧系统机构及用户数据接口
|
||||
xboe.externalinterface.url.system=http://127.0.0.1:9091
|
||||
|
||||
## 案例接口配置
|
||||
## 案例接口配置,init 是否需要初始化
|
||||
xboe.case.sync.init=true
|
||||
xboe.case.sync.api.url=https://csb-broker.boe.com.cn:8086/test
|
||||
xboe.case.sync.api.name=BoeCaseQueryService
|
||||
xboe.case.sync.api.version=1.0.0
|
||||
xboe.case.sync.api.method=POST
|
||||
xboe.case.sync.api.ak=2fc434b249a9402baa070f4cf162bd01
|
||||
xboe.case.sync.api.sk=HSrZqDJfkQg2LmHP1uwOi5BOA2I=
|
||||
|
||||
#加密盐
|
||||
jasypt.encryptor.password=jasypt
|
||||
jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||
@@ -1,66 +0,0 @@
|
||||
spring.profiles.active=@profileActive@
|
||||
spring.application.name=boe-server-course
|
||||
server.port=9099
|
||||
server.servlet.session.timeout=30m
|
||||
|
||||
|
||||
server.servlet.encoding.charset=UTF-8
|
||||
server.servlet.encoding.enabled=true
|
||||
server.servlet.encoding.force=true
|
||||
|
||||
server.tomcat.uri-encoding=UTF-8
|
||||
|
||||
|
||||
|
||||
ok.http.connect-timeout=30
|
||||
ok.http.read-timeout=30
|
||||
ok.http.write-timeout=30
|
||||
# 连接池中整体的空闲连接的最大数量
|
||||
ok.http.max-idle-connections=200
|
||||
# 连接空闲时间最多为 300 秒
|
||||
ok.http.keep-alive-duration=300
|
||||
|
||||
#spring.jackson.locale=
|
||||
#spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||
# spring.jackson.default-property-inclusion=NON_NULL
|
||||
spring.jackson.time-zone=GMT+8
|
||||
|
||||
spring.servlet.multipart.max-file-size=1024MB
|
||||
spring.servlet.multipart.max-request-size=1024MB
|
||||
|
||||
## 静态文件目录,默认是在static下面,以后独立到nginx下面配置
|
||||
spring.mvc.static-path-pattern=/cdn/**
|
||||
|
||||
spring.redis.database=2
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.password=1Qaz2wsx
|
||||
spring.redis.port=6379
|
||||
|
||||
spring.redis.lettuce.pool.max-active=8
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.pool.max-idle=30
|
||||
spring.redis.lettuce.pool.max-wait=10000ms
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
|
||||
# 上传的临时目录,部署到服务器必须指定
|
||||
# spring.servlet.multipart.location=
|
||||
|
||||
# jpa config
|
||||
spring.jpa.database = MYSQL
|
||||
spring.jpa.show-sql = false
|
||||
# spring.jpa.properties.hibernate.cache.use_second_level_cache=true
|
||||
# spring.jpa.properties.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.properties.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy
|
||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
#spring.transaction
|
||||
# spring.jpa.properties.hibernate.allow_update_outside_transaction=true
|
||||
# spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
||||
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
||||
|
||||
|
||||
# 设置logback.xml位置
|
||||
logging.config=classpath:log/logback-@profileActive@.xml
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,54 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||
<property name="log.path" value="logs/${spring.application.name}"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||
<property name="log.path" value="/home/logs/${spring.application.name}"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="ERROR">
|
||||
<appender-ref ref="debug"/>
|
||||
<appender-ref ref="error"/>
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||
<property name="log.path" value="/home/logs/${spring.application.name}"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="ERROR">
|
||||
<appender-ref ref="debug"/>
|
||||
<appender-ref ref="error"/>
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
||||
<property name="log.path" value="logs/${spring.application.name}"/>
|
||||
<!-- 彩色日志格式 -->
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<!-- 彩色日志依赖的渲染类 -->
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log file error output -->
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="debug"/>
|
||||
<appender-ref ref="error"/>
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.xboe;
|
||||
|
||||
public class AttachmentUrlTest {
|
||||
|
||||
// public static String getNameStr(String name) {
|
||||
// String first=name.replaceAll("\\(","(");
|
||||
// int index1=first.indexOf("(");
|
||||
// if(index1>0) {
|
||||
// first=first.substring(0,index1);
|
||||
// }
|
||||
// return first;
|
||||
// }
|
||||
//
|
||||
// public static void main(String[] args) throws Exception {
|
||||
//// String fileUrl="http://bpm.boe.com.cn/portal/apps/com.awspaas.user.apps.showfj/temp/tylc07_boealfjdz/00002770-张玉欣-专利包质量基准.docx";
|
||||
//// int urlLast=fileUrl.lastIndexOf("/");
|
||||
////
|
||||
//// String urlName=fileUrl.substring(urlLast+1);
|
||||
////
|
||||
//// fileUrl=fileUrl.substring(0, urlLast+1)+URLEncoder.encode(urlName, "UTF-8");
|
||||
//// System.out.println(fileUrl);
|
||||
//// fileUrl=fileUrl.replaceAll("\\+","%20");
|
||||
//// System.out.println(fileUrl);
|
||||
//
|
||||
// String caseName="经营管理(一级、二级经营责任者撰写),战略预算(战略企划与执行、预算),投融资(投资管理、资金、股证)】,未匹配到专业分类【经营管理(一级、二级经营责任者撰写),战略预算(战略企划与执行、预算),投融资(投资管理、资金、股证)";
|
||||
// System.out.println(caseName.replaceAll("\\(","("));
|
||||
// System.out.println(AttachmentUrlTest.getNameStr(caseName));
|
||||
// //替换英文的括号为中文的括号
|
||||
// //caseName=caseName.replaceAll("(","(");
|
||||
//
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.6.3</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>boe-server-old</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>boe-server-old</name>
|
||||
<description>已经独立出去不在这里维护</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>xboe-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>xboe-redis</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.bitbucket.b_c</groupId>
|
||||
<artifactId>jose4j</artifactId>
|
||||
<version>0.7.9</version>
|
||||
</dependency>
|
||||
-->
|
||||
<!-- apache commons -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.27</version>
|
||||
<!-- <scope>runtime</scope> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!--加密配置文件-->
|
||||
<dependency>
|
||||
<groupId>com.github.ulisesbocchio</groupId>
|
||||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>application-${profileActive}.properties</include>
|
||||
<include>application.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>false</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<!-- <version>3.8.0</version> -->
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>pro</id>
|
||||
<properties>
|
||||
<profileActive>pro</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>pre</id>
|
||||
<properties>
|
||||
<profileActive>pre</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<profileActive>test</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<profileActive>dev</profileActive>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -1,30 +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.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@SpringBootApplication
|
||||
public class BoeServerAllApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("jasypt.encryptor.password","jasypt");
|
||||
SpringApplication.run(BoeServerAllApplication.class, args);
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void handlePid() throws IOException {
|
||||
File file = new File("application.pid");
|
||||
new ApplicationPid().write(file);
|
||||
file.deleteOnExit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.xboe;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import com.xboe.core.api.authentication.ApiAuthenticateHandle;
|
||||
|
||||
/**
|
||||
* 使用实现 WebMvcConfigurer 此接口,不使用继承WebMvcConfigurationSupport的方式</br>
|
||||
* 这样原有的自动配置不会失效
|
||||
* @author seastar
|
||||
*
|
||||
*/
|
||||
//@EnableWebMvc
|
||||
@Configuration
|
||||
public class WebMvcConfig implements WebMvcConfigurer{
|
||||
|
||||
@Autowired
|
||||
private ApiAuthenticateHandle authenticateHandle;
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
// //设置静态访问目录
|
||||
// if(env.containsProperty(BaseConstant.CONFIG_MVC_STATIC_PATH)) {
|
||||
// String path=env.getProperty(BaseConstant.CONFIG_MVC_STATIC_PATH);
|
||||
// System.out.println("设置static路径:"+path);
|
||||
// registry.addResourceHandler("/static/**").addResourceLocations(path);
|
||||
// }else {
|
||||
// System.out.println("config static classpath");
|
||||
// registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(authenticateHandle).addPathPatterns("/api/**");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.xboe.constants;
|
||||
|
||||
public interface Constants {
|
||||
// 通用
|
||||
String DELETED_NORMAL = "0";
|
||||
|
||||
String DELETED_DEL = "1";
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.xboe.old.data.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.old.data.entity.Audience;
|
||||
import com.xboe.old.data.entity.AudienceMember;
|
||||
import com.xboe.old.data.service.IAudienceMemberService;
|
||||
import com.xboe.old.data.service.IAudienceService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/xboe/old/data/audience")
|
||||
public class AudienceApi extends ApiBaseController {
|
||||
|
||||
@Autowired
|
||||
IAudienceService audienceService;
|
||||
|
||||
@Autowired
|
||||
IAudienceMemberService audienceMemberService;
|
||||
|
||||
/**
|
||||
* 受众基本信息
|
||||
*/
|
||||
@PostMapping("/detail")
|
||||
public JsonResponse<Audience> detail(String kid){
|
||||
if(StringUtil.isBlank(kid)){
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
Audience audience = audienceService.get(kid);
|
||||
return success(audience);
|
||||
}
|
||||
|
||||
/**
|
||||
* 受众成员信息
|
||||
* */
|
||||
@PostMapping("/all")
|
||||
public JsonResponse<List<AudienceMember>> all(String audienceId){
|
||||
if(StringUtil.isBlank(audienceId)){
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
List<AudienceMember> all = audienceMemberService.all(audienceId);
|
||||
return success(all);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.xboe.old.data.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.old.data.service.IManageRefService;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/xboe/old/data/managrref")
|
||||
public class ManagrRefApi extends ApiBaseController{
|
||||
|
||||
@Resource
|
||||
private IManageRefService service;
|
||||
|
||||
|
||||
@RequestMapping(value="/user-company-ids")
|
||||
public JsonResponse<List<String>> query(String uid){
|
||||
if(StringUtils.isBlank(uid)){
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
List<String> query = service.getCompanyIdsByUserId(uid);
|
||||
return success(query);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.old.data.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.old.data.entity.Audience;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class AudienceDao extends BaseDao<Audience> {
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.xboe.old.data.dao;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.old.data.entity.AudienceMember;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class AudienceMemberDao extends BaseDao<AudienceMember> {
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.xboe.old.data.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.xboe.core.orm.BaseDao;
|
||||
import com.xboe.old.data.entity.ManageRef;
|
||||
|
||||
@Repository
|
||||
public class ManageRefDao extends BaseDao<ManageRef> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
package com.xboe.old.data.entity;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_so_audience")
|
||||
public class Audience implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 受众id
|
||||
* */
|
||||
@Id
|
||||
@Column(name = "kid",length = 50)
|
||||
private String kid;
|
||||
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
* */
|
||||
@Column(name = "company_id",length = 50)
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 所有者id
|
||||
* */
|
||||
@Column(name = "owner_id",length = 50)
|
||||
private String ownerId;
|
||||
|
||||
/**
|
||||
* 受众目录id
|
||||
* */
|
||||
@Column(name = "category_id",length = 50)
|
||||
private String cateGoryId;
|
||||
|
||||
/**
|
||||
* 受众编码
|
||||
* */
|
||||
@Column(name = "audience_code",length = 50)
|
||||
private String audienceCode;
|
||||
|
||||
/**
|
||||
* 受众名称
|
||||
* */
|
||||
@Column(name = "audience_name",length = 200)
|
||||
private String audienceName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* */
|
||||
@Column(name = "description",columnDefinition = "mediumtext")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 来源id
|
||||
* */
|
||||
@Column(name = "source_id",length = 50)
|
||||
private String sourceId;
|
||||
|
||||
/**
|
||||
* 受众类型 0名单列表 1课程
|
||||
* */
|
||||
@Column(name = "audience_type",length = 1)
|
||||
private Character audienceType;
|
||||
|
||||
/**
|
||||
* 受众类型
|
||||
* */
|
||||
@Column(name = "type",length = 1)
|
||||
private Character type;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* */
|
||||
@Column(name = "status",length = 1)
|
||||
private Character status;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
* */
|
||||
@Column(name = "version",length = 11)
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Column(name = "created_by", length = 150)
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "created_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建来源
|
||||
*/
|
||||
@Column(name = "created_from", length = 150)
|
||||
private String createdFrom;
|
||||
|
||||
/**
|
||||
* 创建IP
|
||||
*/
|
||||
@Column(name = "created_ip", length = 150)
|
||||
private String createdIp;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
@Column(name = "updated_by", length = 150)
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "updated_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新来源
|
||||
*/
|
||||
@Column(name = "updated_from", length = 150)
|
||||
private String updatedFrom;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
@Column(name = "updated_ip", length = 150)
|
||||
private String updatedIp;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
package com.xboe.old.data.entity;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_so_audience_member")
|
||||
public class AudienceMember implements Serializable {
|
||||
|
||||
/**
|
||||
* 受众成员id
|
||||
* */
|
||||
@Id
|
||||
@Column(name = "kid",length = 50)
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 受众id
|
||||
* */
|
||||
@Column(name = "audience_id",length = 50)
|
||||
private String audienceId;
|
||||
|
||||
/**
|
||||
* 受众条件id
|
||||
* */
|
||||
@Column(name = "condition_id",length = 50)
|
||||
private String conditionId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
* */
|
||||
@Column(name = "user_id",length = 50)
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 状态 0临时 1正常 2停用
|
||||
* */
|
||||
@Column(name = "status",length = 1)
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
//
|
||||
// /**
|
||||
// * 关系生效时间
|
||||
// * */
|
||||
// @Column(name = "start_at",nullable = false,length = 11)
|
||||
// private Integer startAt;
|
||||
//
|
||||
// /**
|
||||
// *'关系失效时间,如果为空,表示无截止时间限制',
|
||||
// * */
|
||||
// @Column(name = "end_at",length = 11)
|
||||
// private Integer endAt;
|
||||
//
|
||||
// /**
|
||||
// * 版本号
|
||||
// */
|
||||
// @Column(name = "version", length = 11)
|
||||
// private Integer version;
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 创建人ID
|
||||
// */
|
||||
// @Column(name = "created_by", length = 150)
|
||||
// private String createdBy;
|
||||
//
|
||||
// /**
|
||||
// * 创建时间
|
||||
// */
|
||||
// @Column(name = "created_at")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// private Date createdAt;
|
||||
//
|
||||
// /**
|
||||
// * 创建来源
|
||||
// */
|
||||
// @Column(name = "created_from", length = 150)
|
||||
// private String createdFrom;
|
||||
//
|
||||
// /**
|
||||
// * 创建IP
|
||||
// */
|
||||
// @Column(name = "created_ip", length = 150)
|
||||
// private String createdIp;
|
||||
//
|
||||
// /**
|
||||
// * 更新人ID
|
||||
// */
|
||||
// @Column(name = "updated_by", length = 150)
|
||||
// private String updatedBy;
|
||||
//
|
||||
// /**
|
||||
// * 更新时间
|
||||
// */
|
||||
// @Column(name = "updated_at")
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
// private Date updatedAt;
|
||||
//
|
||||
// /**
|
||||
// * 更新来源
|
||||
// */
|
||||
// @Column(name = "updated_from", length = 150)
|
||||
// private String updatedFrom;
|
||||
//
|
||||
// /**
|
||||
// * 更新IP
|
||||
// */
|
||||
// @Column(name = "updated_ip", length = 150)
|
||||
// private String updatedIp;
|
||||
//
|
||||
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
package com.xboe.old.data.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Entity
|
||||
@Table(name = "eln_fw_cnt_manage_ref")
|
||||
public class ManageRef {
|
||||
|
||||
|
||||
/**
|
||||
* 内容管辖关系id
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "kid", length = 50)
|
||||
private String kid;
|
||||
|
||||
/**
|
||||
* 主体ID
|
||||
* */
|
||||
@Column(name = "subject_id",nullable = false,length = 50)
|
||||
private String subjectId;
|
||||
/**
|
||||
* 主体类型
|
||||
* */
|
||||
@Column(name = "subjectType",nullable = false,length = 30)
|
||||
private String subjectType;
|
||||
|
||||
/**
|
||||
*内容ID
|
||||
* */
|
||||
@Column(name = "content_id",nullable = false,length = 50)
|
||||
private String contentId;
|
||||
|
||||
/**
|
||||
* 内容类型
|
||||
* */
|
||||
@Column(name = "content_type",nullable = false,length = 50)
|
||||
private String contentType;
|
||||
|
||||
/**
|
||||
* '关联类型;0:查询关系;1:管理关系',
|
||||
* */
|
||||
@Column(name = "reference_type",nullable = false,length = 1)
|
||||
private Character referenceType;
|
||||
|
||||
/**
|
||||
* 状态;0:临时,1:正常,2:停用',
|
||||
*/
|
||||
@Column(name = "status",nullable = false,length = 1)
|
||||
private Character status;
|
||||
|
||||
/**
|
||||
* 关系生效时间
|
||||
* */
|
||||
@Column(name = "start_at",nullable = false,length = 11)
|
||||
private Integer startAt;
|
||||
|
||||
/**
|
||||
*'关系失效时间,如果为空,表示无截止时间限制',
|
||||
* */
|
||||
@Column(name = "end_at",length = 11)
|
||||
private Integer endAt;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@Column(name = "version", length = 11)
|
||||
private Integer version;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
@Column(name = "created_by", length = 150)
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "created_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建来源
|
||||
*/
|
||||
@Column(name = "created_from", length = 150)
|
||||
private String createdFrom;
|
||||
|
||||
/**
|
||||
* 创建IP
|
||||
*/
|
||||
@Column(name = "created_ip", length = 150)
|
||||
private String createdIp;
|
||||
|
||||
/**
|
||||
* 更新人ID
|
||||
*/
|
||||
@Column(name = "updated_by", length = 150)
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "updated_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新来源
|
||||
*/
|
||||
@Column(name = "updated_from", length = 150)
|
||||
private String updatedFrom;
|
||||
|
||||
/**
|
||||
* 更新IP
|
||||
*/
|
||||
@Column(name = "updated_ip", length = 150)
|
||||
private String updatedIp;
|
||||
|
||||
/**
|
||||
* 删除标记;0:正常,1:已删除
|
||||
*/
|
||||
@Column(name = "is_deleted", length = 3)
|
||||
private String isDeleted;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.xboe.old.data.service;
|
||||
|
||||
import com.xboe.old.data.entity.AudienceMember;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IAudienceMemberService {
|
||||
|
||||
/**
|
||||
* 受众下的成员列表
|
||||
* */
|
||||
List<AudienceMember> all(String id);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user