更改角色id查询字段

master
rong.liu 4 years ago
parent 0816c9168b
commit 7d251fcfb3
  1. 44
      src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java
  2. 11
      src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java

@ -71,7 +71,7 @@ public class ProjectManagementController {
if (null != projectPermissions) { if (null != projectPermissions) {
vo.setProjectPermissions(projectPermissions); vo.setProjectPermissions(projectPermissions);
} }
if (null != founder && founder !="") { if (null != founder && founder != "") {
vo.setFounder(founder); vo.setFounder(founder);
} }
if (null != state) { if (null != state) {
@ -86,19 +86,19 @@ public class ProjectManagementController {
if (null != userId) { if (null != userId) {
vo.setUserId(userId); vo.setUserId(userId);
} }
if (null != pageNo){ if (null != pageNo) {
vo.setPageNo(pageNo); vo.setPageNo(pageNo);
} }
if (null != pageSize){ if (null != pageSize) {
vo.setPageSize(pageSize); vo.setPageSize(pageSize);
} }
HashMap<String, Object> ret = service.queryAllManagements(vo); HashMap<String, Object> ret = service.queryAllManagements(vo);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (status == 200) { if (status == 200) {
r.put("status", 200); r.put("status", 200);
r.put("pageInfo",ret.get("pageInfo")); r.put("pageInfo", ret.get("pageInfo"));
} else { } else {
R.error(500,ret.get("retvalue").toString()); R.error(500, ret.get("retvalue").toString());
} }
return r; return r;
} }
@ -155,6 +155,7 @@ public class ProjectManagementController {
// } // }
// return resp; // return resp;
// } // }
/** /**
* 页面查询,排除练习 * 页面查询,排除练习
* <p> * <p>
@ -169,7 +170,7 @@ public class ProjectManagementController {
@ApiParam(name = "userId", value = "用户id", required = true) @RequestParam(required = false) Integer userId, @ApiParam(name = "userId", value = "用户id", required = true) @RequestParam(required = false) Integer userId,
@ApiParam(name = "pageNo", value = "第几页,页码", required = true) @RequestParam Integer pageNo, @ApiParam(name = "pageNo", value = "第几页,页码", required = true) @RequestParam Integer pageNo,
@ApiParam(name = "pageSize", value = "每页展示的数据条数", required = true) @RequestParam Integer pageSize, @ApiParam(name = "pageSize", value = "每页展示的数据条数", required = true) @RequestParam Integer pageSize,
@ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam String projectName) { @ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam(required = false) String projectName) {
Response resp = new Response(); Response resp = new Response();
ProjectManagement vo = new ProjectManagement(); ProjectManagement vo = new ProjectManagement();
if (null != systemId) { if (null != systemId) {
@ -178,10 +179,17 @@ public class ProjectManagementController {
if (null != userId) { if (null != userId) {
vo.setUserId(userId); vo.setUserId(userId);
} }
if (null != projectName) {
/*if (null != projectName) {
vo.setQueryName(projectName); vo.setQueryName(projectName);
}*/
if (org.apache.commons.lang3.StringUtils.equals("", projectName)) {
projectName = null;
} }
HashMap<String, Object> ret = service.queryManagements(vo,pageNo,pageSize); HashMap<String, Object> ret = service.queryManagements(vo, pageNo, pageSize);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (status == 200) { if (status == 200) {
resp.setStatus(status); resp.setStatus(status);
@ -194,12 +202,6 @@ public class ProjectManagementController {
} }
/** /**
* 批量删除 * 批量删除
* *
@ -660,16 +662,17 @@ public class ProjectManagementController {
/** /**
* 判断项目名称是否存在 * 判断项目名称是否存在
*
* @param projectName * @param projectName
* @return * @return
*/ */
@GetMapping("/isNameExistis") @GetMapping("/isNameExistis")
Response isNameExistis(@RequestParam String projectName){ Response isNameExistis(@RequestParam String projectName) {
Response resp = new Response(); Response resp = new Response();
if (StringUtils.isEmpty(projectName)) { if (StringUtils.isEmpty(projectName)) {
resp.setStatus(300); resp.setStatus(300);
resp.setMessage("项目名称为空"); resp.setMessage("项目名称为空");
}else{ } else {
HashMap<String, Object> ret = service.getByName(projectName); HashMap<String, Object> ret = service.getByName(projectName);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (status == 200) { if (status == 200) {
@ -737,13 +740,13 @@ public class ProjectManagementController {
@ApiOperation(value = "川大查询项目管理列表", notes = "川大查询项目管理列表") @ApiOperation(value = "川大查询项目管理列表", notes = "川大查询项目管理列表")
@GetMapping("/getManagements") @GetMapping("/getManagements")
Response 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(); Response resp = new Response();
ProjectManagement vo = new ProjectManagement(); ProjectManagement vo = new ProjectManagement();
if (null == projectPermissions) { if (null == projectPermissions) {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("项目权限不能为空!"); resp.setErrmessage("项目权限不能为空!");
}else { } else {
HashMap<String, Object> ret = service.getManagements(projectPermissions); HashMap<String, Object> ret = service.getManagements(projectPermissions);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (status == 200) { if (status == 200) {
@ -759,13 +762,14 @@ public class ProjectManagementController {
/** /**
* 是否启用 * 是否启用
*
* @param enable 0:启用,1:禁用 * @param enable 0:启用,1:禁用
* @param id 项目id * @param id 项目id
*/ */
@ApiOperation(value = "启用/禁用", notes = "启用/禁用") @ApiOperation(value = "启用/禁用", notes = "启用/禁用")
@GetMapping("/enable") @GetMapping("/enable")
public Response enable(@ApiParam(name = "enable", value = "0:启用,1:禁用")@RequestParam("enable") Integer enable, public Response enable(@ApiParam(name = "enable", value = "0:启用,1:禁用") @RequestParam("enable") Integer enable,
@ApiParam(name = "id", value = "项目id")@RequestParam("id") Integer id) { @ApiParam(name = "id", value = "项目id") @RequestParam("id") Integer id) {
Response resp = new Response(); Response resp = new Response();
if (enable == null || id == null || (enable != 0 && enable != 1)) { if (enable == null || id == null || (enable != 0 && enable != 1)) {
resp.setStatus(406); resp.setStatus(406);

@ -25,8 +25,7 @@ public interface ProjectManagementMapper {
* 分页查询+条件查询 * 分页查询+条件查询
* *
* @param management * @param management
* @return * @return "select projectId,projectName,projectPermissions,founder,creationTime,state from hr_project_management where isdel=0",
* "select projectId,projectName,projectPermissions,founder,creationTime,state from hr_project_management where isdel=0",
* " <if test='projectPermissions!=null'> and projectPermissions=#{projectPermissions}</if>", * " <if test='projectPermissions!=null'> and projectPermissions=#{projectPermissions}</if>",
* " <if test='founder!=null and userId==null'> and founder=#{founder}</if>",//服务端跳项目管理 * " <if test='founder!=null and userId==null'> and founder=#{founder}</if>",//服务端跳项目管理
* " <if test='founder==null and userId!=null'> and (userId=#{userId} or founder = 0)</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的 * " <if test='founder==null and userId!=null'> and (userId=#{userId} or founder = 0)</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的
@ -69,8 +68,9 @@ public interface ProjectManagementMapper {
@Select({"<script>", @Select({"<script>",
"select * from hr_project_management where enable = 0",//(roleId NOT LIKE '%3%' AND isdel = 0 AND projectPermissions != 0)", "select * from hr_project_management where enable = 0",//(roleId NOT LIKE '%3%' AND isdel = 0 AND projectPermissions != 0)",
"<if test='userId==null'>AND roleId NOT LIKE '%3%' AND isdel = 0 AND projectPermissions != 0</if>", "<if test='userId==null'>AND founder != 14 AND isdel = 0 AND projectPermissions != 0</if>",
" <if test='userId!=null'>AND ((roleId NOT LIKE '%3%' AND isdel = 0 AND projectPermissions != 0) OR ( isdel = 0 AND projectPermissions != 0 AND userId = #{userId} ))</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的 " <if test='userId!=null'>AND ((AND founder != 14 AND isdel = 0 AND projectPermissions != 0) " +
" OR ( isdel = 0 AND projectPermissions != 0 AND userId = #{userId} ))</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的
" <if test='systemId!=null'> and systemId=#{systemId}</if>", " <if test='systemId!=null'> and systemId=#{systemId}</if>",
" <if test='queryName!=null'> and projectName LIKE '%' #{queryName} '%'</if>", " <if test='queryName!=null'> and projectName LIKE '%' #{queryName} '%'</if>",
" ORDER BY creationTime desc", " ORDER BY creationTime desc",
@ -211,7 +211,7 @@ public interface ProjectManagementMapper {
@Select({"<script>", @Select({"<script>",
"select score,judgmentPointsId from hr_score_index where judgmentPointsId=#{judgmentPointsId} and systemId = #{systemId} and projectId = #{projectId}", "select score,judgmentPointsId from hr_score_index where judgmentPointsId=#{judgmentPointsId} and systemId = #{systemId} and projectId = #{projectId}",
"</script>"}) "</script>"})
List<ScoreIndex> getScore(Integer judgmentPointsId,Integer systemId,Integer projectId); List<ScoreIndex> getScore(Integer judgmentPointsId, Integer systemId, Integer projectId);
/** /**
@ -310,6 +310,7 @@ public interface ProjectManagementMapper {
/** /**
* 修改判分点绑定的项目 * 修改判分点绑定的项目
*
* @param projectId * @param projectId
* @param judgmentPointsId * @param judgmentPointsId
*/ */

Loading…
Cancel
Save