diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 4becada3..e17804a9 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -3553,7 +3553,8 @@ public class AccountServiceImpl extends ServiceImpl impl // 只有当前子账号数量为0时允许批量上传 QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(Account::getSystemUser, 8) - .eq(Account::getOrganizationId, parent.getOrganizationId()); + .eq(Account::getOrganizationId, parent.getOrganizationId()) + .eq(Account::getSubscriptionPlanId, parent.getSubscriptionPlanId()); List accounts = accountMapper.selectList(qw); if (!accounts.isEmpty()) { throw new BusinessException("permit.bulk.creation", ResultEnum.PROMPT.getCode()); diff --git a/src/main/java/com/ai/da/service/impl/SubscriptionPlanServiceImpl.java b/src/main/java/com/ai/da/service/impl/SubscriptionPlanServiceImpl.java index 892a75a7..8b00a551 100644 --- a/src/main/java/com/ai/da/service/impl/SubscriptionPlanServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/SubscriptionPlanServiceImpl.java @@ -37,10 +37,14 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Objects; +import static com.ai.da.mapper.primary.entity.SubscriptionPlan.SubscriptionStatus.ACTIVE; +import static com.ai.da.mapper.primary.entity.SubscriptionPlan.SubscriptionStatus.PENDING; + @Slf4j @Service @RequiredArgsConstructor @@ -62,7 +66,7 @@ public class SubscriptionPlanServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("is_deleted", 0) // 未删除 + queryWrapper.eq("is_deleted", 0) // 未删除 + .in("status", Arrays.asList(PENDING.name(), ACTIVE.name())) // 还未被激活的,或者设置为激活状态但是未被实际激活的 .between("current_period_start", todayStart, todayEnd) // 今天开始生效 .orderByAsc("current_period_start"); // 按开始时间排序 @@ -487,7 +499,7 @@ public class SubscriptionPlanServiceImpl extends ServiceImpl