diff --git a/src/main/java/com/yipin/liuwanr/controller/Project_ManagementController.java b/src/main/java/com/yipin/liuwanr/controller/Project_ManagementController.java index 2749de7..03dc735 100644 --- a/src/main/java/com/yipin/liuwanr/controller/Project_ManagementController.java +++ b/src/main/java/com/yipin/liuwanr/controller/Project_ManagementController.java @@ -262,6 +262,21 @@ public class Project_ManagementController { return resp; } + @ApiOperation(value = "修改角色", notes = "修改角色") + @PostMapping("/updateRole") + Response updateRole(@ApiParam(name = "Role", value = "角色对象,传入json格式", required = true) @RequestBody Role role) { + Response resp = new Response(); + HashMap ret = service.updateRole(role); + 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; + } /** * 实验数据表格信息的展示,根据角色id diff --git a/src/main/java/com/yipin/liuwanr/entity/Role.java b/src/main/java/com/yipin/liuwanr/entity/Role.java index 1c90473..a2cc14f 100644 --- a/src/main/java/com/yipin/liuwanr/entity/Role.java +++ b/src/main/java/com/yipin/liuwanr/entity/Role.java @@ -13,7 +13,7 @@ import java.io.Serializable; @ApiModel(value = "Role对象", description = "角色对象Role") public class Role implements Serializable { - @ApiModelProperty(hidden = true) + //@ApiModelProperty(hidden = true) protected Integer roleId;// 角色ID @ApiModelProperty(hidden = true) private String roleName;// 角色名称 diff --git a/src/main/java/com/yipin/liuwanr/mapper/Project_ManagementMapper.java b/src/main/java/com/yipin/liuwanr/mapper/Project_ManagementMapper.java index e122807..a80a684 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/Project_ManagementMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/Project_ManagementMapper.java @@ -204,8 +204,8 @@ public interface Project_ManagementMapper { * * @param management */ - @Insert("INSERT INTO hr_project_management(projectName,projectPermissions,experimentalGoal,caseDescription,experimentSuggests,state,founder,systemId,creationTime,isstartexperimental,isstartexperimentSuggests,userId,isExperiment,isAttendance,isdel)" - + " VALUES (#{projectName},#{projectPermissions},#{experimentalGoal},#{caseDescription},#{experimentSuggests},#{state},#{founder},#{systemId},now(),#{isstartexperimental},#{isstartexperimentSuggests},#{userId},0,0,0)") + @Insert("INSERT INTO hr_project_management(projectName,projectPermissions,experimentalGoal,caseDescription,experimentSuggests,state,founder,systemId,creationTime,isstartexperimental,isstartexperimentSuggests,userId)" + + " VALUES (#{projectName},#{projectPermissions},#{experimentalGoal},#{caseDescription},#{experimentSuggests},#{state},#{founder},#{systemId},now(),#{isstartexperimental},#{isstartexperimentSuggests},#{userId})") @Options(useGeneratedKeys = true, keyProperty = "projectId", keyColumn = "projectId") void insertProjectManagement(Project_Management management); diff --git a/src/main/java/com/yipin/liuwanr/service/Project_ManagementService.java b/src/main/java/com/yipin/liuwanr/service/Project_ManagementService.java index b952728..70efe93 100644 --- a/src/main/java/com/yipin/liuwanr/service/Project_ManagementService.java +++ b/src/main/java/com/yipin/liuwanr/service/Project_ManagementService.java @@ -491,7 +491,7 @@ public class Project_ManagementService { */ @Transactional public HashMap updateProjectManagement(Project_Management pro, List points, - List roles) { + List roles) { HashMap resp = new HashMap(); //项目id @@ -548,7 +548,7 @@ public class Project_ManagementService { } //数据库中该判分点未绑定任何项目id - else if (projectIds == null) { + else if (StringUtils.isEmpty(projectIds)) { buff.append(project); } //数据中实验要求不为空,且数据库中的实验要求与前端传来的实验要求信息一致