| | |
| | | } |
| | | PublicDiscussVO publicDiscussVO = baseMapper.selectPublicDiscuss(publicDiscuss); |
| | | publicDiscussVO.setDisabled(false); |
| | | // 一户一票 |
| | | IUserTopicsService bean = SpringUtils.getBean(IUserTopicsService.class); |
| | | if (publicDiscussVO.getVoteRestrictions().equals(CommonConstant.NUMBER_ONE)) { |
| | | long count = bean.count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getHouseCode, publicDiscuss.getHouseCode()) |
| | | .eq(UserTopicsEntity::getArticleId, publicDiscussVO.getArticleId())); |
| | | if (count > 0) { |
| | | publicDiscussVO.setDisabled(true); |
| | | } |
| | | } else { |
| | | // 一个一票 |
| | | long count = bean.count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getHouseholdId, householdEntity.getId()) |
| | | .eq(UserTopicsEntity::getArticleId, publicDiscussVO.getArticleId())); |
| | | if (count > 0) { |
| | | publicDiscussVO.setDisabled(true); |
| | | if (householdEntity != null) { |
| | | // 一户一票 |
| | | IUserTopicsService bean = SpringUtils.getBean(IUserTopicsService.class); |
| | | if (publicDiscussVO.getVoteRestrictions().equals(CommonConstant.NUMBER_ONE)) { |
| | | long count = bean.count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getHouseCode, publicDiscuss.getHouseCode()) |
| | | .eq(UserTopicsEntity::getArticleId, publicDiscussVO.getArticleId())); |
| | | if (count > 0) { |
| | | publicDiscussVO.setDisabled(true); |
| | | } |
| | | } else { |
| | | // 一个一票 |
| | | long count = bean.count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getHouseholdId, householdEntity.getId()) |
| | | .eq(UserTopicsEntity::getArticleId, publicDiscussVO.getArticleId())); |
| | | if (count > 0) { |
| | | publicDiscussVO.setDisabled(true); |
| | | } |
| | | } |
| | | } |
| | | return publicDiscussVO; |