diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/impl/YxStoreHotListServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/impl/YxStoreHotListServiceImpl.java index 9271c5dd..63eb3bb8 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/impl/YxStoreHotListServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/impl/YxStoreHotListServiceImpl.java @@ -164,6 +164,9 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl list=yxStoreHotListRecordMapper.selectList(wrapper); + if(list.isEmpty()){ + return null; + } //获取月份 LinkedHashSet mouthList=new LinkedHashSet<>(); list.forEach(yxStoreHotListRecord -> mouthList.add(yxStoreHotListRecord.getMouth())); @@ -253,6 +256,9 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl list=yxStoreHotListRecordMapper.selectList(wrapper); + if(list.isEmpty()){ + return null; + } //获取月份 LinkedHashSet mouthList=new LinkedHashSet<>(); list.forEach(yxStoreHotListRecord -> mouthList.add(yxStoreHotListRecord.getMouth())); diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java index af3786ac..52b8ddfe 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java @@ -141,15 +141,15 @@ public class StoreProductController { //不能删除 throw new YshopException("当前商品已绑定评测,不能被删除"); } - Long count1 = yxStoreHotListMapper - .selectCount(Wrappers.lambdaQuery() - .eq(YxStoreHotList::getIsShow,1)); +// Long count1 = yxStoreHotListMapper +// .selectCount(Wrappers.lambdaQuery() +// .eq(YxStoreHotList::getIsShow,1)); // .like(YxStoreHotList::getProductList,id)); //此商品被热门榜单绑定,不能删除 - if(count1 > 0) { - //不能删除 - throw new YshopException("当前商品已绑定热门榜单,不能被删除"); - } +// if(count1 > 0) { +// //不能删除 +// throw new YshopException("当前商品已绑定热门榜单,不能被删除"); +// } yxStoreProductService.removeById(id); return new ResponseEntity(HttpStatus.OK); } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java index 8148ca62..8bbdd35c 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java @@ -587,14 +587,14 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl 0) { throw new YshopException("当前商品已绑定评测,不能被下架"); } - Long count1 = yxStoreHotListMapper - .selectCount(Wrappers.lambdaQuery() - .eq(YxStoreHotList::getIsShow,1)); -// .like(YxStoreHotList::getProductList,id)); - //此商品被热门榜单绑定,不能下架 - if(count1 > 0) { - throw new YshopException("当前商品已绑定热门榜单,不能被下架"); - } +// Long count1 = yxStoreHotListMapper +// .selectCount(Wrappers.lambdaQuery() +// .eq(YxStoreHotList::getIsShow,1)); +//// .like(YxStoreHotList::getProductList,id)); +// //此商品被热门榜单绑定,不能下架 +// if(count1 > 0) { +// throw new YshopException("当前商品已绑定热门榜单,不能被下架"); +// } status = ShopCommonEnum.SHOW_0.getValue(); } else { status = ShopCommonEnum.SHOW_1.getValue();