From b2fce0dc7dc4ea5dec9792a2bc3ceb9d33d6e07b Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期一, 04 九月 2023 13:59:52 +0800 Subject: [PATCH] 修改后台社区动态加载不出来 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java index 0609753..05c92b1 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java @@ -5,6 +5,9 @@ import javax.annotation.Resource; +import com.panzhihua.common.model.vos.community.DataCount; +import com.panzhihua.service_community.dao.ComActDynTypeMapper; +import com.panzhihua.service_community.model.dos.ComActDynTypeDO; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; @@ -25,6 +28,7 @@ import com.panzhihua.service_community.service.ComActDynService; import lombok.extern.slf4j.Slf4j; +import org.springframework.util.StringUtils; import static java.util.Objects.nonNull; @@ -43,6 +47,9 @@ private ComActDynUserDAO comActDynUserDAO; @Resource private ComActDAO comActDAO; + + @Resource + private ComActDynTypeMapper comActDynTypeMapper; /** * 分页查询社区动态 @@ -64,6 +71,7 @@ } page.setSize(pageSize); page.setCurrent(pageNum); + IPage<ComActDynVO> iPage = comActDynDAO.pageDynamic(page, comActDynVO); List<ComActDynVO> records = iPage.getRecords(); if (!ObjectUtils.isEmpty(records)) { @@ -92,6 +100,9 @@ @Override public R detailDynamic(Long id) { ComActDynDO comActDynDO = this.getById(id); + + ComActDynTypeDO comActDynTypeDO=comActDynTypeMapper.selectById(comActDynDO.getType()); + if (ObjectUtils.isEmpty(comActDynDO)) { return R.fail("社区动态不存在"); } @@ -116,7 +127,12 @@ } comActDynDAO.updateById(comActDynDO); } - return R.ok(); + + if(comActDynTypeDO!=null && !StringUtils.isEmpty(comActDynTypeDO.getName())) + { + comActDynVO.setTypeName(comActDynTypeDO.getName()); + } + return R.ok(comActDynVO); } /** @@ -199,4 +215,5 @@ return R.ok(iPage); } + } -- Gitblit v1.7.1