|
|
@@ -1,10 +1,8 @@
|
|
|
-package com.usoftchina.saas.document.service.Impl;
|
|
|
+package com.usoftchina.saas.document.service.impl;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
|
|
|
-
|
|
|
-
|
|
|
import com.usoftchina.saas.commons.dto.ComboDTO;
|
|
|
import com.usoftchina.saas.commons.dto.DocReqDTO;
|
|
|
import com.usoftchina.saas.document.dto.ProductDTO;
|
|
|
@@ -12,7 +10,6 @@ import com.usoftchina.saas.document.entities.Product;
|
|
|
import com.usoftchina.saas.document.mapper.ProductMapper;
|
|
|
import com.usoftchina.saas.document.service.ProductService;
|
|
|
import com.usoftchina.saas.page.PageRequest;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -20,9 +17,6 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Product> implements ProductService {
|
|
|
|
|
|
- @Autowired
|
|
|
- private ProductMapper productMapper;
|
|
|
-
|
|
|
@Override
|
|
|
public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, DocReqDTO docReqDTO) {
|
|
|
//设置分页
|
|
|
@@ -32,7 +26,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
page.setSize(10);
|
|
|
}
|
|
|
PageHelper.startPage(page.getNumber(), page.getSize());
|
|
|
- List<ProductDTO> productList = productMapper.getProductsByCondition(docReqDTO);
|
|
|
+ List<ProductDTO> productList = getMapper().getProductsByCondition(docReqDTO);
|
|
|
//取分页信息
|
|
|
PageInfo<ProductDTO> pageInfo = new PageInfo<ProductDTO>(productList);
|
|
|
return pageInfo;
|
|
|
@@ -40,18 +34,18 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
|
|
|
@Override
|
|
|
public List<ComboDTO> getProdUnit() {
|
|
|
- return productMapper.getProdUnit();
|
|
|
+ return getMapper().getProdUnit();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void updateLatestPurchasePrice(Long pu_id) {
|
|
|
- productMapper.updateLatestPurchasePrice(pu_id);
|
|
|
+ getMapper().updateLatestPurchasePrice(pu_id);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Product getProductsByPK(Long id) {
|
|
|
if (null == id) {
|
|
|
- return productMapper.selectByPrimaryKey(id);
|
|
|
+ return getMapper().selectByPrimaryKey(id);
|
|
|
}
|
|
|
return null;
|
|
|
}
|