From 7ee17a00bd47309ea1a61e28f2e44f621a01b8cd Mon Sep 17 00:00:00 2001 From: puhanshu <a9236326> Date: 星期三, 27 四月 2022 11:32:31 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/huacheng' into huacheng --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java | 14 +++++++++++++- springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbDynDAO.java | 3 +-- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java index 157995a..73325b0 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java @@ -54,7 +54,7 @@ + "left join sys_user u on a.sponsor_id=u.user_id " + "left join (select * from com_act_act_sign where `status` = 1) s on a.id=s.activity_id " + "left join com_act ca on a.community_id=ca.community_id " + " where 1=1 " + - "<if test='comActActivityVO.choice == 0 '>" + "AND a.community_id = ${comActActivityVO.communityId} " + " </if> " + "<if test='comActActivityVO.communityId != null and comActActivityVO.communityId!=0'>" + "AND a.community_id = ${comActActivityVO.communityId} " + " </if> " + "<if test='comActActivityVO.areaCode !=null '>" + "AND ca.area_code = ${comActActivityVO.areaCode} " + " </if> " + diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java index a109d65..f72e540 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java @@ -397,7 +397,19 @@ */ @Override public R pageDiscussAdmin(PageComActDiscussDTO pageComActDiscussDTO) { - return R.ok(comActDiscussDAO.pageDiscussAdmin(new Page<>(pageComActDiscussDTO.getPageNum(), pageComActDiscussDTO.getPageSize()), pageComActDiscussDTO)); + IPage<ComActDiscussVO> comActDiscussVOIPage=comActDiscussDAO.pageDiscussAdmin(new Page<>(pageComActDiscussDTO.getPageNum(), pageComActDiscussDTO.getPageSize()), pageComActDiscussDTO); + List<ComActDiscussVO> records = comActDiscussVOIPage.getRecords(); + if (!ObjectUtils.isEmpty(records)) { + records.forEach(comActDiscussVO -> { + 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))); + } + }); + } + return R.ok(); } /** diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbDynDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbDynDAO.java index 1444b93..53d53c7 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbDynDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbDynDAO.java @@ -34,9 +34,8 @@ + "d.publish_at,\n" + "d.content,\n" + "d.cover,\n" + "d.cover_mode,\n" + "d.dyn_type,\n" + "d.create_at,t.name as communityName,d.policy_type \n" + "FROM\n" + "com_pb_dyn d\n" + "LEFT JOIN com_pb_dyn_user u ON d.id = u.dyn_id left join com_act t on d.community_id = t.community_id\n" + "where d.type=#{partyBuildingComPbDynVO.type} \n" - + "<if test='partyBuildingComPbDynVO.choice == 0 '>" + "<if test='partyBuildingComPbDynVO.communityId != null and partyBuildingComPbDynVO.communityId != 0'>" - + "and d.community_id = ${partyBuildingComPbDynVO.communityId} \n" + " </if> "+" </if> " + + "and d.community_id = ${partyBuildingComPbDynVO.communityId} \n" + " </if> " + "<if test='partyBuildingComPbDynVO.dynType != null and partyBuildingComPbDynVO.dynType != 0'>" + "and d.dyn_type = #{partyBuildingComPbDynVO.dynType} \n" + " </if> " + "<if test='partyBuildingComPbDynVO.policyType != null and partyBuildingComPbDynVO.policyType != 0'>" -- Gitblit v1.7.1