Преглед на файлове

Merge remote-tracking branch 'origin/dev' into dev

chendayu преди 2 години
родител
ревизия
cb0d2969e2

+ 6 - 1
PAS/src/main/java/cn/cslg/pas/service/IProductMarketDataService.java

@@ -47,15 +47,20 @@ public interface IProductMarketDataService {
 
     /**
      * 查询产品营销数据趋势图
+     *
      * @param dto
+     * @return 返回查询的数据
      */
     @Transactional
     List<ProductMarketDataTrendVO> showTrend(ProductMarketDataDTO dto);
 
     /**
      * 根据productId查询productName
-     * @param productId
+     *
+     * @param productId 产品id
+     * @return productName
      */
     String queryNameByProductId(Integer productId);
 
+
 }

+ 7 - 9
PAS/src/main/java/cn/cslg/pas/service/impl/ProductCategoryServiceImpl.java

@@ -9,7 +9,6 @@ import cn.cslg.pas.common.utils.FileUtils;
 import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
 import cn.cslg.pas.domain.Product;
 import cn.cslg.pas.domain.ProductCategory;
-import cn.cslg.pas.domain.ProductMarketData;
 import cn.cslg.pas.domain.asso.AssoProductCategoryPicture;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.ProductCategoryMapper;
@@ -25,10 +24,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * 产品类别的Service层接口实现类
@@ -42,12 +38,10 @@ import java.util.stream.Collectors;
 public class ProductCategoryServiceImpl implements IProductCategoryService {
     private final ProductCategoryMapper productCategoryMapper;
     private final AssoProductCategoryPictureMapper assoProductCategoryPictureMapper;
-    private final ProductMapper productMapper;
     private final CacheUtils cacheUtils;
     private final LoginUtils loginUtils;
     private final FileUtils fileUtils;
     private final ProductServiceImpl productService;
-    private final ProductMarketDataServiceImpl productMarketDataIService;
 
     /**
      * 新增产品类别
@@ -258,7 +252,7 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
 
     }
 
-    //返回总的营销数据
+    //返回总的营销数据以及每个的营销数据
     @Override
     public List<ProductCategoryTrendVO> showTrend(ProductCategoryDTO dto) {
         //判断架构id是否有内容,没有的话直接返回null
@@ -271,6 +265,7 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
         List<ProductMarketDataTrendVO> saleVOS = new ArrayList<>();
         //存储所有
         ProductCategoryTrendVO totalTrendVO = new ProductCategoryTrendVO();
+        //返回总的营销数据 将id设为0
         totalTrendVO.setProductId(0);
         totalTrendVO.setProductName("总产品");
         //查询架构id返回的总体营销数据
@@ -282,14 +277,17 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
         } else if (dto.getTimeUnit() == null || dto.getTimeUnit() == 0) {//按照月份返回营销数据
             totalSaleVOS = productCategoryMapper.categoryQueryByMonth(dto.getCategoryId(), dto.getCategoryArea(), dto.getCompanyName());
         }
+        //把总的营销数据赋值、存入
         totalTrendVO.setSaleVOS(totalSaleVOS);
         trendVOS.add(totalTrendVO);
-        //根据传入的架构id、公司名称以及营销地区查询产品id
+        //根据传入的类别id、公司名称以及营销地区查询产品id
         List<ProductIdAndNameVO> idNameVOS = new ArrayList<>();
         idNameVOS = productCategoryMapper.queryProductIdAndNameByCategoryId(dto.getCategoryId(), dto.getCompanyName());
         //返回根据架构id查询到的每个产品id的营销数据
-        for (ProductIdAndNameVO idNameVO : idNameVOS) {
+        //遍历
+        for (ProductIdAndNameVO idNameVO : idNameVOS) {//遍历类取得id和名称
             ProductCategoryTrendVO trendVO = new ProductCategoryTrendVO();
+            //遍历赋值id和name
             trendVO.setProductId(idNameVO.getProductId());
             trendVO.setProductName(idNameVO.getProductName());
             List<ProductMarketDataTrendVO> temSaleVOS = new ArrayList<>();

+ 5 - 2
PAS/src/main/java/cn/cslg/pas/service/impl/ProductMarketDataServiceImpl.java

@@ -8,10 +8,8 @@ import cn.cslg.pas.common.model.dto.ProductMarketDataQueryPageDTO;
 import cn.cslg.pas.common.model.dto.ProductMarketDataUpdateDTO;
 import cn.cslg.pas.common.model.vo.ProductMarketDataTrendVO;
 import cn.cslg.pas.common.model.vo.ProductMarketDataVO;
-import cn.cslg.pas.common.model.vo.ProductVO;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
-import cn.cslg.pas.domain.Product;
 import cn.cslg.pas.domain.ProductMarketData;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.ProductMapper;
@@ -22,9 +20,11 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
+
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -220,4 +220,7 @@ public class ProductMarketDataServiceImpl extends ServiceImpl<ProductMarketDataM
             return null;
         }
     }
+
+
+
 }