优惠券 删除
This commit is contained in:
parent
84a2007b26
commit
065772c2c3
|
|
@ -70,8 +70,8 @@ public class TbShopCouponController {
|
||||||
|
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
@ApiOperation("删除")
|
@ApiOperation("删除")
|
||||||
public ResponseEntity<Object> delete(@RequestParam("id") Integer id) {
|
public ResponseEntity<Object> delete(@RequestBody Integer[] ids) {
|
||||||
tbShopCouponService.delete(id);
|
tbShopCouponService.delete(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public interface TbShopCouponService extends IService<TbShopCoupon> {
|
||||||
TbShopCoupon findById (Integer id);
|
TbShopCoupon findById (Integer id);
|
||||||
|
|
||||||
boolean update(TbShopCouponVo param);
|
boolean update(TbShopCouponVo param);
|
||||||
boolean delete(Integer id);
|
boolean delete(Integer[] ids);
|
||||||
|
|
||||||
ResponseEntity<Object> find(CouponDto param);
|
ResponseEntity<Object> find(CouponDto param);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,11 @@ public class TbShopCouponServiceImpl extends ServiceImpl<TbShopCouponMapper, TbS
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean delete(Integer id) {
|
public boolean delete(Integer[] ids) {
|
||||||
tbShopCouponmapper.deleteById(id);
|
tbShopCouponmapper.deleteBatchIds(Arrays.asList(ids));
|
||||||
couProductService.remove(new LambdaQueryWrapper<TbCouponProduct>().eq(TbCouponProduct::getCouponId, id));
|
for (Integer id : ids) {
|
||||||
|
couProductService.remove(new LambdaQueryWrapper<TbCouponProduct>().eq(TbCouponProduct::getCouponId, id));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue