fix:领取优惠券bug

This commit is contained in:
dzc committed 2025-10-31 17:14:54 +08:00
1 parent e3b523b41c
commit 84b7874237
2 files changed
+2 -9

No files matched your search

@@ -57,6 +57,7 @@ public class ActCancelItemController {
@Idempotent(expireTime = 2, key = "'/act/cancel/app/get/' + #dto.getReceiverUserId()", info = "正在领取中,请勿重复操作")
public R<Long> appGet(@RequestBody ActCancelItemDto dto) {
if (ObjectUtil.isEmpty(dto.getActId())) throw new RuntimeException("活动id不能为空");
if (ObjectUtil.isEmpty(dto.getMchId())) throw new RuntimeException("商户id不能为空");
PjcloudUser user = SecurityUtils.getUser();
return R.ok(actCancelItemService.appGet(user, dto));
}
@@ -127,15 +127,7 @@ public class ActCancelItemServiceImpl extends ServiceImpl<ActCancelItemMapper, A
ActCancelEntity act = actCancelMapper.selectById(dto.getActId());
if (ObjectUtil.isEmpty(act)) throw new RuntimeException("核销活动不存在");
// 获取商户
MchManageEntity actMch = null;
try {
Long mchId = ParamResolver.getLong("ACT_CANCEL_MCH_ID");
if (ObjectUtil.isEmpty(mchId)) throw new Exception("活动商户id为空");
actMch = mchManageService.getById(mchId);
} catch (Exception e) {
e.printStackTrace();
log.error("|{}|获取商户ID失败,error:|{}|", TAG, e.getMessage());
}
MchManageEntity actMch = mchManageService.getById(dto.getMchId());
if (ObjectUtil.isEmpty(actMch)) throw new RuntimeException("核销活动商户不存在");
// 判断是否已经领取