| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.utils.RoleUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | @Override |
| | | public PropertyCompanyDetailVO getDetailByDeptId() { |
| | | String userRole = AuthUtil.getUserRole(); |
| | | if (userRole.contains("wygly")) { |
| | | if (RoleUtil.isProperty(userRole)) { |
| | | // 通过用户机构查询用户的物业公司 |
| | | IPropertyCompanyService bean = SpringUtil.getBean(IPropertyCompanyService.class); |
| | | PropertyCompanyEntity propertyCompanyEntity = bean.getOne(Wrappers.<PropertyCompanyEntity>lambdaQuery().eq(PropertyCompanyEntity::getDeptId, AuthUtil.getDeptId())); |
| | | PropertyCompanyEntity propertyCompanyEntity = bean.getOne(Wrappers.<PropertyCompanyEntity>lambdaQuery().eq(PropertyCompanyEntity::getDeptId, AuthUtil.getDeptId()).last("limit 1")); |
| | | if (propertyCompanyEntity != null) { |
| | | return baseMapper.getDetail(BeanUtil.copyProperties(propertyCompanyEntity, PropertyCompanyVO.class)); |
| | | return baseMapper.getDetailVO(BeanUtil.copyProperties(propertyCompanyEntity, PropertyCompanyVO.class)); |
| | | } |
| | | } |
| | | return null; |