|
|
@@ -1,11 +1,7 @@
|
|
|
package com.poyee.service.impl;
|
|
|
|
|
|
import com.poyee.config.ExchangeRateConfig;
|
|
|
-import com.poyee.dto.ProductCalendarDetailDto;
|
|
|
-import com.poyee.dto.ProductCalendarDto;
|
|
|
-import com.poyee.dto.ProductCalendarGroupedDto;
|
|
|
-import com.poyee.dto.ProductCalendarPriceDto;
|
|
|
-import com.poyee.dto.ProductSimpleDto;
|
|
|
+import com.poyee.dto.*;
|
|
|
import com.poyee.entity.ProductCalendar;
|
|
|
import com.poyee.entity.ProductCalendarPrice;
|
|
|
import com.poyee.mapper.ProductCalendarMapper;
|
|
|
@@ -63,6 +59,26 @@ public class ProductCalendarServiceImpl implements ProductCalendarService {
|
|
|
productCalendarPriceDto.setMinSuggestedPrice(minSuggestedPrice.getSuggestedPrice());
|
|
|
productCalendarPriceDto.setMinCurrencyType(minSuggestedPrice.getCurrencyUnit());
|
|
|
}
|
|
|
+ //查询相似产品
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("year",productCalendar.getYear());
|
|
|
+ params.put("sets",productCalendar.getSets());
|
|
|
+ params.put("sport", productCalendar.getSport());
|
|
|
+ params.put("id", productCalendar.getId());
|
|
|
+ List<ProductSimpleDto> productSimpleDtos =productCalendarMapper.getSimilarProductCalendarsByConditions(params);
|
|
|
+ productCalendarDetailDto.setSimilarProducts(productSimpleDtos);
|
|
|
+ // 截取 productName 中与 year 相同的内容
|
|
|
+ String productName = productCalendar.getProductName();
|
|
|
+ String year = productCalendar.getYear();
|
|
|
+ if (productName != null && year != null && productName.startsWith(year)) {
|
|
|
+ productName = productName.substring(year.length()).trim();
|
|
|
+ }
|
|
|
+ Map<String, Object> params2 = new HashMap<>();
|
|
|
+ params2.put("productName",productName);
|
|
|
+ params2.put("id",productCalendar.getId());
|
|
|
+ //查询历年产品年份
|
|
|
+ List<ProductOtherYearDto> years = productCalendarMapper.getProductCalendarsYears(params2);
|
|
|
+ productCalendarDetailDto.setYears(years);
|
|
|
return productCalendarDetailDto;
|
|
|
}
|
|
|
|