修复榜单绑定商品删除问题
This commit is contained in:
+6
@@ -164,6 +164,9 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl<YxStoreHotListMap
|
||||
wrapper.eq(YxStoreHotListRecord::getIsDel, CommonEnum.DEL_STATUS_0.getValue());
|
||||
//获取所有评测列表(后期限制一年?)
|
||||
List<YxStoreHotListRecord> list=yxStoreHotListRecordMapper.selectList(wrapper);
|
||||
if(list.isEmpty()){
|
||||
return null;
|
||||
}
|
||||
//获取月份
|
||||
LinkedHashSet<String> mouthList=new LinkedHashSet<>();
|
||||
list.forEach(yxStoreHotListRecord -> mouthList.add(yxStoreHotListRecord.getMouth()));
|
||||
@@ -253,6 +256,9 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl<YxStoreHotListMap
|
||||
wrapper.eq(YxStoreHotListRecord::getIsDel, CommonEnum.DEL_STATUS_0.getValue());
|
||||
//获取所有评测列表(后期限制一年?)
|
||||
List<YxStoreHotListRecord> list=yxStoreHotListRecordMapper.selectList(wrapper);
|
||||
if(list.isEmpty()){
|
||||
return null;
|
||||
}
|
||||
//获取月份
|
||||
LinkedHashSet<String> mouthList=new LinkedHashSet<>();
|
||||
list.forEach(yxStoreHotListRecord -> mouthList.add(yxStoreHotListRecord.getMouth()));
|
||||
|
||||
@@ -141,15 +141,15 @@ public class StoreProductController {
|
||||
//不能删除
|
||||
throw new YshopException("当前商品已绑定评测,不能被删除");
|
||||
}
|
||||
Long count1 = yxStoreHotListMapper
|
||||
.selectCount(Wrappers.<YxStoreHotList>lambdaQuery()
|
||||
.eq(YxStoreHotList::getIsShow,1));
|
||||
// Long count1 = yxStoreHotListMapper
|
||||
// .selectCount(Wrappers.<YxStoreHotList>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);
|
||||
}
|
||||
|
||||
+8
-8
@@ -587,14 +587,14 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
||||
if(count > 0) {
|
||||
throw new YshopException("当前商品已绑定评测,不能被下架");
|
||||
}
|
||||
Long count1 = yxStoreHotListMapper
|
||||
.selectCount(Wrappers.<YxStoreHotList>lambdaQuery()
|
||||
.eq(YxStoreHotList::getIsShow,1));
|
||||
// .like(YxStoreHotList::getProductList,id));
|
||||
//此商品被热门榜单绑定,不能下架
|
||||
if(count1 > 0) {
|
||||
throw new YshopException("当前商品已绑定热门榜单,不能被下架");
|
||||
}
|
||||
// Long count1 = yxStoreHotListMapper
|
||||
// .selectCount(Wrappers.<YxStoreHotList>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();
|
||||
|
||||
Reference in New Issue
Block a user