书评bug
This commit is contained in:
@@ -12,6 +12,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.Query;
|
||||
import com.peanut.common.utils.ReadProvinceUtil;
|
||||
import com.peanut.modules.book.dao.BookDao;
|
||||
import com.peanut.modules.book.dao.BookForumArticlesDao;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.book.vo.BookIndexVo;
|
||||
@@ -67,6 +68,8 @@ public class BookController {
|
||||
private ShopProductToLabelService shopProductToLabelService;
|
||||
@Autowired
|
||||
private MedicaldesBookService medicaldesBookService;
|
||||
@Autowired
|
||||
private BookForumArticlesDao bookForumArticlesDao;
|
||||
final ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10);
|
||||
|
||||
/**
|
||||
@@ -745,6 +748,12 @@ public class BookController {
|
||||
}
|
||||
bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1);
|
||||
}
|
||||
for (BookEntity b:bookEntityPage.getRecords()){
|
||||
LambdaQueryWrapper<BookForumArticlesEntity> bookForumArticlesEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
bookForumArticlesEntityLambdaQueryWrapper.eq(BookForumArticlesEntity::getBookid,b.getId());
|
||||
Integer integer = bookForumArticlesDao.selectCount(bookForumArticlesEntityLambdaQueryWrapper);
|
||||
b.setForumNum(integer);
|
||||
}
|
||||
|
||||
return R.ok().put("page",bookEntityPage);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class BookForumArticlesServiceController {
|
||||
@RequestMapping("/getHasForumsAndBook")
|
||||
public R getHasForumsAndBook(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||
String ex_sql = "select 1 from user_ebook_buy where book.id = book_id and user_id = "+userId;
|
||||
String existSql = "select 1 from book_forum_articles where book.id = bookid";
|
||||
String existSql = "select 1 from book_forum_articles where del_flag=0 and book.id = bookid";
|
||||
|
||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookEntity::getDelFlag,0);
|
||||
|
||||
Reference in New Issue
Block a user