User:Shivapatel
From Wikipedia, the free encyclopedia
package com.rts.worker;
import java.util.ArrayList; import java.util.ResourceBundle;
import javax.servlet.ServletOutputStream; import javax.servlet.http.*;
import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileWriter; import java.io.OutputStream; import java.sql.*; import java.util.*; import com.rts.util.*; import com.sun.jndi.ldap.Connection;
public class RTSCrossSellReport extends Abstract {
private QueryInteractor lo_QInteractor = new QueryInteractor(); private HttpSession mo_session = null; private String ms_OpCode = null; private String mo_ReturnPage = ""; private RTSConnection con = new RTSConnection(); private String ms_classId = null; private String action=null; private static String className = "[ RTSCrossSellReport ] "; private String userName = null;
public String handleRequest(HttpServletRequest request,HttpServletResponse response) throws Exception { try { ErrorLogger.info("Entering into handleRequest() method" ); ms_classId = request.getParameter("hidRequestId"); ms_OpCode = request.getParameter("hidOperation"); action=request.getParameter("action") ; ErrorLogger.info("action"+ action ); mo_session = (HttpSession) request.getSession(false); userName = (String) mo_session.getAttribute("USERNAME"); ErrorLogger.info(userName,className,"Entering into handleRequest() method" ); mo_session.removeAttribute("ARRLIST"); String action = null; if(request.getParameter("action")!= null) { action = request.getParameter("action"); ErrorLogger.debug("Value of Action in JAVA is = "+action); mo_session.setAttribute("CAT_ACTION",action); /* Set action for related Jsp pages */ } ErrorLogger.debug(userName,className,"OpCode --> " + ms_OpCode); if (ms_OpCode == null || ms_OpCode.length() == 0) { ErrorLogger.debug(userName,className,"The OpCode is null or not valid"); request.setAttribute("ERRCODE", "ERRM001"); //method id not matched mo_ReturnPage = "ERROR"; } else { if (ms_OpCode.equals("CSMROCROSSSELLREPORTS")) {
mo_ReturnPage = getRoName(request);
} else if(ms_OpCode.equals("DOWNLOADROCSMWISE")) { mo_ReturnPage = downLoadROCSMWiseCrossSellReports(request,response); } else if (ms_OpCode.equals("ROWISESUMMARYOFCROSSSELL")) { mo_ReturnPage = getTLNameforTLummary(request); } else if(ms_OpCode.equals("DOWNLOADTLWISESUMMARY")) { mo_ReturnPage = downLoadTLWiseSummaryCrossSell(request,response); } else if (ms_OpCode.equals("LOCATIONWISESUMMARYOFCROSSSELL")) { mo_ReturnPage = getLocation(request); } else if(ms_OpCode.equals("DOWNLOADLOCATIONWISESUMMARY")) { mo_ReturnPage = downLoadLocationSummaryCrossSell(request,response); } } }catch (Exception e) { e.printStackTrace(); request.setAttribute("ERRCODE", "ERR001"); throw e; } ErrorLogger.info(userName,className,"Exiting from handleRequest() method" ); return mo_ReturnPage; }
// Start downLoad Location Wise data
private String downLoadLocationSummaryCrossSell(HttpServletRequest request, HttpServletResponse response) throws Exception {
ErrorLogger.info("downLoadLocationSummaryCrossSell() method "); String mo_ReturnPage = "DOWNLOAD"; StringBuffer sbQuery = new StringBuffer(); StringBuffer sbDownLoadQuery = new StringBuffer(); String strYears = null; strYears = request.getParameter("cmb_StartYear").toString(); java.sql.Connection lConn = null;
sbQuery.append(" SELECT coalesce(RCS.MONTH_OF_INITIATION,0)as monthss, "); sbQuery.append(" LM.LOOKUP_VALUE as LOCATIONS , coalesce(SUM(RCS.EBV),0.0) AS CROSSSELLREV "); sbQuery.append(" FROM COMMON.REPORT_CROSS_SELL_V1 RCS "); sbQuery.append(" INNER JOIN COMMON.CSMMST_CLIENTMST_MAPPING CCM ON RCS.CLIENT_ID = CCM.CLIENT_ID "); sbQuery.append(" INNER JOIN COMMON.CSM_MST CSM ON CCM.CSM_ID = CSM.CSM_ID "); sbQuery.append(" INNER JOIN COMMON.CSM_MST CSM1 ON CSM1.CSM_ID = CSM.REPORTING_TO "); sbQuery.append(" INNER JOIN COMMON.LOOKUP_MST LM ON LM.LOOKUP_ID = CSM.LOCATION "); sbQuery.append(" where LM.LOOKUP_TYPE = 'LOCATION' " );
if(strYears.toString() !="xx"){ sbQuery.append(" AND RCS.year_of_initiation =").append(strYears).append(""); } sbQuery.append(" GROUP BY RCS.MONTH_OF_INITIATION,LM.LOOKUP_VALUE "); sbQuery.append(" ORDER BY RCS.MONTH_OF_INITIATION ");
ArrayList lo_arrList = null; lo_arrList = (ArrayList)lo_QInteractor.getArrayList(sbQuery.toString()); PreparedStatement deletePstmt = null; lConn = con.getConnection(); try { deletePstmt = lConn.prepareStatement("delete from REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT"); deletePstmt.executeUpdate();
}
catch(Exception e) { e.printStackTrace(); ErrorLogger.debug ("Error While Deleteing the Rows From the table"); }
sbQuery = null; if(lo_arrList != null && lo_arrList.size() > 1) {
int temp = 0; String strComp = null; String strObj = null; PreparedStatement updatePstmt = null; PreparedStatement allRQInputPstmt = null; String insertQuery = null; StringBuffer sbUpdate = new StringBuffer();
Object lo_obj[] = null; for (int k=1; k < lo_arrList.size();k++) { lo_obj = (Object[]) lo_arrList.get(k);
strObj = lo_obj[0].toString();
ErrorLogger.debug("temp1 is here :"+temp); ErrorLogger.debug("strComp is here :"+strComp); if(temp>0){
if (strComp != null && strObj.equalsIgnoreCase(strComp) ){ ErrorLogger.debug("temp2 is here :"+temp); ErrorLogger.debug("strComp is here :"+strComp);
if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } // End Jan
//Start Feb
if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } //end Feb
//Start Mar if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End Mar
// Start Apr if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End Apr
// Start May if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End May
// Start June if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End June
// Start Jul if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End Jul
// Start Aug if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End Aug
// Start Sep if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End Sep
// Start Oct if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End OCt
// Start Nov if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End Nov
// Start Dec if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")){ sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BANGALORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }
if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BARODA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET BHUBNESHWAR ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET CHENNAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET COIMBTORE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET DEHLI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET HYDERABAD ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET KOLKATTA ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET MUMBAI ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { sbUpdate.append("UPDATE REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT SET PUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE MONTHS=").append(lo_obj[0].toString()).append(""); }// End Dec
ErrorLogger.debug ("sbUpdate query is :"+sbUpdate.toString());
updatePstmt = lConn.prepareStatement(sbUpdate.toString()); updatePstmt.executeUpdate();
sbUpdate = null;
temp = 0;
} else { ErrorLogger.debug("temp3 is here :"+temp); ErrorLogger.debug("Else Part of Compare"); //temp++; strComp = lo_obj[0].toString(); ErrorLogger.debug("temp4 is here :"+temp); ErrorLogger.debug("strComp1 is here :"+strComp);
if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DEHLI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For January
// Start For February if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For February
// Start For march if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DEHLI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For March
// Start For April if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For April
// Start For May if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For May
// Start For JUNE if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For JUNE
// Start For JULY if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For JULY
// Start For Ausgust if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For August // Start For Sep if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For Sep
// Start For Oct if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For Oct
// Start For Nov if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For Nov
// Start For Dec if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For January
ErrorLogger.debug ("insertQuery query is :"+insertQuery); allRQInputPstmt = lConn.prepareStatement(insertQuery); allRQInputPstmt.setObject(1,lo_obj[0].toString()); allRQInputPstmt.setObject(2,lo_obj[2].toString()); allRQInputPstmt.executeUpdate();
insertQuery = null; }
} else { temp++; strComp = lo_obj[0].toString(); ErrorLogger.debug("Firts Time temp is :"+temp); ErrorLogger.debug("First Time strComp is :"+strComp); // Start For January if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("1") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For January
// Start For February
if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("2") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For February
// Start For march if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("3") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For March
// Start For April if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("4") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For April
// Start For May if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("5") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For May
// Start For JUNE if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("6") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For JUNE
// Start For JULY if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("7") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For JULY
// Start For Ausgust if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("8") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For August // Start For Sep if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("9") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For Sep
// Start For Oct if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("10") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For Oct
// Start For Nov if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("11") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For Nov
// Start For Dec if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("BANGALORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BANGALORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("BARODA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BARODA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("BHUBNESHWAR")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,BHUBNESHWAR) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("CHENNAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,CHENNAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("COIMBTORE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,COIMBTORE) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("DELHI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,DELHI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("HYDERABAD")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,HYDERABAD) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("KOLKATTA")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,KOLKATTA) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("MUMBAI")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,MUMBAI) values(?,?)"; } if(lo_obj[0].toString().equalsIgnoreCase("12") && lo_obj[1].toString().equalsIgnoreCase("PUNE")) { insertQuery = " insert into REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT(MONTHS,PUNE) values(?,?)"; } // End For January
ErrorLogger.debug ("insertQuery query is :"+insertQuery); allRQInputPstmt = lConn.prepareStatement(insertQuery); allRQInputPstmt.setObject(1,lo_obj[0].toString()); allRQInputPstmt.setObject(2,lo_obj[2].toString()); allRQInputPstmt.executeUpdate();
insertQuery = null;
}//end temp } //end For Loop
} //end if loop
sbDownLoadQuery.append(" select MONTHS,BANGALORE,BARODA,BHUBNESHWAR,CHENNAI, "); sbDownLoadQuery.append(" COIMBTORE,DEHLI,HYDERABAD,KOLKATTA,MUMBAI,PUNE "); sbDownLoadQuery.append(" from REPORT.OUTPUT_LOCATION_WISECROSSSELL_REPORT "); ArrayList download_arrList = null; download_arrList = (ArrayList)lo_QInteractor.getArrayList(sbDownLoadQuery.toString());
if(download_arrList.size()<2){ request.setAttribute("SEARCHRESULT","SEARCHRESULT"); mo_ReturnPage = "LOCATIONWISESUMMARYOFMONTHLYCROSSSELL"; }else{
ResourceBundle mo_rBundle = ResourceBundle.getBundle("com.rts.properties.RequestMapper"); java.text.SimpleDateFormat sf = new java.text.SimpleDateFormat("yyyyMMMddHH.mm.ss.SSSSSS"); String fileCreateTime = sf.format(new java.util.Date()); ErrorLogger.error("Shiva is here *************** :"+fileCreateTime); String strmin = fileCreateTime.substring(12,14); ErrorLogger.error("Min is here *************** :"+strmin);
String _fileName = null; _fileName = mo_rBundle.getString("FILE_UPLOAD_PATH") +"LocationWiseMonthlySummary"+strmin+".csv"; File serverF = new File(_fileName);
File lo_wrFile = null;
String strmonths = new java.util.Date().toString(); String months = strmonths.substring(4, 7);
try { if (serverF.exists()) { serverF.delete(); } if (! (serverF.exists())) {
lo_wrFile = new File(mo_rBundle.getString("FILE_UPLOAD_PATH") +"LocationWiseMonthlySummary"+strmin+".csv"); BufferedWriter lo_brOut = new BufferedWriter(new FileWriter(lo_wrFile)); Object lo_objs[] = null; if(download_arrList != null && download_arrList.size() > 1) {
lo_brOut.write("\n"); lo_brOut.write(""+",");
lo_brOut.write("Location Wise Summary of Monthly CrossSell"+",");
lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write("Legend-"+","); lo_brOut.write("The amount quoted is in INR :000"+","); lo_brOut.write("\n"); lo_brOut.write(""+","); lo_brOut.write("Years :"+strYears+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write("Data is YTD for the month of :"+months+","); lo_brOut.write("\n"); lo_brOut.write("\n"); lo_brOut.write(""+",");
lo_brOut.write("Months"+","); lo_brOut.write("BANGALORE"+","); lo_brOut.write("BARODA"+","); lo_brOut.write("BHUBNESHWAR"+","); lo_brOut.write("CHENNAI"+","); lo_brOut.write("COIMBTORE"+","); lo_brOut.write("DELHI"+","); lo_brOut.write("HYDERABAD"+","); lo_brOut.write("KOLKATTA"+","); lo_brOut.write("MUMBAI"+","); lo_brOut.write("PUNE"+",");
//lo_brOut.write("Grand Total"+","); lo_brOut.write("\n");
//k is row count for (int k=1; k < download_arrList.size();k++) { lo_objs = (Object[]) download_arrList.get(k); lo_brOut.write(""+",");
for (int x=0; x < 1 ; x++) {
String strmonth = null; if(lo_objs[x].toString().equalsIgnoreCase("1")){ strmonth = "January"+strYears ; } if(lo_objs[x].toString().equalsIgnoreCase("2")){ strmonth = "February" +strYears; } if(lo_objs[x].toString().equalsIgnoreCase("3")){ strmonth = "March"+strYears ; } if(lo_objs[x].toString().equalsIgnoreCase("4")){ strmonth = "April"+strYears ; } if(lo_objs[x].toString().equalsIgnoreCase("5")){ strmonth = "May" +strYears; } if(lo_objs[x].toString().equalsIgnoreCase("6")){ strmonth = "June"+strYears ; } if(lo_objs[x].toString().equalsIgnoreCase("7")){ strmonth = "July"+strYears ; } if(lo_objs[x].toString().equalsIgnoreCase("8")){ strmonth = "August"+strYears ; } if(lo_objs[x].toString().equalsIgnoreCase("9")){ strmonth = "September" +strYears; } if(lo_objs[x].toString().equalsIgnoreCase("10")){ strmonth = "October" +strYears; } if(lo_objs[x].toString().equalsIgnoreCase("11")){ strmonth = "November"+strYears ; } if(lo_objs[x].toString().equalsIgnoreCase("12")){ strmonth = "December"+strYears ; }
lo_brOut.write(strmonth+","); ErrorLogger.debug("Shiva is here :" + lo_objs[0].toString()); }
for (int x=1; x < lo_objs.length ; x++) { lo_brOut.write(lo_objs[x]+",");
ErrorLogger.debug("Object is [0]:" + lo_objs[0].toString()); }
lo_brOut.write("\n");
}
} lo_brOut.close(); } } catch(Exception e) {
ErrorLogger.error(" Error is " + e.toString()); } response.setContentType("application/octet-stream"); response.setHeader("Content-Disposition", "attachment; filename=" + serverF.getName() + ";");
ServletOutputStream outStream = null; FileInputStream stream = null; BufferedInputStream bis = null; BufferedOutputStream bos = null;
try { outStream = response.getOutputStream(); stream = new FileInputStream(serverF); bis = new BufferedInputStream(stream); bos = new BufferedOutputStream(outStream); byte[] buff = new byte[2048]; int bytesRead; try { while ( -1 != (bytesRead = bis.read(buff, 0, buff.length))) { bos.write(buff, 0, bytesRead); } } catch (Exception e) { ErrorLogger.error("Exception in downLoadFile method " + e.toString()); } } catch (Exception e) { e.printStackTrace(); ErrorLogger.error("Exception " + e.toString()); } finally { if (bis != null) bis.close(); if (bos != null) bos.close(); if (stream != null) stream.close(); if(outStream != null){ outStream.close(); }
lo_wrFile.delete(); } }
return mo_ReturnPage;
}// End DownLoad Method
private String downLoadTLWiseSummaryCrossSell(HttpServletRequest request, HttpServletResponse response) throws Exception { ErrorLogger.info("downLoadTLWiseSummaryCrossSell() method "); String mo_ReturnPage = "DOWNLOAD"; StringBuffer sbQuery = new StringBuffer(); StringBuffer sbDownLoadQuery = new StringBuffer(); String strYears = null; strYears = request.getParameter("cmb_StartYear").toString(); java.sql.Connection lConn = null;
sbQuery.append(" SELECT CSM1.CSM_NAME AS TEAMLEADER ,CSM.CSM_NAME AS CSMNAME, "); sbQuery.append(" coalesce(SUM(RCS.EBV),0.0) AS CROSSSELLREV, coalesce(RCS.MONTH_OF_INITIATION,0)as monthss "); sbQuery.append(" FROM COMMON.REPORT_CROSS_SELL_V1 RCS "); sbQuery.append(" INNER JOIN COMMON.CSMMST_CLIENTMST_MAPPING CCM ON RCS.CLIENT_ID = CCM.CLIENT_ID "); sbQuery.append(" INNER JOIN COMMON.CSM_MST CSM ON CCM.CSM_ID = CSM.CSM_ID "); sbQuery.append(" INNER JOIN COMMON.CSM_MST CSM1 ON CSM1.CSM_ID = CSM.REPORTING_TO ");
if(strYears.toString() !="xx" ){ sbQuery.append(" where RCS.year_of_initiation =").append(strYears).append(""); }
sbQuery.append(" GROUP BY CSM1.CSM_NAME,CSM.CSM_NAME,RCS.MONTH_OF_INITIATION ORDER BY CSM1.CSM_NAME ");
ArrayList lo_arrList = null; lo_arrList = (ArrayList)lo_QInteractor.getArrayList(sbQuery.toString()); PreparedStatement deletePstmt = null; lConn = con.getConnection(); try { deletePstmt = lConn.prepareStatement("delete from REPORT.OUTPUT_TLWISECROSSSELL_REPORT"); deletePstmt.executeUpdate();
}
catch(Exception e){ e.printStackTrace(); ErrorLogger.debug ("Error While Deleteing the Rows From the table"); }
sbQuery = null; if(lo_arrList != null && lo_arrList.size() > 1) {
int temp = 0; String strComp = null; String strObj = null; PreparedStatement updatePstmt = null; PreparedStatement allRQInputPstmt = null; String insertQuery = null; StringBuffer sbUpdate = new StringBuffer();
Object lo_obj[] = null; for (int k=1; k < lo_arrList.size();k++) { lo_obj = (Object[]) lo_arrList.get(k);
strObj = lo_obj[0].toString()+lo_obj[1].toString();
ErrorLogger.debug("temp1 is here :"+temp); ErrorLogger.debug("strComp is here :"+strComp); if(temp>0){
if (strComp != null && strObj.equalsIgnoreCase(strComp) ){ ErrorLogger.debug("temp2 is here :"+temp); ErrorLogger.debug("strComp is here :"+strComp);
if(lo_obj[3].toString().equalsIgnoreCase("1")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET JANUARY ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("2")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET FEBRUARY ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("3")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET MARCH ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("4")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET APRIL ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("5")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET MAY ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("6")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET JUNE ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("7")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET JULY ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("8")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET AUGUST ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("9")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET SEPTEMBER ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("10")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET OCTOBER ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("11")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET NOVEMBER ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
if(lo_obj[3].toString().equalsIgnoreCase("12")){ sbUpdate.append("UPDATE REPORT.OUTPUT_TLWISECROSSSELL_REPORT SET DECEMBER ="); sbUpdate.append(lo_obj[2].toString()); sbUpdate.append(" WHERE TLNAME='").append(lo_obj[0].toString()).append("' AND CSM_NAME = '"); sbUpdate.append(lo_obj[1].toString()).append("'"); }
ErrorLogger.debug ("sbUpdate query is :"+sbUpdate.toString());
updatePstmt = lConn.prepareStatement(sbUpdate.toString()); updatePstmt.executeUpdate();
sbUpdate = null;
temp = 0; } else { ErrorLogger.debug("temp3 is here :"+temp); ErrorLogger.debug("Else Part of Compare"); //temp++; strComp = lo_obj[0].toString()+lo_obj[1].toString(); ErrorLogger.debug("temp4 is here :"+temp); ErrorLogger.debug("strComp1 is here :"+strComp);
if(lo_obj[3].toString().equalsIgnoreCase("1")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,JANUARY) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("2")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,FEBRUARY) values(?,?,?)";
} if(lo_obj[3].toString().equalsIgnoreCase("3")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,MARCH) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("4")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,APRIL) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("5")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,MAY) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("6")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,JUNE) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("7")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,JULY) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("8")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,AUGUST) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("9")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,SEPTEMBER) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("10")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,OCTOBER) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("11")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,NOVEMBER) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("12")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,DECEMBER) values(?,?,?)"; }
ErrorLogger.debug ("insertQuery query is :"+insertQuery); allRQInputPstmt = lConn.prepareStatement(insertQuery); allRQInputPstmt.setObject(1,lo_obj[0].toString()); allRQInputPstmt.setObject(2,lo_obj[1].toString()); allRQInputPstmt.setObject(3,lo_obj[2].toString()); allRQInputPstmt.executeUpdate();
insertQuery = null; }
} else { temp++; strComp = lo_obj[0].toString()+lo_obj[1].toString(); ErrorLogger.debug("temp4 is here :"+temp); ErrorLogger.debug("strComp1 is here :"+strComp);
if(lo_obj[3].toString().equalsIgnoreCase("1")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,JANUARY) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("2")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,FEBRUARY) values(?,?,?)";
} if(lo_obj[3].toString().equalsIgnoreCase("3")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,MARCH) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("4")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,APRIL) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("5")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,MAY) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("6")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,JUNE) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("7")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,JULY) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("8")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,AUGUST) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("9")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,SEPTEMBER) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("10")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,OCTOBER) values(?,?,?)"; }
if(lo_obj[3].toString().equalsIgnoreCase("11")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,NOVEMBER) values(?,?,?)"; } if(lo_obj[3].toString().equalsIgnoreCase("12")) { insertQuery = " insert into REPORT.OUTPUT_TLWISECROSSSELL_REPORT(TLNAME,CSM_NAME,DECEMBER) values(?,?,?)"; }
ErrorLogger.debug ("insertQuery query is :"+insertQuery); allRQInputPstmt = lConn.prepareStatement(insertQuery); allRQInputPstmt.setObject(1,lo_obj[0].toString()); allRQInputPstmt.setObject(2,lo_obj[1].toString()); allRQInputPstmt.setObject(3,lo_obj[2].toString()); allRQInputPstmt.executeUpdate();
insertQuery = null;
}//end temp } //end For Loop
} //end if loop
sbDownLoadQuery.append(" select TLNAME,CSM_NAME,JANUARY,FEBRUARY,MARCH,APRIL, "); sbDownLoadQuery.append(" MAY,JUNE,JULY,AUGUST,SEPTEMBER,OCTOBER,NOVEMBER, "); sbDownLoadQuery.append(" DECEMBER from REPORT.OUTPUT_TLWISECROSSSELL_REPORT order by TLNAME"); ArrayList download_arrList = null; download_arrList = (ArrayList)lo_QInteractor.getArrayList(sbDownLoadQuery.toString());
if(download_arrList.size()<2){ request.setAttribute("SEARCHRESULT","SEARCHRESULT"); mo_ReturnPage = "ROWISESUMMARYOFMONTHLYCROSSSELL"; }else{
ResourceBundle mo_rBundle = ResourceBundle.getBundle("com.rts.properties.RequestMapper"); java.text.SimpleDateFormat sf = new java.text.SimpleDateFormat("yyyyMMMddHH.mm.ss.SSSSSS"); String fileCreateTime = sf.format(new java.util.Date()); ErrorLogger.error("Shiva is here *************** :"+fileCreateTime); String strmin = fileCreateTime.substring(12,14); ErrorLogger.error("Min is here *************** :"+strmin);
String _fileName = null; _fileName = mo_rBundle.getString("FILE_UPLOAD_PATH") +"TL_Wise_SummaryofMonthlyCrossSell"+strmin+".csv"; File serverF = new File(_fileName);
File lo_wrFile = null;
String strmonths = new java.util.Date().toString(); String months = strmonths.substring(4, 7);
try { if (serverF.exists()) { serverF.delete(); } if (! (serverF.exists())) {
lo_wrFile = new File(mo_rBundle.getString("FILE_UPLOAD_PATH") +"TL_Wise_SummaryofMonthlyCrossSell"+strmin+".csv"); BufferedWriter lo_brOut = new BufferedWriter(new FileWriter(lo_wrFile)); Object lo_objs[] = null; if(download_arrList != null && download_arrList.size() > 1) {
lo_brOut.write("\n"); lo_brOut.write(""+",");
lo_brOut.write("TL Wise Summary of Monthly Cross Sell"+",");
lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write("Legend-"+","); lo_brOut.write("The amount quoted is in INR :000"+","); lo_brOut.write("\n"); lo_brOut.write(""+","); lo_brOut.write("Years :"+strYears+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write("Data is YTD for the month of :"+months+","); lo_brOut.write("\n"); lo_brOut.write("\n"); lo_brOut.write(""+",");
lo_brOut.write("Team Leader"+","); lo_brOut.write("CSM Name"+","); lo_brOut.write("Jan"+strYears+","); lo_brOut.write("Feb-"+strYears+","); lo_brOut.write("Mar-"+strYears+","); lo_brOut.write("Apr-"+strYears+","); lo_brOut.write("May-"+strYears+","); lo_brOut.write("Jun-"+strYears+","); lo_brOut.write("Jul-"+strYears+","); lo_brOut.write("Aug-"+strYears+","); lo_brOut.write("Sep-"+strYears+","); lo_brOut.write("Oct-"+strYears+","); lo_brOut.write("Nov-"+strYears+","); lo_brOut.write("Dec-"+strYears+","); lo_brOut.write("Grand Total"+","); lo_brOut.write("\n");
//k is row count double total = 0.0; Object comp_obj[] = null; String strcomp = null; String strObj = null; int temp = 0; for (int k=1; k < download_arrList.size();k++) { lo_objs = (Object[]) download_arrList.get(k); lo_brOut.write(""+",");
////////////// Test comp_obj = (Object[]) download_arrList.get(k); strObj = lo_objs[0].toString(); //strcomp = comp_obj[0].toString(); ErrorLogger.debug("Hello :" + lo_objs[0].toString()); ErrorLogger.debug("Hello1 :" + comp_obj[0].toString()); ErrorLogger.debug("strObj :" + strObj); ErrorLogger.debug("strcomp :" + strcomp); if(temp>0){ if(strcomp != null && strObj.equalsIgnoreCase(strcomp)){ ErrorLogger.debug("if strcomp ------"); //strcomp = null; temp++; }else{
strcomp = comp_obj[0].toString(); ErrorLogger.debug("else strcomp ------"+strcomp);
} } else { ErrorLogger.debug("else temp before ------"+temp); temp++; ErrorLogger.debug("else temp After ------"+temp); strcomp = comp_obj[0].toString(); ErrorLogger.debug("else temp++ ------");
} //temp
/////////////// End Test
for (int x=0; x < lo_objs.length ; x++) { lo_brOut.write(lo_objs[x]+","); // ErrorLogger.debug("Object is [x]:" + lo_objs[x].toString());. ErrorLogger.debug("Object is [0]:" + lo_objs[0].toString()); } //Grand Totol for (int x=2; x < lo_objs.length ; x++) { total = total + Double.parseDouble(lo_objs[x].toString()); ErrorLogger.debug("total object is :" + total); } lo_brOut.write(total+","); total =0.0;
lo_brOut.write("\n");
}
} lo_brOut.close(); } } catch(Exception e) {
ErrorLogger.error(" Error is " + e.toString()); } response.setContentType("application/octet-stream"); response.setHeader("Content-Disposition", "attachment; filename=" + serverF.getName() + ";");
ServletOutputStream outStream = null; FileInputStream stream = null; BufferedInputStream bis = null; BufferedOutputStream bos = null;
try { outStream = response.getOutputStream(); stream = new FileInputStream(serverF); bis = new BufferedInputStream(stream); bos = new BufferedOutputStream(outStream); byte[] buff = new byte[2048]; int bytesRead; try { while ( -1 != (bytesRead = bis.read(buff, 0, buff.length))) { bos.write(buff, 0, bytesRead); } } catch (Exception e) { ErrorLogger.error("Exception in downLoadFile method " + e.toString()); } } catch (Exception e) { e.printStackTrace(); ErrorLogger.error("Exception " + e.toString()); } finally { if (bis != null) bis.close(); if (bos != null) bos.close(); if (stream != null) stream.close(); if(outStream != null){ outStream.close(); }
lo_wrFile.delete(); } }
return mo_ReturnPage; }// End DownLoad Method
private String getLocation(HttpServletRequest request) throws Exception { String mo_ReturnPage = null; mo_ReturnPage = "LOCATIONWISESUMMARYOFMONTHLYCROSSSELL"; java.sql.Connection lo_con = null; ArrayList al_new = null; String strQ = "select distinct CSM1.CSM_NAME,CSM1.CSM_ID from COMMON.CSM_MST CSM1 ,COMMON.CSM_MST CSM where CSM1.CSM_ID = CSM.REPORTING_TO" ; try{ lo_con = con.getConnection(); al_new = (ArrayList) lo_QInteractor.getArrayList(lo_con,strQ,null); mo_session.setAttribute("LOCATIONS" ,al_new);
}catch(Exception e){ e.printStackTrace(); }
finally{ if(lo_con!=null){ try{ lo_con.close(); }catch(Exception e){ e.printStackTrace(); } } } return mo_ReturnPage;
}
/*private String downLoadTLWiseSummaryCrossSell(HttpServletRequest request, HttpServletResponse response) throws Exception { ErrorLogger.info("downLoadTLWiseSummaryCrossSell() method "); String mo_ReturnPage = "DOWNLOAD"; StringBuffer downLoadQuery = new StringBuffer(); StringBuffer sbCompareQ = new StringBuffer(); String strYears = null; strYears = request.getParameter("cmb_StartYear").toString();
sbCompareQ.append(" SELECT CSM1.CSM_NAME AS TEAMLEADER ,CSM.CSM_NAME AS CSMNAME, "); sbCompareQ.append(" coalesce(SUM(RCS.EBV),0.0) AS CROSSSELLREV, coalesce(RCS.MONTH_OF_INITIATION,0)as monthss "); sbCompareQ.append(" FROM COMMON.REPORT_CROSS_SELL_V1 RCS "); sbCompareQ.append(" INNER JOIN COMMON.CSMMST_CLIENTMST_MAPPING CCM ON RCS.CLIENT_ID = CCM.CLIENT_ID "); sbCompareQ.append(" INNER JOIN COMMON.CSM_MST CSM ON CCM.CSM_ID = CSM.CSM_ID "); sbCompareQ.append(" INNER JOIN COMMON.CSM_MST CSM1 ON CSM1.CSM_ID = CSM.REPORTING_TO ");
if(strYears.toString() !="xx" ){ sbCompareQ.append(" where RCS.year_of_initiation =").append(strYears).append(""); }
sbCompareQ.append(" GROUP BY CSM1.CSM_NAME,CSM.CSM_NAME,RCS.MONTH_OF_INITIATION ORDER BY CSM1.CSM_NAME ");
downLoadQuery.append(" SELECT CSM1.CSM_NAME AS TEAMLEADER ,CSM.CSM_NAME AS CSMNAME, "); downLoadQuery.append(" coalesce(SUM(RCS.EBV),0.0) AS CROSSSELLREV, coalesce(RCS.MONTH_OF_INITIATION,0)as monthss "); downLoadQuery.append(" FROM COMMON.REPORT_CROSS_SELL_V1 RCS "); downLoadQuery.append(" INNER JOIN COMMON.CSMMST_CLIENTMST_MAPPING CCM ON RCS.CLIENT_ID = CCM.CLIENT_ID "); downLoadQuery.append(" INNER JOIN COMMON.CSM_MST CSM ON CCM.CSM_ID = CSM.CSM_ID "); downLoadQuery.append(" INNER JOIN COMMON.CSM_MST CSM1 ON CSM1.CSM_ID = CSM.REPORTING_TO ");
if(strYears.toString() !="xx" ){ downLoadQuery.append(" where RCS.year_of_initiation =").append(strYears).append(""); }
downLoadQuery.append(" GROUP BY CSM1.CSM_NAME,CSM.CSM_NAME,RCS.MONTH_OF_INITIATION ORDER BY CSM1.CSM_NAME ");
ArrayList lo_arrList = null; ArrayList comparrList = null;
lo_arrList = (ArrayList)lo_QInteractor.getArrayList(downLoadQuery.toString()); comparrList = (ArrayList)lo_QInteractor.getArrayList(sbCompareQ.toString()); downLoadQuery = null; sbCompareQ = null; if(lo_arrList.size()<2){ request.setAttribute("SEARCHRESULT","SEARCHRESULT"); mo_ReturnPage = "ROWISESUMMARYOFMONTHLYCROSSSELL"; }else{
ResourceBundle mo_rBundle = ResourceBundle.getBundle("com.rts.properties.RequestMapper"); java.text.SimpleDateFormat sf = new java.text.SimpleDateFormat("yyyyMMMddHH.mm.ss.SSSSSS"); String fileCreateTime = sf.format(new java.util.Date()); ErrorLogger.error("Shiva is here *************** :"+fileCreateTime); String strmin = fileCreateTime.substring(12,14); ErrorLogger.error("Min is here *************** :"+strmin);
String _fileName = null; _fileName = mo_rBundle.getString("FILE_UPLOAD_PATH") +"TL_Wise_SummaryofMonthlyCrossSell"+strmin+".csv"; File serverF = new File(_fileName);
Object lo_obj[] = null; Object com_obj[] = null; File lo_wrFile = null;
String strmonths = new java.util.Date().toString(); String months = strmonths.substring(4, 7);
try { if (serverF.exists()) { serverF.delete(); } if (! (serverF.exists())) {
lo_wrFile = new File(mo_rBundle.getString("FILE_UPLOAD_PATH") +"TL_Wise_SummaryofMonthlyCrossSell"+strmin+".csv"); BufferedWriter lo_brOut = new BufferedWriter(new FileWriter(lo_wrFile)); if(lo_arrList != null && lo_arrList.size() > 1) {
lo_brOut.write("\n"); lo_brOut.write(""+",");
lo_brOut.write("TL Wise Summary of Monthly Cross Sell"+",");
lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write("Legend-"+","); lo_brOut.write("The amount quoted is in INR :000"+","); lo_brOut.write("\n"); lo_brOut.write(""+","); lo_brOut.write("Years :"+strYears+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write("Data is YTD for the month of :"+months+","); lo_brOut.write("\n"); lo_brOut.write("\n"); lo_brOut.write(""+",");
lo_brOut.write("Team Leader"+","); lo_brOut.write("CSM Name"+","); lo_brOut.write("Jan"+strYears+","); lo_brOut.write("Feb-"+strYears+","); lo_brOut.write("Mar-"+strYears+","); lo_brOut.write("Apr-"+strYears+","); lo_brOut.write("May-"+strYears+","); lo_brOut.write("Jun-"+strYears+","); lo_brOut.write("Jul-"+strYears+","); lo_brOut.write("Aug-"+strYears+","); lo_brOut.write("Sep-"+strYears+","); lo_brOut.write("Oct-"+strYears+","); lo_brOut.write("Nov-"+strYears+","); lo_brOut.write("Dec-"+strYears+","); lo_brOut.write("\n");
int tempflags = 0;
for (int k=1; k < lo_arrList.size();k++) {
lo_obj = (Object[]) lo_arrList.get(k); //for (int m=1; m < comparrList.size();m++) //{ com_obj = (Object[]) comparrList.get(1);
lo_brOut.write(""+","); ErrorLogger.debug("First lo_obj[0] is here :"+lo_obj[0]); ErrorLogger.debug("First lo_obj[1] is here :"+lo_obj[1]); ErrorLogger.debug("Temp com_obj[0] is here :"+com_obj[0]); ErrorLogger.debug("Temp com_obj[1] is here :"+com_obj[1]);
for (int x=0; x < 2 ; x++) { if(lo_obj[0].toString().equalsIgnoreCase(com_obj[0].toString()) && lo_obj[1].toString().equalsIgnoreCase(com_obj[1].toString())){ lo_obj = (Object[]) lo_arrList.get(k); lo_brOut.write(lo_obj[x]+","); tempflags++; ErrorLogger.debug("I am here "); }else{ lo_obj = (Object[]) lo_arrList.get(k); lo_brOut.write(lo_obj[x]+","); }
}
for (int x=2; x < 3 ; x++) { lo_obj = (Object[]) lo_arrList.get(k); com_obj = (Object[]) lo_arrList.get(k);
if(lo_obj[3].toString().equalsIgnoreCase("1")){ lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); } if(lo_obj[3].toString().equalsIgnoreCase("2")){ lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); } if(lo_obj[3].toString().equalsIgnoreCase("3")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); } if(lo_obj[3].toString().equalsIgnoreCase("4")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); } if(lo_obj[3].toString().equalsIgnoreCase("5")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); } if(lo_obj[3].toString().equalsIgnoreCase("6")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); } if(lo_obj[3].toString().equalsIgnoreCase("7")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); } if(lo_obj[3].toString().equalsIgnoreCase("8")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); }
if(lo_obj[3].toString().equalsIgnoreCase("9")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); }
if(lo_obj[3].toString().equalsIgnoreCase("10")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); }
if(lo_obj[3].toString().equalsIgnoreCase("11")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); lo_brOut.write("-"+","); }
if(lo_obj[3].toString().equalsIgnoreCase("12")){ lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write("-"+","); lo_brOut.write(lo_obj[x]+","); }
}
lo_brOut.write("\n"); }
} lo_brOut.close(); } } catch(Exception e) {
ErrorLogger.error(" Error is " + e.toString()); } response.setContentType("application/octet-stream"); response.setHeader("Content-Disposition", "attachment; filename=" + serverF.getName() + ";");
ServletOutputStream outStream = null; FileInputStream stream = null; BufferedInputStream bis = null; BufferedOutputStream bos = null;
try { outStream = response.getOutputStream(); stream = new FileInputStream(serverF); bis = new BufferedInputStream(stream); bos = new BufferedOutputStream(outStream); byte[] buff = new byte[2048]; int bytesRead; try { while ( -1 != (bytesRead = bis.read(buff, 0, buff.length))) { bos.write(buff, 0, bytesRead); } } catch (Exception e) { ErrorLogger.error("Exception in downLoadFile method " + e.toString()); } } catch (Exception e) { e.printStackTrace(); ErrorLogger.error("Exception " + e.toString()); } finally { if (bis != null) bis.close(); if (bos != null) bos.close(); if (stream != null) stream.close(); if(outStream != null){ outStream.close(); }
lo_wrFile.delete(); } }
return mo_ReturnPage; }// End DownLoad Method */
private String getTLNameforTLummary(HttpServletRequest request) throws Exception
{ String mo_ReturnPage = null; mo_ReturnPage = "ROWISESUMMARYOFMONTHLYCROSSSELL"; java.sql.Connection lo_con = null; ArrayList al_new = null; String strQ = "select distinct CSM1.CSM_NAME,CSM1.CSM_ID from COMMON.CSM_MST CSM1 ,COMMON.CSM_MST CSM where CSM1.CSM_ID = CSM.REPORTING_TO" ;
try{
lo_con = con.getConnection(); al_new = (ArrayList) lo_QInteractor.getArrayList(lo_con,strQ,null); mo_session.setAttribute("RONAMES" ,al_new);
}catch(Exception e){ e.printStackTrace(); }
finally{ if(lo_con!=null){ try{ lo_con.close(); }catch(Exception e){ e.printStackTrace(); } } } return mo_ReturnPage;
}
// Start DownLoad Method private String downLoadROCSMWiseCrossSellReports(HttpServletRequest request, HttpServletResponse response) throws Exception { ErrorLogger.info("downLoadROCSMWiseCrossSellReports() method "); String mo_ReturnPage = "DOWNLOAD"; StringBuffer downLoadQuery = new StringBuffer(); String roName = null; String strAll = null; String strMonths = null; String strYear = null; roName = request.getParameter("cmb_RoName").toString();
strMonths = request.getParameter("cmb_Month").toString(); strYear = request.getParameter("cmb_Year").toString(); ErrorLogger.error("cmb_Year :"+strYear); ErrorLogger.error("strMonths :"+strMonths);
if(roName!= null && roName.equalsIgnoreCase("ALL")){ strAll = "ALL"; }
downLoadQuery.append(" SELECT CSM1.CSM_NAME AS TEAMLEADER ,CSM.CSM_NAME AS CSMNAME, "); downLoadQuery.append(" coalesce(SUM(RCS.EBV),0.0) AS CROSSSELLREV,coalesce(RCS.MONTH_OF_INITIATION,0), "); downLoadQuery.append(" LM3.LOOKUP_VALUE AS LOCATION,coalesce(RCS.YEAR_OF_INITIATION,0) FROM COMMON.CSM_MST CSM "); downLoadQuery.append(" INNER JOIN COMMON.CSMMST_CLIENTMST_MAPPING CCM ON CCM.CSM_ID = CSM.CSM_ID "); downLoadQuery.append(" INNER JOIN COMMON.LOOKUP_MST LM3 ON LM3.LOOKUP_ID = CSM.LOCATION "); downLoadQuery.append(" INNER JOIN COMMON.CSM_MST CSM1 ON CSM1.CSM_ID = CSM.REPORTING_TO "); downLoadQuery.append(" INNER JOIN COMMON.REPORT_CROSS_SELL_V1 RCS ON CCM.CLIENT_ID = RCS.CLIENT_ID "); if(strAll != null && strAll.equalsIgnoreCase("ALL")){ downLoadQuery.append(" "); } else { downLoadQuery.append(" where CSM1.CSM_NAME = '").append(roName).append("'"); }
if(!strYear.equalsIgnoreCase("XX")){ downLoadQuery.append(" and RCS.YEAR_OF_INITIATION = ").append(strYear).append(""); }
if(!strMonths.equalsIgnoreCase("XX")){ downLoadQuery.append(" and RCS.MONTH_OF_INITIATION = ").append(strMonths).append(""); }
downLoadQuery.append(" GROUP BY LM3.LOOKUP_VALUE,CSM1.CSM_NAME,CSM.CSM_NAME,RCS.MONTH_OF_INITIATION,YEAR_OF_INITIATION "); downLoadQuery.append(" ORDER BY CSM1.CSM_NAME ");
ArrayList lo_arrList = null;
lo_arrList = (ArrayList)lo_QInteractor.getArrayList(downLoadQuery.toString()); downLoadQuery = null; if(lo_arrList.size()<2){ request.setAttribute("SEARCHRESULT","SEARCHRESULT"); mo_ReturnPage = "CSMWISEROWISECROSSSELLREPORT"; }else{
ResourceBundle mo_rBundle = ResourceBundle.getBundle("com.rts.properties.RequestMapper"); java.text.SimpleDateFormat sf = new java.text.SimpleDateFormat("yyyyMMMddHH.mm.ss.SSSSSS"); String fileCreateTime = sf.format(new java.util.Date()); ErrorLogger.error("Shiva is here *************** :"+fileCreateTime); String strmin = fileCreateTime.substring(12,14); ErrorLogger.error("Min is here *************** :"+strmin);
String _fileName = null; _fileName = mo_rBundle.getString("FILE_UPLOAD_PATH") +"CSM_ROWiseCrossSellReport"+strmin+".csv"; File serverF = new File(_fileName);
Object lo_obj[] = null; File lo_wrFile = null;
String strmonths = new java.util.Date().toString(); String months = strmonths.substring(4, 7);
try { if (serverF.exists()) { serverF.delete(); } if (! (serverF.exists())) {
lo_wrFile = new File(mo_rBundle.getString("FILE_UPLOAD_PATH") +"CSM_ROWiseCrossSellReport"+strmin+".csv"); BufferedWriter lo_brOut = new BufferedWriter(new FileWriter(lo_wrFile)); if(lo_arrList != null && lo_arrList.size() > 1) {
lo_brOut.write("\n"); lo_brOut.write("\n"); lo_brOut.write(""+","); lo_brOut.write("CSM/TL Wise Cross Sell Reports "+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write("Legend-"+","); lo_brOut.write("The amount quoted is in INR :000"+","); lo_brOut.write("\n"); lo_brOut.write(""+",");
if(!strYear.equalsIgnoreCase("XX")){ lo_brOut.write("Year :"+strYear+","); } else{ lo_brOut.write(""+","); }
//lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write(""+","); lo_brOut.write("Data is YTD for the month of :"+months+","); lo_brOut.write("\n");
if(!strMonths.equalsIgnoreCase("XX")){ String ddMonths = null; if(strMonths.equalsIgnoreCase("1")){ ddMonths = "January";} if(strMonths.equalsIgnoreCase("2")){ ddMonths = "February";} if(strMonths.equalsIgnoreCase("3")){ ddMonths = "March";} if(strMonths.equalsIgnoreCase("4")){ ddMonths = "April";} if(strMonths.equalsIgnoreCase("5")){ ddMonths = "May";} if(strMonths.equalsIgnoreCase("6")){ ddMonths = "June";} if(strMonths.equalsIgnoreCase("7")){ ddMonths = "July";} if(strMonths.equalsIgnoreCase("8")){ ddMonths = "August";} if(strMonths.equalsIgnoreCase("9")){ ddMonths = "September";} if(strMonths.equalsIgnoreCase("10")){ ddMonths = "October";} if(strMonths.equalsIgnoreCase("11")){ ddMonths = "November";} if(strMonths.equalsIgnoreCase("12")){ ddMonths = "December";}
lo_brOut.write(""+","); lo_brOut.write("Month :"+ddMonths+","); lo_brOut.write("\n");
}
lo_brOut.write("\n"); lo_brOut.write(""+","); lo_brOut.write("Team Leader"+","); lo_brOut.write("CSM Name"+","); lo_brOut.write("Cross Sell Revenue INR 000"+","); lo_brOut.write("Months"+","); lo_brOut.write("Location"+","); lo_brOut.write("\n");
//k is row count for (int k=1; k < lo_arrList.size();k++) {
lo_obj = (Object[]) lo_arrList.get(k); lo_brOut.write(""+","); ErrorLogger.debug("Year is here :"+lo_obj[5].toString()); for (int x=0; x < lo_obj.length-3 ; x++) { lo_brOut.write(lo_obj[x]+","); }
if(lo_obj[3].toString().equalsIgnoreCase("0")){ lo_brOut.write(""+","); } if(lo_obj[3].toString().equalsIgnoreCase("1")){ lo_brOut.write("January"+lo_obj[5]+","); } if(lo_obj[3].toString().equalsIgnoreCase("2")){ lo_brOut.write("February"+lo_obj[5]+","); } if(lo_obj[3].toString().equalsIgnoreCase("3")){ lo_brOut.write("March"+lo_obj[5]+","); } if(lo_obj[3].toString().equalsIgnoreCase("4")){ lo_brOut.write("April"+lo_obj[5]+","); } if(lo_obj[3].toString().equalsIgnoreCase("5")){ lo_brOut.write("May"+lo_obj[5]+","); } if(lo_obj[3].toString().equalsIgnoreCase("6")){ lo_brOut.write("June"+lo_obj[5]+","); } if(lo_obj[3].toString().equalsIgnoreCase("7")){ lo_brOut.write("July"+lo_obj[5]+","); } if(lo_obj[3].toString().equalsIgnoreCase("8")){ lo_brOut.write("August"+lo_obj[5]+","); } if(lo_obj[3].toString().equalsIgnoreCase("9")){ lo_brOut.write("September"+","); } if(lo_obj[3].toString().equalsIgnoreCase("10")){ lo_brOut.write("October"+","); } if(lo_obj[3].toString().equalsIgnoreCase("11")){ lo_brOut.write("November"+","); } if(lo_obj[3].toString().equalsIgnoreCase("12")){ lo_brOut.write("December"+","); }
for (int x=lo_obj.length-2; x < lo_obj.length-1 ; x++) { lo_brOut.write(lo_obj[x]+","); }
lo_brOut.write("\n"); }
} lo_brOut.close(); } } catch(Exception e) {
ErrorLogger.error(" Error is " + e.toString()); } response.setContentType("application/octet-stream"); response.setHeader("Content-Disposition", "attachment; filename=" + serverF.getName() + ";");
ServletOutputStream outStream = null; FileInputStream stream = null; BufferedInputStream bis = null; BufferedOutputStream bos = null;
try { outStream = response.getOutputStream(); stream = new FileInputStream(serverF); bis = new BufferedInputStream(stream); bos = new BufferedOutputStream(outStream); byte[] buff = new byte[2048]; int bytesRead; try { while ( -1 != (bytesRead = bis.read(buff, 0, buff.length))) { bos.write(buff, 0, bytesRead); } } catch (Exception e) { ErrorLogger.error("Exception in downLoadFile method " + e.toString()); } } catch (Exception e) { e.printStackTrace(); ErrorLogger.error("Exception " + e.toString()); } finally { if (bis != null) bis.close(); if (bos != null) bos.close(); if (stream != null) stream.close(); if(outStream != null){ outStream.close(); }
lo_wrFile.delete(); } }
return mo_ReturnPage; }// End DownLoad Method
private String getRoName(HttpServletRequest request) throws Exception { String mo_ReturnPage = null; mo_ReturnPage = "CSMWISEROWISECROSSSELLREPORT"; java.sql.Connection lo_con = null; ArrayList al_new = null; String strQ = "select distinct CSM1.CSM_NAME,CSM1.CSM_ID from COMMON.CSM_MST CSM1 ,COMMON.CSM_MST CSM where CSM1.CSM_ID = CSM.REPORTING_TO order by CSM1.CSM_NAME" ;
try{
lo_con = con.getConnection(); al_new = (ArrayList) lo_QInteractor.getArrayList(lo_con,strQ,null); mo_session.setAttribute("RONAME" ,al_new);
}catch(Exception e){ e.printStackTrace(); }
finally{ if(lo_con!=null){ try{ lo_con.close(); }catch(Exception e){ e.printStackTrace(); } } } return mo_ReturnPage;
}
}