From 3dda4263aa1fbdf3de518131ea12685495f6280a Mon Sep 17 00:00:00 2001 From: "zhiyong.ning" <354350178@qq.com> Date: Thu, 12 Nov 2020 10:46:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=9D=E5=A4=A7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectManagementController.java | 31 +++++++++++++++++++ .../mapper/ProjectManagementMapper.java | 8 +++++ .../service/ProjectManagementService.java | 15 +++++++++ 3 files changed, 54 insertions(+) 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; + } + }