@RequestMapping(value = "/icga/existingCtrlGapAnalysis.html", method = RequestMethod.GET) public String getExistingControl(HttpServletRequest request, Model model) { logger.debug("Existing controls start."); String controlIds = request.getParameter("controlIds") != null ? request.getParameter("controlIds") : "0"; logger.debug("Control Ids=" + controlIds); logger.debug("Existing controls end."); model.addAttribute("controlIds", controlIds); model.addAttribute("mainTabId", getMessageBundlePropertyValue("mainTab.icga")); adminService.addNode(getMessageBundlePropertyValue("landingPage.existingControls"), 2, request); return "common/internalCtrlGapAnalysis"; }
/** * Controller to get control list of transaction type * * @param request * @param model * @return */ @RequestMapping(value = "/icga/InternalCtrlGapAnalysisAC.html", method = RequestMethod.GET) public String getInternalControlGapAC(HttpServletRequest request, Model model) { List thirdPartyTransactionControlList = new ArrayList(); List generalLedgerTransactionControlList = new ArrayList(); List customerTransactionControlList = new ArrayList(); logger.debug("Existing controls start."); try { thirdPartyTransactionControlList = adminService.getControlListByTransactionType( TransactionType.THIRD_PARTY_TRANSACTION.getValue()); logger.debug( "Third Party Transaction Control list size = " + thirdPartyTransactionControlList.size()); generalLedgerTransactionControlList = adminService.getControlListByTransactionType(TransactionType.GENERAL_LEDGER.getValue()); logger.debug( "General Ledger Transaction Control list size = " + generalLedgerTransactionControlList.size()); customerTransactionControlList = adminService.getControlListByTransactionType( TransactionType.CUSTOMER_TRANSACTION.getValue()); logger.debug( "Customer Transaction Control list size = " + customerTransactionControlList.size()); } catch (Exception ex) { logger.debug("CERROR:: Internal Control Gap Analysis " + ex); } model.addAttribute("thirdPartyTransactionControlList", thirdPartyTransactionControlList); model.addAttribute("generalLedgerTransactionControlList", generalLedgerTransactionControlList); model.addAttribute("customerTransactionControlList", customerTransactionControlList); model.addAttribute("mainTabId", Utils.getMessageBundlePropertyValue("mainTab.icga")); model.addAttribute( "subTabId", Utils.getMessageBundlePropertyValue("subTabId.analyzeByControls")); adminService.addNode( Utils.getMessageBundlePropertyValue("landingPage.analyzeByControls"), 2, request); return "common/InternalCtrlGapAnalysisAC"; }
@RequestMapping(value = "/icga/InternalCtrlGapAnalysisAC.html", method = RequestMethod.POST) public String InternalCtrlGapAnalysisACPost(HttpServletRequest request, Model model) { logger.debug(" :: InternalCtrlGapAnalysisAC POSt ::"); String controlIds = ""; List<Control> controlList = adminService.getAllControl(); for (Control control : controlList) { String checkboxStatus = request.getParameter(control.getId() + ""); if (checkboxStatus != null && Constants.CHECK_BOX_ON.equals(checkboxStatus)) { controlIds = controlIds + "," + control.getId(); } } controlIds = Utils.isEmpty(controlIds) ? "" : controlIds.substring(1, controlIds.length()); logger.debug(" ControlIds : " + controlIds); if (Utils.isEmpty(controlIds)) { Utils.setErrorMessage( request, Utils.getMessageBundlePropertyValue("icga.analyzeByControl.noIdisSelect")); return "redirect:./InternalCtrlGapAnalysisAC.html"; } return "redirect:internalCtrlGapAnalysis.html?icga=0&controlIds=" + controlIds; }
/** * control list with applied in no of transaction * * @param request * @return */ @RequestMapping(value = "/icga/getJASONforExistingControlList.html", method = RequestMethod.POST) public @ResponseBody JasonBean getAssignmentList(HttpServletRequest request) { logger.debug("Control List Controller "); String page = request.getParameter("page") != null ? request.getParameter("page") : "1"; String rp = request.getParameter("rp") != null ? request.getParameter("rp") : "10"; String sortname = request.getParameter("sortname") != null ? request.getParameter("sortname") : "projectName"; String sortorder = request.getParameter("sortorder") != null ? request.getParameter("sortorder") : "desc"; String query = request.getParameter("query") != null ? request.getParameter("query") : "false"; String qtype = request.getParameter("qtype") != null ? request.getParameter("qtype") : "false"; String controlIds = request.getParameter("controlIds") != null ? request.getParameter("controlIds") : "0"; String tableName = request.getParameter("tableName") != null ? request.getParameter("tableName") : ""; String controlIdsListAsString = ""; JasonBean jasonData = new JasonBean(); List dbColumnHeaderList = new ArrayList(); int totalControl = 0; List controlList = new ArrayList(); List<Cell> entry = new ArrayList<Cell>(); List allControlList = new ArrayList<Cell>(); Map<String, Integer> countMap = new TreeMap<String, Integer>(); try { String partSql = !"0".equals(controlIds) ? InternalControlGapAnalysisController.getStringForComparingControls(controlIds) : ""; allControlList = adminJdbcService.getControlIdList(controlIds, partSql); controlIdsListAsString = getCommaseparatedStringFromList(allControlList); String[] controllIdsArray = !"0".equals(controlIds) ? getUsedControlsByControlIds(controlIds, controlIdsListAsString.split(",")) : controlIdsListAsString.split(","); countMap = countStringOccurences(controllIdsArray, adminJdbcService); if (countMap != null && countMap.size() > 0) { logger.debug("AMLOG:: countMap size: " + countMap.size()); jasonData.setPage(Utils.parseInteger(page)); for (String string : countMap.keySet()) { Map map = new HashMap(); Long controlId = !Utils.isEmpty(string) ? Long.parseLong(string) : 0; logger.debug("AMLOG:: controlId: " + controlId); // Control control = new Control(); Cell cell = new Cell(); Control control = controlId > 0 ? (Control) adminService.loadEntityById(controlId, Constants.CONTROL) : new Control(); /*control.setId(controlId); control.setName(controlName);*/ control.setTotalUsed(countMap.get(string)); cell.setCell(control); entry.add(cell); map.put("control_name", control.getName()); map.put("transaction_type", control.getTransactionType()); map.put("total", countMap.get(string)); controlList.add(map); } int totalItem = controlList != null ? controlList.size() : 0; Map mapForHeader = new HashMap(); mapForHeader.put( "name", "control_name"); // key=flexigrid parameter name, value = dbField Name mapForHeader.put("transactionType", "transaction_type"); mapForHeader.put("totalUsed", "total"); dbColumnHeaderList.add(mapForHeader); request.getSession().setAttribute(tableName, dbColumnHeaderList); jasonData.setRows(entry); jasonData.setTotal(totalItem); jasonData.setDbColumnHeader(dbColumnHeaderList); if ("max".equals(rp)) { logger.debug("SMN LOG: custom controlList size=" + controlList.size()); TransactionSearchController.setTotalListSizeAndListInSession( totalItem, controlList, request); } } } catch (Exception ex) { logger.debug("CERROR: Real Time Project exception : " + ex); } return jasonData; }
private List<Control> getControlListByTransactionType(String transactionType) { List<Control> controlList = adminService.getControlListByTransactionType(transactionType); return controlList != null ? controlList : new ArrayList<Control>(); }