linwei
2024-02-22 947c4e68b6ce3b64db967a689227315924dd181e
src/main/java/org/springblade/modules/discuss/service/impl/UserTopicsServiceImpl.java
@@ -83,13 +83,17 @@
      PublicDiscussEntity one = bean.getOne(Wrappers.<PublicDiscussEntity>lambdaQuery().eq(PublicDiscussEntity::getArticleId, topics.get(0).getArticleId()));
      // 一户一票
      if (one.getVoteRestrictions().equals(CommonConstant.NUMBER_ONE)) {
         long count = count(Wrappers.<UserTopicsEntity>lambdaQuery().eq(UserTopicsEntity::getHouseCode, topics.get(0).getHouseCode()));
         long count = count(Wrappers.<UserTopicsEntity>lambdaQuery()
            .eq(UserTopicsEntity::getHouseCode, topics.get(0).getHouseCode())
            .eq(UserTopicsEntity::getArticleId,topics.get(0).getArticleId()));
         if (count > 1) {
            throw new Exception("您的房屋已投票,不能重复投票!");
         }
      } else {
         //
         long count = count(Wrappers.<UserTopicsEntity>lambdaQuery().eq(UserTopicsEntity::getUserId, AuthUtil.getUserId()));
         long count = count(Wrappers.<UserTopicsEntity>lambdaQuery()
            .eq(UserTopicsEntity::getUserId, AuthUtil.getUserId())
            .eq(UserTopicsEntity::getArticleId,topics.get(0).getArticleId()));
         if (count > 1) {
            throw new Exception("您的已投票,不能重复投票!");
         }