| | |
| | | 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.node.TreeStringNode; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.common.utils.AuthUtils; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.mapper.DeptMapper; |
| | | import org.springblade.modules.system.node.DeptUserTreeNode; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springblade.modules.system.vo.DeptDetailVO; |
| | | import org.springblade.modules.system.vo.DeptVO; |
| | | import org.springblade.modules.system.wrapper.DeptWrapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | parentId = 0L; |
| | | } |
| | | // 判断数据权限控制,非超管角色只可看到本级及以下数据 |
| | | if (Func.toLong(parentId) == 0L && !AuthUtil.isAdministrator()) { |
| | | if (Func.toLong(parentId) == 0L && !AuthUtils.isAdministratorOrAdmin(AuthUtil.getUserRole())) { |
| | | Long deptId = Func.firstLong(AuthUtil.getDeptId()); |
| | | Dept dept = SysCache.getDept(deptId); |
| | | if (dept.getParentId() != 0) { |
| | | if (dept != null && dept.getParentId() != 0) { |
| | | parentId = dept.getParentId(); |
| | | } |
| | | List<DeptVO> deptVOS = baseMapper.lazyList(tenantId, parentId, param); |
| | |
| | | if (Func.toLong(parentId) == 0L && !AuthUtil.isAdmin()) { |
| | | Long deptId = Func.firstLong(AuthUtil.getDeptId()); |
| | | Dept dept = SysCache.getDept(deptId); |
| | | if (dept.getParentId() != 0) { |
| | | if (dept != null && dept.getParentId() != 0) { |
| | | parentId = dept.getParentId(); |
| | | } |
| | | List<DeptVO> merge = ForestNodeMerger.merge(baseMapper.lazyTree(tenantId, parentId)); |
| | |
| | | // 查询物业公司是否存在 |
| | | QueryWrapper<PropertyCompanyEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("is_deleted", 0) |
| | | .eq("dept_id", dept.getId()) |
| | | .eq("name", dept.getDeptName()); |
| | | .eq("dept_id", dept.getId()); |
| | | PropertyCompanyEntity propertyCompanyEntity = propertyCompanyService.getOne(wrapper); |
| | | if (null != propertyCompanyEntity) { |
| | | // 修改 |