bug xf
This commit is contained in:
@@ -7,7 +7,7 @@ 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.BookClockInChatEntity;
|
||||
import com.peanut.modules.book.entity.BookClockEntryChatEntity;
|
||||
import com.peanut.modules.book.entity.UserEntity;
|
||||
import com.peanut.modules.book.service.BookClockEntryChatService;
|
||||
import com.peanut.modules.book.service.BookClockEntryService;
|
||||
@@ -66,7 +66,7 @@ public class BookClockForumController {
|
||||
@RequestMapping(path = "/getChatList", method = RequestMethod.GET)
|
||||
public R getChatList(@RequestParam("entryId") Integer entryId,
|
||||
@RequestParam(value = "userId", required = false) Integer userId) {
|
||||
QueryWrapper<BookClockInChatEntity> queryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<BookClockEntryChatEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("entry_id", entryId);
|
||||
queryWrapper.eq("fid", 0);
|
||||
if (userId != null) {
|
||||
@@ -74,8 +74,8 @@ public class BookClockForumController {
|
||||
}
|
||||
queryWrapper.orderByAsc("fid", "create_time");
|
||||
List<ClockInCommentVo> resultList = new ArrayList<>();
|
||||
List<BookClockInChatEntity> chatEntityList = bookClockEntryChatService.list(queryWrapper);
|
||||
for (BookClockInChatEntity entity : chatEntityList) {
|
||||
List<BookClockEntryChatEntity> chatEntityList = bookClockEntryChatService.list(queryWrapper);
|
||||
for (BookClockEntryChatEntity entity : chatEntityList) {
|
||||
List<String> imageList = JSON.parseObject(entity.getImages(), new TypeReference<List<String>>() {
|
||||
});
|
||||
entity.setImageList(imageList);
|
||||
@@ -84,11 +84,11 @@ public class BookClockForumController {
|
||||
UserEntity user = userService.getById(entity.getUserId());
|
||||
vo.setNickName(user.getNickname());
|
||||
vo.setAvatar(user.getAvatar());
|
||||
QueryWrapper<BookClockInChatEntity> subQueryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper<BookClockEntryChatEntity> subQueryWrapper = new QueryWrapper<>();
|
||||
subQueryWrapper.eq("fid", entity.getId());
|
||||
List<BookClockInChatEntity> subClockInChatList = bookClockEntryChatService.list(subQueryWrapper);
|
||||
List<BookClockEntryChatEntity> subClockInChatList = bookClockEntryChatService.list(subQueryWrapper);
|
||||
List<ClockInCommentVo> subCommentList = new ArrayList<>();
|
||||
for (BookClockInChatEntity subChat : subClockInChatList) {
|
||||
for (BookClockEntryChatEntity subChat : subClockInChatList) {
|
||||
ClockInCommentVo subVo = new ClockInCommentVo();
|
||||
BeanUtil.copyProperties(subChat, subVo);
|
||||
UserEntity subChatUser = userService.getById(subChat.getUserId());
|
||||
@@ -114,7 +114,7 @@ public class BookClockForumController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(path = "/addChat", method = RequestMethod.POST)
|
||||
public R addChat(@RequestBody BookClockInChatEntity chat) {
|
||||
public R addChat(@RequestBody BookClockEntryChatEntity chat) {
|
||||
List<String> imageList = chat.getImageList();
|
||||
if (imageList != null) {
|
||||
String images = JSON.toJSON(imageList).toString();
|
||||
|
||||
@@ -685,7 +685,9 @@ public class BookController {
|
||||
|
||||
LambdaQueryWrapper<BookEntity> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(BookEntity::getDelFlag,0);
|
||||
wrapper1.in(BookEntity::getId,bookIds);
|
||||
if(bookIds.size()>0){
|
||||
wrapper1.in(BookEntity::getId,bookIds);
|
||||
}
|
||||
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1);
|
||||
|
||||
return R.ok().put("page",bookEntityPage);
|
||||
|
||||
@@ -262,6 +262,30 @@ public class BuyOrderController {
|
||||
return R.ok().put("orderSn", timeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单详情
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getOrderDetail")
|
||||
public R getOrderDetail(@RequestParam Integer orderId){
|
||||
LambdaQueryWrapper<BuyOrderEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BuyOrderEntity::getOrderId,orderId);
|
||||
BuyOrderEntity one = buyOrderService.getOne(wrapper);
|
||||
if(one.equals(null)){
|
||||
return R.error("order error:order is null");
|
||||
}
|
||||
//添加用户信息
|
||||
one.setUser(myUserService.getById(one.getUserId()));
|
||||
//添加商品信息
|
||||
LambdaQueryWrapper<BuyOrderDetailEntity> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(BuyOrderDetailEntity::getOrderId,orderId);
|
||||
List<BuyOrderDetailEntity> buyOrderDetailEntities = buyOrderDetailService.getBaseMapper().selectList(wrapper1);
|
||||
one.setProducts(buyOrderDetailEntities);
|
||||
|
||||
return R.ok().put("user",one);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.peanut.modules.book.dao;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.peanut.modules.book.entity.BookClockInChatEntity;
|
||||
import com.peanut.modules.book.entity.BookClockEntryChatEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BookClockEntryChatDao extends MPJBaseMapper<BookClockInChatEntity> {
|
||||
public interface BookClockEntryChatDao extends MPJBaseMapper<BookClockEntryChatEntity> {
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
@TableName("book_clock_entry_chat")
|
||||
public class BookClockInChatEntity implements Serializable {
|
||||
public class BookClockEntryChatEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
@@ -169,4 +169,7 @@ public class BuyOrderEntity implements Serializable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long timestamp;
|
||||
|
||||
@TableField(exist = false)
|
||||
private MyUserEntity user;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.BookClockInChatEntity;
|
||||
import com.peanut.modules.book.entity.BookClockEntryChatEntity;
|
||||
|
||||
public interface BookClockEntryChatService extends IService<BookClockInChatEntity> {
|
||||
public interface BookClockEntryChatService extends IService<BookClockEntryChatEntity> {
|
||||
}
|
||||
|
||||
@@ -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.BookClockInChatEntity;
|
||||
import com.peanut.modules.book.entity.BookClockEntryChatEntity;
|
||||
import com.peanut.modules.book.service.BookClockEntryChatService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service("bookClockEntryChatService")
|
||||
public class BookClockEntryChatImpl extends ServiceImpl<BookClockEntryChatDao, BookClockInChatEntity> implements BookClockEntryChatService {
|
||||
public class BookClockEntryChatImpl extends ServiceImpl<BookClockEntryChatDao, BookClockEntryChatEntity> implements BookClockEntryChatService {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user