书评bug

This commit is contained in:
wangjinlei
2024-02-02 11:12:18 +08:00
parent 413f63c67c
commit a6c2a9fd84
2 changed files with 10 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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);