后台调接口返回的数据怎么用分页,为什么始终只有一页不能用分页

提问 未结
4 139
摩羯座小笨熊
悬赏:20飞吻
后台接口返回的数据,怎么在前端页面用分页方式展示 后台怎么设置 pageinfo

@Override
public PageInfo NewDraftSelect(PayTaskViewParam payTaskViewParam) {
String post = "";
List<NewDraftRep> newDraftRepList = new ArrayList<>();
PageHelper.startPage(payTaskViewParam.getPage(), payTaskViewParam.getLimit());//开启分页
int num=0;
try {
payTaskViewParam.setPageSize(payTaskViewParam.getLimit());
payTaskViewParam.setPageNo(payTaskViewParam.getPage());

String payTaskViewParamJSON = JSON.toJSONString(payTaskViewParam);
post = resetfulUtil.post(IP_ADDR + "/vi", payTaskViewParamJSON);
JSONObject newDraftObj = JSONObject.parseObject(post);
List<OrderViewVO> orderViewVOList = JSONArray.parseArray(newDraftObj.getString("data"), OrderViewVO.class);
num=orderViewVOList.size();
for (OrderViewVO orderViewVO : orderViewVOList) {
if (!orderViewVO.getStatus().equals(999)) {
for (OrderViewTripVO orderViewTripVO : orderViewVO.getOrderViewTripVOList()) {
NewDraftRep newDraftRep = new NewDraftRep();
newDraftRep.setCreateTime(timeFormat.format(orderViewVO.getCreateTime()));
newDraftRep.setUpdateTime(timeFormat.format(orderViewVO.getUpdateTime()));
newDraftRepList.add(newDraftRep);
}
}
}
} catch (Exception e) {
loggerHelper.exception("出错 post:" + post, e);
}
PageInfo<NewDraftRep> pageInfo =new PageInfo<>(newDraftRepList);
// pageInfo.setTotal(num);
if (newDraftRepList != null && newDraftRepList.size() > 0) {

return pageInfo;
} else {
return pageInfo;
}
}
回帖