提交 5fbb176e authored 作者: lizhuo's avatar lizhuo

--no commit message

上级 419694cf
package com.zrqx.resource.wap.controller.ebook; package com.zrqx.resource.wap.controller.ebook;
import java.text.ParseException;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.zrqx.core.constant.resource.ResourceRequestPath; import com.zrqx.core.constant.resource.ResourceRequestPath;
import com.zrqx.core.enums.AllResourceTypeEnum;
import com.zrqx.core.form.resource.bg.QueryResourceRelationForm; import com.zrqx.core.form.resource.bg.QueryResourceRelationForm;
import com.zrqx.core.form.resource.fg.articlelibrary.FgQueryArticleLibraryForm; import com.zrqx.core.form.resource.fg.articlelibrary.FgQueryArticleLibraryForm;
import com.zrqx.core.model.resource.year.YearLibrary; import com.zrqx.core.model.resource.year.YearLibrary;
...@@ -23,6 +25,7 @@ import com.zrqx.core.vo.resource.fg.ebook.FgEbookVO; ...@@ -23,6 +25,7 @@ import com.zrqx.core.vo.resource.fg.ebook.FgEbookVO;
import com.zrqx.core.vo.resource.fg.ebook.WapIndexEbookListVO; import com.zrqx.core.vo.resource.fg.ebook.WapIndexEbookListVO;
import com.zrqx.resource.bg.service.ResourceRelationService; import com.zrqx.resource.bg.service.ResourceRelationService;
import com.zrqx.resource.fg.service.articlelibrary.FgArticleLibraryService; import com.zrqx.resource.fg.service.articlelibrary.FgArticleLibraryService;
import com.zrqx.resource.fg.service.record.FgRecordService;
import com.zrqx.resource.wap.service.WapBookService; import com.zrqx.resource.wap.service.WapBookService;
import com.zrqx.resource.wap.service.WapYearLibraryService; import com.zrqx.resource.wap.service.WapYearLibraryService;
...@@ -50,7 +53,8 @@ public class WapEbookController { ...@@ -50,7 +53,8 @@ public class WapEbookController {
private ResourceRelationService resourceRelationService; private ResourceRelationService resourceRelationService;
@Autowired @Autowired
private WapYearLibraryService yearLibraryService; private WapYearLibraryService yearLibraryService;
@Autowired
private FgRecordService recordService;
@ApiOperation("首页最新上架") @ApiOperation("首页最新上架")
@GetMapping(ResourceRequestPath.INDEX) @GetMapping(ResourceRequestPath.INDEX)
...@@ -91,12 +95,15 @@ public class WapEbookController { ...@@ -91,12 +95,15 @@ public class WapEbookController {
@ApiOperation("根据id查找电子书") @ApiOperation("根据id查找电子书")
@GetMapping(ResourceRequestPath.GET) @GetMapping(ResourceRequestPath.GET)
public CallBack<FgEbookVO> echo(QueryResourceRelationForm entity) { public CallBack<FgEbookVO> echo(QueryResourceRelationForm entity) throws ParseException {
FgEbookVO vo = bookservice.ebookOneInfoById(entity.getId()).get(0); FgEbookVO vo = bookservice.ebookOneInfoById(entity.getId()).get(0);
// 保存浏览记录
recordService.saveOrUpdateRecord(entity.getId(), AllResourceTypeEnum.BOOK.getCode().toString());
// 更新浏览量 // 更新浏览量
bookservice.updateBrowseNum(entity.getId()); bookservice.updateBrowseNum(entity.getId());
List<ResourceRelationVo> list = resourceRelationService.FgqueryByIdAndResourceType(entity); List<ResourceRelationVo> list = resourceRelationService.FgqueryByIdAndResourceType(entity);
vo.setListArticle(resourceRelationService.queryfgRelationList(list)); vo.setListArticle(resourceRelationService.queryfgRelationList(list));
return CallBack.success(vo); return CallBack.success(vo);
} }
} }
...@@ -12,6 +12,7 @@ import com.zrqx.core.exception.BusinessValidateException; ...@@ -12,6 +12,7 @@ import com.zrqx.core.exception.BusinessValidateException;
import com.zrqx.core.form.resource.fg.articlelibrary.FgQueryArticleLibraryForm; import com.zrqx.core.form.resource.fg.articlelibrary.FgQueryArticleLibraryForm;
import com.zrqx.core.mapper.BaseMapper; import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.ebook.Book; import com.zrqx.core.model.resource.ebook.Book;
import com.zrqx.core.model.resource.pdffilelibrary.PdfLibrary;
import com.zrqx.core.model.resource.year.YearLibrary; import com.zrqx.core.model.resource.year.YearLibrary;
import com.zrqx.core.service.BaseServiceImpl; import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.core.util.datatype.ArrayUtils; import com.zrqx.core.util.datatype.ArrayUtils;
...@@ -20,6 +21,7 @@ import com.zrqx.core.vo.resource.fg.articlelibrary.FgArticleLibraryListVO; ...@@ -20,6 +21,7 @@ import com.zrqx.core.vo.resource.fg.articlelibrary.FgArticleLibraryListVO;
import com.zrqx.core.vo.resource.fg.ebook.FgEbookListVO; import com.zrqx.core.vo.resource.fg.ebook.FgEbookListVO;
import com.zrqx.core.vo.resource.fg.ebook.FgEbookVO; import com.zrqx.core.vo.resource.fg.ebook.FgEbookVO;
import com.zrqx.core.vo.resource.fg.ebook.WapIndexEbookListVO; import com.zrqx.core.vo.resource.fg.ebook.WapIndexEbookListVO;
import com.zrqx.resource.bg.mapper.pdffilelibrary.PdfLibraryMapper;
import com.zrqx.resource.fg.mapper.year.FgYearLibraryMapper; import com.zrqx.resource.fg.mapper.year.FgYearLibraryMapper;
import com.zrqx.resource.wap.mapper.WapBookMapper; import com.zrqx.resource.wap.mapper.WapBookMapper;
...@@ -35,7 +37,8 @@ public class WapBookServiceImpl extends BaseServiceImpl<Book, String> implements ...@@ -35,7 +37,8 @@ public class WapBookServiceImpl extends BaseServiceImpl<Book, String> implements
private WapBookMapper bookMapper; private WapBookMapper bookMapper;
@Autowired @Autowired
private FgYearLibraryMapper fgYearLibraryMapper; private FgYearLibraryMapper fgYearLibraryMapper;
@Autowired
private PdfLibraryMapper pdfLibraryMapper;
@Override @Override
public BaseMapper<Book> getMapper() { public BaseMapper<Book> getMapper() {
return bookMapper; return bookMapper;
...@@ -120,6 +123,12 @@ public class WapBookServiceImpl extends BaseServiceImpl<Book, String> implements ...@@ -120,6 +123,12 @@ public class WapBookServiceImpl extends BaseServiceImpl<Book, String> implements
for (FgEbookVO vo : list) { for (FgEbookVO vo : list) {
YearLibrary library = fgYearLibraryMapper.selectByPrimaryKey(vo.getYearId()); YearLibrary library = fgYearLibraryMapper.selectByPrimaryKey(vo.getYearId());
vo.setName(vo.getName()+"["+library.getName()+"年第"+vo.getPeriods()+"期]"); vo.setName(vo.getName()+"["+library.getName()+"年第"+vo.getPeriods()+"期]");
PdfLibrary pdfLibrary = pdfLibraryMapper.selectByPrimaryKey(vo.getPdf());
if(pdfLibrary !=null) {
vo.setPdf(pdfLibrary.getPdf());
}else {
vo.setPdf(null);
}
} }
/*this.regEx(list);*/ /*this.regEx(list);*/
return list; return list;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论