From 8d5fb4ee9d27fd6a61b210eaee74af265f76aa7c Mon Sep 17 00:00:00 2001 From: manailin <261030956@qq.com> Date: 星期五, 08 四月 2022 14:55:18 +0800 Subject: [PATCH] [修改]修改配置 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java | 30 ++++++++++++++++++++++++++++-- 1 files changed, 28 insertions(+), 2 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 2139a1d..8935ff6 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 @@ -6,6 +6,7 @@ import javax.annotation.Resource; +import com.panzhihua.service_community.service.ComActNeighborCircleTopicService; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -61,6 +62,8 @@ private ComActDAO comActDAO; @Resource private ComActNeighborCircleTopicMapper comActNeighborCircleTopicMapper; + @Resource + private ComActNeighborCircleTopicService comActNeighborCircleTopicService; /** * 分页查询邻里圈列表 @@ -123,6 +126,25 @@ } if (StringUtils.isNotEmpty(addNeighborCircleAppDTO.getPhone())) { neighborCircleDO.setReleasePhone(addNeighborCircleAppDTO.getPhone()); + } + //判断用户的话题是否是新增的 + if(StringUtils.isNotEmpty(addNeighborCircleAppDTO.getTopicName())){ + //新增邻里圈话题 + ComActNeighborCircleTopicDO circleTopicDO = comActNeighborCircleTopicMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicDO>() + .lambda().eq(ComActNeighborCircleTopicDO::getCommunityId,neighborCircleDO.getCommunityId()) + .eq(ComActNeighborCircleTopicDO::getName,addNeighborCircleAppDTO.getTopicName())); + if(circleTopicDO == null){ + circleTopicDO = new ComActNeighborCircleTopicDO(); + circleTopicDO.setCommunityId(neighborCircleDO.getCommunityId()); + circleTopicDO.setName(addNeighborCircleAppDTO.getTopicName()); + circleTopicDO.setCreateBy(neighborCircleDO.getReleaseId()); + circleTopicDO.setCreateAt(new Date()); + circleTopicDO.setCount(0); + circleTopicDO.setHotNum(0L); + circleTopicDO.setStatus(ComActNeighborCircleTopicDO.status.yes); + comActNeighborCircleTopicMapper.insert(circleTopicDO); + } + neighborCircleDO.setTopicId(circleTopicDO.getId()); } //判断当前邻里圈是否需要审核 if(addNeighborCircleAppDTO.getIsExamine().equals(AddComActNeighborCircleAppDTO.isExamine.no)){ @@ -253,8 +275,10 @@ Page page = new Page(neighborCircleAdminDTO.getPageNum(), neighborCircleAdminDTO.getPageSize()); IPage<ComActNeighborCircleAdminVO> doPager = this.baseMapper.pageNeighborByAdmin(page, neighborCircleAdminDTO); doPager.getRecords().forEach(data -> { - if (data.getUserType() != 1) { - data.setReleaseName(data.getCommunityName()); + if(data.getUserType()!=null){ + if (data.getUserType() != 1) { + data.setReleaseName(data.getCommunityName()); + } } }); return R.ok(doPager); @@ -641,6 +665,7 @@ DetailNeighborCircleAdminVO vo = new DetailNeighborCircleAdminVO(); BeanUtils.copyProperties(comActNeighborCircleDO, vo); vo.setReleaseName(user.getName()); + vo.setImageUrl(user.getImageUrl()); // 查询话题名称 if (comActNeighborCircleDO.getTopicId() != null) { @@ -697,6 +722,7 @@ BeanUtils.copyProperties(commentDO, vo); String name = user.getName() == null ? user.getNickName() : user.getName(); vo.setUserName(name); + vo.setUserPhone(user.getPhone()); return R.ok(vo); } -- Gitblit v1.7.1