| | |
| | | import com.example.common.Result; |
| | | import com.example.entity.Department; |
| | | import com.example.security.UserContext; |
| | | import com.example.service.DataExcelService; |
| | | import com.example.service.DepartmentService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private DepartmentService departmentService; |
| | | |
| | | @Autowired |
| | | private DataExcelService dataExcelService; |
| | | |
| | | @GetMapping("/list") |
| | | public Result<List<Department>> list() { |
| | | String currentDeptCode = UserContext.getCurrentDeptCode(); |
| | |
| | | |
| | | @GetMapping("/tree") |
| | | public Result<List<Department>> tree() { |
| | | String currentDeptCode = UserContext.getCurrentDeptCode(); |
| | | return Result.success(departmentService.getDepartmentTreeWithPermission(currentDeptCode)); |
| | | return Result.success(dataExcelService.getDepartmentTree()); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |