提交 07d0e7ce authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 50149e84
......@@ -7,6 +7,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import com.zrqx.core.util.datatype.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.web.multipart.MultipartFile;
......@@ -73,7 +75,11 @@ public class BookUtil {
if(epubUtil.getISBN()!=null) {
book.setIsbn(epubUtil.getISBN());
}else {
throw new BaseException("上传失败!");
if(StringUtils.isNotBlank(epubUtil.getIsbn())){
book.setIsbn(epubUtil.getIsbn());
}else{
throw new BaseException("上传失败!");
}
}
ev = er.setBookInfo(epubUtil, ev);
......
......@@ -243,6 +243,24 @@ public class EpubUtil {
}
return isbn;
}
/**
* 获取图书名称
* @throws Exception
*/
public String getIsbn() throws Exception{
String isbn = null;
try {
for(Identifier identifier : getMetadata().getIdentifiers()){
if(identifier.getScheme().equals("ISBN")){
isbn = identifier.getValue();
}
}
} catch (Exception e) {
e.printStackTrace();
}
return isbn;
}
/**
* 获取图书作者
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论