Merge branch 'ww' into test

This commit is contained in:
wangw 2024-10-26 11:25:03 +08:00
commit d805b3d729
3 changed files with 8 additions and 6 deletions

View File

@ -70,8 +70,8 @@ public class TbShopCouponController {
@DeleteMapping
@ApiOperation("删除")
public ResponseEntity<Object> delete(@RequestParam("id") Integer id) {
tbShopCouponService.delete(id);
public ResponseEntity<Object> delete(@RequestBody Integer[] ids) {
tbShopCouponService.delete(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -26,7 +26,7 @@ public interface TbShopCouponService extends IService<TbShopCoupon> {
TbShopCoupon findById (Integer id);
boolean update(TbShopCouponVo param);
boolean delete(Integer id);
boolean delete(Integer[] ids);
ResponseEntity<Object> find(CouponDto param);

View File

@ -133,9 +133,11 @@ public class TbShopCouponServiceImpl extends ServiceImpl<TbShopCouponMapper, TbS
}
@Override
public boolean delete(Integer id) {
tbShopCouponmapper.deleteById(id);
public boolean delete(Integer[] ids) {
tbShopCouponmapper.deleteBatchIds(Arrays.asList(ids));
for (Integer id : ids) {
couProductService.remove(new LambdaQueryWrapper<TbCouponProduct>().eq(TbCouponProduct::getCouponId, id));
}
return true;
}