添加川大查询项目管理列表接口

master
zhiyong.ning 4 years ago
parent 2f156cf27a
commit 3dda4263aa
  1. 31
      src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java
  2. 8
      src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java
  3. 15
      src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java

@ -524,4 +524,35 @@ public class ProjectManagementController {
}
return resp;
}
/**
* 川大查询项目管理
* <p>
*
* @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<String, Object> 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;
}
}

@ -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<ProjectManagement> getManagements(Integer projectPermissions);
@Select("SELECT id FROM tms_experimental_teaching WHERE project_id =#{projectId}")
List<Integer> queryproject(Integer projectId);

@ -681,4 +681,19 @@ public class ProjectManagementService {
return resp;
}
public HashMap<String, Object> getManagements(Integer projectPermissions){
HashMap<String, Object> resp = new HashMap<String, Object>();
try{
List<ProjectManagement> 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;
}
}

Loading…
Cancel
Save