From abd14557a25a61ecd7005e799458b03a2cdb7a11 Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Mon, 9 Sep 2024 14:52:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hfkj/service/discount/impl/BsDiscountUserServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/src/main/java/com/hfkj/service/discount/impl/BsDiscountUserServiceImpl.java b/service/src/main/java/com/hfkj/service/discount/impl/BsDiscountUserServiceImpl.java index 44752f4..09fd7c0 100644 --- a/service/src/main/java/com/hfkj/service/discount/impl/BsDiscountUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/discount/impl/BsDiscountUserServiceImpl.java @@ -331,6 +331,9 @@ public class BsDiscountUserServiceImpl implements BsDiscountUserService { if (!giveUser.getId().equals(discountUser.getUserId())) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券无法赠送"); } + if (giveUser.getPhone().equals(phone)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "不可以赠送给自己"); + } // 查询接收人 BsUser user = userService.getUser(phone); if (user == null) {