提交修改

This commit is contained in:
daihh
2022-12-12 13:46:28 +08:00
parent 83a6e2a22d
commit 3f1d46908e
2 changed files with 18 additions and 4 deletions

View File

@@ -14,7 +14,6 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.xboe.core.orm.LikeMatchMode;
import org.apache.commons.lang3.StringUtils;
import org.springframework.orm.ObjectOptimisticLockingFailureException;
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.orm.FieldFilters;
import com.xboe.core.orm.IFieldFilter;
import com.xboe.core.orm.LikeMatchMode;
import com.xboe.core.upload.XFileUploader;
import com.xboe.module.course.entity.CourseFile;
import com.xboe.module.course.service.ICourseFileService;
import com.xboe.module.course.service.impl.FileConverterProvider;
import com.xboe.module.scorm.SCORMParser;
import com.xboe.standard.BaseConstant;
import com.xboe.standard.enums.BoedxCourseFileType;
import it.sauronsoftware.jave.Encoder;
import it.sauronsoftware.jave.MultimediaInfo;
@@ -180,14 +182,15 @@ public class CourseFileApi extends ApiBaseController {
file.setResType(20);//以后换成变量
} else if ("doc,xls,ppt,docx,xlsx,pptx".indexOf(file.getFileType()) > -1) {
file.setResType(40);//以后换成变量
}else if(file.getFileType().equalsIgnoreCase("zip")) {
file.setResType(BoedxCourseFileType.Scrom.getValue());//scorm课件
} else {
file.setResType(90);//以后换成变量
}
}
String fileFullPath = SysConstant.getConfigValue(BaseConstant.CONFIG_UPLOAD_FILES_SAVEPATH) + file.getFilePath();
if ("mp3,mp4".indexOf(file.getFileType()) > -1){
Encoder encoder = new Encoder();
String fileFullPath = SysConstant.getConfigValue(BaseConstant.CONFIG_UPLOAD_FILES_SAVEPATH) + file.getFilePath();
try {
//System.out.println(fileFullPath);
MultimediaInfo m = encoder.getInfo(new File(fileFullPath));
@@ -210,11 +213,16 @@ public class CourseFileApi extends ApiBaseController {
try {
file.setFileType(file.getFileType());
if(file.getFileType().equals("pdf")) {
if(file.getFileType().equalsIgnoreCase("pdf")) {
file.setPreviewFilePath(file.getFilePath());
file.setConverStatus(0);//代表不需要转化
}else if ("doc,xls,ppt,docx,xlsx,pptx".indexOf(file.getFileType().toLowerCase()) > -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);

View File

@@ -137,6 +137,12 @@ public class CourseFile extends BaseEntity {
@Column(name = "ownership3",length = 50)
private String ownership3;
/**
* 对应的内容的json
*/
@Column(name = "content",columnDefinition = "text")
private String content;
/**
* 备注
* */