取消关联
This commit is contained in:
parent
0794ac7569
commit
02e5684c0f
|
|
@ -124,11 +124,20 @@ public class ACouponController {
|
||||||
* @param couponId 如果syncId有值 则为syncId 否则为id
|
* @param couponId 如果syncId有值 则为syncId 否则为id
|
||||||
*/
|
*/
|
||||||
@GetMapping("/gifts")
|
@GetMapping("/gifts")
|
||||||
public CzgResult<Page<MkCouponGiftDTO>> getCouponPage(Long couponId) {
|
public CzgResult<Page<MkCouponGiftDTO>> getCouponGiftPage(Long couponId) {
|
||||||
Page<MkCouponGiftDTO> data = couponGiftService.getCouponGiftPage(couponId);
|
Page<MkCouponGiftDTO> data = couponGiftService.getCouponGiftPage(couponId);
|
||||||
return CzgResult.success(data);
|
return CzgResult.success(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过关联Id取消该券的关联
|
||||||
|
* @param id /admin/coupon/gifts的 主键Id
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/cancelGift")
|
||||||
|
public CzgResult<Void> cancelGift(Long id) {
|
||||||
|
couponGiftService.cancelGift(id);
|
||||||
|
return CzgResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
private void asyncToBranchShop(Long id, Integer type) {
|
private void asyncToBranchShop(Long id, Integer type) {
|
||||||
long shopId = StpKit.USER.getShopId(0L);
|
long shopId = StpKit.USER.getShopId(0L);
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,12 @@ public interface MkCouponGiftService extends IService<MkCouponGift> {
|
||||||
*/
|
*/
|
||||||
void upCouponGift(Long sourceId, String sourceName, Integer type, List<MkCouponGiftDTO> couponGiftList);
|
void upCouponGift(Long sourceId, String sourceName, Integer type, List<MkCouponGiftDTO> couponGiftList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过关联Id取消该关联关系
|
||||||
|
*/
|
||||||
|
void cancelGift(Long id);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除关联券
|
* 删除关联券
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import com.czg.market.dto.MkCouponGiftDTO;
|
||||||
import com.czg.market.entity.MkCouponGift;
|
import com.czg.market.entity.MkCouponGift;
|
||||||
import com.czg.market.entity.ShopCoupon;
|
import com.czg.market.entity.ShopCoupon;
|
||||||
import com.czg.market.service.MkCouponGiftService;
|
import com.czg.market.service.MkCouponGiftService;
|
||||||
import com.czg.market.service.ShopCouponService;
|
|
||||||
import com.czg.service.market.mapper.MkCouponGiftMapper;
|
import com.czg.service.market.mapper.MkCouponGiftMapper;
|
||||||
import com.czg.service.market.mapper.ShopCouponMapper;
|
import com.czg.service.market.mapper.ShopCouponMapper;
|
||||||
import com.czg.utils.PageUtil;
|
import com.czg.utils.PageUtil;
|
||||||
|
|
@ -72,6 +71,11 @@ public class MkCouponGiftServiceImpl extends ServiceImpl<MkCouponGiftMapper, MkC
|
||||||
addCouponGift(sourceId, sourceName, type, couponGiftList);
|
addCouponGift(sourceId, sourceName, type, couponGiftList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancelGift(Long id) {
|
||||||
|
removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteJoinCouponGift(Long sourceId, Integer type) {
|
public void deleteJoinCouponGift(Long sourceId, Integer type) {
|
||||||
remove(new QueryWrapper().eq(MkCouponGift::getSourceId, sourceId).eq(MkCouponGift::getType, type));
|
remove(new QueryWrapper().eq(MkCouponGift::getSourceId, sourceId).eq(MkCouponGift::getType, type));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue