提交 76e6ddc7 authored 作者: yucaiwei's avatar yucaiwei

--no commit message

上级 fce861b4
...@@ -153,9 +153,9 @@ public class ArticleLibraryController { ...@@ -153,9 +153,9 @@ public class ArticleLibraryController {
if (entity.getStatus() == LibraryStatusEnum.STATUS_0.getCode()) { if (entity.getStatus() == LibraryStatusEnum.STATUS_0.getCode()) {
throw new BusinessValidateException("待审核状态的文章不能直接操作上架状态需通过批量审核操作上架"); throw new BusinessValidateException("待审核状态的文章不能直接操作上架状态需通过批量审核操作上架");
} }
if (entity.getBookId() != null && entity.getBookId() != "") { /*if (entity.getBookId() != null && entity.getBookId() != "") {
throw new BusinessValidateException("图书内拆分出来的文章不支持单独上、下架、删除操作"); throw new BusinessValidateException("图书内拆分出来的文章不支持单独上、下架、删除操作");
} }*/
} }
for (ArticleLibrary entity : list) { for (ArticleLibrary entity : list) {
entity.setStatus(form.getStatus()); entity.setStatus(form.getStatus());
......
...@@ -49,6 +49,7 @@ import com.zrqx.core.model.resource.ebook.EbookDiyType; ...@@ -49,6 +49,7 @@ import com.zrqx.core.model.resource.ebook.EbookDiyType;
import com.zrqx.core.model.resource.ebook.EbookResource; import com.zrqx.core.model.resource.ebook.EbookResource;
import com.zrqx.core.model.resource.imagelibrary.ImageLibrary; import com.zrqx.core.model.resource.imagelibrary.ImageLibrary;
import com.zrqx.core.model.resource.imagelibrary.ImageLibraryDiyType; import com.zrqx.core.model.resource.imagelibrary.ImageLibraryDiyType;
import com.zrqx.core.util.datatype.ArrayUtils;
import com.zrqx.core.util.page.PageInfo; import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam; import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.util.response.CallBack; import com.zrqx.core.util.response.CallBack;
...@@ -241,14 +242,18 @@ public class EbookController { ...@@ -241,14 +242,18 @@ public class EbookController {
Example example = alservice.createExample(); Example example = alservice.createExample();
example.createCriteria().andIn("bookId", ids); example.createCriteria().andIn("bookId", ids);
List<ArticleLibrary> articleList = alservice.selectByExample(example); List<ArticleLibrary> articleList = alservice.selectByExample(example);
List<String> articleIds = articleList.stream().map(ArticleLibrary :: getId).collect(Collectors.toList()); if(ArrayUtils.isNotEmpty(articleList)){
alservice.batchDelete(articleIds); List<String> articleIds = articleList.stream().map(ArticleLibrary :: getId).collect(Collectors.toList());
alservice.batchDelete(articleIds);
}
// 删除图片 // 删除图片
example = ilService.createExample(); example = ilService.createExample();
example.createCriteria().andIn("bookId", ids); example.createCriteria().andIn("bookId", ids);
List<ImageLibrary> imageList = ilService.selectByExample(example); List<ImageLibrary> imageList = ilService.selectByExample(example);
List<Integer> imageIds = imageList.stream().map(ImageLibrary :: getId).collect(Collectors.toList()); if (ArrayUtils.isNotEmpty(imageList)) {
ilService.batchDelete(imageIds); List<Integer> imageIds = imageList.stream().map(ImageLibrary :: getId).collect(Collectors.toList());
ilService.batchDelete(imageIds);
}
return CallBack.success(); return CallBack.success();
} }
@ApiOperation("查询电子书列表") @ApiOperation("查询电子书列表")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论