| | |
| | | package com.ycl.controller.depart; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.api.BasePageDTO; |
| | | import com.ycl.api.BasePageVO; |
| | | import com.ycl.api.CommonPage; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.dto.user.AdminDepartInfoDTO; |
| | | import com.ycl.entity.auth.Operator; |
| | | import com.ycl.entity.depart.SccgDepart; |
| | | import com.ycl.entity.user.UmsAdminDepart; |
| | | import com.ycl.entity.user.UmsMenu; |
| | | import com.ycl.service.depart.SccgDepartService; |
| | | import com.ycl.service.user.UmsAdminDepartService; |
| | | import com.ycl.service.user.UmsMenuService; |
| | | import com.ycl.vo.depart.DepartVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @RestController |
| | | @Api(tags = "部门管理模块") |
| | | @RequestMapping("/depart") |
| | | public class DepartController { |
| | | public class DepartController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SccgDepartService departService; |
| | | @Resource |
| | | private UmsAdminDepartService umsAdminDepartService; |
| | | |
| | | @ApiOperation("添加部门") |
| | | @PostMapping(value = "/create") |
| | | public CommonResult<Void> create(@Validated @RequestBody DepartVO.AddDepartVO addDepartVO) { |
| | | departService.create(addDepartVO); |
| | | return CommonResult.success(null); |
| | | } |
| | | |
| | | @ApiOperation("编辑部门") |
| | | @PostMapping(value = "/update") |
| | | public CommonResult<Void> create(@Validated @RequestBody DepartVO.UpdateDepartVO params) { |
| | | departService.update(params); |
| | | return CommonResult.success(null); |
| | | } |
| | | |
| | |
| | | return CommonResult.success(null); |
| | | } |
| | | |
| | | @ApiOperation("查询全部部门") |
| | | @GetMapping(value = "/page") |
| | | public CommonResult<IPage<SccgDepart>> page(DepartVO.PageDepartVO params) { |
| | | IPage<SccgDepart> page = departService.pageDepart(params); |
| | | return CommonResult.success(page); |
| | | } |
| | | |
| | | @ApiOperation("查询我的部门") |
| | | @GetMapping(value = "/belongDepart") |
| | | public CommonResult<BasePageDTO> belongDepart(BasePageVO params) { |
| | | BasePageDTO basePageDTO= umsAdminDepartService.belongDepart(fetchOperator(request).getOperatorId(), params.getCurrent(), params.getPageSize()); |
| | | return CommonResult.success(basePageDTO); |
| | | } |
| | | } |
| | | |