bug fix
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.BookClockEntryEntity;
|
||||
@@ -69,6 +70,7 @@ public class BookClockForumController {
|
||||
@RequestParam(value = "userId", required = false) Integer userId,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "currentPage", defaultValue = "1") Integer currentPage) {
|
||||
Page<BookClockEntryChat> chatPage = new Page<>(currentPage, pageSize);
|
||||
QueryWrapper<BookClockEntryChat> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("entry_id", entryId);
|
||||
queryWrapper.eq("fid", 0);
|
||||
@@ -77,7 +79,8 @@ public class BookClockForumController {
|
||||
}
|
||||
queryWrapper.orderByAsc("fid", "create_time");
|
||||
List<ClockInCommentVo> resultList = new ArrayList<>();
|
||||
List<BookClockEntryChat> chatEntityList = bookClockEntryChatService.list(queryWrapper);
|
||||
Page<BookClockEntryChat> page = bookClockEntryChatService.page(chatPage, queryWrapper);
|
||||
List<BookClockEntryChat> chatEntityList = page.getRecords();
|
||||
for (BookClockEntryChat entity : chatEntityList) {
|
||||
List<String> imageList = JSON.parseObject(entity.getImages(), new TypeReference<List<String>>() {
|
||||
});
|
||||
@@ -89,8 +92,7 @@ public class BookClockForumController {
|
||||
vo.setAvatar(user.getAvatar());
|
||||
resultList.add(vo);
|
||||
}
|
||||
PageUtils page = new PageUtils(resultList, resultList.size(), pageSize, currentPage);
|
||||
return R.ok().put("result", page);
|
||||
return R.ok().put("result", resultList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,9 +107,11 @@ public class BookClockForumController {
|
||||
public R getSubChatList(@RequestParam("fid") Integer fid,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "currentPage", defaultValue = "1") Integer currentPage) {
|
||||
Page<BookClockEntryChat> bookClockEntryChatPage = new Page<>(currentPage, pageSize);
|
||||
QueryWrapper<BookClockEntryChat> subQueryWrapper = new QueryWrapper<>();
|
||||
subQueryWrapper.eq("fid", fid);
|
||||
List<BookClockEntryChat> subClockInChatList = bookClockEntryChatService.list(subQueryWrapper);
|
||||
Page<BookClockEntryChat> page = bookClockEntryChatService.page(bookClockEntryChatPage, subQueryWrapper);
|
||||
List<BookClockEntryChat> subClockInChatList = page.getRecords();
|
||||
List<ClockInCommentVo> subCommentList = new ArrayList<>();
|
||||
for (BookClockEntryChat subChat : subClockInChatList) {
|
||||
ClockInCommentVo subVo = new ClockInCommentVo();
|
||||
@@ -120,8 +124,7 @@ public class BookClockForumController {
|
||||
subVo.setNickName(subChatUser.getNickname());
|
||||
subCommentList.add(subVo);
|
||||
}
|
||||
PageUtils subChatPage = new PageUtils(subCommentList, subCommentList.size(), pageSize, currentPage);
|
||||
return R.ok().put("result", subChatPage);
|
||||
return R.ok().put("result", subCommentList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -103,7 +103,7 @@ public class BuyOrderController {
|
||||
*/
|
||||
@RequestMapping(path = "/orderList", method = RequestMethod.POST)
|
||||
public R orderList(@RequestBody BuyOrderListRequestVo requestVo) {
|
||||
PageUtils page = buyOrderService.orderList(requestVo);
|
||||
List<BuyOrderResponseVo> page = buyOrderService.orderList(requestVo);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public interface BuyOrderService extends IService<BuyOrder> {
|
||||
* @param requestVo
|
||||
* @return
|
||||
*/
|
||||
PageUtils orderList(BuyOrderListRequestVo requestVo);
|
||||
List<BuyOrderResponseVo> orderList(BuyOrderListRequestVo requestVo);
|
||||
|
||||
/**
|
||||
* 订单拆分发货
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.peanut.common.utils.ExcludeEmptyQueryWrapper;
|
||||
@@ -304,19 +305,21 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils orderList(BuyOrderListRequestVo requestVo) {
|
||||
public List<BuyOrderResponseVo> orderList(BuyOrderListRequestVo requestVo) {
|
||||
Page<BuyOrder> buyOrderPage = new Page<>(requestVo.getPageIndex(), requestVo.getPageSize());
|
||||
List<BuyOrderResponseVo> result = new ArrayList<>();
|
||||
QueryWrapper<BuyOrder> buyOrderQueryWrapper = new QueryWrapper<>();
|
||||
buyOrderQueryWrapper.like(StringUtils.isNotBlank(requestVo.getSearchKeyWord()), "order_sn", requestVo.getSearchKeyWord());
|
||||
buyOrderQueryWrapper.eq(StringUtils.isNotBlank(requestVo.getOrderStatus()), "order_status", requestVo.getOrderStatus());
|
||||
buyOrderQueryWrapper.gt(requestVo.getStartTime() != null, "create_time", requestVo.getStartTime());
|
||||
buyOrderQueryWrapper.lt(requestVo.getEndTime() != null, "create_time", requestVo.getStartTime());
|
||||
List<BuyOrder> buyOrderList = list(buyOrderQueryWrapper);
|
||||
Page<BuyOrder> page = page(buyOrderPage, buyOrderQueryWrapper);
|
||||
List<BuyOrder> buyOrderList = page.getRecords();
|
||||
for (BuyOrder buyOrder : buyOrderList) {
|
||||
BuyOrderResponseVo responseVo = setBuyOrderInfo(buyOrder);
|
||||
result.add(responseVo);
|
||||
}
|
||||
return new PageUtils(result, buyOrderList.size(), requestVo.getPageSize(), requestVo.getPageIndex());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user