| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.system.pojo.vo.SysDeptPageVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | |
| | | return deptMapper.deleteDeptById(deptId); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 递归列表 |
| | | */ |
| | |
| | | { |
| | | return getChildList(list, t).size() > 0; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public IPage<SysDeptPageVO> page(IPage<SysDeptPageVO> iPage, String name) { |
| | | return deptMapper.page(iPage,name); |
| | | } |
| | | |
| | | @Override |
| | | public void add(String name) { |
| | | SysDept sysDept=deptMapper.selectDeptByName(name); |
| | | if (sysDept != null){ |
| | | throw new ServiceException("该部门已存在"); |
| | | } |
| | | sysDept=new SysDept(); |
| | | sysDept.setDeptName(name); |
| | | deptMapper.insertDept(sysDept); |
| | | } |
| | | |
| | | @Override |
| | | public void updateDeptName(SysDept sysDept) { |
| | | deptMapper.updateDeptName(sysDept); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysDeptPageVO> getDeptList() { |
| | | return deptMapper.getDeptList(); |
| | | } |
| | | } |