|
@@ -351,7 +351,11 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
|
|
|
.eq(OmsOrder :: getStatus,param.getStatus())
|
|
|
.orderByDesc(OmsOrder :: getCreateTime)
|
|
|
.page(PagingUtils.convert(param.getPaging()));
|
|
|
- return PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
|
|
|
+ Pagination<OmsOrderDTO> pagination = PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
|
|
|
+ pagination.getRecords().forEach(item ->{
|
|
|
+ item.setGoodsInfo(this.omsOrderItemService.getOrderItemByOrderId(item.getId()));
|
|
|
+ });
|
|
|
+ return pagination;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -362,7 +366,11 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
|
|
|
.eq(StringUtils.nonEmpty(param.getStatus()),OmsOrder :: getStatus,param.getStatus())
|
|
|
.orderByDesc(OmsOrder :: getCreateTime)
|
|
|
.page(PagingUtils.convert(param.getPaging()));
|
|
|
- return PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
|
|
|
+ Pagination<OmsOrderDTO> pagination = PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
|
|
|
+ pagination.getRecords().forEach(item ->{
|
|
|
+ item.setGoodsInfo(this.omsOrderItemService.getOrderItemByOrderId(item.getId()));
|
|
|
+ });
|
|
|
+ return pagination;
|
|
|
}else{
|
|
|
List<Long> merchants = this.merchantService.getMerchantIdsByUserId(userId);
|
|
|
if (!StringUtils.nonEmpty(merchants)){
|
|
@@ -373,7 +381,11 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
|
|
|
.in(OmsOrder :: getMerchantId,merchants)
|
|
|
.orderByDesc(OmsOrder :: getCreateTime)
|
|
|
.page(PagingUtils.convert(param.getPaging()));
|
|
|
- return PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
|
|
|
+ Pagination<OmsOrderDTO> pagination = PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
|
|
|
+ pagination.getRecords().forEach(item ->{
|
|
|
+ item.setGoodsInfo(this.omsOrderItemService.getOrderItemByOrderId(item.getId()));
|
|
|
+ });
|
|
|
+ return pagination;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -735,11 +747,21 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
|
|
|
}
|
|
|
@Override
|
|
|
public Pagination<OmsOrderDTO> getMerchantOrderPaging(OrderPagingParam param){
|
|
|
+ Long userId = SessionContextHolder.getId();
|
|
|
+ List<Long> merchants = this.merchantService.getMerchantIdsByUserId(userId);
|
|
|
+ if (!StringUtils.nonEmpty(merchants)){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
Page<OmsOrder> page = this.lambdaQuery()
|
|
|
.eq(StringUtils.nonEmpty(param.getStatus()),OmsOrder :: getStatus,param.getStatus())
|
|
|
+ .in(OmsOrder::getMerchantId,merchants)
|
|
|
.orderByDesc(OmsOrder :: getCreateTime)
|
|
|
.page(PagingUtils.convert(param.getPaging()));
|
|
|
- return PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
|
|
|
+ Pagination<OmsOrderDTO> pagination = PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
|
|
|
+ pagination.getRecords().forEach(item ->{
|
|
|
+ item.setGoodsInfo(this.omsOrderItemService.getOrderItemByOrderId(item.getId()));
|
|
|
+ });
|
|
|
+ return pagination;
|
|
|
}
|
|
|
|
|
|
@Override
|