mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-13 21:06:48 +08:00
提交修改
This commit is contained in:
@@ -14,7 +14,6 @@ import javax.annotation.Resource;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.xboe.core.orm.LikeMatchMode;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -33,11 +32,14 @@ import com.xboe.core.SysConstant;
|
|||||||
import com.xboe.core.api.ApiBaseController;
|
import com.xboe.core.api.ApiBaseController;
|
||||||
import com.xboe.core.orm.FieldFilters;
|
import com.xboe.core.orm.FieldFilters;
|
||||||
import com.xboe.core.orm.IFieldFilter;
|
import com.xboe.core.orm.IFieldFilter;
|
||||||
|
import com.xboe.core.orm.LikeMatchMode;
|
||||||
import com.xboe.core.upload.XFileUploader;
|
import com.xboe.core.upload.XFileUploader;
|
||||||
import com.xboe.module.course.entity.CourseFile;
|
import com.xboe.module.course.entity.CourseFile;
|
||||||
import com.xboe.module.course.service.ICourseFileService;
|
import com.xboe.module.course.service.ICourseFileService;
|
||||||
import com.xboe.module.course.service.impl.FileConverterProvider;
|
import com.xboe.module.course.service.impl.FileConverterProvider;
|
||||||
|
import com.xboe.module.scorm.SCORMParser;
|
||||||
import com.xboe.standard.BaseConstant;
|
import com.xboe.standard.BaseConstant;
|
||||||
|
import com.xboe.standard.enums.BoedxCourseFileType;
|
||||||
|
|
||||||
import it.sauronsoftware.jave.Encoder;
|
import it.sauronsoftware.jave.Encoder;
|
||||||
import it.sauronsoftware.jave.MultimediaInfo;
|
import it.sauronsoftware.jave.MultimediaInfo;
|
||||||
@@ -180,14 +182,15 @@ public class CourseFileApi extends ApiBaseController {
|
|||||||
file.setResType(20);//以后换成变量
|
file.setResType(20);//以后换成变量
|
||||||
} else if ("doc,xls,ppt,docx,xlsx,pptx".indexOf(file.getFileType()) > -1) {
|
} else if ("doc,xls,ppt,docx,xlsx,pptx".indexOf(file.getFileType()) > -1) {
|
||||||
file.setResType(40);//以后换成变量
|
file.setResType(40);//以后换成变量
|
||||||
|
}else if(file.getFileType().equalsIgnoreCase("zip")) {
|
||||||
|
file.setResType(BoedxCourseFileType.Scrom.getValue());//scorm课件
|
||||||
} else {
|
} else {
|
||||||
file.setResType(90);//以后换成变量
|
file.setResType(90);//以后换成变量
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String fileFullPath = SysConstant.getConfigValue(BaseConstant.CONFIG_UPLOAD_FILES_SAVEPATH) + file.getFilePath();
|
||||||
if ("mp3,mp4".indexOf(file.getFileType()) > -1){
|
if ("mp3,mp4".indexOf(file.getFileType()) > -1){
|
||||||
Encoder encoder = new Encoder();
|
Encoder encoder = new Encoder();
|
||||||
String fileFullPath = SysConstant.getConfigValue(BaseConstant.CONFIG_UPLOAD_FILES_SAVEPATH) + file.getFilePath();
|
|
||||||
try {
|
try {
|
||||||
//System.out.println(fileFullPath);
|
//System.out.println(fileFullPath);
|
||||||
MultimediaInfo m = encoder.getInfo(new File(fileFullPath));
|
MultimediaInfo m = encoder.getInfo(new File(fileFullPath));
|
||||||
@@ -210,11 +213,16 @@ public class CourseFileApi extends ApiBaseController {
|
|||||||
try {
|
try {
|
||||||
file.setFileType(file.getFileType());
|
file.setFileType(file.getFileType());
|
||||||
|
|
||||||
if(file.getFileType().equals("pdf")) {
|
if(file.getFileType().equalsIgnoreCase("pdf")) {
|
||||||
file.setPreviewFilePath(file.getFilePath());
|
file.setPreviewFilePath(file.getFilePath());
|
||||||
file.setConverStatus(0);//代表不需要转化
|
file.setConverStatus(0);//代表不需要转化
|
||||||
}else if ("doc,xls,ppt,docx,xlsx,pptx".indexOf(file.getFileType().toLowerCase()) > -1) {
|
}else if ("doc,xls,ppt,docx,xlsx,pptx".indexOf(file.getFileType().toLowerCase()) > -1) {
|
||||||
file.setConverStatus(1);//转化中
|
file.setConverStatus(1);//转化中
|
||||||
|
}else if(file.getFileType().equalsIgnoreCase("zip")) {
|
||||||
|
//scorm包的内容
|
||||||
|
SCORMParser scormParser=new SCORMParser();
|
||||||
|
String json = scormParser.parserToJson(fileFullPath);
|
||||||
|
file.setContent(json);
|
||||||
}
|
}
|
||||||
//保存
|
//保存
|
||||||
courseFileService.save(file);
|
courseFileService.save(file);
|
||||||
|
|||||||
@@ -137,6 +137,12 @@ public class CourseFile extends BaseEntity {
|
|||||||
@Column(name = "ownership3",length = 50)
|
@Column(name = "ownership3",length = 50)
|
||||||
private String ownership3;
|
private String ownership3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应的内容的json
|
||||||
|
*/
|
||||||
|
@Column(name = "content",columnDefinition = "text")
|
||||||
|
private String content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
* */
|
* */
|
||||||
|
|||||||
Reference in New Issue
Block a user