| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.UserDto; |
| | | import com.yuanchu.mom.pojo.Department; |
| | | import com.yuanchu.mom.pojo.DepartmentLims; |
| | | import com.yuanchu.mom.service.DepartmentLimsService; |
| | | import com.yuanchu.mom.service.DepartmentService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 部门明细 前端控制器 |
| | | * 组织架构明细 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 江苏鵷雏网络科技有限公司 |
| | |
| | | @RequestMapping("/department") |
| | | public class DepartmentController { |
| | | |
| | | DepartmentService departmentService; |
| | | @ValueClassify("人员明细") |
| | | @ApiOperation(value = "添加部门") |
| | | private DepartmentService departmentService; |
| | | |
| | | private DepartmentLimsService departmentLimsService; |
| | | |
| | | @ValueClassify("用户管理") |
| | | @ApiOperation(value = "添加组织架构") |
| | | @PostMapping("/addDepartment") |
| | | public Result addDepartment(@RequestBody Department department) { |
| | | return Result.success(departmentService.addDepartment(department)); |
| | | } |
| | | @ApiOperation(value = "获取部门树") |
| | | @ApiOperation(value = "获取组织架构树") |
| | | @GetMapping("/selectDepartment") |
| | | @ValueClassify("人员明细") |
| | | @ValueClassify("用户管理") |
| | | public Result selectDepartment() { |
| | | return Result.success(departmentService.selectDepartment()); |
| | | } |
| | | @ValueClassify("人员明细") |
| | | @ApiOperation(value = "删除部门") |
| | | @ValueClassify("用户管理") |
| | | @ApiOperation(value = "删除组织架构") |
| | | @PostMapping("/delDepartment") |
| | | public Result delDepartment(Integer id) { |
| | | return Result.success(departmentService.delDepartment(id)); |
| | | } |
| | | @ValueAuth |
| | | @ApiOperation(value = "根据选择的树展示相关的人员") |
| | | @PostMapping("/showUserById") |
| | | public Result showUserById(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | UserDto user = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), UserDto.class); |
| | | return Result.success(departmentService.showUserById(page, user)); |
| | | |
| | | @ValueClassify("人员明细") |
| | | @ApiOperation(value = "获取组织架构树") |
| | | @GetMapping("/selectDepartmentLim") |
| | | public Result selectDepartmentLim() { |
| | | return Result.success(departmentLimsService.selectDepartment()); |
| | | } |
| | | |
| | | @ValueClassify("人员明细") |
| | | @ApiOperation(value = "添加组织架构") |
| | | @PostMapping("/addDepartmentLims") |
| | | public Result addDepartmentLims(@RequestBody DepartmentLims department) { |
| | | return Result.success(departmentLimsService.addDepartment(department)); |
| | | } |
| | | |
| | | @ValueClassify("人员明细") |
| | | @ApiOperation(value = "删除组织架构") |
| | | @PostMapping("/delDepartmentLims") |
| | | public Result delDepartmentLims(Integer id) { |
| | | return Result.success(departmentLimsService.delDepartment(id)); |
| | | } |
| | | } |