Explorar o código

加限购时判断collectionId并且最大加10

xiongzhu %!s(int64=3) %!d(string=hai) anos
pai
achega
e660f0217a
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      src/main/java/com/izouma/nineth/service/UserService.java

+ 3 - 2
src/main/java/com/izouma/nineth/service/UserService.java

@@ -1167,6 +1167,7 @@ public class UserService {
     }
     }
 
 
     public void savePoint(User user) {
     public void savePoint(User user) {
+        if (8573130L != user.getCollectionId()) return;
         //给积分
         //给积分
         Long invitor = user.getCollectionInvitor();
         Long invitor = user.getCollectionInvitor();
         if (ObjectUtils.isEmpty(user.getCollectionId()) || ObjectUtils.isEmpty(invitor)) {
         if (ObjectUtils.isEmpty(user.getCollectionId()) || ObjectUtils.isEmpty(invitor)) {
@@ -1215,13 +1216,13 @@ public class UserService {
         if (userProperty.getMaxCount() < 10) {
         if (userProperty.getMaxCount() < 10) {
             if (parent.getVipPurchase() > 0 || parent.getCreatedAt().isAfter(LocalDateTime.of(2022, 7, 5, 0, 0, 0))) {
             if (parent.getVipPurchase() > 0 || parent.getCreatedAt().isAfter(LocalDateTime.of(2022, 7, 5, 0, 0, 0))) {
                 if (userProperty.getMaxCount() != point + 1) {
                 if (userProperty.getMaxCount() != point + 1) {
-                    userProperty.setMaxCount(point + 1);
+                    userProperty.setMaxCount(Math.min(point + 1, 10));
                     userPropertyRepo.save(userProperty);
                     userPropertyRepo.save(userProperty);
                     log.info("邀请绑卡限购+1,{}", invitor);
                     log.info("邀请绑卡限购+1,{}", invitor);
                     return;
                     return;
                 }
                 }
             }
             }
-            userProperty.setMaxCount(point);
+            userProperty.setMaxCount(Math.min(point, 10));
             userPropertyRepo.save(userProperty);
             userPropertyRepo.save(userProperty);
             log.info("邀请绑卡限购+1,{}", invitor);
             log.info("邀请绑卡限购+1,{}", invitor);
         }
         }