这是删除套餐的业务需求
在售的套餐不能删除
套餐内包含在售的商品不能删除
未勾选任何套餐是不能删除
```java
@DeleteMapping
@ApiOperation("批量删除套餐")
public Result delete(@RequestParam List<Long> ids){
log.info("批量删除套餐,{}",ids);
setmealService.deleteBatch(ids);
return Result.success();
}
void deleteBatch(List ids);
```java
@Override
public void deleteBatch(List<Long> ids) {
for (Long id : ids) {
//在售套餐不能删除
Setmeal setmeal = setmealMapper.getById(id);
if (setmeal.getStatus()==StatusConstant.ENABLE){
//当前商品不能删除
throw new DeletionNotAllowedException(MessageConstant.SETMEAL_ON_SALE);
}
}
for (Long id : ids) {
setmealMapper.deleteId(id);
setmealDishMapper.delete(id);
}
}
这是代码怎么阐述业务逻辑,尽量不提代码只阐述逻辑