public ModelAndView doRRProcess(HttpServletRequest request, HttpServletResponse response) { HashMap<String, Object> json = new HashMap<String, Object>(); try { LoginUser lu = (LoginUser) request.getSession().getAttribute("user"); String data = URLDecoder.decode(request.getParameter("data"), "utf-8"); String[] separator = StringHelper.getDataSeparator(data, 2); data = data.replaceAll(":s:", separator[0]).replaceAll(":se:", separator[1]); if (request.getParameter("isRevise").equals("0")) { DaoFactory.createReceiveReportDao() .doAccounting(data, separator[0], separator[1], lu.getUserId()); } else { DaoFactory.createReceiveReportDao() .doAccountingRevise(data, separator[0], separator[1], lu.getUserId()); } } catch (Exception e) { e.printStackTrace(); json.put("message", e.getMessage()); } return new ModelAndView("jsonView", json); }
public ModelAndView ajaxNUpdate(HttpServletRequest request, HttpServletResponse response) throws IOException { Map<String, Object> json = new HashMap<String, Object>(); try { LoginUser lu = (LoginUser) request.getSession().getAttribute("user"); String data = URLDecoder.decode(request.getParameter("data"), "utf-8"); String[] separator = StringHelper.getDataSeparator(data, 2); data = data.replaceAll(":s:", separator[0]).replaceAll(":se:", separator[1]); DaoFactory.createAssignCanvassingDao() .ajaxNUpdatePA(data, separator[0], separator[1], lu.getUserId()); json.put("message", ""); } catch (Exception e) { e.printStackTrace(); json.put("message", e.getMessage()); } return new ModelAndView("jsonView", json); }