fix:领取优惠券bug
This commit is contained in:
1 parent
e3b523b41c
commit
84b7874237
2 files changed
+2
-9
No files matched your search
+1
@@ -57,6 +57,7 @@ public class ActCancelItemController {
|
|||||||
@Idempotent(expireTime = 2, key = "'/act/cancel/app/get/' + #dto.getReceiverUserId()", info = "正在领取中,请勿重复操作")
|
@Idempotent(expireTime = 2, key = "'/act/cancel/app/get/' + #dto.getReceiverUserId()", info = "正在领取中,请勿重复操作")
|
||||||
public R<Long> appGet(@RequestBody ActCancelItemDto dto) {
|
public R<Long> appGet(@RequestBody ActCancelItemDto dto) {
|
||||||
if (ObjectUtil.isEmpty(dto.getActId())) throw new RuntimeException("活动id不能为空");
|
if (ObjectUtil.isEmpty(dto.getActId())) throw new RuntimeException("活动id不能为空");
|
||||||
|
if (ObjectUtil.isEmpty(dto.getMchId())) throw new RuntimeException("商户id不能为空");
|
||||||
PjcloudUser user = SecurityUtils.getUser();
|
PjcloudUser user = SecurityUtils.getUser();
|
||||||
return R.ok(actCancelItemService.appGet(user, dto));
|
return R.ok(actCancelItemService.appGet(user, dto));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-9
@@ -127,15 +127,7 @@ public class ActCancelItemServiceImpl extends ServiceImpl<ActCancelItemMapper, A
|
|||||||
ActCancelEntity act = actCancelMapper.selectById(dto.getActId());
|
ActCancelEntity act = actCancelMapper.selectById(dto.getActId());
|
||||||
if (ObjectUtil.isEmpty(act)) throw new RuntimeException("核销活动不存在");
|
if (ObjectUtil.isEmpty(act)) throw new RuntimeException("核销活动不存在");
|
||||||
// 获取商户
|
// 获取商户
|
||||||
MchManageEntity actMch = null;
|
MchManageEntity actMch = mchManageService.getById(dto.getMchId());
|
||||||
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());
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isEmpty(actMch)) throw new RuntimeException("核销活动商户不存在");
|
if (ObjectUtil.isEmpty(actMch)) throw new RuntimeException("核销活动商户不存在");
|
||||||
|
|
||||||
// 判断是否已经领取
|
// 判断是否已经领取
|
||||||
|
|||||||
Reference in new issue
Block a user