@RequestMapping(value = "/doQuery", method = RequestMethod.POST) public @ResponseBody void doQuery( @RequestParam(value = "projectUuid", required = true) String projectUuid, @RequestParam(value = "draw", required = true) int draw, @RequestParam(value = "start", required = true) int start, @RequestParam(value = "length", required = true) int length, HttpSession session, HttpServletResponse response) throws IOException { DatatableReturnBean datatableReturnBean = new DatatableReturnBean(); datatableReturnBean.setDraw(draw); List<ProjectPhase> projectPhaseList = projectWizardService.queryProjectPhaseList(projectUuid); for (ProjectPhase projectPhase : projectPhaseList) { Map<String, Object> record = new HashMap<String, Object>(); record.put("uuid", projectPhase.getUuid()); record.put("name", projectPhase.getName()); record.put("serialNo", projectPhase.getSerialNo()); datatableReturnBean.addRecord(record); } datatableReturnBean.setRecordsTotal(projectPhaseList.size()); datatableReturnBean.setRecordsFiltered(projectPhaseList.size()); response.setContentType(JKEY_CONTENT_TYPE); response.getWriter().write(datatableReturnBean.toString()); }
@RequestMapping(value = "/doQueryTool", method = RequestMethod.POST) public @ResponseBody void doQueryTool( @RequestParam(value = "phaseUuid", required = false) String phaseUuid, @RequestParam(value = "draw", required = true) int draw, @RequestParam(value = "start", required = true) int start, @RequestParam(value = "length", required = true) int length, HttpSession session, HttpServletResponse response) throws IOException { DatatableReturnBean datatableReturnBean = new DatatableReturnBean(); datatableReturnBean.setDraw(draw); List<Tool> toolList = projectWizardService.queryToolList(); List<String> phaseToolUuidList = null; if (StringUtils.isNotEmpty(phaseUuid)) { phaseToolUuidList = projectWizardService.queryPhaseToolUuidList(phaseUuid); } for (Tool tool : toolList) { Map<String, Object> record = new HashMap<String, Object>(); record.put("uuid", tool.getUuid()); record.put("name", tool.getName()); if (phaseToolUuidList != null && phaseToolUuidList.size() > 0 && phaseToolUuidList.contains(tool.getUuid())) { record.put("isSelected", "Y"); } else { record.put("isSelected", "N"); } datatableReturnBean.addRecord(record); } datatableReturnBean.setRecordsTotal(toolList.size()); datatableReturnBean.setRecordsFiltered(toolList.size()); response.setContentType(JKEY_CONTENT_TYPE); response.getWriter().write(datatableReturnBean.toString()); }