提交 e69a115f authored 作者: jiashixiong's avatar jiashixiong

前台公共资源接口添加查询专家

上级 23d29136
......@@ -164,9 +164,9 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
Integer bookType = 1;
ebook.setBookType(1);
if (book.getId() == null) {
if((bookType.equals(0) || bookType.equals(1)) && ((StringUtils.isBlank(ebook.getEpubFile())) && (StringUtils.isBlank(ebook.getPdfFile())))){
throw new BaseException("请添加相关PDF资源");
}
// if((bookType.equals(0) || bookType.equals(1)) && ((StringUtils.isBlank(ebook.getEpubFile())) && (StringUtils.isBlank(ebook.getPdfFile())))){
// throw new BaseException("请添加相关PDF资源");
// }
book.setResourceType(AllResourceTypeEnum.BOOK.getCode());
book.setSalesNum(0);
bookMapper.insertSelective(book);
......@@ -179,9 +179,9 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
ebookMapper.insertSelective(ebook);
} else {
//Ebook e = ebookMapper.selectByPrimaryKey(book.getId());
if((bookType.equals(0) || bookType.equals(1)) && ((StringUtils.isBlank(ebook.getEpubFile())) && (StringUtils.isBlank(ebook.getPdfFile())))){
throw new BaseException("请添加相关epub资源或者PDF资源");
}
// if((bookType.equals(0) || bookType.equals(1)) && ((StringUtils.isBlank(ebook.getEpubFile())) && (StringUtils.isBlank(ebook.getPdfFile())))){
// throw new BaseException("请添加相关epub资源或者PDF资源");
// }
bookMapper.updateByPrimaryKeySelective(book);
ebook.setUpdateTime(new Date());
ebookMapper.updateByPrimaryKeySelective(ebook);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论