|
|
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
|
|
|
import com.ruoyi.basic.domain.YjStore;
|
|
|
|
|
|
|
|
import com.ruoyi.basic.service.YjStoreService;
|
|
|
|
import com.ruoyi.course.domain.req.ReqSearchClaTime;
|
|
|
|
import com.ruoyi.course.domain.req.ReqSearchClaTime;
|
|
|
|
import com.ruoyi.course.service.ScClaTimeService;
|
|
|
|
import com.ruoyi.course.service.ScClaTimeService;
|
|
|
|
import com.ruoyi.mall.domain.Product;
|
|
|
|
import com.ruoyi.mall.domain.Product;
|
|
|
|
@ -47,7 +49,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private BrandMapper brandMapper;
|
|
|
|
private BrandMapper brandMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private ScClaTimeService scClaTimeService;
|
|
|
|
private YjStoreService storeService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询商品信息
|
|
|
|
* 查询商品信息
|
|
|
|
@ -73,24 +75,34 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|
|
|
* @return 商品信息
|
|
|
|
* @return 商品信息
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public List<Product> selectList(ProductQuery query, Pageable page) {
|
|
|
|
public List<Product> selectList(ProductQuery query, Pageable page) {
|
|
|
|
if (page != null) {
|
|
|
|
|
|
|
|
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Long categoryId = query.getCategoryId();
|
|
|
|
Long categoryId = query.getCategoryId();
|
|
|
|
if (categoryId != null && categoryId.equals(1L)) {
|
|
|
|
if (categoryId != null && categoryId.equals(1L)) {
|
|
|
|
|
|
|
|
YjStore store= storeService.getOne(Long.valueOf(query.getStoreId()));
|
|
|
|
|
|
|
|
if (store==null){
|
|
|
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (page != null) {
|
|
|
|
|
|
|
|
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
|
|
|
|
|
|
|
}
|
|
|
|
QueryWrapper<Product> qw = new QueryWrapper<>();
|
|
|
|
QueryWrapper<Product> qw = new QueryWrapper<>();
|
|
|
|
qw.eq("publish_status", 1);
|
|
|
|
qw.eq("publish_status", 1);
|
|
|
|
qw.orderByAsc("sort");
|
|
|
|
|
|
|
|
qw.eq("category_id", categoryId);
|
|
|
|
qw.eq("category_id", categoryId);
|
|
|
|
qw.eq("store_id", query.getStoreId());//门店id
|
|
|
|
qw.eq("store_id", query.getStoreId());//门店id
|
|
|
|
String search = query.getSearch();
|
|
|
|
String search = query.getSearch();
|
|
|
|
if (StringUtils.isNoneEmpty(search)){
|
|
|
|
if (StringUtils.isNoneEmpty(search)){
|
|
|
|
qw.like("name", "%".concat(query.getSearch().trim()).concat("%"));
|
|
|
|
qw.like("name", "%".concat(query.getSearch().trim()).concat("%"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
qw.orderByAsc("sort");
|
|
|
|
return productMapper.selectList(qw);
|
|
|
|
return productMapper.selectList(qw);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//商城商品
|
|
|
|
//商城商品
|
|
|
|
|
|
|
|
if (page != null) {
|
|
|
|
|
|
|
|
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
|
|
|
|
|
|
|
}
|
|
|
|
return productMapper.getMallProductList(categoryId,query.getSearch(),null);
|
|
|
|
return productMapper.getMallProductList(categoryId,query.getSearch(),null);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|