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

Commit d93e5d60 authored by zhengfuxin's avatar zhengfuxin

修改魔方

parent 760c081a
...@@ -2,10 +2,7 @@ package com.liquidnet.service.goblin.controller; ...@@ -2,10 +2,7 @@ package com.liquidnet.service.goblin.controller;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinFrontBannerVo; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.dto.vo.GoblinFrontGoodDetailVo;
import com.liquidnet.service.goblin.dto.vo.GoblinFrontSeckillVo;
import com.liquidnet.service.goblin.dto.vo.GoblinFrontSelectGoodVo;
import com.liquidnet.service.goblin.entity.GoblinFrontHotWord; import com.liquidnet.service.goblin.entity.GoblinFrontHotWord;
import com.liquidnet.service.goblin.entity.GoblinFrontNavigation; import com.liquidnet.service.goblin.entity.GoblinFrontNavigation;
import com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl; import com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl;
...@@ -83,7 +80,7 @@ public class GoblinFrontController { ...@@ -83,7 +80,7 @@ public class GoblinFrontController {
} }
@GetMapping("getCube") @GetMapping("getCube")
@ApiOperation("获取魔方") @ApiOperation("获取魔方")
public ResponseDto getCube() throws ParseException { public ResponseDto<GoblinFrontCubeVo> getCube() throws ParseException {
return ResponseDto.success( goblinFrontService.getCube()); return ResponseDto.success( goblinFrontService.getCube());
} }
@GetMapping("getCategory") @GetMapping("getCategory")
......
...@@ -306,6 +306,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -306,6 +306,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
} }
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){ 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>() { Collections.sort(list, new Comparator<GoblinGoodsInfoVo>() {
public int compare(GoblinGoodsInfoVo arg0, GoblinGoodsInfoVo arg1) { public int compare(GoblinGoodsInfoVo arg0, GoblinGoodsInfoVo arg1) {
return -(arg0.getCount().compareTo(arg1.getCount())); return -(arg0.getCount().compareTo(arg1.getCount()));
......
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