| | |
| | | package com.ycl.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | import com.ycl.common.base.Result; |
| | | import com.ycl.common.core.domain.StringTreeSelect; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class SysDeptController extends BaseController { |
| | | |
| | | private final ISysDeptService deptService; |
| | | //业主端id |
| | | private final static Long userPortId = 101L; |
| | | //审批端id |
| | | private final static Long approvalPortId = 102L; |
| | | |
| | | /** |
| | | * 获取部门列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | return success(depts); |
| | | } |
| | | |
| | | @GetMapping("/flowable/all") |
| | | public AjaxResult all() |
| | | { |
| | | List<StringTreeSelect> depts = deptService.flowableAll(); |
| | | return success(depts); |
| | | } |
| | | |
| | |
| | | { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | else if (dept.getParentId().equals(deptId)) |
| | | else if (Objects.nonNull(dept.getParentId()) && dept.getParentId().equals(deptId)) |
| | | { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); |
| | | } |
| | |
| | | deptService.checkDeptDataScope(deptId); |
| | | return toAjax(deptService.deleteDeptById(deptId)); |
| | | } |
| | | |
| | | @GetMapping("/approvalList") |
| | | @ApiOperation(value = "审批部门下拉列表", notes = "审批部门下拉列表") |
| | | public Result approvalList() { |
| | | SysDept dept = new SysDept(); |
| | | dept.setParentId(approvalPortId); |
| | | return Result.ok().data(deptService.selectDeptListNoAuth(dept)); |
| | | } |
| | | |
| | | } |