|
@@ -3,9 +3,12 @@ package cn.cslg.pas.service.impl;
|
|
import cn.cslg.pas.common.JsonPage;
|
|
import cn.cslg.pas.common.JsonPage;
|
|
import cn.cslg.pas.common.model.PersonnelVO;
|
|
import cn.cslg.pas.common.model.PersonnelVO;
|
|
import cn.cslg.pas.common.model.dto.ProductMarketDataAddNewDTO;
|
|
import cn.cslg.pas.common.model.dto.ProductMarketDataAddNewDTO;
|
|
|
|
+import cn.cslg.pas.common.model.dto.ProductMarketDataDTO;
|
|
import cn.cslg.pas.common.model.dto.ProductMarketDataQueryPageDTO;
|
|
import cn.cslg.pas.common.model.dto.ProductMarketDataQueryPageDTO;
|
|
import cn.cslg.pas.common.model.dto.ProductMarketDataUpdateDTO;
|
|
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.ProductMarketDataVO;
|
|
|
|
+import cn.cslg.pas.common.model.vo.ProductVO;
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.pas.domain.Product;
|
|
import cn.cslg.pas.domain.Product;
|
|
@@ -37,6 +40,7 @@ import java.util.regex.Pattern;
|
|
@Service
|
|
@Service
|
|
public class ProductMarketDataServiceImpl extends ServiceImpl<ProductMarketDataMapper, ProductMarketData> implements IProductMarketDataService {
|
|
public class ProductMarketDataServiceImpl extends ServiceImpl<ProductMarketDataMapper, ProductMarketData> implements IProductMarketDataService {
|
|
private final ProductMarketDataMapper productMarketDataMapper;
|
|
private final ProductMarketDataMapper productMarketDataMapper;
|
|
|
|
+ private final ProductMapper productMapper;
|
|
private final CacheUtils cacheUtils;
|
|
private final CacheUtils cacheUtils;
|
|
private final LoginUtils loginUtils;
|
|
private final LoginUtils loginUtils;
|
|
|
|
|
|
@@ -184,4 +188,36 @@ public class ProductMarketDataServiceImpl extends ServiceImpl<ProductMarketDataM
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 根据productId查询productName
|
|
|
|
+ * @param productId
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public String queryNameByProductId(Integer productId){
|
|
|
|
+ int id = productId;
|
|
|
|
+ String ProductName = productMapper.queryNameById(id);
|
|
|
|
+ return ProductName;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询产品趋势图
|
|
|
|
+ *
|
|
|
|
+ * @param dto
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<ProductMarketDataTrendVO> showTrend(ProductMarketDataDTO dto) {
|
|
|
|
+ if(dto.getTimeUnit() == 2){//按照年份返回营销数据
|
|
|
|
+ List<ProductMarketDataTrendVO> list= productMarketDataMapper.queryByYear(dto.getProductId(), dto.getSaleArea());
|
|
|
|
+ return list;
|
|
|
|
+ }else if(dto.getTimeUnit() == 1 ){//按照季度返回营销数据
|
|
|
|
+ List<ProductMarketDataTrendVO> list= productMarketDataMapper.queryBySeason(dto.getProductId(), dto.getSaleArea());
|
|
|
|
+ return list;
|
|
|
|
+ }else if(dto.getTimeUnit() == null||dto.getTimeUnit() == 0 ){//按照月份返回营销数据
|
|
|
|
+ List<ProductMarketDataTrendVO> list= productMarketDataMapper.queryByMonth(dto.getProductId(), dto.getSaleArea());
|
|
|
|
+ return list;
|
|
|
|
+ }else{
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|