|
|
@@ -85,16 +85,18 @@ public class CategoryProdServiceImpl extends ServiceImpl<CategoryProdMapper, Cat
|
|
|
|
|
|
for (Long aLong : prodIdList) {
|
|
|
|
|
|
- CategoryProd categoryProd = categoryPropMapper.selectOne(new LambdaQueryWrapper<CategoryProd>().eq(CategoryProd::getProdId, aLong)
|
|
|
+ List<CategoryProd> categoryProdList = categoryPropMapper.selectList(new LambdaQueryWrapper<CategoryProd>().eq(CategoryProd::getProdId, aLong)
|
|
|
.eq(CategoryProd::getIsDelete, 0)
|
|
|
.eq(CategoryProd::getShopId, categoryProductDTO.getShopId())
|
|
|
.eq(CategoryProd::getCode, categoryProductDTO.getCode()));
|
|
|
|
|
|
- if (ObjectUtils.isEmpty(categoryProd)) {
|
|
|
+ if (ObjectUtils.isEmpty(categoryProdList)) {
|
|
|
new GlobalException("该门店分类对应商品ID=" + aLong + " 不存在!请勿重复取消");
|
|
|
}
|
|
|
- categoryProd.setIsDelete(1);
|
|
|
- categoryPropMapper.deleteById(categoryProd);
|
|
|
+ for (CategoryProd categoryProd : categoryProdList) {
|
|
|
+ categoryProd.setIsDelete(1);
|
|
|
+ categoryPropMapper.deleteById(categoryProd);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|