|
@@ -269,7 +269,7 @@ public class BookServiceImpl implements BookService {
|
|
if (freeChapterNum == null) { //查看默认配置
|
|
if (freeChapterNum == null) { //查看默认配置
|
|
freeChapterNum = getDefaultFreeChapterNum();
|
|
freeChapterNum = getDefaultFreeChapterNum();
|
|
}
|
|
}
|
|
- if (bookContentVO.getNum() >= freeChapterNum) {
|
|
|
|
|
|
+ if (bookContentVO.getNum() >= freeChapterNum) {
|
|
//收费
|
|
//收费
|
|
//是否已购买
|
|
//是否已购买
|
|
Consume consume = consumeMapper.selectOneByExample(ConsumeExample.newAndCreateCriteria()
|
|
Consume consume = consumeMapper.selectOneByExample(ConsumeExample.newAndCreateCriteria()
|
|
@@ -499,8 +499,11 @@ public class BookServiceImpl implements BookService {
|
|
for (UserRecentlyRead userRecentlyRead : userRecentlyReads) {
|
|
for (UserRecentlyRead userRecentlyRead : userRecentlyReads) {
|
|
UserRecentlyReadRes recentlyReadRes = new UserRecentlyReadRes();
|
|
UserRecentlyReadRes recentlyReadRes = new UserRecentlyReadRes();
|
|
BeanUtils.copyProperties(userRecentlyRead, recentlyReadRes);
|
|
BeanUtils.copyProperties(userRecentlyRead, recentlyReadRes);
|
|
- recentlyReadRes.setBookName(map.get(userRecentlyRead.getBookId()).getName());
|
|
|
|
- recentlyReadRes.setImage(map.get(userRecentlyRead.getBookId()).getImage());
|
|
|
|
|
|
+ Book book = map.get(userRecentlyRead.getBookId());
|
|
|
|
+ if (book != null) {
|
|
|
|
+ recentlyReadRes.setBookName(book.getName());
|
|
|
|
+ recentlyReadRes.setImage(book.getImage());
|
|
|
|
+ }
|
|
res.add(recentlyReadRes);
|
|
res.add(recentlyReadRes);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -825,6 +828,11 @@ public class BookServiceImpl implements BookService {
|
|
.andBookIdEqualTo(id)
|
|
.andBookIdEqualTo(id)
|
|
.example()
|
|
.example()
|
|
);
|
|
);
|
|
|
|
+ userRecentlyReadMapper.deleteByExample(
|
|
|
|
+ UserRecentlyReadExample.newAndCreateCriteria()
|
|
|
|
+ .andBookIdEqualTo(id)
|
|
|
|
+ .example()
|
|
|
|
+ );
|
|
return 1;
|
|
return 1;
|
|
} else {
|
|
} else {
|
|
return 0;
|
|
return 0;
|