userentity bug

This commit is contained in:
wangjinlei
2023-10-18 12:41:22 +08:00
parent 59f46eb2aa
commit 8f7f785ba9
21 changed files with 75 additions and 239 deletions

View File

@@ -5,12 +5,12 @@ 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.app.service.UserService;
import com.peanut.modules.book.entity.BookClockEntryEntity;
import com.peanut.modules.book.entity.BookClockEntryChatEntity;
import com.peanut.modules.book.entity.UserEntity;
import com.peanut.modules.book.entity.MyUserEntity;
import com.peanut.modules.book.service.BookClockEntryChatService;
import com.peanut.modules.book.service.BookClockEntryService;
import com.peanut.modules.book.service.MyUserService;
import com.peanut.modules.book.vo.ClockInCommentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -36,7 +36,7 @@ public class BookClockForumController {
private BookClockEntryService bookClockEntryService;
@Autowired
private UserService userService;
private MyUserService userService;
/**
* 获取论坛内容
@@ -81,7 +81,7 @@ public class BookClockForumController {
entity.setImageList(imageList);
ClockInCommentVo vo = new ClockInCommentVo();
BeanUtil.copyProperties(entity, vo);
UserEntity user = userService.getById(entity.getUserId());
MyUserEntity user = userService.getById(entity.getUserId());
vo.setNickName(user.getNickname());
vo.setAvatar(user.getAvatar());
QueryWrapper<BookClockEntryChatEntity> subQueryWrapper = new QueryWrapper<>();
@@ -91,8 +91,8 @@ public class BookClockForumController {
for (BookClockEntryChatEntity subChat : subClockInChatList) {
ClockInCommentVo subVo = new ClockInCommentVo();
BeanUtil.copyProperties(subChat, subVo);
UserEntity subChatUser = userService.getById(subChat.getUserId());
UserEntity pUser = userService.getById(subChat.getPuserId());
MyUserEntity subChatUser = userService.getById(subChat.getUserId());
MyUserEntity pUser = userService.getById(subChat.getPuserId());
subVo.setPuserNickName(pUser.getNickname());
subVo.setPuserAvatar(pUser.getAvatar());
subVo.setAvatar(subChatUser.getAvatar());

View File

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.R;
import com.peanut.modules.app.service.UserService;
import com.peanut.modules.book.dao.BookForumArticlesDao;
import com.peanut.modules.book.entity.*;
import com.peanut.modules.book.service.*;
@@ -32,7 +31,7 @@ public class BookForumArticlesServiceController {
@Autowired
private BookForumArticlesDao bookForumArticlesDao;
@Autowired
private UserService userService;
private MyUserService userService;
/**
* 列表 (开始时间倒叙) 后台get请求
@@ -132,7 +131,7 @@ public class BookForumArticlesServiceController {
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
for (BookEntity b :bookEntityPage.getRecords()){
b.setForums(bookForumArticlesService.getForumsLimit(b.getId(), 4));
b.setForums(userService.getForumsLimit(b.getId(), 4));
b.setForumNum(bookForumArticlesService.getForumsCount(b.getId()));
}
@@ -159,7 +158,7 @@ public class BookForumArticlesServiceController {
wrapper.exists(existSql);
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
for (BookEntity b : bookEntityPage.getRecords()){
b.setForums(bookForumArticlesService.getForumsLimit(b.getId(), 4));
b.setForums(userService.getForumsLimit(b.getId(), 4));
b.setForumNum(bookForumArticlesService.getForumsCount(b.getId()));
}
@@ -185,7 +184,7 @@ public class BookForumArticlesServiceController {
wrapper.exists(existSql);
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
for (BookEntity b : bookEntityPage.getRecords()){
b.setForums(bookForumArticlesService.getForumsLimit(b.getId(), 4));
b.setForums(userService.getForumsLimit(b.getId(), 4));
b.setForumNum(bookForumArticlesService.getForumsCount(b.getId()));
}
@@ -232,7 +231,7 @@ public class BookForumArticlesServiceController {
wrapper.orderByDesc(BookForumArticlesEntity::getCreateTime);
Page<BookForumArticlesEntity> bookForumArticlesEntityPage = bookForumArticlesService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
for (BookForumArticlesEntity b:bookForumArticlesEntityPage.getRecords()){
UserEntity byId = userService.getById(b.getUserid());
MyUserEntity byId = userService.getById(b.getUserid());
b.setUser(byId);
b.setComment(bookForumCommenService.getCommentsLimit(b.getId(),3));
}

View File

@@ -263,7 +263,7 @@ public class BuyOrderController {
BuyOrderEntity buyOrderEntity = buyOrderService.getBaseMapper().selectOne(new LambdaQueryWrapper<BuyOrderEntity>().eq(BuyOrderEntity::getOrderSn, timeId));
WechatPaymentInfo paymentInfo = new WechatPaymentInfo();
paymentInfo.setOrderSn(buyOrderEntity.getOrderSn());
paymentInfo.setBuyOrderId(buyOrderEntity.getOrderId());
paymentInfo.setBuyOrderId(Integer.valueOf(buyOrderEntity.getProductId()));
paymentInfo.setTotalAmount(buyOrderEntity.getRealMoney());
wxpayService.prepay(paymentInfo);
return R.ok().put("orderSn", timeId);

View File

@@ -9,10 +9,13 @@ 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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.peanut.common.utils.MD5Utils;
import com.peanut.modules.book.entity.*;
import com.peanut.modules.book.service.*;
import com.peanut.modules.book.to.PageIdDto;
import com.peanut.modules.sys.service.SysUserTokenService;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@@ -71,6 +74,23 @@ public class MyUserController {
return R.ok().put("page", page);
}
/**
* 获取用户列表
* @param p
* @return
*/
@RequestMapping("/getUserList")
public R getUserList(@RequestBody PageIdDto p){
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>();
if(!p.getKey().equals(null)){
wrapper.eq(MyUserEntity::getTel,p.getKey()).or().eq(MyUserEntity::getName,p.getKey());
}
wrapper.eq(MyUserEntity::getDelFlag,0);
Page<MyUserEntity> myUserEntityPage = userService.getBaseMapper().selectPage(new Page<MyUserEntity>(p.getPage(), p.getLimit()), wrapper);
return R.ok().put("user",myUserEntityPage);
}
/**
* 信息