|
|
|
@ -11,6 +11,7 @@ import com.zh.project0512.annotation.AdminTokenValid;
|
|
|
|
|
import com.zh.project0512.model.*;
|
|
|
|
|
import com.zh.project0512.model.validatedDemo.TaskValidGroup1;
|
|
|
|
|
import com.zh.project0512.model.validatedDemo.TaskValidGroup2;
|
|
|
|
|
import com.zh.project0512.model.vo.FileUploadParamVo;
|
|
|
|
|
import com.zh.project0512.service.*;
|
|
|
|
|
import com.zh.project0512.utils.CustomUtil;
|
|
|
|
|
import com.zh.project0512.utils.FileTypeUtil;
|
|
|
|
@ -102,14 +103,15 @@ public class TaskController {
|
|
|
|
|
taskDepartmentService.addGroup(departmentList, id);
|
|
|
|
|
}
|
|
|
|
|
// 上传任务时同时上传素材
|
|
|
|
|
List<String> referenceUrlList = task.getReferenceUrlList();
|
|
|
|
|
List<FileUploadParamVo> referenceUrlList = task.getReferenceUrlList();
|
|
|
|
|
if (referenceUrlList != null && referenceUrlList.size() > 0) {
|
|
|
|
|
List<Reference> l = new ArrayList<>();
|
|
|
|
|
// List<TopicActivity> ta = new ArrayList<>();
|
|
|
|
|
for (String e : referenceUrlList) {
|
|
|
|
|
if (e.lastIndexOf(".") != -1) {
|
|
|
|
|
l.add(new Reference().setTitle(task.getTitle()).setCoverUrl(task.getCoverUrl()).setCreatAt(LocalDateTime.now())
|
|
|
|
|
.setFileUrl(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))));
|
|
|
|
|
for (FileUploadParamVo e : referenceUrlList) {
|
|
|
|
|
String url = e.getUrl();
|
|
|
|
|
if (url != null && e.getUrl().lastIndexOf(".") != -1) {
|
|
|
|
|
l.add(new Reference().setTitle(task.getTitle()).setCoverUrl(task.getCoverUrl()).setDuration(e.getDuration()).setCreatAt(LocalDateTime.now())
|
|
|
|
|
.setFileUrl(url).setType(FileTypeUtil.getcontentTypeNum(url.substring(url.lastIndexOf(".")))));
|
|
|
|
|
// ta.add(new TopicActivity().setTitle(task.getTitle()).setCover(task.getCoverUrl()).setCreatAt(LocalDateTime.now())
|
|
|
|
|
// .setContent(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))));
|
|
|
|
|
}
|
|
|
|
@ -134,11 +136,12 @@ public class TaskController {
|
|
|
|
|
.setFileUrl(e.getFileUrl()).setType(FileTypeUtil.getcontentTypeNum(e.getFileUrl().substring(e.getFileUrl().lastIndexOf("."))))));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<String> teachRefeUrlList = task.getTeachRefeUrlList();
|
|
|
|
|
for (String e : teachRefeUrlList) {
|
|
|
|
|
if (e.lastIndexOf(".") != -1) {
|
|
|
|
|
l2.add(new TaskTeachRefe().setTaskId(id).setCreatAt(LocalDateTime.now())
|
|
|
|
|
.setFileUrl(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))));
|
|
|
|
|
List<FileUploadParamVo> teachRefeUrlList = task.getTeachRefeUrlList();
|
|
|
|
|
for (FileUploadParamVo e : teachRefeUrlList) {
|
|
|
|
|
String url = e.getUrl();
|
|
|
|
|
if (url != null && url.lastIndexOf(".") != -1) {
|
|
|
|
|
l2.add(new TaskTeachRefe().setTaskId(id).setCreatAt(LocalDateTime.now()).setDuration(e.getDuration())
|
|
|
|
|
.setFileUrl(url).setType(FileTypeUtil.getcontentTypeNum(url.substring(url.lastIndexOf(".")))));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (l2.size() > 0) {
|
|
|
|
|