| | |
| | | package com.ycl.controller.depart; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.api.BasePageDTO; |
| | | import com.ycl.api.BasePageVO; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.entity.depart.SccgDepart; |
| | | import com.ycl.entity.user.UmsMenu; |
| | | import com.ycl.service.depart.SccgDepartService; |
| | | import com.ycl.service.user.UmsMenuService; |
| | | import com.ycl.service.user.UmsDepartManageService; |
| | | import com.ycl.utils.auth.UserAuthUtil; |
| | | import com.ycl.vo.depart.DepartVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @RestController |
| | | @Api(tags = "部门管理模块") |
| | | @RequestMapping("/depart") |
| | | public class DepartController { |
| | | public class DepartController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SccgDepartService departService; |
| | | @Resource |
| | | private UmsDepartManageService umsAdminDepartService; |
| | | @Resource |
| | | private UserAuthUtil userAuthUtil; |
| | | |
| | | @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); |
| | | } |
| | | } |
| | | |