xiongzhu 4 years ago
parent
commit
b8a3833183
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/main/java/com/izouma/nineth/service/GiftOrderService.java

+ 3 - 0
src/main/java/com/izouma/nineth/service/GiftOrderService.java

@@ -67,6 +67,9 @@ public class GiftOrderService {
         if (!asset.getUserId().equals(userId)) {
         if (!asset.getUserId().equals(userId)) {
             throw new BusinessException("无权限");
             throw new BusinessException("无权限");
         }
         }
+        if (!toUserId.equals(userId)) {
+            throw new BusinessException("不能送给自己");
+        }
         if (!(asset.getStatus() == AssetStatus.NORMAL)) {
         if (!(asset.getStatus() == AssetStatus.NORMAL)) {
             throw new BusinessException("当前状态不可转赠");
             throw new BusinessException("当前状态不可转赠");
         }
         }