101captain
2022-08-09 d345374efced70c4ccff1c1bbcb49f7b8c4b9fd4
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -10,6 +10,7 @@
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.PageVO;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.SensitiveUtil;
import com.panzhihua.service_community.entity.ComPbCheckUnit;
import com.panzhihua.service_community.service.ComActNeighborCircleTopicService;
import org.apache.commons.lang3.ObjectUtils;
@@ -36,6 +37,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestParam;
/**
 * @auther lyq
@@ -242,7 +244,7 @@
        if(circleDetailAppVO.getOrderType()!=null){
            if(circleDetailAppVO.getOrderType()==2){
                AdministratorsUserVO user1 = this.baseMapper.selectUserByUserId(circleDetailAppVO.getSolveId());
                circleDetailAppVO.setSolveName(user1.getName());
                circleDetailAppVO.setSolveName(SensitiveUtil.replaceName(user1.getName()));
            }
            if(circleDetailAppVO.getOrderType()==1){
                ComPbCheckUnit comPbCheckUnit=comPbCheckUnitDao.selectById(circleDetailAppVO.getSolveUnitId());
@@ -267,7 +269,12 @@
                circleDetailAppVO.setHaveSign(2);
            }
        }
        ComActActivityDO comActActivityDO=comActActivityDAO.selectOne(new QueryWrapper<ComActActivityDO>().lambda().eq(ComActActivityDO::getRelationId,neighborCircleAppDTO.getCircleId()));
        if(comActActivityDO!=null){
            circleDetailAppVO.setActivityDate(comActActivityDO.getCreateAt());
            circleDetailAppVO.setActivityId(comActActivityDO.getId());
            circleDetailAppVO.setActivityName(comActActivityDO.getActivityName());
        }
        // 查询邻里圈下评论列表
        IPage<ComActNeighborCircleCommentAppVO> circleCommentAppPage =
            comActNeighborCircleCommentDAO.pageNeighborCommentByApp(
@@ -478,6 +485,7 @@
            ComActNeighborCircleCommentDO circleCommentDO =
                comActNeighborCircleCommentDAO.selectById(fabulousAppDTO.getServiceId());
            if (circleCommentDO != null) {
                circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() + 1);
                comActNeighborCircleCommentDAO.updateById(circleCommentDO);
                //计算需要增加的热度值
@@ -1189,6 +1197,48 @@
        return null;
    }
    @Override
    public R selectCount(Integer type, String phone,Long communityId) {
        return R.ok(this.baseMapper.selectCount(type,phone,communityId));
    }
    /**
     * 分页查询可关联清单列表
     * @param neighborCircleAppDTO
     * @return
     */
    @Override
    public R pageRelationList(ComActNeighborCircleAppDTO neighborCircleAppDTO) {
        Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize());
        IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageRelationList(userPage, neighborCircleAppDTO);
        if (!doPager.getRecords().isEmpty()) {
            for (ComActNeighborCircleAppVO circleAppVO : doPager.getRecords()) {
                if (neighborCircleAppDTO.getUserId() != null) {
                    // 查询点赞信息
                    ComActNeighborCircleFabulousDO circleFabulousDO =
                            comActNeighborCircleFabulousDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousDO>()
                                    .lambda().eq(ComActNeighborCircleFabulousDO::getParentId, circleAppVO.getId())
                                    .eq(ComActNeighborCircleFabulousDO::getUserId, neighborCircleAppDTO.getUserId())
                                    .eq(ComActNeighborCircleFabulousDO::getType, ComActNeighborCircleFabulousDO.type.llq)
                                    .eq(ComActNeighborCircleFabulousDO::getIsEffective,
                                            ComActNeighborCircleFabulousDO.isEffective.yes));
                    if (circleFabulousDO != null) {
                        circleAppVO.setHaveSign(1);
                    } else {
                        circleAppVO.setHaveSign(2);
                    }
                }
                if (circleAppVO.getType() != null && circleAppVO.getType().equals(ComActNeighborCircleDO.type.admin)) {
                    ComActDO actDO = comActDAO.selectById(circleAppVO.getCommunityId());
                    if (actDO != null) {
                        circleAppVO.setName(actDO.getName());
                    }
                }
            }
        }
        return R.ok(doPager);
    }
    /**
     * 判断活动统计列表中是否已有该单位的数据
     * */