This commit is contained in:
2025-09-13 15:35:20 +08:00
parent db50c78049
commit 77ac277856
7 changed files with 463 additions and 12 deletions

View File

@@ -4,9 +4,10 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil;
import com.czg.log.annotation.OperationLog;
import com.czg.market.dto.MkCouponGiftDTO;
import com.czg.market.dto.MkShopCouponRecordDTO;
import com.czg.market.dto.ShopCouponDTO;
import com.czg.market.service.MkCouponGiftService;
import com.czg.market.service.MkShopConsumerCouponService;
import com.czg.market.service.MkShopCouponRecordService;
import com.czg.market.service.ShopCouponService;
import com.czg.product.service.ShopSyncService;
import com.czg.resp.CzgResult;
@@ -39,7 +40,7 @@ public class ACouponController {
@Resource
private MkCouponGiftService couponGiftService;
@Resource
private MkShopConsumerCouponService consumerCouponService;
private MkShopCouponRecordService couponRecordService;
@DubboReference
private ShopSyncService shopSyncService;
@@ -135,16 +136,26 @@ public class ACouponController {
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();
// }
/**
* 优惠券列表/已领取详情
* @param search 用户Id/昵称/手机号
* @param param 用户的优惠券列表 使用该对象的UserId
*/
@GetMapping("/record")
public CzgResult<Page<MkShopCouponRecordDTO>> getRecord(@RequestParam(required = false) String search, MkShopCouponRecordDTO param) {
Page<MkShopCouponRecordDTO> data = couponRecordService.getRecord(search, param);
return CzgResult.success(data);
}
/**
* 删除用户优惠券
* @param id 优惠券记录Id
*/
@DeleteMapping("/deleteRecord")
public CzgResult<Void> cancelRecord(Long id) {
couponRecordService.deleteRecord(id);
return CzgResult.success();
}
private void asyncToBranchShop(Long id, Integer type) {
long shopId = StpKit.USER.getShopId(0L);