| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) |
| | | { |
| | | SysUser user = getLoginUser().getUser(); |
| | | dept.setOrgid(user.getOrgid()); |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | return success(depts); |
| | | } |
| | |
| | | @ApiOperation("新增部门") |
| | | //@PreAuthorize("@ss.hasPermi('system:dept:add')") |
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@Validated @RequestBody SysDept dept) |
| | | { |
| | | if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) |
| | |
| | | @ApiOperation("修改部门") |
| | | //@PreAuthorize("@ss.hasPermi('system:dept:edit')") |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept) |
| | | { |
| | | Long deptId = dept.getDeptId(); |