|
|
@@ -15,6 +15,8 @@ import com.ssj.framework.core.util.StringUtil;
|
|
|
import com.ssj.framework.files.service.FileInfoService;
|
|
|
import com.ssj.framework.weixin.util.MUDload;
|
|
|
import com.ssj.framework.weixin.util.WeixinUtil;
|
|
|
+import com.ssj.service.reading.in.BookIsbnInDto;
|
|
|
+import com.ssj.service.reading.in.BookSaveInDto;
|
|
|
import com.ssj.service.weixin.library.service.*;
|
|
|
import com.ssj.weixin.util.UserUtil;
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
@@ -47,9 +49,7 @@ public class LibBookController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private IBookManagerService managerService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILibBookService bookService;
|
|
|
+
|
|
|
|
|
|
@Autowired
|
|
|
private IBookDetailService detailService;
|
|
|
@@ -57,9 +57,7 @@ public class LibBookController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private ILibJoinService joinService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IBookBaseService bookBaseService;
|
|
|
+
|
|
|
|
|
|
@Autowired
|
|
|
private TokenManager tokenManager;
|
|
|
@@ -95,16 +93,11 @@ public class LibBookController extends BaseController {
|
|
|
//通过userId 查询管理员所在的图书馆
|
|
|
String userId = UserUtil.getUserId(request);
|
|
|
TbLibManager manager = managerService.findByUserIdAndLibIsNotNull(userId);
|
|
|
- if(manager ==null ){
|
|
|
+ if(manager ==null || manager.getType() == 5){
|
|
|
model.addAttribute("msgType", "只有图书管理员才能进行录入操作!");
|
|
|
return "weixin/library/bangding_infor";
|
|
|
- }else{
|
|
|
- //List<Map<String,Object>> libList = adminSaleService.findCdLibList(userId);
|
|
|
- if(manager.getType() == 5){
|
|
|
- model.addAttribute("msgType", "合伙人不能进行录入操作!");
|
|
|
- return "weixin/library/bangding_infor";
|
|
|
- }
|
|
|
}
|
|
|
+
|
|
|
BookDetail detail = detailService.findById(id);
|
|
|
if(detail == null){
|
|
|
model.addAttribute("msgType", "此二维码无效!");
|
|
|
@@ -117,9 +110,9 @@ public class LibBookController extends BaseController {
|
|
|
}
|
|
|
|
|
|
TbLibJoin join = joinService.getById(manager.getLibId());
|
|
|
- model.addAttribute("detailId", id);
|
|
|
+ model.addAttribute("id", id);
|
|
|
model.addAttribute("joinName", join.getLeagueName());
|
|
|
- return "weixin/library/scanQRCode";
|
|
|
+ return "weixin/library/scanQRCode2";
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/scanQRMp3")
|
|
|
@@ -130,123 +123,31 @@ public class LibBookController extends BaseController {
|
|
|
|
|
|
@RequestMapping(value="/save",method=RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public ResponseEntity save(HttpServletRequest request, HttpServletResponse response,TbLibBookInfo info,String saveType,String detailId) throws Exception{
|
|
|
+ public ResponseEntity save(HttpServletRequest request, BookSaveInDto req,String saveType) throws Exception{
|
|
|
ResponseEntity resp = new ResponseEntity();
|
|
|
try {
|
|
|
String userId = UserUtil.getUserId(request);
|
|
|
//通过userId 查询管理员所在的图书馆
|
|
|
TbLibManager manager = managerService.findByUserIdAndLibIsNotNull(userId);
|
|
|
- BookDetail bookDetail = detailService.findById(detailId);
|
|
|
- if(bookDetail == null){
|
|
|
- resp.failure("此二维码无效!");
|
|
|
- return resp;
|
|
|
- }
|
|
|
- if(manager == null){
|
|
|
+
|
|
|
+ if(manager == null || manager.getType() == 5){
|
|
|
resp.failure("您好,只有图书管理员才能进行录入操作!");
|
|
|
return resp;
|
|
|
- }else{
|
|
|
- //List<Map<String,Object>> libList = adminSaleService.findCdLibList(userId);
|
|
|
- if(manager.getType() == 5){
|
|
|
- resp.failure("合伙人不能进行录入操作!");
|
|
|
- return resp;
|
|
|
- }
|
|
|
}
|
|
|
- if(info.getTitle() == null || "".equals(info.getTitle())){
|
|
|
- resp.failure("书籍名称不能为空!");
|
|
|
- return resp;
|
|
|
- }
|
|
|
- if(StringUtil.isEmpty(info.getIsbn13())){
|
|
|
- resp.failure("书籍ISBN号不能为空!");
|
|
|
- return resp;
|
|
|
- }
|
|
|
- if(bookDetail.getInfoId() != null && !"".equals(bookDetail.getInfoId())){
|
|
|
- resp.failure("该书二维码已绑定");
|
|
|
- return resp;
|
|
|
- }else{
|
|
|
- //根据isbn号以及所在图书馆查询图书是否存在
|
|
|
- TbLibBookInfo info2 = bookService.findByIsbnAndLibId(info.getIsbn13(),manager.getLibId());
|
|
|
-
|
|
|
- TbLibJoin libJoin = joinService.getById(manager.getLibId());
|
|
|
- TbLibBookBase bookBase = bookBaseService.findInsertData(info.getIsbn13());
|
|
|
-
|
|
|
- String infoId = "";
|
|
|
- if(info2 != null){
|
|
|
- infoId = info2.getId();
|
|
|
- info2.setUpdateTime(new Date());
|
|
|
- info2.setBookStock(info2.getBookStock()+info.getBookStock());
|
|
|
- info2.setBookStockRemain(info2.getBookStockRemain()==null?bookDetail.getBookcase()==null?0:1:bookDetail.getBookcase()==null?info2.getBookStockRemain():info2.getBookStockRemain()+1);
|
|
|
- bookService.save(info2);
|
|
|
- }else{
|
|
|
- if("2".equals(saveType)){ //需要保存上传过来的图片
|
|
|
- MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
|
|
- Map<String, MultipartFile> fileList = multipartRequest.getFileMap();
|
|
|
- if (fileList !=null && fileList.size() > 0) {
|
|
|
- List<FileInfo> fileInfos = fileInfoService.uploadFilePicture(userId,fileList);
|
|
|
- if (fileList.size() == fileInfos.size()) {
|
|
|
- info.setLocalImage(fileInfos.get(0).getFilePath());
|
|
|
- }
|
|
|
- }else{
|
|
|
- resp.failure("书籍封面不能为空!");
|
|
|
- return resp;
|
|
|
- }
|
|
|
- }else if("1".equals(saveType)){
|
|
|
- info.setLocalImage(MUDload.downloadImage(info.getDoubanImage()));
|
|
|
- }else{
|
|
|
- info.setLocalImage(info.getDoubanImage().replace(PropertiesUtil.getValue("STATIC_FILE_URL"), ""));
|
|
|
- }
|
|
|
- info.setLibId(manager.getLibId());
|
|
|
- info.setOrgCode(libJoin.getOrgCode());
|
|
|
- info.setCreateTime(new Date());
|
|
|
- info.setSummary(info.getSummary());
|
|
|
- if(info.getCsisbn()== null || "".equals(info.getCsisbn())){
|
|
|
- info.setIsSerial("1");
|
|
|
- }else{
|
|
|
- info.setIsSerial("2");
|
|
|
- }
|
|
|
- info.setBookStockRemain(bookDetail.getBookcase()==null?0:1);
|
|
|
- TbLibBookInfo newInfo = bookService.save(info);
|
|
|
- infoId = newInfo.getId();
|
|
|
- }
|
|
|
- if(bookBase == null){
|
|
|
- bookBase = new TbLibBookBase();
|
|
|
- bookBase.setTitle(info.getTitle());
|
|
|
- bookBase.setAuthor(info.getAuthor());
|
|
|
- bookBase.setAuthorIntro(info.getAuthorIntro());
|
|
|
- bookBase.setCatalog(info.getCatalog());
|
|
|
- bookBase.setCreateTime(new Date());
|
|
|
- bookBase.setIsbn13(info.getIsbn13());
|
|
|
- bookBase.setIsbn10(info.getIsbn10());
|
|
|
- bookBase.setDoubanImage(info.getLocalImage());
|
|
|
- bookBase.setLocalImage(info.getLocalImage());
|
|
|
- bookBase.setPages(info.getPages());
|
|
|
- bookBase.setPrice(info.getPrice());
|
|
|
- bookBase.setPubdate(info.getPubdate());
|
|
|
- bookBase.setPublisher(info.getPublisher());
|
|
|
- bookBase.setCsisbn(info.getCsisbn());
|
|
|
- if(info.getCsisbn()== null || "".equals(info.getCsisbn())){
|
|
|
- bookBase.setIsSerial("1"); //1指代主
|
|
|
- }else{
|
|
|
- bookBase.setIsSerial("2"); //1指代主
|
|
|
- }
|
|
|
- bookBase=bookBaseService.save(bookBase);
|
|
|
- }else{
|
|
|
- bookBase.setIsbn13(info.getIsbn13());
|
|
|
- bookBase.setCsisbn(info.getCsisbn());
|
|
|
- if(info.getCsisbn()== null || "".equals(info.getCsisbn())){
|
|
|
- bookBase.setIsSerial("1"); //1指代主
|
|
|
- }else{
|
|
|
- bookBase.setIsSerial("2"); //1指代主
|
|
|
+ req.setLibId(manager.getLibId());
|
|
|
+ if("2".equals(saveType)) {
|
|
|
+ MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
|
|
+ Map<String, MultipartFile> fileList = multipartRequest.getFileMap();
|
|
|
+ if (fileList != null && fileList.size() > 0) {
|
|
|
+ List<FileInfo> fileInfos = fileInfoService.uploadFilePicture(userId, fileList);
|
|
|
+ if (fileList.size() == fileInfos.size()) {
|
|
|
+ req.setLocalImage(fileInfos.get(0).getFilePath());
|
|
|
}
|
|
|
- bookBase=bookBaseService.save(bookBase);
|
|
|
+ } else {
|
|
|
+ return resp.failure("书籍封面不能为空!");
|
|
|
}
|
|
|
- bookDetail.setInfoId(infoId);
|
|
|
- bookDetail.setLibId(manager.getLibId());
|
|
|
- bookDetail.setCreateTime(new Date());
|
|
|
- bookDetail.setInuser(userId);
|
|
|
- detailService.save(bookDetail);
|
|
|
- // Map<String, Object> data = new HashMap<String, Object>();
|
|
|
- resp.success("保存成功");
|
|
|
}
|
|
|
+ resp = detailService.addBook(req,userId);
|
|
|
} catch (Exception e) {
|
|
|
resp.failure("保存失败,请联系管理员!");
|
|
|
e.printStackTrace();
|
|
|
@@ -255,203 +156,8 @@ public class LibBookController extends BaseController {
|
|
|
}
|
|
|
@RequestMapping(value="/getBookInfo",method=RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public ResponseEntity getBookInfo(HttpServletRequest request, Model model,String isbn13,String csisbn){
|
|
|
- ResponseEntity response = new ResponseEntity();
|
|
|
- /**
|
|
|
- * 1、查询书籍基础库 tb_lib_book_base 根据isbn查询 看是否有数据
|
|
|
- * 2、如果1没有数据去tb_lib_book_info 中根据isbn 查询是否有数据
|
|
|
- * 3、如果2也无数据,调用豆瓣接口获取
|
|
|
- * 4、如果3都无数据则叫用户新增
|
|
|
- */
|
|
|
- if(isbn13 == null || "".equals(isbn13)){
|
|
|
- response.failure("传入的isbn号为空,请重新扫描");
|
|
|
- return response;
|
|
|
- }
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- if("".equals(csisbn)){ //非丛书
|
|
|
- TbLibBookBase baseBook = bookBaseService.findByIsbn13(isbn13);
|
|
|
- if(baseBook == null){
|
|
|
- TbLibBookInfo info2 = bookService.findBookInfoByIsbn(isbn13);
|
|
|
- if(info2 == null ){
|
|
|
- String url = "https://api.douban.com/v2/book/isbn/"+isbn13;
|
|
|
- JSONObject jsonObject2 = WeixinUtil.httpRequest(url, "GET", null);
|
|
|
- if(jsonObject2 == null){
|
|
|
- response.failure("根据ISBN未查到相应数据");
|
|
|
- }else{
|
|
|
- jsonObject2.put("saveType", "1"); //数据库获取 豆瓣获取1
|
|
|
- response.success(jsonObject2,"获取成功");
|
|
|
- }
|
|
|
- }else{
|
|
|
- jsonObject.put("author_intro", info2.getAuthorIntro()== null ? "":info2.getAuthorIntro());
|
|
|
- jsonObject.put("summary",info2.getSummary()==null ? "":info2.getSummary() );
|
|
|
- jsonObject.put("price", info2.getPrice()==null ? "":info2.getPrice());
|
|
|
- jsonObject.put("publisher",info2.getPublisher() == null ? "":info2.getPublisher() );
|
|
|
- jsonObject.put("pages",info2.getPages() == null ? "":info2.getPages());
|
|
|
- jsonObject.put("catalog",info2.getCatalog() == null ? "" :info2.getCatalog());
|
|
|
- jsonObject.put("isbn10",info2.getIsbn10() == null ? "" :info2.getIsbn10());
|
|
|
- jsonObject.put("pubdate",info2.getPubdate() == null ? "" :info2.getPubdate());
|
|
|
- jsonObject.put("author", info2.getAuthor() == null ? "" :info2.getAuthor());
|
|
|
- jsonObject.put("isbn13", info2.getIsbn13());
|
|
|
- jsonObject.put("title", info2.getTitle());
|
|
|
- jsonObject.put("bookcase", info2.getBookcase());
|
|
|
- jsonObject.put("startAge", info2.getStartAge());
|
|
|
- jsonObject.put("endAge", info2.getEndAge());
|
|
|
- jsonObject.put("keyword", info2.getKeyword());
|
|
|
- jsonObject.put("bookGr", info2.getBookcase());
|
|
|
- jsonObject.put("keywordFeel", info2.getKeywordFeel());
|
|
|
- jsonObject.put("parentTheme", info2.getParentTheme());
|
|
|
- jsonObject.put("childTheme", info2.getChildTheme());
|
|
|
- jsonObject.put("grade", info2.getGrade());
|
|
|
- jsonObject.put("section", info2.getSection());
|
|
|
- jsonObject.put("image",PropertiesUtil.getValue("STATIC_FILE_URL")+info2.getLocalImage());
|
|
|
- jsonObject.put("saveType", "0"); //数据库获取 0
|
|
|
- response.success(jsonObject,"获取成功");
|
|
|
- }
|
|
|
- }else{
|
|
|
- if("2".equals(baseBook.getIsSerial())){ //是丛书
|
|
|
- jsonObject.put("saveType", "3"); //丛书2
|
|
|
- //获取丛书列表 --丛书拥有同一个isbn号,不同的csisbn号
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- for(int i=1;i<21;i++){
|
|
|
- map.put(""+i, i);
|
|
|
- }
|
|
|
- List<TbLibBookBase> baseList = bookBaseService.getBaseCsList(isbn13);
|
|
|
- for(TbLibBookBase base :baseList){
|
|
|
- map.put(base.getIsbn13().replace(isbn13, ""), base.getTitle());
|
|
|
- }
|
|
|
- jsonObject.put("cslist2", map);
|
|
|
- response.success(jsonObject,"获取成功");
|
|
|
- }else{ //非丛书
|
|
|
- jsonObject.put("author_intro", baseBook.getAuthorIntro()== null ? "":baseBook.getAuthorIntro());
|
|
|
- jsonObject.put("summary",baseBook.getSummary()==null ? "":baseBook.getSummary() );
|
|
|
- jsonObject.put("price", baseBook.getPrice()==null ? "":baseBook.getPrice());
|
|
|
- jsonObject.put("publisher",baseBook.getPublisher() == null ? "":baseBook.getPublisher() );
|
|
|
- jsonObject.put("pages",baseBook.getPages() == null ? "":baseBook.getPages());
|
|
|
- jsonObject.put("catalog",baseBook.getCatalog() == null ? "" :baseBook.getCatalog());
|
|
|
- jsonObject.put("isbn10",baseBook.getIsbn10() == null ? "" :baseBook.getIsbn10());
|
|
|
- jsonObject.put("pubdate",baseBook.getPubdate() == null ? "" :baseBook.getPubdate());
|
|
|
- jsonObject.put("author", baseBook.getAuthor() == null ? "" :baseBook.getAuthor());
|
|
|
- jsonObject.put("isbn13", baseBook.getIsbn13());
|
|
|
- jsonObject.put("title", baseBook.getTitle());
|
|
|
- jsonObject.put("bookcase", baseBook.getBookcase());
|
|
|
- jsonObject.put("startAge", baseBook.getStartAge());
|
|
|
- jsonObject.put("endAge", baseBook.getEndAge());
|
|
|
- jsonObject.put("keyword", baseBook.getKeyword());
|
|
|
- jsonObject.put("bookGr", baseBook.getBookcase());
|
|
|
- jsonObject.put("keywordFeel", baseBook.getKeywordFeel());
|
|
|
- jsonObject.put("parentTheme", baseBook.getParentTheme());
|
|
|
- jsonObject.put("childTheme", baseBook.getChildTheme());
|
|
|
- jsonObject.put("grade", baseBook.getGrade());
|
|
|
- jsonObject.put("section", baseBook.getSection());
|
|
|
- jsonObject.put("image",PropertiesUtil.getValue("STATIC_FILE_URL")+baseBook.getLocalImage());
|
|
|
- jsonObject.put("saveType", "0"); //数据库获取 0
|
|
|
- response.success(jsonObject,"获取成功");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }else{
|
|
|
- TbLibBookBase baseBook2 = bookBaseService.getBookcs(isbn13,csisbn);
|
|
|
- if(baseBook2 == null){ //查不到该数据
|
|
|
- TbLibBookBase baseBook = bookBaseService.findByIsbn13(isbn13);
|
|
|
- if(baseBook == null){
|
|
|
- TbLibBookInfo info2 = bookService.findBookInfoByIsbn(isbn13);
|
|
|
- if(info2 == null ){
|
|
|
- String url = "https://api.douban.com/v2/book/isbn/"+isbn13;
|
|
|
- JSONObject jsonObject2 = WeixinUtil.httpRequest(url, "GET", null);
|
|
|
- if(jsonObject2 == null){
|
|
|
- response.failure("根据ISBN未查到相应数据");
|
|
|
- }else{
|
|
|
- jsonObject2.put("saveType", "1"); //数据库获取 豆瓣获取1
|
|
|
- jsonObject.put("csisbn", csisbn.replace(isbn13,""));
|
|
|
- jsonObject.put("bookcase", "");
|
|
|
- jsonObject.put("startAge", "");
|
|
|
- jsonObject.put("endAge", "");
|
|
|
- jsonObject.put("keyword", "");
|
|
|
- response.success(jsonObject2,"获取成功");
|
|
|
- }
|
|
|
- }else{
|
|
|
- jsonObject.put("author_intro", info2.getAuthorIntro()== null ? "":info2.getAuthorIntro());
|
|
|
- jsonObject.put("summary",info2.getSummary()==null ? "":info2.getSummary() );
|
|
|
- jsonObject.put("price", info2.getPrice()==null ? "":info2.getPrice());
|
|
|
- jsonObject.put("publisher",info2.getPublisher() == null ? "":info2.getPublisher() );
|
|
|
- jsonObject.put("pages",info2.getPages() == null ? "":info2.getPages());
|
|
|
- jsonObject.put("catalog",info2.getCatalog() == null ? "" :info2.getCatalog());
|
|
|
- jsonObject.put("isbn10",info2.getIsbn10() == null ? "" :info2.getIsbn10());
|
|
|
- jsonObject.put("pubdate",info2.getPubdate() == null ? "" :info2.getPubdate());
|
|
|
- jsonObject.put("author", info2.getAuthor() == null ? "" :info2.getAuthor());
|
|
|
- jsonObject.put("isbn13", info2.getIsbn13());
|
|
|
- jsonObject.put("title", info2.getTitle());
|
|
|
- jsonObject.put("csisbn", isbn13.replace(csisbn,""));
|
|
|
- jsonObject.put("image",PropertiesUtil.getValue("STATIC_FILE_URL")+info2.getLocalImage());
|
|
|
- jsonObject.put("saveType", "0"); //数据库获取 0
|
|
|
- jsonObject.put("bookcase", info2.getBookcase());
|
|
|
- jsonObject.put("startAge", info2.getStartAge());
|
|
|
- jsonObject.put("endAge", info2.getEndAge());
|
|
|
- jsonObject.put("keyword", info2.getKeyword());
|
|
|
- jsonObject.put("bookGr", info2.getBookcase());
|
|
|
- jsonObject.put("keywordFeel", info2.getKeywordFeel());
|
|
|
- jsonObject.put("parentTheme", info2.getParentTheme());
|
|
|
- jsonObject.put("childTheme", info2.getChildTheme());
|
|
|
- jsonObject.put("grade", info2.getGrade());
|
|
|
- jsonObject.put("section", info2.getSection());
|
|
|
- response.success(jsonObject,"获取成功");
|
|
|
- }
|
|
|
- }else{
|
|
|
- jsonObject.put("author_intro", baseBook.getAuthorIntro()== null ? "":baseBook.getAuthorIntro());
|
|
|
- jsonObject.put("summary",baseBook.getSummary()==null ? "":baseBook.getSummary() );
|
|
|
- jsonObject.put("price", baseBook.getPrice()==null ? "":baseBook.getPrice());
|
|
|
- jsonObject.put("publisher",baseBook.getPublisher() == null ? "":baseBook.getPublisher() );
|
|
|
- jsonObject.put("pages",baseBook.getPages() == null ? "":baseBook.getPages());
|
|
|
- jsonObject.put("catalog",baseBook.getCatalog() == null ? "" :baseBook.getCatalog());
|
|
|
- jsonObject.put("isbn10",baseBook.getIsbn10() == null ? "" :baseBook.getIsbn10());
|
|
|
- jsonObject.put("pubdate",baseBook.getPubdate() == null ? "" :baseBook.getPubdate());
|
|
|
- jsonObject.put("author", baseBook.getAuthor() == null ? "" :baseBook.getAuthor());
|
|
|
- jsonObject.put("isbn13", isbn13);
|
|
|
- jsonObject.put("title", baseBook.getTitle());
|
|
|
- jsonObject.put("image",PropertiesUtil.getValue("STATIC_FILE_URL")+baseBook.getLocalImage());
|
|
|
- jsonObject.put("csisbn", isbn13.replace(csisbn,""));
|
|
|
- jsonObject.put("saveType", "0"); //数据库获取 0
|
|
|
- jsonObject.put("bookcase",baseBook.getBookcase()==null ? "":baseBook.getBookcase());
|
|
|
- jsonObject.put("startAge", baseBook.getStartAge() == null ? "":baseBook.getStartAge());
|
|
|
- jsonObject.put("endAge", baseBook.getEndAge() == null ? "":baseBook.getEndAge());
|
|
|
- jsonObject.put("keyword", baseBook.getKeyword() == null ? "":baseBook.getKeyword());
|
|
|
- jsonObject.put("bookGr", baseBook.getBookcase());
|
|
|
- jsonObject.put("keywordFeel", baseBook.getKeywordFeel());
|
|
|
- jsonObject.put("parentTheme", baseBook.getParentTheme());
|
|
|
- jsonObject.put("childTheme", baseBook.getChildTheme());
|
|
|
- jsonObject.put("grade", baseBook.getGrade());
|
|
|
- jsonObject.put("section", baseBook.getSection());
|
|
|
- response.success(jsonObject,"获取成功");
|
|
|
- }
|
|
|
- }else{
|
|
|
- jsonObject.put("author_intro", baseBook2.getAuthorIntro()== null ? "":baseBook2.getAuthorIntro());
|
|
|
- jsonObject.put("summary",baseBook2.getSummary()==null ? "":baseBook2.getSummary() );
|
|
|
- jsonObject.put("price", baseBook2.getPrice()==null ? "":baseBook2.getPrice());
|
|
|
- jsonObject.put("publisher",baseBook2.getPublisher() == null ? "":baseBook2.getPublisher() );
|
|
|
- jsonObject.put("pages",baseBook2.getPages() == null ? "":baseBook2.getPages());
|
|
|
- jsonObject.put("catalog",baseBook2.getCatalog() == null ? "" :baseBook2.getCatalog());
|
|
|
- jsonObject.put("isbn10",baseBook2.getIsbn10() == null ? "" :baseBook2.getIsbn10());
|
|
|
- jsonObject.put("pubdate",baseBook2.getPubdate() == null ? "" :baseBook2.getPubdate());
|
|
|
- jsonObject.put("author", baseBook2.getAuthor() == null ? "" :baseBook2.getAuthor());
|
|
|
- jsonObject.put("isbn13", baseBook2.getCsisbn());
|
|
|
- jsonObject.put("title", baseBook2.getTitle());
|
|
|
- jsonObject.put("image",PropertiesUtil.getValue("STATIC_FILE_URL")+baseBook2.getLocalImage());
|
|
|
- jsonObject.put("csisbn", csisbn.replace(baseBook2.getCsisbn(), ""));
|
|
|
- jsonObject.put("saveType", "0"); //数据库获取 0
|
|
|
- jsonObject.put("bookcase",baseBook2.getBookcase()==null ? "":baseBook2.getBookcase());
|
|
|
- jsonObject.put("startAge", baseBook2.getStartAge() == null ? "":baseBook2.getStartAge());
|
|
|
- jsonObject.put("endAge", baseBook2.getEndAge() == null ? "":baseBook2.getEndAge());
|
|
|
- jsonObject.put("keyword", baseBook2.getKeyword() == null ? "":baseBook2.getKeyword());
|
|
|
- jsonObject.put("bookGr", baseBook2.getBookcase());
|
|
|
- jsonObject.put("keywordFeel", baseBook2.getKeywordFeel());
|
|
|
- jsonObject.put("parentTheme", baseBook2.getParentTheme());
|
|
|
- jsonObject.put("childTheme", baseBook2.getChildTheme());
|
|
|
- jsonObject.put("grade", baseBook2.getGrade());
|
|
|
- jsonObject.put("section", baseBook2.getSection());
|
|
|
- response.success(jsonObject,"获取成功");
|
|
|
- }
|
|
|
- }
|
|
|
- return response;
|
|
|
+ public ResponseEntity getBookInfo(HttpServletRequest request, Model model, BookIsbnInDto req){
|
|
|
+ return detailService.getBookInfoByIsbn(req);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/checkDetail",method=RequestMethod.POST)
|