|
@@ -265,8 +265,9 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
|
|
|
//根据产品类别ID获得产品id和产品名称
|
|
|
LambdaQueryWrapper<Product> productWrapper = new LambdaQueryWrapper<>();
|
|
|
productWrapper.eq(Product::getProductCategoryId, dto.getCategoryId());
|
|
|
- if(dto.getCompanyName()!=null&&dto.getCompanyName()!=""){
|
|
|
- productWrapper.eq(Product::getCompanyName,dto.getCompanyName());}
|
|
|
+ if (dto.getCompanyName() != null && dto.getCompanyName() != "") {
|
|
|
+ productWrapper.eq(Product::getCompanyName, dto.getCompanyName());
|
|
|
+ }
|
|
|
List<Product> products = productService.list(productWrapper);
|
|
|
if (products.size() != 0) {
|
|
|
List<Integer> productIds = products.stream().map(Product::getId).collect(Collectors.toList());
|
|
@@ -302,19 +303,18 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
|
|
|
ca.setTime(dateForm);
|
|
|
int month = ca.get(Calendar.MONTH);//第几个月
|
|
|
int year = ca.get(Calendar.YEAR);//年份数值
|
|
|
- int season = (month - 1) / 3+1;
|
|
|
+ int season = (month - 1) / 3 + 1;
|
|
|
date = year + "-" + season;
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }
|
|
|
- else if(dto.getTimeUnit() == 2){
|
|
|
+ } else if (dto.getTimeUnit() == 2) {
|
|
|
try {
|
|
|
Date dateForm = new SimpleDateFormat("yyyy-MM").parse(date);
|
|
|
Calendar ca = Calendar.getInstance();
|
|
|
ca.setTime(dateForm);
|
|
|
int year = ca.get(Calendar.YEAR);//年份数值
|
|
|
- date = year+"";
|
|
|
+ date = year + "";
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -326,10 +326,10 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
|
|
|
marketDataMap.put(date, saleCount);
|
|
|
|
|
|
//产品总体部分
|
|
|
- if (allMarketDataMap.get(date) != null) {
|
|
|
- saleCount += Double.parseDouble(allMarketDataMap.get(date).toString());
|
|
|
- }
|
|
|
- allMarketDataMap.put(date, saleCount);
|
|
|
+ if (allMarketDataMap.get(date) != null) {
|
|
|
+ saleCount += Double.parseDouble(allMarketDataMap.get(date).toString());
|
|
|
+ }
|
|
|
+ allMarketDataMap.put(date, saleCount);
|
|
|
}
|
|
|
);
|
|
|
Set keyset = marketDataMap.keySet();
|