| | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Organizational; |
| | | import com.yuanchu.limslaboratory.service.OrganizationalService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | return Result.success(organizationalTree); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据点击Id查询部门") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "部门ID", name = "departmentId", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/table") |
| | | public Result<?> getDepartmentListTable(Integer departmentId) { |
| | | List<Map<String, Object>> departmentListTable = organizationalService.getDepartmentListTable(departmentId); |
| | | return Result.success(departmentListTable); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加部门") |
| | | @PostMapping("/add") |
| | | public Result<?> addDepartment(@RequestBody @Validated Organizational organizational) { |
| | |
| | | |
| | | @ApiOperation(value = "删除部门") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteDepartment(Integer id) { |
| | | Integer deleteDepartment = organizationalService.deleteDepartment(id); |
| | | if (deleteDepartment >= 1){ |
| | | return Result.success("删除成功!"); |
| | | } |
| | | return Result.fail("删除失败!"); |
| | | public Result<?> deleteDepartment(String ids) { |
| | | organizationalService.deleteDepartment(ids); |
| | | return Result.success("删除成功!"); |
| | | } |
| | | } |