提交 23399ae7 authored 作者: zhouzhigang's avatar zhouzhigang

--no commit message

上级 d77f3954
......@@ -75,6 +75,7 @@ import com.zrqx.resource.commons.model.articlelibrary.ArticleLibraryDiyType;
import com.zrqx.resource.commons.model.audiolibrary.AudioLibraryDiyType;
import com.zrqx.resource.commons.model.authorLibrary.AuthorLibrary;
import com.zrqx.resource.commons.model.authorLibrary.AuthorLibraryDiytype;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibrary;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibraryDiyType;
import com.zrqx.resource.commons.model.ebook.Book;
import com.zrqx.resource.commons.model.ebook.Ebook;
......@@ -191,6 +192,18 @@ public class ResourceLibraryController {
if(entity.getId() == null || entity.getResourceIds() == null || entity.getResourceType() == null || entity.getResourceIds().length == 0){
throw new BaseException("必须指定id、被关联的resourceId、资源类型");
}
//获取当前资源已经绑定的资源
ResourceRelation relation = new ResourceRelation();
relation.setObjectId(entity.getId());
int count = resourceRelationService.selectCount(relation);
//获取当前资源的节数,判断绑定的资源的总条数不能超过当前资源的总节数
CourseLibrary courseLibrary = courseLibraryService.selectByPrimaryKey(entity.getId());
if(courseLibrary != null) {
Integer countVideo = courseLibrary.getCountVideo();
if((entity.getResourceIds().length + count) > countVideo.intValue()) {
throw new BaseException("更新节数:" + entity.getResourceIds().length + count + "不能大于总节数:" + countVideo.intValue());
}
}
// List<ResourceRelation> recordList = new ArrayList<ResourceRelation>();
Arrays.asList(entity.getResourceIds()).forEach(resourceId -> {
ResourceRelation e = new ResourceRelation();
......
package com.zrqx.resource.fg.controller.videolibrary;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
@RestController
@RequestMapping("/fg/videoLook-library")
@Api(description = "前台-视频播放记录库")
public class FgPersonalCourseController {
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论