xiaoyong931011
2022-09-22 7cf7a80569d3cb907e0260abc3b2dbd36ec6c4c2
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -483,14 +483,11 @@
        IPage<MallOrderInfo> page = new Page<>(orderListDto.getPageNum(), orderListDto.getPageSize());
        orderListDto.setMemberId(member.getId());
//        IPage<MallOrderInfo> mallOrderInfos = this.baseMapper.selectApiOrderListInPage(page, orderListDto);
        IPage<MallOrderInfo> mallOrderInfos = this.baseMapper.selectNewApiOrderListInPage(page, orderListDto);
        if(CollUtil.isNotEmpty(mallOrderInfos.getRecords())){
            for(MallOrderInfo mallOrderInfo : mallOrderInfos.getRecords()){
                Long orderInfoId = mallOrderInfo.getId();
                List<MallOrderItem> mallOrderItemList = mallOrderItemMapper.selectListByOrderId(orderInfoId);
                mallOrderInfo.setItems(mallOrderItemList);
            }
        IPage<MallOrderInfo> mallOrderInfos = this.baseMapper.selectApiOrderListInPage(page, orderListDto);
        if (CollUtil.isNotEmpty(mallOrderInfos.getRecords())) {
            mallOrderInfos.getRecords().forEach(item -> {
                item.setItems(mallOrderItemMapper.selectListByOrderId(item.getId()));
            });
        }
        return MallOrderInfoConversion.INSTANCE.entitysToVos(mallOrderInfos.getRecords());
    }