From 6c4db89ea8795d6be8431f698051e62bec9ec956 Mon Sep 17 00:00:00 2001 From: 罗yu 元桥 <2376770955@qq.com> Date: 星期五, 07 五月 2021 09:06:08 +0800 Subject: [PATCH] Merge branch 'test' into 'master' --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java | 40 ++++++++++++++++++++++++++++++++-------- 1 files changed, 32 insertions(+), 8 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java index f537bdf..f6dcf99 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java @@ -84,8 +84,9 @@ ComActNeighborCircleFabulousDO circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,circleAppVO.getId()) .eq(ComActNeighborCircleFabulousDO::getUserId,neighborCircleAppDTO.getUserId()) - .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.llq)); - if(circleFabulousDO != null && circleFabulousDO.getIsEffective().equals(ComActNeighborCircleFabulousDO.isEffective.yes)){ + .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.llq) + .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); + if(circleFabulousDO != null){ circleAppVO.setHaveSign(1); }else{ circleAppVO.setHaveSign(2); @@ -139,8 +140,9 @@ ComActNeighborCircleFabulousDO circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,circleDetailAppVO.getId()) .eq(ComActNeighborCircleFabulousDO::getUserId,neighborCircleAppDTO.getUserId()) - .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.llq)); - if(circleFabulousDO != null && circleFabulousDO.getIsEffective().equals(ComActNeighborCircleFabulousDO.isEffective.yes)){ + .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.llq) + .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); + if(circleFabulousDO != null){ circleDetailAppVO.setHaveSign(1); }else{ circleDetailAppVO.setHaveSign(2); @@ -155,8 +157,9 @@ ComActNeighborCircleFabulousDO circleCommentFabulousDO = comActNeighborCircleFabulousDAO.selectOne( new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,circleCommentVo.getId()) .eq(ComActNeighborCircleFabulousDO::getUserId,neighborCircleAppDTO.getUserId()) - .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.pl)); - if(circleCommentFabulousDO != null && circleCommentFabulousDO.getIsEffective().equals(ComActNeighborCircleFabulousDO.isEffective.yes)){ + .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.pl) + .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); + if(circleCommentFabulousDO != null){ circleCommentVo.setHaveSign(1); }else{ circleCommentVo.setHaveSign(2); @@ -169,8 +172,9 @@ ComActNeighborCircleFabulousDO circleReplyFabulousDO = comActNeighborCircleFabulousDAO.selectOne( new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,commentReplyVO.getId()) .eq(ComActNeighborCircleFabulousDO::getUserId,neighborCircleAppDTO.getUserId()) - .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.hf)); - if(circleReplyFabulousDO != null && circleReplyFabulousDO.getIsEffective().equals(ComActNeighborCircleFabulousDO.isEffective.yes)){ + .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.hf) + .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); + if(circleReplyFabulousDO != null){ commentReplyVO.setHaveSign(1); }else{ commentReplyVO.setHaveSign(2); @@ -592,6 +596,13 @@ if(circleFabulousDO == null){ return R.fail("未查询到点赞信息"); } + + //减少邻里圈点赞数量 + ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(fabulousAppDTO.getServiceId()); + if(neighborCircleDO != null){ + neighborCircleDO.setFabulousNum(neighborCircleDO.getFabulousNum() - 1); + this.baseMapper.updateById(neighborCircleDO); + } }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.pl)){ circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,fabulousAppDTO.getServiceId()) @@ -601,6 +612,13 @@ if(circleFabulousDO == null){ return R.fail("未查询到点赞信息"); } + + //减少邻里圈评论点赞数量 + ComActNeighborCircleCommentDO circleCommentDO = comActNeighborCircleCommentDAO.selectById(fabulousAppDTO.getServiceId()); + if(circleCommentDO != null){ + circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() - 1); + comActNeighborCircleCommentDAO.updateById(circleCommentDO); + } }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.hf)){ circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,fabulousAppDTO.getServiceId()) @@ -610,6 +628,12 @@ if(circleFabulousDO == null){ return R.fail("未查询到点赞信息"); } + //减少邻里圈评论回复点赞数量 + ComActNeighborCircleCommentReplyDO circleCommentReplyDO = comActNeighborCircleCommentReplyDAO.selectById(fabulousAppDTO.getServiceId()); + if(circleCommentReplyDO != null){ + circleCommentReplyDO.setFabulousNum(circleCommentReplyDO.getFabulousNum() - 1); + comActNeighborCircleCommentReplyDAO.updateById(circleCommentReplyDO); + } } if(circleFabulousDO != null){ circleFabulousDO.setIsEffective(ComActNeighborCircleFabulousDO.isEffective.no); -- Gitblit v1.7.1