| | |
| | | import java.util.stream.Collectors;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import com.ruoyi.common.core.constant.UserConstants;
|
| | | import com.ruoyi.common.core.exception.ServiceException;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils;
|
| | | import com.ruoyi.system.api.domain.SysDept;
|
| | | import com.ruoyi.system.api.domain.SysRole;
|
| | | import com.ruoyi.system.api.domain.SysUser;
|
| | | import com.ruoyi.system.domain.vo.TreeSelect;
|
| | | import com.ruoyi.system.mapper.SysDeptMapper;
|
| | | import com.ruoyi.system.mapper.SysRoleMapper;
|
| | |
| | | @Override
|
| | | public void checkDeptDataScope(Long deptId)
|
| | | {
|
| | | if (!SysUser.isAdmin(SecurityUtils.getUserId()) && StringUtils.isNotNull(deptId))
|
| | | if (!SecurityUtils.isAdmin() && StringUtils.isNotNull(deptId))
|
| | | {
|
| | | SysDept dept = new SysDept();
|
| | | dept.setDeptId(deptId);
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 保存部门排序
|
| | | *
|
| | | * @param deptIds 部门ID数组
|
| | | * @param orderNums 排序数组
|
| | | */
|
| | | @Override
|
| | | @Transactional
|
| | | public void updateDeptSort(String[] deptIds, String[] orderNums)
|
| | | {
|
| | | try
|
| | | {
|
| | | for (int i = 0; i < deptIds.length; i++)
|
| | | {
|
| | | SysDept dept = new SysDept();
|
| | | dept.setDeptId(Convert.toLong(deptIds[i]));
|
| | | dept.setOrderNum(Convert.toInt(orderNums[i]));
|
| | | deptMapper.updateDeptSort(dept);
|
| | | }
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | throw new ServiceException("保存排序异常,请联系管理员");
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除部门管理信息
|
| | | *
|
| | | * @param deptId 部门ID
|