diff --git a/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java b/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java index 9d5a97c..193999a 100644 --- a/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java +++ b/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java @@ -58,20 +58,20 @@ public class ProjectManagementController { @ApiOperation(value = "项目管理列表", notes = "项目管理列表") @GetMapping("/queryAllManagements") R queryAllManagements( - @ApiParam(name = "projectPermissions", value = "项目权限(0、练习 1、考核 2、竞赛)", required = false) @RequestParam(required = false) Integer projectPermissions, - @ApiParam(name = "founder", value = "项目创建人(0、系统 1、老师)", required = false) @RequestParam(required = false) String founder, - @ApiParam(name = "state", value = "项目状态(0、草稿箱 1、已发布)", required = false) @RequestParam(required = false) Integer state, - @ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam(required = false) String projectName, - @ApiParam(name = "systemId", value = "系统id", required = true) @RequestParam Integer systemId, - @ApiParam(name = "userId", value = "用户id", required = true) @RequestParam Integer userId, - @ApiParam(name = "pageNo", value = "起始页数", required = true) @RequestParam Integer pageNo, - @ApiParam(name = "pageSize", value = "页数", required = true) @RequestParam Integer pageSize) { + @ApiParam(name = "projectPermissions", value = "项目权限(0、练习 1、考核 2、竞赛)", required = false) @RequestParam(required = false) Integer projectPermissions, + @ApiParam(name = "founder", value = "项目创建人(0、系统 1、老师)", required = false) @RequestParam(required = false) String founder, + @ApiParam(name = "state", value = "项目状态(0、草稿箱 1、已发布)", required = false) @RequestParam(required = false) Integer state, + @ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam(required = false) String projectName, + @ApiParam(name = "systemId", value = "系统id", required = true) @RequestParam Integer systemId, + @ApiParam(name = "userId", value = "用户id", required = true) @RequestParam Integer userId, + @ApiParam(name = "pageNo", value = "起始页数", required = true) @RequestParam Integer pageNo, + @ApiParam(name = "pageSize", value = "页数", required = true) @RequestParam Integer pageSize) { R r = new R(); ProjectManagement vo = new ProjectManagement(); if (null != projectPermissions) { vo.setProjectPermissions(projectPermissions); } - if (null != founder && founder !="") { + if (null != founder && founder != "") { vo.setFounder(founder); } if (null != state) { @@ -86,19 +86,19 @@ public class ProjectManagementController { if (null != userId) { vo.setUserId(userId); } - if (null != pageNo){ + if (null != pageNo) { vo.setPageNo(pageNo); } - if (null != pageSize){ + if (null != pageSize) { vo.setPageSize(pageSize); } HashMap ret = service.queryAllManagements(vo); int status = (int) ret.get("retcode"); if (status == 200) { r.put("status", 200); - r.put("pageInfo",ret.get("pageInfo")); + r.put("pageInfo", ret.get("pageInfo")); } else { - R.error(500,ret.get("retvalue").toString()); + R.error(500, ret.get("retvalue").toString()); } return r; } @@ -155,6 +155,7 @@ public class ProjectManagementController { // } // return resp; // } + /** * 页面查询,排除练习 *

@@ -165,11 +166,11 @@ public class ProjectManagementController { @ApiOperation(value = "项目列表(排除练习)", notes = "项目列表(用于创建实验,排除练习项目)") @GetMapping("/queryManagements") Response queryManagements( - @ApiParam(name = "systemId", value = "系统id", required = true) @RequestParam(required = false) Integer systemId, - @ApiParam(name = "userId", value = "用户id", required = true) @RequestParam(required = false) Integer userId, - @ApiParam(name = "pageNo", value = "第几页,页码", required = true) @RequestParam Integer pageNo, - @ApiParam(name = "pageSize", value = "每页展示的数据条数", required = true) @RequestParam Integer pageSize, - @ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam String projectName) { + @ApiParam(name = "systemId", value = "系统id", required = true) @RequestParam(required = false) Integer systemId, + @ApiParam(name = "userId", value = "用户id", required = true) @RequestParam(required = false) Integer userId, + @ApiParam(name = "pageNo", value = "第几页,页码", required = true) @RequestParam Integer pageNo, + @ApiParam(name = "pageSize", value = "每页展示的数据条数", required = true) @RequestParam Integer pageSize, + @ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam(required = false) String projectName) { Response resp = new Response(); ProjectManagement vo = new ProjectManagement(); if (null != systemId) { @@ -178,10 +179,17 @@ public class ProjectManagementController { if (null != userId) { vo.setUserId(userId); } - if (null != projectName) { + + + + /*if (null != projectName) { vo.setQueryName(projectName); + }*/ + + if (org.apache.commons.lang3.StringUtils.equals("", projectName)) { + projectName = null; } - HashMap ret = service.queryManagements(vo,pageNo,pageSize); + HashMap ret = service.queryManagements(vo, pageNo, pageSize); int status = (int) ret.get("retcode"); if (status == 200) { resp.setStatus(status); @@ -194,12 +202,6 @@ public class ProjectManagementController { } - - - - - - /** * 批量删除 * @@ -660,16 +662,17 @@ public class ProjectManagementController { /** * 判断项目名称是否存在 + * * @param projectName * @return */ @GetMapping("/isNameExistis") - Response isNameExistis(@RequestParam String projectName){ + Response isNameExistis(@RequestParam String projectName) { Response resp = new Response(); if (StringUtils.isEmpty(projectName)) { resp.setStatus(300); resp.setMessage("项目名称为空"); - }else{ + } else { HashMap ret = service.getByName(projectName); int status = (int) ret.get("retcode"); if (status == 200) { @@ -737,13 +740,13 @@ public class ProjectManagementController { @ApiOperation(value = "川大查询项目管理列表", notes = "川大查询项目管理列表") @GetMapping("/getManagements") Response getManagements( - @ApiParam(name = "projectPermissions", value = "项目权限(0、练习 1、考核 2、竞赛)", required = true) @RequestParam(required = true) Integer projectPermissions){ + @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 { + } else { HashMap ret = service.getManagements(projectPermissions); int status = (int) ret.get("retcode"); if (status == 200) { @@ -759,13 +762,14 @@ public class ProjectManagementController { /** * 是否启用 + * * @param enable 0:启用,1:禁用 - * @param id 项目id + * @param id 项目id */ @ApiOperation(value = "启用/禁用", notes = "启用/禁用") @GetMapping("/enable") - public Response enable(@ApiParam(name = "enable", value = "0:启用,1:禁用")@RequestParam("enable") Integer enable, - @ApiParam(name = "id", value = "项目id")@RequestParam("id") Integer id) { + public Response enable(@ApiParam(name = "enable", value = "0:启用,1:禁用") @RequestParam("enable") Integer enable, + @ApiParam(name = "id", value = "项目id") @RequestParam("id") Integer id) { Response resp = new Response(); if (enable == null || id == null || (enable != 0 && enable != 1)) { resp.setStatus(406); diff --git a/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java b/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java index 5d6be3e..0e577ee 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java @@ -25,17 +25,16 @@ public interface ProjectManagementMapper { * 分页查询+条件查询 * * @param management - * @return - * "select projectId,projectName,projectPermissions,founder,creationTime,state from hr_project_management where isdel=0", - * " and projectPermissions=#{projectPermissions}", - * " and founder=#{founder}",//服务端跳项目管理 - * " and (userId=#{userId} or founder = 0)",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的 - * " and founder=#{founder}",//教师选择创建人为系统 - * " and userId=#{userId}",//教师选则创建人为老师 - * " and state=#{state}", - * " and systemId=#{systemId}", - * " and projectName like concat('%',#{projectName},'%')", - * " ORDER BY creationTime desc", + * @return "select projectId,projectName,projectPermissions,founder,creationTime,state from hr_project_management where isdel=0", + * " and projectPermissions=#{projectPermissions}", + * " and founder=#{founder}",//服务端跳项目管理 + * " and (userId=#{userId} or founder = 0)",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的 + * " and founder=#{founder}",//教师选择创建人为系统 + * " and userId=#{userId}",//教师选则创建人为老师 + * " and state=#{state}", + * " and systemId=#{systemId}", + * " and projectName like concat('%',#{projectName},'%')", + * " ORDER BY creationTime desc", */ @Select({""}) List queryManagements(ProjectManagement management); @@ -69,10 +68,11 @@ public interface ProjectManagementMapper { @Select({""}) List queryManagementsExportTest(ProjectManagement management); @@ -211,7 +211,7 @@ public interface ProjectManagementMapper { @Select({""}) - List getScore(Integer judgmentPointsId,Integer systemId,Integer projectId); + List getScore(Integer judgmentPointsId, Integer systemId, Integer projectId); /** @@ -310,6 +310,7 @@ public interface ProjectManagementMapper { /** * 修改判分点绑定的项目 + * * @param projectId * @param judgmentPointsId */