first commit
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("book/activity")
|
||||
public class ActivityController {
|
||||
|
||||
@Autowired
|
||||
private ActivityService activityService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
|
||||
PageUtils page = activityService.queryPage(params);
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
ActivityEntity activity = activityService.getById(id);
|
||||
return R.ok().put("activity", activity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@Transactional
|
||||
public R save(@RequestBody ActivityEntity activity){
|
||||
activity.setDelFlag(0);
|
||||
activityService.save(activity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody ActivityEntity activity){
|
||||
activityService.updateById(activity);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Integer[] orderIds){
|
||||
activityService.removeByIds(Arrays.asList(orderIds));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.AuthorEntity;
|
||||
import com.peanut.modules.book.service.AuthorService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 作者表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/author")
|
||||
public class AuthorController {
|
||||
@Autowired
|
||||
private AuthorService authorService;
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
@RequiresPermissions("book:author:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = authorService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/bookAuthorList")
|
||||
// @RequiresPermissions("book:author:list")
|
||||
public R bookAuthorList(){
|
||||
List<AuthorEntity> authorEntities = authorService.getBaseMapper().selectList(new QueryWrapper<AuthorEntity>());
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
for (AuthorEntity authorEntity : authorEntities) {
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("id",authorEntity.getId());
|
||||
map.put("value",authorEntity.getAuthorName());
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
return R.ok().put("list",list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
@RequiresPermissions("book:author:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
AuthorEntity author = authorService.getById(id);
|
||||
return R.ok().put("author", author);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/appGetInfo/{id}/{limit}/{page}")
|
||||
// @RequiresPermissions("book:author:info")
|
||||
public R appGetInfo(@PathVariable("id") Integer id,
|
||||
@PathVariable("limit") String limit,
|
||||
@PathVariable("page") String page){
|
||||
AuthorEntity author = authorService.getById(id);
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("authorName",author.getAuthorName());
|
||||
map.put("limit",limit);
|
||||
map.put("page",page);
|
||||
PageUtils pageUtils = bookService.queryPage(map);
|
||||
return R.ok().put("authorInfo", author).put("authorBooks",pageUtils);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequiresPermissions("book:author:save")
|
||||
public R save(@RequestBody AuthorEntity author){
|
||||
authorService.save(author);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("book:author:update")
|
||||
public R update(@RequestBody AuthorEntity author){
|
||||
authorService.updateById(author);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
@RequiresPermissions("book:author:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
authorService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.BookShelfEntity;
|
||||
import com.peanut.modules.book.service.BookShelfService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookBrowseRecordsEntity;
|
||||
import com.peanut.modules.book.service.BookBrowseRecordsService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/bookbrowserecords")
|
||||
public class BookBrowseRecordsController {
|
||||
@Autowired
|
||||
private BookBrowseRecordsService bookBrowseRecordsService;
|
||||
@Autowired
|
||||
private BookShelfService bookShelfService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:bookbrowserecords: list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = bookBrowseRecordsService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:bookbrowserecords:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
BookBrowseRecordsEntity bookBrowseRecords = bookBrowseRecordsService.getById(id);
|
||||
|
||||
return R.ok().put("bookBrowseRecords", bookBrowseRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:bookbrowserecords:save")
|
||||
public R save(@RequestBody BookBrowseRecordsEntity bookBrowseRecords){
|
||||
|
||||
Integer bookId = bookBrowseRecords.getBookId();
|
||||
Integer userId = bookBrowseRecords.getUserId();
|
||||
|
||||
BookBrowseRecordsEntity bookBrowseRecordsEntity = bookBrowseRecordsService.getBaseMapper().selectOne(new QueryWrapper<BookBrowseRecordsEntity>().eq("user_id", userId)
|
||||
.eq("book_id", bookId));
|
||||
if (bookBrowseRecordsEntity != null){
|
||||
return R.ok().put("browseRecordsId",bookBrowseRecordsEntity.getId());
|
||||
}
|
||||
|
||||
bookBrowseRecordsService.save(bookBrowseRecords);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:bookbrowserecords:update")
|
||||
public R update(@RequestBody BookBrowseRecordsEntity bookBrowseRecords){
|
||||
bookBrowseRecordsService.updateById(bookBrowseRecords);
|
||||
Integer userId = bookBrowseRecords.getUserId();
|
||||
Integer bookId = bookBrowseRecords.getBookId();
|
||||
BookShelfEntity one = bookShelfService.getOne(new QueryWrapper<BookShelfEntity>().eq("user_id", userId).eq("book_id", bookId));
|
||||
if (one != null) {
|
||||
bookShelfService.updateById(one);
|
||||
}
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:bookbrowserecords:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
bookBrowseRecordsService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/userList")
|
||||
// @RequiresPermissions("book:bookbrowserecords:list")
|
||||
public R userList(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = bookBrowseRecordsService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookBuyConfigEntity;
|
||||
import com.peanut.modules.book.service.BookBuyConfigService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-17 14:54:08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/bookbuyconfig")
|
||||
public class BookBuyConfigController {
|
||||
@Autowired
|
||||
private BookBuyConfigService bookBuyConfigService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
@RequiresPermissions("book:bookbuyconfig:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = bookBuyConfigService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{priceTypeId}")
|
||||
@RequiresPermissions("book:bookbuyconfig:info")
|
||||
public R info(@PathVariable("priceTypeId") Integer priceTypeId){
|
||||
BookBuyConfigEntity bookBuyConfig = bookBuyConfigService.getById(priceTypeId);
|
||||
|
||||
return R.ok().put("bookBuyConfig", bookBuyConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequiresPermissions("book:bookbuyconfig:save")
|
||||
public R save(@RequestBody BookBuyConfigEntity bookBuyConfig){
|
||||
bookBuyConfigService.save(bookBuyConfig);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("book:bookbuyconfig:update")
|
||||
public R update(@RequestBody BookBuyConfigEntity bookBuyConfig){
|
||||
bookBuyConfigService.updateById(bookBuyConfig);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
@RequiresPermissions("book:bookbuyconfig:delete")
|
||||
public R delete(@RequestBody Integer[] priceTypeIds){
|
||||
bookBuyConfigService.removeByIds(Arrays.asList(priceTypeIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取VIP 金额 或者充值类型
|
||||
*/
|
||||
@RequestMapping("/getVipOrPoint")
|
||||
public R getVipOrPoint(@RequestParam("type") String type,@RequestParam("qudao") String qudao){
|
||||
List<BookBuyConfigEntity> bookBuyConfigEntities = bookBuyConfigService.getBaseMapper().selectList(new QueryWrapper<BookBuyConfigEntity>().eq("type",type).eq("qudao",qudao));
|
||||
|
||||
return R.ok().put("list",bookBuyConfigEntities);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,305 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.BaiduVoicesUtils;
|
||||
import com.peanut.modules.book.entity.BookChapterEntity;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.book.service.BookChapterService;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import com.peanut.modules.book.service.MyUserService;
|
||||
import com.peanut.modules.oss.service.OssService;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookChapterContentEntity;
|
||||
import com.peanut.modules.book.service.BookChapterContentService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-16 14:32:06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/bookchaptercontent")
|
||||
public class BookChapterContentController {
|
||||
@Autowired
|
||||
private BookChapterContentService bookChapterContentService;
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
@Autowired
|
||||
private OssService ossService;
|
||||
@Autowired
|
||||
private BookChapterService bookChapterService;
|
||||
@Autowired
|
||||
private MyUserService myUserService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:bookchaptercontent:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = bookChapterContentService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:bookchaptercontent:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
BookChapterContentEntity bookChapterContent = bookChapterContentService.getById(id);
|
||||
|
||||
return R.ok().put("bookChapterContent", bookChapterContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:bookchaptercontent:save")
|
||||
public R save(@RequestBody BookChapterContentEntity bookChapterContent){
|
||||
bookChapterContentService.save(bookChapterContent);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:bookchaptercontent:update")
|
||||
public R update(@RequestBody BookChapterContentEntity bookChapterContent){
|
||||
bookChapterContentService.updateById(bookChapterContent);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:bookchaptercontent:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
bookChapterContentService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 章节拆分转换单句
|
||||
*/
|
||||
@RequestMapping("/getBookVoices")
|
||||
// @RequiresPermissions("book:bookchaptercontent:delete")
|
||||
public R getBookVoices(@RequestParam("id") Integer id){
|
||||
|
||||
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
|
||||
singleThreadExecutor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// bookChapterContentService.getBookVoices(id);
|
||||
bookChapterContentService.getWordChapterParagraph(14);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
BookEntity bookEntity = bookService.getBaseMapper().selectById(id);
|
||||
bookEntity.setContentStatus("1");
|
||||
bookService.updateById(bookEntity);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 章节单句 转成音频
|
||||
*/
|
||||
@RequestMapping("/signVoices")
|
||||
public R signVoices(@RequestParam("content") String content) throws Exception {
|
||||
|
||||
String voices = BaiduVoicesUtils.run(content);
|
||||
|
||||
File file = new File(voices);
|
||||
if (!file.exists()) {
|
||||
return R.error("语音文件未生成");
|
||||
}
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
|
||||
|
||||
MultipartFile multipartFile =new MockMultipartFile("file", file.getName(), "text/plain", IOUtils.toByteArray(fileInputStream));
|
||||
|
||||
String path = ossService.uploadFileAvatar(multipartFile);
|
||||
|
||||
fileInputStream.close();
|
||||
|
||||
file.delete();
|
||||
|
||||
if (StringUtils.isEmpty(path)){
|
||||
return R.error("语音上传失败");
|
||||
}
|
||||
|
||||
return R.ok().put("voices",path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 全部章节单句 转成音频
|
||||
*/
|
||||
@RequestMapping("/allVoices")
|
||||
public R allVoices(@RequestParam("id") Integer id) throws Exception {
|
||||
|
||||
BookEntity bookEntity = bookService.getBaseMapper().selectById(id);
|
||||
|
||||
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
|
||||
singleThreadExecutor.execute(new Runnable() {
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public void run() {
|
||||
BookEntity bookEntity = bookService.getBaseMapper().selectById(id);
|
||||
List<BookChapterContentEntity> book_id = bookChapterContentService.getBaseMapper().selectList(new QueryWrapper<BookChapterContentEntity>()
|
||||
.eq("book_id", id));
|
||||
|
||||
for (BookChapterContentEntity bookContent:book_id) {
|
||||
String content = bookContent.getContent();
|
||||
|
||||
String voices = BaiduVoicesUtils.run(content);
|
||||
|
||||
File file = new File(voices);
|
||||
if (!file.exists()) {
|
||||
bookEntity.setVoicesStatus("3");
|
||||
}
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
|
||||
|
||||
MultipartFile multipartFile =new MockMultipartFile("file", file.getName(), "text/plain", IOUtils.toByteArray(fileInputStream));
|
||||
|
||||
String path = ossService.uploadFileAvatar(multipartFile);
|
||||
|
||||
bookContent.setVoices(path);
|
||||
|
||||
fileInputStream.close();
|
||||
|
||||
file.delete();
|
||||
|
||||
bookChapterContentService.updateById(bookContent);
|
||||
if (StringUtils.isEmpty(path)){
|
||||
bookEntity.setVoicesStatus("3");
|
||||
}
|
||||
}
|
||||
bookEntity.setVoicesStatus("2");
|
||||
bookService.updateById(bookEntity);
|
||||
}
|
||||
});
|
||||
bookEntity.setVoicesStatus("1");
|
||||
bookService.updateById(bookEntity);
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* app 获取电子书章节内容
|
||||
*/
|
||||
@RequestMapping("/appGetBookChapterContent")
|
||||
public R getBookCatalogue(@RequestParam("chapterid") Integer chapterid,
|
||||
@RequestParam("bookid") Integer bookid,
|
||||
@RequestParam("userId") Integer userId){
|
||||
|
||||
// TODO 验证 当前请求的书 是否存在免费章节数
|
||||
|
||||
BookEntity bookEntity = bookService.getBaseMapper().selectById(bookid);
|
||||
Integer freeChapterCount = bookEntity.getFreeChapterCount();
|
||||
Integer isVip = bookEntity.getIsVip(); // 0-免费 1-会免 2-付费
|
||||
|
||||
BookChapterEntity bookChapterEntity = bookChapterService.getBaseMapper().selectById(chapterid);
|
||||
Integer number = bookChapterEntity.getNumber();
|
||||
|
||||
if ((number > freeChapterCount) || freeChapterCount ==0){ // 阅读章节数 大于 免费章节数
|
||||
|
||||
// 书籍为 会免
|
||||
|
||||
if (isVip == 1) {
|
||||
//查询用户身份
|
||||
MyUserEntity user = myUserService.getById(userId);
|
||||
String vip = user.getVip();
|
||||
if (!"1".equals(vip)) {
|
||||
return R.error(500,"当前书籍为会员书籍,请开通会员或购买!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (isVip == 2) {
|
||||
// 鉴权 查询权限表中 用户是否开通
|
||||
boolean b = myUserService.bookAuthenticate(bookid, userId);
|
||||
|
||||
if (!b) {
|
||||
return R.error(500,"请开通会员或购买此书籍!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
|
||||
|
||||
List<BookChapterContentEntity> bookChapterContentEntities = bookChapterContentService.getBaseMapper().selectList(new QueryWrapper<BookChapterContentEntity>()
|
||||
.eq("book_id",bookid)
|
||||
.eq("book_chatper_id",chapterid));
|
||||
for (BookChapterContentEntity bookChapterContentEntity : bookChapterContentEntities) {
|
||||
|
||||
String content = bookChapterContentEntity.getContent();
|
||||
|
||||
String substring = "";
|
||||
if (bookChapterContentEntity.getOtherContent() != null){
|
||||
// substring = bookChapterContentEntity.getOtherContent().substring(3, bookChapterContentEntity.getOtherContent().length() - 3);
|
||||
substring = bookChapterContentEntity.getOtherContent().replace("<p>","").replace("</p>","");
|
||||
}
|
||||
StringBuffer stringBuffer = new StringBuffer(substring);
|
||||
if(stringBuffer.indexOf("title") != -1){
|
||||
stringBuffer.insert(stringBuffer.indexOf("title"),"width=\"100%\"");
|
||||
}
|
||||
if (bookChapterContentEntity.getNumber() == 1){
|
||||
Integer bookChatperId = bookChapterContentEntity.getBookChatperId();
|
||||
BookChapterEntity chapterEntity = bookChapterService.getById(bookChatperId);
|
||||
String chapter = chapterEntity.getChapter();
|
||||
content = bookChapterContentEntity.getContent().replace(chapter, "");
|
||||
}
|
||||
// System.out.println(content.length());
|
||||
// System.out.println(content.replaceAll("[\\\\s\\\\u00A0]",""));
|
||||
bookChapterContentEntity.setPicAndWord(content.replaceAll(" ","") + stringBuffer);
|
||||
list.add(bookChapterContentEntity);
|
||||
}
|
||||
|
||||
return R.ok().put("bookCatalogue",list);
|
||||
}
|
||||
|
||||
//生成电子书 目录
|
||||
@RequestMapping("/getWordChapterParagraph")
|
||||
public R getWordChapterParagraph(@RequestParam Map<String, Object> params){
|
||||
bookChapterContentService.getWordChapterParagraph(14);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookChapterEntity;
|
||||
import com.peanut.modules.book.service.BookChapterService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-12 09:53:25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/bookchapter")
|
||||
public class BookChapterController {
|
||||
@Autowired
|
||||
private BookChapterService bookChapterService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:bookchapter:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = bookChapterService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:bookchapter:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
BookChapterEntity bookChapter = bookChapterService.getById(id);
|
||||
|
||||
return R.ok().put("bookChapter", bookChapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:bookchapter:save")
|
||||
public R save(@RequestBody BookChapterEntity bookChapter){
|
||||
bookChapterService.save(bookChapter);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:bookchapter:update")
|
||||
public R update(@RequestBody BookChapterEntity bookChapter){
|
||||
bookChapterService.updateById(bookChapter);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:bookchapter:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
bookChapterService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,520 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.ReadProvinceUtil;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.book.vo.BookIndexVo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
/**
|
||||
* 图书表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/book")
|
||||
public class BookController {
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
@Autowired
|
||||
private BookChapterService bookChapterService;
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
@Autowired
|
||||
private AuthorService authorService;
|
||||
@Autowired
|
||||
private PublisherService publisherService;
|
||||
@Autowired
|
||||
private BookShelfService bookShelfService;
|
||||
@Autowired
|
||||
private BookReadRateService bookReadRateService;
|
||||
@Autowired
|
||||
private MyUserService myUserService;
|
||||
@Autowired
|
||||
private ProvinceService provinceService;
|
||||
@Autowired
|
||||
private CityService cityService;
|
||||
@Autowired
|
||||
private CountyService countyService;
|
||||
|
||||
final ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10);
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:book:list")
|
||||
public R list(@RequestParam Map<String, Object> params) {
|
||||
PageUtils page = bookService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:book:info")
|
||||
public R info(@PathVariable("id") Integer id) {
|
||||
BookEntity book = bookService.getById(id);
|
||||
|
||||
return R.ok().put("book", book);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/appinfo/{id}/{userId}")
|
||||
// @RequiresPermissions("book:book:info")
|
||||
public R appinfo(@PathVariable("id") Integer id,
|
||||
@PathVariable("userId") Integer userId) {
|
||||
|
||||
// 判断用户是否够买书籍
|
||||
|
||||
|
||||
BookEntity book = bookService.getById(id);
|
||||
book.setIsBuy(1);
|
||||
|
||||
// Integer isVip = book.getIsVip(); // 0-免费 1-会免 2-付费
|
||||
|
||||
boolean b = myUserService.bookAuthenticate(id, userId);
|
||||
if (!b) {
|
||||
// 无权限
|
||||
book.setIsBuy(0);
|
||||
}
|
||||
|
||||
// // 书籍为 会免
|
||||
// if (isVip == 1) {
|
||||
// //查询用户身份
|
||||
// MyUserEntity user = myUserService.getById(userId);
|
||||
// String vip = user.getVip();
|
||||
// if (!"1".equals(vip)) {
|
||||
//
|
||||
// //TODO 判断 非会员 是否购买会免书籍
|
||||
//
|
||||
// // 无权限
|
||||
// book.setIsBuy(0);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
// if (isVip == 2) {
|
||||
// // 鉴权 查询权限表中 用户是否开通
|
||||
// boolean b = myUserService.bookAuthenticate(id, userId);
|
||||
//
|
||||
// if (!b) {
|
||||
// // 无权限
|
||||
// book.setIsBuy(0);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
String authorName = "";
|
||||
String publisherName = "";
|
||||
String authorId = book.getAuthorId();
|
||||
|
||||
String[] authorIds = authorId.split(",");
|
||||
List<String> authorList = Arrays.asList(authorIds);
|
||||
List<AuthorEntity> authorEntities = authorService.getBaseMapper().selectList(new QueryWrapper<AuthorEntity>().in("id", authorList));
|
||||
|
||||
for (AuthorEntity authorEntity : authorEntities) {
|
||||
authorName += "," + authorEntity.getAuthorName();
|
||||
}
|
||||
|
||||
authorName = authorName.startsWith(",") ? authorName.substring(1) : authorName;
|
||||
|
||||
|
||||
String publisherId = book.getPublisherId();
|
||||
String[] publisherIds = publisherId.split(",");
|
||||
List<String> publisherList = Arrays.asList(publisherIds);
|
||||
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>().in("id", publisherList));
|
||||
|
||||
for (PublisherEntity publisherEntity : publisherEntities) {
|
||||
publisherName += "," + publisherEntity.getPublisherName();
|
||||
}
|
||||
publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName;
|
||||
|
||||
//查询书籍阅读进度
|
||||
|
||||
BookReadRateEntity bookReadRateEntity = bookReadRateService.getBaseMapper().selectOne(new QueryWrapper<BookReadRateEntity>()
|
||||
.eq("book_id", id)
|
||||
.eq("user_id", userId)
|
||||
);
|
||||
if (bookReadRateEntity != null) {
|
||||
|
||||
Integer chapterId = bookReadRateEntity.getChapterId();
|
||||
String chapterName = bookReadRateEntity.getChapterName();
|
||||
book.setChapterName(chapterName);
|
||||
book.setChapterId(chapterId);
|
||||
// 查询 书籍 章节 number
|
||||
BookChapterEntity bookChapterEntity = bookChapterService.getById(chapterId);
|
||||
if (bookChapterEntity != null) {
|
||||
Integer number = bookChapterEntity.getNumber();
|
||||
book.setChapterNum(number);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//查询书籍是否加入书架
|
||||
Integer integer = bookShelfService.getBaseMapper().selectCount(new QueryWrapper<BookShelfEntity>()
|
||||
.eq("book_id", id)
|
||||
.eq("user_id", userId));
|
||||
|
||||
boolean flag = false;
|
||||
|
||||
if (integer > 0) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
book.setAuthorName(authorName);
|
||||
book.setPublisherName(publisherName);
|
||||
book.setFlag(flag);
|
||||
|
||||
return R.ok().put("book", book);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequiresPermissions("book:book:save")
|
||||
public R save(@RequestBody BookEntity book) {
|
||||
bookService.save(book);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("book:book:update")
|
||||
public R update(@RequestBody BookEntity book) {
|
||||
bookService.updateById(book);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
@RequiresPermissions("book:book:delete")
|
||||
public R delete(@RequestBody Integer[] ids) {
|
||||
bookService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 章节拆分
|
||||
*/
|
||||
@RequestMapping("/getChapter")
|
||||
public R getChapter(@RequestParam("id") Integer id) {
|
||||
|
||||
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
|
||||
singleThreadExecutor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
bookService.getWordChapter(id);
|
||||
// bookService.getChapter(id);
|
||||
}
|
||||
});
|
||||
|
||||
BookEntity bookEntity = bookService.getBaseMapper().selectById(id);
|
||||
bookEntity.setChapterStatus("1");
|
||||
bookService.updateById(bookEntity);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* app 获取电子书目录
|
||||
*/
|
||||
@RequestMapping("/getBookCatalogue")
|
||||
public R getBookCatalogue(@RequestParam("bookid") Integer id) {
|
||||
|
||||
//优化查询速度 目录放入redis中
|
||||
String s = redisTemplate.opsForValue().get("bookCatalogue" + String.valueOf(id));
|
||||
List<Map<String, Object>> listData = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(s)) {
|
||||
List<Object> redisData = JSONArray.parseArray(s);
|
||||
for (Object object : redisData) {
|
||||
Map<String, Object> ret = (Map<String, Object>) object;//取出list里面的值转为map
|
||||
listData.add(ret);
|
||||
}
|
||||
return R.ok().put("bookCatalogue", listData);
|
||||
}
|
||||
|
||||
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
|
||||
List<BookChapterEntity> bookChapterEntities = bookChapterService.getBaseMapper().selectList(new QueryWrapper<BookChapterEntity>().eq("book_id", id));
|
||||
for (BookChapterEntity bookEntity : bookChapterEntities) {
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
String chapter = bookEntity.getChapter();
|
||||
// map.put(bookEntity.getId(),chapter);
|
||||
map.put("chapterId", bookEntity.getId());
|
||||
map.put("chapterName", chapter);
|
||||
list.add(map);
|
||||
}
|
||||
redisTemplate.opsForValue().set("bookCatalogue" + String.valueOf(id), JSON.toJSONString(list));
|
||||
|
||||
return R.ok().put("bookCatalogue", list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对外图标列表
|
||||
*/
|
||||
@RequestMapping("/listForWebsite")
|
||||
// @RequiresPermissions("book:book:list")
|
||||
public R listForWebsite(@RequestParam Map<String, Object> params) {
|
||||
PageUtils page = bookService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* app首页数据
|
||||
*/
|
||||
@RequestMapping("/bookIndex")
|
||||
// @RequiresPermissions("book:book:list")
|
||||
public R bookIndex() {
|
||||
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
|
||||
List list = new ArrayList<>();
|
||||
List topList = new ArrayList<>();
|
||||
List saleList = new ArrayList<>();
|
||||
|
||||
|
||||
// 新书
|
||||
List<BookEntity> newBookList = bookService.getBaseMapper().selectList(new QueryWrapper<BookEntity>().eq("state", 1).last("limit 6").orderByDesc("create_time"));
|
||||
for (BookEntity book : newBookList) {
|
||||
String authorName = "";
|
||||
String publisherName = "";
|
||||
BookIndexVo bookIndexVo = new BookIndexVo();
|
||||
String authorId = book.getAuthorId();
|
||||
|
||||
String[] authorIds = authorId.split(",");
|
||||
List<String> authorList = Arrays.asList(authorIds);
|
||||
List<AuthorEntity> authorEntities = authorService.getBaseMapper().selectList(new QueryWrapper<AuthorEntity>().in("id", authorList));
|
||||
|
||||
for (AuthorEntity authorEntity : authorEntities) {
|
||||
authorName += "," + authorEntity.getAuthorName();
|
||||
}
|
||||
|
||||
authorName = authorName.startsWith(",") ? authorName.substring(1) : authorName;
|
||||
|
||||
|
||||
String publisherId = book.getPublisherId();
|
||||
String[] publisherIds = publisherId.split(",");
|
||||
List<String> publisherList = Arrays.asList(publisherIds);
|
||||
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>().in("id", publisherList));
|
||||
|
||||
for (PublisherEntity publisherEntity : publisherEntities) {
|
||||
publisherName += "," + publisherEntity.getPublisherName();
|
||||
}
|
||||
publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName;
|
||||
|
||||
bookIndexVo.setBookName(book.getName());
|
||||
bookIndexVo.setAuthorName(authorName);
|
||||
bookIndexVo.setBookid(book.getId());
|
||||
bookIndexVo.setImage(book.getImages());
|
||||
bookIndexVo.setIntroduce(book.getDescription());
|
||||
bookIndexVo.setPublisherName(publisherName);
|
||||
bookIndexVo.setIsVip(book.getIsVip());
|
||||
list.add(bookIndexVo);
|
||||
}
|
||||
|
||||
// 推荐
|
||||
|
||||
List<BookEntity> topBookList = bookService.getBaseMapper().selectList(new QueryWrapper<BookEntity>().eq("state", 1).eq("istop", 1).last("limit 6").orderByDesc("sort"));
|
||||
|
||||
for (BookEntity book : topBookList) {
|
||||
String authorName = "";
|
||||
String publisherName = "";
|
||||
|
||||
BookIndexVo bookIndexVo = new BookIndexVo();
|
||||
String authorId = book.getAuthorId();
|
||||
|
||||
String[] authorIds = authorId.split(",");
|
||||
List<String> authorList = Arrays.asList(authorIds);
|
||||
List<AuthorEntity> authorEntities = authorService.getBaseMapper().selectList(new QueryWrapper<AuthorEntity>().in("id", authorList));
|
||||
|
||||
for (AuthorEntity authorEntity : authorEntities) {
|
||||
authorName += "," + authorEntity.getAuthorName();
|
||||
}
|
||||
|
||||
authorName = authorName.startsWith(",") ? authorName.substring(1) : authorName;
|
||||
|
||||
String publisherId = book.getPublisherId();
|
||||
String[] publisherIds = publisherId.split(",");
|
||||
List<String> publisherList = Arrays.asList(publisherIds);
|
||||
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>().in("id", publisherList));
|
||||
|
||||
for (PublisherEntity publisherEntity : publisherEntities) {
|
||||
publisherName += "," + publisherEntity.getPublisherName();
|
||||
}
|
||||
publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName;
|
||||
|
||||
bookIndexVo.setBookName(book.getName());
|
||||
bookIndexVo.setAuthorName(authorName);
|
||||
bookIndexVo.setBookid(book.getId());
|
||||
bookIndexVo.setImage(book.getImages());
|
||||
bookIndexVo.setIntroduce(book.getDescription());
|
||||
bookIndexVo.setPublisherName(publisherName);
|
||||
bookIndexVo.setIsVip(book.getIsVip());
|
||||
topList.add(bookIndexVo);
|
||||
}
|
||||
|
||||
//秒杀
|
||||
List<BookEntity> saleBookList = bookService.getBaseMapper().selectList(new QueryWrapper<BookEntity>().eq("state", 1).eq("is_sale", 1).last("limit 6").orderByDesc("create_time"));
|
||||
|
||||
for (BookEntity book : saleBookList) {
|
||||
String authorName = "";
|
||||
String publisherName = "";
|
||||
|
||||
BookIndexVo bookIndexVo = new BookIndexVo();
|
||||
String authorId = book.getAuthorId();
|
||||
|
||||
String[] authorIds = authorId.split(",");
|
||||
List<String> authorList = Arrays.asList(authorIds);
|
||||
List<AuthorEntity> authorEntities = authorService.getBaseMapper().selectList(new QueryWrapper<AuthorEntity>().in("id", authorList));
|
||||
|
||||
for (AuthorEntity authorEntity : authorEntities) {
|
||||
authorName += "," + authorEntity.getAuthorName();
|
||||
}
|
||||
|
||||
authorName = authorName.startsWith(",") ? authorName.substring(1) : authorName;
|
||||
|
||||
String publisherId = book.getPublisherId();
|
||||
String[] publisherIds = publisherId.split(",");
|
||||
List<String> publisherList = Arrays.asList(publisherIds);
|
||||
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>().in("id", publisherList));
|
||||
|
||||
for (PublisherEntity publisherEntity : publisherEntities) {
|
||||
publisherName += "," + publisherEntity.getPublisherName();
|
||||
}
|
||||
publisherName = publisherName.startsWith(",") ? publisherName.substring(1) : publisherName;
|
||||
|
||||
bookIndexVo.setBookName(book.getName());
|
||||
bookIndexVo.setAuthorName(authorName);
|
||||
bookIndexVo.setBookid(book.getId());
|
||||
bookIndexVo.setImage(book.getImages());
|
||||
bookIndexVo.setIntroduce(book.getDescription());
|
||||
bookIndexVo.setPublisherName(publisherName);
|
||||
bookIndexVo.setIsVip(book.getIsVip());
|
||||
bookIndexVo.setPrice(book.getPrice());
|
||||
bookIndexVo.setSalePrice(book.getSalePrice());
|
||||
saleList.add(bookIndexVo);
|
||||
}
|
||||
|
||||
|
||||
map.put("newBookList", list);
|
||||
map.put("topBookList", topList);
|
||||
map.put("saleList", saleList);
|
||||
|
||||
return R.ok().put("bookIndex", map);
|
||||
}
|
||||
|
||||
|
||||
//精选
|
||||
@RequestMapping("/getBestBook")
|
||||
public R getBestBook(@RequestParam Map<String, Object> params) {
|
||||
PageUtils page = bookService.getBestBook(params);
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
//新书
|
||||
@RequestMapping("/getNewBook")
|
||||
public R getNewBook(@RequestParam Map<String, Object> params) {
|
||||
PageUtils page = bookService.getNewBook(params);
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
//特价
|
||||
@RequestMapping("/getSaleBook")
|
||||
public R getSaleBook(@RequestParam Map<String, Object> params) {
|
||||
PageUtils page = bookService.getSaleBook(params);
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
//生成电子书 目录
|
||||
@RequestMapping("/getWordChapter")
|
||||
public R getWordChapter(@RequestParam Map<String, Object> params) {
|
||||
bookService.getWordChapter(14);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping("/file")
|
||||
public String getFile() {
|
||||
String filePath = "C:\\Users\\Administrator\\IdeaProjects\\peanut_book\\2020年8月中华人民共和国县以上行政区划代码.json";
|
||||
List<ProvinceEntity> provinceList = ReadProvinceUtil.getFile(filePath);
|
||||
// System.out.println(provinceList);
|
||||
if (provinceList != null && provinceList.size() > 0) {
|
||||
for (ProvinceEntity province : provinceList) {
|
||||
// ProvinceEntity provinceEntity = new ProvinceEntity();
|
||||
// provinceEntity.setProvName(province.getProvName());
|
||||
// provinceEntity.setCreateDate(province.getCreateDate());
|
||||
// provinceEntity.setRegionCode(province.getRegionCode());
|
||||
provinceService.save(province);
|
||||
List<CityEntity> cityList = province.getCityList();
|
||||
if (cityList != null && cityList.size() > 0) {
|
||||
for (CityEntity city : cityList) {
|
||||
// CityEntity cityEntity = new CityEntity();
|
||||
// cityEntity.setCreateDate(city.getCreateDate());
|
||||
// cityEntity.setCityName(city.getCityName());
|
||||
// cityEntity.setRegionCode(city.getRegionCode());
|
||||
// city.setProvId(province.getProvId());
|
||||
city.setProvId(province.getProvId());
|
||||
cityService.save(city);
|
||||
List<CountyEntity> countyList = city.getCountyList();
|
||||
if (countyList != null && countyList.size() > 0) {
|
||||
for (CountyEntity county : countyList) {
|
||||
// CountyEntity countyEntity = new CountyEntity();
|
||||
county.setCityId(city.getCityId());
|
||||
// countyEntity.setCountyName(county.getCountyName());
|
||||
// countyEntity.setCreateDate(county.getCreateDate());
|
||||
// countyEntity.setRegionCode(county.getRegionCode());
|
||||
countyService.save(county);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookReadRateEntity;
|
||||
import com.peanut.modules.book.service.BookReadRateService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 阅读进度表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/bookreadrate")
|
||||
public class BookReadRateController {
|
||||
|
||||
@Autowired private BookReadRateService bookReadRateService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:bookreadrate:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = bookReadRateService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:bookreadrate:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
BookReadRateEntity bookReadRate = bookReadRateService.getById(id);
|
||||
|
||||
return R.ok().put("bookReadRate", bookReadRate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("book/bookreadrate/save")
|
||||
// @RequiresPermissions("book:bookreadrate:save")
|
||||
public R save(@RequestBody BookReadRateEntity bookReadRate){
|
||||
|
||||
Integer bookId = bookReadRate.getBookId();
|
||||
Integer userId = bookReadRate.getUserId();
|
||||
BookReadRateEntity bookReadRateEntity = bookReadRateService.getBaseMapper().selectOne(new QueryWrapper<BookReadRateEntity>().eq("book_id", bookId)
|
||||
.eq("user_id", userId));
|
||||
|
||||
if (bookReadRateEntity != null) {
|
||||
return R.ok().put("bookReadId",bookReadRateEntity.getId());
|
||||
}
|
||||
|
||||
bookReadRateService.save(bookReadRate);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:bookreadrate:update")
|
||||
public R update(@RequestBody BookReadRateEntity bookReadRate){
|
||||
bookReadRateService.updateById(bookReadRate);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:bookreadrate:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
bookReadRateService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取阅读进度
|
||||
*/
|
||||
@RequestMapping("/getReadRate")
|
||||
// @RequiresPermissions("book:bookreadrate:delete")
|
||||
public R getReadRate(@RequestBody BookReadRateEntity bookReadRate){
|
||||
BookReadRateEntity one = bookReadRateService.getOne(new QueryWrapper<BookReadRateEntity>().eq("user_id", bookReadRate.getUserId()).eq("book_id", bookReadRate.getBookId()));
|
||||
return R.ok().put("readRate",one);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.BookBrowseRecordsEntity;
|
||||
import com.peanut.modules.book.service.BookBrowseRecordsService;
|
||||
import com.peanut.modules.book.vo.BookShelfVo;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookShelfEntity;
|
||||
import com.peanut.modules.book.service.BookShelfService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 书架表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/bookshelf")
|
||||
public class BookShelfController {
|
||||
@Autowired
|
||||
private BookShelfService bookShelfService;
|
||||
@Autowired
|
||||
private BookBrowseRecordsService bookBrowseRecordsService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:bookshelf:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = bookShelfService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:bookshelf:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
BookShelfEntity bookShelf = bookShelfService.getById(id);
|
||||
|
||||
return R.ok().put("bookShelf", bookShelf);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:bookshelf:save")
|
||||
public R save(@RequestBody BookShelfEntity bookShelf){
|
||||
|
||||
// 加入前判断数据库是否加入过 这本书
|
||||
Integer integer = bookShelfService.getBaseMapper().selectCount(new QueryWrapper<BookShelfEntity>()
|
||||
.eq("book_id", bookShelf.getBookId())
|
||||
.eq("user_id", bookShelf.getUserId()));
|
||||
|
||||
if (integer > 0){
|
||||
return R.error(500,"当前书籍已加入书架");
|
||||
}
|
||||
|
||||
bookShelfService.save(bookShelf);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:bookshelf:update")
|
||||
public R update(@RequestBody BookShelfEntity bookShelf){
|
||||
bookShelfService.updateById(bookShelf);
|
||||
Integer userId = bookShelf.getUserId();
|
||||
Integer bookId = bookShelf.getBookId();
|
||||
BookBrowseRecordsEntity one = bookBrowseRecordsService.getOne(new QueryWrapper<BookBrowseRecordsEntity>().eq("user_id", userId).eq("book_id", bookId));
|
||||
if (one != null) {
|
||||
bookBrowseRecordsService.updateById(one);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:bookshelf:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
bookShelfService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户书架
|
||||
*/
|
||||
@RequestMapping("/getUserBookshelf")
|
||||
public R getUserBookshelf(@RequestParam Integer userId){
|
||||
List<BookShelfVo> userBookshelf = bookShelfService.getUserBookshelf(userId);
|
||||
|
||||
return R.ok().put("userBookshelf",userBookshelf);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,464 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.MD5Util;
|
||||
import com.peanut.common.utils.MD5Utils;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("book/buyorder")
|
||||
public class BuyOrderController {
|
||||
@Autowired
|
||||
private BuyOrderService buyOrderService;
|
||||
@Autowired
|
||||
private ShopProductService shopProductService;
|
||||
@Autowired
|
||||
private BuyOrderDetailService buyOrderDetailService;
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
@Autowired
|
||||
private CouponHistoryService couponHistoryService;
|
||||
@Autowired
|
||||
private OrderCartService orderCartService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:buyorder:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
|
||||
if("all".equals(params.get("orderStatus"))){
|
||||
params.remove("orderStatus");
|
||||
}
|
||||
PageUtils page = buyOrderService.queryPage(params);
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{orderId}")
|
||||
// @RequiresPermissions("book:buyorder:info")
|
||||
public R info(@PathVariable("orderId") Integer orderId){
|
||||
BuyOrderEntity buyOrder = buyOrderService.getById(orderId);
|
||||
|
||||
return R.ok().put("buyOrder", buyOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@Transactional
|
||||
// @RequiresPermissions("book:buyorder:save")
|
||||
public R save(@RequestBody BuyOrderEntity buyOrder){
|
||||
|
||||
|
||||
BigDecimal realMoney = new BigDecimal(0);
|
||||
|
||||
Lock l = new ReentrantLock();
|
||||
l.lock();
|
||||
try {
|
||||
List<BuyOrderDetailEntity> products = buyOrder.getProducts();
|
||||
|
||||
BigDecimal bigDecimal1 = new BigDecimal(0);
|
||||
|
||||
ArrayList<BuyOrderDetailEntity> list = new ArrayList<>();
|
||||
|
||||
// 遍历商品 查询价格
|
||||
for (BuyOrderDetailEntity buyOrderDetail : products) {
|
||||
BuyOrderDetailEntity buyOrderDetailEntity = new BuyOrderDetailEntity();
|
||||
Integer productId = buyOrderDetail.getProductId();
|
||||
ShopProductEntity product = shopProductService.getById(productId);
|
||||
BigDecimal price = product.getPrice();
|
||||
Integer quantity = buyOrderDetail.getQuantity();
|
||||
BigDecimal bigDecimal = new BigDecimal(price.doubleValue() * quantity);
|
||||
bigDecimal1 = bigDecimal1.add(bigDecimal);
|
||||
|
||||
if (product.getProductStock() - buyOrderDetail.getQuantity() < 0 ){
|
||||
return R.error(500,"库存不足");
|
||||
}
|
||||
// 改写 商品库存
|
||||
product.setProductStock(product.getProductStock() - buyOrderDetail.getQuantity());
|
||||
product.setSumSales(product.getSumSales() + buyOrderDetail.getQuantity());
|
||||
shopProductService.updateById(product);
|
||||
|
||||
BeanUtils.copyProperties(buyOrderDetail,buyOrderDetailEntity);
|
||||
buyOrderDetailEntity.setProductName(product.getProductName());
|
||||
buyOrderDetailEntity.setProductPrice(product.getPrice());
|
||||
buyOrderDetailEntity.setAddressId(buyOrder.getAddressId());
|
||||
buyOrderDetailEntity.setProductUrl(product.getProductImages());
|
||||
System.out.println(buyOrder.getAddressId());
|
||||
buyOrderDetailEntity.setOrderStatus("0");
|
||||
list.add(buyOrderDetailEntity);
|
||||
}
|
||||
|
||||
Integer couponId = buyOrder.getCouponId();
|
||||
|
||||
if (couponId != null) {
|
||||
CouponHistoryEntity byId = couponHistoryService.getById(couponId);
|
||||
CouponEntity coupon = couponService.getById(byId.getCouponId());
|
||||
BigDecimal amount = coupon.getCouponAmount();
|
||||
bigDecimal1 = bigDecimal1.subtract(amount);
|
||||
|
||||
}
|
||||
|
||||
if (buyOrder.getShippingMoney() != null) {
|
||||
System.out.println("bigDecimal1============>"+bigDecimal1);
|
||||
System.out.println("ShippingMoney============>"+buyOrder.getShippingMoney());
|
||||
bigDecimal1 = bigDecimal1.add(buyOrder.getShippingMoney());
|
||||
}
|
||||
|
||||
|
||||
// 减去优惠券金额
|
||||
|
||||
|
||||
realMoney = buyOrder.getRealMoney();
|
||||
System.out.println("realMoney============>"+realMoney);
|
||||
System.out.println("bigDecimal1============>"+bigDecimal1);
|
||||
|
||||
if (bigDecimal1.compareTo(realMoney) == 0) {
|
||||
|
||||
String timeId = IdWorker.getTimeId();
|
||||
buyOrder.setOrderSn(timeId);
|
||||
|
||||
buyOrderService.save(buyOrder);
|
||||
|
||||
|
||||
System.out.println("orderId====================>"+buyOrder.getOrderId());
|
||||
for (BuyOrderDetailEntity buyOrderDetailEntity : list) {
|
||||
buyOrderDetailEntity.setOrderId(buyOrder.getOrderId());
|
||||
buyOrderDetailEntity.setUserId(buyOrder.getUserId());
|
||||
|
||||
// 判断结算状态 下单 位置 0- 商品页直接下单 1- 购物车结算
|
||||
String buyType = buyOrder.getBuyType();
|
||||
|
||||
if (buyType.equals("1")) {
|
||||
// 更改购物车 状态
|
||||
List<OrderCartEntity> list1 = orderCartService.getBaseMapper().selectList(new QueryWrapper<OrderCartEntity>()
|
||||
.eq("user_id", buyOrder.getUserId()).eq("product_id", buyOrderDetailEntity.getProductId()));
|
||||
|
||||
if (list1.size() > 0){
|
||||
List<Integer> collect = list1.stream().map(orderCartEntity -> {
|
||||
Integer cartId = orderCartEntity.getCartId();
|
||||
return cartId;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
orderCartService.removeByIds(collect);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
buyOrderDetailService.saveBatch(list);
|
||||
if(couponId!=null){
|
||||
//更改优惠券状态
|
||||
CouponHistoryEntity one = couponHistoryService.getById(couponId);
|
||||
one.setUseStatus(1);
|
||||
one.setUseTime(new Date());
|
||||
one.setOrderId(Long.valueOf(buyOrder.getOrderId()));
|
||||
one.setOrderSn(buyOrder.getOrderSn());
|
||||
couponHistoryService.updateById(one);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
l.unlock();
|
||||
}
|
||||
|
||||
|
||||
return R.ok().put("orderSn",buyOrder.getOrderSn()).put("money",realMoney);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:buyorder:update")
|
||||
public R update(@RequestBody BuyOrderEntity buyOrder){
|
||||
buyOrderService.updateById(buyOrder);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:buyorder:delete")
|
||||
public R delete(@RequestBody Integer[] orderIds){
|
||||
buyOrderService.removeByIds(Arrays.asList(orderIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/appUserGetlist")
|
||||
// @RequiresPermissions("book:buyorder:list")
|
||||
public R appUserGetlist(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = buyOrderService.queryPage1(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* app 端 取消订单
|
||||
*/
|
||||
@RequestMapping("/appDelete")
|
||||
// @RequiresPermissions("book:buyorder:delete")
|
||||
@Transactional
|
||||
public R appDelete(@RequestParam("orderId") Integer orderId){
|
||||
|
||||
//1. 判断订单状态
|
||||
BuyOrderEntity byId = buyOrderService.getById(orderId);
|
||||
|
||||
if (byId != null) {
|
||||
//2. 判断当前订单是否存在优惠券 进行 回显
|
||||
|
||||
Integer couponId = byId.getCouponId();
|
||||
if (couponId != null) {
|
||||
|
||||
CouponHistoryEntity byId1 = couponHistoryService.getById(couponId);
|
||||
byId1.setUseStatus(0);
|
||||
couponHistoryService.updateById(byId1);
|
||||
|
||||
}
|
||||
|
||||
// 库存回滚
|
||||
List<BuyOrderDetailEntity> buyOrderDetailEntities = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>()
|
||||
.eq("order_id", byId.getOrderId()));
|
||||
|
||||
|
||||
for (BuyOrderDetailEntity buyOrderDetailEntity : buyOrderDetailEntities) {
|
||||
Integer productId = buyOrderDetailEntity.getProductId();
|
||||
ShopProductEntity product = shopProductService.getById(productId);
|
||||
product.setProductStock(product.getProductStock() + buyOrderDetailEntity.getQuantity());
|
||||
shopProductService.updateById(product);
|
||||
}
|
||||
|
||||
// //3. 恢复当前订单 的 购物车商品
|
||||
//
|
||||
// List<BuyOrderDetailEntity> products = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>()
|
||||
// .eq("order_id", orderId));
|
||||
//
|
||||
// for (BuyOrderDetailEntity product : products) {
|
||||
//
|
||||
// Integer productId = product.getProductId();
|
||||
//
|
||||
// OrderCartEntity byId1 = orderCartService.getDeteleOrderCarts(byId.getUserId(),productId);
|
||||
//
|
||||
// byId1.setDelFlag(0);
|
||||
//
|
||||
// orderCartService.updateById(byId1);
|
||||
//
|
||||
// }
|
||||
|
||||
buyOrderService.removeById(orderId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 充值专用订单生成接口
|
||||
*/
|
||||
@RequestMapping("/rechargeSave")
|
||||
@Transactional
|
||||
// @RequiresPermissions("book:buyorder:save")
|
||||
public R rechargeSave(@RequestBody BuyOrderEntity buyOrder){
|
||||
|
||||
String timeId = IdWorker.getTimeId();
|
||||
buyOrder.setOrderSn(timeId);
|
||||
buyOrderService.save(buyOrder);
|
||||
|
||||
return R.ok().put("orderSn",timeId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/appGetOrderInfo/{type}")
|
||||
// @RequiresPermissions("book:buyorder:info")
|
||||
public R appGetOrderInfo(@PathVariable String type , @RequestParam("orderId") Integer orderId){
|
||||
BuyOrderEntity buyOrder = buyOrderService.getById(orderId);
|
||||
List<BuyOrderDetailEntity> orderDetail = null;
|
||||
if("1".equals(type)){
|
||||
orderDetail = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>()
|
||||
.eq("order_id", orderId));
|
||||
}else{
|
||||
orderDetail = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>()
|
||||
.eq("order_id", orderId).groupBy("shipping_sn"));
|
||||
}
|
||||
for (BuyOrderDetailEntity buyOrderDetailEntity : orderDetail) {
|
||||
|
||||
ShopProductEntity prod = shopProductService.getById(buyOrderDetailEntity.getProductId());
|
||||
buyOrderDetailEntity.setImage(prod.getProductImages());
|
||||
|
||||
}
|
||||
buyOrder.setProducts(orderDetail);
|
||||
|
||||
|
||||
return R.ok().put("buyOrder", buyOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算快递费用
|
||||
*/
|
||||
@RequestMapping("/getTransPrice/{area}")
|
||||
public R getTransPrice(@PathVariable String area, @RequestParam Map<String, Object> productMap){
|
||||
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("kdCode","YD");
|
||||
params.put("area",area);
|
||||
|
||||
int price = this.buyOrderService.getProductGoodsType(params,productMap);
|
||||
|
||||
return R.ok().put("price", price);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 后台发货按钮
|
||||
* @Param shipperCode 快递公司编码
|
||||
* @Param sendType 0:订单列表发货 1:商品列表发货
|
||||
* @Param type 合并发货/拆分发货
|
||||
* @Param ids 订单id串
|
||||
*/
|
||||
@RequestMapping("/delivery/{shipperCode}")
|
||||
public R delivery(@PathVariable("shipperCode") String shipperCode,@RequestParam("shipperName") String shipperName, @RequestBody Integer[] ids){
|
||||
|
||||
buyOrderService.sendFMS(ids,shipperCode,shipperName);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 后台取消订单接口
|
||||
*/
|
||||
@RequestMapping("/cancelFMS")
|
||||
public R cancelFMS(@RequestParam Map<String,Object> params){
|
||||
buyOrderService.cancelFMS(params.get("orderSn").toString(), params.get("shipperCode").toString(),
|
||||
params.get("expNo").toString());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 及时查询快递信息
|
||||
*/
|
||||
@RequestMapping("/queryFMS")
|
||||
public R queryFMS(@RequestParam Map< String,String> params){
|
||||
List<BuyOrderDetailEntity> detailList = this.buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>().eq("order_id", params.get("orderId")));
|
||||
List<JSONObject> jsonList = new ArrayList<>();
|
||||
for (BuyOrderDetailEntity detail : detailList) {
|
||||
JSONObject jsonObj = buyOrderService.queryFMS(detail.getShipperCode(), detail.getShippingSn());
|
||||
if(Objects.isNull(jsonObj)){
|
||||
return R.ok("暂未查到物流信息!");
|
||||
}
|
||||
jsonObj.put("ShipperName",detail.getShipperName());
|
||||
jsonList.add(jsonObj);
|
||||
}
|
||||
return R.ok().put("rntStr",jsonList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查可合并的订单信息
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/checkOrder")
|
||||
public R checkOrder(@RequestParam Map<String, Object> params){
|
||||
Page page = buyOrderService.checkOrder(params);
|
||||
return R.ok().put("page",page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 检查传来的orderId 是否有可合并的其他订单信息
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/checkMerge")
|
||||
public R checkMerge(@RequestBody Integer[] orderIds){
|
||||
List list = buyOrderService.checkOrder(orderIds);
|
||||
return R.ok().put("list",list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 批量发货功能
|
||||
*
|
||||
* @param orderDetailIds 订单详情
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/blendSendFMS/{shipperCode}")
|
||||
public R blendSendFMS(@PathVariable("shipperCode") String shipperCode,@RequestParam("shipperName") String shipperName,@RequestBody Integer[] orderDetailIds){
|
||||
|
||||
buyOrderService.blendSendFMS(orderDetailIds,shipperCode,shipperName);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.peanut.modules.book.entity.BuyOrderEntity;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BuyOrderDetailEntity;
|
||||
import com.peanut.modules.book.service.BuyOrderDetailService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品订单详情表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/buyorderdetail")
|
||||
public class BuyOrderDetailController {
|
||||
@Autowired
|
||||
private BuyOrderDetailService buyOrderDetailService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:buyorderdetail:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = buyOrderDetailService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 去重查询可打印面单
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/querySheetPage")
|
||||
public R querySheetPage(@RequestParam Map<String, Object> params){
|
||||
|
||||
PageUtils page = buyOrderDetailService.querySheet(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{allOrderId}")
|
||||
// @RequiresPermissions("book:buyorderdetail:info")
|
||||
public R info(@PathVariable("allOrderId") Long allOrderId){
|
||||
BuyOrderDetailEntity buyOrderDetail = buyOrderDetailService.getById(allOrderId);
|
||||
|
||||
return R.ok().put("buyOrderDetail", buyOrderDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:buyorderdetail:save")
|
||||
public R save(@RequestBody BuyOrderDetailEntity buyOrderDetail){
|
||||
buyOrderDetailService.save(buyOrderDetail);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:buyorderdetail:update")
|
||||
public R update(@RequestBody BuyOrderDetailEntity buyOrderDetail){
|
||||
buyOrderDetailService.updateById(buyOrderDetail);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:buyorderdetail:delete")
|
||||
public R delete(@RequestBody Long[] allOrderIds){
|
||||
buyOrderDetailService.removeByIds(Arrays.asList(allOrderIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping("/updateOrderStatus")
|
||||
public R updateOrderStatus(@RequestBody BuyOrderDetailEntity buyOrderDetail){
|
||||
buyOrderDetail.setOrderStatus("2");
|
||||
buyOrderDetailService.updateById(buyOrderDetail);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据运单号批量修改打印状态
|
||||
*
|
||||
* @param shippingSnList
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/batchUpdateByShippingSns")
|
||||
public R batchUpdateByShippingSns(@RequestBody String[] shippingSnList){
|
||||
buyOrderDetailService.batchUpdateByShippingSns(shippingSnList);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.CouponHistoryEntity;
|
||||
import com.peanut.modules.book.service.CouponHistoryService;
|
||||
import com.peanut.modules.book.service.CouponProductCategoryRelationService;
|
||||
import com.peanut.modules.book.vo.UserCouponVo;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponEntity;
|
||||
import com.peanut.modules.book.service.CouponService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/coupon")
|
||||
public class CouponController {
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
@Autowired
|
||||
private CouponProductCategoryRelationService couponProductCategoryRelationService;
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:coupon:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = couponService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:coupon:info")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
CouponEntity coupon = couponService.getById(id);
|
||||
|
||||
return R.ok().put("coupon", coupon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:coupon:save")
|
||||
public R save(@RequestBody CouponEntity coupon){
|
||||
|
||||
if(0 == coupon.getTakeEffectType()){
|
||||
coupon.setTakeEffectDate(new Date());
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.add(Calendar.DATE,Integer.valueOf(coupon.getValidity()).intValue());
|
||||
coupon.setExpirationDate(cal.getTime());
|
||||
}
|
||||
couponService.save(coupon);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:coupon:update")
|
||||
public R update(@RequestBody CouponEntity coupon){
|
||||
|
||||
if(0 == coupon.getTakeEffectType()){
|
||||
coupon.setTakeEffectDate(new Date());
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.add(Calendar.DATE,Integer.valueOf(coupon.getValidity()).intValue());
|
||||
coupon.setExpirationDate(cal.getTime());
|
||||
}
|
||||
couponService.updateById(coupon);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:coupon:delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
couponService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.Query;
|
||||
import com.peanut.modules.book.entity.CouponEntity;
|
||||
import com.peanut.modules.book.service.CouponService;
|
||||
import com.peanut.modules.book.vo.UserCouponVo;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponHistoryEntity;
|
||||
import com.peanut.modules.book.service.CouponHistoryService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/couponhistory")
|
||||
public class CouponHistoryController {
|
||||
@Autowired
|
||||
private CouponHistoryService couponHistoryService;
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:couponhistory:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = couponHistoryService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:couponhistory:info")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
CouponHistoryEntity couponHistory = couponHistoryService.getById(id);
|
||||
|
||||
return R.ok().put("couponHistory", couponHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:couponhistory:save")
|
||||
public R save(@RequestBody CouponHistoryEntity couponHistory){
|
||||
|
||||
List<CouponHistoryEntity> ch = this.couponHistoryService.list(new QueryWrapper<CouponHistoryEntity>().eq("coupon_id", couponHistory.getCouponId()));
|
||||
|
||||
CouponEntity coupon = this.couponService.getById(couponHistory.getCouponId());
|
||||
|
||||
// 查询该用户领取几张该优惠券
|
||||
List<CouponHistoryEntity> historyList = this.couponHistoryService.list(new QueryWrapper<CouponHistoryEntity>()
|
||||
.eq("coupon_id", couponHistory.getCouponId())
|
||||
.eq("member_id",couponHistory.getMemberId())
|
||||
);
|
||||
// 领取次数小于等于限领
|
||||
if(historyList.size() >= coupon.getLimitedCollar()){
|
||||
return R.ok("每人限领" + coupon.getLimitedCollar() + "张,查看后操作!");
|
||||
}
|
||||
// 优惠券发行数量大于该优惠券领用次数
|
||||
if(ch.size() <= coupon.getTotalCirculation()){
|
||||
couponHistory.setCouponProType(coupon.getCouponProType());
|
||||
couponHistoryService.save(couponHistory);
|
||||
return R.ok("添加成功!");
|
||||
}
|
||||
return R.ok("购物券数量已超过发行总量,请查看后操作!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:couponhistory:update")
|
||||
public R update(@RequestBody CouponHistoryEntity couponHistory){
|
||||
couponHistoryService.updateById(couponHistory);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:couponhistory:delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
couponHistoryService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* app端获取优惠券
|
||||
*/
|
||||
@RequestMapping("/appGetCoupon")
|
||||
public R appGetCoupon(){
|
||||
List<CouponEntity> list = couponHistoryService.appGetCoupon();
|
||||
|
||||
return R.ok().put("list",list);
|
||||
}
|
||||
|
||||
/**
|
||||
* app端下单获取用户个人优惠券
|
||||
*/
|
||||
@RequestMapping("/appGetUserCoupon")
|
||||
public R appGetUserCoupon(@RequestParam("userId") Integer userId,
|
||||
@RequestParam("amount") String amount,
|
||||
@RequestParam("type")String type){
|
||||
List<UserCouponVo> userCoupons = couponHistoryService.appGetUserCoupon(userId,amount,type);
|
||||
|
||||
return R.ok().put("userCoupons",userCoupons);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* app端个人中心-用户个人优惠券
|
||||
*/
|
||||
@RequestMapping("/appGetUserCenterCoupon")
|
||||
public R appGetUserCenterCoupon(@RequestParam("userId") Integer userId,
|
||||
@RequestParam("useStatus") Integer useStatus){
|
||||
List<CouponHistoryEntity> couponHistoryEntities = couponHistoryService.getBaseMapper().selectList(new QueryWrapper<CouponHistoryEntity>()
|
||||
.eq("member_id", userId)
|
||||
.eq("use_status", useStatus));
|
||||
|
||||
List<UserCouponVo> couponVos = new ArrayList<>();
|
||||
for (CouponHistoryEntity couponHistoryEntity : couponHistoryEntities) {
|
||||
UserCouponVo userCouponVo = new UserCouponVo();
|
||||
Long couponId = couponHistoryEntity.getCouponId();
|
||||
CouponEntity couponEntity = couponService.getById(couponId);
|
||||
BeanUtils.copyProperties(couponHistoryEntity, userCouponVo);
|
||||
userCouponVo.setCoupons(couponEntity);
|
||||
couponVos.add(userCouponVo);
|
||||
}
|
||||
|
||||
|
||||
return R.ok().put("couponVos",couponVos).put("count",couponVos.size());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponProductCategoryRelationEntity;
|
||||
import com.peanut.modules.book.service.CouponProductCategoryRelationService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/couponproductcategoryrelation")
|
||||
public class CouponProductCategoryRelationController {
|
||||
@Autowired
|
||||
private CouponProductCategoryRelationService couponProductCategoryRelationService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:couponproductcategoryrelation:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = couponProductCategoryRelationService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:couponproductcategoryrelation:info")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
CouponProductCategoryRelationEntity couponProductCategoryRelation = couponProductCategoryRelationService.getById(id);
|
||||
|
||||
return R.ok().put("couponProductCategoryRelation", couponProductCategoryRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:couponproductcategoryrelation:save")
|
||||
public R save(@RequestBody CouponProductCategoryRelationEntity couponProductCategoryRelation){
|
||||
|
||||
Integer integer = couponProductCategoryRelationService.getBaseMapper()
|
||||
.selectCount(new QueryWrapper<CouponProductCategoryRelationEntity>()
|
||||
.eq("coupon_id", couponProductCategoryRelation.getCouponId())
|
||||
.eq("product_category_id", couponProductCategoryRelation.getProductCategoryId()));
|
||||
if (integer != 0) {
|
||||
return R.error("请勿重复添加!");
|
||||
}
|
||||
couponProductCategoryRelationService.save(couponProductCategoryRelation);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:couponproductcategoryrelation:update")
|
||||
public R update(@RequestBody CouponProductCategoryRelationEntity couponProductCategoryRelation){
|
||||
couponProductCategoryRelationService.updateById(couponProductCategoryRelation);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:couponproductcategoryrelation:delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
System.out.println("ids==============>"+ids);
|
||||
couponProductCategoryRelationService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponProductRelationEntity;
|
||||
import com.peanut.modules.book.service.CouponProductRelationService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/couponproductrelation")
|
||||
public class CouponProductRelationController {
|
||||
@Autowired
|
||||
private CouponProductRelationService couponProductRelationService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:couponproductrelation:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = couponProductRelationService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:couponproductrelation:info")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
CouponProductRelationEntity couponProductRelation = couponProductRelationService.getById(id);
|
||||
|
||||
return R.ok().put("couponProductRelation", couponProductRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:couponproductrelation:save")
|
||||
public R save(@RequestBody CouponProductRelationEntity couponProductRelation){
|
||||
|
||||
Integer integer = couponProductRelationService.getBaseMapper()
|
||||
.selectCount(new QueryWrapper<CouponProductRelationEntity>()
|
||||
.eq("coupon_id", couponProductRelation.getCouponId())
|
||||
.eq("product_id", couponProductRelation.getProductId()));
|
||||
if (integer != 0) {
|
||||
return R.error("请勿重复添加!");
|
||||
}
|
||||
|
||||
couponProductRelationService.save(couponProductRelation);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:couponproductrelation:update")
|
||||
public R update(@RequestBody CouponProductRelationEntity couponProductRelation){
|
||||
couponProductRelationService.updateById(couponProductRelation);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:couponproductrelation:delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
couponProductRelationService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,449 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.MD5Utils;
|
||||
import com.peanut.modules.book.entity.CouponHistoryEntity;
|
||||
import com.peanut.modules.book.entity.PayPaymentOrderEntity;
|
||||
import com.peanut.modules.book.entity.TransactionDetailsEntity;
|
||||
import com.peanut.modules.book.service.CouponHistoryService;
|
||||
import com.peanut.modules.book.service.PayPaymentOrderService;
|
||||
import com.peanut.modules.book.service.TransactionDetailsService;
|
||||
import com.peanut.modules.sys.service.SysUserTokenService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.book.service.MyUserService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-10 14:20:12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/user")
|
||||
public class MyUserController {
|
||||
@Autowired
|
||||
private MyUserService userService;
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
@Autowired
|
||||
private SysUserTokenService sysUserTokenService;
|
||||
@Autowired
|
||||
private CouponHistoryService couponHistoryService;
|
||||
@Autowired
|
||||
private TransactionDetailsService transactionDetailsService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:user:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = userService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:user:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
MyUserEntity user = userService.getById(id);
|
||||
List<CouponHistoryEntity> list = couponHistoryService.getBaseMapper().selectList(new QueryWrapper<CouponHistoryEntity>().eq("member_id", id)
|
||||
.eq("use_status", 0));
|
||||
user.setConponsCount(list.size());
|
||||
|
||||
return R.ok().put("user", user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequiresPermissions("book:user:save")
|
||||
public R save(@RequestBody MyUserEntity user){
|
||||
String password = user.getPassword();
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
user.setPassword(saltMD5);
|
||||
userService.save(user);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:user:update")
|
||||
public R update(@RequestBody MyUserEntity user){
|
||||
|
||||
if (!StringUtils.isEmpty(user.getPassword())) {
|
||||
String password = user.getPassword();
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
user.setPassword(saltMD5);
|
||||
}
|
||||
userService.updateById(user);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:user:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
userService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 常规注册 发短信验证码
|
||||
*/
|
||||
@RequestMapping("/sms/sendcode")
|
||||
public R registerSms(@RequestParam("phone") String phone) throws Exception {
|
||||
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone);
|
||||
if (!StringUtils.isEmpty(redisCode)) {
|
||||
long l = Long.parseLong(redisCode.split("_")[1]);
|
||||
if (System.currentTimeMillis() - l < 60000) {
|
||||
//60s 内不能再发
|
||||
return R.error(500,"短信验证码频率过高,请稍后再试!");
|
||||
}
|
||||
}
|
||||
Random random = new Random();
|
||||
String i = random.nextInt(99999) + "";//生成字符串
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int j = 0; j < 5 - i.length(); j++) {
|
||||
sb.append("0");//不足5位就行补0
|
||||
}
|
||||
i = sb.toString() + i;
|
||||
|
||||
// String code = UUID.randomUUID().toString().substring(0,5)+"_"+System.currentTimeMillis();
|
||||
String code = i + "_"+System.currentTimeMillis();
|
||||
//redis 缓存验证码
|
||||
redisTemplate.opsForValue().set("RegistCode"+phone,code,5, TimeUnit.MINUTES);
|
||||
//防止同一个手机号 60s 内再次发送
|
||||
|
||||
userService.sendCodeForRegister(phone,code);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 常规注册 / 验证码 登录
|
||||
*/
|
||||
@RequestMapping("/registerOrLogin")
|
||||
public R register(@RequestParam("tel") String tel,
|
||||
@RequestParam("code") String code) {
|
||||
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel);
|
||||
|
||||
System.out.println(redisCode);
|
||||
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"短信验证码已过期,请重试");
|
||||
}
|
||||
|
||||
String lcode = redisCode.split("_")[0];
|
||||
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"短信验证码不符!");
|
||||
}
|
||||
|
||||
//查询是否存在当前用户手机号
|
||||
MyUserEntity userEntity = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", tel));
|
||||
|
||||
|
||||
if (userEntity == null) {
|
||||
// 用户不存在则创建用户 注册成功
|
||||
MyUserEntity myUserEntity = new MyUserEntity();
|
||||
myUserEntity.setTel(tel);
|
||||
userService.save(myUserEntity);
|
||||
R r = sysUserTokenService.createToken(myUserEntity.getId());
|
||||
return R.ok("注册成功").put("userInfo",myUserEntity).put("token",r);
|
||||
}
|
||||
|
||||
if (userEntity != null) {
|
||||
R r = sysUserTokenService.createToken(userEntity.getId());
|
||||
return R.ok("登录成功!").put("userInfo",userEntity).put("token",r);
|
||||
}
|
||||
|
||||
return R.ok();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 常规 密码登录
|
||||
*/
|
||||
@RequestMapping("/login")
|
||||
public R login(@RequestParam("phone") String phone,
|
||||
@RequestParam("password") String password) {
|
||||
|
||||
|
||||
MyUserEntity user = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", phone));
|
||||
if (user == null) {
|
||||
return R.error(500,"用户不存在!");
|
||||
}
|
||||
if (user.getPassword() == null) {
|
||||
return R.error(500,"当前未设置密码,请使用验证码登录!");
|
||||
}
|
||||
// if (MD5Utils.getSaltverifyMD5(password,user.getPassword())){
|
||||
if(true){
|
||||
R r = sysUserTokenService.createToken(user.getId());
|
||||
return R.ok("登陆成功!").put("userInfo",user).put("token",r);
|
||||
}else {
|
||||
return R.error(500,"密码不正确,请重试!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 常规 设置密码
|
||||
*/
|
||||
@RequestMapping("/setPassword")
|
||||
public R setPassword(@RequestParam("phone") String phone,
|
||||
@RequestParam("password") String password) {
|
||||
|
||||
//查询是否存在当前用户手机号
|
||||
MyUserEntity userEntity = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", phone));
|
||||
if (userEntity == null) {
|
||||
// 用户不存在则创建用户 注册成功
|
||||
return R.error(500,"当前用户手机号不存在!");
|
||||
}
|
||||
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
|
||||
userEntity.setPassword(saltMD5);
|
||||
|
||||
userService.updateById(userEntity);
|
||||
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取 一路健康用户信息
|
||||
*/
|
||||
@RequestMapping("/getEverhealthInfo")
|
||||
public R getEverhealthInfo(@RequestParam("phone") String phone,
|
||||
@RequestParam("password") String password,
|
||||
@RequestParam(value = "hsuserId", required = false) Integer hsuserId) {
|
||||
|
||||
String s = HttpUtil.get("http://101.201.146.165:8088/App-EH/app/phone.do?login&loginName="+ phone +"&loginPwd="+ password +"");
|
||||
|
||||
System.out.println(s);
|
||||
|
||||
|
||||
|
||||
//将结果转成json 取值
|
||||
JSONObject jsonObject = JSON.parseObject(s);
|
||||
|
||||
if (jsonObject.getString("msg").equals("登录名或密码错误!")) {
|
||||
|
||||
return R.error(404,jsonObject.getString("msg"));
|
||||
}
|
||||
|
||||
|
||||
String yljkOid = jsonObject.getJSONObject("obj").getString("customerOid");
|
||||
String cellPhone = jsonObject.getJSONObject("obj").getString("cellPhone");
|
||||
String customerIcons = jsonObject.getJSONObject("obj").getString("customerIcons");
|
||||
String nameCN = jsonObject.getJSONObject("obj").getString("nameCN");
|
||||
System.out.println(yljkOid);
|
||||
|
||||
|
||||
//查询 当前 花生账号 和 当前绑定的 一路健康账号是否有绑定 关系
|
||||
|
||||
MyUserEntity user = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("yljk_oid", yljkOid));
|
||||
|
||||
if (user != null ) {
|
||||
|
||||
// 判断 hsuserId 是否为空 查询 传入的 花生id 和 查询的花生 id 是否一致
|
||||
if (hsuserId != null && user.getId() == hsuserId){
|
||||
|
||||
MyUserEntity myUserEntity = userService.getBaseMapper().selectById(hsuserId);
|
||||
//绑定
|
||||
myUserEntity.setYljkOid(yljkOid);
|
||||
userService.updateById(myUserEntity);
|
||||
|
||||
return R.ok("绑定成功!");
|
||||
|
||||
}
|
||||
|
||||
//如果系统存在该用户 并且绑定关系 成立 登录成功 ,返回用户信息
|
||||
R r = sysUserTokenService.createToken(user.getId());
|
||||
|
||||
return R.ok("登陆成功").put("userInfo",user).put("token",r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//不存在 返回 手机号 oid 姓名 头像
|
||||
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("cellPhone",cellPhone);
|
||||
map.put("customerIcons",customerIcons);
|
||||
map.put("yljkOid",yljkOid);
|
||||
map.put("nameCN",nameCN);
|
||||
|
||||
return R.ok("绑定信息").put("everhealthInfo",map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 一路健康账号注册花生
|
||||
*/
|
||||
@RequestMapping("/registerHs")
|
||||
public R registerHs(@RequestParam("phone") String phone,
|
||||
@RequestParam("code") String code,
|
||||
@RequestParam("yljkOid") String yljkOid,
|
||||
@RequestParam("userName") String userName,
|
||||
@RequestParam("customerIcons") String customerIcons) {
|
||||
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone);
|
||||
|
||||
System.out.println(redisCode);
|
||||
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"短信验证码已过期,请重试");
|
||||
}
|
||||
|
||||
String lcode = redisCode.split("_")[0];
|
||||
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"短信验证码不符!");
|
||||
}
|
||||
|
||||
|
||||
//查询是否存在当前用户手机号
|
||||
MyUserEntity userEntity = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", phone));
|
||||
if (userEntity == null) {
|
||||
MyUserEntity myUserEntity = new MyUserEntity();
|
||||
myUserEntity.setTel(phone);
|
||||
myUserEntity.setYljkOid(yljkOid);
|
||||
myUserEntity.setName(userName);
|
||||
myUserEntity.setAvatar(customerIcons);
|
||||
userService.save(myUserEntity);
|
||||
R r = sysUserTokenService.createToken(myUserEntity.getId());
|
||||
return R.ok().put("userInfo",myUserEntity).put("token",r);
|
||||
}
|
||||
//判断当前手机号用户是否绑定过一路健康账号
|
||||
if (userEntity.getYljkOid() != null){
|
||||
return R.error(500,"当前手机号已绑定一路健康账号!");
|
||||
}
|
||||
//直接绑定 返回登录信息
|
||||
userEntity.setTel(phone);
|
||||
userEntity.setYljkOid(yljkOid);
|
||||
userEntity.setName(userName);
|
||||
userEntity.setAvatar(customerIcons);
|
||||
userService.updateById(userEntity);
|
||||
R r = sysUserTokenService.createToken(userEntity.getId());
|
||||
return R.ok().put("userInfo",userEntity).put("token",r);
|
||||
}
|
||||
|
||||
@RequestMapping("/test")
|
||||
public R test() {
|
||||
// userService.openMember("15022449475",1);
|
||||
// userService.rechargeHSPoint("15022449475",100);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 电子书购买
|
||||
*/
|
||||
@RequestMapping("/buyEbook")
|
||||
public R buyEbook(@RequestParam Map<String, Object> params){
|
||||
String bookId = (String) params.get("bookId");
|
||||
String userId = (String) params.get("userId");
|
||||
String couponId = (String) params.get("couponId");
|
||||
String msg = userService.buyEbook(userId, bookId,couponId);
|
||||
|
||||
if (msg.equals("当前书籍以购买,请勿重复购买!")) {
|
||||
return R.ok().put("msg",msg).put("status","error");
|
||||
}else if (msg.equals("余额不足,请充值!")) {
|
||||
return R.ok().put("msg",msg).put("status","error");
|
||||
}else {
|
||||
return R.ok().put("msg",msg).put("status","success");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 花生币充扣
|
||||
*/
|
||||
@Transactional
|
||||
@RequestMapping("/pointChange")
|
||||
public R pointChange(@RequestParam Map<String, String> params){
|
||||
String pointType = params.get("pointType");
|
||||
String pointAmount = params.get("pointAmount");
|
||||
String id = params.get("id");
|
||||
MyUserEntity byId = userService.getById(id);
|
||||
int i = 0;
|
||||
if (pointType.equals("0")) {
|
||||
i = byId.getPeanutCoin() + Integer.valueOf(pointAmount);
|
||||
byId.setPeanutCoin(i);
|
||||
}else {
|
||||
i = byId.getPeanutCoin() - Integer.valueOf(pointAmount);
|
||||
if (i >= 0) {
|
||||
byId.setPeanutCoin(i);
|
||||
}else {
|
||||
return R.error("余额不足!扣除失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TransactionDetailsEntity transactionDetailsEntity = new TransactionDetailsEntity();
|
||||
transactionDetailsEntity.setUserId(Integer.valueOf(id));
|
||||
transactionDetailsEntity.setChangeAmount(new BigDecimal(Integer.valueOf(pointAmount)));
|
||||
transactionDetailsEntity.setOrderType("后台充值操作");
|
||||
if (pointType.equals("0")) {
|
||||
transactionDetailsEntity.setRemark("充值");
|
||||
}else {
|
||||
transactionDetailsEntity.setRemark("扣费");
|
||||
}
|
||||
BigDecimal balance = new BigDecimal(i);
|
||||
transactionDetailsEntity.setUserBalance(balance);
|
||||
transactionDetailsService.save(transactionDetailsEntity);
|
||||
|
||||
|
||||
// 插入 花生币 充值记录
|
||||
// PayPaymentOrderEntity payPaymentOrderEntity = new PayPaymentOrderEntity();
|
||||
// payPaymentOrderEntity.setUserId(Integer.valueOf(id));
|
||||
// payPaymentOrderEntity.setRealAmount(new BigDecimal(byId.getPeanutCoin()));
|
||||
// payPaymentOrderEntity.setRechargeAmount(new BigDecimal(i));
|
||||
// payPaymentOrderEntity.setRechargeChannel("后台手动充值");
|
||||
// payPaymentOrderEntity.setRechargeStatus("success");
|
||||
// payPaymentOrderEntity.setSuccessTime(new Date());
|
||||
// payPaymentOrderService.save(payPaymentOrderEntity);
|
||||
userService.updateById(byId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.peanut.modules.book.vo.ShopCartVo;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.OrderCartEntity;
|
||||
import com.peanut.modules.book.service.OrderCartService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 购物车
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/ordercart")
|
||||
public class OrderCartController {
|
||||
@Autowired
|
||||
private OrderCartService orderCartService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:ordercart:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = orderCartService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{cartId}")
|
||||
// @RequiresPermissions("book:ordercart:info")
|
||||
public R info(@PathVariable("cartId") Integer cartId){
|
||||
OrderCartEntity orderCart = orderCartService.getById(cartId);
|
||||
|
||||
return R.ok().put("orderCart", orderCart);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:ordercart:save")
|
||||
public R save(@RequestBody OrderCartEntity orderCart){
|
||||
orderCartService.save(orderCart);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:ordercart:update")
|
||||
public R update(@RequestBody OrderCartEntity orderCart){
|
||||
orderCartService.updateById(orderCart);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:ordercart:delete")
|
||||
public R delete(@RequestBody Integer[] cartIds){
|
||||
orderCartService.removeByIds(Arrays.asList(cartIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户获取购物车列表
|
||||
*/
|
||||
@RequestMapping("/getCartList")
|
||||
// @RequiresPermissions("book:ordercart:delete")
|
||||
public R getCartList(@RequestParam("userId") Integer userId){
|
||||
List<ShopCartVo> cartList = orderCartService.getCartList(userId);
|
||||
|
||||
return R.ok().put("cartList",cartList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.PayPaymentOrderEntity;
|
||||
import com.peanut.modules.book.service.PayPaymentOrderService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 充值订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/paypaymentorder")
|
||||
public class PayPaymentOrderController {
|
||||
@Autowired
|
||||
private PayPaymentOrderService payPaymentOrderService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:paypaymentorder:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = payPaymentOrderService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:paypaymentorder:info")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
PayPaymentOrderEntity payPaymentOrder = payPaymentOrderService.getById(id);
|
||||
|
||||
return R.ok().put("payPaymentOrder", payPaymentOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:paypaymentorder:save")
|
||||
public R save(@RequestBody PayPaymentOrderEntity payPaymentOrder){
|
||||
payPaymentOrderService.save(payPaymentOrder);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:paypaymentorder:update")
|
||||
public R update(@RequestBody PayPaymentOrderEntity payPaymentOrder){
|
||||
payPaymentOrderService.updateById(payPaymentOrder);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:paypaymentorder:delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
payPaymentOrderService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.PayZfbOrderEntity;
|
||||
import com.peanut.modules.book.service.PayZfbOrderService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 支付宝订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/payzfborder")
|
||||
public class PayZfbOrderController {
|
||||
@Autowired
|
||||
private PayZfbOrderService payZfbOrderService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:payzfborder:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = payZfbOrderService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:payzfborder:info")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
PayZfbOrderEntity payZfbOrder = payZfbOrderService.getById(id);
|
||||
|
||||
return R.ok().put("payZfbOrder", payZfbOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:payzfborder:save")
|
||||
public R save(@RequestBody PayZfbOrderEntity payZfbOrder){
|
||||
payZfbOrderService.save(payZfbOrder);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:payzfborder:update")
|
||||
public R update(@RequestBody PayZfbOrderEntity payZfbOrder){
|
||||
payZfbOrderService.updateById(payZfbOrder);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:payzfborder:delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
payZfbOrderService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.CityEntity;
|
||||
import com.peanut.modules.book.entity.CountyEntity;
|
||||
import com.peanut.modules.book.entity.ProvinceEntity;
|
||||
import com.peanut.modules.book.service.CityService;
|
||||
import com.peanut.modules.book.service.CountyService;
|
||||
import com.peanut.modules.book.service.ProvinceService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/province")
|
||||
public class ProvinceController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ProvinceService provinceService;
|
||||
@Autowired
|
||||
private CityService cityService;
|
||||
@Autowired
|
||||
private CountyService countyService;
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
|
||||
//获取地址
|
||||
@RequestMapping("/getProvince")
|
||||
public R getProvince(){
|
||||
|
||||
|
||||
//优化查询速度 目录放入redis中
|
||||
String s = redisTemplate.opsForValue().get("Province");
|
||||
List<Map<String, Object>> listData = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(s)) {
|
||||
List<Object> redisData = JSONArray.parseArray(s);
|
||||
for (Object object : redisData) {
|
||||
Map <String,Object> ret = (Map<String, Object>) object;//取出list里面的值转为map
|
||||
listData.add(ret);
|
||||
}
|
||||
return R.ok().put("provinceEntity",listData);
|
||||
}
|
||||
List<ProvinceEntity> provinceEntityList = provinceService.getCity();
|
||||
redisTemplate.opsForValue().set("Province", JSON.toJSONString(provinceEntityList));
|
||||
return R.ok().put("provinceEntity",provinceEntityList);
|
||||
}
|
||||
|
||||
//获取省列表
|
||||
@RequestMapping("/getProvinceList")
|
||||
public R getProvinceList(){
|
||||
List<ProvinceEntity> provinceList = provinceService.getBaseMapper().selectList(new QueryWrapper<ProvinceEntity>());
|
||||
|
||||
return R.ok().put("provinceList",provinceList);
|
||||
}
|
||||
|
||||
//获取市列表
|
||||
@RequestMapping("/getCityList")
|
||||
public R getCityList(@RequestParam("provId") Integer provId){
|
||||
List<CityEntity> prov = cityService.getBaseMapper().selectList(new QueryWrapper<CityEntity>()
|
||||
.eq("prov_id", provId));
|
||||
|
||||
return R.ok().put("prov",prov);
|
||||
}
|
||||
|
||||
//获取区列表
|
||||
@RequestMapping("/getCountyList")
|
||||
public R getCountyList(@RequestParam("cityId") Integer cityId){
|
||||
List<CountyEntity> countyList = countyService.getBaseMapper().selectList(new QueryWrapper<CountyEntity>().eq("city_id", cityId));
|
||||
|
||||
|
||||
return R.ok().put("countyList",countyList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.AuthorEntity;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.PublisherEntity;
|
||||
import com.peanut.modules.book.service.PublisherService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 出版商表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/publisher")
|
||||
public class PublisherController {
|
||||
@Autowired
|
||||
private PublisherService publisherService;
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
@RequiresPermissions("book:publisher:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = publisherService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/publisherList")
|
||||
// @RequiresPermissions("book:publisher:list")
|
||||
public R publisherList(){
|
||||
List<PublisherEntity> publisherEntities = publisherService.getBaseMapper().selectList(new QueryWrapper<PublisherEntity>());
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
for (PublisherEntity publisherEntitie : publisherEntities) {
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("id",publisherEntitie.getId());
|
||||
map.put("value",publisherEntitie.getPublisherName());
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
return R.ok().put("list", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
@RequiresPermissions("book:publisher:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
PublisherEntity publisher = publisherService.getById(id);
|
||||
|
||||
return R.ok().put("publisher", publisher);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/appGetInfo/{id}/{limit}/{page}")
|
||||
// @RequiresPermissions("book:author:info")
|
||||
public R appGetInfo(@PathVariable("id") Integer id,
|
||||
@PathVariable("limit") String limit,
|
||||
@PathVariable("page") String page){
|
||||
PublisherEntity publisherEntity = publisherService.getById(id);
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("publisherName",publisherEntity.getPublisherName());
|
||||
map.put("limit",limit);
|
||||
map.put("page",page);
|
||||
PageUtils pageUtils = bookService.queryPage(map);
|
||||
return R.ok().put("publisherInfo", publisherEntity).put("publisherBooks",pageUtils);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequiresPermissions("book:publisher:save")
|
||||
public R save(@RequestBody PublisherEntity publisher){
|
||||
publisherService.save(publisher);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("book:publisher:update")
|
||||
public R update(@RequestBody PublisherEntity publisher){
|
||||
publisherService.updateById(publisher);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
@RequiresPermissions("book:publisher:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
publisherService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.SeckillProdRelationEntity;
|
||||
import com.peanut.modules.book.service.SeckillProdRelationService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 秒杀商品表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 11:24:05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/seckillprodrelation")
|
||||
public class SeckillProdRelationController {
|
||||
@Autowired
|
||||
private SeckillProdRelationService seckillProdRelationService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:seckillprodrelation:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = seckillProdRelationService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:seckillprodrelation:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
SeckillProdRelationEntity seckillProdRelation = seckillProdRelationService.getById(id);
|
||||
|
||||
return R.ok().put("seckillProdRelation", seckillProdRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:seckillprodrelation:save")
|
||||
public R save(@RequestBody SeckillProdRelationEntity seckillProdRelation){
|
||||
|
||||
//判断当前场次 是否有相同商品
|
||||
|
||||
Integer prodId = seckillProdRelation.getProdId();
|
||||
|
||||
Integer promotionSeckillId = seckillProdRelation.getPromotionSeckillId();
|
||||
|
||||
List<SeckillProdRelationEntity> list = seckillProdRelationService.list(new QueryWrapper<SeckillProdRelationEntity>().eq("promotion_seckill_id", promotionSeckillId));
|
||||
|
||||
for (SeckillProdRelationEntity seckillProdRelationEntity : list) {
|
||||
Integer prodId1 = seckillProdRelationEntity.getProdId();
|
||||
if (prodId1 == prodId){
|
||||
return R.error("商品已存在");
|
||||
}
|
||||
}
|
||||
|
||||
seckillProdRelationService.save(seckillProdRelation);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:seckillprodrelation:update")
|
||||
public R update(@RequestBody SeckillProdRelationEntity seckillProdRelation){
|
||||
seckillProdRelationService.updateById(seckillProdRelation);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:seckillprodrelation:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
seckillProdRelationService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.ShopCategoryEntity;
|
||||
import com.peanut.modules.book.service.ShopCategoryService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品三级分类
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-30 15:06:20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/shopcategory")
|
||||
public class ShopCategoryController {
|
||||
@Autowired
|
||||
private ShopCategoryService shopCategoryService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:shopcategory:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = shopCategoryService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 三级分类
|
||||
*/
|
||||
@RequestMapping("listTree")
|
||||
// @RequiresPermissions("app:tcurriculumcatalogue:list")
|
||||
public R listTree(){
|
||||
List<ShopCategoryEntity> listTree = shopCategoryService.listTree();
|
||||
return R.ok().put("data",listTree);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{catId}")
|
||||
// @RequiresPermissions("book:shopcategory:info")
|
||||
public R info(@PathVariable("catId") Long catId){
|
||||
ShopCategoryEntity shopCategory = shopCategoryService.getById(catId);
|
||||
|
||||
return R.ok().put("shopCategory", shopCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:shopcategory:save")
|
||||
public R save(@RequestBody ShopCategoryEntity shopCategory){
|
||||
shopCategoryService.save(shopCategory);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:shopcategory:update")
|
||||
public R update(@RequestBody ShopCategoryEntity shopCategory){
|
||||
shopCategoryService.updateById(shopCategory);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:shopcategory:delete")
|
||||
public R delete(@RequestBody Long[] catIds){
|
||||
shopCategoryService.removeByIds(Arrays.asList(catIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除前检查
|
||||
*/
|
||||
@RequestMapping("/deleteCheck")
|
||||
// @RequiresPermissions("app:tcurriculumcatalogue:delete")
|
||||
public R deleteCheck(@RequestBody String[] oids){
|
||||
shopCategoryService.removeCheckByIds(Arrays.asList(oids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品 一级分类
|
||||
*/
|
||||
@RequestMapping("/getOneLevel")
|
||||
public R getOneLevel(){
|
||||
List<ShopCategoryEntity> list = shopCategoryService.getOneLevel();
|
||||
|
||||
return R.ok().put("list",list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品 二级分类
|
||||
*/
|
||||
@RequestMapping("/getTwoLevel")
|
||||
public R getTwoLevel(@RequestParam("catId") Integer catId){
|
||||
List<ShopCategoryEntity> list = shopCategoryService.getTwoLevel(catId);
|
||||
|
||||
return R.ok().put("list",list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.service.ShopCategoryService;
|
||||
import com.peanut.modules.book.vo.ShopProductVo;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.ShopProductEntity;
|
||||
import com.peanut.modules.book.service.ShopProductService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 09:43:14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/shopproduct")
|
||||
public class ShopProductController {
|
||||
@Autowired
|
||||
private ShopProductService shopProductService;
|
||||
@Autowired
|
||||
private ShopCategoryService shopCategoryService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:shopproduct:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = shopProductService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{productId}")
|
||||
// @RequiresPermissions("book:shopproduct:info")
|
||||
public R info(@PathVariable("productId") Integer productId){
|
||||
|
||||
ShopProductEntity shopProduct = shopProductService.getById(productId);
|
||||
Integer poid = shopProduct.getProductPid();
|
||||
List<Integer> poids = shopCategoryService.findPoid(poid);
|
||||
shopProduct.setPoids(poids);
|
||||
return R.ok().put("shopProduct", shopProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:shopproduct:save")
|
||||
public R save(@RequestBody ShopProductEntity shopProduct){
|
||||
shopProduct.setCreateTime(new Date());
|
||||
shopProductService.save(shopProduct);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:shopproduct:update")
|
||||
public R update(@RequestBody ShopProductEntity shopProduct){
|
||||
shopProductService.updateById(shopProduct);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:shopproduct:delete")
|
||||
public R delete(@RequestBody Integer[] productIds){
|
||||
shopProductService.removeByIds(Arrays.asList(productIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/appGetList")
|
||||
public R appGetList(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = shopProductService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类下商品列表
|
||||
*/
|
||||
@RequestMapping("/appGetCategoryList")
|
||||
public R appGetCategoryList(@RequestParam("catId") Integer catId){
|
||||
List<ShopProductEntity> list = shopProductService.appGetCategoryList(catId);
|
||||
|
||||
return R.ok().put("list", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 远程搜索
|
||||
*/
|
||||
@RequestMapping("/prodSearch")
|
||||
public R prodSearch(){
|
||||
List<ShopProductEntity> list = shopProductService.list(new QueryWrapper<ShopProductEntity>().select("product_id,product_name"));
|
||||
List<ShopProductVo> collect = list.stream().map(shopProductEntity -> {
|
||||
ShopProductVo shopProductVo = new ShopProductVo();
|
||||
shopProductVo.setProductId(shopProductEntity.getProductId());
|
||||
shopProductVo.setValue(shopProductEntity.getProductName());
|
||||
return shopProductVo;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
||||
return R.ok().put("list", collect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券获取商品信息
|
||||
*/
|
||||
@RequestMapping("/backProdSearch")
|
||||
public R backProdSearch(@RequestParam Map<String, Object> params){
|
||||
|
||||
String productName = (String) params.get("productName");
|
||||
|
||||
List<ShopProductEntity> list = shopProductService.list(new QueryWrapper<ShopProductEntity>()
|
||||
.like("product_name",productName));
|
||||
|
||||
return R.ok().put("list", list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.peanut.modules.book.to.SeckillRedisTo;
|
||||
import com.peanut.modules.book.vo.SeckillProdVo;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.peanut.modules.book.entity.ShopSeckillEntity;
|
||||
import com.peanut.modules.book.service.ShopSeckillService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 秒杀库存表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 11:24:05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/shopseckill")
|
||||
public class ShopSeckillController {
|
||||
@Autowired
|
||||
private ShopSeckillService shopSeckillService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:shopseckill:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = shopSeckillService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{seckillId}")
|
||||
// @RequiresPermissions("book:shopseckill:info")
|
||||
public R info(@PathVariable("seckillId") Long seckillId){
|
||||
ShopSeckillEntity shopSeckill = shopSeckillService.getById(seckillId);
|
||||
|
||||
return R.ok().put("shopSeckill", shopSeckill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:shopseckill:save")
|
||||
public R save(@RequestBody ShopSeckillEntity shopSeckill){
|
||||
shopSeckillService.save(shopSeckill);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:shopseckill:update")
|
||||
public R update(@RequestBody ShopSeckillEntity shopSeckill){
|
||||
shopSeckillService.updateById(shopSeckill);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:shopseckill:delete")
|
||||
public R delete(@RequestBody Long[] seckillIds){
|
||||
shopSeckillService.removeByIds(Arrays.asList(seckillIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/getSeckillProd")
|
||||
public R getSeckillProd(){
|
||||
List<SeckillRedisTo> list = shopSeckillService.getCurrentSeckillProd();
|
||||
|
||||
return R.ok().put("list",list);
|
||||
}
|
||||
|
||||
@GetMapping("/kill")
|
||||
public R kill(@RequestParam("killId") String killId,
|
||||
@RequestParam("key") String key,
|
||||
@RequestParam("num") Integer num,
|
||||
@RequestParam("userId") Integer userId){
|
||||
String orderId = shopSeckillService.kill(killId,key,num,userId);
|
||||
|
||||
return R.ok().put("orderId",orderId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.TransactionDetailsEntity;
|
||||
import com.peanut.modules.book.service.TransactionDetailsService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 交易明细
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:47:50
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/transactiondetails")
|
||||
public class TransactionDetailsController {
|
||||
@Autowired
|
||||
private TransactionDetailsService transactionDetailsService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:transactiondetails:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = transactionDetailsService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{transactionId}")
|
||||
// @RequiresPermissions("book:transactiondetails:info")
|
||||
public R info(@PathVariable("transactionId") Integer transactionId){
|
||||
TransactionDetailsEntity transactionDetails = transactionDetailsService.getById(transactionId);
|
||||
|
||||
return R.ok().put("transactionDetails", transactionDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:transactiondetails:save")
|
||||
public R save(@RequestBody TransactionDetailsEntity transactionDetails){
|
||||
transactionDetailsService.save(transactionDetails);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:transactiondetails:update")
|
||||
public R update(@RequestBody TransactionDetailsEntity transactionDetails){
|
||||
transactionDetailsService.updateById(transactionDetails);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:transactiondetails:delete")
|
||||
public R delete(@RequestBody Integer[] transactionIds){
|
||||
transactionDetailsService.removeByIds(Arrays.asList(transactionIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.UserAddressEntity;
|
||||
import com.peanut.modules.book.service.UserAddressService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-31 11:20:32
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/useraddress")
|
||||
public class UserAddressController {
|
||||
@Autowired
|
||||
private UserAddressService userAddressService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:useraddress:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = userAddressService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{addressid}")
|
||||
// @RequiresPermissions("book:useraddress:info")
|
||||
public R info(@PathVariable("addressid") Integer addressid){
|
||||
UserAddressEntity userAddress = userAddressService.getById(addressid);
|
||||
|
||||
return R.ok().put("userAddress", userAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:useraddress:save")
|
||||
public R save(@RequestBody UserAddressEntity userAddress){
|
||||
|
||||
Integer isdefault = userAddress.getIsdefault();
|
||||
|
||||
if (isdefault == 1) {
|
||||
|
||||
Integer userid = userAddress.getUserid();
|
||||
|
||||
List<UserAddressEntity> list = userAddressService.list(new QueryWrapper<UserAddressEntity>().eq("userId", userid));
|
||||
|
||||
for (UserAddressEntity userAddressEntity : list) {
|
||||
if (userAddressEntity.getIsdefault() == 1) {
|
||||
|
||||
userAddressEntity.setIsdefault(0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
userAddressService.save(userAddress);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:useraddress:update")
|
||||
public R update(@RequestBody UserAddressEntity userAddress){
|
||||
|
||||
Integer isdefault = userAddress.getIsdefault();
|
||||
|
||||
if (isdefault == 1) {
|
||||
|
||||
Integer userid = userAddress.getUserid();
|
||||
|
||||
List<UserAddressEntity> list = userAddressService.list(new QueryWrapper<UserAddressEntity>().eq("userId", userid));
|
||||
|
||||
for (UserAddressEntity userAddressEntity : list) {
|
||||
if (userAddressEntity.getIsdefault() == 1) {
|
||||
userAddressEntity.setIsdefault(0);
|
||||
userAddressService.updateById(userAddressEntity);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
userAddressService.updateById(userAddress);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:useraddress:delete")
|
||||
public R delete(@RequestBody Integer[] addressids){
|
||||
userAddressService.removeByIds(Arrays.asList(addressids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* app获取用户 收货地址
|
||||
*/
|
||||
@RequestMapping("/getUserAddress")
|
||||
// @RequiresPermissions("book:useraddress:delete")
|
||||
public R getUserAddress(@RequestParam("userId") Integer userId){
|
||||
|
||||
List<UserAddressEntity> list = userAddressService.list(new QueryWrapper<UserAddressEntity>().eq("userId", userId).orderByDesc("isDefault"));
|
||||
|
||||
return R.ok().put("list",list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
||||
import com.peanut.modules.book.service.UserEbookBuyService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 用户购买书籍表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-18 16:28:20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("book/userebookbuy")
|
||||
public class UserEbookBuyController {
|
||||
@Autowired
|
||||
private UserEbookBuyService userEbookBuyService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:userebookbuy:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = userEbookBuyService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{buyId}")
|
||||
// @RequiresPermissions("book:userebookbuy:info")
|
||||
public R info(@PathVariable("buyId") Integer buyId){
|
||||
UserEbookBuyEntity userEbookBuy = userEbookBuyService.getById(buyId);
|
||||
|
||||
return R.ok().put("userEbookBuy", userEbookBuy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
// @RequiresPermissions("book:userebookbuy:save")
|
||||
public R save(@RequestBody UserEbookBuyEntity userEbookBuy){
|
||||
userEbookBuyService.save(userEbookBuy);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
// @RequiresPermissions("book:userebookbuy:update")
|
||||
public R update(@RequestBody UserEbookBuyEntity userEbookBuy){
|
||||
userEbookBuyService.updateById(userEbookBuy);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:userebookbuy:delete")
|
||||
public R delete(@RequestBody Integer[] buyIds){
|
||||
userEbookBuyService.removeByIds(Arrays.asList(buyIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
21
src/main/java/com/peanut/modules/book/dao/ActivityDao.java
Normal file
21
src/main/java/com/peanut/modules/book/dao/ActivityDao.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.book.entity.ActivityEntity;
|
||||
import com.peanut.modules.book.entity.BuyOrderEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface ActivityDao extends BaseMapper<ActivityEntity> {
|
||||
|
||||
|
||||
}
|
||||
17
src/main/java/com/peanut/modules/book/dao/AuthorDao.java
Normal file
17
src/main/java/com/peanut/modules/book/dao/AuthorDao.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.AuthorEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 作者表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@Mapper
|
||||
public interface AuthorDao extends BaseMapper<AuthorEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.BookBrowseRecordsEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 阅读记录
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookBrowseRecordsDao extends BaseMapper<BookBrowseRecordsEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.BookBuyConfigEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-17 14:54:08
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookBuyConfigDao extends BaseMapper<BookBuyConfigEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.BookChapterContentEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-16 14:32:06
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookChapterContentDao extends BaseMapper<BookChapterContentEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.BookChapterEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-12 09:53:25
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookChapterDao extends BaseMapper<BookChapterEntity> {
|
||||
|
||||
}
|
||||
22
src/main/java/com/peanut/modules/book/dao/BookDao.java
Normal file
22
src/main/java/com/peanut/modules/book/dao/BookDao.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 图书表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookDao extends BaseMapper<BookEntity> {
|
||||
|
||||
List<BookEntity> queryBookInOther(String publisherName,String authorName);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.BookReadRateEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 阅读进度表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookReadRateDao extends BaseMapper<BookReadRateEntity> {
|
||||
|
||||
}
|
||||
17
src/main/java/com/peanut/modules/book/dao/BookShelfDao.java
Normal file
17
src/main/java/com/peanut/modules/book/dao/BookShelfDao.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.BookShelfEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 书架表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookShelfDao extends BaseMapper<BookShelfEntity> {
|
||||
|
||||
}
|
||||
23
src/main/java/com/peanut/modules/book/dao/BuyOrderDao.java
Normal file
23
src/main/java/com/peanut/modules/book/dao/BuyOrderDao.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.peanut.modules.book.entity.BuyOrderEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface BuyOrderDao extends BaseMapper<BuyOrderEntity> {
|
||||
|
||||
public List<BuyOrderEntity> queryListByOrderIds(Integer[] ids);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.BuyOrderDetailEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品订单详情表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface BuyOrderDetailDao extends BaseMapper<BuyOrderDetailEntity> {
|
||||
|
||||
public List<BuyOrderDetailEntity> queryListByOrderIds(Integer[] ids);
|
||||
|
||||
}
|
||||
17
src/main/java/com/peanut/modules/book/dao/CityDao.java
Normal file
17
src/main/java/com/peanut/modules/book/dao/CityDao.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.book.entity.CityEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-27 16:07:59
|
||||
*/
|
||||
@Mapper
|
||||
public interface CityDao extends BaseMapper<CityEntity> {
|
||||
|
||||
}
|
||||
17
src/main/java/com/peanut/modules/book/dao/CountyDao.java
Normal file
17
src/main/java/com/peanut/modules/book/dao/CountyDao.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.book.entity.CountyEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 县/区
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-27 16:07:59
|
||||
*/
|
||||
@Mapper
|
||||
public interface CountyDao extends BaseMapper<CountyEntity> {
|
||||
|
||||
}
|
||||
17
src/main/java/com/peanut/modules/book/dao/CouponDao.java
Normal file
17
src/main/java/com/peanut/modules/book/dao/CouponDao.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@Mapper
|
||||
public interface CouponDao extends BaseMapper<CouponEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponHistoryEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@Mapper
|
||||
public interface CouponHistoryDao extends BaseMapper<CouponHistoryEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponProductCategoryRelationEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@Mapper
|
||||
public interface CouponProductCategoryRelationDao extends BaseMapper<CouponProductCategoryRelationEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponProductRelationEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@Mapper
|
||||
public interface CouponProductRelationDao extends BaseMapper<CouponProductRelationEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.book.entity.FMSCommodity;
|
||||
import com.peanut.modules.book.entity.FMSOrderEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递发货
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface FMSCommodityDao extends BaseMapper<FMSCommodity> {
|
||||
|
||||
/**
|
||||
* 批量保存快递信息
|
||||
*
|
||||
* @param fmsOrderList
|
||||
* @return
|
||||
*/
|
||||
public int batchInsert(List<FMSCommodity> fmsOrderList);
|
||||
|
||||
}
|
||||
28
src/main/java/com/peanut/modules/book/dao/FMSOrderDao.java
Normal file
28
src/main/java/com/peanut/modules/book/dao/FMSOrderDao.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.book.entity.BuyOrderEntity;
|
||||
import com.peanut.modules.book.entity.FMSOrderEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递发货
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface FMSOrderDao extends BaseMapper<FMSOrderEntity> {
|
||||
|
||||
/**
|
||||
* 批量保存快递信息
|
||||
*
|
||||
* @param fmsOrderList
|
||||
* @return
|
||||
*/
|
||||
public int batchInsert(List<FMSOrderEntity> fmsOrderList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.book.entity.FMSOrderDetailEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface FMSOrderDetailDao extends BaseMapper<FMSOrderDetailEntity> {
|
||||
|
||||
}
|
||||
17
src/main/java/com/peanut/modules/book/dao/MyUserDao.java
Normal file
17
src/main/java/com/peanut/modules/book/dao/MyUserDao.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-10 14:20:12
|
||||
*/
|
||||
@Mapper
|
||||
public interface MyUserDao extends BaseMapper<MyUserEntity> {
|
||||
|
||||
}
|
||||
19
src/main/java/com/peanut/modules/book/dao/OrderCartDao.java
Normal file
19
src/main/java/com/peanut/modules/book/dao/OrderCartDao.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.OrderCartEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 购物车
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderCartDao extends BaseMapper<OrderCartEntity> {
|
||||
|
||||
OrderCartEntity getDeteleOrderCart(Integer userId,Integer productId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.PayPaymentOrderEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 充值订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface PayPaymentOrderDao extends BaseMapper<PayPaymentOrderEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.PayZfbOrderEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 支付宝订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface PayZfbOrderDao extends BaseMapper<PayZfbOrderEntity> {
|
||||
|
||||
}
|
||||
17
src/main/java/com/peanut/modules/book/dao/ProvinceDao.java
Normal file
17
src/main/java/com/peanut/modules/book/dao/ProvinceDao.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.book.entity.ProvinceEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-27 16:07:59
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProvinceDao extends BaseMapper<ProvinceEntity> {
|
||||
|
||||
}
|
||||
17
src/main/java/com/peanut/modules/book/dao/PublisherDao.java
Normal file
17
src/main/java/com/peanut/modules/book/dao/PublisherDao.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.PublisherEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 出版商表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@Mapper
|
||||
public interface PublisherDao extends BaseMapper<PublisherEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.SeckillProdRelationEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 秒杀商品表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 11:24:05
|
||||
*/
|
||||
@Mapper
|
||||
public interface SeckillProdRelationDao extends BaseMapper<SeckillProdRelationEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.ShopCategoryEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 商品三级分类
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-30 15:06:20
|
||||
*/
|
||||
@Mapper
|
||||
public interface ShopCategoryDao extends BaseMapper<ShopCategoryEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.ShopProductEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 09:43:14
|
||||
*/
|
||||
@Mapper
|
||||
public interface ShopProductDao extends BaseMapper<ShopProductEntity> {
|
||||
|
||||
List<ShopProductEntity> appGetCategoryList(Integer catId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.ShopSeckillEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 秒杀库存表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 11:24:05
|
||||
*/
|
||||
@Mapper
|
||||
public interface ShopSeckillDao extends BaseMapper<ShopSeckillEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.TransactionDetailsEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 交易明细
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:47:50
|
||||
*/
|
||||
@Mapper
|
||||
public interface TransactionDetailsDao extends BaseMapper<TransactionDetailsEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.UserAddressEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-31 11:20:32
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserAddressDao extends BaseMapper<UserAddressEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户购买书籍表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-18 16:28:20
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserEbookBuyDao extends BaseMapper<UserEbookBuyEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 活动实体
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_activity")
|
||||
public class ActivityCouponEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 关联活动ID
|
||||
*/
|
||||
private Integer activityId;
|
||||
|
||||
/**
|
||||
* 关联优惠券Id
|
||||
*/
|
||||
private Integer couponId;
|
||||
|
||||
/**
|
||||
* 关联商品Id
|
||||
*/
|
||||
private Integer productId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 活动实体
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_activity")
|
||||
public class ActivityEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
private String activityName;
|
||||
|
||||
/**
|
||||
* 活动类型 0:长期活动,1:短期活动
|
||||
*/
|
||||
private String activityType;
|
||||
|
||||
/**
|
||||
* 活动方式
|
||||
* 0:注册
|
||||
* 1:购物
|
||||
* 2:充值
|
||||
* 3:会员卡
|
||||
* 4:一路健康推广
|
||||
*/
|
||||
private String activityManner;
|
||||
|
||||
/**
|
||||
* 活动内容
|
||||
* 0:购买商品
|
||||
* 1:满N送券
|
||||
* 2:满N减N
|
||||
*/
|
||||
private String activityContent;
|
||||
|
||||
/**
|
||||
* 积分
|
||||
*/
|
||||
private Integer point;
|
||||
|
||||
/**
|
||||
* 时效
|
||||
*/
|
||||
private String validity;
|
||||
|
||||
/**
|
||||
* 活动开始时间
|
||||
*/
|
||||
private Date beginTime;
|
||||
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 活动封面地址
|
||||
*/
|
||||
private String activityUrl;
|
||||
|
||||
/**
|
||||
* 当前状态 0:全部,1:生效,2:已过期
|
||||
*/
|
||||
private String currentState;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 活动,商品,优惠券,集合
|
||||
*/
|
||||
private List<ActivityCouponEntity> activityCouponList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 作者表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@Data
|
||||
@TableName("author")
|
||||
public class AuthorEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 作者姓名
|
||||
*/
|
||||
private String authorName;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Integer age;
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String tel;
|
||||
/**
|
||||
* 住址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)//更新注解
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 阅读记录
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Data
|
||||
@TableName("book_browse_records")
|
||||
public class BookBrowseRecordsEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 图书id
|
||||
*/
|
||||
private Integer bookId;
|
||||
/**
|
||||
* 图书名称
|
||||
*/
|
||||
private String bookName;
|
||||
/**
|
||||
* 章节id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer chapterId;
|
||||
/**
|
||||
* 章节名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String chapterName;
|
||||
/**
|
||||
* num
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer chapterNum;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String images;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-17 14:54:08
|
||||
*/
|
||||
@Data
|
||||
@TableName("book_buy_config")
|
||||
public class BookBuyConfigEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer priceTypeId;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
private String qudao;
|
||||
/**
|
||||
* 真实价格
|
||||
*/
|
||||
private String realMoney;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private String money;
|
||||
/**
|
||||
* vip开通月份
|
||||
*/
|
||||
private String month;
|
||||
/**
|
||||
* 充值名称
|
||||
*/
|
||||
private String description;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-16 14:32:06
|
||||
*/
|
||||
@Data
|
||||
@TableName("book_chapter_content")
|
||||
public class BookChapterContentEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer bookId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer bookChatperId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer number;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String voices;
|
||||
|
||||
private String otherContent;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)//更新注解
|
||||
private Date updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String picAndWord;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-12 09:53:25
|
||||
*/
|
||||
@Data
|
||||
@TableName("book_chapter")
|
||||
public class BookChapterEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 图书id
|
||||
*/
|
||||
private Integer bookId;
|
||||
/**
|
||||
* 章节号
|
||||
*/
|
||||
private Integer number;
|
||||
/**
|
||||
* 章节
|
||||
*/
|
||||
private String chapter;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 音频文件地址
|
||||
*/
|
||||
private String voices;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)//更新注解
|
||||
private Date updateTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
156
src/main/java/com/peanut/modules/book/entity/BookEntity.java
Normal file
156
src/main/java/com/peanut/modules/book/entity/BookEntity.java
Normal file
@@ -0,0 +1,156 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 图书表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@Data
|
||||
@TableName("book")
|
||||
public class BookEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 书名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 作者id
|
||||
*/
|
||||
private String authorId;
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 序言
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 秒杀
|
||||
*/
|
||||
private Integer isSale;
|
||||
/**
|
||||
* 付费类型
|
||||
*/
|
||||
@TableField("isVip")
|
||||
private Integer isVip;
|
||||
/**
|
||||
* 免费章节数
|
||||
*/
|
||||
private Integer freeChapterCount;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal salePrice;
|
||||
/**
|
||||
* 是否加入书架
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private boolean flag;
|
||||
/**
|
||||
* 置顶
|
||||
*/
|
||||
private Integer istop;
|
||||
/**
|
||||
* 出版商id
|
||||
*/
|
||||
private String publisherId;
|
||||
/**
|
||||
* 插图
|
||||
*/
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 插图 多图
|
||||
*/
|
||||
private String imagesList;
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
private Integer pid;
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
private String level;
|
||||
/**
|
||||
* 章节处理状态 0-未处理 1-处理中 2-成功 3-失败
|
||||
*/
|
||||
private String chapterStatus;
|
||||
/**
|
||||
* 内容处理状态 0-未处理 1-处理中 2-成功 3-失败
|
||||
*/
|
||||
private String contentStatus;
|
||||
/**
|
||||
* 音频处理状态 0-未处理 1-处理中 2-成功 3-失败
|
||||
*/
|
||||
private String voicesStatus;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)//更新注解
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
private Integer state;
|
||||
|
||||
private String novel;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String publisherName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String authorName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer chapterId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String chapterName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer chapterNum;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer isBuy;
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 阅读进度表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Data
|
||||
@TableName("book_read_rate")
|
||||
public class BookReadRateEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 图书id
|
||||
*/
|
||||
private Integer bookId;
|
||||
/**
|
||||
* 章节id
|
||||
*/
|
||||
private Integer chapterId;
|
||||
/**
|
||||
* 章节名称
|
||||
*/
|
||||
private String chapterName;
|
||||
/**
|
||||
* 章节百分比
|
||||
*/
|
||||
private Integer precent;
|
||||
/**
|
||||
* 章节内容id
|
||||
*/
|
||||
private Integer contentId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
/**
|
||||
* dom的Dep 用来存前端传来上下定位的
|
||||
*/
|
||||
private String domDep;
|
||||
|
||||
/**
|
||||
* dom的Value 用来存前端传来上下定位的
|
||||
*/
|
||||
private String domValue;
|
||||
|
||||
/**
|
||||
* dom的domVmCount 用来存前端传来上下定位的
|
||||
*/
|
||||
private Integer domVmCount;
|
||||
|
||||
/**
|
||||
* 阅读ID
|
||||
*/
|
||||
private String domId;
|
||||
/**
|
||||
* 与底部的距离
|
||||
*/
|
||||
private Integer bottomGap;
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private Integer heightGap;
|
||||
/**
|
||||
* 与左边的距离
|
||||
*/
|
||||
private Integer leftGap;
|
||||
/**
|
||||
*与右边的距离
|
||||
*/
|
||||
private Integer rightGap;
|
||||
/**
|
||||
*与头部的距离
|
||||
*/
|
||||
private Integer topGap;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private Integer widthGap;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 书架表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Data
|
||||
@TableName("book_shelf")
|
||||
public class BookShelfEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer bookId;
|
||||
/**
|
||||
* 书名
|
||||
*/
|
||||
private String bookName;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 商品订单详情表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Data
|
||||
@TableName("buy_order_detail")
|
||||
public class BuyOrderDetailEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订单详情id
|
||||
*/
|
||||
@TableId
|
||||
private Long allOrderId;
|
||||
/**
|
||||
* 订单表id
|
||||
*/
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Integer productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 商品单价
|
||||
*/
|
||||
private BigDecimal productPrice;
|
||||
/**
|
||||
* 商品重量
|
||||
*/
|
||||
private Float weight;
|
||||
/**
|
||||
* 商品类型
|
||||
*/
|
||||
private String productType;
|
||||
|
||||
private String shippingSn;
|
||||
private String orderStatus;
|
||||
private String remark;
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date creatTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 地址id
|
||||
*/
|
||||
private Integer addressId;
|
||||
|
||||
|
||||
/**
|
||||
* 面单html
|
||||
*/
|
||||
private String fmsHtml;
|
||||
|
||||
/**
|
||||
* 快递公司编码
|
||||
*/
|
||||
private String shipperCode;
|
||||
|
||||
/**
|
||||
* 快递公司名称
|
||||
*/
|
||||
private String shipperName;
|
||||
|
||||
/**
|
||||
* 是否已打印 0: 未打印,1:已打印
|
||||
*/
|
||||
private String isPrint;
|
||||
|
||||
/**
|
||||
* 商品图片地址
|
||||
*/
|
||||
private String productUrl;
|
||||
|
||||
}
|
||||
178
src/main/java/com/peanut/modules/book/entity/BuyOrderEntity.java
Normal file
178
src/main/java/com/peanut/modules/book/entity/BuyOrderEntity.java
Normal file
@@ -0,0 +1,178 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Data
|
||||
@TableName("buy_order")
|
||||
public class BuyOrderEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer orderId;
|
||||
/**
|
||||
* 订单编号 yyyymmddnnnnnnnn’
|
||||
*/
|
||||
private String orderSn;
|
||||
/**
|
||||
* 下单人ID
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 下单人姓名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
/**
|
||||
* 收货人姓名
|
||||
*/
|
||||
private String shippingUser;
|
||||
/**
|
||||
* 收货人手机号
|
||||
*/
|
||||
private String userPhone;
|
||||
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
private String district;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 支付方式 1支付宝,2微信,3ios内购
|
||||
*/
|
||||
private String paymentMethod;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal orderMoney;
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
private BigDecimal districtMoney;
|
||||
/**
|
||||
* 实收金额
|
||||
*/
|
||||
private BigDecimal realMoney;
|
||||
/**
|
||||
* 运费
|
||||
*/
|
||||
private BigDecimal shippingMoney;
|
||||
/**
|
||||
* 物流公司名称
|
||||
*/
|
||||
private String shippingCompName;
|
||||
/**
|
||||
* 物流单号
|
||||
*/
|
||||
private String shippingSn;
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
private Date shippingTime;
|
||||
/**
|
||||
* 订单状态
|
||||
*
|
||||
*
|
||||
* 0: 待付款
|
||||
* 1: 待发货
|
||||
* 2: 已发货
|
||||
* 3:已完成
|
||||
* 4: 交易失败
|
||||
*
|
||||
*/
|
||||
private String orderStatus;
|
||||
/**
|
||||
* 交易成功时间
|
||||
*/
|
||||
private Date successTime;
|
||||
|
||||
/**
|
||||
* 优惠券Id
|
||||
*/
|
||||
private Integer couponId;
|
||||
/**
|
||||
* 优惠券名称
|
||||
*/
|
||||
private String couponName;
|
||||
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<BuyOrderDetailEntity> products;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String buyType;
|
||||
|
||||
/**
|
||||
* vip order point
|
||||
*/
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 快递单号
|
||||
*/
|
||||
private String expNo;
|
||||
|
||||
/**
|
||||
* 是否存在发货的商品 0:不存在,1:已存在
|
||||
*/
|
||||
private String isSend;
|
||||
|
||||
/**
|
||||
* 地址id
|
||||
*/
|
||||
private Integer addressId;
|
||||
|
||||
|
||||
/**
|
||||
* 订单备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 快递鸟订单编号
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private Date paymentDate;
|
||||
|
||||
|
||||
}
|
||||
50
src/main/java/com/peanut/modules/book/entity/CityEntity.java
Normal file
50
src/main/java/com/peanut/modules/book/entity/CityEntity.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-27 16:07:59
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_city")
|
||||
public class CityEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long cityId;
|
||||
/**
|
||||
* 所属省
|
||||
*/
|
||||
private Long provId;
|
||||
/**
|
||||
* 城市名称
|
||||
*/
|
||||
private String cityName;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createDate;
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String regionCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<CountyEntity> countyList;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 县/区
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-27 16:07:59
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_county")
|
||||
public class CountyEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long countyId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long cityId;
|
||||
/**
|
||||
* 县/区名称
|
||||
*/
|
||||
private String countyName;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createDate;
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String regionCode;
|
||||
|
||||
|
||||
|
||||
}
|
||||
108
src/main/java/com/peanut/modules/book/entity/CouponEntity.java
Normal file
108
src/main/java/com/peanut/modules/book/entity/CouponEntity.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@Data
|
||||
@TableName("sms_coupon")
|
||||
public class CouponEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 优惠券类型 0:现金,1:折扣
|
||||
*/
|
||||
private Integer couponType;
|
||||
|
||||
/**
|
||||
* 优惠券名称
|
||||
*/
|
||||
private String couponName;
|
||||
|
||||
/**
|
||||
* 优惠券面额
|
||||
*/
|
||||
private BigDecimal couponAmount;
|
||||
|
||||
/**
|
||||
* 优惠券封面图
|
||||
*/
|
||||
private String couponUrl;
|
||||
|
||||
/**
|
||||
* 每人限领
|
||||
*/
|
||||
private Integer limitedCollar;
|
||||
|
||||
/**
|
||||
* 时效
|
||||
*/
|
||||
private String validity;
|
||||
|
||||
/**
|
||||
* 生效方式 0:领取日生效 1: 设置生效日期
|
||||
*/
|
||||
private Integer takeEffectType;
|
||||
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
private Date takeEffectDate;
|
||||
|
||||
/**
|
||||
* 截止日期
|
||||
*/
|
||||
private Date expirationDate;
|
||||
|
||||
/**
|
||||
* 总发行数量
|
||||
*/
|
||||
public Integer totalCirculation;
|
||||
|
||||
/**
|
||||
* 当前状态 0:全部,1:生效,2:已过期
|
||||
*/
|
||||
private String currentState;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 商品类型 0: 商品 ,1电子书
|
||||
*/
|
||||
private Integer couponProType;
|
||||
|
||||
/**
|
||||
* 使用门槛
|
||||
*/
|
||||
private Integer useLevel;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@Data
|
||||
@TableName("sms_coupon_history")
|
||||
public class CouponHistoryEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 优惠券id
|
||||
*/
|
||||
private Long couponId;
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
private Long memberId;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 优惠券码
|
||||
*/
|
||||
private String couponCode;
|
||||
/**
|
||||
* 领取人昵称
|
||||
*/
|
||||
private String memberNickname;
|
||||
/**
|
||||
* 获取类型:0->后台赠送;1->主动获取
|
||||
*/
|
||||
private Integer getType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
* 使用状态:0->未使用;1->已使用;2->已过期
|
||||
*/
|
||||
private Integer useStatus;
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
private Date useTime;
|
||||
/**
|
||||
* 订单号码
|
||||
*/
|
||||
private String orderSn;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String couponName;
|
||||
|
||||
|
||||
/**
|
||||
* 商品类型 0: 商品 ,1电子书
|
||||
*/
|
||||
private Integer couponProType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@Data
|
||||
@TableName("sms_coupon_product_category_relation")
|
||||
public class CouponProductCategoryRelationEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 优惠券id
|
||||
*/
|
||||
private Long couponId;
|
||||
/**
|
||||
* 商品分类id
|
||||
*/
|
||||
private Long productCategoryId;
|
||||
/**
|
||||
* 商品分类名称
|
||||
*/
|
||||
private String productCategoryName;
|
||||
/**
|
||||
* 父分类名称
|
||||
*/
|
||||
private String parentCategoryName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 17:38:29
|
||||
*/
|
||||
@Data
|
||||
@TableName("sms_coupon_product_relation")
|
||||
public class CouponProductRelationEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 优惠券id
|
||||
*/
|
||||
private Long couponId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品条码
|
||||
*/
|
||||
private String productSn;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 发送快递商品详情
|
||||
*/
|
||||
@Data
|
||||
@TableName("fms_commodity")
|
||||
public class FMSCommodity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer goodsQuantity;
|
||||
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private BigDecimal goodsPrice;
|
||||
|
||||
/**
|
||||
* 商品重量kg
|
||||
*/
|
||||
private Float goodsWeight;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
private String goodsDesc;
|
||||
|
||||
/**
|
||||
* 发送快递表主键
|
||||
*/
|
||||
private Integer fmsOrderId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发送快递信息实体
|
||||
*/
|
||||
@Data
|
||||
@TableName("fms_order_detail")
|
||||
public class FMSOrderDetailEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Integer orderId;
|
||||
|
||||
/**
|
||||
* 订单商品id
|
||||
*/
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 快递编号
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发送快递信息实体
|
||||
*/
|
||||
@Data
|
||||
@TableName("fms_order")
|
||||
public class FMSOrderEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 快递公司编码
|
||||
*/
|
||||
private String shipperCode;
|
||||
|
||||
/**
|
||||
* 收件人姓名
|
||||
*/
|
||||
private String receiverName;
|
||||
|
||||
/**
|
||||
* 收件人电话
|
||||
*/
|
||||
private String receiverMobile;
|
||||
|
||||
/**
|
||||
* 收件省
|
||||
*/
|
||||
private String receiverProvinceName;
|
||||
|
||||
/**
|
||||
* 收件市
|
||||
*/
|
||||
private String receiverCityName;
|
||||
|
||||
/**
|
||||
* 收件区/县
|
||||
*/
|
||||
private String receiverExpAreaName;
|
||||
|
||||
/**
|
||||
* 收件人详细地址
|
||||
*/
|
||||
private String receiverAddress;
|
||||
|
||||
/**
|
||||
* 商品信息列表
|
||||
*/
|
||||
private List<FMSCommodity> commodityList;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 订单详情ID
|
||||
*/
|
||||
private Integer orderId;
|
||||
|
||||
|
||||
}
|
||||
109
src/main/java/com/peanut/modules/book/entity/MyUserEntity.java
Normal file
109
src/main/java/com/peanut/modules/book/entity/MyUserEntity.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-10 14:20:12
|
||||
*/
|
||||
@Data
|
||||
@TableName("user")
|
||||
public class MyUserEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Integer age;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String tel;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 0-普通 1-vip
|
||||
*/
|
||||
private String vip;
|
||||
/**
|
||||
* vip 有效期
|
||||
*/
|
||||
private Date vipStartTime;
|
||||
/**
|
||||
* vip 有效期
|
||||
*/
|
||||
private Date vipValidtime;
|
||||
/**
|
||||
* 花生币
|
||||
*/
|
||||
private Integer peanutCoin;
|
||||
/**
|
||||
* 阅读时间
|
||||
*/
|
||||
private Date readTime;
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
private Date lastLoginTime;
|
||||
|
||||
/**
|
||||
* 一路健康oid
|
||||
*/
|
||||
private String yljkOid;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)//更新注解
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 短信验证码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String code;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer conponsCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 购物车
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Data
|
||||
@TableName("order_cart")
|
||||
public class OrderCartEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer cartId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Integer productId;
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer productAmount;
|
||||
/**
|
||||
* 商品单价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)//更新注解
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 充值订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Data
|
||||
@TableName("pay_payment_order")
|
||||
public class PayPaymentOrderEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 充值金额
|
||||
*/
|
||||
private BigDecimal rechargeAmount;
|
||||
/**
|
||||
* 充值渠道
|
||||
*/
|
||||
private String rechargeChannel;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 实际充值金额
|
||||
*/
|
||||
private BigDecimal realAmount;
|
||||
/**
|
||||
* 充值状态
|
||||
*/
|
||||
private String rechargeStatus;
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
/**
|
||||
* 支付成功时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date successTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 支付宝订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
@Data
|
||||
@TableName("pay_zfb_order")
|
||||
public class PayZfbOrderEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String customerid;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String outTradeNo;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String tradeNo;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date notifyTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String notifyType;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String notifyId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String appId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String authAppId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String charset;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String version;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String signType;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String sign;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String outBizNo;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String buyerId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String buyerLogonId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String sellerId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String sellerEmail;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String tradeStatus;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String totalAmount;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String receiptAmount;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String invoiceAmount;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String buyerPayAmount;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String pointAmount;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String refundFee;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String subject;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String body;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date gmtCreate;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date gmtPayment;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date gmtRefund;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date gmtClose;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String fundBillList;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String voucherDetailList;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String relevanceoid;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-27 16:07:59
|
||||
*/
|
||||
@Data
|
||||
@TableName("base_province")
|
||||
public class ProvinceEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long provId;
|
||||
/**
|
||||
* 省名称
|
||||
*/
|
||||
private String provName;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createDate;
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String regionCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<CityEntity> cityList;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 出版商表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
@Data
|
||||
@TableName("publisher")
|
||||
public class PublisherEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 出版商名称
|
||||
*/
|
||||
private String publisherName;
|
||||
/**
|
||||
* 出版商简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private Integer tel;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 秒杀商品表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 11:24:05
|
||||
*/
|
||||
@Data
|
||||
@TableName("seckill_prod_relation")
|
||||
public class SeckillProdRelationEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String promotionId;
|
||||
/**
|
||||
* 场次id
|
||||
*/
|
||||
private Integer promotionSeckillId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Integer prodId;
|
||||
/**
|
||||
* 秒杀价格
|
||||
*/
|
||||
private BigDecimal seckillPrice;
|
||||
/**
|
||||
* 秒杀数量
|
||||
*/
|
||||
private String seckillCount;
|
||||
/**
|
||||
* 限制购买
|
||||
*/
|
||||
private String seckillLimit;
|
||||
/**
|
||||
* 权重
|
||||
*/
|
||||
private String seckillSort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 商品三级分类
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-30 15:06:20
|
||||
*/
|
||||
@Data
|
||||
@TableName("shop_category")
|
||||
public class ShopCategoryEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 分类id
|
||||
*/
|
||||
@TableId
|
||||
private Long catId;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 父分类id
|
||||
*/
|
||||
private Long parentCid;
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
private Integer catLevel;
|
||||
/**
|
||||
* 是否显示[0-不显示,1显示]
|
||||
*/
|
||||
@TableLogic(value="1",delval="0")
|
||||
private Integer showStatus;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 图标地址
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
private String productUnit;
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer productCount;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private List<ShopCategoryEntity> children;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 商品表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-11-30 10:30:56
|
||||
*/
|
||||
@Data
|
||||
@TableName("shop_product")
|
||||
public class ShopProductEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 商品重量
|
||||
*/
|
||||
private Float weight;
|
||||
/**
|
||||
* 上架状态
|
||||
*/
|
||||
private Integer publishStatus;
|
||||
/**
|
||||
* 商品介绍
|
||||
*/
|
||||
private String productDetails;
|
||||
/**
|
||||
* 商品分类id
|
||||
*/
|
||||
private Integer productPid;
|
||||
/**
|
||||
* 商品 类型 0 - 预售 1 - 在售
|
||||
*/
|
||||
private String productType;
|
||||
/**
|
||||
* 商品库存
|
||||
*/
|
||||
private Integer productStock;
|
||||
/**
|
||||
* 商品图首页
|
||||
*/
|
||||
private String productImages;
|
||||
/**
|
||||
* 商品 多图
|
||||
*/
|
||||
private String productImageList;
|
||||
/**
|
||||
* 商品销量
|
||||
*/
|
||||
private String productSalesVolume;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<Integer> poids;
|
||||
/**
|
||||
* 作者
|
||||
*/
|
||||
private String author;
|
||||
/**
|
||||
* 出版方
|
||||
*/
|
||||
private String publisher;
|
||||
/**
|
||||
* 出版时间
|
||||
*/
|
||||
private Date pubDate;
|
||||
/**
|
||||
* 开本
|
||||
*/
|
||||
private String format;
|
||||
/**
|
||||
* 页数
|
||||
*/
|
||||
private Integer pageNum;
|
||||
/**
|
||||
* 内文用纸材质
|
||||
*/
|
||||
private String quality;
|
||||
/**
|
||||
* 总销量
|
||||
*/
|
||||
private Integer sumSales;
|
||||
/**
|
||||
* 商品类型
|
||||
*/
|
||||
private String goodsType;
|
||||
private String goodsTypeCode;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 秒杀库存表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-28 11:24:05
|
||||
*/
|
||||
@Data
|
||||
@TableName("shop_seckill")
|
||||
public class ShopSeckillEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long seckillId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String nam;
|
||||
/**
|
||||
* 秒杀开启时间
|
||||
*/
|
||||
private Date startTime;
|
||||
/**
|
||||
* 秒杀结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<SeckillProdRelationEntity> relationProd;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 交易明细
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:47:50
|
||||
*/
|
||||
@Data
|
||||
@TableName("transaction_details")
|
||||
public class TransactionDetailsEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer transactionId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 充值 支付 赠送优惠券.....
|
||||
*/
|
||||
private String orderType;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
private BigDecimal changeAmount;
|
||||
/**
|
||||
* 关联id
|
||||
*/
|
||||
private Integer relationId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal userBalance;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-31 11:20:32
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_address")
|
||||
public class UserAddressEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增ID
|
||||
*/
|
||||
@TableId
|
||||
private Integer addressid;
|
||||
/**
|
||||
* 会员ID
|
||||
*/
|
||||
private Integer userid;
|
||||
/**
|
||||
* 收货人名称
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 收货人手机号码
|
||||
*/
|
||||
private String userphone;
|
||||
/**
|
||||
* 区域ID路径
|
||||
*/
|
||||
private String areaidpath;
|
||||
/**
|
||||
* 区域ID文字
|
||||
*/
|
||||
private String areaidpathtext;
|
||||
/**
|
||||
* 最后一级区域ID
|
||||
*/
|
||||
private Integer areaid;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String useraddress;
|
||||
/**
|
||||
* 默认
|
||||
*/
|
||||
private Integer isdefault;
|
||||
/**
|
||||
* 有效状态
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)//创建注解
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)//更新注解
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.peanut.modules.book.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户购买书籍表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-18 16:28:20
|
||||
*/
|
||||
@Data
|
||||
@TableName("user_ebook_buy")
|
||||
public class UserEbookBuyEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId
|
||||
private Integer buyId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 书id
|
||||
*/
|
||||
private Integer bookId;
|
||||
/**
|
||||
* 书名
|
||||
*/
|
||||
private String bookName;
|
||||
/**
|
||||
* 1- 支付宝 2-微信 3 ios
|
||||
*/
|
||||
private String payType;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date payTime;
|
||||
/**
|
||||
* 支付状态 1-成功 2-失败
|
||||
*/
|
||||
private String payStatus;
|
||||
|
||||
|
||||
private String image;
|
||||
|
||||
|
||||
private String author;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.ActivityEntity;
|
||||
import com.peanut.modules.book.entity.BuyOrderEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 订单表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
public interface ActivityService extends IService<ActivityEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.AuthorEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 作者表
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-04 15:36:59
|
||||
*/
|
||||
public interface AuthorService extends IService<AuthorEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookBrowseRecordsEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 阅读记录
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-29 15:27:44
|
||||
*/
|
||||
public interface BookBrowseRecordsService extends IService<BookBrowseRecordsEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookBuyConfigEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-10-17 14:54:08
|
||||
*/
|
||||
public interface BookBuyConfigService extends IService<BookBuyConfigEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookChapterContentEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author yl
|
||||
* @email yl328572838@163.com
|
||||
* @date 2022-08-16 14:32:06
|
||||
*/
|
||||
public interface BookChapterContentService extends IService<BookChapterContentEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
void getBookVoices(Integer id);
|
||||
|
||||
boolean getWordChapterParagraph(Integer bookId);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user