|
|
@@ -21,6 +21,7 @@ import com.github.zuihou.tenant.dto.ProductDto;
|
|
|
import com.github.zuihou.tenant.dto.ProductInfoDto;
|
|
|
import com.github.zuihou.tenant.dto.ProductInfoExcelDto;
|
|
|
import com.github.zuihou.tenant.dto.ProductionStatisticalDto;
|
|
|
+import com.github.zuihou.tenant.vo.ProductVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
@@ -96,9 +97,13 @@ public class ProductLinePerformanceServiceImpl extends SuperCacheServiceImpl<Pro
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public List<ProductDto> getProductStatistics(){
|
|
|
- List<ProductDto> statistics = workpieceMapper.getProductStatistics();
|
|
|
- return statistics;
|
|
|
+ public IPage<ProductDto> getProductStatistics(Long page, Long limit, ProductVo vo){
|
|
|
+ List<ProductDto> statistics = workpieceMapper.getProductStatistics(vo);
|
|
|
+ if (!CollectionUtil.isEmpty(statistics)) {
|
|
|
+ Page pages = IPageUtils.getPages(page, limit, statistics);
|
|
|
+ return pages;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -106,8 +111,8 @@ public class ProductLinePerformanceServiceImpl extends SuperCacheServiceImpl<Pro
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public IPage<ProductInfoDto> getProductInfoStatistics(Long page, Long limit) {
|
|
|
- List<ProductInfoDto> productInfoDtos = workpieceMapper.selectProductInfo();
|
|
|
+ public IPage<ProductInfoDto> getProductInfoStatistics(Long page, Long limit, ProductVo vo) {
|
|
|
+ List<ProductInfoDto> productInfoDtos = workpieceMapper.selectProductInfo(vo);
|
|
|
if (!CollectionUtil.isEmpty(productInfoDtos)) {
|
|
|
List<ProductInfoDto> productInfos = productInfoDtos.stream().map(item -> {
|
|
|
ProductInfoDto productInfoDto = BeanUtil.toBean(item, ProductInfoDto.class);
|
|
|
@@ -132,7 +137,8 @@ public class ProductLinePerformanceServiceImpl extends SuperCacheServiceImpl<Pro
|
|
|
|
|
|
@Override
|
|
|
public void expectProduct(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
|
|
- List<ProductDto> productStatistics = getProductStatistics();
|
|
|
+ ProductVo vo = new ProductVo();
|
|
|
+ List<ProductDto> productStatistics = workpieceMapper.getProductStatistics(vo);
|
|
|
// 设置响应输出的头类型
|
|
|
// 设置响应输出的头类型
|
|
|
response.setHeader("content-Type", "application/vnd.ms-excel");
|
|
|
@@ -147,7 +153,8 @@ public class ProductLinePerformanceServiceImpl extends SuperCacheServiceImpl<Pro
|
|
|
|
|
|
@Override
|
|
|
public void expectProductInfo(HttpServletResponse response) throws IOException {
|
|
|
- List<ProductInfoDto> productInfoDtos = workpieceMapper.selectProductInfo();
|
|
|
+ ProductVo vo = new ProductVo();
|
|
|
+ List<ProductInfoDto> productInfoDtos = workpieceMapper.selectProductInfo(vo);
|
|
|
List<ProductInfoDto> productInfos = productInfoDtos.stream().map(item->{
|
|
|
ProductInfoDto productInfoDto = BeanUtil.toBean(item, ProductInfoDto.class);
|
|
|
if (item.getEndTime() != null && item.getStartTime() != null) {
|
|
|
@@ -188,13 +195,17 @@ public class ProductLinePerformanceServiceImpl extends SuperCacheServiceImpl<Pro
|
|
|
* 设备工时统计
|
|
|
* @param page
|
|
|
* @param limit
|
|
|
+ * @param vo
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public IPage<ProductionStatisticalDto> queryProcedure(Long page, Long limit) {
|
|
|
- List<ProductionStatisticalDto> list = baseMapper.queryProcedure();
|
|
|
- Page pages = IPageUtils.getPages(page, limit, list);
|
|
|
- return pages;
|
|
|
+ public IPage<ProductionStatisticalDto> queryProcedure(Long page, Long limit, ProductVo vo) {
|
|
|
+ List<ProductionStatisticalDto> list = baseMapper.queryProcedure(vo);
|
|
|
+ if (!CollectionUtil.isEmpty(list)){
|
|
|
+ Page pages = IPageUtils.getPages(page, limit, list);
|
|
|
+ return pages;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -204,7 +215,8 @@ public class ProductLinePerformanceServiceImpl extends SuperCacheServiceImpl<Pro
|
|
|
*/
|
|
|
@Override
|
|
|
public void expectProcedure(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
|
|
- List<ProductionStatisticalDto> list = baseMapper.queryProcedure();
|
|
|
+ ProductVo vo = new ProductVo();
|
|
|
+ List<ProductionStatisticalDto> list = baseMapper.queryProcedure(vo);
|
|
|
// 设置响应输出的头类型
|
|
|
// 设置响应输出的头类型
|
|
|
response.setHeader("content-Type", "application/vnd.ms-excel");
|