Restructured_function_size

public Map getReportTableData(final Map targetTableViewMapObj,final List targetTableList,final String tableName,final String filteredSkus, Map scoreCardRollUpSkuMapObj, final List actualWeeksList,final List forecastWeeksList,final String actualWeeksBuffer,final String weeksForMAxWeekBuffer,final String allWeeksBuffer, final String forecastweeksBuffer,final Integer planningCycleId,final String nextFilterVariable,final String selectedTypeValue,final String business, final String whereClauseStr,final Integer week,final Integer year,final Integer range,final Integer firstIndex,final Integer switchForTotalSelectedTypeValues, final String btbValue,final String targetValue,final String selectedPeriod,final Map targetTablecolorRangeMapObj){ try{ logger.debug("Entered into getReportTableData"); Object object = hibernateTemplate.execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException, SQLException { Properties properties = getInputProperties(PropertiesUtil); try { List percentageOfTargetsData= new ArrayList(); String businessTypeCriteria= ""; String actualsQuery = null; String forecastQuery = null; String commonFilters = null; String timePeriod = null; List actualsList = null; List forecastList = null; List BTBList = null; List percentageOfTargetList = null; if(week!=null && year!=null){ CheckForProductEndOfLife(); } if(!ApplicationUtil.isEmptyOrNull(business)){ businessTypeCriteria = constructBusinessTypeCriterias(); } commonFilters = constructCommonFilterCondition(selectedTypeValue,productIdColumn,selectedTypeValue,orderWeek,weeksForMAxWeekBuffer,businessColumn,nextFilterVariable); timePeriod = getTimePeriodInformation(selectedPeriod); actualsQuery = getActualsQuery(); if(!ApplicationUtil.isEmptyOrNull(filteredSkus)){ if(tableName.equalsIgnoreCase("ForecastingUnits")){ forecastQuery = forecastUnitsQuery(commonFilters,timePeriod); } else if (tableName.equalsIgnoreCase("ForecastingASP")){ forecastQuery = forecastASPQuery(commonFilters,timePeriod); } else if (tableName.equalsIgnoreCase("ForecastingRevenue")){ forecastQuery = forecastedRevenueQuery(commonFilters,timePeriod); } else if (tableName.equalsIgnoreCase("ForecastingESC")){ forecastQuery = forecastESCQuery(commonFilters,timePeriod); } else { forecastQuery = forecastProductMarginQuery(commonFilters,timePeriod); } } actualsList = getActualsData(actualsQuery); forecastList = getForecastData(forecastQuery); BTBList = getBTBData(params); percentageOfTargetList = getPercentageOfTargetData(params); targetTableViewMapObj.add("actualsList",actualsList); targetTableViewMapObj.add("forecastList",forecastList); targetTableViewMapObj.add("percentageOfTargetList",percentageOfTargetList); targetTableViewMapObj.add("BTBList",BTBList); } catch (HibernateException he) { throw he; } catch (ApplicationException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } return targetTableViewMapObj; } }); logger.debug("Leaving from getReportTableData"); return (Map) object; }catch (Exception e) { logger.error("Exception Occured :" + e + " at Line no :"+e.getStackTrace()[0].getLineNumber()+" in File: "+e.getStackTrace()[0].getFileName()); throw e; } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.