| | |
| | | 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("您的已投票,不能重复投票!"); |
| | | } |