@Override public DaoPage findUserOperationByParams(Map params, Integer pageIndex, Integer pageSize) { if (params == null) { params = new HashMap(); } DaoPage daoPage = userOperationDao.findUserOperationByParams(params, pageIndex, pageSize); daoPage.setResult(convertUserOperationToInParam((List<UserOperation>) daoPage.getResult())); return daoPage; }
/** * jobs数据加载 * * @param response * @param parameter * @return * @throws Exception */ @ResponseBody @RequestMapping(value = "/getJobDefinitions") public DaoPage loadJobDefinitions( HttpServletResponse response, @RequestParam Map<String, Object> parameter) throws Exception { DaoPage daoPage = jobDefinitionService.loadJobs( parameter, PageUtils.getPageNumber(parameter), PageUtils.getPageSize( parameter)); // (parameter,PageUtils.getPageNumber(parameter),PageUtils.getPageSize(parameter)); JSONObject result = new JSONObject(); result.put("total", daoPage.getRecordCount()); result.put("rows", daoPage.getResult()); // daoPage.getr result.put("pages", daoPage.getPageCount()); result.put("success", true); retJson(response, result); return null; }
/** * 显示历史jobs信息 * * @param response * @return * @throws Exception */ @ResponseBody @RequestMapping(value = "/loadhistory") public DaoPage getJobByName( HttpServletResponse response, @RequestParam Map<String, Object> parameter) throws Exception { StringBuffer sqlBuffer = new StringBuffer(); System.out.println((String) parameter.get("id")); DaoPage daoPage = jobDefinitionService.getJobByName( parameter, Integer.parseInt(parameter.get("page").toString()), Integer.parseInt(parameter.get("rows").toString())); JSONObject result = new JSONObject(); JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor()); JSONArray jsonArray = JSONArray.fromObject(daoPage.getResult(), jsonConfig); result.put("total", daoPage.getRecordCount()); result.put("rows", jsonArray); // daoPage.getr result.put("pages", daoPage.getPageCount()); result.put("success", true); retJson(response, result); return null; }