src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.xml
@@ -75,13 +75,22 @@ <if test="noticeComment.checkUser != null ">and jac.check_user = #{noticeComment.checkUser}</if> <if test="noticeComment.checkTime != null ">and jac.check_time = #{noticeComment.checkTime}</if> <if test="noticeComment.checkStatus != null ">and jac.check_status = #{noticeComment.checkStatus}</if> <if test="noticeComment.checkRemark != null and noticeComment.checkRemark != ''">and jac.check_remark = #{noticeComment.checkRemark}</if> <if test="noticeComment.checkRemark != null and noticeComment.checkRemark != ''">and jac.check_remark = #{noticeComment.checkRemark} </if> <if test="noticeComment.createTime != null ">and jac.create_time = #{noticeComment.createTime}</if> <if test="noticeComment.isDeleted != null ">and jac.is_deleted = #{noticeComment.isDeleted}</if> <if test="noticeComment.phone != null ">and bu.phone like concat('%',#{noticeComment.phone},'%')</if> <if test="noticeComment.name != null ">and bu.name like concat('%',#{noticeComment.name},'%')</if> <if test="noticeComment.title != null ">and ja.title like concat('%',#{noticeComment.title},'%') </if> <if test="noticeComment.title != null ">and ja.title like concat('%',#{noticeComment.title},'%')</if> <if test="noticeComment.cityCode != null and noticeComment.cityCode != ''"> and ( ja.article_range like <foreach collection="noticeComment.cityCode" separator=" or ja.article_range like" item="id">'%${id}%' </foreach> ) </if> and jac.user_id is not null order by jac.create_time desc </where> src/main/java/org/springblade/modules/article/service/impl/ArticleCommentServiceImpl.java
@@ -18,12 +18,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.common.cache.SysCache; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.modules.article.entity.ArticleCommentEntity; import org.springblade.modules.article.mapper.ArticleCommentMapper; import org.springblade.modules.article.service.IArticleCommentService; import org.springblade.modules.article.vo.ArticleCommentVO; import org.springframework.stereotype.Service; import java.util.List; /** * 通知评论表 服务实现类 @@ -36,6 +39,15 @@ @Override public IPage<ArticleCommentVO> selectArticleCommentPage(IPage<ArticleCommentVO> page, ArticleCommentVO noticeComment) { String userRole = AuthUtil.getUserRole(); if (userRole.contains("jdgly")) { List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); // IDistrictService bean = SpringUtils.getBean(IDistrictService.class); // List<DistrictEntity> list = bean.list(Wrappers.<DistrictEntity>lambdaQuery() // .in(DistrictEntity::getCommunityCode, regionChildCodesList)); // List<String> fieldValues = list.stream().map(DistrictEntity::getId).collect(Collectors.toList()); noticeComment.setCityCodeList(regionChildCodesList); } return page.setRecords(baseMapper.selectArticleCommentPage(page, noticeComment)); } src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java
@@ -10,8 +10,6 @@ import org.springblade.modules.article.mapper.ArticleMapper; import org.springblade.modules.article.service.ArticleService; import org.springblade.modules.article.vo.ArticleVO; import org.springblade.modules.district.entity.DistrictEntity; import org.springblade.modules.district.service.IDistrictService; import org.springblade.modules.property.entity.PropertyCompanyDistrictEntity; import org.springblade.modules.property.service.IPropertyCompanyDistrictService; import org.springframework.stereotype.Service; @@ -48,11 +46,11 @@ } if (userRole.contains("jdgly")) { List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); IDistrictService bean = SpringUtils.getBean(IDistrictService.class); List<DistrictEntity> list = bean.list(Wrappers.<DistrictEntity>lambdaQuery() .in(DistrictEntity::getCommunityCode, regionChildCodesList)); List<String> fieldValues = list.stream().map(DistrictEntity::getId).collect(Collectors.toList()); article.setDistrictIdList(fieldValues); // IDistrictService bean = SpringUtils.getBean(IDistrictService.class); // List<DistrictEntity> list = bean.list(Wrappers.<DistrictEntity>lambdaQuery() // .in(DistrictEntity::getCommunityCode, regionChildCodesList)); // List<String> fieldValues = list.stream().map(DistrictEntity::getId).collect(Collectors.toList()); article.setDistrictIdList(regionChildCodesList); } return page.setRecords(baseMapper.selectArticlePage(page, article)); } src/main/java/org/springblade/modules/article/vo/ArticleCommentVO.java
@@ -5,6 +5,8 @@ import lombok.EqualsAndHashCode; import org.springblade.modules.article.entity.ArticleCommentEntity; import java.util.List; /** * 通知评论表 视图实体类 * @@ -28,4 +30,6 @@ @ApiModelProperty(value = "头像") private String avatar; private List<String> cityCodeList; }