项目使用的是Mybatis - 通用分页拦截器
正确状态:
@Override
public Page<BalanceWithdrawalVO> getWithdrawInfoList(Page page, BalanceWithdrawalDTO dto) {
PageHelper.startPage(page.getPageNo(), page.getPageSize());
List<BalanceWithdrawalVO> merchantIdList = storeNetBankInfoDao.selectStoreInfoByCondition(dto);
List<BalanceWithdrawalVO> balanceWithdrawalVOList = new ArrayList<>();
for (BalanceWithdrawalVO vo : merchantIdList) {
//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式
BalanceWithdrawalVO balanceWithdrawalVO = new BalanceWithdrawalVO();
try {
List<BalanceInfo> amountInfo = getAmountInfo(vo.getMerchantId());
balanceWithdrawalVO.setMerchantId(vo.getMerchantId());
balanceWithdrawalVO.setStoreName(vo.getStoreName());
if (Objects.isNull(amountInfo)) {
balanceWithdrawalVO.setBalance(null);
} else {
balanceWithdrawalVO.setBalance(amountInfo.get(1).getTotalAmount());
}
} catch (MybankApiException e) {
log.warn("获取余额提现数据错误【{}】", e);
}
balanceWithdrawalVOList.add(balanceWithdrawalVO);
}
merchantIdList.clear();
merchantIdList.addAll(balanceWithdrawalVOList);
return new Page<>(merchantIdList);
}
正常显示
初始状态:
@Override
public Page<BalanceWithdrawalVO> getWithdrawInfoList(Page page, BalanceWithdrawalDTO dto) {
PageHelper.startPage(page.getPageNo(), page.getPageSize());
List<BalanceWithdrawalVO> merchantIdList = storeNetBankInfoDao.selectStoreInfoByCondition(dto);
List<BalanceWithdrawalVO> balanceWithdrawalVOList = new ArrayList<>();
for (BalanceWithdrawalVO vo : merchantIdList) {
//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式
BalanceWithdrawalVO balanceWithdrawalVO = new BalanceWithdrawalVO();
try {
List<BalanceInfo> amountInfo = getAmountInfo(vo.getMerchantId());
balanceWithdrawalVO.setMerchantId(vo.getMerchantId());
balanceWithdrawalVO.setStoreName(vo.getStoreName());
if (Objects.isNull(amountInfo)) {
balanceWithdrawalVO.setBalance(null);
} else {
balanceWithdrawalVO.setBalance(amountInfo.get(1).getTotalAmount());
}
} catch (MybankApiException e) {
log.warn("获取余额提现数据错误【{}】", e);
}
balanceWithdrawalVOList.add(balanceWithdrawalVO);
}
return new Page<>(balanceWithdrawalVOList);
}
无法显示总条数
网友评论