| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | |
| | | private ComShopGoodsDAO shopGoodsDAO; |
| | | @Resource |
| | | private ComShopGoodsAttrDAO comShopGoodsAttrDAO; |
| | | @Resource |
| | | private ComShopOrderService orderService; |
| | | @Resource |
| | | private UserService userService; |
| | | /** |
| | | * 查询店铺列表 |
| | | * |
| | |
| | | public R pageStoreList(PageComShopStoreDTO pageComShopStoreDTO) { |
| | | Page page = new Page<>(pageComShopStoreDTO.getPageNum(), pageComShopStoreDTO.getPageSize()); |
| | | IPage<PageShopStoreVO> comShopStoreVOIPage = this.baseMapper.pageShopStore(page, pageComShopStoreDTO); |
| | | if(comShopStoreVOIPage!=null){ |
| | | Optional.ofNullable(comShopStoreVOIPage.getRecords()).orElse(new ArrayList<>()).forEach(shopStoreVO ->{ |
| | | List<Integer> notDoneOrderStatus = new ArrayList<>(); |
| | | notDoneOrderStatus.add(1); |
| | | notDoneOrderStatus.add(2); |
| | | notDoneOrderStatus.add(3); |
| | | notDoneOrderStatus.add(4); |
| | | Integer orderCount = orderService.getBaseMapper() |
| | | .selectCount(new LambdaQueryWrapper<ComShopOrderDO>() |
| | | .eq(ComShopOrderDO::getStoreId, shopStoreVO.getId()) |
| | | .eq(ComShopOrderDO::getDeleteStatus, 1) |
| | | .in(ComShopOrderDO::getStatus, notDoneOrderStatus) |
| | | ); |
| | | if(orderCount!=null && orderCount.intValue()>0){ |
| | | shopStoreVO.setOrderDone(false); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(comShopStoreVOIPage); |
| | | } |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private ComShopOrderService orderService; |
| | | |
| | | /** |
| | | * 查询店铺详情 |