记得上下班打卡 | git大法好,push需谨慎

Commit 264a33e0 authored by zhengfuxin's avatar zhengfuxin

修改vo

parent 903a4eb9
...@@ -21,7 +21,7 @@ public class GoblinFrontCategoryListVo implements Serializable,Cloneable { ...@@ -21,7 +21,7 @@ public class GoblinFrontCategoryListVo implements Serializable,Cloneable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "spu信息") @ApiModelProperty(value = "spu信息")
private List<GoblinGoodsInfoVo> spuList; private List<GoblinGoodsInfoListVo> spuList;
@ApiModelProperty(value = "数据条数") @ApiModelProperty(value = "数据条数")
private long count; private long count;
......
package com.liquidnet.service.goblin.dto.vo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ApiModel(value = "GoblinGoodsInfoListVo", description = "商品SPU List")
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class GoblinGoodsInfoListVo implements Serializable, Cloneable {
private static final long serialVersionUID = -4712015317981742851L;
@ApiModelProperty(position = 11, value = "商品ID[64]")
private String spuId;
@ApiModelProperty(position = 20, value = "封面图片地址[256]")
private String coverPic;
@ApiModelProperty(position = 13, value = "商品名称[100]")
private String name;
@ApiModelProperty(position = 16, value = "价格区间MIN[20,2]")
private BigDecimal priceGe;
@ApiModelProperty(position = 15, value = "销售价-原价[20,2]")
private BigDecimal sellPrice;
@ApiModelProperty(position = 52, value = "商品标签列表")
private List<GoblinGoodsTagVo> tagVoList;
private static final GoblinGoodsInfoListVo obj = new GoblinGoodsInfoListVo();
public static GoblinGoodsInfoListVo getNew() {
try {
return (GoblinGoodsInfoListVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinGoodsInfoListVo();
}
}
/* public int compareTo(GoblinGoodsInfoVo arg0) {
return this.getCount().compareTo(arg0.getCount());
}*/
}
...@@ -289,7 +289,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -289,7 +289,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return goblinFrontGoodDetailVo; return goblinFrontGoodDetailVo;
} }
/** /**
* 获得商品详情 * 获取组件排序
*/ */
public List getMoudleIndex(){ public List getMoudleIndex(){
if(!redisUtil.hasKey(GoblinRedisConst.MOUDLE_INDEX)){ if(!redisUtil.hasKey(GoblinRedisConst.MOUDLE_INDEX)){
...@@ -472,8 +472,14 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -472,8 +472,14 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return -(arg0.getCount().compareTo(arg1.getCount())); return -(arg0.getCount().compareTo(arg1.getCount()));
}}); }});
}*/ }*/
ArrayList<GoblinGoodsInfoListVo> listVos=ObjectUtil.getGoblinGoodsInfoListVo();
for(GoblinGoodsInfoVo goblinGoodsInfoVo:list){
GoblinGoodsInfoListVo goblinGoodsInfoListVo= GoblinGoodsInfoListVo.getNew();
BeanUtils.copyProperties(goblinGoodsInfoVo,goblinGoodsInfoListVo);
listVos.add(goblinGoodsInfoListVo);
}
GoblinFrontCategoryListVo goblinFrontCategoryListVo=GoblinFrontCategoryListVo.getNew(); GoblinFrontCategoryListVo goblinFrontCategoryListVo=GoblinFrontCategoryListVo.getNew();
goblinFrontCategoryListVo.setSpuList(list); goblinFrontCategoryListVo.setSpuList(listVos);
return goblinFrontCategoryListVo; return goblinFrontCategoryListVo;
} }
...@@ -520,9 +526,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -520,9 +526,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return -(arg0.getCount().compareTo(arg1.getCount())); return -(arg0.getCount().compareTo(arg1.getCount()));
}}); }});
}*/ }*/
ArrayList<GoblinGoodsInfoListVo> listVos=ObjectUtil.getGoblinGoodsInfoListVo();
for(GoblinGoodsInfoVo goblinGoodsInfoVo:list){
GoblinGoodsInfoListVo goblinGoodsInfoListVo= GoblinGoodsInfoListVo.getNew();
BeanUtils.copyProperties(goblinGoodsInfoVo,goblinGoodsInfoListVo);
listVos.add(goblinGoodsInfoListVo);
}
GoblinFrontCategoryListVo goblinFrontCategoryListVo=GoblinFrontCategoryListVo.getNew(); GoblinFrontCategoryListVo goblinFrontCategoryListVo=GoblinFrontCategoryListVo.getNew();
goblinFrontCategoryListVo.setCount(count); goblinFrontCategoryListVo.setCount(count);
goblinFrontCategoryListVo.setSpuList(list); goblinFrontCategoryListVo.setSpuList(listVos);
return goblinFrontCategoryListVo; return goblinFrontCategoryListVo;
} }
...@@ -556,24 +568,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -556,24 +568,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
long count = mongoTemplate.count(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()); long count = mongoTemplate.count(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
query.with(pageable); query.with(pageable);
List<GoblinGoodsInfoVo> list = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()); List<GoblinGoodsInfoVo> list = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
/* if(list.size()>0&&isRe){
//找到 销量
for(GoblinGoodsInfoVo goblinGoodsInfoVo:list){
Integer counts=goblinRedisUtils.getSpuSaleCount(goblinGoodsInfoVo.getSpuId());
if(counts==null){
goblinGoodsInfoVo.setCount(0);
}else{
goblinGoodsInfoVo.setCount(counts);
}
}
Collections.sort(list, new Comparator<GoblinGoodsInfoVo>() {
public int compare(GoblinGoodsInfoVo arg0, GoblinGoodsInfoVo arg1) {
return -(arg0.getCount().compareTo(arg1.getCount()));
}});
}*/
GoblinFrontCategoryListVo goblinFrontCategoryListVo=GoblinFrontCategoryListVo.getNew(); GoblinFrontCategoryListVo goblinFrontCategoryListVo=GoblinFrontCategoryListVo.getNew();
goblinFrontCategoryListVo.setCount(count); goblinFrontCategoryListVo.setCount(count);
goblinFrontCategoryListVo.setSpuList(list); ArrayList<GoblinGoodsInfoListVo> listVos=ObjectUtil.getGoblinGoodsInfoListVo();
for(GoblinGoodsInfoVo goblinGoodsInfoVo:list){
GoblinGoodsInfoListVo goblinGoodsInfoListVo= GoblinGoodsInfoListVo.getNew();
BeanUtils.copyProperties(goblinGoodsInfoVo,goblinGoodsInfoListVo);
listVos.add(goblinGoodsInfoListVo);
}
goblinFrontCategoryListVo.setSpuList(listVos);
return goblinFrontCategoryListVo; return goblinFrontCategoryListVo;
} }
......
...@@ -60,7 +60,9 @@ public class ObjectUtil { ...@@ -60,7 +60,9 @@ public class ObjectUtil {
private static final ArrayList<GoblinBackOrderVo> goblinBackOrderVoArrayList = new ArrayList<>(); private static final ArrayList<GoblinBackOrderVo> goblinBackOrderVoArrayList = new ArrayList<>();
private static final ArrayList<GoblinFrontNavigationVo> goblinFrontNavigationVoArrayList = new ArrayList<>(); private static final ArrayList<GoblinFrontNavigationVo> goblinFrontNavigationVoArrayList = new ArrayList<>();
private static final ArrayList<GoblinGoodsSkuInfoDetailVo> goblinGoodsSkuInfoDetailVos = new ArrayList<>(); private static final ArrayList<GoblinGoodsSkuInfoDetailVo> goblinGoodsSkuInfoDetailVos = new ArrayList<>();
private static final ArrayList<GoblinGoodsInfoListVo> goblinGoodsInfoListVo = new ArrayList<>();
private static final ArrayList<String> stringList = new ArrayList<>(); private static final ArrayList<String> stringList = new ArrayList<>();
private static final BasicDBObject basicDBObject = new BasicDBObject(); private static final BasicDBObject basicDBObject = new BasicDBObject();
private static final ArrayList<WriteModel<Document>> writeModelDocumentArrayList = new ArrayList<>(); private static final ArrayList<WriteModel<Document>> writeModelDocumentArrayList = new ArrayList<>();
...@@ -74,6 +76,9 @@ public class ObjectUtil { ...@@ -74,6 +76,9 @@ public class ObjectUtil {
public static ArrayList<String> getStringList() { public static ArrayList<String> getStringList() {
return (ArrayList<String>) stringList.clone(); return (ArrayList<String>) stringList.clone();
} }
public static ArrayList<GoblinGoodsInfoListVo> getGoblinGoodsInfoListVo() {
return (ArrayList<GoblinGoodsInfoListVo>) goblinGoodsInfoListVo.clone();
}
public static ArrayList<GoblinGoodsSkuInfoDetailVo> goblinGoodsSkuInfoDetailVos() { public static ArrayList<GoblinGoodsSkuInfoDetailVo> goblinGoodsSkuInfoDetailVos() {
return (ArrayList<GoblinGoodsSkuInfoDetailVo>) goblinGoodsSkuInfoDetailVos.clone(); return (ArrayList<GoblinGoodsSkuInfoDetailVo>) goblinGoodsSkuInfoDetailVos.clone();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment