2023-08-10 21:09:49 +08:00
|
|
|
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;
|
2023-08-20 15:46:23 +08:00
|
|
|
import com.ruoyi.common.core.text.Convert;
|
2023-08-12 12:18:27 +08:00
|
|
|
import com.ruoyi.common.enums.PublicStateEnum;
|
2023-08-20 15:46:23 +08:00
|
|
|
import com.ruoyi.common.enums.SysRoleEnum;
|
2023-08-10 21:09:49 +08:00
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
import com.yanzhu.jh.project.domain.SurProject;
|
2023-08-20 15:46:23 +08:00
|
|
|
import com.yanzhu.jh.project.domain.SurProjectChecking;
|
|
|
|
import com.yanzhu.jh.project.domain.SurProjectUnitInfo;
|
|
|
|
import com.yanzhu.jh.project.domain.SurProjectUserinfo;
|
2023-08-10 21:09:49 +08:00
|
|
|
import com.yanzhu.jh.project.service.ISurProjectService;
|
2023-08-20 15:46:23 +08:00
|
|
|
import com.yanzhu.jh.project.service.ISurProjectUnitInfoService;
|
|
|
|
import com.yanzhu.jh.project.service.ISurProjectUserinfoService;
|
2023-08-10 21:09:49 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2023-08-20 15:46:23 +08:00
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
2023-08-10 21:09:49 +08:00
|
|
|
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;
|
|
|
|
|
2023-08-20 15:46:23 +08:00
|
|
|
@Autowired
|
|
|
|
private ISurProjectUnitInfoService surProjectUnitInfoService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private ISurProjectUserinfoService surProjectUserinfoService;
|
|
|
|
|
2023-08-10 21:09:49 +08:00
|
|
|
/**
|
|
|
|
* 获取部门列表
|
|
|
|
*/
|
|
|
|
@GetMapping("/deptList")
|
|
|
|
public AjaxResult list(SysDept dept)
|
|
|
|
{
|
2023-08-12 12:18:27 +08:00
|
|
|
dept.setStatus(PublicStateEnum.OK.getCode());
|
2023-08-10 21:09:49 +08:00
|
|
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
|
|
|
return success(depts);
|
|
|
|
}
|
|
|
|
|
2023-08-12 12:18:27 +08:00
|
|
|
/**
|
|
|
|
* 获取子公司部门列表
|
|
|
|
*/
|
|
|
|
@GetMapping("/queryZgsDeptList")
|
|
|
|
public AjaxResult queryZgsDeptList(SysDept dept)
|
|
|
|
{
|
|
|
|
dept.setStatus(PublicStateEnum.OK.getCode());
|
|
|
|
dept.setComFlag(PublicStateEnum.COMZGS.getCode());
|
|
|
|
return success(deptService.selectAllDeptList(dept));
|
|
|
|
}
|
|
|
|
|
2023-08-10 21:09:49 +08:00
|
|
|
/**
|
|
|
|
* 查询项目列表
|
|
|
|
*/
|
|
|
|
@GetMapping("/projectList")
|
|
|
|
public TableDataInfo list(SurProject surProject)
|
|
|
|
{
|
|
|
|
List<SurProject> list = surProjectService.selectSurProjectList(surProject);
|
|
|
|
return getDataTable(list);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取用户列表
|
|
|
|
*/
|
|
|
|
@GetMapping("/userList")
|
|
|
|
public TableDataInfo list(SysUser user)
|
|
|
|
{
|
2023-08-12 12:18:27 +08:00
|
|
|
user.setDelFlag(PublicStateEnum.OK.getCode());
|
2023-08-10 21:09:49 +08:00
|
|
|
List<SysUser> list = userService.selectUserList(user);
|
|
|
|
return getDataTable(list);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取部门树列表
|
|
|
|
*/
|
|
|
|
@GetMapping("/deptTree")
|
|
|
|
public AjaxResult deptTree(SysDept dept)
|
|
|
|
{
|
|
|
|
return success(deptService.selectDeptTreeList(dept));
|
|
|
|
}
|
2023-08-20 15:46:23 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询项目部门列表
|
|
|
|
*/
|
|
|
|
@GetMapping("/queryUnitList")
|
|
|
|
public TableDataInfo queryUnitList(SurProjectUnitInfo surProjectUnitInfo)
|
|
|
|
{
|
|
|
|
surProjectUnitInfo.setNowRole(Convert.toStr(getUserFirstRole()));
|
|
|
|
if(SysRoleEnum.ZBDW.getCode().equals(surProjectUnitInfo.getNowRole())){
|
|
|
|
surProjectUnitInfo.setUnitId(getDeptId());
|
|
|
|
}
|
|
|
|
return getDataTable(surProjectUnitInfoService.selectSurProjectUnitInfoList(surProjectUnitInfo));
|
|
|
|
}
|
|
|
|
|
2023-09-01 17:31:12 +08:00
|
|
|
/**
|
|
|
|
* 选择项目所有部门人员
|
|
|
|
*/
|
|
|
|
@GetMapping("/selectProjectAllUnitUser")
|
|
|
|
public AjaxResult selectProjectAllUnitUser(SurProjectUserinfo surProjectUserinfo)
|
|
|
|
{
|
|
|
|
return success(surProjectUserinfoService.selectProjectUnitUser(surProjectUserinfo));
|
|
|
|
}
|
|
|
|
|
2023-08-20 15:46:23 +08:00
|
|
|
/**
|
|
|
|
* 选择项目部门人员
|
|
|
|
*/
|
|
|
|
@GetMapping("/selectProjectUnitUser")
|
2023-09-01 17:31:12 +08:00
|
|
|
public AjaxResult selectProjectUnitUser(SurProjectUnitInfo surProjectUnitInfo)
|
2023-08-20 15:46:23 +08:00
|
|
|
{
|
2023-09-01 17:31:12 +08:00
|
|
|
return success(surProjectUserinfoService.selectProjectUnitUser(surProjectUnitInfo));
|
2023-08-20 15:46:23 +08:00
|
|
|
}
|
2023-08-10 21:09:49 +08:00
|
|
|
}
|