| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.utils.RoleUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | |
| | | // List<String> collect = list.stream().map(PropertyCompanyDistrictEntity::getDistrictId).collect(Collectors.toList()); |
| | | // article.setDistrictIdList(collect); |
| | | // } |
| | | if (userRole.contains("wygly") || userRole.contains("wyxmjl")) { |
| | | if (RoleUtil.isProperty(userRole)) { |
| | | // 查询小区id |
| | | IPropertyDistrictUserService propertyDistrictUserService = SpringUtils.getBean(IPropertyDistrictUserService.class); |
| | | List<String> districtIds = propertyDistrictUserService.selectPropertyDistrictByUserId(AuthUtil.getUserId()); |
| | | // 通过用户机构查询用户的物业公司 |
| | | IPropertyCompanyService bean = SpringUtil.getBean(IPropertyCompanyService.class); |
| | | PropertyCompanyEntity one = bean.getOne(Wrappers.<PropertyCompanyEntity>lambdaQuery().eq(PropertyCompanyEntity::getDeptId, AuthUtil.getDeptId())); |
| | | if (one != null) { |
| | | PropertyCompanyEntity companyEntity = bean.getOne(Wrappers.<PropertyCompanyEntity>lambdaQuery().eq(PropertyCompanyEntity::getDeptId, AuthUtil.getDeptId())); |
| | | if (companyEntity != null) { |
| | | IPropertyCompanyDistrictService bean2 = SpringUtils.getBean(IPropertyCompanyDistrictService.class); |
| | | // 通过物业公司,查询小区 |
| | | List<PropertyCompanyDistrictEntity> list = bean2.list(Wrappers.<PropertyCompanyDistrictEntity>lambdaQuery() |
| | | .eq(PropertyCompanyDistrictEntity::getPropertyCompanyId, one.getId())); |
| | | if (list.size() > 0) { |
| | | List<String> collect = list.stream().map(i -> i.getDistrictId()).collect(Collectors.toList()); |
| | | List<PropertyCompanyDistrictEntity> propertyCompanyDistrictEntityList = bean2.list(Wrappers.<PropertyCompanyDistrictEntity>lambdaQuery() |
| | | .eq(PropertyCompanyDistrictEntity::getPropertyCompanyId, companyEntity.getId())); |
| | | if (propertyCompanyDistrictEntityList.size() > 0) { |
| | | List<String> collect = propertyCompanyDistrictEntityList.stream().map(i -> i.getDistrictId()).collect(Collectors.toList()); |
| | | districtIds.addAll(collect); |
| | | } |
| | | } |
| | |
| | | if (districtIds.size() == 0) { |
| | | return page.setRecords(new ArrayList<>()); |
| | | } |
| | | article.setPropertyFlag(1); |
| | | } |
| | | if (userRole.contains("jdgly")) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | |
| | | // 查询用户小区的id |
| | | String districId = baseMapper.getDistrictId(article.getHouseCode()); |
| | | article.setDistrictId(districId); |
| | | article.setUserId(AuthUtil.getUserId()); |
| | | List<ArticleVO> articleVOS = baseMapper.selectArticlePageByApp(page, article); |
| | | return page.setRecords(articleVOS); |
| | | } |
| | |
| | | ArticleVO articleVO = baseMapper.getArticleOne(article); |
| | | return articleVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<ArticleVO> getArticleByDistrictId(ArticleVO article) { |
| | | List<String> objects = new ArrayList<>(); |
| | | objects.add(article.getDistrictId()); |
| | | article.setDistrictIdList(objects); |
| | | return baseMapper.getArticleByDistrictId(article); |
| | | } |
| | | } |