81 lines
2.1 KiB
Java
81 lines
2.1 KiB
Java
|
package com.yanzhu.jh.publics;
|
||
|
|
||
|
import com.ruoyi.common.core.controller.BaseController;
|
||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||
|
import com.ruoyi.common.enums.UserStatus;
|
||
|
import com.ruoyi.system.service.ISysDeptService;
|
||
|
import com.ruoyi.system.service.ISysUserService;
|
||
|
import com.yanzhu.jh.project.domain.SurProject;
|
||
|
import com.yanzhu.jh.project.service.ISurProjectService;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* 公共服务Controller
|
||
|
*
|
||
|
* @author JiangYuQi
|
||
|
* @date 2023-07-29
|
||
|
*/
|
||
|
@RestController
|
||
|
@RequestMapping("/publics")
|
||
|
public class
|
||
|
PublicsController extends BaseController {
|
||
|
|
||
|
@Autowired
|
||
|
private ISysUserService userService;
|
||
|
|
||
|
@Autowired
|
||
|
private ISysDeptService deptService;
|
||
|
|
||
|
@Autowired
|
||
|
private ISurProjectService surProjectService;
|
||
|
|
||
|
/**
|
||
|
* 获取部门列表
|
||
|
*/
|
||
|
@GetMapping("/deptList")
|
||
|
public AjaxResult list(SysDept dept)
|
||
|
{
|
||
|
dept.setStatus(UserStatus.OK.getCode());
|
||
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
||
|
return success(depts);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 查询项目列表
|
||
|
*/
|
||
|
@GetMapping("/projectList")
|
||
|
public TableDataInfo list(SurProject surProject)
|
||
|
{
|
||
|
List<SurProject> list = surProjectService.selectSurProjectList(surProject);
|
||
|
return getDataTable(list);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 获取用户列表
|
||
|
*/
|
||
|
@GetMapping("/userList")
|
||
|
public TableDataInfo list(SysUser user)
|
||
|
{
|
||
|
user.setDelFlag(UserStatus.OK.getCode());
|
||
|
List<SysUser> list = userService.selectUserList(user);
|
||
|
return getDataTable(list);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 获取部门树列表
|
||
|
*/
|
||
|
@GetMapping("/deptTree")
|
||
|
public AjaxResult deptTree(SysDept dept)
|
||
|
{
|
||
|
return success(deptService.selectDeptTreeList(dept));
|
||
|
}
|
||
|
}
|