Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jfjxhly
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
jfjxhly
Commits
f8114c9f
提交
f8114c9f
authored
3月 23, 2021
作者:
renjianyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
bb4a014e
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
62 行增加
和
38 行删除
+62
-38
FgEbookChapterVO.java
...m/zrqx/resource/commons/vo/fg/ebook/FgEbookChapterVO.java
+44
-0
FgEbookController.java
.../zrqx/resource/fg/controller/ebook/FgEbookController.java
+14
-33
FgChapterLibraryMapper.java
...urce/fg/mapper/articlelibrary/FgChapterLibraryMapper.java
+4
-0
FgEbookServiceImpl.java
...om/zrqx/resource/fg/service/ebook/FgEbookServiceImpl.java
+0
-5
没有找到文件。
app/resource/src/main/java/com/zrqx/resource/commons/vo/fg/ebook/FgEbookChapterVO.java
0 → 100644
浏览文件 @
f8114c9f
package
com
.
zrqx
.
resource
.
commons
.
vo
.
fg
.
ebook
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
com.zrqx.resource.commons.model.articlelibrary.ChapterLibrary
;
import
com.zrqx.resource.commons.model.diytype.DiyType
;
import
com.zrqx.resource.commons.model.resourcerelation.RelationAuthor
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 前台-电子书vo
* @author ycw
* @date 2019年1月11日下午4:39:39
*/
@Data
@ApiModel
(
value
=
"FgEbookVO"
,
description
=
"图书基础数据+电子书数据"
)
public
class
FgEbookChapterVO
{
@ApiModelProperty
(
"目录id,新增时不需要填写"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"目录标题"
,
required
=
true
)
private
String
chapterName
;
@ApiModelProperty
(
value
=
"父章节id(第一级为0,之后为父级的markId)"
,
required
=
true
)
private
String
parentId
;
@ApiModelProperty
(
value
=
"所属图书id"
,
required
=
true
)
private
String
bookId
;
@ApiModelProperty
(
value
=
"所属图书名称"
,
required
=
true
)
private
String
bookName
;
@ApiModelProperty
(
value
=
"章节排序"
,
required
=
true
)
private
Integer
orderNum
;
@ApiModelProperty
(
value
=
"章节标识号(bookid+txt编号)"
,
required
=
true
)
private
String
markId
;
@ApiModelProperty
(
value
=
"章节层级(1,2,3,4,5)"
,
required
=
true
)
private
Integer
level
;
@ApiModelProperty
(
value
=
"pdf页码"
,
required
=
true
)
private
Integer
pdfNum
;
@ApiModelProperty
(
value
=
"关联目录章节"
)
private
List
<
ChapterLibrary
>
chapterList
;
}
app/resource/src/main/java/com/zrqx/resource/fg/controller/ebook/FgEbookController.java
浏览文件 @
f8114c9f
...
@@ -37,10 +37,12 @@ import com.zrqx.resource.commons.model.resourcerelation.RelationAuthor;
...
@@ -37,10 +37,12 @@ import com.zrqx.resource.commons.model.resourcerelation.RelationAuthor;
import
com.zrqx.resource.commons.vo.fg.authorlibrary.FgAboutEbookListVO
;
import
com.zrqx.resource.commons.vo.fg.authorlibrary.FgAboutEbookListVO
;
import
com.zrqx.resource.commons.vo.fg.comment.FgCommentNumAndScoreVo
;
import
com.zrqx.resource.commons.vo.fg.comment.FgCommentNumAndScoreVo
;
import
com.zrqx.resource.commons.vo.fg.diytype.FgDiyTypeVo
;
import
com.zrqx.resource.commons.vo.fg.diytype.FgDiyTypeVo
;
import
com.zrqx.resource.commons.vo.fg.ebook.FgEbookChapterVO
;
import
com.zrqx.resource.commons.vo.fg.ebook.FgEbookListVO
;
import
com.zrqx.resource.commons.vo.fg.ebook.FgEbookListVO
;
import
com.zrqx.resource.commons.vo.fg.ebook.FgEbookVO
;
import
com.zrqx.resource.commons.vo.fg.ebook.FgEbookVO
;
import
com.zrqx.resource.commons.vo.fg.label.FgLabelInfoVO
;
import
com.zrqx.resource.commons.vo.fg.label.FgLabelInfoVO
;
import
com.zrqx.resource.commons.vo.fg.marketing.FgPromotionInfoOneVO
;
import
com.zrqx.resource.commons.vo.fg.marketing.FgPromotionInfoOneVO
;
import
com.zrqx.resource.fg.mapper.articlelibrary.FgChapterLibraryMapper
;
import
com.zrqx.resource.fg.service.FgRelationAuthorService
;
import
com.zrqx.resource.fg.service.FgRelationAuthorService
;
import
com.zrqx.resource.fg.service.articlelibrary.FgChapterLibraryService
;
import
com.zrqx.resource.fg.service.articlelibrary.FgChapterLibraryService
;
import
com.zrqx.resource.fg.service.comment.FgCommentService
;
import
com.zrqx.resource.fg.service.comment.FgCommentService
;
...
@@ -84,6 +86,8 @@ public class FgEbookController {
...
@@ -84,6 +86,8 @@ public class FgEbookController {
@Autowired
@Autowired
private
FgChapterLibraryService
clservice
;
private
FgChapterLibraryService
clservice
;
@Autowired
@Autowired
private
FgChapterLibraryMapper
clmapper
;
@Autowired
private
FgOrganMemberRecordService
fgOrganMemberRecordService
;
private
FgOrganMemberRecordService
fgOrganMemberRecordService
;
@Autowired
@Autowired
private
FgPromotionService
promotionService
;
private
FgPromotionService
promotionService
;
...
@@ -131,47 +135,24 @@ public class FgEbookController {
...
@@ -131,47 +135,24 @@ public class FgEbookController {
@ApiOperation
(
"根据id查找电子书"
)
@ApiOperation
(
"根据id查找电子书"
)
@GetMapping
(
"/get/{oid}"
)
@GetMapping
(
"/get/{oid}"
)
public
CallBack
<
FgEbookVO
>
echo
(
@PathVariable
String
oid
)
{
public
CallBack
<
FgEbookChapterVO
>
echo
(
@PathVariable
String
oid
)
{
FgEbookVO
vo
=
ebookservice
.
ebookOneInfoById
(
oid
);
FgEbookChapterVO
vo
=
clmapper
.
selectchapter
(
oid
,
1
);
//查看促销活动,修改成活动价格
FgPromotionInfoOneVO
info
=
promotionService
.
getInfoByResId
(
vo
.
getId
(),
AllResourceTypeEnum
.
BOOK
.
getCode
());
if
(
info
!=
null
){
vo
.
setDiscount
(
info
.
getDiscountOrRealPrice
().
multiply
(
new
BigDecimal
(
10
)));
}
// 目录
// 目录
List
<
ChapterLibrary
>
chapterList
=
this
.
getDirectory
(
null
,
oid
);
List
<
ChapterLibrary
>
chapterList
=
this
.
getDirectory
(
null
,
oid
,
1
);
vo
.
setChapterList
(
chapterList
);
vo
.
setChapterList
(
chapterList
);
Example
example
=
clservice
.
createExample
();
Example
example
=
clservice
.
createExample
();
example
.
createCriteria
().
andEqualTo
(
"bookId"
,
oid
);
example
.
createCriteria
().
andEqualTo
(
"bookId"
,
oid
);
PageHelper
.
orderBy
(
" orderNum asc, pdfNum asc"
);
PageHelper
.
orderBy
(
" orderNum asc, pdfNum asc"
);
List
<
ChapterLibrary
>
list
=
clservice
.
selectByExample
(
example
);
List
<
ChapterLibrary
>
list
=
clservice
.
selectByExample
(
example
);
if
(!
list
.
isEmpty
()){
vo
.
setMarkid
(
list
.
get
(
0
).
getMarkId
());
}
// 保存浏览记录
// 保存浏览记录
recordService
.
saveOrUpdateRecord
(
oid
,
AllResourceTypeEnum
.
BOOK
.
getCode
().
toString
());
recordService
.
saveOrUpdateRecord
(
oid
,
AllResourceTypeEnum
.
BOOK
.
getCode
().
toString
());
// 更新浏览量
// 更新浏览量
ebookservice
.
updateBrowseNum
(
oid
);
ebookservice
.
updateBrowseNum
(
oid
);
//获取评分与评论数TODO
FgQueryCommentForm
queryCommentForm
=
new
FgQueryCommentForm
();
queryCommentForm
.
setResourceId
(
oid
);
queryCommentForm
.
setResourceType
(
AllResourceTypeEnum
.
BOOK
.
getCode
());
FgCommentNumAndScoreVo
commentNumAndScoreVo
=
commentService
.
getCommentNumAndScore
(
queryCommentForm
);
BeanUtils
.
copyProperties
(
commentNumAndScoreVo
,
vo
);
//保存机构用户浏览记录
FgSaveOrganMemberRecordForm
form
=
new
FgSaveOrganMemberRecordForm
();
form
.
setResourceId
(
vo
.
getId
());
form
.
setResourceName
(
vo
.
getName
());
form
.
setResourceType
(
vo
.
getResourceType
());
fgOrganMemberRecordService
.
saveOrUpdateRecord
(
form
);
//查询所属分类
List
<
DiyType
>
diyTypeList
=
ebookDiyTypeService
.
selectDiyTypeList
(
oid
);
vo
.
setDiyTypeList
(
diyTypeList
);
// 关联作者集合
// 关联作者集合
example
=
bookAuthorService
.
createExample
();
//
example = bookAuthorService.createExample();
example
.
createCriteria
().
andEqualTo
(
"resourceId"
,
oid
);
//
example.createCriteria().andEqualTo("resourceId", oid);
List
<
RelationAuthor
>
baList
=
bookAuthorService
.
selectByExample
(
example
);
//
List<RelationAuthor> baList = bookAuthorService.selectByExample(example);
vo
.
setAuthorList
(
baList
);
//
vo.setAuthorList(baList);
return
CallBack
.
success
(
vo
);
return
CallBack
.
success
(
vo
);
}
}
...
@@ -189,7 +170,7 @@ public class FgEbookController {
...
@@ -189,7 +170,7 @@ public class FgEbookController {
throw
new
BaseException
(
"参数不能为空!"
);
throw
new
BaseException
(
"参数不能为空!"
);
}
}
// 目录
// 目录
List
<
ChapterLibrary
>
chapterList
=
this
.
getDirectory
(
chapterName
,
bookId
);
List
<
ChapterLibrary
>
chapterList
=
this
.
getDirectory
(
chapterName
,
bookId
,
1
);
return
CallBack
.
success
(
chapterList
);
return
CallBack
.
success
(
chapterList
);
}
}
...
@@ -400,7 +381,7 @@ public class FgEbookController {
...
@@ -400,7 +381,7 @@ public class FgEbookController {
* @author ycw
* @author ycw
* @date: 2019年1月11日 上午9:30:06
* @date: 2019年1月11日 上午9:30:06
*/
*/
public
List
<
ChapterLibrary
>
getDirectory
(
String
chapterName
,
String
bookId
)
{
public
List
<
ChapterLibrary
>
getDirectory
(
String
chapterName
,
String
bookId
,
Integer
orderNum
)
{
if
(
StringUtils
.
isBlank
(
bookId
)){
if
(
StringUtils
.
isBlank
(
bookId
)){
throw
new
BaseException
(
"参数不能为空!"
);
throw
new
BaseException
(
"参数不能为空!"
);
}
}
...
@@ -411,7 +392,7 @@ public class FgEbookController {
...
@@ -411,7 +392,7 @@ public class FgEbookController {
List
<
ChapterLibrary
>
list
=
clservice
.
selectByExample
(
example
);
List
<
ChapterLibrary
>
list
=
clservice
.
selectByExample
(
example
);
return
list
;
return
list
;
}
else
{
}
else
{
example
.
createCriteria
().
andEqualTo
(
"bookId"
,
bookId
);
example
.
createCriteria
().
andEqualTo
(
"bookId"
,
bookId
)
.
andNotEqualTo
(
"orderNum"
,
orderNum
)
;
PageHelper
.
orderBy
(
" orderNum asc, pdfNum asc"
);
PageHelper
.
orderBy
(
" orderNum asc, pdfNum asc"
);
List
<
ChapterLibrary
>
list
=
clservice
.
selectByExample
(
example
);
List
<
ChapterLibrary
>
list
=
clservice
.
selectByExample
(
example
);
...
...
app/resource/src/main/java/com/zrqx/resource/fg/mapper/articlelibrary/FgChapterLibraryMapper.java
浏览文件 @
f8114c9f
...
@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Select;
...
@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Select;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.resource.commons.model.articlelibrary.ChapterLibrary
;
import
com.zrqx.resource.commons.model.articlelibrary.ChapterLibrary
;
import
com.zrqx.resource.commons.vo.fg.ebook.FgEbookChapterVO
;
import
feign.Param
;
import
feign.Param
;
/**
/**
...
@@ -13,4 +14,7 @@ public interface FgChapterLibraryMapper extends BaseMapper<ChapterLibrary> {
...
@@ -13,4 +14,7 @@ public interface FgChapterLibraryMapper extends BaseMapper<ChapterLibrary> {
@Select
(
"select max(orderNum) from res_chapter_library where bookid = #{bookid}"
)
@Select
(
"select max(orderNum) from res_chapter_library where bookid = #{bookid}"
)
Integer
selectMaxOrderNum
(
@Param
(
"bookid"
)
String
bookid
);
Integer
selectMaxOrderNum
(
@Param
(
"bookid"
)
String
bookid
);
@Select
(
"select * from res_chapter_library where bookid = #{bookid} and orderNum = #{orderNum}"
)
FgEbookChapterVO
selectchapter
(
@Param
(
"bookid"
)
String
bookid
,
@Param
(
"orderNum"
)
Integer
orderNum
);
}
}
app/resource/src/main/java/com/zrqx/resource/fg/service/ebook/FgEbookServiceImpl.java
浏览文件 @
f8114c9f
...
@@ -265,11 +265,6 @@ public class FgEbookServiceImpl extends BaseServiceImpl<Ebook, String> implement
...
@@ -265,11 +265,6 @@ public class FgEbookServiceImpl extends BaseServiceImpl<Ebook, String> implement
vo
.
setIsPdf
(
0
);
vo
.
setIsPdf
(
0
);
}
}
vo
.
setSynopsis
(
StringUtil
.
regEx
(
vo
.
getSynopsis
()));
vo
.
setSynopsis
(
StringUtil
.
regEx
(
vo
.
getSynopsis
()));
// 二维码
QrCode
qrCode
=
new
QrCode
();
qrCode
.
setResourceId
(
oid
);
qrCode
=
qrCodeMapper
.
selectOne
(
qrCode
);
vo
.
setQrCode
(
qrCode
.
getQrCode
());
if
(!
redis
.
isExistMember
())
{
if
(!
redis
.
isExistMember
())
{
// 未登录
// 未登录
vo
.
setIsCollection
(
Integer
.
parseInt
(
BooleanStatusEnum
.
NO
.
getCode
()));
vo
.
setIsCollection
(
Integer
.
parseInt
(
BooleanStatusEnum
.
NO
.
getCode
()));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论