|
@@ -4,6 +4,7 @@ import com.caimei.www.mapper.ProductDao;
|
|
|
import com.caimei.www.pojo.page.ProductDetail;
|
|
|
import com.caimei.www.service.page.ProductService;
|
|
|
import com.caimei.www.utils.ImageUtil;
|
|
|
+import com.caimei.www.utils.PriceUtil;
|
|
|
import io.netty.util.internal.StringUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -41,17 +42,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
}
|
|
|
product.setImage(ImageUtil.getImageURL("product", product.getImage(), 0, domain));
|
|
|
// 价格等级
|
|
|
- if (product.getPrice() > 50 * 5000) {
|
|
|
- product.setPriceGrade(5);
|
|
|
- } else if (product.getPrice() > 25 * 5000) {
|
|
|
- product.setPriceGrade(4);
|
|
|
- } else if (product.getPrice() > 10 * 5000) {
|
|
|
- product.setPriceGrade(3);
|
|
|
- } else if (product.getPrice() > 2.5 * 5000) {
|
|
|
- product.setPriceGrade(2);
|
|
|
- } else {
|
|
|
- product.setPriceGrade(1);
|
|
|
- }
|
|
|
+ product.setPriceGrade(PriceUtil.getpriceGrade(product.getPrice()));
|
|
|
}
|
|
|
return product;
|
|
|
}
|