|
@@ -11,7 +11,6 @@ import com.usoftchina.saas.document.entities.Product;
|
|
|
import com.usoftchina.saas.document.mapper.ProductMapper;
|
|
import com.usoftchina.saas.document.mapper.ProductMapper;
|
|
|
import com.usoftchina.saas.document.service.ProductService;
|
|
import com.usoftchina.saas.document.service.ProductService;
|
|
|
import com.usoftchina.saas.page.PageRequest;
|
|
import com.usoftchina.saas.page.PageRequest;
|
|
|
-import com.usoftchina.saas.utils.BeanMapper;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -24,7 +23,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
private ProductMapper productMapper;
|
|
private ProductMapper productMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO) {
|
|
|
|
|
|
|
+ public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO) {
|
|
|
//设置分页
|
|
//设置分页
|
|
|
if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
|
|
if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
|
|
|
page = new PageRequest();
|
|
page = new PageRequest();
|
|
@@ -32,12 +31,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
page.setSize(10);
|
|
page.setSize(10);
|
|
|
}
|
|
}
|
|
|
PageHelper.startPage(page.getNumber(), page.getSize());
|
|
PageHelper.startPage(page.getNumber(), page.getSize());
|
|
|
- List<Product> productList = productMapper.getProductsByCondition(docReqDTO);
|
|
|
|
|
- //Product To ProductDTO
|
|
|
|
|
- List<ProductDTO> productDTOList = BeanMapper.mapList(productList, ProductDTO.class);
|
|
|
|
|
|
|
+ List<ProductDTO> productList = productMapper.getProductsByCondition(docReqDTO);
|
|
|
//取分页信息
|
|
//取分页信息
|
|
|
- PageInfo<ProductDTO> pageInfo = new PageInfo<ProductDTO>(productDTOList);
|
|
|
|
|
- return productDTOList;
|
|
|
|
|
|
|
+ PageInfo<ProductDTO> pageInfo = new PageInfo<ProductDTO>(productList);
|
|
|
|
|
+ return pageInfo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|