1
huanghongfa
2021-09-18 55b91c9938a8eaa4a96910f6fce633c7bcdaa85f
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java
@@ -600,6 +600,11 @@
            records.forEach(comActDiscussVO -> {
                Integer type = comActDiscussVO.getType();
                Long id = comActDiscussVO.getId();
                String viewNumKey = String.join("_", DISCUSS_VIEW_NUM_PREFIX, id.toString());
                if (stringRedisTemplate.hasKey(viewNumKey)) {
                    ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue();
                    comActDiscussVO.setViewsNum(Integer.parseInt(opsForValue.get(viewNumKey)));
                }
                if (type.equals(2)) {
                    List<ComActDiscussOptionDO> comActDiscussOptionDOS = comActDiscussOptionDAO.selectList(
                            new QueryWrapper<ComActDiscussOptionDO>().lambda().eq(ComActDiscussOptionDO::getDiscussId, id));
@@ -889,7 +894,12 @@
            comActDiscussVO.setHaveSign(comActDiscussVO1.getHaveSign());
            comActDiscussVO.setHaveVote(comActDiscussVO1.getHaveVote());
        }
        String viewNumKey = String.join("_", DISCUSS_VIEW_NUM_PREFIX, id.toString());
        if (stringRedisTemplate.hasKey(viewNumKey)) {
            ValueOperations opsForValue = stringRedisTemplate.opsForValue();
            int viewNum = Integer.parseInt((String) opsForValue.get(viewNumKey));
            comActDiscussVO.setViewsNum(viewNum);
        }
        return R.ok(comActDiscussVO);
    }
@@ -1123,7 +1133,9 @@
    @Override
    public R discussJurisdictionGet(Long communityId, Long userId) {
        List<SysConfDO> confDOList = sysConfDao.selectList(new LambdaQueryWrapper<SysConfDO>()
                .eq(SysConfDO::getCommunityId, communityId).orderByDesc(SysConfDO::getCreateAt));
                .eq(SysConfDO::getCommunityId, communityId)
                .eq(SysConfDO::getCode,Constants.DISCUSS_IDENTITY_KEY + communityId)
                .orderByDesc(SysConfDO::getCreateAt));
        if (confDOList == null || confDOList.size() == 0) {
            SysConfDO sysConfDO = new SysConfDO();
            sysConfDO.setCode(Constants.DISCUSS_IDENTITY_KEY + communityId);