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

Commit 1b0bc5d4 authored by zhengfuxin's avatar zhengfuxin

修改bug

parent 539e80a5
......@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangfuxin
......@@ -99,6 +100,23 @@ public class GoblinFrontController {
return ResponseDto.success( goblinFrontService.getCategory(categoryId));
}
@GetMapping("getStore")
@ApiOperation("获得店铺详情")
public ResponseDto<GoblinStoreInfoVo> getStore(@RequestParam(name = "storeId", required = true)String storeId) throws ParseException {
return ResponseDto.success( goblinFrontService.getStore(storeId));
}
@GetMapping("getStoreCategory")
@ApiOperation("获得店铺分类")
public ResponseDto<List<GoblinStoreGoodsCategoryVo>> getStoreCategory(@RequestParam(name = "storeId", required = true)String storeId) throws ParseException {
return ResponseDto.success( goblinFrontService.getStoreCategory(storeId));
}
@GetMapping("getStoreGoodes")
@ApiOperation("获得店铺分类")
public ResponseDto<List<GoblinStoreGoodsCategoryVo>> getStoreGoodes(@RequestParam(name = "storeId", required = true)String storeId) throws ParseException {
return ResponseDto.success( goblinFrontService.getStoreCategory(storeId));
}
......
......@@ -45,6 +45,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
@Override
public ArrayList<GoblinFrontBannerVo> getListBanner() {
if(!redisUtil.hasKey(GoblinRedisConst.FRONT_TOP_BANNER)){
return null;
}
List<GoblinFrontBanner> list= (List<GoblinFrontBanner>) redisUtil.get(GoblinRedisConst.FRONT_TOP_BANNER);
LocalDateTime nowTime= LocalDateTime.now();
ArrayList<GoblinFrontBanner> goblinFrontBannerArrayList= ObjectUtil.getGoblinFrontBannerArrayList();
......@@ -66,6 +69,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return list1;
}
public ArrayList<GoblinFrontBannerVo> getMiddleBanner() {
if(!redisUtil.hasKey(GoblinRedisConst.FRONT_MIDDLE_BANNER)){
return null;
}
List<GoblinFrontBanner> list= (List<GoblinFrontBanner>) redisUtil.get(GoblinRedisConst.FRONT_MIDDLE_BANNER);
LocalDateTime nowTime= LocalDateTime.now();
ArrayList<GoblinFrontBanner> goblinFrontBannerArrayList= ObjectUtil.getGoblinFrontBannerArrayList();
......@@ -89,6 +95,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
@Override
public GoblinFrontHotWord getHotWord() {
if(!redisUtil.hasKey(GoblinRedisConst.FRONT_HOTWORD)){
return null;
}
// int index= (int) redisUtil.get(GoblinRedisConst.FRONT_HOTWORD_INDEX);
//获得value
List<GoblinFrontHotWord> list= (List<GoblinFrontHotWord>) redisUtil.get(GoblinRedisConst.FRONT_HOTWORD);
......@@ -109,6 +118,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
@Override
public GoblinFrontNavigationVoo getNavigation() {
if(!redisUtil.hasKey(GoblinRedisConst.FRONT_NAVIGATION)){
return null;
}
GoblinFrontNavigationVoo goblinFrontNavigationVoo=GoblinFrontNavigationVoo.getNew();
List<GoblinFrontNavigation> list = (List<GoblinFrontNavigation>) redisUtil.get(GoblinRedisConst.FRONT_NAVIGATION);
ArrayList<GoblinFrontNavigationVo> list1=ObjectUtil.getgoblinFrontNavigationVoArrayList();
......@@ -257,6 +269,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
* 获得商品详情
*/
public List getMoudleIndex(){
if(!redisUtil.hasKey(GoblinRedisConst.MOUDLE_INDEX)){
return null;
}
//GoblinGoodsInfoVo goblinGoodsInfoVo=goblinRedisUtils.get(spuId);
List<GoblinFrontMoudleIndex> list= (List<GoblinFrontMoudleIndex>) redisUtil.get(GoblinRedisConst.MOUDLE_INDEX);
return list;
......@@ -269,6 +284,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
public GoblinFrontCubeVo getCube(){
GoblinFrontCubeVo goblinFrontCubeVo=GoblinFrontCubeVo.getNew();
ArrayList<GoblinGoodsInfoVo> goblinGoodsInfoVoArrayList= ObjectUtil.getGoblinGoodsInfoVos();
if(!redisUtil.hasKey(GoblinRedisConst.FRONT_GOBLINFRONTCUBE)){
return null;
}
List<GoblinFrontCube> list= (List<GoblinFrontCube>) redisUtil.get(GoblinRedisConst.FRONT_GOBLINFRONTCUBE);
if(list.size()>0){
BeanUtils.copyProperties(list.get(0),goblinFrontCubeVo);
......@@ -285,7 +303,19 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
return goblinFrontCubeVo;
}
public GoblinStoreInfoVo getStore(String storId){
return goblinRedisUtils.getStoreInfoVo(storId);
}
/***
* @author zhangfuxin
* @Description:获得商铺分类
* @date 2022/1/18 下午1:44
*/
public List<GoblinStoreGoodsCategoryVo> getStoreCategory(String storId){
//店铺分类数据源
List<GoblinStoreGoodsCategoryVo> list=goblinRedisUtils.getStoreGoodsCategoryVos(storId);
return list;
}
/**
* 找到分类
*/
......@@ -315,6 +345,36 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return goblinCategoryzfVo;
}
public List<GoblinGoodsInfoVo> getStoreGoodes(String storeId,String categoryId){
//
Query query = new Query();
query.addCriteria(Criteria.where("storeId").is(storeId));
if(StringUtil.isNotBlank(categoryId)){
query.addCriteria(new Criteria().orOperator(
Criteria.where("cateFid").is(categoryId),
Criteria.where("cateSid").is(categoryId),
Criteria.where("cateTid").is(categoryId)
));
}
// 查询总数
List<GoblinGoodsInfoVo> list = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
if(list.size()>0){
//找到 销量
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()));
}});
}
return list;
}
/**
*音乐人列表
......@@ -428,6 +488,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
*/
@Override
public GoblinFrontSelectGoodVo getSelectGoods(int page, int pageSize) {
if(!redisUtil.hasKey(GoblinRedisConst.SELECT_GOODS)){
return null;
}
//redis 取出精选商品列表
List<GoblinFrontSelectGoods> list= (List<GoblinFrontSelectGoods>) redisUtil.get(GoblinRedisConst.SELECT_GOODS);
if(null!=list&&list.size()==1){
......
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