|
|
@@ -4,7 +4,9 @@ import lombok.Data;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.ThreadLocalRandom;
|
|
|
|
|
|
/**
|
|
|
* 用户端分类下的商品项:商品ID、名称、售价、原价、销量、产品标签列表
|
|
|
@@ -13,6 +15,8 @@ import java.util.List;
|
|
|
public class FsStoreUserEndCategoryProductVO implements Serializable {
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
+ private static final double min = 95.0;
|
|
|
+ private static final double max = 99.9;
|
|
|
|
|
|
private Long productId;
|
|
|
private String productName;
|
|
|
@@ -22,8 +26,14 @@ public class FsStoreUserEndCategoryProductVO implements Serializable {
|
|
|
private BigDecimal price;
|
|
|
/** 原价 */
|
|
|
private BigDecimal otPrice;
|
|
|
+ /** 好评率 */
|
|
|
+ private BigDecimal positiveRating;
|
|
|
/** 销量 */
|
|
|
private Long sales;
|
|
|
/** 产品标签名称列表 */
|
|
|
private List<String> tagList;
|
|
|
+ public void setPositiveRating() {
|
|
|
+ double rating = ThreadLocalRandom.current().nextDouble(min, max);
|
|
|
+ this.positiveRating = new BigDecimal(rating).setScale(1, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
}
|