clock in and comment finished waitting for test

This commit is contained in:
Cauchy
2023-10-11 14:22:45 +08:00
parent 6a66bc7249
commit d80d598529
20 changed files with 311 additions and 164 deletions

View File

@@ -0,0 +1,90 @@
package com.peanut.modules.book.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.peanut.common.utils.R;
import com.peanut.modules.book.entity.BookClockInChatEntity;
import com.peanut.modules.book.entity.BookClockInEntity;
import com.peanut.modules.book.service.BookClockEntryChatService;
import com.peanut.modules.book.service.BookClockinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description: 打卡论坛 Controller
* @Author: Cauchy
* @CreateTime: 2023/10/11
*/
@RestController("/book/clockForum")
public class BookClockForumController {
@Autowired
private BookClockEntryChatService bookClockEntryChatService;
@Autowired
private BookClockinService bookClockinService;
/**
* 获取论坛内容
*
* @param bookId
* @param day
* @return
*/
@RequestMapping(path = "/getPostingInfo", method = RequestMethod.GET)
public R getPostingInfo(@RequestParam("bookId") Integer bookId,
@RequestParam("day") Integer day) {
QueryWrapper<BookClockInEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("book_id", bookId);
queryWrapper.eq("day", day);
BookClockInEntity entity = bookClockinService.getOne(queryWrapper);
Map<String, Object> result = new HashMap<>();
result.put("result", entity);
return R.ok(result);
}
/**
* 获取评论列表
*
* @param entryId
* @return
*/
@RequestMapping(path = "/getChatList", method = RequestMethod.GET)
public R getChatList(@RequestParam("entryId") Integer entryId) {
QueryWrapper<BookClockInChatEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("entry_id", entryId);
queryWrapper.orderByAsc("f_id", "create_time");
List<BookClockInChatEntity> resultList = bookClockEntryChatService.list(queryWrapper);
Map<String, Object> result = new HashMap<>();
result.put("chatList", resultList);
return R.ok(result);
}
/**
* 添加评论
*
* @param chat
* @return
*/
@RequestMapping(path = "/addChat", method = RequestMethod.POST)
public R addChat(@RequestBody BookClockInChatEntity chat) {
bookClockEntryChatService.save(chat);
return R.ok();
}
/**
* 删除评论
*
* @param id
* @return
*/
@RequestMapping(path = "/deleteChat", method = RequestMethod.GET)
public R deleteChat(@RequestParam("id") Integer id) {
bookClockEntryChatService.removeById(id);
return R.ok();
}
}

View File

@@ -4,12 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.R;
import com.peanut.modules.book.entity.BookClockinCommentEntity;
import com.peanut.modules.book.entity.BookClockinEntity;
import com.peanut.modules.book.entity.BookClockInEntity;
import com.peanut.modules.book.entity.BookClockinPunchEntity;
import com.peanut.modules.book.service.BookClockinCommentService;
import com.peanut.modules.book.service.BookClockinPunchService;
import com.peanut.modules.book.service.BookClockinService;
import com.peanut.modules.book.service.BookTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
@@ -97,7 +96,7 @@ public class BookClockinCommentController {
Integer bookid = clockinComment.getBookId();
Integer userId = clockinComment.getUserId();
Integer pid = clockinComment.getPid();
BookClockinEntity bookClockinEntity = bookClockinService.getBaseMapper().selectOne(new QueryWrapper<BookClockinEntity>()
BookClockInEntity bookClockinEntity = bookClockinService.getBaseMapper().selectOne(new QueryWrapper<BookClockInEntity>()
.eq("id",pid)
);
clockinComment.setDelFlag(0);

View File

@@ -44,10 +44,10 @@ public class BookClockinController {
public R applist(@RequestParam("bookid") String bookid,
@RequestParam("taskid") String taskid) {
List<BookClockinEntity> bookClockinEntityList = bookClockinService.getBaseMapper().selectList(new QueryWrapper<BookClockinEntity>()
List<BookClockInEntity> bookClockinEntityList = bookClockinService.getBaseMapper().selectList(new QueryWrapper<BookClockInEntity>()
.eq("book_id", bookid).eq("task_id", taskid));
List list = new ArrayList<>();
for (BookClockinEntity bookClockinEntity : bookClockinEntityList) {
for (BookClockInEntity bookClockinEntity : bookClockinEntityList) {
Map<String, Object> map = new HashMap<>();
String name = "";
String avatar="";
@@ -101,7 +101,7 @@ public class BookClockinController {
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Integer id) {
BookClockinEntity bookClockinEntity = bookClockinService.getById(id);
BookClockInEntity bookClockinEntity = bookClockinService.getById(id);
return R.ok().put("bookBuyConfig", bookClockinEntity);
}
@@ -109,7 +109,7 @@ public class BookClockinController {
* 保存
*/
@RequestMapping("/save")
public R save(@RequestBody BookClockinEntity bookClockinEntity) {
public R save(@RequestBody BookClockInEntity bookClockinEntity) {
Integer bookId = bookClockinEntity.getBookId();
Integer userId = bookClockinEntity.getUserId();
@@ -124,7 +124,7 @@ public class BookClockinController {
if (bookClockinPunchEntity==null) {
return R.error("当天打卡内容未发布");
}
BookClockinEntity bookClockin = bookClockinService.getBaseMapper().selectOne(new QueryWrapper<BookClockinEntity>()
BookClockInEntity bookClockin = bookClockinService.getBaseMapper().selectOne(new QueryWrapper<BookClockInEntity>()
.eq("book_id", bookId)
.eq("task_id", taskId)
.eq("day_id", dayId)
@@ -159,7 +159,7 @@ public class BookClockinController {
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody BookClockinEntity bookClockinEntity) {
public R update(@RequestBody BookClockInEntity bookClockinEntity) {
bookClockinService.updateById(bookClockinEntity);
return R.ok("提交成功");
}
@@ -186,11 +186,11 @@ public class BookClockinController {
List applist = new ArrayList<>();
Map<String, Object> productMap = new HashMap<>();
//根据bookid查找出签到表中签到的用户数据
List<BookClockinEntity> bookid = bookClockinService.getBaseMapper().selectList(new QueryWrapper<BookClockinEntity>()
List<BookClockInEntity> bookid = bookClockinService.getBaseMapper().selectList(new QueryWrapper<BookClockInEntity>()
.eq("book_id", bookId)
.orderByDesc("create_time"));
for (BookClockinEntity book : bookid) {
for (BookClockInEntity book : bookid) {
HashMap<Object, Object> map = new HashMap<>();
Integer bookid1 = book.getBookId();
@@ -222,11 +222,11 @@ public class BookClockinController {
@RequestParam("bookid") Integer bookId) {
List<BookClockinEntity> bookClockinEntityList = bookClockinService.getBaseMapper().selectList(new QueryWrapper<BookClockinEntity>()
List<BookClockInEntity> bookClockinEntityList = bookClockinService.getBaseMapper().selectList(new QueryWrapper<BookClockInEntity>()
.eq("user_id",id) .eq("book_id",bookId).orderByDesc("create_time"));
List list = new ArrayList<>();
for (BookClockinEntity bookClockinEntity : bookClockinEntityList) {
for (BookClockInEntity bookClockinEntity : bookClockinEntityList) {
Map<String, Object> productMap = new HashMap<>();
Integer userId = bookClockinEntity.getUserId();
Integer dayId = bookClockinEntity.getDayId();
@@ -286,7 +286,7 @@ public class BookClockinController {
) {
List list = new ArrayList<>();
Map<String, Object> productMap = new HashMap<>();
BookClockinEntity bookClockin = bookClockinService.getBaseMapper().selectOne(new QueryWrapper<BookClockinEntity>()
BookClockInEntity bookClockin = bookClockinService.getBaseMapper().selectOne(new QueryWrapper<BookClockInEntity>()
.eq("user_id",id)
.eq("task_id",taskid)
.eq("book_id",bookId)

View File

@@ -1,4 +1,9 @@
package com.peanut.modules.book.controller;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -7,29 +12,28 @@ import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.R;
import com.peanut.modules.book.dao.UserEbookBuyDao;
import com.peanut.modules.book.entity.*;
import com.peanut.modules.book.service.BookClockinCommentService;
import com.peanut.modules.book.service.BookClockinPunchService;
import com.peanut.modules.book.service.BookService;
import com.peanut.modules.book.service.MyUserService;
import com.peanut.modules.book.service.*;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
@RestController
@RequestMapping("book/clockinPunch")
public class BookClockinPunchController {
@Autowired
private BookClockinPunchService bookClockinPunchService;
@Autowired
private BookService bookService;
@Autowired
private MyUserService myUserService;
@Autowired
private BookClockinCommentService bookClockinCommentService;
@Autowired
private UserEbookBuyDao userEbookBuyDao;
@Autowired
private BookClockinPunchService bookClockinPunchService;
@Autowired
private BookService bookService;
@Autowired
private MyUserService myUserService;
@Autowired
private BookClockinCommentService bookClockinCommentService;
@Autowired
private UserEbookBuyDao userEbookBuyDao;
@Autowired
UserBookClockService userBookClockService;
/**
@@ -44,49 +48,6 @@ private UserEbookBuyDao userEbookBuyDao;
/**
* 计算打卡天数
*/
@RequestMapping("/clockindays")
public R applists(@RequestParam("bookId") String bookid,
@RequestParam("userId") String userid) {
ArrayList<Object> list = new ArrayList<>();
//查询用户id图书id 根据第一天打卡天数开始计算
BookClockinPunchEntity bookClockinEntity = bookClockinPunchService.getBaseMapper().selectOne(new QueryWrapper<BookClockinPunchEntity>()
.eq("book_id", bookid)
.eq("user_id", userid)
.eq("days",1)
);
List<BookClockinPunchEntity> bookClockinEntityList = bookClockinPunchService.getBaseMapper().selectList(new QueryWrapper<BookClockinPunchEntity>()
.eq("book_id", bookid)
.eq("user_id", userid)
);
for (BookClockinPunchEntity bookClock : bookClockinEntityList) {
Integer days = bookClock.getDays();
list.add(days);
}
if (bookClockinEntity != null) {
Date createTime = bookClockinEntity.getCreateTime();
long createTimeMillis = createTime.getTime();
//获取第一次打卡天数createTimeMillis毫秒数时间戳减并除以毫秒数24 * 60 * 60 * 1000计算打卡总天数+1
int daysBetween = (int) (System.currentTimeMillis() - createTimeMillis) / (24 * 60 * 60 * 1000)+1;
return R.ok().put("daysBetween", daysBetween).put("dayslist", list);
} else if (bookClockinEntity == null) {
Date createTime = new Date();
long createTimeMillis = createTime.getTime();
int daysBetween = (int) (System.currentTimeMillis() - createTimeMillis) / (24 * 60 * 60 * 1000)+1;
return R.ok().put("daysBetween", daysBetween).put("dayslist",list );
}
return R.error("无信息记录");
}
/**
* 信息
*/
@@ -113,25 +74,24 @@ private UserEbookBuyDao userEbookBuyDao;
.eq("t_id", taskId)
);
if (bookClock !=null) {
if (bookClock != null) {
return R.error("您已经签到,请勿重复签到");
}
if(canListen == true){
boolean b = myUserService.bookAuthen(bookid1,userId);
if (b){
if (canListen == true) {
boolean b = myUserService.bookAuthen(bookid1, userId);
if (b) {
bookClockinPunchEntity.setDelFlag(0);
bookClockinPunchService.save(bookClockinPunchEntity);
return R.ok("签到成功");
}else {
} else {
return R.error("您还未购买此书,购买后即可签到");
}
}else {
} else {
return R.error("该书暂未开放打卡权限");
}
@@ -141,37 +101,39 @@ private UserEbookBuyDao userEbookBuyDao;
/**
* 获取用户打卡已购图书
*
* @param userId
* @return
*/
@RequestMapping("/myClockBooks")
public R myClockBooks(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
public R myClockBooks(@RequestParam Integer userId, @RequestParam Integer limit, @RequestParam Integer page) {
MPJLambdaWrapper<UserEbookBuyEntity> wrapper = new MPJLambdaWrapper<>();
wrapper.selectAll(BookEntity.class);
wrapper.leftJoin(BookEntity.class,BookEntity::getId,UserEbookBuyEntity::getBookId);
wrapper.eq(UserEbookBuyEntity::getUserId,userId);
wrapper.eq(BookEntity::getDelFlag,0);
wrapper.eq(BookEntity::getClockIn,1);
wrapper.leftJoin(BookEntity.class, BookEntity::getId, UserEbookBuyEntity::getBookId);
wrapper.eq(UserEbookBuyEntity::getUserId, userId);
wrapper.eq(BookEntity::getDelFlag, 0);
wrapper.eq(BookEntity::getClockIn, 1);
Page<BookEntity> userBookEntityPage = userEbookBuyDao.selectJoinPage(new Page<BookEntity>(page, limit), BookEntity.class, wrapper);
return R.ok().put("page",userBookEntityPage);
return R.ok().put("page", userBookEntityPage);
}
/**
* 获取打卡推荐图书
*
* @param userId
* @param limit
* @param page
* @return
*/
@RequestMapping("/getBestClockBooks")
public R getBestClockBooks(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
String not_ex_sql = "select 1 from user_ebook_buy where book.id = book_id and user_id = "+userId;
public R getBestClockBooks(@RequestParam Integer userId, @RequestParam Integer limit, @RequestParam Integer page) {
String not_ex_sql = "select 1 from user_ebook_buy where book.id = book_id and user_id = " + userId;
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BookEntity::getDelFlag,0);
wrapper.eq(BookEntity::getClockIn,1);
wrapper.eq(BookEntity::getDelFlag, 0);
wrapper.eq(BookEntity::getClockIn, 1);
wrapper.notExists(not_ex_sql);
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
return R.ok().put("page",bookEntityPage);
return R.ok().put("page", bookEntityPage);
}
@@ -197,12 +159,13 @@ private UserEbookBuyDao userEbookBuyDao;
/**
* 获取评论
* 获取评论
*
* @param bookClockinPunchEntity
* @return
*/
@RequestMapping("/punchcoments")
public R punchcoments(@RequestBody BookClockinPunchEntity bookClockinPunchEntity) {
public R punchcoments(@RequestBody BookClockinPunchEntity bookClockinPunchEntity) {
//图书Id
Integer bookId = bookClockinPunchEntity.getBookId();
//用户id
@@ -212,48 +175,46 @@ private UserEbookBuyDao userEbookBuyDao;
ArrayList<Object> list = new ArrayList<>();
List<BookClockinCommentEntity> bookClockinCommentEntities = bookClockinCommentService.getBaseMapper().selectList(new QueryWrapper<BookClockinCommentEntity>()
.eq("user_id", userId)
.eq("book_id", bookId)
.eq("task_id", days)
.eq("user_id", userId)
.eq("book_id", bookId)
.eq("task_id", days)
//pid等于1时为一级评论
// .eq("pid",1)
);
for (BookClockinCommentEntity bookClockinCommentEntity : bookClockinCommentEntities) {
HashMap<Object, Object> map = new HashMap<>();
String name = "";
String avatar="";
for (BookClockinCommentEntity bookClockinCommentEntity : bookClockinCommentEntities) {
HashMap<Object, Object> map = new HashMap<>();
String name = "";
String avatar = "";
Integer userId1 = bookClockinCommentEntity.getUserId();
Integer bookId1 = bookClockinCommentEntity.getBookId();
String content = bookClockinCommentEntity.getContent();
String images = bookClockinCommentEntity.getImages();
Date createTime = bookClockinCommentEntity.getCreateTime();
Integer userId1 = bookClockinCommentEntity.getUserId();
Integer bookId1 = bookClockinCommentEntity.getBookId();
String content = bookClockinCommentEntity.getContent();
String images = bookClockinCommentEntity.getImages();
Date createTime = bookClockinCommentEntity.getCreateTime();
List<MyUserEntity> id = myUserService.getBaseMapper().selectList(new QueryWrapper<MyUserEntity>().eq("id", userId));
for (MyUserEntity user : id) {
name = user.getNickname();
avatar = user.getAvatar();
}
map.put("userid", userId1);
map.put("name", name);
map.put("avatar", avatar);
map.put("bookid", bookId1);
map.put("content", content);
map.put("images", images);
map.put("createdate", createTime);
list.add(map);
List<MyUserEntity> id = myUserService.getBaseMapper().selectList(new QueryWrapper<MyUserEntity>().eq("id", userId));
for (MyUserEntity user : id) {
name = user.getNickname();
avatar = user.getAvatar();
}
map.put("userid", userId1);
map.put("name", name);
map.put("avatar", avatar);
map.put("bookid", bookId1);
map.put("content", content);
map.put("images", images);
map.put("createdate", createTime);
list.add(map);
}
}
Collections.reverse(list);
return R.ok().put("list", list);
}
}
}

View File

@@ -4,7 +4,6 @@ package com.peanut.modules.book.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.R;
import com.peanut.modules.book.entity.BookClockinEntity;
import com.peanut.modules.book.entity.BookClockinPunchEntity;
import com.peanut.modules.book.entity.BookTaskEntity;
import com.peanut.modules.book.service.*;

View File

@@ -0,0 +1,99 @@
package com.peanut.modules.book.controller;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.peanut.common.utils.R;
import com.peanut.modules.book.entity.UserBookClockEntity;
import com.peanut.modules.book.service.UserBookClockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.*;
/**
* @Description: 用户打卡 Controller
* @Author: Cauchy
* @CreateTime: 2023/10/11
*/
@Slf4j
@RequestMapping("/book/userClockIn")
public class UserBookClockController {
@Autowired
UserBookClockService userBookClockService;
/**
* 计算打卡天数
*
* @param bookId
* @param userId
* @return
*/
@RequestMapping(path = "/clockInDays", method = RequestMethod.GET)
public R clockInDays(@RequestParam("bookId") Integer bookId,
@RequestParam("userId") Integer userId) {
QueryWrapper<UserBookClockEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("book_id", bookId);
queryWrapper.eq("user_id", userId);
UserBookClockEntity userBookClock = userBookClockService.getOne(queryWrapper);
if (userBookClock == null) {
return R.error("未获取到该用户的打卡信息");
}
// 1. 获取打卡初始日期
Date beginDate = userBookClock.getBeginDate();
// 2. 获取打卡天数列表
String clocksStr = userBookClock.getClocks();
List<Integer> clockInDayList = JSON.parseObject(clocksStr, new TypeReference<List<Integer>>() {
});
Map<String, Object> result = new HashMap<>();
result.put("beginDate", beginDate);
result.put("clockInDayList", clockInDayList);
return R.ok(result);
}
/**
* 用户打卡
*
* @param bookId
* @param userId
* @return
*/
@RequestMapping(path = "/clockIn", method = RequestMethod.GET)
public R clockIn(@RequestParam("bookId") Integer bookId, @RequestParam("userId") Integer userId) {
// 查询是否有该用户打卡记录,如果没有,说明是第一天打卡
QueryWrapper<UserBookClockEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("book_id", bookId);
queryWrapper.eq("user_id", userId);
UserBookClockEntity userBookClock = userBookClockService.getOne(queryWrapper);
// 第一天打卡
if (userBookClock == null) {
UserBookClockEntity entity = new UserBookClockEntity();
java.sql.Date beginDate = new java.sql.Date(new Date().getTime());
List<Integer> clockInDaysList = new ArrayList<>();
clockInDaysList.add(1);
String clockInDaysListStr = JSON.toJSON(clockInDaysList).toString();
entity.setBookId(bookId);
entity.setUserId(userId);
entity.setBeginDate(beginDate);
entity.setClocks(clockInDaysListStr);
userBookClockService.save(entity);
return R.ok("打卡成功");
}
String clocksStr = userBookClock.getClocks();
List<Integer> clockInDaysList = JSON.parseObject(clocksStr, new TypeReference<List<Integer>>() {
});
Date beginDate = userBookClock.getBeginDate();
Date today = new Date();
long between = DateUtil.between(beginDate, today, DateUnit.DAY);
clockInDaysList.add((int) between);
String clockInDaysListStr = JSON.toJSON(clockInDaysList).toString();
userBookClock.setClocks(clockInDaysListStr);
userBookClockService.updateById(userBookClock);
return R.ok("打卡成功");
}
}

View File

@@ -1,9 +1,9 @@
package com.peanut.modules.book.dao;
import com.github.yulichang.base.MPJBaseMapper;
import com.peanut.modules.book.entity.BookClockEntryChatEntity;
import com.peanut.modules.book.entity.BookClockInChatEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface BookClockEntryChatDao extends MPJBaseMapper<BookClockEntryChatEntity> {
public interface BookClockEntryChatDao extends MPJBaseMapper<BookClockInChatEntity> {
}

View File

@@ -1,12 +1,11 @@
package com.peanut.modules.book.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.peanut.modules.book.entity.BookClockinEntity;
import com.peanut.modules.book.entity.BookClockInEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface BookClockinDao extends MPJBaseMapper<BookClockinEntity> {
public interface BookClockinDao extends MPJBaseMapper<BookClockInEntity> {

View File

@@ -2,11 +2,13 @@ package com.peanut.modules.book.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
public class BookClockEntryChatEntity implements Serializable {
@Data
public class BookClockInChatEntity implements Serializable {
private static final long serialVersionUID = 1L;
@TableId

View File

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
/**
@@ -16,7 +15,7 @@ import java.util.Date;
*/
@Data
@TableName("book_clockin")
public class BookClockinEntity implements Serializable {
public class BookClockInEntity implements Serializable {

View File

@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.sql.Date;
import java.util.Date;
@Data
@TableName("user_book_clock")

View File

@@ -1,7 +1,7 @@
package com.peanut.modules.book.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.book.entity.BookClockEntryChatEntity;
import com.peanut.modules.book.entity.BookClockInChatEntity;
public interface BookClockEntryChatService extends IService<BookClockEntryChatEntity> {
public interface BookClockEntryChatService extends IService<BookClockInChatEntity> {
}

View File

@@ -3,7 +3,6 @@ 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.BookClockinEntity;
import com.peanut.modules.book.entity.BookClockinPunchEntity;
import java.util.Map;

View File

@@ -2,11 +2,11 @@ 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.BookClockinEntity;
import com.peanut.modules.book.entity.BookClockInEntity;
import java.util.Map;
public interface BookClockinService extends IService<BookClockinEntity> {
public interface BookClockinService extends IService<BookClockInEntity> {
PageUtils queryPage(Map<String, Object> params);

View File

@@ -2,10 +2,10 @@ package com.peanut.modules.book.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.book.dao.BookClockEntryChatDao;
import com.peanut.modules.book.entity.BookClockEntryChatEntity;
import com.peanut.modules.book.entity.BookClockInChatEntity;
import com.peanut.modules.book.service.BookClockEntryChatService;
import org.springframework.stereotype.Service;
@Service("bookClockEntryChatService")
public class BookClockEntryChatImpl extends ServiceImpl<BookClockEntryChatDao,BookClockEntryChatEntity> implements BookClockEntryChatService {
public class BookClockEntryChatImpl extends ServiceImpl<BookClockEntryChatDao, BookClockInChatEntity> implements BookClockEntryChatService {
}

View File

@@ -7,7 +7,6 @@ import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query;
import com.peanut.modules.book.dao.BookClockinCommentDao;
import com.peanut.modules.book.entity.BookClockinCommentEntity;
import com.peanut.modules.book.entity.BookClockinEntity;
import com.peanut.modules.book.service.BookClockinCommentService;
import org.springframework.stereotype.Service;

View File

@@ -6,23 +6,23 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query;
import com.peanut.modules.book.dao.BookClockinDao;
import com.peanut.modules.book.entity.BookClockinEntity;
import com.peanut.modules.book.entity.BookClockInEntity;
import com.peanut.modules.book.service.BookClockinService;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service
public class BookClockinServiceImpl extends ServiceImpl<BookClockinDao, BookClockinEntity> implements BookClockinService {
public class BookClockinServiceImpl extends ServiceImpl<BookClockinDao, BookClockInEntity> implements BookClockinService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Object book =params.get("bookid");
Object taskid = params.get("taskid");
IPage<BookClockinEntity> page = this.page(
new Query<BookClockinEntity>().getPage(params),
new QueryWrapper<BookClockinEntity>()
IPage<BookClockInEntity> page = this.page(
new Query<BookClockInEntity>().getPage(params),
new QueryWrapper<BookClockInEntity>()
.eq("book_id",book)
.eq("task_id",taskid)
.orderByDesc("create_time")
@@ -34,9 +34,9 @@ public class BookClockinServiceImpl extends ServiceImpl<BookClockinDao, BookCloc
@Override
public PageUtils queryPagemylist(Map<String, Object> params) {
IPage<BookClockinEntity> page = this.page(
new Query<BookClockinEntity>().getPage(params),
new QueryWrapper<BookClockinEntity>()
IPage<BookClockInEntity> page = this.page(
new Query<BookClockInEntity>().getPage(params),
new QueryWrapper<BookClockInEntity>()
);
return new PageUtils(page);

View File

@@ -15,6 +15,7 @@ import org.springframework.stereotype.Component;
*/
@Component
public class OrderCancelConsumer {
@Autowired
BuyOrderService buyOrderService;

View File

@@ -8,7 +8,7 @@
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.peanut.modules.book.entity.BookClockinEntity" id="bookClockinMap">
<resultMap type="com.peanut.modules.book.entity.BookClockInEntity" id="bookClockinMap">
<result property="id" column="id"/>
<result property="bookId" column="book_id"/>
<result property="userId" column="user_id"/>

View File

@@ -1,27 +1,27 @@
# APP ID
wxpay.appId:wx47134a8f15083734
# ?? ID
# \u5546\u6237 ID
wxpay.mchId:1612860909
# ?? URL
# \u652F\u4ED8 URL
wxpay.payUrl:https://api.mch.weixin.qq.com/v3/pay/transactions/app
# ????
# \u901A\u77E5\u56DE\u8C03 URL
wxpay.notifyUrl:https://testapi.nuttyreading.com/pay/payNotify
# ?? url
# \u9000\u6B3E URL
wxpay.refundNotifyUrl:http://pjm6m9.natappfree.cc/pay/refundNotify
# key pem
wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
#wxpay.keyPemPath:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
#wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
wxpay.keyPemPath:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
#wxpay.keyPemPath:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
#wxpay.keyPemPath:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
# ???
# \u5546\u6237\u5E8F\u5217\u53F7
wxpay.serialNo:679AECB2F7AC4183033F713828892BA640E4EEE3
# API v3 key
wxpay.apiV3Key:4aYFklzaULeGlr7oJPZ6rHWKcxjihZUF
# ????
wxpay.wechatPayCertificateUrl:/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
# wxpay.wechatPayCertificateUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
# \u8BC1\u4E66
#wxpay.wechatPayCertificateUrl:/usr/local/hs/peanut_book/target/classes/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
wxpay.wechatPayCertificateUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
# wxpay.wechatPayCertificateUrl:D:/hs/nuttyreading-java/src/main/resources/cent/wechatpay_7B5676E3CDF56680D0414A009CE501C844DBE2D6.pem
# ?? url
wxpay.privateKeyUrl:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
#wxpay.privateKeyUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
# \u5BC6\u94A5
#wxpay.privateKeyUrl:/usr/local/hs/peanut_book/target/classes/cent/apiclient_key.pem
wxpay.privateKeyUrl:C:/Users/Cauchy/IdeaProjects/nuttyreading-java/src/main/resources/cent/apiclient_key.pem
#wxpay.privateKeyUrl:D:/hs/nuttyreading-java/src/main/resources/cent/apiclient_key.pem