diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b99da679..b4c2cb4a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,98 +2,35 @@ - - - - - - - - - - - - + + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + - - - - - - - - - + @@ -132,10 +69,19 @@ - + - - + + + + + + + + + + + @@ -143,41 +89,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + @@ -197,39 +122,40 @@ - Map<String,Object> - /book/book - list.add - PageUtils - PageUtils page = - 分页 - userebookbuy - getmy - list++++[] - 对应当天 - 鉴权 - /buylist - appBooksChapterContent - shopproduct - list - 未购买 - bookidsimages - 已购买 - myinfo - 评价 - ++++++++BookListeningEntity - appbooklist - userId - /appGetOrderInfo appGetOrderInfo for (String sout 图片 健康超市 appGetCategoryList + /punchcoments + punchcoments + clockin + queryBookInOther + book/task/list + nginx + 销量 + desccreatelist + 签到 + 我的 + bookForumArticlesServiceImpl + update + 打卡 + ossf + 您尚未签到 + oss + imageUrlPrefix + html + @RequiresPermissions + forum/articles + @RequiresPermissions + 生成器 + 9100 + 9200 + 9200 @@ -239,39 +165,6 @@ @@ -333,8 +259,8 @@ - @@ -347,6 +273,7 @@ + @@ -422,36 +349,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -461,13 +358,12 @@ - - + @@ -496,12 +392,11 @@ - - - - - - + + + + + @@ -520,11 +415,12 @@ - - - - - + + + + + + @@ -948,7 +844,11 @@ - + + + + + 1663124293206 @@ -1329,7 +1229,7 @@ - @@ -1341,7 +1241,7 @@ - + @@ -1351,10 +1251,10 @@ - + - + @@ -1372,13 +1272,13 @@ - + - + @@ -1401,10 +1301,10 @@ - + - + @@ -1420,15 +1320,15 @@ - - - + + + - + @@ -1538,6 +1438,12 @@ - + - - + + - + - - + + - + - - + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - + - - + + - + - - + + - + - - + + - + - - - - - - - + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/src/main/java/com/peanut/modules/book/controller/AuthorController.java b/src/main/java/com/peanut/modules/book/controller/AuthorController.java index 54ac4cef..c432fe71 100644 --- a/src/main/java/com/peanut/modules/book/controller/AuthorController.java +++ b/src/main/java/com/peanut/modules/book/controller/AuthorController.java @@ -38,7 +38,7 @@ public class AuthorController { * 列表 */ @RequestMapping("/list") - @RequiresPermissions("book:author:list") +// @RequiresPermissions("book:author:list") public R list(@RequestParam Map params){ PageUtils page = authorService.queryPage(params); @@ -67,7 +67,7 @@ public class AuthorController { * 信息 */ @RequestMapping("/info/{id}") - @RequiresPermissions("book:author:info") +// @RequiresPermissions("book:author:info") public R info(@PathVariable("id") Integer id){ AuthorEntity author = authorService.getById(id); return R.ok().put("author", author); @@ -95,7 +95,7 @@ public class AuthorController { * 保存 */ @RequestMapping("/save") - @RequiresPermissions("book:author:save") +// @RequiresPermissions("book:author:save") public R save(@RequestBody AuthorEntity author){ authorService.save(author); @@ -106,7 +106,7 @@ public class AuthorController { * 修改 */ @RequestMapping("/update") - @RequiresPermissions("book:author:update") +// @RequiresPermissions("book:author:update") public R update(@RequestBody AuthorEntity author){ authorService.updateById(author); @@ -117,7 +117,7 @@ public class AuthorController { * 删除 */ @RequestMapping("/delete") - @RequiresPermissions("book:author:delete") +// @RequiresPermissions("book:author:delete") public R delete(@RequestBody Integer[] ids){ authorService.removeByIds(Arrays.asList(ids)); diff --git a/src/main/java/com/peanut/modules/book/controller/BookController.java b/src/main/java/com/peanut/modules/book/controller/BookController.java index a466a788..f78decc6 100644 --- a/src/main/java/com/peanut/modules/book/controller/BookController.java +++ b/src/main/java/com/peanut/modules/book/controller/BookController.java @@ -184,7 +184,7 @@ public class BookController { * 保存 */ @RequestMapping("/save") - @RequiresPermissions("book:book:save") + public R save(@RequestBody BookEntity book) { bookService.save(book); @@ -196,7 +196,7 @@ public class BookController { * 修改 */ @RequestMapping("/update") - @RequiresPermissions("book:book:update") + public R update(@RequestBody BookEntity book) { bookService.updateById(book); @@ -207,7 +207,7 @@ public class BookController { * 删除 */ @RequestMapping("/delete") - @RequiresPermissions("book:book:delete") + public R delete(@RequestBody Integer[] ids) { bookService.removeByIds(Arrays.asList(ids)); diff --git a/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java b/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java index 5f24b395..b7d9da0f 100644 --- a/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java +++ b/src/main/java/com/peanut/modules/book/controller/BookForumArticlesServiceController.java @@ -1,15 +1,14 @@ package com.peanut.modules.book.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.peanut.common.utils.PageUtils; import com.peanut.common.utils.R; -import com.peanut.modules.book.entity.BookForumArticlesEntity; -import com.peanut.modules.book.entity.BookForumCommentEntity; -import com.peanut.modules.book.service.BookForumArticlesService; -import com.peanut.modules.book.service.BookForumCommenService; +import com.peanut.modules.book.entity.*; +import com.peanut.modules.book.service.*; +import com.peanut.modules.book.vo.BookForumArticlesVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Arrays; -import java.util.Date; -import java.util.Map; + +import java.util.*; @RestController @RequestMapping("forum/articles") @@ -18,6 +17,12 @@ public class BookForumArticlesServiceController { private BookForumArticlesService bookForumArticlesService; @Autowired private BookForumCommenService bookForumCommenService; + @Autowired + private BookService bookService; + @Autowired + private AuthorService authorService; + @Autowired + private PublisherService publisherService; /** * 列表 (开始时间倒叙) 后台get请求 @@ -34,13 +39,100 @@ public class BookForumArticlesServiceController { */ @RequestMapping("/descupdatelist") public R Descupdatelist(@RequestParam Map params){ + PageUtils page = bookForumArticlesService.queryPages(params); return R.ok().put("page", page); } + @RequestMapping("/desc/{page}") + public R Descupd(@RequestParam Map params,@PathVariable("page") Integer page){ + HashMap map = new HashMap<>(); + List list = new ArrayList<>(); + List newBookList_all = bookForumArticlesService.getBaseMapper().selectList(new QueryWrapper() + .orderByDesc("create_time")); + List newBookList = new ArrayList<>(); + int start = (page-1)*2; + int end = (page-1)*2+2; + if((page-1)*2 >= newBookList_all.size()){ + start = newBookList_all.size(); + } + if((page-1)*2+2 >= newBookList_all.size()){ + end = newBookList_all.size(); + } + newBookList = newBookList_all.subList(start,end); + for (BookForumArticlesEntity book : newBookList) { + String bookid = ""; + String publisherName = ""; + BookForumArticlesVO bookForumArticlesVO = new BookForumArticlesVO(); + String bookid1 = String.valueOf(book.getBookid()); + + String image = book.getImage(); + String content = book.getContent(); + String title = book.getTitle(); + Date createTime = book.getCreateTime(); + + String[] authorIds = bookid1.split(","); + List bookids = Arrays.asList(authorIds); + + List id = bookService.getBaseMapper().selectList(new QueryWrapper().in("id", bookids)); + + for (BookEntity bookentity : id) { + String authorName = ""; + String images = bookentity.getImages(); + String name = bookentity.getName(); + Integer id1 = bookentity.getId(); + + + String authorId = bookentity.getAuthorId(); + + String[] author = authorId.split(","); + List authorList = Arrays.asList(author); + List authorEntities = authorService.getBaseMapper().selectList(new QueryWrapper().in("id", authorList)); + + for (AuthorEntity authorEntity : authorEntities) { + authorName += "," + authorEntity.getAuthorName(); + } + + authorName = authorName.startsWith(",") ? authorName.substring(1) : authorName; + + String publisherId = bookentity.getPublisherId(); + String[] publisherIds = publisherId.split(","); + List publisherList = Arrays.asList(publisherIds); + List publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper().in("id", publisherList)); + + for (PublisherEntity publisherEntity : publisherEntities) { + publisherName += "," + publisherEntity.getPublisherName(); + } + publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName; + bookForumArticlesVO.setBookid(bookid1); + bookForumArticlesVO.setAuthorName(authorName); + bookForumArticlesVO.setPublisherName(publisherName); + bookForumArticlesVO.setBookName(name); + bookForumArticlesVO.setBookimage(images); + bookForumArticlesVO.setImage(image); + bookForumArticlesVO.setTitle(title); + bookForumArticlesVO.setContent(content); + bookForumArticlesVO.setCreate_time(createTime); + list.add(bookForumArticlesVO); + System.out.println(list); + + + + + + + } + + } + + + map.put("list",list); + + return R.ok().put("descupdatelist",map); + } /** @@ -61,6 +153,7 @@ public class BookForumArticlesServiceController { @RequestMapping("/appinfo/{id}") public R appinfo(@PathVariable("id") Integer id){ BookForumArticlesEntity forumArticles = bookForumArticlesService.getById(id); + return R.ok().put("BookForumArticlesEntity", forumArticles); } @@ -68,7 +161,7 @@ public class BookForumArticlesServiceController { /** - * 保存 + * 手动输入 */ @RequestMapping("/save") @@ -79,6 +172,46 @@ public class BookForumArticlesServiceController { return R.ok(); } + + + + +// /** +// * 列表 (修改时间倒叙) app页面 +// */ +// @RequestMapping("/importlist") +// public R importlist(@RequestParam Map params){ +// +// PageUtils page = bookForumArticlesService.importlistqueryPages(params); +// return R.ok().put("page", page); +// } + + + + + /** + * 导入 + */ + @RequestMapping("/importsave") + + public R importsave(@RequestBody BookForumArticlesEntity bookForumArticlesEntity){ + //读后感导入,,加用户id 头像, + bookForumArticlesEntity.setCreateTime(new Date()); + bookForumArticlesEntity.setDelflag(0); + + return R.ok(); + } + + + + + + + + + + + /** * 修改 */ diff --git a/src/main/java/com/peanut/modules/book/controller/BookForumCommentController.java b/src/main/java/com/peanut/modules/book/controller/BookForumCommentController.java index 990c9936..20698725 100644 --- a/src/main/java/com/peanut/modules/book/controller/BookForumCommentController.java +++ b/src/main/java/com/peanut/modules/book/controller/BookForumCommentController.java @@ -43,7 +43,6 @@ public class BookForumCommentController { @RequestMapping("/info/{id}") public R info(@PathVariable("id") Integer id){ BookForumCommentEntity forumCom = bookForumCommentService.getById(id); - return R.ok().put("BookForumCommentEntity", forumCom); } @@ -73,7 +72,7 @@ public class BookForumCommentController { /** - * 删除 + * 删除buy/record/All */ @RequestMapping("/delete") public R delete(@RequestBody Integer[] ids){ @@ -83,7 +82,15 @@ public class BookForumCommentController { + /** + * 列表 (后台书评导入列表) + */ + @GetMapping("/importlist") + public R importlist(@RequestParam Map params){ + PageUtils page = bookForumCommentService.importlistqueryPages(params); + return R.ok().put("page", page); + } diff --git a/src/main/java/com/peanut/modules/book/controller/MyUserController.java b/src/main/java/com/peanut/modules/book/controller/MyUserController.java index a6ce7b74..800eece8 100644 --- a/src/main/java/com/peanut/modules/book/controller/MyUserController.java +++ b/src/main/java/com/peanut/modules/book/controller/MyUserController.java @@ -561,21 +561,21 @@ public class MyUserController { } - - /** - * @Description: app微信登陆 - * @Author: z.hw - */ - @RequestMapping("/appUserAuthorLogin") -// @ApiOperation(value = "getUserInfoByAppCode", notes = "不分页", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) -// @ApiResponses(value = { -// @ApiResponse(code = 404, message = "Not Found"), -// @ApiResponse(code = 400, message = "No Name Provided"), -// }) - public R getUserInfoByApp(@Validated @RequestBody UserAppAuthorEntity userAppAuthorEntity) { - - return userService.getUserInfoByApp(userAppAuthorEntity); - } - +// +// /** +// * @Description: app微信登陆 +// * @Author: z.hw +// */ +// @RequestMapping("/appUserAuthorLogin") +//// @ApiOperation(value = "getUserInfoByAppCode", notes = "不分页", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) +//// @ApiResponses(value = { +//// @ApiResponse(code = 404, message = "Not Found"), +//// @ApiResponse(code = 400, message = "No Name Provided"), +//// }) +// public R getUserInfoByApp(@Validated @RequestBody UserAppAuthorEntity userAppAuthorEntity) { +// +// return userService.getUserInfoByApp(userAppAuthorEntity); +// } +// } diff --git a/src/main/java/com/peanut/modules/book/controller/PublisherController.java b/src/main/java/com/peanut/modules/book/controller/PublisherController.java index 44efe740..92b30cc3 100644 --- a/src/main/java/com/peanut/modules/book/controller/PublisherController.java +++ b/src/main/java/com/peanut/modules/book/controller/PublisherController.java @@ -39,7 +39,7 @@ public class PublisherController { * 列表 */ @RequestMapping("/list") - @RequiresPermissions("book:publisher:list") +// @RequiresPermissions("book:publisher:list") public R list(@RequestParam Map params){ PageUtils page = publisherService.queryPage(params); @@ -68,7 +68,7 @@ public class PublisherController { * 信息 */ @RequestMapping("/info/{id}") - @RequiresPermissions("book:publisher:info") +// @RequiresPermissions("book:publisher:info") public R info(@PathVariable("id") Integer id){ PublisherEntity publisher = publisherService.getById(id); @@ -99,7 +99,7 @@ public class PublisherController { * 保存 */ @RequestMapping("/save") - @RequiresPermissions("book:publisher:save") +// @RequiresPermissions("book:publisher:save") public R save(@RequestBody PublisherEntity publisher){ publisher.setDelFlag(0); publisherService.save(publisher); @@ -111,7 +111,7 @@ public class PublisherController { * 修改 */ @RequestMapping("/update") - @RequiresPermissions("book:publisher:update") +// @RequiresPermissions("book:publisher:update") public R update(@RequestBody PublisherEntity publisher){ publisherService.updateById(publisher); @@ -122,7 +122,7 @@ public class PublisherController { * 删除 */ @RequestMapping("/delete") - @RequiresPermissions("book:publisher:delete") +// @RequiresPermissions("book:publisher:delete") public R delete(@RequestBody Integer[] ids){ publisherService.removeByIds(Arrays.asList(ids)); diff --git a/src/main/java/com/peanut/modules/book/controller/ShopProductController.java b/src/main/java/com/peanut/modules/book/controller/ShopProductController.java index 79c58552..71809346 100644 --- a/src/main/java/com/peanut/modules/book/controller/ShopProductController.java +++ b/src/main/java/com/peanut/modules/book/controller/ShopProductController.java @@ -40,6 +40,27 @@ public class ShopProductController { private BuyOrderDetailService buyOrderDetailService; @Autowired private BookService bookService; + + // 商品销量 productSalesVolume + + + + + /** + * 精选商品 列表 + */ + @RequestMapping("/listproductSales") +// @RequiresPermissions("book:shopproduct:list") + public R listproductSales(@RequestParam Map params){ + PageUtils page = shopProductService.queryPageproductSales(params); + return R.ok().put("page", page); + + } + + + + + /** * 列表 */ diff --git a/src/main/java/com/peanut/modules/book/entity/BookClockinCommentEntity.java b/src/main/java/com/peanut/modules/book/entity/BookClockinCommentEntity.java index ee2cedec..11625c39 100644 --- a/src/main/java/com/peanut/modules/book/entity/BookClockinCommentEntity.java +++ b/src/main/java/com/peanut/modules/book/entity/BookClockinCommentEntity.java @@ -7,6 +7,12 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; + +/** + * 打卡评论追评表 + * + */ + @Data @TableName("book_clockin_comment") public class BookClockinCommentEntity implements Serializable { diff --git a/src/main/java/com/peanut/modules/book/entity/BookClockinEntity.java b/src/main/java/com/peanut/modules/book/entity/BookClockinEntity.java index 2d554905..5acbf7f3 100644 --- a/src/main/java/com/peanut/modules/book/entity/BookClockinEntity.java +++ b/src/main/java/com/peanut/modules/book/entity/BookClockinEntity.java @@ -9,7 +9,7 @@ import java.util.Date; /** * - * 打卡表 + * 打卡评论表 * @author * @email * @date diff --git a/src/main/java/com/peanut/modules/book/entity/BookClockinPunchEntity.java b/src/main/java/com/peanut/modules/book/entity/BookClockinPunchEntity.java index 1778a753..a32a50a5 100644 --- a/src/main/java/com/peanut/modules/book/entity/BookClockinPunchEntity.java +++ b/src/main/java/com/peanut/modules/book/entity/BookClockinPunchEntity.java @@ -5,7 +5,7 @@ import java.io.Serializable; import java.util.Date; /** - * 签到 + * 签到表 */ @Data @TableName("book_clockin_punch") diff --git a/src/main/java/com/peanut/modules/book/entity/BookForumArticlesEntity.java b/src/main/java/com/peanut/modules/book/entity/BookForumArticlesEntity.java index 60e23701..e42f029f 100644 --- a/src/main/java/com/peanut/modules/book/entity/BookForumArticlesEntity.java +++ b/src/main/java/com/peanut/modules/book/entity/BookForumArticlesEntity.java @@ -68,4 +68,14 @@ public class BookForumArticlesEntity { @TableField("del_flag") @TableLogic private Integer delflag; + + + + @TableField("author") + private String author; + + @TableField("publishername") + private String publishername; + + } diff --git a/src/main/java/com/peanut/modules/book/entity/BookForumCommentEntity.java b/src/main/java/com/peanut/modules/book/entity/BookForumCommentEntity.java index 7b4bca6d..cf1613b8 100644 --- a/src/main/java/com/peanut/modules/book/entity/BookForumCommentEntity.java +++ b/src/main/java/com/peanut/modules/book/entity/BookForumCommentEntity.java @@ -14,9 +14,7 @@ import java.util.Date; @TableName("book_forum_comment") public class BookForumCommentEntity { -/** - * id bfa_id userid content images create_time update_time - */ + /** * id */ diff --git a/src/main/java/com/peanut/modules/book/entity/BookTaskEntity.java b/src/main/java/com/peanut/modules/book/entity/BookTaskEntity.java index 84b791e3..21055c7b 100644 --- a/src/main/java/com/peanut/modules/book/entity/BookTaskEntity.java +++ b/src/main/java/com/peanut/modules/book/entity/BookTaskEntity.java @@ -11,7 +11,7 @@ import java.math.BigDecimal; import java.util.Date; /** - * 签到列表内容 + * 发布打卡内容表 * */ @Data diff --git a/src/main/java/com/peanut/modules/book/service/BookForumArticlesService.java b/src/main/java/com/peanut/modules/book/service/BookForumArticlesService.java index ec304bb3..7ec28978 100644 --- a/src/main/java/com/peanut/modules/book/service/BookForumArticlesService.java +++ b/src/main/java/com/peanut/modules/book/service/BookForumArticlesService.java @@ -10,4 +10,7 @@ public interface BookForumArticlesService extends IService params); PageUtils queryPages(Map params); + + + } diff --git a/src/main/java/com/peanut/modules/book/service/BookForumCommenService.java b/src/main/java/com/peanut/modules/book/service/BookForumCommenService.java index e59a9ff6..81d77786 100644 --- a/src/main/java/com/peanut/modules/book/service/BookForumCommenService.java +++ b/src/main/java/com/peanut/modules/book/service/BookForumCommenService.java @@ -8,4 +8,6 @@ import java.util.Map; public interface BookForumCommenService extends IService { PageUtils queryPage(Map params); + + PageUtils importlistqueryPages(Map params); } diff --git a/src/main/java/com/peanut/modules/book/service/ShopProductService.java b/src/main/java/com/peanut/modules/book/service/ShopProductService.java index 9181b068..b9dfd389 100644 --- a/src/main/java/com/peanut/modules/book/service/ShopProductService.java +++ b/src/main/java/com/peanut/modules/book/service/ShopProductService.java @@ -27,5 +27,7 @@ public interface ShopProductService extends IService { PageUtils getNewBook(Map params); PageUtils selectListqueryPage(Map params); + + PageUtils queryPageproductSales(Map params); } diff --git a/src/main/java/com/peanut/modules/book/service/impl/BookForumArticlesServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/BookForumArticlesServiceImpl.java index d70dbfe8..9237a18f 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/BookForumArticlesServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/BookForumArticlesServiceImpl.java @@ -6,10 +6,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.peanut.common.utils.PageUtils; import com.peanut.common.utils.Query; import com.peanut.modules.book.dao.BookForumArticlesDao; +import com.peanut.modules.book.entity.AuthorEntity; +import com.peanut.modules.book.entity.BookEntity; import com.peanut.modules.book.entity.BookForumArticlesEntity; +import com.peanut.modules.book.entity.PublisherEntity; +import com.peanut.modules.book.service.AuthorService; import com.peanut.modules.book.service.BookForumArticlesService; +import com.peanut.modules.book.service.BookService; +import com.peanut.modules.book.service.PublisherService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Arrays; +import java.util.List; import java.util.Map; @Service @@ -26,17 +35,27 @@ public class BookForumArticlesServiceImpl extends ServiceImpl params) { String bookid = (String) params.get("bookid"); + IPage page = this.page( new Query().getPage(params), new QueryWrapper().eq("bookid",bookid) + + ); return new PageUtils(page); } + + } diff --git a/src/main/java/com/peanut/modules/book/service/impl/BookForumCommenServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/BookForumCommenServiceImpl.java index b0538725..e5b5a4ac 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/BookForumCommenServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/BookForumCommenServiceImpl.java @@ -28,4 +28,15 @@ public class BookForumCommenServiceImpl extends ServiceImpl params) { + Object b = params.get("bfid"); + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper().eq("bfa_id",b).orderByDesc("create_time") + ); + + return new PageUtils(page); + } } diff --git a/src/main/java/com/peanut/modules/book/service/impl/BookServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/BookServiceImpl.java index 3e045749..c7277ef5 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/BookServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/BookServiceImpl.java @@ -8,9 +8,7 @@ import com.google.common.base.Joiner; import com.peanut.common.utils.*; import com.peanut.modules.book.entity.*; import com.peanut.modules.book.entity.SysDictDataEntity; -import com.peanut.modules.book.service.BookChapterContentService; -import com.peanut.modules.book.service.BookChapterService; -import com.peanut.modules.book.service.PublisherService; +import com.peanut.modules.book.service.*; import com.peanut.modules.book.vo.BookIndexVo; import com.peanut.modules.sys.service.SysDictDataService; import com.spire.doc.Document; @@ -35,7 +33,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.peanut.modules.book.dao.BookDao; -import com.peanut.modules.book.service.BookService; import org.springframework.util.CollectionUtils; @@ -52,6 +49,8 @@ public class BookServiceImpl extends ServiceImpl implements private BookChapterService bookChapterService; @Autowired ConstantPropertiesUtils constantPropertiesUtils; + @Autowired + private BookForumArticlesService bookForumArticlesService; @@ -108,6 +107,8 @@ public class BookServiceImpl extends ServiceImpl implements String[] split = type.split(","); + + for (String tp : split) { SysDictDataEntity dict = sysDictDataService.getBaseMapper().selectOne(new QueryWrapper() .eq("dict_type", tp).eq("dict_label", "book_type")); @@ -659,7 +660,9 @@ public class BookServiceImpl extends ServiceImpl implements return false; } - } + + +} diff --git a/src/main/java/com/peanut/modules/book/service/impl/ShopProductServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/ShopProductServiceImpl.java index a5f64c10..38e751d1 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/ShopProductServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/ShopProductServiceImpl.java @@ -65,5 +65,15 @@ public class ShopProductServiceImpl extends ServiceImpl params) { + + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper().orderByDesc("sum_sales") + ); + System.out.println("page"+page); + return new PageUtils(page); + } } \ No newline at end of file diff --git a/src/main/java/com/peanut/modules/oss/controller/OssController.java b/src/main/java/com/peanut/modules/oss/controller/OssController.java index 6eb7eb25..8b5b9a16 100644 --- a/src/main/java/com/peanut/modules/oss/controller/OssController.java +++ b/src/main/java/com/peanut/modules/oss/controller/OssController.java @@ -25,6 +25,7 @@ public class OssController { @PostMapping @ApiOperation("上传") public R uploadOssFile(MultipartFile file) { + //获取上传文件 MultipartFile //返回上传到oss的路径 String url = ossService.uploadFileAvatar(file); diff --git a/src/main/java/com/peanut/modules/oss/service/impl/OssServiceImpl.java b/src/main/java/com/peanut/modules/oss/service/impl/OssServiceImpl.java index 8dbf1276..61c4ea1c 100644 --- a/src/main/java/com/peanut/modules/oss/service/impl/OssServiceImpl.java +++ b/src/main/java/com/peanut/modules/oss/service/impl/OssServiceImpl.java @@ -27,6 +27,7 @@ public class OssServiceImpl implements OssService { // 创建OSS实例。 OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret); + //获取上传文件输入流 InputStream inputStream = file.getInputStream(); //获取文件名称 diff --git a/src/main/java/com/peanut/modules/sys/controller/SysRoleController.java b/src/main/java/com/peanut/modules/sys/controller/SysRoleController.java index 0994d4a8..b7afbe74 100644 --- a/src/main/java/com/peanut/modules/sys/controller/SysRoleController.java +++ b/src/main/java/com/peanut/modules/sys/controller/SysRoleController.java @@ -44,7 +44,7 @@ public class SysRoleController extends AbstractController { * 角色列表 */ @GetMapping("/list") - @RequiresPermissions("sys:role:list") +// @RequiresPermissions("sys:role:list") public R list(@RequestParam Map params){ //如果不是超级管理员,则只查询自己创建的角色列表 // if(getUserId() != Constant.SUPER_ADMIN){ @@ -65,7 +65,7 @@ public class SysRoleController extends AbstractController { * 角色列表 */ @GetMapping("/select") - @RequiresPermissions("sys:role:select") +// @RequiresPermissions("sys:role:select") public R select(){ Map map = new HashMap<>(); @@ -88,7 +88,7 @@ public class SysRoleController extends AbstractController { * 角色信息 */ @GetMapping("/info/{roleId}") - @RequiresPermissions("sys:role:info") +// @RequiresPermissions("sys:role:info") public R info(@PathVariable("roleId") Long roleId){ SysRoleEntity role = sysRoleService.getById(roleId); @@ -104,7 +104,7 @@ public class SysRoleController extends AbstractController { */ @SysLog("保存角色") @PostMapping("/save") - @RequiresPermissions("sys:role:save") +// @RequiresPermissions("sys:role:save") public R save(@RequestBody SysRoleEntity role){ ValidatorUtils.validateEntity(role); @@ -119,7 +119,7 @@ public class SysRoleController extends AbstractController { */ @SysLog("修改角色") @PostMapping("/update") - @RequiresPermissions("sys:role:update") +// @RequiresPermissions("sys:role:update") public R update(@RequestBody SysRoleEntity role){ ValidatorUtils.validateEntity(role); @@ -134,7 +134,7 @@ public class SysRoleController extends AbstractController { */ @SysLog("删除角色") @PostMapping("/delete") - @RequiresPermissions("sys:role:delete") +// @RequiresPermissions("sys:role:delete") public R delete(@RequestBody Long[] roleIds){ sysRoleService.deleteBatch(roleIds); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index dd10e53b..d4efc149 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,8 +3,8 @@ spring: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver -# url: jdbc:mysql://82.157.238.238:3309/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai - url: jdbc:mysql://59.110.212.44:3306/book_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true + url: jdbc:mysql://59.110.212.44:3306/e_book_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true +# url: jdbc:mysql://59.110.212.44:3306/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true username: root password: HSXY1234hsxy initial-size: 10 diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index b73c3437..92528431 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -3,7 +3,8 @@ spring: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://59.110.212.44:3306/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai +# url: jdbc:mysql://59.110.212.44:3306/e_book?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + url: jdbc:mysql://59.110.212.44:3306/e_book_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai username: root password: HSXY1234hsxy initial-size: 10 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3971fbcb..78a15bb6 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -4,7 +4,7 @@ server: uri-encoding: UTF-8 max-threads: 1000 min-spare-threads: 30 - port: 9100 + port: 9200 servlet: context-path: /pb diff --git a/src/main/resources/mapper/book/BookForumArticlesDao.xml b/src/main/resources/mapper/book/BookForumArticlesDao.xml index 047eba07..ac425e59 100644 --- a/src/main/resources/mapper/book/BookForumArticlesDao.xml +++ b/src/main/resources/mapper/book/BookForumArticlesDao.xml @@ -16,6 +16,9 @@ + + +