diff --git a/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java b/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java index 1dc5638..0114511 100644 --- a/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java +++ b/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java @@ -524,4 +524,35 @@ public class ProjectManagementController { } return resp; } + + + /** + * 川大查询项目管理 + *

+ * + * @param projectPermissions:权限 + * @return + */ + @ApiOperation(value = "川大查询项目管理列表", notes = "川大查询项目管理列表") + @GetMapping("/getManagements") + Response getManagements( + @ApiParam(name = "projectPermissions", value = "项目权限(0、练习 1、考核 2、竞赛)", required = true) @RequestParam(required = true) Integer projectPermissions){ + Response resp = new Response(); + ProjectManagement vo = new ProjectManagement(); + if (null == projectPermissions) { + resp.setStatus(300); + resp.setErrmessage("项目权限不能为空!"); + }else { + HashMap ret = service.getManagements(projectPermissions); + int status = (int) ret.get("retcode"); + if (status == 200) { + resp.setStatus(status); + resp.setMessage(ret.get("retvalue")); + } else { + resp.setStatus(status); + resp.setErrmessage(ret.get("retvalue").toString()); + } + } + return resp; + } } diff --git a/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java b/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java index dbe638c..cdfe9dd 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java @@ -315,6 +315,14 @@ public interface ProjectManagementMapper { @Select("SELECT accountRole FROM user WHERE userId=#{userId}") Integer queryRoleId(Integer userId); + /** + * 查询项目名称 + * + * @param projectPermissions + * @return + */ + @Select("select * from hr_project_management where projectPermissions=#{projectPermissions}") + List getManagements(Integer projectPermissions); @Select("SELECT id FROM tms_experimental_teaching WHERE project_id =#{projectId}") List queryproject(Integer projectId); diff --git a/src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java b/src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java index 250420f..67b114a 100644 --- a/src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java +++ b/src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java @@ -681,4 +681,19 @@ public class ProjectManagementService { return resp; } + public HashMap getManagements(Integer projectPermissions){ + HashMap resp = new HashMap(); + try{ + List projectManagements = mapper.getManagements(projectPermissions); + resp.put("retcode", 200); + resp.put("retvalue",projectManagements); + }catch (RuntimeException e){ + logger.error(e.getMessage()); + resp.put("retcode", 500); + resp.put("retvalue", "数据有误,查询失败!"); + throw new RuntimeException(); + } + return resp; + } + }