| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.RoleUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | import org.springblade.modules.district.service.IDistrictService; |
| | | import org.springblade.modules.ownersCommittee.entity.OwnersCommitteeEntity; |
| | | import org.springblade.modules.ownersCommittee.service.IOwnersCommitteeService; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | import org.springblade.modules.property.entity.PropertyCapitalApplyEntity; |
| | | import org.springblade.modules.property.entity.PropertyCompanyDistrictEntity; |
| | | import org.springblade.modules.property.entity.PropertyCompanyEntity; |
| | |
| | | |
| | | @Override |
| | | public IPage<PropertyCapitalApplyVO> selectPropertyCapitalApplyPage(IPage<PropertyCapitalApplyVO> page, PropertyCapitalApplyVO propertyCapitalApply) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(PropertyCapitalApplyVO.class, propertyCapitalApply); |
| | | // 判断角色,物业角色只能查询当前小区的 |
| | | String userRole = AuthUtil.getUserRole(); |
| | | 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())); |
| | | PropertyCompanyEntity one = bean.getOne(Wrappers.<PropertyCompanyEntity>lambdaQuery().eq(PropertyCompanyEntity::getDeptId, AuthUtil.getDeptId()).last("limit 1")); |
| | | if (one != null) { |
| | | IPropertyCompanyDistrictService bean2 = SpringUtils.getBean(IPropertyCompanyDistrictService.class); |
| | | // 通过物业公司,查询小区 |
| | |
| | | return page.setRecords(new ArrayList<>()); |
| | | } |
| | | } |
| | | return page.setRecords(baseMapper.selectPropertyCapitalApplyPage(page, propertyCapitalApply, regionChildCodesList, isAdministrator)); |
| | | return page.setRecords(baseMapper.selectPropertyCapitalApplyPage(page, propertyCapitalApply, |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator())); |
| | | } |
| | | |
| | | @Autowired |