Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jgjk
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
任建宇
jgjk
Commits
23b471f5
提交
23b471f5
authored
10月 16, 2020
作者:
liupengfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
8501bf3e
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
57 行增加
和
50 行删除
+57
-50
ReadingRecord.java
...com/zrqx/resource/commons/model/record/ReadingRecord.java
+3
-1
FgBookShelfVo.java
...esource/commons/vo/fg/membercollection/FgBookShelfVo.java
+4
-0
FgArticleLibraryController.java
...controller/articlelibrary/FgArticleLibraryController.java
+6
-48
FgReadingRecordMapper.java
...zrqx/resource/fg/mapper/record/FgReadingRecordMapper.java
+11
-0
FgBookShelfServiceImpl.java
...e/fg/service/membercollection/FgBookShelfServiceImpl.java
+19
-0
FgReadingRecordService.java
...qx/resource/fg/service/record/FgReadingRecordService.java
+7
-0
FgReadingRecordServiceImpl.java
...esource/fg/service/record/FgReadingRecordServiceImpl.java
+7
-1
没有找到文件。
app/resource/src/main/java/com/zrqx/resource/commons/model/record/ReadingRecord.java
浏览文件 @
23b471f5
...
...
@@ -24,7 +24,9 @@ public class ReadingRecord {
@ApiModelProperty
(
value
=
"图书Id"
)
private
String
bookId
;
@ApiModelProperty
(
value
=
"文章id "
)
private
String
articeId
;
private
String
articleId
;
@ApiModelProperty
(
value
=
"章节排序"
)
private
Integer
orderNum
;
@ApiModelProperty
(
value
=
"用户id"
)
private
String
memberId
;
@ApiModelProperty
(
value
=
"创建时间"
)
...
...
app/resource/src/main/java/com/zrqx/resource/commons/vo/fg/membercollection/FgBookShelfVo.java
浏览文件 @
23b471f5
...
...
@@ -23,4 +23,8 @@ public class FgBookShelfVo {
private
String
cover
;
@ApiModelProperty
(
"加入书架时间"
)
private
Date
uploadTime
;
@ApiModelProperty
(
"阅读进度"
)
private
Integer
readingProgress
;
@ApiModelProperty
(
"文章id"
)
private
String
newAriticleId
;
}
app/resource/src/main/java/com/zrqx/resource/fg/controller/articlelibrary/FgArticleLibraryController.java
浏览文件 @
23b471f5
...
...
@@ -51,6 +51,7 @@ import com.zrqx.resource.fg.service.articlelibrary.FgChapterLibraryService;
import
com.zrqx.resource.fg.service.ebook.FgEbookService
;
import
com.zrqx.resource.fg.service.marketing.FgPromotionService
;
import
com.zrqx.resource.fg.service.organmemberrecord.FgOrganMemberRecordService
;
import
com.zrqx.resource.fg.service.record.FgReadingRecordService
;
import
com.zrqx.resource.fg.service.record.FgRecordService
;
import
io.swagger.annotations.Api
;
...
...
@@ -85,9 +86,9 @@ public class FgArticleLibraryController {
/** 促销*/
@Autowired
private
FgPromotionService
promotionService
;
/**
浏览
记录*/
/**
阅读
记录*/
@Autowired
private
FgRe
cordService
r
ecordService
;
private
FgRe
adingRecordService
readingR
ecordService
;
@Autowired
private
FgChapterLibraryService
chapterLibraryService
;
@Autowired
...
...
@@ -149,22 +150,10 @@ public class FgArticleLibraryController {
};
}
}
// 保存阅读记录
saveReadingRecord
(
vo
);
service
.
updateBrowseNum
(
oid
);
return
CallBack
.
success
(
vo
);
}
public
void
saveReadingRecord
(
FgArticleLibraryOneVO
vo
)
{
if
(
redis
.
isExistMember
())
{
ReadingRecord
readingRecord
=
new
ReadingRecord
();
readingRecord
.
setArticeId
(
vo
.
getId
());
readingRecord
.
setBookId
(
vo
.
getBookId
());
readingRecord
.
setMemberId
(
redis
.
getOpId
());
readingRecord
.
setUploadTime
(
new
Date
());
}
}
@ApiOperation
(
value
=
"目录页查询文章"
,
notes
=
"目录页查询文章"
)
@GetMapping
(
value
=
"/get"
)
public
CallBack
<
FgArticleLibraryOneVO
>
getByOne
(
FgDirectoryForm
form
)
{
...
...
@@ -216,41 +205,10 @@ public class FgArticleLibraryController {
}
articleLibraryOneVO
.
setVideo
(
null
);
articleLibraryOneVO
.
setAudio
(
null
);
//articleLibraryOneVO.setPdf(null);
}
//查看促销活动,修改成活动价格
/*FgPromotionInfoOneVO info = promotionService.getInfoByResId(articleLibraryOneVO.getId(), articleLibraryOneVO.getResourceType());
if(info != null){
articleLibraryOneVO.setPrice(info.getPrice().toString());
articleLibraryOneVO.setDiscount(info.getDiscountOrRealPrice().multiply(new BigDecimal(10)));
articleLibraryOneVO.setRealPrice(info.getRealPrice().toString());
}
if(StringUtils.isNotBlank(articleLibraryOneVO.getBookId())){
FgPromotionInfoOneVO bookInfo = promotionService.getInfoByResId(articleLibraryOneVO.getBookId(), AllResourceTypeEnum.BOOK.getCode());
if(bookInfo != null){
if(bookInfo.getPrice() != null){
articleLibraryOneVO.setBookPrice(bookInfo.getPrice().toString());
}
if(bookInfo.getDiscountOrRealPrice() != null){
articleLibraryOneVO.setBookDiscount(bookInfo.getDiscountOrRealPrice().toString());
}
if(bookInfo.getRealPrice() != null){
articleLibraryOneVO.setBookRealPrice(bookInfo.getRealPrice().toString());
}
}else{
Ebook ebook = ebookService.selectByPrimaryKey(articleLibraryOneVO.getBookId());
if(ebook != null){
if(ebook.getPrice() != null){
articleLibraryOneVO.setBookPrice(ebook.getPrice().toString());
}
if(ebook.getRealPrice() != null){
articleLibraryOneVO.setBookRealPrice(ebook.getRealPrice().toString());
}
};
}
}*/
// 保存浏览记录
//recordService.saveOrUpdateRecord(articleLibraryOneVO.getId(), articleLibraryOneVO.getGoodsType());
vo
.
setOrderNum
(
articleLibraryOneVO
.
getOrderNum
());
// 保存阅读记录
readingRecordService
.
saveOrUpdateRecord
(
vo
);
// 更新浏览量
service
.
updateBrowseNum
(
articleLibraryOneVO
.
getId
());
Integer
orderMaxNum
=
chapterLibraryService
.
selectMaxOrderNum
(
form
.
getBookId
());
...
...
app/resource/src/main/java/com/zrqx/resource/fg/mapper/record/FgReadingRecordMapper.java
浏览文件 @
23b471f5
package
com
.
zrqx
.
resource
.
fg
.
mapper
.
record
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.resource.commons.model.record.ReadingRecord
;
...
...
@@ -10,5 +13,13 @@ import com.zrqx.resource.commons.model.record.ReadingRecord;
*/
public
interface
FgReadingRecordMapper
extends
BaseMapper
<
ReadingRecord
>
{
/**
* 查询图书最新文章id
* @param resourceId
* @return
*/
@Select
(
"select * from res_reading_record where bookid = #{resourceId} order by uploadTime desc limit 1"
)
ReadingRecord
selectNewArticleId
(
@Param
(
"resourceId"
)
String
resourceId
);
}
app/resource/src/main/java/com/zrqx/resource/fg/service/membercollection/FgBookShelfServiceImpl.java
浏览文件 @
23b471f5
...
...
@@ -16,8 +16,11 @@ import com.zrqx.core.util.page.PageInfo;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.resource.commons.form.fg.membercollection.FgSaveOrCancelBookShelfForm
;
import
com.zrqx.resource.commons.model.membercollection.BookShelf
;
import
com.zrqx.resource.commons.model.record.ReadingRecord
;
import
com.zrqx.resource.commons.vo.fg.membercollection.FgBookShelfVo
;
import
com.zrqx.resource.fg.mapper.membercollection.FgBookShelfMapper
;
import
com.zrqx.resource.fg.service.articlelibrary.FgChapterLibraryService
;
import
com.zrqx.resource.fg.service.record.FgReadingRecordService
;
@Service
public
class
FgBookShelfServiceImpl
extends
BaseServiceImpl
<
BookShelf
,
Integer
>
implements
FgBookShelfService
{
...
...
@@ -26,6 +29,10 @@ public class FgBookShelfServiceImpl extends BaseServiceImpl<BookShelf, Integer>
private
FgBookShelfMapper
mapper
;
@Autowired
private
Redis
fgRedisManage
;
@Autowired
private
FgChapterLibraryService
chapterLibraryService
;
@Autowired
private
FgReadingRecordService
readingRecordService
;
@Override
public
BaseMapper
<
BookShelf
>
getMapper
()
{
...
...
@@ -69,6 +76,18 @@ public class FgBookShelfServiceImpl extends BaseServiceImpl<BookShelf, Integer>
}
startPage
(
pageParam
);
List
<
FgBookShelfVo
>
list
=
mapper
.
selectAboutEbook
(
name
,
memberId
);
list
.
forEach
(
f
->
{
Integer
readingProgress
=
0
;
Integer
maxOrderNum
=
chapterLibraryService
.
selectMaxOrderNum
(
f
.
getResourceId
());
if
(
maxOrderNum
!=
null
)
{
ReadingRecord
readingRecord
=
readingRecordService
.
selectNewArticleId
(
f
.
getResourceId
());
if
(
readingRecord
!=
null
)
{
f
.
setNewAriticleId
(
readingRecord
.
getArticleId
());
readingProgress
=
readingRecord
.
getOrderNum
()*
100
/
maxOrderNum
;
}
}
f
.
setReadingProgress
(
readingProgress
);
});
return
new
PageInfo
<
FgBookShelfVo
>(
list
);
}
}
app/resource/src/main/java/com/zrqx/resource/fg/service/record/FgReadingRecordService.java
浏览文件 @
23b471f5
...
...
@@ -16,4 +16,11 @@ public interface FgReadingRecordService extends BaseService<ReadingRecord, Integ
* @date: 2019年2月12日 下午3:02:55
*/
boolean
saveOrUpdateRecord
(
FgArticleLibraryOneVO
vo
);
/**
* 查询图书最新文章id
* @param resourceId
* @return
*/
ReadingRecord
selectNewArticleId
(
String
resourceId
);
}
app/resource/src/main/java/com/zrqx/resource/fg/service/record/FgReadingRecordServiceImpl.java
浏览文件 @
23b471f5
...
...
@@ -39,9 +39,10 @@ public class FgReadingRecordServiceImpl extends BaseServiceImpl<ReadingRecord, I
return
false
;
}
ReadingRecord
record
=
new
ReadingRecord
();
record
.
setArticeId
(
vo
.
getId
());
record
.
setArtic
l
eId
(
vo
.
getId
());
record
.
setMemberId
(
redis
.
getMember
().
getId
());
record
.
setBookId
(
vo
.
getBookId
());
record
.
setOrderNum
(
vo
.
getOrderNum
());
ReadingRecord
records
=
mapper
.
selectOne
(
record
);
if
(
records
!=
null
)
{
records
.
setUploadTime
(
new
Date
());
...
...
@@ -52,5 +53,10 @@ public class FgReadingRecordServiceImpl extends BaseServiceImpl<ReadingRecord, I
}
return
true
;
}
@Override
public
ReadingRecord
selectNewArticleId
(
String
resourceId
)
{
return
mapper
.
selectNewArticleId
(
resourceId
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论