| | |
| | | package com.ycl.controller.depart; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.api.BasePageDTO; |
| | | import com.ycl.api.BasePageVO; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description batch deletion departments |
| | | * @Param [ids] |
| | | * @return com.ycl.api.CommonResult<java.lang.Void> |
| | | * @Description batch deletion departments |
| | | * @Param [ids] |
| | | **/ |
| | | @ApiOperation("批处理-删除") |
| | | @PostMapping(value = "/batch_deletion") |
| | | public CommonResult delete(@RequestParam List<Long> ids) { |
| | | if (ids.isEmpty()){ |
| | | if (ids.isEmpty()) { |
| | | return CommonResult.failed("bad request parameter"); |
| | | } |
| | | return CommonResult.success(departService.removeBatchByIds(ids)); |
| | |
| | | @ApiOperation("查询我的部门") |
| | | @GetMapping(value = "/belongDepart") |
| | | public CommonResult<BasePageDTO> belongDepart(BasePageVO params) { |
| | | BasePageDTO basePageDTO= umsAdminDepartService.belongDepart(fetchOperator(request).getOperatorId(), params.getCurrent(), params.getPageSize()); |
| | | BasePageDTO basePageDTO = umsAdminDepartService.belongDepart(fetchOperator(request).getOperatorId(), params.getCurrent(), params.getPageSize()); |
| | | return CommonResult.success(basePageDTO); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("查询顶级部门") |
| | | @GetMapping(value = "/query_father") |
| | | public CommonResult search() { |
| | | Integer fatherId = 0; |
| | | return CommonResult.success(departService |
| | | .list(new LambdaQueryWrapper<UmsDepart>() |
| | | .eq(UmsDepart::getParentId, fatherId))); |
| | | } |
| | | |
| | | @ApiOperation("查询部门二级") |
| | | @GetMapping(value = "/query_father_children") |
| | | public CommonResult search(@RequestParam Integer fatherId) { |
| | | return CommonResult.success(departService |
| | | .list(new LambdaQueryWrapper<UmsDepart>() |
| | | .eq(UmsDepart::getParentId, fatherId))); |
| | | } |
| | | } |