Commit de677789 authored by nsawalakhe's avatar nsawalakhe

Modify DB connection changes in all ejb and add connection changes in servlet


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@40533 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7a0f3f45
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.utility.EMail; import ibase.utility.EMail;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -32,32 +33,34 @@ import com.lowagie.text.pdf.PdfWriter; ...@@ -32,32 +33,34 @@ import com.lowagie.text.pdf.PdfWriter;
/** /**
* Session Bean implementation class BSRTransferReport * Session Bean implementation class BSRTransferReport
*/ */
@Stateless @Stateless
public class BSRTransferReport extends ValidatorEJB implements BSRTransferReportRemote, BSRTransferReportLocal public class BSRTransferReport extends ValidatorEJB implements BSRTransferReportRemote, BSRTransferReportLocal
{ {
/** /**
* Default constructor. * Default constructor.
*/ */
List<String> listDate = null; List<String> listDate = null;
StringBuffer xmlDataForGeo = null; StringBuffer xmlDataForGeo = null;
StringBuffer xmlDataForUnit = null; StringBuffer xmlDataForUnit = null;
E12GenericUtility e12GenericUtility = new E12GenericUtility();
public BSRTransferReport() throws RemoteException, ITMException public BSRTransferReport() throws RemoteException, ITMException
{ {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
Calendar cal = null; Calendar cal = null;
try try
{ {
System.out.println("in BSRTransferReport"); System.out.println("in BSRTransferReport");
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
cal = Calendar.getInstance(); cal = Calendar.getInstance();
cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE)); cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
cal = Calendar.getInstance(); cal = Calendar.getInstance();
...@@ -149,7 +152,6 @@ public class BSRTransferReport extends ValidatorEJB implements BSRTransferReport ...@@ -149,7 +152,6 @@ public class BSRTransferReport extends ValidatorEJB implements BSRTransferReport
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null, pstmt1; PreparedStatement pstmt = null, pstmt1;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData = null; StringBuffer xmlData = null;
String geoLocation = ""; String geoLocation = "";
String unit = ""; String unit = "";
...@@ -165,20 +167,21 @@ public class BSRTransferReport extends ValidatorEJB implements BSRTransferReport ...@@ -165,20 +167,21 @@ public class BSRTransferReport extends ValidatorEJB implements BSRTransferReport
String[] temptoDate = null; String[] temptoDate = null;
xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>"); xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>");
xmlData.append("<Detail>"); xmlData.append("<Detail>");
int firstDayOfMonth = 0; int firstDayOfMonth = 0;
int lastDayOfMonth = 0; int lastDayOfMonth = 0;
listDate = new ArrayList<String>(); listDate = new ArrayList<String>();
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:20062016 by Nikhil*/
conn = getConnection();
// change on date 11/11/2013 // change on date 11/11/2013
System.out.println("from date from jsp =" + frmDate + "To Date from jsp==" + toDate); System.out.println("from date from jsp =" + frmDate + "To Date from jsp==" + toDate);
tempfrmDate = frmDate.split("-"); tempfrmDate = frmDate.split("-");
firstDayOfMonth = Integer.parseInt(tempfrmDate[0]); firstDayOfMonth = Integer.parseInt(tempfrmDate[0]);
month = tempfrmDate[1]; month = tempfrmDate[1];
year = Integer.parseInt(tempfrmDate[2]); year = Integer.parseInt(tempfrmDate[2]);
// case2 // case2
temptoDate = toDate.split("-"); temptoDate = toDate.split("-");
lastDayOfMonth = Integer.parseInt(temptoDate[0]); lastDayOfMonth = Integer.parseInt(temptoDate[0]);
...@@ -191,13 +194,13 @@ public class BSRTransferReport extends ValidatorEJB implements BSRTransferReport ...@@ -191,13 +194,13 @@ public class BSRTransferReport extends ValidatorEJB implements BSRTransferReport
System.out.println("select Final initGeoLocation inside in EJB ===" + geoLoc + "selected initUnitForm inside in java ==" + unitForm + "length of List ====" + listDate.size() + "AND Value of ===" + listDate); System.out.println("select Final initGeoLocation inside in EJB ===" + geoLoc + "selected initUnitForm inside in java ==" + unitForm + "length of List ====" + listDate.size() + "AND Value of ===" + listDate);
// sql_changesbySahul on data-130215 = "select geo_loc, unit__form,to_char (tran_date,'DD') as tran_date, day_quantity, pyr_cumqty, " + "cum_budqty , sum(day_quantity) over (partition by geo_loc, unit__form order by tran_date) " + "as cur_cumqty from ( select s.GEO_LOC,p.tran_date, t.unit__form, " + "sum(fn_qty_form(p.item_code,p.unit,t.unit__form,i.phy_attrib_6, p.quantity)) " + "as day_quantity, fn_get_pyr_cumqty( to_date(add_months(p.tran_date,-12)),s.geo_loc,t.unit__form ) " + "as pyr_cumqty, fn_get_budgetqty(p.tran_date,s.GEO_LOC,t.unit__form ) " + "as cum_budqty from dwh_production_day_events p, item i, item_type t, " + "site s where p.site_code = s.site_code and p.item_code = i.item_code " + "and i.item_type = t.item_type and p.tran_date >= ? " + "and p.tran_date <= ? " + "and p.ref_type = (case when t.item_type in('AMPOULES','BOTTLES','DROPS','INHALER','POWDER','POUCH','SUSPENSION','TUBE','VIALS','GRANULES') then 'P' when t.item_type in('CAPSULES','TABLETS',' SOFTGELCAP') then 'P' else '' end ) " + "and p.ref_ser = 'W-RCP' and s.geo_loc in(" + geoLoc + ") " + "and t.unit__form in(" + unitForm + ") group by s.GEO_LOC, p.tran_date, t.unit__form ) " + "order by geo_loc, unit__form,tran_date"; // sql_changesbySahul on data-130215 = "select geo_loc, unit__form,to_char (tran_date,'DD') as tran_date, day_quantity, pyr_cumqty, " + "cum_budqty , sum(day_quantity) over (partition by geo_loc, unit__form order by tran_date) " + "as cur_cumqty from ( select s.GEO_LOC,p.tran_date, t.unit__form, " + "sum(fn_qty_form(p.item_code,p.unit,t.unit__form,i.phy_attrib_6, p.quantity)) " + "as day_quantity, fn_get_pyr_cumqty( to_date(add_months(p.tran_date,-12)),s.geo_loc,t.unit__form ) " + "as pyr_cumqty, fn_get_budgetqty(p.tran_date,s.GEO_LOC,t.unit__form ) " + "as cum_budqty from dwh_production_day_events p, item i, item_type t, " + "site s where p.site_code = s.site_code and p.item_code = i.item_code " + "and i.item_type = t.item_type and p.tran_date >= ? " + "and p.tran_date <= ? " + "and p.ref_type = (case when t.item_type in('AMPOULES','BOTTLES','DROPS','INHALER','POWDER','POUCH','SUSPENSION','TUBE','VIALS','GRANULES') then 'P' when t.item_type in('CAPSULES','TABLETS',' SOFTGELCAP') then 'P' else '' end ) " + "and p.ref_ser = 'W-RCP' and s.geo_loc in(" + geoLoc + ") " + "and t.unit__form in(" + unitForm + ") group by s.GEO_LOC, p.tran_date, t.unit__form ) " + "order by geo_loc, unit__form,tran_date";
sql = "select geo_loc, unit__form,to_char (tran_date,'DD') as tran_date, day_quantity, pyr_cumqty, " + "cum_budqty , sum(day_quantity) over (partition by geo_loc, unit__form order by tran_date) " + "as cur_cumqty from ( select s.GEO_LOC,p.tran_date, t.unit__form, " + "sum(fn_qty_form(p.item_code,p.unit,t.unit__form,i.phy_attrib_6, p.quantity)) " + "as day_quantity, fn_get_pyr_cumqty( to_date(add_months(p.tran_date,-12)),s.geo_loc,t.unit__form ) " + "as pyr_cumqty, fn_get_budgetqty(p.tran_date,s.GEO_LOC,t.unit__form ) " + "as cum_budqty from dwh_production_day_events p, item i, item_type t, " + "site s where p.site_code = s.site_code and p.item_code = i.item_code " + "and i.item_type = t.item_type and p.tran_date >= ? " + "and p.tran_date <= ? " + "and p.ref_type = (case when t.item_type in (select trim(item_type) from item_type where unit__form is not null) then 'P' when t.item_type in (select trim(item_type) from item_type where unit__form is not null) then 'P' else '' end ) " + "and p.ref_ser = 'W-RCP' and s.geo_loc in(" + geoLoc + ") " + "and t.unit__form in(" + unitForm + ") group by s.GEO_LOC, p.tran_date, t.unit__form ) " + "order by geo_loc, unit__form,tran_date"; sql = "select geo_loc, unit__form,to_char (tran_date,'DD') as tran_date, day_quantity, pyr_cumqty, " + "cum_budqty , sum(day_quantity) over (partition by geo_loc, unit__form order by tran_date) " + "as cur_cumqty from ( select s.GEO_LOC,p.tran_date, t.unit__form, " + "sum(fn_qty_form(p.item_code,p.unit,t.unit__form,i.phy_attrib_6, p.quantity)) " + "as day_quantity, fn_get_pyr_cumqty( to_date(add_months(p.tran_date,-12)),s.geo_loc,t.unit__form ) " + "as pyr_cumqty, fn_get_budgetqty(p.tran_date,s.GEO_LOC,t.unit__form ) " + "as cum_budqty from dwh_production_day_events p, item i, item_type t, " + "site s where p.site_code = s.site_code and p.item_code = i.item_code " + "and i.item_type = t.item_type and p.tran_date >= ? " + "and p.tran_date <= ? " + "and p.ref_type = (case when t.item_type in (select trim(item_type) from item_type where unit__form is not null) then 'P' when t.item_type in (select trim(item_type) from item_type where unit__form is not null) then 'P' else '' end ) " + "and p.ref_ser = 'W-RCP' and s.geo_loc in(" + geoLoc + ") " + "and t.unit__form in(" + unitForm + ") group by s.GEO_LOC, p.tran_date, t.unit__form ) " + "order by geo_loc, unit__form,tran_date";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, frmDate); pstmt.setString(1, frmDate);
pstmt.setString(2, toDate); pstmt.setString(2, toDate);
// End of setter statement // End of setter statement
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
int cntFrBudget = 0; int cntFrBudget = 0;
String curCumQty = ""; String curCumQty = "";
String missingDate = ""; String missingDate = "";
String pyrCumqty = "0.0"; String pyrCumqty = "0.0";
...@@ -667,8 +670,10 @@ public class BSRTransferReport extends ValidatorEJB implements BSRTransferReport ...@@ -667,8 +670,10 @@ public class BSRTransferReport extends ValidatorEJB implements BSRTransferReport
file.close(); file.close();
System.out.println("PDF Created succesfully"); System.out.println("PDF Created succesfully");
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:16062016 by Nikhil*/
conn = getConnection();
toMailId = ""; toMailId = "";
ccMailId = ""; ccMailId = "";
bccAddress = ""; bccAddress = "";
......
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
/** /**
* Session Bean implementation class BSRTransferReport * Session Bean implementation class BSRTransferReport
...@@ -20,22 +22,23 @@ public class HalolMFGCommitVsActual extends ValidatorEJB implements HalolMFGComm ...@@ -20,22 +22,23 @@ public class HalolMFGCommitVsActual extends ValidatorEJB implements HalolMFGComm
String geoLocation=""; String geoLocation="";
public HalolMFGCommitVsActual() public HalolMFGCommitVsActual()
{} {}
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getHalolMFGCommitVsActual(String dataSourceName, String month,String geoLoc) throws RemoteException, ITMException public JSONObject getHalolMFGCommitVsActual(String dataSourceName, String month,String geoLoc) throws RemoteException, ITMException
{ {
JSONObject rawDataMthlySalesJson = new JSONObject(); JSONObject rawDataMthlySalesJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt =null; PreparedStatement pstmt =null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); String sql = "",finYear="";
String sql = "",finYear=""; geoLocation = geoLoc;
geoLocation =geoLoc;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:16062016 by Nikhil*/
conn = getConnection();
if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0) if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0)
{ {
System.out.println("Comming month inside getWeekWiseActualRelease ==="+month); System.out.println("Comming month inside getWeekWiseActualRelease ==="+month);
...@@ -144,17 +147,18 @@ public JSONObject getHalolMFGCommitVsActual(String dataSourceName, String month, ...@@ -144,17 +147,18 @@ public JSONObject getHalolMFGCommitVsActual(String dataSourceName, String month,
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
geoLoc=geoLocation; geoLoc=geoLocation;
week =week.substring(2, 4); week =week.substring(2, 4);
try try
{ {
if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0 ) if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0 )
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
SimpleDateFormat gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); /*add new code for connection DB on dated:16062016 by Nikhil*/
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); conn = getConnection();
SimpleDateFormat gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
System.out.println("Comming month inside getWeekWiseActualRelease1 ==="+month); System.out.println("Comming month inside getWeekWiseActualRelease1 ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03")) if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03"))
...@@ -324,19 +328,20 @@ public JSONObject getHalolMFGCommitVsActual(String dataSourceName, String month, ...@@ -324,19 +328,20 @@ public JSONObject getHalolMFGCommitVsActual(String dataSourceName, String month,
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
geoLoc=geoLocation; geoLoc=geoLocation;
week =week.substring(2, 4); week =week.substring(2, 4);
try try
{ {
if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0) if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
SimpleDateFormat gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); /*add new code for connection DB on dated:17062016 by Nikhil*/
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); conn = getConnection();
System.out.println("Comming month inside getWeekWiseCommitedRelease ==="+month); SimpleDateFormat gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
String selectedMonth = month.substring(4, 6); SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
System.out.println("Comming month inside getWeekWiseCommitedRelease ==="+month);
String selectedMonth = month.substring(4, 6);
if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03")) if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03"))
{ {
finYear = String.valueOf(Integer.parseInt(month.substring(0, 4))-1)+"-"+month.substring(2, 4); finYear = String.valueOf(Integer.parseInt(month.substring(0, 4))-1)+"-"+month.substring(2, 4);
......
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.utility.EMail; import ibase.utility.EMail;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility; import ibase.webitm.utility.GenericUtility;
...@@ -36,7 +37,7 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -36,7 +37,7 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
String geoLocation=""; String geoLocation="";
public HalolMFGRelease() public HalolMFGRelease()
{} {}
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
String firstWeek=""; String firstWeek="";
//1.This is the main method to show the parent graph //1.This is the main method to show the parent graph
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
...@@ -47,7 +48,6 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -47,7 +48,6 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt =null; PreparedStatement pstmt =null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String sql_forprd = ""; String sql_forprd = "";
String sql_forforcastweek=""; String sql_forforcastweek="";
String OverDueSql=""; String OverDueSql="";
...@@ -59,8 +59,10 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -59,8 +59,10 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
{ {
if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0) if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy"); SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy");
/* added by swati for previous month calculation 13 feb 2015 */ /* added by swati for previous month calculation 13 feb 2015 */
String selectedYear = month.substring(0, 4); String selectedYear = month.substring(0, 4);
...@@ -302,16 +304,17 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -302,16 +304,17 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
geoLoc=geoLocation; geoLoc=geoLocation;
String week=""; String week="";
try try
{ {
//do the implement on date 19/02/2015 //do the implement on date 19/02/2015
gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
convrtToTimStmDate = new SimpleDateFormat(genericUtility.getDBDateFormat()); convrtToTimStmDate = new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
//prd_code =month; //prd_code =month;
System.out.println("Comming month inside getMonthWisePendingRelease ==="+periodCode+"And Length==="+periodCode.trim().length() +" and geoLoc is ="+geoLoc); System.out.println("Comming month inside getMonthWisePendingRelease ==="+periodCode+"And Length==="+periodCode.trim().length() +" and geoLoc is ="+geoLoc);
if(periodCode!=null && periodCode.trim().length()==8 && geoLoc!=null && geoLoc.trim().length()>0) if(periodCode!=null && periodCode.trim().length()==8 && geoLoc!=null && geoLoc.trim().length()>0)
...@@ -478,16 +481,17 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -478,16 +481,17 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
geoLoc=geoLocation; geoLoc=geoLocation;
try try
{ {
if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0) if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
SimpleDateFormat gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); /*add new code for connection DB on dated:17062016 by Nikhil*/
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); conn = getConnection();
SimpleDateFormat gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
System.out.println("Comming month inside getMonthWiseActualRelease ==="+month); System.out.println("Comming month inside getMonthWiseActualRelease ==="+month);
month=convertMonthToPrd(month); month=convertMonthToPrd(month);
System.out.println("in getMonthWiseActualRelease month after conversion==="+month); System.out.println("in getMonthWiseActualRelease month after conversion==="+month);
...@@ -591,7 +595,6 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -591,7 +595,6 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
int sumOfWeek = 0; int sumOfWeek = 0;
int tbdTotal = 0; int tbdTotal = 0;
int grandTotal=0; int grandTotal=0;
...@@ -600,8 +603,10 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -600,8 +603,10 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
{ {
if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0) if(month!=null && month.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
System.out.println("final parameter goes to getSummaryGrid =="+month); System.out.println("final parameter goes to getSummaryGrid =="+month);
sql = " select COUNT(BATCH_NO) AS TBD_BATCHES from MFG_RELEASE3 where SITE_CODE = '"+geoLoc+"' and BATCH_NO IS NOT NULL and REL_STATUS = 'In METIS Not in LIMS' "; sql = " select COUNT(BATCH_NO) AS TBD_BATCHES from MFG_RELEASE3 where SITE_CODE = '"+geoLoc+"' and BATCH_NO IS NOT NULL and REL_STATUS = 'In METIS Not in LIMS' ";
...@@ -699,14 +704,15 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -699,14 +704,15 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
geoLoc=geoLocation; geoLoc=geoLocation;
try try
{ {
System.out.println("periodCode-------->"+periodCode); System.out.println("periodCode-------->"+periodCode);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
if(periodCode!=null && periodCode.equals("In METIS Not in LIMS")) if(periodCode!=null && periodCode.equals("In METIS Not in LIMS"))
{ {
...@@ -802,7 +808,6 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -802,7 +808,6 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
int oosBatch = 0; int oosBatch = 0;
int ootBatch = 0; int ootBatch = 0;
int labEvent = 0; int labEvent = 0;
...@@ -815,9 +820,10 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -815,9 +820,10 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
System.out.println("periodCode in getUnreleasedSummaryGrid =="+periodCode); System.out.println("periodCode in getUnreleasedSummaryGrid =="+periodCode);
if(periodCode!=null && periodCode.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0) if(periodCode!=null && periodCode.trim().length()>0 && geoLoc!=null && geoLoc.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
sql = "select COUNT(BATCH_NO) AS OOS_BATCHES " sql = "select COUNT(BATCH_NO) AS OOS_BATCHES "
+" FROM MFG_RELEASE3 " +" FROM MFG_RELEASE3 "
...@@ -1138,8 +1144,10 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo ...@@ -1138,8 +1144,10 @@ public class HalolMFGRelease extends ValidatorEJB implements HalolMFGReleaseRemo
file.close(); file.close();
System.out.println("PDF Created succesfully"); System.out.println("PDF Created succesfully");
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver =null; connDriver =null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
toMailId =""; toMailId ="";
ccMailId =""; ccMailId ="";
bccAddress =""; bccAddress ="";
......
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
...@@ -21,6 +21,7 @@ public class MachineUtlDetails extends ValidatorEJB implements MachineUtlDetail ...@@ -21,6 +21,7 @@ public class MachineUtlDetails extends ValidatorEJB implements MachineUtlDetail
/** /**
* Default constructor. * Default constructor.
*/ */
E12GenericUtility e12GenericUtility = new E12GenericUtility();
public MachineUtlDetails() { public MachineUtlDetails() {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
...@@ -29,16 +30,17 @@ public class MachineUtlDetails extends ValidatorEJB implements MachineUtlDetail ...@@ -29,16 +30,17 @@ public class MachineUtlDetails extends ValidatorEJB implements MachineUtlDetail
{ {
StringBuffer xmlData = null; StringBuffer xmlData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
sql="select distinct site_code,descr FROM site ORDER BY site_code"; /*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
sql ="select distinct site_code,descr FROM site ORDER BY site_code";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>"); xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>");
...@@ -97,7 +99,6 @@ public class MachineUtlDetails extends ValidatorEJB implements MachineUtlDetail ...@@ -97,7 +99,6 @@ public class MachineUtlDetails extends ValidatorEJB implements MachineUtlDetail
PreparedStatement pstmt2 = null; PreparedStatement pstmt2 = null;
PreparedStatement pstmt3 = null; PreparedStatement pstmt3 = null;
PreparedStatement pstmt4 = null; PreparedStatement pstmt4 = null;
ConnDriver connDriver = null;
StringBuffer xmlData =new StringBuffer(); StringBuffer xmlData =new StringBuffer();
String pre_workDate=""; String pre_workDate="";
int count=0; int count=0;
...@@ -138,10 +139,11 @@ public class MachineUtlDetails extends ValidatorEJB implements MachineUtlDetail ...@@ -138,10 +139,11 @@ public class MachineUtlDetails extends ValidatorEJB implements MachineUtlDetail
//End of -------1St of month and last of month //End of -------1St of month and last of month
System.out.println("from date in side Machine Utilization ="+fromDate); System.out.println("from date in side Machine Utilization ="+fromDate);
System.out.println("toDate date in Machine Utilization="+toDate); System.out.println("toDate date in Machine Utilization="+toDate);
connDriver=new ConnDriver(); /*connDriver=new ConnDriver();*/
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>"); xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>");
sql="SELECT DISTINCT WORK_CTR, DESCR FROM WORKCNTR WHERE SITE_CODE =? ORDER BY WORK_CTR"; sql="SELECT DISTINCT WORK_CTR, DESCR FROM WORKCNTR WHERE SITE_CODE =? ORDER BY WORK_CTR";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
......
...@@ -3,7 +3,9 @@ package ibase.dashboard.mfg.ejb; ...@@ -3,7 +3,9 @@ package ibase.dashboard.mfg.ejb;
import ibase.dashboard.Report.Utility.DashboardUtility; import ibase.dashboard.Report.Utility.DashboardUtility;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.utility.EMail; import ibase.utility.EMail;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.awt.Color; import java.awt.Color;
...@@ -45,7 +47,7 @@ import com.lowagie.text.pdf.PdfPTable; ...@@ -45,7 +47,7 @@ import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter; import com.lowagie.text.pdf.PdfWriter;
@Stateless @Stateless
public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, PendingQCPurchaseOrderRemote public class PendingQCPurchaseOrder extends ValidatorEJB implements PendingQCPurchaseOrderLocal, PendingQCPurchaseOrderRemote
{ {
public PendingQCPurchaseOrder() public PendingQCPurchaseOrder()
...@@ -53,7 +55,7 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -53,7 +55,7 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getPendingQCOrderPurchase(String geoLocation, String siteCode, String dataSourceName) throws RemoteException,ITMException public JSONObject getPendingQCOrderPurchase(String geoLocation, String siteCode, String dataSourceName) throws RemoteException,ITMException
{ {
...@@ -65,12 +67,13 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -65,12 +67,13 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
...@@ -500,10 +503,8 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -500,10 +503,8 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
throw new ITMException(d); throw new ITMException(d);
} }
} }
return rowDataPendingQCOrderPurc; return rowDataPendingQCOrderPurc;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getPendingQCOrderPurchaseGrid(String geoLocation, String siteCode, String dataSourceName) throws RemoteException, ITMException public JSONObject getPendingQCOrderPurchaseGrid(String geoLocation, String siteCode, String dataSourceName) throws RemoteException, ITMException
{ {
...@@ -513,13 +514,14 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -513,13 +514,14 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
System.out.println(" Inside getPendingQCOrderPurchase for getPendingQCOrderPurchaseGrid Data Soruc Name ="+dataSourceName); System.out.println(" Inside getPendingQCOrderPurchase for getPendingQCOrderPurchaseGrid Data Soruc Name ="+dataSourceName);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
siteCode = dashboardUtility.getCommaSeparated(siteCode); siteCode = dashboardUtility.getCommaSeparated(siteCode);
...@@ -950,8 +952,10 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -950,8 +952,10 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
file.close(); file.close();
System.out.println("PDF Created succesfully in PendingQCPurchaseOrder getPDFByScheduler"); System.out.println("PDF Created succesfully in PendingQCPurchaseOrder getPDFByScheduler");
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver =null; connDriver =null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
toMailId =""; toMailId ="";
ccMailId =""; ccMailId ="";
bccAddress =""; bccAddress ="";
...@@ -1068,7 +1072,6 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -1068,7 +1072,6 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String excelFileName = null; String excelFileName = null;
String exportPDFPath = ""; String exportPDFPath = "";
String currDate=""; String currDate="";
...@@ -1077,8 +1080,10 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -1077,8 +1080,10 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
simpleDateFormat = new SimpleDateFormat("dd-MMM-yy"); simpleDateFormat = new SimpleDateFormat("dd-MMM-yy");
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
calendar = Calendar.getInstance(); calendar = Calendar.getInstance();
...@@ -1283,12 +1288,13 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -1283,12 +1288,13 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
if(geoLocation.trim().length()>0 && geoLocation!=null && siteCode!=null && siteCode.trim().length()>0) if(geoLocation.trim().length()>0 && geoLocation!=null && siteCode!=null && siteCode.trim().length()>0)
...@@ -1541,13 +1547,14 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -1541,13 +1547,14 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
System.out.println(" Inside getPendingQCOrderPurchase for getPendingManualQCOrderGrid Data Soruc Name ="+dataSourceName); System.out.println(" Inside getPendingQCOrderPurchase for getPendingManualQCOrderGrid Data Soruc Name ="+dataSourceName);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
siteCode = dashboardUtility.getCommaSeparated(siteCode); siteCode = dashboardUtility.getCommaSeparated(siteCode);
...@@ -1641,7 +1648,6 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -1641,7 +1648,6 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String excelFileName = null; String excelFileName = null;
String exportPDFPath = ""; String exportPDFPath = "";
String currDate=""; String currDate="";
...@@ -1650,8 +1656,10 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen ...@@ -1650,8 +1656,10 @@ public class PendingQCPurchaseOrder implements PendingQCPurchaseOrderLocal, Pen
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
simpleDateFormat = new SimpleDateFormat("dd-MMM-yy"); simpleDateFormat = new SimpleDateFormat("dd-MMM-yy");
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
calendar = Calendar.getInstance(); calendar = Calendar.getInstance();
......
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
...@@ -8,7 +9,7 @@ import javax.ejb.Remote; ...@@ -8,7 +9,7 @@ import javax.ejb.Remote;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@Remote @Remote
public interface PendingQCPurchaseOrderRemote public interface PendingQCPurchaseOrderRemote extends ValidatorRemote
{ {
public JSONObject getPendingQCOrderPurchase(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException; public JSONObject getPendingQCOrderPurchase(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingQCOrderPurchaseGrid(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException; public JSONObject getPendingQCOrderPurchaseGrid(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
......
...@@ -3,7 +3,9 @@ package ibase.dashboard.mfg.ejb; ...@@ -3,7 +3,9 @@ package ibase.dashboard.mfg.ejb;
import ibase.dashboard.Report.Utility.DashboardUtility; import ibase.dashboard.Report.Utility.DashboardUtility;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.utility.EMail; import ibase.utility.EMail;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.awt.Color; import java.awt.Color;
...@@ -45,15 +47,14 @@ import com.lowagie.text.pdf.PdfPTable; ...@@ -45,15 +47,14 @@ import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter; import com.lowagie.text.pdf.PdfWriter;
@Stateless @Stateless
public class PendingQCWorkOrder implements PendingQCWorkOrderLocal, PendingQCWorkOrderRemote public class PendingQCWorkOrder extends ValidatorEJB implements PendingQCWorkOrderLocal, PendingQCWorkOrderRemote
{ {
public PendingQCWorkOrder() public PendingQCWorkOrder()
{ {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getPendingQCWorkOrder(String geoLocation, String siteCode, String dataSourceName) throws RemoteException,ITMException public JSONObject getPendingQCWorkOrder(String geoLocation, String siteCode, String dataSourceName) throws RemoteException,ITMException
{ {
...@@ -65,13 +66,14 @@ public class PendingQCWorkOrder implements PendingQCWorkOrderLocal, PendingQCWo ...@@ -65,13 +66,14 @@ public class PendingQCWorkOrder implements PendingQCWorkOrderLocal, PendingQCWo
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
...@@ -512,8 +514,10 @@ public class PendingQCWorkOrder implements PendingQCWorkOrderLocal, PendingQCWo ...@@ -512,8 +514,10 @@ public class PendingQCWorkOrder implements PendingQCWorkOrderLocal, PendingQCWo
try try
{ {
System.out.println(" Inside PendingQCWorkOrder for getPendingQCWorkOrderGrid Data Soruc Name ="+dataSourceName); System.out.println(" Inside PendingQCWorkOrder for getPendingQCWorkOrderGrid Data Soruc Name ="+dataSourceName);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
...@@ -1083,8 +1087,10 @@ public class PendingQCWorkOrder implements PendingQCWorkOrderLocal, PendingQCWo ...@@ -1083,8 +1087,10 @@ public class PendingQCWorkOrder implements PendingQCWorkOrderLocal, PendingQCWo
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
simpleDateFormat = new SimpleDateFormat("dd-MMM-yy"); simpleDateFormat = new SimpleDateFormat("dd-MMM-yy");
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
calendar = Calendar.getInstance(); calendar = Calendar.getInstance();
......
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
...@@ -8,7 +9,7 @@ import javax.ejb.Remote; ...@@ -8,7 +9,7 @@ import javax.ejb.Remote;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@Remote @Remote
public interface PendingQCWorkOrderRemote public interface PendingQCWorkOrderRemote extends ValidatorRemote
{ {
public JSONObject getPendingQCWorkOrder(String orderType, String siteCode, String dataSourceName)throws RemoteException, ITMException; public JSONObject getPendingQCWorkOrder(String orderType, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingQCWorkOrderGrid(String orderType, String siteCode, String dataSourceName)throws RemoteException, ITMException; public JSONObject getPendingQCWorkOrderGrid(String orderType, String siteCode, String dataSourceName)throws RemoteException, ITMException;
......
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.utility.EMail; import ibase.utility.EMail;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -32,12 +33,14 @@ import com.lowagie.text.pdf.PdfWriter; ...@@ -32,12 +33,14 @@ import com.lowagie.text.pdf.PdfWriter;
/** /**
* Session Bean implementation class ProductionVsBudgetReport * Session Bean implementation class ProductionVsBudgetReport
*/ */
@Stateless @Stateless
public class ProductionVsBudgetReport extends ValidatorEJB implements ProductionVsBudgetReportRemote, ProductionVsBudgetReportLocal public class ProductionVsBudgetReport extends ValidatorEJB implements ProductionVsBudgetReportRemote, ProductionVsBudgetReportLocal
{ {
/** /**
* Default constructor. * Default constructor.
*/ */
E12GenericUtility e12GenericUtility = new E12GenericUtility();
List<String> listDate = null; List<String> listDate = null;
StringBuffer xmlDataForGeo = null; StringBuffer xmlDataForGeo = null;
StringBuffer xmlDataForUnit = null; StringBuffer xmlDataForUnit = null;
...@@ -50,14 +53,15 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production ...@@ -50,14 +53,15 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
ResultSet rs = null; ResultSet rs = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
Calendar cal = null; Calendar cal = null;
SimpleDateFormat sdf = null; SimpleDateFormat sdf = null;
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:20062016 by Nikhil*/
conn = getConnection();
cal = Calendar.getInstance(); cal = Calendar.getInstance();
sdf = new SimpleDateFormat("dd-MMM-yy"); sdf = new SimpleDateFormat("dd-MMM-yy");
cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE)); cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
...@@ -155,7 +159,6 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production ...@@ -155,7 +159,6 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null, pstmt1; PreparedStatement pstmt = null, pstmt1;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData = null; StringBuffer xmlData = null;
String geoLocation = ""; String geoLocation = "";
String unit = ""; String unit = "";
...@@ -176,8 +179,10 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production ...@@ -176,8 +179,10 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:20062016 by Nikhil*/
conn = getConnection();
System.out.println("comming from date from jsp =" + frmDate + "To Date comming from jsp==" + toDate); System.out.println("comming from date from jsp =" + frmDate + "To Date comming from jsp==" + toDate);
tempfrmDate = frmDate.split("-"); tempfrmDate = frmDate.split("-");
firstDayOfMonth = Integer.parseInt(tempfrmDate[0]); firstDayOfMonth = Integer.parseInt(tempfrmDate[0]);
...@@ -485,15 +490,16 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production ...@@ -485,15 +490,16 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
public boolean getRoleValid(String userId, String roleCode) throws RemoteException, ITMException public boolean getRoleValid(String userId, String roleCode) throws RemoteException, ITMException
{ {
boolean flag = false; boolean flag = false;
ConnDriver connDriver = new ConnDriver();
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:20062016 by Nikhil*/
conn = getConnection();
String sql = " SELECT * FROM WF_ROLE_USERS WHERE userid='" + userId + "' AND role_code='" + roleCode + "' "; String sql = " SELECT * FROM WF_ROLE_USERS WHERE userid='" + userId + "' AND role_code='" + roleCode + "' ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
......
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
...@@ -16,9 +14,7 @@ import java.util.Calendar; ...@@ -16,9 +14,7 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
/** /**
...@@ -37,9 +33,7 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh ...@@ -37,9 +33,7 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh
public ProfitLossBalSheet() public ProfitLossBalSheet()
{ {
} }
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject generateReport(String siteCode,String prdFrom,String prdTo,String acctPrd, String formatCode,String reportType,String dataSourceName) throws RemoteException, ITMException public JSONObject generateReport(String siteCode,String prdFrom,String prdTo,String acctPrd, String formatCode,String reportType,String dataSourceName) throws RemoteException, ITMException
{ {
...@@ -49,7 +43,6 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh ...@@ -49,7 +43,6 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh
PreparedStatement pstmt=null; PreparedStatement pstmt=null;
PreparedStatement pstmt1 = null; PreparedStatement pstmt1 = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String prevPrd=""; String prevPrd="";
String prevPrdCodeFrom=""; String prevPrdCodeFrom="";
String prevPrdCodeTo = ""; String prevPrdCodeTo = "";
...@@ -73,9 +66,10 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh ...@@ -73,9 +66,10 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh
prevPrdCodeFrom= String.valueOf(Integer.parseInt(prdFrom.substring(0, 4))-1)+prdFrom.substring(4, 6); prevPrdCodeFrom= String.valueOf(Integer.parseInt(prdFrom.substring(0, 4))-1)+prdFrom.substring(4, 6);
prevPrdCodeTo=String.valueOf(Integer.parseInt(prdTo.substring(0, 4))-1)+prdTo.substring(4, 6); prevPrdCodeTo=String.valueOf(Integer.parseInt(prdTo.substring(0, 4))-1)+prdTo.substring(4, 6);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
sql="select descr from SITE where site_code = ?"; sql="select descr from SITE where site_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode); pstmt.setString(1, siteCode);
...@@ -705,7 +699,6 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh ...@@ -705,7 +699,6 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
PreparedStatement pstmt1 = null; PreparedStatement pstmt1 = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String prevPrdSGrp=""; String prevPrdSGrp="";
String prevPrdCodeFromSGrp=""; String prevPrdCodeFromSGrp="";
String prevPrdCodeToSGrp = ""; String prevPrdCodeToSGrp = "";
...@@ -733,9 +726,10 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh ...@@ -733,9 +726,10 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh
prevPrdCodeFromSGrp= String.valueOf(Integer.parseInt(prdFrom.substring(0, 4))-1)+prdFrom.substring(4, 6); prevPrdCodeFromSGrp= String.valueOf(Integer.parseInt(prdFrom.substring(0, 4))-1)+prdFrom.substring(4, 6);
prevPrdCodeToSGrp=String.valueOf(Integer.parseInt(prdTo.substring(0, 4))-1)+prdTo.substring(4, 6); prevPrdCodeToSGrp=String.valueOf(Integer.parseInt(prdTo.substring(0, 4))-1)+prdTo.substring(4, 6);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
for(int i=0;i<10;i++) for(int i=0;i<10;i++)
{ {
totalCurr[i]=0; totalCurr[i]=0;
...@@ -1318,8 +1312,7 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh ...@@ -1318,8 +1312,7 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh
System.out.println("Exception in :RecallDetails:getProductWiseRecallDetails:" + d.getMessage()); System.out.println("Exception in :RecallDetails:getProductWiseRecallDetails:" + d.getMessage());
throw new ITMException(d); throw new ITMException(d);
} }
} }
return true; return true;
} }
...@@ -1331,13 +1324,13 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh ...@@ -1331,13 +1324,13 @@ public class ProfitLossBalSheet extends ValidatorEJB implements ProfitLossBalSh
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String frDate="",toDate=""; String frDate="",toDate="";
try try
{ {
/*conn = connDriver.getConnectDB(dataSourceName);
conn = connDriver.getConnectDB(dataSourceName); connDriver = null; */
connDriver = null; /*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
rawDataMnthDivWiseSalesJson=generateReport(sitecode,prdfrom,prdto,acctprd,formatcode,reporttype,dataSourceName); rawDataMnthDivWiseSalesJson=generateReport(sitecode,prdfrom,prdto,acctprd,formatcode,reporttype,dataSourceName);
System.out.println("getProductWiseRecallDetails data :"+rawDataMnthDivWiseSalesJson); System.out.println("getProductWiseRecallDetails data :"+rawDataMnthDivWiseSalesJson);
} }
......
...@@ -2,8 +2,8 @@ package ibase.dashboard.mfg.ejb; ...@@ -2,8 +2,8 @@ package ibase.dashboard.mfg.ejb;
import ibase.dashboard.Report.Utility.DashboardUtility; import ibase.dashboard.Report.Utility.DashboardUtility;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
...@@ -12,7 +12,6 @@ import java.sql.ResultSet; ...@@ -12,7 +12,6 @@ import java.sql.ResultSet;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -28,7 +27,7 @@ public class QCSampleCost extends ValidatorEJB implements QCSampleCostLocal, QCS ...@@ -28,7 +27,7 @@ public class QCSampleCost extends ValidatorEJB implements QCSampleCostLocal, QCS
public QCSampleCost() public QCSampleCost()
{ {
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getQCSampleCostData(String dataSourceName, String geoLocation, String lastMonth) throws RemoteException, ITMException public JSONObject getQCSampleCostData(String dataSourceName, String geoLocation, String lastMonth) throws RemoteException, ITMException
{ {
...@@ -38,8 +37,6 @@ public class QCSampleCost extends ValidatorEJB implements QCSampleCostLocal, QCS ...@@ -38,8 +37,6 @@ public class QCSampleCost extends ValidatorEJB implements QCSampleCostLocal, QCS
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
GenericUtility genericUtility = GenericUtility.getInstance();
Date frmDate = null; Date frmDate = null;
Date toDate = null; Date toDate = null;
DashboardUtility dashbordUtil = null; DashboardUtility dashbordUtil = null;
...@@ -71,7 +68,7 @@ public class QCSampleCost extends ValidatorEJB implements QCSampleCostLocal, QCS ...@@ -71,7 +68,7 @@ public class QCSampleCost extends ValidatorEJB implements QCSampleCostLocal, QCS
calendar.add(Calendar.MONTH,-6); calendar.add(Calendar.MONTH,-6);
String fromDate = simpleDateFormat.format(calendar.getTime());*/ String fromDate = simpleDateFormat.format(calendar.getTime());*/
SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
dashbordUtil = new DashboardUtility(); dashbordUtil = new DashboardUtility();
geoLocation = dashbordUtil.getCommaSeparated(geoLocation); geoLocation = dashbordUtil.getCommaSeparated(geoLocation);
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
...@@ -88,8 +85,10 @@ public class QCSampleCost extends ValidatorEJB implements QCSampleCostLocal, QCS ...@@ -88,8 +85,10 @@ public class QCSampleCost extends ValidatorEJB implements QCSampleCostLocal, QCS
System.out.println("From date is =" + frmDate + "and to date is =" + toDate + "and geolocation is ="+geoLocation+" and lastmonth is ="+lastMonth); System.out.println("From date is =" + frmDate + "and to date is =" + toDate + "and geolocation is ="+geoLocation+" and lastmonth is ="+lastMonth);
if (frmDate != null && toDate != null) if (frmDate != null && toDate != null)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
sql = " select to_char(tran_date,'MON-YY') as qc_date , to_date('01-' || to_char(tran_date,'MON-YY')),sum(i.quantity * s.rate) as sample_cost" + sql = " select to_char(tran_date,'MON-YY') as qc_date , to_date('01-' || to_char(tran_date,'MON-YY')),sum(i.quantity * s.rate) as sample_cost" +
" from invtrace i, stock s, site o where o.site_code = i.site_code and s.item_code = i.item_code and s.site_code = i.site_code" + " from invtrace i, stock s, site o where o.site_code = i.site_code and s.item_code = i.item_code and s.site_code = i.site_code" +
" and s.loc_code = i.loc_code and s.lot_no = i.lot_no and s.lot_sl = i.lot_sl and i.ref_ser in ('S-ISS','W-QCS') And I.Eff_Qty < 0" + " " + " and s.loc_code = i.loc_code and s.lot_no = i.lot_no and s.lot_sl = i.lot_sl and i.ref_ser in ('S-ISS','W-QCS') And I.Eff_Qty < 0" + " " +
......
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.utility.E12GenericUtility;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
...@@ -13,9 +9,7 @@ import java.sql.ResultSet; ...@@ -13,9 +9,7 @@ import java.sql.ResultSet;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
/** /**
...@@ -31,26 +25,26 @@ public class RecallDetails extends ValidatorEJB implements RecallDetailsRemote, ...@@ -31,26 +25,26 @@ public class RecallDetails extends ValidatorEJB implements RecallDetailsRemote,
public RecallDetails() { public RecallDetails() {
} }
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getMarketWiseRecallDetails(String dataSourceName,String lastMonth) throws RemoteException, ITMException public JSONObject getMarketWiseRecallDetails(String dataSourceName,String lastMonth) throws RemoteException, ITMException
{ {
JSONObject rawDataMarketWiseRecallJson = new JSONObject(); JSONObject rawDataMarketWiseRecallJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); Date frmDate = null;
Date frmDate = null; Date toDate = null;
Date toDate = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:17062016 by Nikhil*/
SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(genericUtility.getDBDateFormat()); conn = getConnection();
SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
{ {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
...@@ -122,18 +116,19 @@ public class RecallDetails extends ValidatorEJB implements RecallDetailsRemote, ...@@ -122,18 +116,19 @@ public class RecallDetails extends ValidatorEJB implements RecallDetailsRemote,
JSONObject rawDataProductWiseRecallJson = new JSONObject(); JSONObject rawDataProductWiseRecallJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); Date frmDate = null;
Date frmDate = null; Date toDate = null;
Date toDate = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(genericUtility.getDBDateFormat()); /*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
{ {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
...@@ -208,16 +203,16 @@ public class RecallDetails extends ValidatorEJB implements RecallDetailsRemote, ...@@ -208,16 +203,16 @@ public class RecallDetails extends ValidatorEJB implements RecallDetailsRemote,
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
Date frmDate = null; Date frmDate = null;
Date toDate = null; Date toDate = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(genericUtility.getDBDateFormat()); /*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
{ {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
......
package ibase.dashboard.mfg.ejb; package ibase.dashboard.mfg.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.sys.UtilMethods; import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -11,10 +11,7 @@ import java.sql.ResultSet; ...@@ -11,10 +11,7 @@ import java.sql.ResultSet;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import ibase.webitm.utility.GenericUtility;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
/** /**
...@@ -30,7 +27,7 @@ public class SampleRCpDtl extends ValidatorEJB implements SampleRCpDtlRemote, Sa ...@@ -30,7 +27,7 @@ public class SampleRCpDtl extends ValidatorEJB implements SampleRCpDtlRemote, Sa
{ {
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
/*** /***
* End of method getProfitGraphData() * End of method getProfitGraphData()
* *
...@@ -49,21 +46,19 @@ public class SampleRCpDtl extends ValidatorEJB implements SampleRCpDtlRemote, Sa ...@@ -49,21 +46,19 @@ public class SampleRCpDtl extends ValidatorEJB implements SampleRCpDtlRemote, Sa
JSONObject smplRcpDateWiseJson = new JSONObject(); JSONObject smplRcpDateWiseJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
SimpleDateFormat simpleDateFormat = null; SimpleDateFormat simpleDateFormat = null;
Calendar calendar = null; Calendar calendar = null;
UtilMethods utilMethods = new UtilMethods(); UtilMethods utilMethods = new UtilMethods();
int daysInInt=0; int daysInInt=0;
GenericUtility genericUtility = GenericUtility.getInstance();
Date frmDate = null; Date frmDate = null;
Date toDate = null; Date toDate = null;
try try
{ {
SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat convrtToTimStmDate = new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy"); SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy");
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
{ {
...@@ -78,8 +73,10 @@ public class SampleRCpDtl extends ValidatorEJB implements SampleRCpDtlRemote, Sa ...@@ -78,8 +73,10 @@ public class SampleRCpDtl extends ValidatorEJB implements SampleRCpDtlRemote, Sa
System.out.println("From date is =" + frmDate + "and to date is =" + toDate+ "and to lastMonth is ="+lastMonth); System.out.println("From date is =" + frmDate + "and to date is =" + toDate+ "and to lastMonth is ="+lastMonth);
if (frmDate != null && toDate != null) if (frmDate != null && toDate != null)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
sql = "select facility_code, curr_date,sum(day_received) as day_received, sum(day_approved) day_approved, sum (day_pending) day_pending from ( select s.facility_code, q.QORDER_DATE as curr_date,count(1) as day_received," + "0 as day_pending, 0 as day_approved from qc_order q, site s Where S.Site_Code = Q.Site_Code " + sql = "select facility_code, curr_date,sum(day_received) as day_received, sum(day_approved) day_approved, sum (day_pending) day_pending from ( select s.facility_code, q.QORDER_DATE as curr_date,count(1) as day_received," + "0 as day_pending, 0 as day_approved from qc_order q, site s Where S.Site_Code = Q.Site_Code " +
" and q.QORDER_DATE between ? and ?"+ " and q.QORDER_DATE between ? and ?"+
......
...@@ -3,10 +3,10 @@ package ibase.dashboard.mfg.ejb; ...@@ -3,10 +3,10 @@ package ibase.dashboard.mfg.ejb;
import ibase.dashboard.Report.Utility.DashboardUtility; import ibase.dashboard.Report.Utility.DashboardUtility;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.utility.EMail; import ibase.utility.EMail;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.awt.Color; import java.awt.Color;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
...@@ -15,18 +15,21 @@ import java.rmi.RemoteException; ...@@ -15,18 +15,21 @@ import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.ejb.Stateless; import javax.ejb.Stateless;
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 org.json.simple.JSONObject; import org.json.simple.JSONObject;
import com.lowagie.text.Document; import com.lowagie.text.Document;
import com.lowagie.text.Element; import com.lowagie.text.Element;
import com.lowagie.text.Font; import com.lowagie.text.Font;
...@@ -36,14 +39,6 @@ import com.lowagie.text.Paragraph; ...@@ -36,14 +39,6 @@ import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfPCell; import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable; import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter; import com.lowagie.text.pdf.PdfWriter;
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.sql.ResultSetMetaData;
/** /**
* Session Bean implementation class SalesPersonSales * Session Bean implementation class SalesPersonSales
*/ */
...@@ -53,23 +48,25 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus ...@@ -53,23 +48,25 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
public WIPStatus() { public WIPStatus() {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getWIPStatus(String city, String siteCode, String dataSourceName) throws RemoteException, ITMException public JSONObject getWIPStatus(String city, String siteCode, String dataSourceName) throws RemoteException, ITMException
{ {
JSONObject rawDataWIPStatusDtlJson = new JSONObject(); JSONObject rawDataWIPStatusDtlJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
System.out.println(" Inside WIPStatus for getWIPStatus Data Soruc Name ="+dataSourceName); System.out.println(" Inside WIPStatus for getWIPStatus Data Soruc Name ="+dataSourceName);
System.out.println("In getWIPStatus Method dataSourceName :"+dataSourceName); System.out.println("In getWIPStatus Method dataSourceName :"+dataSourceName);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
...@@ -512,18 +509,19 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus ...@@ -512,18 +509,19 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
{ {
JSONObject rawDataWIPStatusGridDtlJson = new JSONObject(); JSONObject rawDataWIPStatusGridDtlJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
System.out.println(" Inside WIPStatus for getWIPStatusGrid Data Soruc Name ="+dataSourceName); System.out.println(" Inside WIPStatus for getWIPStatusGrid Data Soruc Name ="+dataSourceName);
System.out.println("In getWIPStatusGrid Method dataSourceName :"+dataSourceName); System.out.println("In getWIPStatusGrid Method dataSourceName :"+dataSourceName);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
city = dashboardUtility.getCommaSeparated(city); city = dashboardUtility.getCommaSeparated(city);
...@@ -592,11 +590,11 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus ...@@ -592,11 +590,11 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
{ {
rowData = new JSONObject(); rowData = new JSONObject();
rowData.put("no_of_days_text", rs.getString("NO_OF_DAYS_TEXT")); rowData.put("no_of_days_text", rs.getString("NO_OF_DAYS_TEXT"));
rowData.put("sub_type", rs.getString("SUB_TYPE")); rowData.put("sub_type", rs.getString("SUB_TYPE"));
rowData.put("wip", rs.getString("WIP")); rowData.put("wip", rs.getString("WIP"));
rowData.put("batch_cost", rs.getString("BATCH_COST")); rowData.put("batch_cost", rs.getString("BATCH_COST"));
rowData.put("city", rs.getString("CITY")); rowData.put("city", rs.getString("CITY"));
rowData.put("status", rs.getString("STATUS")); rowData.put("status", rs.getString("STATUS"));
rawDataWIPStatusGridDtlJson.put(count, rowData); rawDataWIPStatusGridDtlJson.put(count, rowData);
count++; count++;
...@@ -641,11 +639,10 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus ...@@ -641,11 +639,10 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
{ {
JSONObject rawDataWIPStatusLinkGridDtlJson = new JSONObject(); JSONObject rawDataWIPStatusLinkGridDtlJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
...@@ -656,8 +653,10 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus ...@@ -656,8 +653,10 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
System.out.println(" Inside WIPStatus for getWIPStatusLinkGrid siteCode ="+siteCode+"===city :"+city); System.out.println(" Inside WIPStatus for getWIPStatusLinkGrid siteCode ="+siteCode+"===city :"+city);
System.out.println("In getWIPStatusLinkGrid Method period :"+period+"-------catagory :"+catagory+ "-------dataSourceName :"+dataSourceName); System.out.println("In getWIPStatusLinkGrid Method period :"+period+"-------catagory :"+catagory+ "-------dataSourceName :"+dataSourceName);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
String[] temp ; String[] temp ;
String firstDays = ""; String firstDays = "";
...@@ -1038,8 +1037,10 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus ...@@ -1038,8 +1037,10 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
file.close(); file.close();
System.out.println("PDF Created succesfully in WIPStatus getPDFByScheduler"); System.out.println("PDF Created succesfully in WIPStatus getPDFByScheduler");
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver =null; connDriver =null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
toMailId =""; toMailId ="";
ccMailId =""; ccMailId ="";
bccAddress =""; bccAddress ="";
...@@ -1160,27 +1161,28 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus ...@@ -1160,27 +1161,28 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
public void getExcelGenerate(String city, String siteCode, String dataSourceName)throws RemoteException, ITMException public void getExcelGenerate(String city, String siteCode, String dataSourceName)throws RemoteException, ITMException
{ {
System.out.println("in getExcelGenerate city :"+city+"-----siteCode :"+siteCode); System.out.println("in getExcelGenerate city :"+city+"-----siteCode :"+siteCode);
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); String excelFileName = null;
String excelFileName = null; String exportPDFPath = "";
String exportPDFPath = ""; String currDate= "";
String currDate="";
SimpleDateFormat simpleDateFormat = null; SimpleDateFormat simpleDateFormat = null;
Calendar calendar = null; Calendar calendar = null;
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:17062016 by Nikhil*/
conn = getConnection();
simpleDateFormat = new SimpleDateFormat("dd-MMM-yy"); simpleDateFormat = new SimpleDateFormat("dd-MMM-yy");
calendar = Calendar.getInstance(); calendar = Calendar.getInstance();
exportPDFPath = CommonConstants.JBOSSHOME + File.separator +"server"+File.separator +"default"+File.separator +"deploy"+File.separator +"ibase.ear"+File.separator + "ibase.war" +File.separator + "dashboard" + File.separator + "mfg"+ File.separator + "Scheduler"+File.separator +"ExportExample"+ File.separator + "ExportPDF"+File.separator; exportPDFPath = CommonConstants.JBOSSHOME + File.separator +"server"+File.separator +"default"+File.separator +"deploy"+File.separator +"ibase.ear"+File.separator + "ibase.war" +File.separator + "dashboard" + File.separator + "mfg"+ File.separator + "Scheduler"+File.separator +"ExportExample"+ File.separator + "ExportPDF"+File.separator;
currDate = simpleDateFormat.format(calendar.getTime()); currDate = simpleDateFormat.format(calendar.getTime());
excelFileName = city+" ("+siteCode+")"+" Plant Open Work Order Status as on " +currDate; excelFileName = city+" ("+siteCode+")"+" Plant Open Work Order Status as on " +currDate;
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
city = dashboardUtility.getCommaSeparated(city); city = dashboardUtility.getCommaSeparated(city);
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HalolMFGCommitVsActualServlet extends HttpServlet public class HalolMFGCommitVsActualServlet extends HttpServlet
...@@ -31,12 +32,16 @@ public class HalolMFGCommitVsActualServlet extends HttpServlet ...@@ -31,12 +32,16 @@ public class HalolMFGCommitVsActualServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
geoLoc = (request.getParameter("month")); geoLoc = (request.getParameter("month"));
geoLoc = (request.getParameter("geolocation")); geoLoc = (request.getParameter("geolocation"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
halolMFGCommitVsActualRemote = (HalolMFGCommitVsActualRemote) context.lookup("ibase/HalolMFGCommitVsActual/remote"); halolMFGCommitVsActualRemote = (HalolMFGCommitVsActualRemote) context.lookup("ibase/HalolMFGCommitVsActual/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
halolMFGCommitVsActualRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)halolMFGCommitVsActualRemote.getHalolMFGCommitVsActual(dataSourceName,month,geoLoc); JSONObject jsonObjData = (JSONObject)halolMFGCommitVsActualRemote.getHalolMFGCommitVsActual(dataSourceName,month,geoLoc);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -33,11 +34,15 @@ public class HalolMFGMonthWiseSummaryServlet extends HttpServlet ...@@ -33,11 +34,15 @@ public class HalolMFGMonthWiseSummaryServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
geoLoc = (request.getParameter("geolocation")); geoLoc = (request.getParameter("geolocation"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote"); halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
halolMFGReleaseRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)halolMFGReleaseRemote.getSummaryGrid(dataSourceName, month,geoLoc); JSONObject jsonObjData = (JSONObject)halolMFGReleaseRemote.getSummaryGrid(dataSourceName, month,geoLoc);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -11,6 +11,7 @@ import javax.servlet.ServletException; ...@@ -11,6 +11,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -35,11 +36,15 @@ public class HalolMFGReleaseServlet extends HttpServlet ...@@ -35,11 +36,15 @@ public class HalolMFGReleaseServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
geoLoc = (request.getParameter("geolocation")); geoLoc = (request.getParameter("geolocation"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote"); halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
halolMFGReleaseRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)halolMFGReleaseRemote.getHalolMFGReleaseBatches(dataSourceName,month,geoLoc); JSONObject jsonObjData = (JSONObject)halolMFGReleaseRemote.getHalolMFGReleaseBatches(dataSourceName,month,geoLoc);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -33,11 +34,15 @@ public class HalolMFGUnreleasedBatchServlet extends HttpServlet ...@@ -33,11 +34,15 @@ public class HalolMFGUnreleasedBatchServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
geoLoc = (request.getParameter("geolocation")); geoLoc = (request.getParameter("geolocation"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote"); halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
halolMFGReleaseRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)halolMFGReleaseRemote.getUnreleasedSummaryGrid(dataSourceName, month,geoLoc); JSONObject jsonObjData = (JSONObject)halolMFGReleaseRemote.getUnreleasedSummaryGrid(dataSourceName, month,geoLoc);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HalolMonthWiseActReleaseServlet extends HttpServlet public class HalolMonthWiseActReleaseServlet extends HttpServlet
...@@ -31,11 +32,15 @@ public class HalolMonthWiseActReleaseServlet extends HttpServlet ...@@ -31,11 +32,15 @@ public class HalolMonthWiseActReleaseServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("prd_code")); month = (request.getParameter("prd_code"));
geoLoc = (request.getParameter("geolocation")); geoLoc = (request.getParameter("geolocation"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote"); halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
halolMFGReleaseRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)halolMFGReleaseRemote.getMonthWiseActualRelease (dataSourceName,month,geoLoc); JSONObject jsonObjData = (JSONObject)halolMFGReleaseRemote.getMonthWiseActualRelease (dataSourceName,month,geoLoc);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HalolMonthWisePendingReleaseServlet extends HttpServlet public class HalolMonthWisePendingReleaseServlet extends HttpServlet
...@@ -34,6 +35,8 @@ public class HalolMonthWisePendingReleaseServlet extends HttpServlet ...@@ -34,6 +35,8 @@ public class HalolMonthWisePendingReleaseServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
//month = (request.getParameter("month")); //month = (request.getParameter("month"));
month = (request.getParameter("prd_code")); month = (request.getParameter("prd_code"));
...@@ -43,6 +46,8 @@ public class HalolMonthWisePendingReleaseServlet extends HttpServlet ...@@ -43,6 +46,8 @@ public class HalolMonthWisePendingReleaseServlet extends HttpServlet
System.out.println(" month and week ===" + month+"prd_code===="+prd_code); System.out.println(" month and week ===" + month+"prd_code===="+prd_code);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote"); halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
halolMFGReleaseRemote.setUserInfo(userInfo);
if(metadataName.equals("monthwisepending")) if(metadataName.equals("monthwisepending"))
{ {
System.out.println("in monthwisepending"); System.out.println("in monthwisepending");
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HalolWeekWiseActReleaseServlet extends HttpServlet public class HalolWeekWiseActReleaseServlet extends HttpServlet
...@@ -33,12 +34,16 @@ public class HalolWeekWiseActReleaseServlet extends HttpServlet ...@@ -33,12 +34,16 @@ public class HalolWeekWiseActReleaseServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
week = (request.getParameter("week")); week = (request.getParameter("week"));
geoLoc = (request.getParameter("geolocation")); geoLoc = (request.getParameter("geolocation"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
halolMFGCommitVsActualRemote = (HalolMFGCommitVsActualRemote) context.lookup("ibase/HalolMFGCommitVsActual/remote"); halolMFGCommitVsActualRemote = (HalolMFGCommitVsActualRemote) context.lookup("ibase/HalolMFGCommitVsActual/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
halolMFGCommitVsActualRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)halolMFGCommitVsActualRemote.getWeekWiseActualRelease(dataSourceName,month,week,geoLoc); JSONObject jsonObjData = (JSONObject)halolMFGCommitVsActualRemote.getWeekWiseActualRelease(dataSourceName,month,week,geoLoc);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HalolWeekWiseCommitedReleaseServlet extends HttpServlet public class HalolWeekWiseCommitedReleaseServlet extends HttpServlet
...@@ -32,12 +33,16 @@ public class HalolWeekWiseCommitedReleaseServlet extends HttpServlet ...@@ -32,12 +33,16 @@ public class HalolWeekWiseCommitedReleaseServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
week = (request.getParameter("week")); week = (request.getParameter("week"));
geoLoc = (request.getParameter("geolocation")); geoLoc = (request.getParameter("geolocation"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
halolMFGCommitVsActualRemote = (HalolMFGCommitVsActualRemote) context.lookup("ibase/HalolMFGCommitVsActual/remote"); halolMFGCommitVsActualRemote = (HalolMFGCommitVsActualRemote) context.lookup("ibase/HalolMFGCommitVsActual/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
halolMFGCommitVsActualRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)halolMFGCommitVsActualRemote.getWeekWiseCommitedRelease(dataSourceName,month,week,geoLoc); JSONObject jsonObjData = (JSONObject)halolMFGCommitVsActualRemote.getWeekWiseCommitedRelease(dataSourceName,month,week,geoLoc);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -3,16 +3,14 @@ package ibase.dashboard.mfg.servlet; ...@@ -3,16 +3,14 @@ package ibase.dashboard.mfg.servlet;
import ibase.dashboard.mfg.ejb.RecallDetailsRemote; import ibase.dashboard.mfg.ejb.RecallDetailsRemote;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
...@@ -36,12 +34,16 @@ public class MarketWiseRecallServlet extends HttpServlet ...@@ -36,12 +34,16 @@ public class MarketWiseRecallServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
lastMonth = request.getParameter("lastMonth"); lastMonth = request.getParameter("lastMonth");
System.out.println("in doPost" + "lastMonth is =:" + lastMonth+":" ); System.out.println("in doPost" + "lastMonth is =:" + lastMonth+":" );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
recallDetailsRemote = (RecallDetailsRemote) context.lookup("ibase/RecallDetails/remote"); recallDetailsRemote = (RecallDetailsRemote) context.lookup("ibase/RecallDetails/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
recallDetailsRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)recallDetailsRemote.getMarketWiseRecallDetails(dataSourceName,lastMonth); JSONObject jsonObjData = (JSONObject)recallDetailsRemote.getMarketWiseRecallDetails(dataSourceName,lastMonth);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,13 +10,12 @@ import javax.servlet.ServletException; ...@@ -10,13 +10,12 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class PendingManualQCOrderGridServlet extends HttpServlet public class PendingManualQCOrderGridServlet extends HttpServlet
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
...@@ -37,17 +36,17 @@ public class PendingManualQCOrderGridServlet extends HttpServlet ...@@ -37,17 +36,17 @@ public class PendingManualQCOrderGridServlet extends HttpServlet
{ {
System.out.println("in PendingManualQCOrderGridServlet " ); System.out.println("in PendingManualQCOrderGridServlet " );
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode"); siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation"); geoLocation = request.getParameter("geoLocation");
geoLocation = geoLocation.replace("@", "&"); geoLocation = geoLocation.replace("@", "&");
System.out.println("in PendingManualQCOrderGridServlet SiteCode :"+siteCode+"----geoLocation :"+geoLocation);
System.out.println("in PendingManualQCOrderGridServlet SiteCode :"+siteCode+"----geoLocation :"+geoLocation);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote"); pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingQCOrderRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingManualQCOrderGrid(geoLocation,siteCode,dataSourceName); JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingManualQCOrderGrid(geoLocation,siteCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -39,7 +39,8 @@ public class PendingManualQCOrderServlet extends HttpServlet ...@@ -39,7 +39,8 @@ public class PendingManualQCOrderServlet extends HttpServlet
{ {
System.out.println("in PendingManualQCOrderServlet " ); System.out.println("in PendingManualQCOrderServlet " );
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode"); siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation"); geoLocation = request.getParameter("geoLocation");
...@@ -49,7 +50,8 @@ public class PendingManualQCOrderServlet extends HttpServlet ...@@ -49,7 +50,8 @@ public class PendingManualQCOrderServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote"); pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingQCOrderRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingManualQCOrder(geoLocation,siteCode,dataSourceName); JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingManualQCOrder(geoLocation,siteCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,6 +10,8 @@ import javax.servlet.ServletException; ...@@ -10,6 +10,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class PendingQCOrderPurchaseGridServlet extends HttpServlet public class PendingQCOrderPurchaseGridServlet extends HttpServlet
...@@ -37,7 +39,8 @@ public class PendingQCOrderPurchaseGridServlet extends HttpServlet ...@@ -37,7 +39,8 @@ public class PendingQCOrderPurchaseGridServlet extends HttpServlet
{ {
System.out.println("in PendingQCOrderPurchaseGridServlet " ); System.out.println("in PendingQCOrderPurchaseGridServlet " );
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode"); siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation"); geoLocation = request.getParameter("geoLocation");
...@@ -47,7 +50,8 @@ public class PendingQCOrderPurchaseGridServlet extends HttpServlet ...@@ -47,7 +50,8 @@ public class PendingQCOrderPurchaseGridServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote"); pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingQCOrderRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingQCOrderPurchaseGrid(geoLocation,siteCode,dataSourceName); JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingQCOrderPurchaseGrid(geoLocation,siteCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -39,7 +39,8 @@ public class PendingQCOrderPurchaseServlet extends HttpServlet ...@@ -39,7 +39,8 @@ public class PendingQCOrderPurchaseServlet extends HttpServlet
{ {
System.out.println("in PendingQCOrderPurchaseServlet " ); System.out.println("in PendingQCOrderPurchaseServlet " );
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode"); siteCode = request.getParameter("sitecode");
...@@ -52,7 +53,8 @@ public class PendingQCOrderPurchaseServlet extends HttpServlet ...@@ -52,7 +53,8 @@ public class PendingQCOrderPurchaseServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote"); pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingQCOrderRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingQCOrderPurchase(geoLocation,siteCode,dataSourceName); JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingQCOrderPurchase(geoLocation,siteCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -38,6 +38,7 @@ public class PendingQCPurcExportPDFServlet extends HttpServlet ...@@ -38,6 +38,7 @@ public class PendingQCPurcExportPDFServlet extends HttpServlet
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String sessionCity = (String) session.getAttribute("geoLocation"); String sessionCity = (String) session.getAttribute("geoLocation");
String sessionSiteCode = (String) session.getAttribute("siteCode"); String sessionSiteCode = (String) session.getAttribute("siteCode");
...@@ -53,7 +54,9 @@ public class PendingQCPurcExportPDFServlet extends HttpServlet ...@@ -53,7 +54,9 @@ public class PendingQCPurcExportPDFServlet extends HttpServlet
// call EJB method for PDF creation******************* // call EJB method for PDF creation*******************
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingQCPurchaseOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote"); pendingQCPurchaseOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote");
resultString = pendingQCPurchaseOrderRemote.getPDFByScheduler(rptTitle,remark,userID,imgName,sessionCity,sessionSiteCode); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingQCPurchaseOrderRemote.setUserInfo(userInfo);
resultString = pendingQCPurchaseOrderRemote.getPDFByScheduler(rptTitle,remark,userID,imgName,sessionCity,sessionSiteCode);
response.setContentType("text/html"); response.setContentType("text/html");
if(resultString.equals("false")) if(resultString.equals("false"))
{ {
......
...@@ -38,6 +38,7 @@ public class PendingQCReceiptExportPDFServlet extends HttpServlet ...@@ -38,6 +38,7 @@ public class PendingQCReceiptExportPDFServlet extends HttpServlet
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String sessionCity = (String) session.getAttribute("geoLocation"); String sessionCity = (String) session.getAttribute("geoLocation");
String sessionSiteCode = (String) session.getAttribute("siteCode"); String sessionSiteCode = (String) session.getAttribute("siteCode");
...@@ -53,6 +54,8 @@ public class PendingQCReceiptExportPDFServlet extends HttpServlet ...@@ -53,6 +54,8 @@ public class PendingQCReceiptExportPDFServlet extends HttpServlet
// call EJB method for PDF creation******************* // call EJB method for PDF creation*******************
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
PendingQCWorkOrderRemote = (PendingQCWorkOrderRemote) context.lookup("ibase/PendingQCWorkOrder/remote"); PendingQCWorkOrderRemote = (PendingQCWorkOrderRemote) context.lookup("ibase/PendingQCWorkOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
PendingQCWorkOrderRemote.setUserInfo(userInfo);
resultString = PendingQCWorkOrderRemote.getPDFByScheduler(rptTitle,remark,userID,imgName,sessionCity,sessionSiteCode); resultString = PendingQCWorkOrderRemote.getPDFByScheduler(rptTitle,remark,userID,imgName,sessionCity,sessionSiteCode);
response.setContentType("text/html"); response.setContentType("text/html");
if(resultString.equals("false")) if(resultString.equals("false"))
......
...@@ -10,6 +10,8 @@ import javax.servlet.ServletException; ...@@ -10,6 +10,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class PendingQCWorkOrderGridServlet extends HttpServlet public class PendingQCWorkOrderGridServlet extends HttpServlet
...@@ -37,7 +39,8 @@ public class PendingQCWorkOrderGridServlet extends HttpServlet ...@@ -37,7 +39,8 @@ public class PendingQCWorkOrderGridServlet extends HttpServlet
{ {
System.out.println("in PendingQCWorkOrderGridServlet " ); System.out.println("in PendingQCWorkOrderGridServlet " );
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode"); siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation"); geoLocation = request.getParameter("geoLocation");
...@@ -47,7 +50,8 @@ public class PendingQCWorkOrderGridServlet extends HttpServlet ...@@ -47,7 +50,8 @@ public class PendingQCWorkOrderGridServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingQCWorkOrderRemote = (PendingQCWorkOrderRemote) context.lookup("ibase/PendingQCWorkOrder/remote"); pendingQCWorkOrderRemote = (PendingQCWorkOrderRemote) context.lookup("ibase/PendingQCWorkOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingQCWorkOrderRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) pendingQCWorkOrderRemote.getPendingQCWorkOrderGrid(geoLocation,siteCode,dataSourceName); JSONObject jsonObjData = (JSONObject) pendingQCWorkOrderRemote.getPendingQCWorkOrderGrid(geoLocation,siteCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -40,8 +40,8 @@ public class PendingQCWorkOrderServlet extends HttpServlet ...@@ -40,8 +40,8 @@ public class PendingQCWorkOrderServlet extends HttpServlet
System.out.println("in PendingQCWorkOrderServlet " ); System.out.println("in PendingQCWorkOrderServlet " );
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode"); siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation"); geoLocation = request.getParameter("geoLocation");
...@@ -53,7 +53,8 @@ public class PendingQCWorkOrderServlet extends HttpServlet ...@@ -53,7 +53,8 @@ public class PendingQCWorkOrderServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingQCWorkOrderRemote = (PendingQCWorkOrderRemote) context.lookup("ibase/PendingQCWorkOrder/remote"); pendingQCWorkOrderRemote = (PendingQCWorkOrderRemote) context.lookup("ibase/PendingQCWorkOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingQCWorkOrderRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) pendingQCWorkOrderRemote.getPendingQCWorkOrder(geoLocation,siteCode,dataSourceName); JSONObject jsonObjData = (JSONObject) pendingQCWorkOrderRemote.getPendingQCWorkOrder(geoLocation,siteCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -12,6 +12,7 @@ import javax.servlet.ServletException; ...@@ -12,6 +12,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -36,13 +37,16 @@ public class PlantWiseRecallServlet extends HttpServlet ...@@ -36,13 +37,16 @@ public class PlantWiseRecallServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
lastMonth = request.getParameter("lastMonth"); lastMonth = request.getParameter("lastMonth");
System.out.println("in doPost lastMonth is ==:" + lastMonth ); System.out.println("in doPost lastMonth is ==:" + lastMonth );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
recallDetailsRemote = (RecallDetailsRemote) context.lookup("ibase/RecallDetails/remote"); recallDetailsRemote = (RecallDetailsRemote) context.lookup("ibase/RecallDetails/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
recallDetailsRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)recallDetailsRemote.getPlantWiseRecallDetails(dataSourceName,lastMonth); JSONObject jsonObjData = (JSONObject)recallDetailsRemote.getPlantWiseRecallDetails(dataSourceName,lastMonth);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -12,6 +12,7 @@ import javax.servlet.ServletException; ...@@ -12,6 +12,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -36,6 +37,8 @@ public class ProductWiseRecallServlet extends HttpServlet ...@@ -36,6 +37,8 @@ public class ProductWiseRecallServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
lastMonth = (request.getParameter("lastMonth")); lastMonth = (request.getParameter("lastMonth"));
System.out.println("in doPost" + "lastMonth is ==:" + lastMonth+":" ); System.out.println("in doPost" + "lastMonth is ==:" + lastMonth+":" );
...@@ -43,6 +46,8 @@ public class ProductWiseRecallServlet extends HttpServlet ...@@ -43,6 +46,8 @@ public class ProductWiseRecallServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
recallDetailsRemote = (RecallDetailsRemote) context.lookup("ibase/RecallDetails/remote"); recallDetailsRemote = (RecallDetailsRemote) context.lookup("ibase/RecallDetails/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
recallDetailsRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)recallDetailsRemote.getProductWiseRecallDetails(dataSourceName,lastMonth); JSONObject jsonObjData = (JSONObject)recallDetailsRemote.getProductWiseRecallDetails(dataSourceName,lastMonth);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -12,6 +12,7 @@ import javax.servlet.ServletException; ...@@ -12,6 +12,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -36,6 +37,8 @@ public class ProfitLossBalSheetServlet extends HttpServlet ...@@ -36,6 +37,8 @@ public class ProfitLossBalSheetServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
sitecode= request.getParameter("sitecode"); sitecode= request.getParameter("sitecode");
prdfrom = request.getParameter("prdfrom"); prdfrom = request.getParameter("prdfrom");
prdto= request.getParameter("prdto"); prdto= request.getParameter("prdto");
...@@ -53,6 +56,8 @@ public class ProfitLossBalSheetServlet extends HttpServlet ...@@ -53,6 +56,8 @@ public class ProfitLossBalSheetServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
profitLossBalSheetRemote = (ProfitLossBalSheetRemote) context.lookup("ibase/ProfitLossBalSheet/remote"); profitLossBalSheetRemote = (ProfitLossBalSheetRemote) context.lookup("ibase/ProfitLossBalSheet/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
profitLossBalSheetRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)profitLossBalSheetRemote.getProfitBalanceSheetDetails(sitecode,prdfrom,prdto,acctprd,formatcode,reporttype,dataSourceName); JSONObject jsonObjData = (JSONObject)profitLossBalSheetRemote.getProfitBalanceSheetDetails(sitecode,prdfrom,prdto,acctprd,formatcode,reporttype,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -2,12 +2,7 @@ package ibase.dashboard.mfg.servlet; ...@@ -2,12 +2,7 @@ package ibase.dashboard.mfg.servlet;
import ibase.dashboard.mfg.ejb.HalolMFGReleaseRemote; import ibase.dashboard.mfg.ejb.HalolMFGReleaseRemote;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
...@@ -35,11 +30,13 @@ public class QCBatchExportPDFServlet extends HttpServlet ...@@ -35,11 +30,13 @@ public class QCBatchExportPDFServlet extends HttpServlet
HalolMFGReleaseRemote halolMFGReleaseRemote = null; HalolMFGReleaseRemote halolMFGReleaseRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
System.out.println(" ENTER - QCBatchExportPDFServlet ***********************"); System.out.println(" ENTER - QCBatchExportPDFServlet ***********************");
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
userID = request.getParameter("userID"); userID = request.getParameter("userID");
rptTitle = request.getParameter("rptTitle"); rptTitle = request.getParameter("rptTitle");
remark = request.getParameter("remark"); remark = request.getParameter("remark");
...@@ -48,7 +45,9 @@ public class QCBatchExportPDFServlet extends HttpServlet ...@@ -48,7 +45,9 @@ public class QCBatchExportPDFServlet extends HttpServlet
// call EJB method for PDF creation******************* // call EJB method for PDF creation*******************
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote"); halolMFGReleaseRemote = (HalolMFGReleaseRemote) context.lookup("ibase/HalolMFGRelease/remote");
resultString = halolMFGReleaseRemote.getPDFByScheduler(rptTitle,remark,userID,imgName); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
halolMFGReleaseRemote.setUserInfo(userInfo);
resultString = halolMFGReleaseRemote.getPDFByScheduler(rptTitle,remark,userID,imgName);
response.setContentType("text/html"); response.setContentType("text/html");
if(resultString.equals("false")) if(resultString.equals("false"))
{ {
...@@ -73,8 +72,8 @@ public class QCBatchExportPDFServlet extends HttpServlet ...@@ -73,8 +72,8 @@ public class QCBatchExportPDFServlet extends HttpServlet
} }
finally finally
{ {
userID=""; userID = "";
rptTitle=""; rptTitle = "";
} }
} }
......
...@@ -11,6 +11,7 @@ import javax.servlet.ServletException; ...@@ -11,6 +11,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -40,11 +41,15 @@ public class QCSampleCostServlet extends HttpServlet ...@@ -40,11 +41,15 @@ public class QCSampleCostServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
geoLocation = request.getParameter("geoLocation"); geoLocation = request.getParameter("geoLocation");
lastMonth = request.getParameter("lastMonth"); lastMonth = request.getParameter("lastMonth");
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
qCSampleCostRemote = (QCSampleCostRemote) context.lookup("ibase/QCSampleCost/remote"); qCSampleCostRemote = (QCSampleCostRemote) context.lookup("ibase/QCSampleCost/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
qCSampleCostRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) qCSampleCostRemote.getQCSampleCostData(dataSourceName,geoLocation,lastMonth); JSONObject jsonObjData = (JSONObject) qCSampleCostRemote.getQCSampleCostData(dataSourceName,geoLocation,lastMonth);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,6 +10,7 @@ import javax.servlet.ServletException; ...@@ -10,6 +10,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -38,10 +39,14 @@ public class SampleRcpDtlServlet extends HttpServlet ...@@ -38,10 +39,14 @@ public class SampleRcpDtlServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
lastMonth = request.getParameter("lastMonth"); lastMonth = request.getParameter("lastMonth");
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
sampleRCpDtlRemote = (SampleRCpDtlRemote) context.lookup("ibase/SampleRCpDtl/remote"); sampleRCpDtlRemote = (SampleRCpDtlRemote) context.lookup("ibase/SampleRCpDtl/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
sampleRCpDtlRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) sampleRCpDtlRemote.getSampleRCPDtlData(dataSourceName,lastMonth); JSONObject jsonObjData = (JSONObject) sampleRCpDtlRemote.getSampleRCPDtlData(dataSourceName,lastMonth);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -36,9 +36,8 @@ public class WIPStatusExportPDFServlet extends HttpServlet ...@@ -36,9 +36,8 @@ public class WIPStatusExportPDFServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String sessionCity = (String) session.getAttribute("city"); String sessionCity = (String) session.getAttribute("city");
String sessionSiteCode = (String) session.getAttribute("siteCode"); String sessionSiteCode = (String) session.getAttribute("siteCode");
...@@ -50,10 +49,11 @@ public class WIPStatusExportPDFServlet extends HttpServlet ...@@ -50,10 +49,11 @@ public class WIPStatusExportPDFServlet extends HttpServlet
remark = request.getParameter("remark"); remark = request.getParameter("remark");
imgName = request.getParameter("imgNameList"); imgName = request.getParameter("imgNameList");
System.out.println("userID inside WIPStatusExportPDFServlet====="+ userID +"---rptTitle----->"+rptTitle + "---remark--->"+remark+"---imgName--->"+imgName); System.out.println("userID inside WIPStatusExportPDFServlet====="+ userID +"---rptTitle----->"+rptTitle + "---remark--->"+remark+"---imgName--->"+imgName);
// call EJB method for PDF creation*******************
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wipStatusRemote = (WIPStatusRemote) context.lookup("ibase/WIPStatus/remote"); wipStatusRemote = (WIPStatusRemote) context.lookup("ibase/WIPStatus/remote");
resultString = wipStatusRemote.getPDFByScheduler(rptTitle,remark,userID,imgName,sessionCity,sessionSiteCode); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
wipStatusRemote.setUserInfo(userInfo);
resultString = wipStatusRemote.getPDFByScheduler(rptTitle,remark,userID,imgName,sessionCity,sessionSiteCode);
response.setContentType("text/html"); response.setContentType("text/html");
if(resultString.equals("false")) if(resultString.equals("false"))
{ {
......
...@@ -32,7 +32,7 @@ public class WIPStatusGridLinkServlet extends HttpServlet ...@@ -32,7 +32,7 @@ public class WIPStatusGridLinkServlet extends HttpServlet
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String month = ""; String month = "";
String loginId ="";
String city = ""; String city = "";
String category = ""; String category = "";
String siteCode = ""; String siteCode = "";
...@@ -40,9 +40,9 @@ public class WIPStatusGridLinkServlet extends HttpServlet ...@@ -40,9 +40,9 @@ public class WIPStatusGridLinkServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
/*HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO"); ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
loginId = userInfo.getLoginCode();*/ loginId = userInfo.getLoginCode();
month = request.getParameter("month"); month = request.getParameter("month");
city = request.getParameter("city"); city = request.getParameter("city");
...@@ -55,6 +55,8 @@ public class WIPStatusGridLinkServlet extends HttpServlet ...@@ -55,6 +55,8 @@ public class WIPStatusGridLinkServlet extends HttpServlet
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wipStatusRemote = (WIPStatusRemote) context.lookup("ibase/WIPStatus/remote"); wipStatusRemote = (WIPStatusRemote) context.lookup("ibase/WIPStatus/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
wipStatusRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)wipStatusRemote.getWIPStatusLinkGrid(city,siteCode,month,category,dataSourceName); JSONObject jsonObjData = (JSONObject)wipStatusRemote.getWIPStatusLinkGrid(city,siteCode,month,category,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -32,20 +32,23 @@ public class WIPStatusGridServlet extends HttpServlet ...@@ -32,20 +32,23 @@ public class WIPStatusGridServlet extends HttpServlet
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String city = ""; String city = "";
String loginId ="";
String siteCode = ""; String siteCode = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
/*HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO"); ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
loginId = userInfo.getLoginCode();*/ loginId = userInfo.getLoginCode();
city = request.getParameter("city").replace("@", "&"); city = request.getParameter("city").replace("@", "&");
siteCode = request.getParameter("siteCode"); siteCode = request.getParameter("siteCode");
System.out.println("in WIPStatusGridServlet city :"+city+"====siteCode :"+siteCode); System.out.println("in WIPStatusGridServlet city :"+city+"====siteCode :"+siteCode);
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wipStatusRemote = (WIPStatusRemote) context.lookup("ibase/WIPStatus/remote"); wipStatusRemote = (WIPStatusRemote) context.lookup("ibase/WIPStatus/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
wipStatusRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)wipStatusRemote.getWIPStatusGrid(city, siteCode, dataSourceName); JSONObject jsonObjData = (JSONObject)wipStatusRemote.getWIPStatusGrid(city, siteCode, dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -2,17 +2,14 @@ package ibase.dashboard.mfg.servlet; ...@@ -2,17 +2,14 @@ package ibase.dashboard.mfg.servlet;
import ibase.dashboard.mfg.ejb.WIPStatusRemote; import ibase.dashboard.mfg.ejb.WIPStatusRemote;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class WIPStatusServlet extends HttpServlet public class WIPStatusServlet extends HttpServlet
...@@ -36,7 +33,8 @@ public class WIPStatusServlet extends HttpServlet ...@@ -36,7 +33,8 @@ public class WIPStatusServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
city = request.getParameter("city").replace("@", "&"); city = request.getParameter("city").replace("@", "&");
siteCode = request.getParameter("siteCode"); siteCode = request.getParameter("siteCode");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
...@@ -47,10 +45,10 @@ public class WIPStatusServlet extends HttpServlet ...@@ -47,10 +45,10 @@ public class WIPStatusServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wipStatusRemote = (WIPStatusRemote) context.lookup("ibase/WIPStatus/remote"); wipStatusRemote = (WIPStatusRemote) context.lookup("ibase/WIPStatus/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
wipStatusRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)wipStatusRemote.getWIPStatus(city, siteCode, dataSourceName); JSONObject jsonObjData = (JSONObject)wipStatusRemote.getWIPStatus(city, siteCode, dataSourceName);
//String jsonObjData = "{'0':{'month':0,'product_catagory':'F','product_value':{'2013':'6','2014':'6'}},'1':{'month':1,'product_catagory':'FRESH','product_value':{'2014':'13','<15 days':'9','>120-180 days':'1','>180 days':'1','>30-60 days':'4','>60-120 days':'5'}}}";
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
//outputStream.write(jsonObjData.toString().replace('\'', '"').getBytes());
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); outputStream.flush();
outputStream.close(); outputStream.close();
......
package ibase.dashboard.scm.ejb; package ibase.dashboard.scm.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
...@@ -15,24 +14,26 @@ public class Attrition extends ValidatorEJB implements AttritionRemote, Attritio ...@@ -15,24 +14,26 @@ public class Attrition extends ValidatorEJB implements AttritionRemote, Attritio
public Attrition() public Attrition()
{} {}
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
//1.This is the main method to show the parent graph //1.This is the main method to show the parent graph
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getAttritionDetails(String dataSourceName, String month) throws RemoteException, ITMException public JSONObject getAttritionDetails(String dataSourceName, String month) throws RemoteException, ITMException
{ {
JSONObject rawDataJson = new JSONObject(); JSONObject rawDataJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt= null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
int count=0; int count=0;
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
......
package ibase.dashboard.scm.ejb; package ibase.dashboard.scm.ejb;
import ibase.dashboard.Report.Utility.DashboardUtility; import ibase.dashboard.Report.Utility.DashboardUtility;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
...@@ -15,9 +14,7 @@ import java.util.Calendar; ...@@ -15,9 +14,7 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
/** /**
...@@ -32,31 +29,31 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -32,31 +29,31 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
public CustomerInfoEJB() { public CustomerInfoEJB() {
} }
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public JSONObject getCurrentReceivable(String custCode, String lastMonth,String dataSourceName) throws RemoteException, ITMException public JSONObject getCurrentReceivable(String custCode, String lastMonth,String dataSourceName) throws RemoteException, ITMException
{ {
JSONObject rawDataCurntRecvbleJson = null; JSONObject rawDataCurntRecvbleJson = null;
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); Date frmDate = null;
//DashboardUtility dashbordUtil = null; Date toDate = null;
Date frmDate = null;
Date toDate = null;
try try
{ {
System.out.println(" Inside CustomerInfoEJB for getCurrentReceivable Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth); System.out.println(" Inside CustomerInfoEJB for getCurrentReceivable Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth);
DashboardUtility dashbordUtil = new DashboardUtility(); DashboardUtility dashbordUtil = new DashboardUtility();
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
rawDataCurntRecvbleJson = new JSONObject(); rawDataCurntRecvbleJson = new JSONObject();
SimpleDateFormat gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); SimpleDateFormat gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!= null && lastMonth.trim().length()>0 )
{ {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
toDate = new Date(cal.get(Calendar.YEAR) - 1900, cal.get(Calendar.MONTH), cal.get(Calendar.DATE)); toDate = new Date(cal.get(Calendar.YEAR) - 1900, cal.get(Calendar.MONTH), cal.get(Calendar.DATE));
...@@ -167,18 +164,18 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -167,18 +164,18 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashbordUtil = null; DashboardUtility dashbordUtil = null;
Date frmDate = null; Date frmDate = null;
Date toDate = null; Date toDate = null;
try try
{ {
System.out.println(" Inside CustomerInfoEJB for getCurrentReceivableChartView Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth); System.out.println(" Inside CustomerInfoEJB for getCurrentReceivableChartView Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
rawDataCurntRecvbleChartJson = new JSONObject(); /*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); rawDataCurntRecvbleChartJson = new JSONObject();
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
{ {
...@@ -349,15 +346,17 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -349,15 +346,17 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
try try
{ {
System.out.println(" Inside CustomerInfoEJB for getPendingOrder Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth); System.out.println(" Inside CustomerInfoEJB for getPendingOrder Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
rawDataPendingOrderJson = new JSONObject(); rawDataPendingOrderJson = new JSONObject();
dashbordUtil = new DashboardUtility(); dashbordUtil = new DashboardUtility();
//start date conversion form //start date conversion form
SimpleDateFormat gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); SimpleDateFormat gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy"); SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy");
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
...@@ -691,7 +690,6 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -691,7 +690,6 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashbordUtil = null; DashboardUtility dashbordUtil = null;
Date frmDate = null; Date frmDate = null;
Date toDate = null; Date toDate = null;
...@@ -699,13 +697,14 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -699,13 +697,14 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
{ {
System.out.println(" Inside CustomerInfoEJB for getOrderHistory Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth); System.out.println(" Inside CustomerInfoEJB for getOrderHistory Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
//start date conversion form //start date conversion form
SimpleDateFormat gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); SimpleDateFormat gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy"); SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy");
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
{ {
...@@ -826,9 +825,7 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -826,9 +825,7 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
System.out.println("rawDataOrderHistoryJson--["+rawDataOrderHistoryJson.toString()+"]"); System.out.println("rawDataOrderHistoryJson--["+rawDataOrderHistoryJson.toString()+"]");
return rawDataOrderHistoryJson; return rawDataOrderHistoryJson;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public JSONObject getSalesHistory(String custCode, String lastMonth,String dataSourceName) throws RemoteException, ITMException public JSONObject getSalesHistory(String custCode, String lastMonth,String dataSourceName) throws RemoteException, ITMException
...@@ -839,7 +836,6 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -839,7 +836,6 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashbordUtil = null; DashboardUtility dashbordUtil = null;
Date frmDate = null; Date frmDate = null;
Date toDate = null; Date toDate = null;
...@@ -847,13 +843,15 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -847,13 +843,15 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
{ {
System.out.println(" Inside CustomerInfoEJB for getSalesHistory Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth); System.out.println(" Inside CustomerInfoEJB for getSalesHistory Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
dashbordUtil = new DashboardUtility(); dashbordUtil = new DashboardUtility();
//start date conversion form //start date conversion form
SimpleDateFormat gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); SimpleDateFormat gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy"); SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy");
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
{ {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
...@@ -982,7 +980,6 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -982,7 +980,6 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashbordUtil = null; DashboardUtility dashbordUtil = null;
Date frmDate = null; Date frmDate = null;
Date toDate = null; Date toDate = null;
...@@ -990,13 +987,15 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -990,13 +987,15 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
{ {
System.out.println(" Inside CustomerInfoEJB for getTransactionSummary Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth); System.out.println(" Inside CustomerInfoEJB for getTransactionSummary Method Data Soruc Name ="+dataSourceName+" custCode:"+custCode+" lastMonth is =" + lastMonth);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
//start date conversion form //start date conversion form
SimpleDateFormat gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); SimpleDateFormat gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy"); SimpleDateFormat graphDateFormat = new SimpleDateFormat("dd-MMM-yy");
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
if(lastMonth!=null && lastMonth.trim().length()>0 ) if(lastMonth!=null && lastMonth.trim().length()>0 )
{ {
...@@ -1061,12 +1060,12 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote, ...@@ -1061,12 +1060,12 @@ public class CustomerInfoEJB extends ValidatorEJB implements CustomerInfoRemote,
rowData.put("no_of_sales", checkNull(rs.getString("NO_OF_SALES"))); rowData.put("no_of_sales", checkNull(rs.getString("NO_OF_SALES")));
rowData.put("sales_value", checkNull(rs.getString("SALES_VALUE"))); rowData.put("sales_value", checkNull(rs.getString("SALES_VALUE")));
rowData.put("receivables", checkNull(rs.getString("RECEIVABLES"))); rowData.put("receivables", checkNull(rs.getString("RECEIVABLES")));
rowData.put("collection", checkNull(rs.getString("COLLECTION"))); rowData.put("collection", checkNull(rs.getString("COLLECTION")));
rowData.put("no_of_dn", checkNull(rs.getString("NO_OF_DN"))); rowData.put("no_of_dn", checkNull(rs.getString("NO_OF_DN")));
rowData.put("dn_value", checkNull(rs.getString("DN_VALUE"))); rowData.put("dn_value", checkNull(rs.getString("DN_VALUE")));
rowData.put("no_of_cn", checkNull(rs.getString("NO_OF_CN"))); rowData.put("no_of_cn", checkNull(rs.getString("NO_OF_CN")));
rowData.put("cn_value", checkNull(rs.getString("CN_VALUE"))); rowData.put("cn_value", checkNull(rs.getString("CN_VALUE")));
rowData.put("no_of_sr",checkNull( rs.getString("NO_OF_SR"))); rowData.put("no_of_sr", checkNull( rs.getString("NO_OF_SR")));
rowData.put("sr_value", checkNull(rs.getString("SR_VALUE"))); rowData.put("sr_value", checkNull(rs.getString("SR_VALUE")));
rawDataTrnsctionSumryJson.put(count, rowData); rawDataTrnsctionSumryJson.put(count, rowData);
count++; count++;
......
package ibase.dashboard.scm.ejb; package ibase.dashboard.scm.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
/** /**
...@@ -32,6 +25,7 @@ public class DivMonthlyStatus extends ValidatorEJB implements DivMonthlyStatusRe ...@@ -32,6 +25,7 @@ public class DivMonthlyStatus extends ValidatorEJB implements DivMonthlyStatusRe
{ {
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
//Method :1 for Grid //Method :1 for Grid
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
...@@ -581,40 +575,41 @@ public class DivMonthlyStatus extends ValidatorEJB implements DivMonthlyStatusRe ...@@ -581,40 +575,41 @@ public class DivMonthlyStatus extends ValidatorEJB implements DivMonthlyStatusRe
+" AND b.fin_year=a.fin_year AND d.fin_year=a.fin_year " +" AND b.fin_year=a.fin_year AND d.fin_year=a.fin_year "
+" AND trim(a.item_ser)=trim(c.table_no) AND c.finyr = SUBSTR(a.fin_year,3,2)||SUBSTR(a.fin_year,6,2)))"; +" AND trim(a.item_ser)=trim(c.table_no) AND c.finyr = SUBSTR(a.fin_year,3,2)||SUBSTR(a.fin_year,6,2)))";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
int count = 0; int count = 0;
while (rs.next()) while (rs.next())
{ {
rowData = new JSONObject(); rowData = new JSONObject();
rowData.put("div_descr", checkNull(rs.getString("DIVISION"))); rowData.put("div_descr", checkNull(rs.getString("DIVISION")));
rowData.put("cysl_trgt", checkNull(rs.getString("CYSL_TRGT"))); rowData.put("cysl_trgt", checkNull(rs.getString("CYSL_TRGT")));
rowData.put("mth_ho_ach", checkNull(rs.getString("MTH_HO_ACH"))); rowData.put("mth_ho_ach", checkNull(rs.getString("MTH_HO_ACH")));
rowData.put("mth_ly_sales", checkNull(rs.getString("MTH_LY_SALES"))); rowData.put("mth_ly_sales",checkNull(rs.getString("MTH_LY_SALES")));
rowData.put("mth_bud_gr", checkNull(rs.getString("MTH_BUD_GR"))); rowData.put("mth_bud_gr", checkNull(rs.getString("MTH_BUD_GR")));
rowData.put("no_of_so", checkNull(rs.getString("NO_OF_SO"))); rowData.put("no_of_so", checkNull(rs.getString("NO_OF_SO")));
rowData.put("bud_inc_pmpm", checkNull(rs.getString("BUD_INC_PMPM"))); rowData.put("bud_inc_pmpm",checkNull(rs.getString("BUD_INC_PMPM")));
rowData.put("retu_ytd", checkNull(rs.getString("RETU_YTD"))); rowData.put("retu_ytd", checkNull(rs.getString("RETU_YTD")));
rowData.put("retu_ytd_prct", checkNull(rs.getString("RETU_YTD_PRCT"))); rowData.put("retu_ytd_prct",checkNull(rs.getString("RETU_YTD_PRCT")));
rowData.put("act_pft_mth", checkNull(rs.getString("ACT_PFT_MTH"))); rowData.put("act_pft_mth", checkNull(rs.getString("ACT_PFT_MTH")));
rowData.put("terrcnt", checkNull(rs.getString("TERRCNT"))); rowData.put("terrcnt", checkNull(rs.getString("TERRCNT")));
rowData.put("terr_ach_cnt", checkNull(rs.getString("TERR_ACH_CNT"))); rowData.put("terr_ach_cnt", checkNull(rs.getString("TERR_ACH_CNT")));
rowData.put("ach_st", checkNull(rs.getString("ACH_ST"))); rowData.put("ach_st", checkNull(rs.getString("ACH_ST")));
rowData.put("gr_st", checkNull(rs.getString("GR_ST"))); rowData.put("gr_st", checkNull(rs.getString("GR_ST")));
rowData.put("incpmpm_st", checkNull(rs.getString("INCPMPM_ST"))); rowData.put("incpmpm_st", checkNull(rs.getString("INCPMPM_ST")));
rowData.put("sret_st", checkNull(rs.getString("SRET_ST"))); rowData.put("sret_st", checkNull(rs.getString("SRET_ST")));
rowData.put("pft_st", checkNull(rs.getString("PFT_ST"))); rowData.put("pft_st", checkNull(rs.getString("PFT_ST")));
rowData.put("soach_st", checkNull(rs.getString("SOACH_ST"))); rowData.put("soach_st", checkNull(rs.getString("SOACH_ST")));
rowData.put("tot_cnt", checkNull(rs.getString("TOT_CNT"))); rowData.put("tot_cnt", checkNull(rs.getString("TOT_CNT")));
rowData.put("rnk", checkNull(rs.getString("RNK"))); rowData.put("rnk", checkNull(rs.getString("RNK")));
rawDataJson.put(count, rowData); rawDataJson.put(count, rowData);
count++; count++;
} }
......
package ibase.dashboard.scm.ejb; package ibase.dashboard.scm.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
...@@ -21,7 +21,7 @@ public class ItemInfoEJB extends ValidatorEJB implements ItemInfoRemote, ItemInf ...@@ -21,7 +21,7 @@ public class ItemInfoEJB extends ValidatorEJB implements ItemInfoRemote, ItemInf
public ItemInfoEJB() { public ItemInfoEJB() {
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public JSONObject getCurrentInventory(String itmCode, String prdCode,String dataSourceName) throws RemoteException, ITMException public JSONObject getCurrentInventory(String itmCode, String prdCode,String dataSourceName) throws RemoteException, ITMException
...@@ -31,21 +31,20 @@ public class ItemInfoEJB extends ValidatorEJB implements ItemInfoRemote, ItemInf ...@@ -31,21 +31,20 @@ public class ItemInfoEJB extends ValidatorEJB implements ItemInfoRemote, ItemInf
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println(" Inside ItemInfoEJB for getCurrentInventory Method Data Soruc Name ="+dataSourceName+" custCode:"+itmCode+" prdCode is =" + prdCode); System.out.println(" Inside ItemInfoEJB for getCurrentInventory Method Data Soruc Name ="+dataSourceName+" custCode:"+itmCode+" prdCode is =" + prdCode);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:15062016 by Nikhil*/
sql = " /*Put Sql Query */"; conn = getConnection();
sql = " /*Put Sql Query */";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
int count = 0; int count = 0;
while (rs.next()) while (rs.next())
{ {
...@@ -104,21 +103,20 @@ public class ItemInfoEJB extends ValidatorEJB implements ItemInfoRemote, ItemInf ...@@ -104,21 +103,20 @@ public class ItemInfoEJB extends ValidatorEJB implements ItemInfoRemote, ItemInf
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println(" Inside ItemInfoEJB for getSalesHistoryInfoQty Method Data Soruc Name ="+dataSourceName+" custCode:"+itmCode+" prdCode is =" + prdCode); System.out.println(" Inside ItemInfoEJB for getSalesHistoryInfoQty Method Data Soruc Name ="+dataSourceName+" custCode:"+itmCode+" prdCode is =" + prdCode);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
sql = " /*Put Sql Query */"; conn = getConnection();
sql = " /*Put Sql Query */";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
int count = 0; int count = 0;
while (rs.next()) while (rs.next())
{ {
......
package ibase.dashboard.scm.ejb; package ibase.dashboard.scm.ejb;
import ibase.dashboard.Report.Utility.DashboardUtility; import ibase.dashboard.Report.Utility.DashboardUtility;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -25,30 +22,31 @@ public class OrderVsShipmentEJB extends ValidatorEJB implements OrderVsShipmentR ...@@ -25,30 +22,31 @@ public class OrderVsShipmentEJB extends ValidatorEJB implements OrderVsShipmentR
public OrderVsShipmentEJB() { public OrderVsShipmentEJB() {
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getmonthWiseDespatchOrders(String lastMonth,String siteCode,String custCode,String custCodeDlv,String dataSourceName) throws RemoteException, ITMException public JSONObject getmonthWiseDespatchOrders(String lastMonth,String siteCode,String custCode,String custCodeDlv,String dataSourceName) throws RemoteException, ITMException
{ {
JSONObject monthWiseDespatchOrdersJson = new JSONObject(); JSONObject monthWiseDespatchOrdersJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashbordUtil = null; DashboardUtility dashbordUtil = null;
String custCodeSorder=""; String custCodeSorder ="";
String custCodeDespatch=""; String custCodeDespatch ="";
String custCodeDlvSorder=""; String custCodeDlvSorder ="";
String custCodeDlvDespatch=""; String custCodeDlvDespatch="";
try try
{ {
System.out.println(" Inside DespatchOrder for getmonthWiseDespatchOrders() Method Data Soruc Name ="+dataSourceName+" siteCode:"+siteCode +"lastMonth:="+lastMonth+ " custCode:="+custCode+" custCodeDlv:="+custCodeDlv); System.out.println(" Inside DespatchOrder for getmonthWiseDespatchOrders() Method Data Soruc Name ="+dataSourceName+" siteCode:"+siteCode +"lastMonth:="+lastMonth+ " custCode:="+custCode+" custCodeDlv:="+custCodeDlv);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
dashbordUtil = new DashboardUtility(); /*add new code for connection DB on dated:15062016 by Nikhil*/
siteCode= dashbordUtil.getCommaSeparated(siteCode); conn = getConnection();
dashbordUtil = new DashboardUtility();
siteCode = dashbordUtil.getCommaSeparated(siteCode);
//lastMonth="6"; //lastMonth="6";
//start code for customer code and customer code dlv as dynamic input //start code for customer code and customer code dlv as dynamic input
......
package ibase.dashboard.scm.ejb; package ibase.dashboard.scm.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
/** /**
* Session Bean implementation class SalesPersonSales * Session Bean implementation class SalesPersonSales
...@@ -18,7 +20,7 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote ...@@ -18,7 +20,7 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote
public SalesInventory() public SalesInventory()
{} {}
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
//1.This is the main method to show the parent graph //1.This is the main method to show the parent graph
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getSalesInventoryDivWise(String dataSourceName, String month, String nomns) throws RemoteException, ITMException public JSONObject getSalesInventoryDivWise(String dataSourceName, String month, String nomns) throws RemoteException, ITMException
...@@ -26,17 +28,17 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote ...@@ -26,17 +28,17 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote
JSONObject rawDataJson = new JSONObject(); JSONObject rawDataJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear= "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
int count=0; int count=0;
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
...@@ -96,8 +98,6 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote ...@@ -96,8 +98,6 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote
rowData.put("noofmth_invtry", rs.getString("noofmth_invtry")); rowData.put("noofmth_invtry", rs.getString("noofmth_invtry"));
rawDataJson.put(count, rowData); rawDataJson.put(count, rowData);
count++; count++;
} }
} }
...@@ -141,17 +141,17 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote ...@@ -141,17 +141,17 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote
JSONObject rawDataJson = new JSONObject(); JSONObject rawDataJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
int count=0; int count=0;
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
...@@ -288,9 +288,9 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote ...@@ -288,9 +288,9 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote
rowData.put("siliguri", checkNull(rs.getString("SILIGURI"))); rowData.put("siliguri", checkNull(rs.getString("SILIGURI")));
rowData.put("vapi", checkNull(rs.getString("VAPI"))); rowData.put("vapi", checkNull(rs.getString("VAPI")));
rowData.put("vijayawada", checkNull(rs.getString("VIJAYAWADA"))); rowData.put("vijayawada", checkNull(rs.getString("VIJAYAWADA")));
rowData.put("zirakpur", checkNull(rs.getString("ZIRAKPUR"))); rowData.put("zirakpur", checkNull(rs.getString("ZIRAKPUR")));
rowData.put("kolkata", checkNull(rs.getString("KOLKATA"))); rowData.put("kolkata", checkNull(rs.getString("KOLKATA")));
rowData.put("newdelhi", checkNull(rs.getString("NEWDELHI"))); rowData.put("newdelhi", checkNull(rs.getString("NEWDELHI")));
rawDataJson.put(count, rowData); rawDataJson.put(count, rowData);
count++; count++;
......
package ibase.dashboard.scm.ejb; package ibase.dashboard.scm.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
...@@ -24,10 +24,7 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -24,10 +24,7 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
public SalesPerformance() public SalesPerformance()
{ {
} }
/*** /***
* Method Name : getSalesGraphData(String dataSourceName, String month) * Method Name : getSalesGraphData(String dataSourceName, String month)
* Servlet Name : SalesPerfrmncSalesGrphServlet * Servlet Name : SalesPerfrmncSalesGrphServlet
...@@ -36,23 +33,23 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -36,23 +33,23 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
* Graph Caption : * Graph Caption :
* 1. Monthly Sales trend - India BU * 1. Monthly Sales trend - India BU
* ***/ * ***/
E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getSalesGraphData(String dataSourceName, String month) throws RemoteException, ITMException public JSONObject getSalesGraphData(String dataSourceName, String month) throws RemoteException, ITMException
{ {
JSONObject rawDataJson = new JSONObject(); JSONObject rawDataJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt= null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
int count=0; int count=0;
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
...@@ -527,17 +524,18 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -527,17 +524,18 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
public JSONObject getProfitGraphData(String dataSourceName, String month) throws RemoteException, ITMException public JSONObject getProfitGraphData(String dataSourceName, String month) throws RemoteException, ITMException
{ {
JSONObject rawDataJson = new JSONObject(); JSONObject rawDataJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
int count=0; int count=0;
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
...@@ -1177,19 +1175,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -1177,19 +1175,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
public JSONObject getMnthlySalesGraphData(String dataSourceName, String month) throws RemoteException, ITMException public JSONObject getMnthlySalesGraphData(String dataSourceName, String month) throws RemoteException, ITMException
{ {
JSONObject rawDataMthlySalesJson = new JSONObject(); JSONObject rawDataMthlySalesJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); String sql = "";
String sql = ""; String finYear = "";
String finYear="";
try try
{ {
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
System.out.println("Comming month inside getMnthlySalesGraphData ==="+month); System.out.println("Comming month inside getMnthlySalesGraphData ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03")) if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03"))
...@@ -1436,19 +1435,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -1436,19 +1435,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
public JSONObject getYTDSalesGraphData(String dataSourceName,String month) throws RemoteException, ITMException public JSONObject getYTDSalesGraphData(String dataSourceName,String month) throws RemoteException, ITMException
{ {
JSONObject rawDataYTDSalesJson = new JSONObject(); JSONObject rawDataYTDSalesJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
System.out.println("Comming month inside getYTDSalesGraphData ==="+month); System.out.println("Comming month inside getYTDSalesGraphData ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03")) if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03"))
...@@ -1639,22 +1639,22 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -1639,22 +1639,22 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
rowData = new JSONObject(); rowData = new JSONObject();
rowData.put("division_grp", checkNull(rs.getString("div_group"))); rowData.put("division_grp", checkNull(rs.getString("div_group")));
rowData.put("sal", rs.getString("ytd_cy_sales")); rowData.put("sal", rs.getString("ytd_cy_sales"));
rowData.put("gr", rs.getString("ytd_gr")); rowData.put("gr", rs.getString("ytd_gr"));
rowData.put("ho_ach", rs.getString("YTD_ACH_PER")); rowData.put("ho_ach", rs.getString("YTD_ACH_PER"));
//check property in sql nowwwwwww-- //check property in sql nowwwwwww--
//add new property for YTD on 8/01/2015 by Birendra Pandey //add new property for YTD on 8/01/2015 by Birendra Pandey
rowData.put("ytd_ly_sales", rs.getString("YTD_LY_SALES")); rowData.put("ytd_ly_sales", rs.getString("YTD_LY_SALES"));
rowData.put("ytd_ho_trgt", rs.getString("YTD_HO_TRGT")); rowData.put("ytd_ho_trgt", rs.getString("YTD_HO_TRGT"));
rowData.put("retu_ytd_prct", rs.getString("RETU_YTD_PRCT")); rowData.put("retu_ytd_prct", rs.getString("RETU_YTD_PRCT"));
//Add new new property on date 8-Jan-15 by Birendra Pandey for Month sales graph //Add new new property on date 8-Jan-15 by Birendra Pandey for Month sales graph
rowData.put("reqd_mthly", rs.getString("REQD_MTHLY")); rowData.put("reqd_mthly", rs.getString("REQD_MTHLY"));
rowData.put("avg_mthly", rs.getString("AVG_MTHLY")); rowData.put("avg_mthly", rs.getString("AVG_MTHLY"));
rowData.put("mth_cy_sales", rs.getString("MTH_CY_SALES")); rowData.put("mth_cy_sales", rs.getString("MTH_CY_SALES"));
rowData.put("mth_ho_trgt", rs.getString("MTH_HO_TRGT")); rowData.put("mth_ho_trgt", rs.getString("MTH_HO_TRGT"));
rowData.put("mth_gr", rs.getString("MTH_GR")); rowData.put("mth_gr", rs.getString("MTH_GR"));
//add new property for PMPM on 8/01/2015 by Birendra Pandey //add new property for PMPM on 8/01/2015 by Birendra Pandey
rowData.put("pmpm", rs.getString("PMPM")); rowData.put("pmpm", rs.getString("PMPM"));
rowData.put("pmpm_ly", rs.getString("PMPM_LY")); rowData.put("pmpm_ly", rs.getString("PMPM_LY"));
//end of code by Birendra //end of code by Birendra
...@@ -1718,19 +1718,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -1718,19 +1718,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
JSONObject rawDataYTDSalesJson = new JSONObject(); JSONObject rawDataYTDSalesJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear ="";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(month!=null && month.trim().length()>0 && divGrp!=null) if(month!=null && month.trim().length()>0 && divGrp!=null)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
divGrp=divGrp.trim(); divGrp=divGrp.trim();
System.out.println("Comming month inside getDivisionWiseGraph ==="+month); System.out.println("Comming month inside getDivisionWiseGraph ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
...@@ -1998,18 +1999,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -1998,18 +1999,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
JSONObject rawDataYTDSalesJson = new JSONObject(); JSONObject rawDataYTDSalesJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(month!=null && month.trim().length()>0 && divDescr!=null) if(month!=null && month.trim().length()>0 && divDescr!=null)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
divDescr=divDescr.trim(); divDescr=divDescr.trim();
System.out.println("Comming month inside getTopBrandYTD ==="+month); System.out.println("Comming month inside getTopBrandYTD ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
...@@ -2204,18 +2206,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -2204,18 +2206,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
JSONObject rawDataYTDSalesJson = new JSONObject(); JSONObject rawDataYTDSalesJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(month!=null && month.trim().length()>0 && divDescr!=null) if(month!=null && month.trim().length()>0 && divDescr!=null)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
divDescr=divDescr.trim(); divDescr=divDescr.trim();
System.out.println("Comming month inside getTopBrandMTH ==="+month); System.out.println("Comming month inside getTopBrandMTH ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
...@@ -2428,18 +2431,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -2428,18 +2431,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
JSONObject rawDataZoneWiseJson = new JSONObject(); JSONObject rawDataZoneWiseJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
System.out.println("Comming month inside getZoneWiseDetail ==="+month); System.out.println("Comming month inside getZoneWiseDetail ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03")) if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03"))
...@@ -2733,18 +2737,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -2733,18 +2737,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
JSONObject rawDataResionWiseJson = new JSONObject(); JSONObject rawDataResionWiseJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
System.out.println("Comming month inside getZoneWiseMetroDetail ==="+month); System.out.println("Comming month inside getZoneWiseMetroDetail ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03")) if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03"))
...@@ -2965,7 +2970,7 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -2965,7 +2970,7 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
int count = 0; int count = 0;
while (rs.next()) while (rs.next())
{ {
...@@ -3043,18 +3048,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -3043,18 +3048,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
JSONObject rawDataZoneWiseJson = new JSONObject(); JSONObject rawDataZoneWiseJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
System.out.println("Comming month inside getBrandWiseZoneDetail ==="+month); System.out.println("Comming month inside getBrandWiseZoneDetail ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03")) if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03"))
...@@ -3278,20 +3284,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -3278,20 +3284,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
rowData = new JSONObject(); rowData = new JSONObject();
rowData.put("zone_descr", checkNull(rs.getString("ZONE_DESCR"))); rowData.put("zone_descr", checkNull(rs.getString("ZONE_DESCR")));
rowData.put("ytd_cy_sales", rs.getString("ytd_cy_sales")); rowData.put("ytd_cy_sales", rs.getString("ytd_cy_sales"));
rowData.put("ytd_gr", rs.getString("ytd_gr")); rowData.put("ytd_gr", rs.getString("ytd_gr"));
rowData.put("ytd_ach_extra", rs.getString("ytd_ach_extra")); rowData.put("ytd_ach_extra",rs.getString("ytd_ach_extra"));
rowData.put("ytd_ach_per", rs.getString("ytd_ach_per")); rowData.put("ytd_ach_per", rs.getString("ytd_ach_per"));
rowData.put("ytd_ly_sales", rs.getString("YTD_LY_SALES")); rowData.put("ytd_ly_sales", rs.getString("YTD_LY_SALES"));
rowData.put("ytd_ho_trgt", rs.getString("YTD_HO_TRGT")); rowData.put("ytd_ho_trgt", rs.getString("YTD_HO_TRGT"));
rowData.put("retu_ytd_prct", rs.getString("RETU_YTD_PRCT")); rowData.put("retu_ytd_prct",rs.getString("RETU_YTD_PRCT"));
rowData.put("reqd_mthly", rs.getString("REQD_MTHLY")); rowData.put("reqd_mthly", rs.getString("REQD_MTHLY"));
rowData.put("avg_mthly", rs.getString("AVG_MTHLY")); rowData.put("avg_mthly", rs.getString("AVG_MTHLY"));
rowData.put("mth_cy_sales", rs.getString("MTH_CY_SALES")); rowData.put("mth_cy_sales", rs.getString("MTH_CY_SALES"));
rowData.put("mth_ho_trgt", rs.getString("MTH_HO_TRGT")); rowData.put("mth_ho_trgt", rs.getString("MTH_HO_TRGT"));
rowData.put("mth_ach_per", rs.getString("MTH_ACH_PER")); rowData.put("mth_ach_per", rs.getString("MTH_ACH_PER"));
rowData.put("mth_gr", rs.getString("MTH_GR")); rowData.put("mth_gr", rs.getString("MTH_GR"));
rowData.put("pmpm", rs.getString("PMPM")); rowData.put("pmpm", rs.getString("PMPM"));
rowData.put("pmpm_ly", rs.getString("PMPM_LY")); rowData.put("pmpm_ly", rs.getString("PMPM_LY"));
rawDataZoneWiseJson.put(count, rowData); rawDataZoneWiseJson.put(count, rowData);
count++; count++;
...@@ -3352,18 +3358,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -3352,18 +3358,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
JSONObject rawDataMetroWiseJson = new JSONObject(); JSONObject rawDataMetroWiseJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
System.out.println("Comming month inside getBrandZoneWiseMetroDetail ==="+month); System.out.println("Comming month inside getBrandZoneWiseMetroDetail ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03")) if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03"))
...@@ -3583,7 +3590,7 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -3583,7 +3590,7 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
int count = 0; int count = 0;
while (rs.next()) while (rs.next())
{ {
...@@ -3662,18 +3669,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -3662,18 +3669,19 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
JSONObject rawDataMnthDivWiseSalesJson = new JSONObject(); JSONObject rawDataMnthDivWiseSalesJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String finYear=""; String finYear = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(month!=null && month.trim().length()>0) if(month!=null && month.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
System.out.println("Comming month inside getMnthSalesDivWiseGraphData ==="+month); System.out.println("Comming month inside getMnthSalesDivWiseGraphData ==="+month);
String selectedMonth = month.substring(4, 6); String selectedMonth = month.substring(4, 6);
if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03")) if(selectedMonth.trim().equalsIgnoreCase("01") ||selectedMonth.trim().equalsIgnoreCase("02") ||selectedMonth.trim().equalsIgnoreCase("03"))
...@@ -3778,19 +3786,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -3778,19 +3786,20 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
{ {
JSONObject rawDataGlobleChildGridJson = new JSONObject(); JSONObject rawDataGlobleChildGridJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); String brandName = "";
String brandName="";
try try
{ {
System.out.println("linkMetadate------>"+linkMetadate); System.out.println("linkMetadate------>"+linkMetadate);
if(month!=null && month.trim().length()>0 && parameters!=null) if(month!=null && month.trim().length()>0 && parameters!=null)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
if(linkMetadate.equals("topbrandgridchild")) if(linkMetadate.equals("topbrandgridchild"))
{ {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
package ibase.dashboard.scm.ejb; package ibase.dashboard.scm.ejb;
import ibase.dashboard.Report.Utility.DashboardUtility; import ibase.dashboard.Report.Utility.DashboardUtility;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility; import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -24,7 +25,7 @@ public class StateWiseStock extends ValidatorEJB implements StateWiseStockRemote ...@@ -24,7 +25,7 @@ public class StateWiseStock extends ValidatorEJB implements StateWiseStockRemote
public StateWiseStock() public StateWiseStock()
{} {}
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getIndiaMap(String dataSourceName, String month, String brand,String division, String viewOptionSelectd) throws RemoteException, ITMException public JSONObject getIndiaMap(String dataSourceName, String month, String brand,String division, String viewOptionSelectd) throws RemoteException, ITMException
{ {
...@@ -32,18 +33,17 @@ public class StateWiseStock extends ValidatorEJB implements StateWiseStockRemote ...@@ -32,18 +33,17 @@ public class StateWiseStock extends ValidatorEJB implements StateWiseStockRemote
JSONObject rawDataIndiaMapJson = new JSONObject(); JSONObject rawDataIndiaMapJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
DashboardUtility dashbordUtil = null; DashboardUtility dashbordUtil = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String brandStr = ""; String brandStr = "";
String divisionStr = ""; String divisionStr = "";
int count = 0; int count = 0;
String previousStateId = ""; String previousStateId = "";
StringBuffer toolTextStr = new StringBuffer(); StringBuffer toolTextStr = new StringBuffer();
double siteInvtry = 0.0; double siteInvtry = 0.0;
String stateId =""; String stateId = "";
double avgValue = 0.0; double avgValue = 0.0;
double maxValue = 0.0; double maxValue = 0.0;
ArrayList<Double> maxValList = new ArrayList<Double>(); ArrayList<Double> maxValList = new ArrayList<Double>();
...@@ -52,9 +52,10 @@ public class StateWiseStock extends ValidatorEJB implements StateWiseStockRemote ...@@ -52,9 +52,10 @@ public class StateWiseStock extends ValidatorEJB implements StateWiseStockRemote
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
dashbordUtil = new DashboardUtility(); dashbordUtil = new DashboardUtility();
System.out.println("in StateWiseStock month :"+month+"-----brand :"+brand+"-----division : "+division+"----viewOptionSelectd :"+viewOptionSelectd); System.out.println("in StateWiseStock month :"+month+"-----brand :"+brand+"-----division : "+division+"----viewOptionSelectd :"+viewOptionSelectd);
...@@ -206,8 +207,7 @@ public class StateWiseStock extends ValidatorEJB implements StateWiseStockRemote ...@@ -206,8 +207,7 @@ public class StateWiseStock extends ValidatorEJB implements StateWiseStockRemote
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
stateId = rs.getString("CODE"); stateId = rs.getString("CODE");
if(!previousStateId.equals(stateId)) if(!previousStateId.equals(stateId))
......
package ibase.dashboard.scm.ejb; package ibase.dashboard.scm.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
...@@ -21,31 +21,31 @@ public class SupplierInfoEJB extends ValidatorEJB implements SupplierInfoRemote, ...@@ -21,31 +21,31 @@ public class SupplierInfoEJB extends ValidatorEJB implements SupplierInfoRemote,
public SupplierInfoEJB() { public SupplierInfoEJB() {
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public JSONObject getPendingPurchase(String suppCode, String prdCode,String dataSourceName) throws RemoteException, ITMException public JSONObject getPendingPurchase(String suppCode, String prdCode,String dataSourceName) throws RemoteException, ITMException
{ {
JSONObject rawDataPendingPurchJson = new JSONObject(); JSONObject rawDataPendingPurchJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println(" Inside SupplierInfoEJB for getPendingPurchase Method Data Soruc Name ="+dataSourceName+" suppCode:"+suppCode+" prdCode is =" + prdCode); System.out.println(" Inside SupplierInfoEJB for getPendingPurchase Method Data Soruc Name ="+dataSourceName+" suppCode:"+suppCode+" prdCode is =" + prdCode);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:15062016 by Nikhil*/
conn = getConnection();
sql = " /*Put Sql Query */"; sql = " /*Put Sql Query */";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
int count = 0; int count = 0;
while (rs.next()) while (rs.next())
{ {
...@@ -96,9 +96,6 @@ public class SupplierInfoEJB extends ValidatorEJB implements SupplierInfoRemote, ...@@ -96,9 +96,6 @@ public class SupplierInfoEJB extends ValidatorEJB implements SupplierInfoRemote,
return rawDataPendingPurchJson; return rawDataPendingPurchJson;
} }
private String getGeolocation(String geoLocation) private String getGeolocation(String geoLocation)
{ {
String[] geoLocArray = this.getSplitedStrng(geoLocation); String[] geoLocArray = this.getSplitedStrng(geoLocation);
......
...@@ -3,13 +3,17 @@ package ibase.dashboard.scm.servlet; ...@@ -3,13 +3,17 @@ package ibase.dashboard.scm.servlet;
import ibase.dashboard.scm.ejb.SalesPerformanceTwoRemote; import ibase.dashboard.scm.ejb.SalesPerformanceTwoRemote;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class AllIndiaTopBrandServlet extends HttpServlet public class AllIndiaTopBrandServlet extends HttpServlet
{ {
...@@ -24,22 +28,27 @@ public class AllIndiaTopBrandServlet extends HttpServlet ...@@ -24,22 +28,27 @@ public class AllIndiaTopBrandServlet extends HttpServlet
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
SalesPerformanceTwoRemote salesPerformanceTwo = null; SalesPerformanceTwoRemote salesPerformanceTwo = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String topNos = "", month = ""; String topNos = "";
String month = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
/*Added session by Nikhil On dated 13 June 2016*/
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
/*Ended session by Nikhil On dated 13 June 2016*/
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos); System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getAllIndiaTopBrandData(dataSourceName,month,topNos); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getAllIndiaTopBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); outputStream.flush();
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class AttritionServlet extends HttpServlet public class AttritionServlet extends HttpServlet
...@@ -25,18 +26,22 @@ public class AttritionServlet extends HttpServlet ...@@ -25,18 +26,22 @@ public class AttritionServlet extends HttpServlet
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
AttritionRemote attritionRemote = null; AttritionRemote attritionRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String month = ""; String month = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
System.out.println(" month======" + month); System.out.println(" month======" + month);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
attritionRemote = (AttritionRemote) context.lookup("ibase/Attrition/remote"); attritionRemote = (AttritionRemote) context.lookup("ibase/Attrition/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
attritionRemote.setUserInfo(userInfo);
//Here invoke EJB define method //Here invoke EJB define method
JSONObject jsonObjData = (JSONObject)attritionRemote.getAttritionDetails(dataSourceName, month); JSONObject jsonObjData = (JSONObject)attritionRemote.getAttritionDetails(dataSourceName, month);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class BrandWiseZoneServlet extends HttpServlet public class BrandWiseZoneServlet extends HttpServlet
...@@ -19,23 +20,26 @@ public class BrandWiseZoneServlet extends HttpServlet ...@@ -19,23 +20,26 @@ public class BrandWiseZoneServlet extends HttpServlet
{ {
doPost(request, response); doPost(request, response);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
SalesPerformanceRemote salesPerformance = null; SalesPerformanceRemote salesPerformance = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String month = "",brandName="",zonedescr="",divGrp=""; String month = "",brandName="",zonedescr="",divGrp="";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
dataSourceName = request.getParameter("dataSourceName"); HttpSession session = request.getSession(true);
month = (request.getParameter("month")); ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month"));
brandName = (request.getParameter("brandname")); brandName = (request.getParameter("brandname"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getBrandWiseZoneDetail(dataSourceName,month,brandName); JSONObject jsonObjData = (JSONObject)salesPerformance.getBrandWiseZoneDetail(dataSourceName,month,brandName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class BrandZoneWiseMetroServlet extends HttpServlet public class BrandZoneWiseMetroServlet extends HttpServlet
...@@ -19,25 +20,28 @@ public class BrandZoneWiseMetroServlet extends HttpServlet ...@@ -19,25 +20,28 @@ public class BrandZoneWiseMetroServlet extends HttpServlet
{ {
doPost(request, response); doPost(request, response);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
SalesPerformanceRemote salesPerformance = null; SalesPerformanceRemote salesPerformance = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String month = "",brandName="",zonedescr="",divDescr=""; String month = "",brandName="",zonedescr="",divDescr="";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
dataSourceName = request.getParameter("dataSourceName"); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
brandName = (request.getParameter("brandname")); brandName = (request.getParameter("brandname"));
zonedescr= (request.getParameter("zonedescr")); zonedescr = (request.getParameter("zonedescr"));
divDescr = (request.getParameter("divdescr")); divDescr = (request.getParameter("divdescr"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getBrandZoneWiseMetroDetail(dataSourceName,month,brandName,zonedescr,divDescr); JSONObject jsonObjData = (JSONObject)salesPerformance.getBrandZoneWiseMetroDetail(dataSourceName,month,brandName,zonedescr,divDescr);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -32,13 +33,16 @@ public class CNSDivisionBrandServlet extends HttpServlet ...@@ -32,13 +33,16 @@ public class CNSDivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos); System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getCNSDivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getCNSDivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,7 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,7 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class CVDDivisionBrandServlet extends HttpServlet public class CVDDivisionBrandServlet extends HttpServlet
...@@ -32,13 +32,16 @@ public class CVDDivisionBrandServlet extends HttpServlet ...@@ -32,13 +32,16 @@ public class CVDDivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos); System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getCVDDivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getCVDDivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -31,25 +31,26 @@ public class CurntInvServlet extends HttpServlet ...@@ -31,25 +31,26 @@ public class CurntInvServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String itmCode = ""; String itmCode = "";
String prdCode = ""; String prdCode = "";
String reportName=""; String reportName = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
dataSourceName =request.getParameter("dataSourceName"); ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
itmCode =request.getParameter("itmCode"); dataSourceName = request.getParameter("dataSourceName");
prdCode =request.getParameter("prdCode"); itmCode = request.getParameter("itmCode");
reportName = request.getParameter("reportName"); prdCode = request.getParameter("prdCode");
reportName = request.getParameter("reportName");
System.out.println("in doPost" + "itmCode is =" + itmCode ); System.out.println("in doPost" + "itmCode is =" + itmCode );
System.out.println( "prdCode is =" + prdCode ); System.out.println( "prdCode is =" + prdCode );
session.setAttribute("reportName", reportName); session.setAttribute("reportName", reportName);
System.out.println("reportName is =" + reportName ); System.out.println("reportName is =" + reportName );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
itmInfoRemote = (ItemInfoRemote)context.lookup("ibase/ItemInfoEJB/remote"); itmInfoRemote = (ItemInfoRemote)context.lookup("ibase/ItemInfoEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
itmInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)itmInfoRemote.getCurrentInventory(itmCode,prdCode,dataSourceName); JSONObject jsonObjData = (JSONObject)itmInfoRemote.getCurrentInventory(itmCode,prdCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,7 +10,6 @@ import javax.servlet.http.HttpServlet; ...@@ -10,7 +10,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class CurntRecvbleChartServlet extends HttpServlet public class CurntRecvbleChartServlet extends HttpServlet
...@@ -28,13 +27,14 @@ public class CurntRecvbleChartServlet extends HttpServlet ...@@ -28,13 +27,14 @@ public class CurntRecvbleChartServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String custCode = ""; String custCode = "";
String lastMonth = ""; String lastMonth = "";
String reportName=""; String reportName = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName =request.getParameter("dataSourceName"); dataSourceName =request.getParameter("dataSourceName");
custCode =request.getParameter("custCode"); custCode =request.getParameter("custCode");
lastMonth =request.getParameter("prdCode"); lastMonth =request.getParameter("prdCode");
...@@ -46,6 +46,8 @@ public class CurntRecvbleChartServlet extends HttpServlet ...@@ -46,6 +46,8 @@ public class CurntRecvbleChartServlet extends HttpServlet
System.out.println("lastMonth in CurntRecvbleChartServlet ==" + lastMonth ); System.out.println("lastMonth in CurntRecvbleChartServlet ==" + lastMonth );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote"); custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
custInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)custInfoRemote.getCurrentReceivableChartView(custCode,lastMonth,dataSourceName); JSONObject jsonObjData = (JSONObject)custInfoRemote.getCurrentReceivableChartView(custCode,lastMonth,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,7 +10,6 @@ import javax.servlet.http.HttpServlet; ...@@ -10,7 +10,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class CurntRecvbleServlet extends HttpServlet public class CurntRecvbleServlet extends HttpServlet
...@@ -38,6 +37,7 @@ public class CurntRecvbleServlet extends HttpServlet ...@@ -38,6 +37,7 @@ public class CurntRecvbleServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName =request.getParameter("dataSourceName"); dataSourceName =request.getParameter("dataSourceName");
custCode =request.getParameter("custCode"); custCode =request.getParameter("custCode");
prdCode =request.getParameter("prdCode"); prdCode =request.getParameter("prdCode");
...@@ -49,6 +49,8 @@ public class CurntRecvbleServlet extends HttpServlet ...@@ -49,6 +49,8 @@ public class CurntRecvbleServlet extends HttpServlet
System.out.println( "prdCode is =>" + prdCode ); System.out.println( "prdCode is =>" + prdCode );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote"); custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
custInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)custInfoRemote.getCurrentReceivable(custCode,prdCode,dataSourceName); JSONObject jsonObjData = (JSONObject)custInfoRemote.getCurrentReceivable(custCode,prdCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,7 +10,7 @@ import javax.servlet.ServletException; ...@@ -10,7 +10,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
...@@ -34,12 +34,16 @@ public class DERMADivisionBrandServlet extends HttpServlet ...@@ -34,12 +34,16 @@ public class DERMADivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos); System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getDERMADivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getDERMADivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class DivMonthlyStatusServlet extends HttpServlet public class DivMonthlyStatusServlet extends HttpServlet
...@@ -30,13 +31,15 @@ public class DivMonthlyStatusServlet extends HttpServlet ...@@ -30,13 +31,15 @@ public class DivMonthlyStatusServlet extends HttpServlet
String month = ""; String month = "";
try try
{ {
System.out.println(" in DivMonthlyStatusServlet do post");
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
divMonthlyStatus = (DivMonthlyStatusRemote) context.lookup("ibase/DivMonthlyStatus/remote"); divMonthlyStatus = (DivMonthlyStatusRemote) context.lookup("ibase/DivMonthlyStatus/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
divMonthlyStatus.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)divMonthlyStatus.getMonthlyData(dataSourceName, month); JSONObject jsonObjData = (JSONObject)divMonthlyStatus.getMonthlyData(dataSourceName, month);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -33,6 +34,9 @@ public class GIPAINDivisionBrandServlet extends HttpServlet ...@@ -33,6 +34,9 @@ public class GIPAINDivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
...@@ -40,6 +44,8 @@ public class GIPAINDivisionBrandServlet extends HttpServlet ...@@ -40,6 +44,8 @@ public class GIPAINDivisionBrandServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getGIPAINDivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getGIPAINDivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
...@@ -32,6 +34,9 @@ public class GYNAECDivisionBrandServlet extends HttpServlet ...@@ -32,6 +34,9 @@ public class GYNAECDivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
...@@ -39,6 +44,8 @@ public class GYNAECDivisionBrandServlet extends HttpServlet ...@@ -39,6 +44,8 @@ public class GYNAECDivisionBrandServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getGYNAECDivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getGYNAECDivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class GlobleChildGridServlet extends HttpServlet public class GlobleChildGridServlet extends HttpServlet
...@@ -33,15 +35,18 @@ public class GlobleChildGridServlet extends HttpServlet ...@@ -33,15 +35,18 @@ public class GlobleChildGridServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
parameters = request.getParameter("P1"); parameters = request.getParameter("P1");
linkMetadata = request.getParameter("reportName"); linkMetadata = request.getParameter("reportName");
System.out.println(" in GlobleChildGridServlet month--"+month+"---parameters--"+parameters+"----linkMetadata---"+linkMetadata);
System.out.println(" in GlobleChildGridServlet month--"+month+"---parameters--"+parameters+"----linkMetadata---"+linkMetadata);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getGlobleChildGridDet(dataSourceName,month,parameters,linkMetadata); JSONObject jsonObjData = (JSONObject)salesPerformance.getGlobleChildGridDet(dataSourceName,month,parameters,linkMetadata);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,6 +10,7 @@ import javax.servlet.ServletException; ...@@ -10,6 +10,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -34,12 +35,17 @@ public class ONCODivisionBrandServlet extends HttpServlet ...@@ -34,12 +35,17 @@ public class ONCODivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos); System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getONCODivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getONCODivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
...@@ -32,13 +34,18 @@ public class OPTHALDivisionBrandServlet extends HttpServlet ...@@ -32,13 +34,18 @@ public class OPTHALDivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos); System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getOPTHALDivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getOPTHALDivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
...@@ -32,6 +34,9 @@ public class OTHERDivisionBrandServlet extends HttpServlet ...@@ -32,6 +34,9 @@ public class OTHERDivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
...@@ -39,6 +44,8 @@ public class OTHERDivisionBrandServlet extends HttpServlet ...@@ -39,6 +44,8 @@ public class OTHERDivisionBrandServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getOtherDivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getOtherDivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -31,13 +31,14 @@ public class OrderHistoryServlet extends HttpServlet ...@@ -31,13 +31,14 @@ public class OrderHistoryServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String custCode = ""; String custCode = "";
String prdCode = ""; String prdCode = "";
String reportName=""; String reportName = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName =request.getParameter("dataSourceName"); dataSourceName =request.getParameter("dataSourceName");
custCode =request.getParameter("custCode"); custCode =request.getParameter("custCode");
prdCode =request.getParameter("prdCode"); prdCode =request.getParameter("prdCode");
...@@ -48,6 +49,8 @@ public class OrderHistoryServlet extends HttpServlet ...@@ -48,6 +49,8 @@ public class OrderHistoryServlet extends HttpServlet
System.out.println( "prdCode is =" + prdCode ); System.out.println( "prdCode is =" + prdCode );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote"); custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
custInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)custInfoRemote.getOrderHistory(custCode,prdCode,dataSourceName); JSONObject jsonObjData = (JSONObject)custInfoRemote.getOrderHistory(custCode,prdCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -31,15 +31,17 @@ public class OrderVsShipmentServlet extends HttpServlet ...@@ -31,15 +31,17 @@ public class OrderVsShipmentServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String siteCode = ""; String siteCode = "";
String lastMonth = ""; String lastMonth = "";
String reportName=""; String reportName= "";
String custCode=""; String custCode = "";
String custCodeDlv=""; String custCodeDlv="";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
lastMonth = request.getParameter("lastMonth"); lastMonth = request.getParameter("lastMonth");
siteCode = request.getParameter("siteCode"); siteCode = request.getParameter("siteCode");
...@@ -60,6 +62,8 @@ public class OrderVsShipmentServlet extends HttpServlet ...@@ -60,6 +62,8 @@ public class OrderVsShipmentServlet extends HttpServlet
System.out.println("reportName is =" + reportName ); System.out.println("reportName is =" + reportName );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
despatchOrderRemote = (OrderVsShipmentRemote)context.lookup("ibase/OrderVsShipmentEJB/remote"); despatchOrderRemote = (OrderVsShipmentRemote)context.lookup("ibase/OrderVsShipmentEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
despatchOrderRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)despatchOrderRemote.getmonthWiseDespatchOrders(lastMonth,siteCode,custCode,custCodeDlv,dataSourceName); JSONObject jsonObjData = (JSONObject)despatchOrderRemote.getmonthWiseDespatchOrders(lastMonth,siteCode,custCode,custCodeDlv,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -31,23 +31,26 @@ public class PendingOrderServlet extends HttpServlet ...@@ -31,23 +31,26 @@ public class PendingOrderServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String custCode = ""; String custCode = "";
String prdCode = ""; String prdCode = "";
String reportName=""; String reportName = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName =request.getParameter("dataSourceName"); dataSourceName =request.getParameter("dataSourceName");
custCode =request.getParameter("custCode"); custCode =request.getParameter("custCode");
prdCode =request.getParameter("prdCode"); prdCode =request.getParameter("prdCode");
reportName = request.getParameter("reportName"); reportName =request.getParameter("reportName");
session.setAttribute("reportName", reportName); session.setAttribute("reportName", reportName);
System.out.println("reportName is =" + reportName ); System.out.println("reportName is =" + reportName );
System.out.println("in doPost" + "custCode is =" + custCode ); System.out.println("in doPost" + "custCode is =" + custCode );
System.out.println( "prdCode is =" + prdCode ); System.out.println( "prdCode is =" + prdCode );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote"); custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
custInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)custInfoRemote.getPendingOrder(custCode,prdCode,dataSourceName); JSONObject jsonObjData = (JSONObject)custInfoRemote.getPendingOrder(custCode,prdCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -31,13 +31,14 @@ public class PendingPurchaseServlet extends HttpServlet ...@@ -31,13 +31,14 @@ public class PendingPurchaseServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String suppCode = ""; String suppCode = "";
String prdCode = ""; String prdCode = "";
String reportName=""; String reportName = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName =request.getParameter("dataSourceName"); dataSourceName =request.getParameter("dataSourceName");
suppCode =request.getParameter("suppCode"); suppCode =request.getParameter("suppCode");
prdCode =request.getParameter("prdCode"); prdCode =request.getParameter("prdCode");
...@@ -48,6 +49,8 @@ public class PendingPurchaseServlet extends HttpServlet ...@@ -48,6 +49,8 @@ public class PendingPurchaseServlet extends HttpServlet
System.out.println( "prdCode is =" + prdCode ); System.out.println( "prdCode is =" + prdCode );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
suppInfoRemote = (SupplierInfoRemote)context.lookup("ibase/SupplierInfoEJB/remote"); suppInfoRemote = (SupplierInfoRemote)context.lookup("ibase/SupplierInfoEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
suppInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)suppInfoRemote.getPendingPurchase(suppCode,prdCode,dataSourceName); JSONObject jsonObjData = (JSONObject)suppInfoRemote.getPendingPurchase(suppCode,prdCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -33,13 +34,18 @@ public class RESPDivisionBrandServlet extends HttpServlet ...@@ -33,13 +34,18 @@ public class RESPDivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos); System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getRESPDivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getRESPDivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -38,16 +38,20 @@ public class SalesHisInfoQtyServlet extends HttpServlet ...@@ -38,16 +38,20 @@ public class SalesHisInfoQtyServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
dataSourceName =request.getParameter("dataSourceName"); ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName =request.getParameter("dataSourceName");
itmCode =request.getParameter("itmCode"); itmCode =request.getParameter("itmCode");
prdCode =request.getParameter("prdCode"); prdCode =request.getParameter("prdCode");
reportName = request.getParameter("reportName"); reportName = request.getParameter("reportName");
session.setAttribute("reportName", reportName); session.setAttribute("reportName", reportName);
System.out.println("reportName is =" + reportName ); System.out.println("reportName is =" + reportName );
System.out.println("in doPost" + "itmCode is =" + itmCode ); System.out.println("in doPost" + "itmCode is =" + itmCode );
System.out.println( "prdCode is =" + prdCode ); System.out.println( "prdCode is =" + prdCode );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
itmInfoRemote = (ItemInfoRemote)context.lookup("ibase/ItemInfoEJB/remote"); itmInfoRemote = (ItemInfoRemote)context.lookup("ibase/ItemInfoEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
itmInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)itmInfoRemote.getSalesHistoryInfoQty(itmCode,prdCode,dataSourceName); JSONObject jsonObjData = (JSONObject)itmInfoRemote.getSalesHistoryInfoQty(itmCode,prdCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -31,16 +31,17 @@ public class SalesHistoryServlet extends HttpServlet ...@@ -31,16 +31,17 @@ public class SalesHistoryServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String custCode = ""; String custCode = "";
String prdCode = ""; String prdCode = "";
String reportName=""; String reportName="";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
dataSourceName =request.getParameter("dataSourceName"); ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
custCode =request.getParameter("custCode"); dataSourceName =request.getParameter("dataSourceName");
prdCode =request.getParameter("prdCode"); custCode =request.getParameter("custCode");
prdCode =request.getParameter("prdCode");
reportName = request.getParameter("reportName"); reportName = request.getParameter("reportName");
session.setAttribute("reportName", reportName); session.setAttribute("reportName", reportName);
System.out.println("reportName is =" + reportName ); System.out.println("reportName is =" + reportName );
...@@ -48,6 +49,8 @@ public class SalesHistoryServlet extends HttpServlet ...@@ -48,6 +49,8 @@ public class SalesHistoryServlet extends HttpServlet
System.out.println( "prdCode is =" + prdCode ); System.out.println( "prdCode is =" + prdCode );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote"); custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
custInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)custInfoRemote.getSalesHistory(custCode,prdCode,dataSourceName); JSONObject jsonObjData = (JSONObject)custInfoRemote.getSalesHistory(custCode,prdCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class SalesInventoryBrandWiseServlet extends HttpServlet public class SalesInventoryBrandWiseServlet extends HttpServlet
...@@ -32,6 +34,9 @@ public class SalesInventoryBrandWiseServlet extends HttpServlet ...@@ -32,6 +34,9 @@ public class SalesInventoryBrandWiseServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
urlStr = request.getParameter("P1"); urlStr = request.getParameter("P1");
...@@ -44,6 +49,8 @@ public class SalesInventoryBrandWiseServlet extends HttpServlet ...@@ -44,6 +49,8 @@ public class SalesInventoryBrandWiseServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesInventoryRemote = (SalesInventoryRemote) context.lookup("ibase/SalesInventory/remote"); salesInventoryRemote = (SalesInventoryRemote) context.lookup("ibase/SalesInventory/remote");
//Here invoke EJB define method //Here invoke EJB define method
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesInventoryRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesInventoryRemote.getSalesInventoryBrandWise(dataSourceName, month,brandName); JSONObject jsonObjData = (JSONObject)salesInventoryRemote.getSalesInventoryBrandWise(dataSourceName, month,brandName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class SalesInventoryDivWiseServlet extends HttpServlet public class SalesInventoryDivWiseServlet extends HttpServlet
...@@ -29,19 +31,22 @@ public class SalesInventoryDivWiseServlet extends HttpServlet ...@@ -29,19 +31,22 @@ public class SalesInventoryDivWiseServlet extends HttpServlet
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String month = ""; String month = "";
String nomns = ""; String nomns = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
nomns = (request.getParameter("nomns")); nomns = (request.getParameter("nomns"));
System.out.println(" month======" + month+"nomns==="+nomns); System.out.println(" month======" + month+"nomns==="+nomns);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesInventoryRemote = (SalesInventoryRemote) context.lookup("ibase/SalesInventory/remote"); salesInventoryRemote = (SalesInventoryRemote) context.lookup("ibase/SalesInventory/remote");
//Here invoke EJB define method //Here invoke EJB define method
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesInventoryRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesInventoryRemote.getSalesInventoryDivWise(dataSourceName, month,nomns); JSONObject jsonObjData = (JSONObject)salesInventoryRemote.getSalesInventoryDivWise(dataSourceName, month,nomns);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class SalesPerDivGroupWiseServlet extends HttpServlet public class SalesPerDivGroupWiseServlet extends HttpServlet
...@@ -31,11 +33,16 @@ public class SalesPerDivGroupWiseServlet extends HttpServlet ...@@ -31,11 +33,16 @@ public class SalesPerDivGroupWiseServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
divGrp = (request.getParameter("divgrp")); divGrp = (request.getParameter("divgrp"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getDivisionWiseGraph(dataSourceName,month,divGrp); JSONObject jsonObjData = (JSONObject)salesPerformance.getDivisionWiseGraph(dataSourceName,month,divGrp);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,7 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -27,14 +28,19 @@ public class SalesPerfrmncDivisionWiseServlet extends HttpServlet ...@@ -27,14 +28,19 @@ public class SalesPerfrmncDivisionWiseServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String month = ""; String month = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getMnthSalesDivWiseGraphData(dataSourceName,month); JSONObject jsonObjData = (JSONObject)salesPerformance.getMnthSalesDivWiseGraphData(dataSourceName,month);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,6 +10,7 @@ import javax.servlet.ServletException; ...@@ -10,6 +10,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -33,10 +34,15 @@ public class SalesPerfrmncMonthWiseSalesServlet extends HttpServlet ...@@ -33,10 +34,15 @@ public class SalesPerfrmncMonthWiseSalesServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getMnthlySalesGraphData(dataSourceName,month); JSONObject jsonObjData = (JSONObject)salesPerformance.getMnthlySalesGraphData(dataSourceName,month);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,6 +10,7 @@ import javax.servlet.ServletException; ...@@ -10,6 +10,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -34,10 +35,15 @@ public class SalesPerfrmncProfitGraphServlet extends HttpServlet ...@@ -34,10 +35,15 @@ public class SalesPerfrmncProfitGraphServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getProfitGraphData(dataSourceName,month); JSONObject jsonObjData = (JSONObject)salesPerformance.getProfitGraphData(dataSourceName,month);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class SalesPerfrmncSalesGrphServlet extends HttpServlet public class SalesPerfrmncSalesGrphServlet extends HttpServlet
...@@ -26,15 +28,20 @@ public class SalesPerfrmncSalesGrphServlet extends HttpServlet ...@@ -26,15 +28,20 @@ public class SalesPerfrmncSalesGrphServlet extends HttpServlet
SalesPerformanceRemote salesPerformance = null; SalesPerformanceRemote salesPerformance = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String month = ""; String month = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
dataSourceName = request.getParameter("dataSourceName"); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getSalesGraphData(dataSourceName,month); JSONObject jsonObjData = (JSONObject)salesPerformance.getSalesGraphData(dataSourceName,month);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,6 +10,7 @@ import javax.servlet.ServletException; ...@@ -10,6 +10,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -29,14 +30,19 @@ public class SalesPerfrmncYTDWiseSalesServlet extends HttpServlet ...@@ -29,14 +30,19 @@ public class SalesPerfrmncYTDWiseSalesServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String month = ""; String month = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getYTDSalesGraphData(dataSourceName,month); JSONObject jsonObjData = (JSONObject)salesPerformance.getYTDSalesGraphData(dataSourceName,month);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class StateWiseStockServlet extends HttpServlet public class StateWiseStockServlet extends HttpServlet
...@@ -35,6 +37,9 @@ public class StateWiseStockServlet extends HttpServlet ...@@ -35,6 +37,9 @@ public class StateWiseStockServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = request.getParameter("month"); month = request.getParameter("month");
brand = request.getParameter("brand"); brand = request.getParameter("brand");
...@@ -47,14 +52,9 @@ public class StateWiseStockServlet extends HttpServlet ...@@ -47,14 +52,9 @@ public class StateWiseStockServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
stateWiseStock = (StateWiseStockRemote) context.lookup("ibase/StateWiseStock/remote"); stateWiseStock = (StateWiseStockRemote) context.lookup("ibase/StateWiseStock/remote");
JSONObject jsonObjData = (JSONObject)stateWiseStock.getIndiaMap(dataSourceName,month,brand,division,viewOptionSelectd); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
stateWiseStock.setUserInfo(userInfo);
/*String jsonObjData1 ="{'0':{'001':'','near_exp':'2501','long_exp':'201'},'1':{'002':'11202','near_exp':'2502','long_exp':'201'},'2':{'003':'11203','near_exp':'2503','long_exp':'203'},'3':{'004':'11247','near_exp':'2500','long_exp':'200'},'4':{'005':'11247','near_exp':'2500','long_exp':'200'},'5':{'006':'11247','near_exp':'2500','long_exp':'200'},'6':{'007':'11247','near_exp':'2500','long_exp':'200'},'7':{'008':'11247','near_exp':'2500','long_exp':'200'},'8':{'009':'11247','near_exp':'2500','long_exp':'200'},'9':{'010':'11247','near_exp':'2500','long_exp':'200'},'10':{'011':'11247','near_exp':'2500','long_exp':'200'},'11':{'012':'11247','near_exp':'2500','long_exp':'200'},'12':{'013':'11247','near_exp':'2500','long_exp':'200'},'13':{'014':'11247','near_exp':'2500','long_exp':'200'},'14':{'015':'11247','near_exp':'2500','long_exp':'200'},'15':{'016':'11247','near_exp':'2500','long_exp':'200'},'16':{'017':'11247','near_exp':'2500','long_exp':'200'},'17':{'018':'11247','near_exp':'2500','long_exp':'200'},'18':{'019':'','near_exp':'2500','long_exp':'200'},'19':{'020':'11247','near_exp':'2500','long_exp':'200'},'20':{'021':'11247','near_exp':'2500','long_exp':'200','tooltextlbl':'Maha:82781{br}Near_Exp: 420{br}Long_Exp:2'},'21':{'022':'11247','near_exp':'2500','long_exp':'200'},'22':{'023':'11247','near_exp':'2500','long_exp':'200'},'23':{'024':'11247','near_exp':'2500','long_exp':'200'},'24':{'025':'11247','near_exp':'2500','long_exp':'200'},'25':{'026':'11247','near_exp':'2500','long_exp':'200'},'26':{'027':'11247','near_exp':'2500','long_exp':'200'},'27':{'028':'11247','near_exp':'2500','long_exp':'200'},'28':{'029':'11247','near_exp':'2500','long_exp':'200'},'29':{'030':'11247','near_exp':'2500','long_exp':'200'},'30':{'031':'11247','near_exp':'2500','long_exp':'200'},'31':{'032':'11247','near_exp':'2500','long_exp':'200'},'32':{'033':'11247','near_exp':'2500','long_exp':'200'},'33':{'034':'11247','near_exp':'2500','long_exp':'200'},'34':{'035':'11247','near_exp':'2500','long_exp':'200'},'35':{'036':'11247','near_exp':'2500','long_exp':'200'}}"; JSONObject jsonObjData = (JSONObject)stateWiseStock.getIndiaMap(dataSourceName,month,brand,division,viewOptionSelectd);
OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().replace('\'', '"').getBytes());
outputStream.flush();
outputStream.close();*/
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); outputStream.flush();
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class TopBrandMTHServlet extends HttpServlet public class TopBrandMTHServlet extends HttpServlet
...@@ -31,11 +33,16 @@ public class TopBrandMTHServlet extends HttpServlet ...@@ -31,11 +33,16 @@ public class TopBrandMTHServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
divCode = (request.getParameter("divcode")); divCode = (request.getParameter("divcode"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getTopBrandMTH(dataSourceName,month,divCode); JSONObject jsonObjData = (JSONObject)salesPerformance.getTopBrandMTH(dataSourceName,month,divCode);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class TopBrandYTDServlet extends HttpServlet public class TopBrandYTDServlet extends HttpServlet
...@@ -31,11 +33,16 @@ public class TopBrandYTDServlet extends HttpServlet ...@@ -31,11 +33,16 @@ public class TopBrandYTDServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
divCode = (request.getParameter("divcode")); divCode = (request.getParameter("divcode"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getTopBrandYTD(dataSourceName,month,divCode); JSONObject jsonObjData = (JSONObject)salesPerformance.getTopBrandYTD(dataSourceName,month,divCode);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -31,13 +31,14 @@ public class TranstnSummaryServlet extends HttpServlet ...@@ -31,13 +31,14 @@ public class TranstnSummaryServlet extends HttpServlet
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String custCode = ""; String custCode = "";
String prdCode = ""; String prdCode = "";
String reportName=""; String reportName= "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName =request.getParameter("dataSourceName"); dataSourceName =request.getParameter("dataSourceName");
custCode =request.getParameter("custCode"); custCode =request.getParameter("custCode");
prdCode =request.getParameter("prdCode"); prdCode =request.getParameter("prdCode");
...@@ -48,6 +49,8 @@ public class TranstnSummaryServlet extends HttpServlet ...@@ -48,6 +49,8 @@ public class TranstnSummaryServlet extends HttpServlet
System.out.println( "prdCode is =" + prdCode ); System.out.println( "prdCode is =" + prdCode );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote"); custInfoRemote = (CustomerInfoRemote)context.lookup("ibase/CustomerInfoEJB/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
custInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)custInfoRemote.getTransactionSummary(custCode,prdCode,dataSourceName); JSONObject jsonObjData = (JSONObject)custInfoRemote.getTransactionSummary(custCode,prdCode,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -10,6 +10,8 @@ import javax.servlet.ServletException; ...@@ -10,6 +10,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@SuppressWarnings("serial") @SuppressWarnings("serial")
...@@ -33,13 +35,18 @@ public class URODivisionBrandServlet extends HttpServlet ...@@ -33,13 +35,18 @@ public class URODivisionBrandServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
topNos = (request.getParameter("topNos")); topNos = (request.getParameter("topNos"));
month = (request.getParameter("month")); month = (request.getParameter("month"));
System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos); System.out.println("in doPost" + "month is =" + month + "topNos is =" + topNos);
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote"); salesPerformanceTwo = (SalesPerformanceTwoRemote) context.lookup("ibase/SalesPerformanceTwo/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformanceTwo.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getURODivisionBrandData(dataSourceName,month,topNos); JSONObject jsonObjData = (JSONObject)salesPerformanceTwo.getURODivisionBrandData(dataSourceName,month,topNos);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class ZoneWiseMetroServlet extends HttpServlet public class ZoneWiseMetroServlet extends HttpServlet
...@@ -31,13 +33,18 @@ public class ZoneWiseMetroServlet extends HttpServlet ...@@ -31,13 +33,18 @@ public class ZoneWiseMetroServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
divCode = (request.getParameter("divcode")); divCode = (request.getParameter("divcode"));
divGrp = (request.getParameter("divgrp")); divGrp = (request.getParameter("divgrp"));
zonedescr = (request.getParameter("zonedescr")); zonedescr = (request.getParameter("zonedescr"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getZoneWiseMetroDetail(dataSourceName,month,divGrp,divCode,zonedescr); JSONObject jsonObjData = (JSONObject)salesPerformance.getZoneWiseMetroDetail(dataSourceName,month,divGrp,divCode,zonedescr);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -9,6 +9,8 @@ import javax.servlet.ServletException; ...@@ -9,6 +9,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class ZoneWiseServlet extends HttpServlet public class ZoneWiseServlet extends HttpServlet
...@@ -31,11 +33,15 @@ public class ZoneWiseServlet extends HttpServlet ...@@ -31,11 +33,15 @@ public class ZoneWiseServlet extends HttpServlet
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
month = (request.getParameter("month")); month = (request.getParameter("month"));
divCode = (request.getParameter("divcode")); divCode = (request.getParameter("divcode"));
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote"); salesPerformance = (SalesPerformanceRemote) context.lookup("ibase/SalesPerformance/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
salesPerformance.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)salesPerformance.getZoneWiseDetail(dataSourceName,month,divCode); JSONObject jsonObjData = (JSONObject)salesPerformance.getZoneWiseDetail(dataSourceName,month,divCode);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
package ibase.dashboard.ssc.ejb; package ibase.dashboard.ssc.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
...@@ -12,9 +11,7 @@ import java.util.ArrayList; ...@@ -12,9 +11,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
/** /**
* Session Bean implementation class SalesPersonSales * Session Bean implementation class SalesPersonSales
...@@ -25,23 +22,25 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -25,23 +22,25 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
public AcctPayable() { public AcctPayable() {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getPaymentEfficiency(String dataSourceName) throws RemoteException, ITMException public JSONObject getPaymentEfficiency(String dataSourceName) throws RemoteException, ITMException
{ {
JSONObject rawDataAcctPayableDtlJson = new JSONObject(); JSONObject rawDataAcctPayableDtlJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println(" Inside AcctPayable for getPaymentEfficiency Data Soruc Name ="+dataSourceName); System.out.println(" Inside AcctPayable for getPaymentEfficiency Data Soruc Name ="+dataSourceName);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
int delayCount = 0; int delayCount = 0;
double delayAmount = 0.0; double delayAmount = 0.0;
...@@ -66,11 +65,11 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -66,11 +65,11 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
"and to_date(sysdate) between p.fr_date and p.to_date" ; "and to_date(sysdate) between p.fr_date and p.to_date" ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
delayCount = rs.getInt("delay_Invoice"); delayCount = rs.getInt("delay_Invoice");
delayAmount = Double.parseDouble(checkZero(rs.getString("delay_Inv_payment"))); delayAmount = Double.parseDouble(checkZero(rs.getString("delay_Inv_payment")));
} }
...@@ -82,10 +81,10 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -82,10 +81,10 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
"and to_date(sysdate) between p.fr_date and p.to_date"; "and to_date(sysdate) between p.fr_date and p.to_date";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
paymentCount = rs.getInt("paymentcount"); paymentCount = rs.getInt("paymentcount");
paymentAmount = Double.parseDouble(checkZero(rs.getString("paymentamt"))); paymentAmount = Double.parseDouble(checkZero(rs.getString("paymentamt")));
} }
...@@ -103,8 +102,7 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -103,8 +102,7 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
while (rs.next()) while (rs.next())
{ {
paidAmount = Double.parseDouble(checkZero(rs.getString("paid_amount"))); paidAmount = Double.parseDouble(checkZero(rs.getString("paid_amount")));
//delayTotalAmount = Double.parseDouble(checkZero(rs.getString("total_amount"))); delayDays = Double.parseDouble(checkZero(rs.getString("delayed_days")));
delayDays = Double.parseDouble(checkZero(rs.getString("delayed_days")));
} }
sql="select sum(d.pay_amt) delay_Total_Amount from misc_payment h, misc_paydet d, " + sql="select sum(d.pay_amt) delay_Total_Amount from misc_payment h, misc_paydet d, " +
...@@ -113,7 +111,7 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -113,7 +111,7 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
"and to_date(sysdate) between p.fr_date and p.to_date"; "and to_date(sysdate) between p.fr_date and p.to_date";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
delayTotalAmount = Double.parseDouble(checkZero(rs.getString("delay_Total_Amount"))); delayTotalAmount = Double.parseDouble(checkZero(rs.getString("delay_Total_Amount")));
...@@ -217,17 +215,19 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -217,17 +215,19 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
{ {
JSONObject rawDataPayableProfitJson = new JSONObject(); JSONObject rawDataPayableProfitJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println(" Inside AcctPayable for getPayableProfit Data Soruc Name ="+dataSourceName); System.out.println(" Inside AcctPayable for getPayableProfit Data Soruc Name ="+dataSourceName);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
/*sql=" select sum(cnt) as invoice_number,sum(due_amount) as invoice_val," + /*sql=" select sum(cnt) as invoice_number,sum(due_amount) as invoice_val," +
" (case when due_days <= 7 then '7 Days' when due_days <= 15 then '15 Days' " + " (case when due_days <= 7 then '7 Days' when due_days <= 15 then '15 Days' " +
...@@ -308,20 +308,22 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -308,20 +308,22 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
{ {
JSONObject rawDataSavingOpporntyJson = new JSONObject(); JSONObject rawDataSavingOpporntyJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println(" Inside AcctPayable for getSavingOpportunity Data Soruc Name ="+dataSourceName); System.out.println(" Inside AcctPayable for getSavingOpportunity Data Soruc Name ="+dataSourceName);
SimpleDateFormat gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); SimpleDateFormat gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
/*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
conn = connDriver.getConnectDB(dataSourceName);
connDriver = null;
int count = 0; int count = 0;
sql=" select v.bill_no, s.sh_name, v.net_amt, round(case when c.FCHG_TYPE ='F' " + sql=" select v.bill_no, s.sh_name, v.net_amt, round(case when c.FCHG_TYPE ='F' " +
" then c.FIN_CHG else (v.net_amt * c.FIN_CHG / 100) end,0) as disc_amt , " + " then c.FIN_CHG else (v.net_amt * c.FIN_CHG / 100) end,0) as disc_amt , " +
...@@ -385,21 +387,21 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -385,21 +387,21 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
{ {
JSONObject rawDataEfficiencyTrendJson = new JSONObject(); JSONObject rawDataEfficiencyTrendJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println(" Inside AcctPayable for getEfficiencyTrend Data Soruc Name ="+dataSourceName); System.out.println(" Inside AcctPayable for getEfficiencyTrend Data Soruc Name ="+dataSourceName);
SimpleDateFormat gridDateFormat = new SimpleDateFormat( "yyyy-MM-dd"); SimpleDateFormat gridDateFormat = new SimpleDateFormat( "yyyy-MM-dd");
SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat convrtToTimStmDate= new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
conn = connDriver.getConnectDB(dataSourceName);
connDriver = null;
/*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
HashMap<String, ArrayList<String>> onTimeMap = new HashMap<String,ArrayList<String>>(); HashMap<String, ArrayList<String>> onTimeMap = new HashMap<String,ArrayList<String>>();
HashMap<String, String> delayTimeMap = new HashMap<String, String>(); HashMap<String, String> delayTimeMap = new HashMap<String, String>();
ArrayList<String> valueList =null; ArrayList<String> valueList =null;
...@@ -441,9 +443,9 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -441,9 +443,9 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
" and to_date(sysdate) between p.fr_date and p.to_date" + " and to_date(sysdate) between p.fr_date and p.to_date" +
" group by to_date(h.conf_date) order by to_date(h.conf_date)"; " group by to_date(h.conf_date) order by to_date(h.conf_date)";
pstmt = null; pstmt = null;
rs = null; rs = null;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
conf_date = ""; conf_date = "";
while (rs.next()) while (rs.next())
{ {
...@@ -456,8 +458,8 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -456,8 +458,8 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
if(onTimeMap.containsKey(entry.getKey())) if(onTimeMap.containsKey(entry.getKey()))
{ {
valueList = new ArrayList<String>(); valueList = new ArrayList<String>();
tempList = new ArrayList<String>(); tempList = new ArrayList<String>();
tempList = onTimeMap.get(entry.getKey()); tempList = onTimeMap.get(entry.getKey());
//valueList.add(onTimeMap.get(entry.getKey())); //valueList.add(onTimeMap.get(entry.getKey()));
valueList.add(tempList.get(0)); valueList.add(tempList.get(0));
valueList.add(""+delayTimeMap.get(entry.getKey())); valueList.add(""+delayTimeMap.get(entry.getKey()));
...@@ -480,8 +482,8 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP ...@@ -480,8 +482,8 @@ public class AcctPayable extends ValidatorEJB implements AcctPayableLocal, AcctP
if(!finalHashMap.containsKey(entry.getKey())) if(!finalHashMap.containsKey(entry.getKey()))
{ {
valueList = new ArrayList<String>(); valueList = new ArrayList<String>();
tempList = new ArrayList<String>(); tempList = new ArrayList<String>();
tempList = onTimeMap.get(entry.getKey()); tempList = onTimeMap.get(entry.getKey());
valueList.add(tempList.get(0)); valueList.add(tempList.get(0));
//valueList.add(""+onTimeMap.get(entry.getKey())); //valueList.add(""+onTimeMap.get(entry.getKey()));
valueList.add("0"); valueList.add("0");
......
package ibase.dashboard.ssc.ejb; package ibase.dashboard.ssc.ejb;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
...@@ -24,35 +23,32 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -24,35 +23,32 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
public PendingPurcOrder() { public PendingPurcOrder() {
} }
GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility e12GenericUtility = new E12GenericUtility();
SimpleDateFormat gridDateFormat=null; SimpleDateFormat gridDateFormat = null;
SimpleDateFormat convrtToTimStmDate=null; SimpleDateFormat convrtToTimStmDate = null;
/*Last*/ /*Last*/
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public JSONObject getPendingPO(String loginCode, String dataSourceName) throws RemoteException, ITMException public JSONObject getPendingPO(String loginCode, String dataSourceName) throws RemoteException, ITMException
{ {
JSONObject rawDataPaymentDet = new JSONObject(); JSONObject rawDataPaymentDet = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
if(loginCode!=null && loginCode.trim().length()>0) if(loginCode!=null && loginCode.trim().length()>0)
{ {
gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); convrtToTimStmDate = new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
convrtToTimStmDate = new SimpleDateFormat(genericUtility.getDBDateFormat());
System.out.println(" Inside PendingPurcOrder for getPendingPO Method Data Soruc Name ="+dataSourceName+" loginCode comming from seesion =" + loginCode); System.out.println(" Inside PendingPurcOrder for getPendingPO Method Data Soruc Name ="+dataSourceName+" loginCode comming from seesion =" + loginCode);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
int count = 0; /*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
int count = 0;
sql = " select m.tran_id,m.tran_date, m.net_amt,m.ref_no,m. bank_code,b.bank_name from misc_payment m inner join bank b on m.bank_code=b.bank_code " + sql = " select m.tran_id,m.tran_date, m.net_amt,m.ref_no,m. bank_code,b.bank_name from misc_payment m inner join bank b on m.bank_code=b.bank_code " +
" where Rownum <= 5 and m.sundry_type = 'S'and m.net_amt>0 " + " where Rownum <= 5 and m.sundry_type = 'S'and m.net_amt>0 " +
" and m.sundry_code in (select entity_code from entity_contact where entity_type = 'S' " + " and m.sundry_code in (select entity_code from entity_contact where entity_type = 'S' " +
...@@ -123,11 +119,10 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -123,11 +119,10 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
JSONObject rawDataPOValueDet = new JSONObject(); JSONObject rawDataPOValueDet = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
...@@ -136,8 +131,10 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -136,8 +131,10 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
if(loginCode!=null && loginCode.trim().length()>0) if(loginCode!=null && loginCode.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
sql = " select to_char(ORD_DATE, 'MON-YY') as month, sum(tot_amt) as povalue,to_char(ORD_DATE,'MMYY'),count(1) as no_of_po "+ sql = " select to_char(ORD_DATE, 'MON-YY') as month, sum(tot_amt) as povalue,to_char(ORD_DATE,'MMYY'),count(1) as no_of_po "+
" from porder where ORD_DATE >= (SELECT ADD_MONTHS(SYSDATE,-5) FROM DUAL ) "+ " from porder where ORD_DATE >= (SELECT ADD_MONTHS(SYSDATE,-5) FROM DUAL ) "+
" and case when confirmed is null then 'N' else confirmed end = 'Y' "+ " and case when confirmed is null then 'N' else confirmed end = 'Y' "+
...@@ -197,23 +194,24 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -197,23 +194,24 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
JSONObject rawDataPendingInvoice = new JSONObject(); JSONObject rawDataPendingInvoice = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); Calendar calendar = null;
Calendar calendar=null; String currentDate ="";
String currentDate=""; String varValue ="";
String varValue=""; String[] lotNoList = null;
String[] lotNoList=null;
try try
{ {
System.out.println(" Inside PendingPurcOrder for getPendingInvoice Method Data Soruc Name ="+dataSourceName+" logincode is =" + loginCode+"fromDate==="+fromDate+"ToDate==="+toDate); System.out.println(" Inside PendingPurcOrder for getPendingInvoice Method Data Soruc Name ="+dataSourceName+" logincode is =" + loginCode+"fromDate==="+fromDate+"ToDate==="+toDate);
if(loginCode!=null && loginCode.trim().length()>0) if(loginCode!=null && loginCode.trim().length()>0)
{ {
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
// This is old sql for pending invoice detail.Changes by Birendra Pandey on dated :13/10/2015 // This is old sql for pending invoice detail.Changes by Birendra Pandey on dated :13/10/2015
sql ="select var_value from disparm where prd_code = '999999' and var_name = 'BILL_STATUS_REAS'"; sql ="select var_value from disparm where prd_code = '999999' and var_name = 'BILL_STATUS_REAS'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -254,13 +252,13 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -254,13 +252,13 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
if((fromDate==null) ||(fromDate.equals("")) && (toDate==null) || (toDate.equals(""))) if((fromDate==null) ||(fromDate.equals("")) && (toDate==null) || (toDate.equals("")))
{ {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
calendar = Calendar.getInstance(); calendar = Calendar.getInstance();
currentDate = simpleDateFormat.format(calendar.getTime()); currentDate = simpleDateFormat.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
toDate = simpleDateFormat.format(calendar.getTime()); toDate = simpleDateFormat.format(calendar.getTime());
calendar = Calendar.getInstance(); calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
fromDate = simpleDateFormat.format(calendar.getTime()); fromDate = simpleDateFormat.format(calendar.getTime());
System.out.println("get default date ,when user not entering date from GUI:"+"currentDate="+currentDate+"fromDate="+fromDate+"toDate="+toDate); System.out.println("get default date ,when user not entering date from GUI:"+"currentDate="+currentDate+"fromDate="+fromDate+"toDate="+toDate);
...@@ -341,22 +339,23 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -341,22 +339,23 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
public JSONObject getPendingPOSummary(String loginCode, String dataSourceName) throws RemoteException, ITMException public JSONObject getPendingPOSummary(String loginCode, String dataSourceName) throws RemoteException, ITMException
{ {
JSONObject rawDataPaymentDet = new JSONObject(); JSONObject rawDataPaymentDet = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
//String processOrder="",completed="",open=""; //String processOrder="",completed="",open="";
try try
{ {
gridDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); gridDateFormat = new SimpleDateFormat( e12GenericUtility.getApplDateFormat());
convrtToTimStmDate = new SimpleDateFormat(genericUtility.getDBDateFormat()); convrtToTimStmDate = new SimpleDateFormat(e12GenericUtility.getDBDateFormat());
if(loginCode!=null && loginCode.trim().length()>0) if(loginCode!=null && loginCode.trim().length()>0)
{ {
System.out.println(" Inside PendingPurcOrder for getPendingPOSummary Method Data Soruc Name ="+dataSourceName+" loginCode is =" + loginCode); System.out.println(" Inside PendingPurcOrder for getPendingPOSummary Method Data Soruc Name ="+dataSourceName+" loginCode is =" + loginCode);
conn = connDriver.getConnectDB(dataSourceName); /*conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
/*to get P Order summary data */ /*to get P Order summary data */
sql = " select sum(tot_amt) as process_orders,count(1) as no_of_po " sql = " select sum(tot_amt) as process_orders,count(1) as no_of_po "
+" from porder where ORD_DATE >= (SELECT ADD_MONTHS(SYSDATE,-5) FROM DUAL ) " +" from porder where ORD_DATE >= (SELECT ADD_MONTHS(SYSDATE,-5) FROM DUAL ) "
...@@ -366,7 +365,7 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -366,7 +365,7 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
+" and User_id__portal = '"+loginCode+"') "; +" and User_id__portal = '"+loginCode+"') ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
int count = 0; int count = 0;
while (rs.next()) while (rs.next())
{ {
...@@ -380,7 +379,7 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -380,7 +379,7 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
rs = null; rs = null;
sql = " select sum(tot_amt) as completed,count(1) as no_of_po " sql = " select sum(tot_amt) as completed,count(1) as no_of_po "
+" from porder where ORD_DATE >= (SELECT ADD_MONTHS(SYSDATE,-5) FROM DUAL ) " +" from porder where ORD_DATE >= (SELECT ADD_MONTHS(SYSDATE,-5) FROM DUAL ) "
+" and case when confirmed is null then 'N' else confirmed end = 'Y' " +" and case when confirmed is null then 'N' else confirmed end = 'Y' "
...@@ -389,7 +388,7 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -389,7 +388,7 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
+"and User_id__portal = '"+loginCode+"') "; +"and User_id__portal = '"+loginCode+"') ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
rowData = new JSONObject(); rowData = new JSONObject();
...@@ -455,7 +454,7 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe ...@@ -455,7 +454,7 @@ public class PendingPurcOrder extends ValidatorEJB implements PendingPurcOrderRe
} }
//check null functionallity for required component /*check null functionallity for required component*/
private double checkDoubleNull(String str) private double checkDoubleNull(String str)
{ {
if(str == null || str.trim().length() == 0 || str.trim().equalsIgnoreCase("null")) if(str == null || str.trim().length() == 0 || str.trim().equalsIgnoreCase("null"))
......
...@@ -25,26 +25,29 @@ public class EfficiencyTrendServlet extends HttpServlet ...@@ -25,26 +25,29 @@ public class EfficiencyTrendServlet extends HttpServlet
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
AcctPayableRemote acctPayableRemote = null; AcctPayableRemote acctPayableRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
/*Added session by Nikhil On dated 13 June 2016*/
dataSourceName = request.getParameter("dataSourceName"); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
/*Ended session by Nikhil On dated 13 June 2016*/
dataSourceName = request.getParameter("dataSourceName");
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
acctPayableRemote = (AcctPayableRemote) context.lookup("ibase/AcctPayable/remote"); acctPayableRemote = (AcctPayableRemote) context.lookup("ibase/AcctPayable/remote");
JSONObject jsonObjData = (JSONObject) acctPayableRemote.getEfficiencyTrend(dataSourceName); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
acctPayableRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) acctPayableRemote.getEfficiencyTrend(dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); outputStream.flush();
outputStream.close(); outputStream.close();
System.out.println(" Final data set for EfficiencyTrendServlet build the Graph is===" + jsonObjData); System.out.println(" Final data set for EfficiencyTrendServlet build the Graph is===" + jsonObjData);
} catch (Exception e) } catch (Exception e)
{ {
System.out.println("Exception : EfficiencyTrendServlet :doPost(HttpServletRequest request, HttpServletResponse response) :" + e); System.out.println("Exception : EfficiencyTrendServlet :doPost(HttpServletRequest request, HttpServletResponse response) :" + e);
try try
......
...@@ -25,17 +25,22 @@ public class PayableProfitServlet extends HttpServlet ...@@ -25,17 +25,22 @@ public class PayableProfitServlet extends HttpServlet
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
AcctPayableRemote acctPayableRemote = null; AcctPayableRemote acctPayableRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
/*Added session by Nikhil On dated 13 June 2016*/
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
/*Ended session by Nikhil On dated 13 June 2016*/
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
acctPayableRemote = (AcctPayableRemote) context.lookup("ibase/AcctPayable/remote"); acctPayableRemote = (AcctPayableRemote) context.lookup("ibase/AcctPayable/remote");
JSONObject jsonObjData = (JSONObject) acctPayableRemote.getPayableProfit(dataSourceName); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
acctPayableRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) acctPayableRemote.getPayableProfit(dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); outputStream.flush();
......
...@@ -20,29 +20,31 @@ public class PaymentEfficiencyServlet extends HttpServlet ...@@ -20,29 +20,31 @@ public class PaymentEfficiencyServlet extends HttpServlet
{ {
doPost(request, response); doPost(request, response);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
AcctPayableRemote acctPayableRemote = null; AcctPayableRemote acctPayableRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
/*Added session by Nikhil On dated 13 June 2016*/
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
/*Ended session by Nikhil On dated 13 June 2016*/
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
acctPayableRemote = (AcctPayableRemote) context.lookup("ibase/AcctPayable/remote"); acctPayableRemote = (AcctPayableRemote) context.lookup("ibase/AcctPayable/remote");
JSONObject jsonObjData = (JSONObject) acctPayableRemote.getPaymentEfficiency(dataSourceName); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
acctPayableRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) acctPayableRemote.getPaymentEfficiency(dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); outputStream.flush();
outputStream.close(); outputStream.close();
System.out.println(" Final data set for PaymentEfficiencyServlet build the Graph is===" + jsonObjData); System.out.println(" Final data set for PaymentEfficiencyServlet build the Graph is===" + jsonObjData);
} catch (Exception e) } catch (Exception e)
{ {
......
...@@ -20,22 +20,19 @@ public class PendingInvoiceServlet extends HttpServlet ...@@ -20,22 +20,19 @@ public class PendingInvoiceServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
doPost(request, response); doPost(request, response);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
PendingPurcOrderRemote pendingPurcOrdRemote = null; PendingPurcOrderRemote pendingPurcOrdRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String loginId = ""; String loginId = "";
String fromDate = ""; String fromDate = "";
String toDate = ""; String toDate = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO"); ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
...@@ -46,6 +43,8 @@ public class PendingInvoiceServlet extends HttpServlet ...@@ -46,6 +43,8 @@ public class PendingInvoiceServlet extends HttpServlet
System.out.println( "login code comming from session =" + loginId ); System.out.println( "login code comming from session =" + loginId );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingPurcOrdRemote = (PendingPurcOrderRemote)context.lookup("ibase/PendingPurcOrder/remote"); pendingPurcOrdRemote = (PendingPurcOrderRemote)context.lookup("ibase/PendingPurcOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingPurcOrdRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)pendingPurcOrdRemote.getPendingInvoice(loginId,fromDate,toDate, dataSourceName); JSONObject jsonObjData = (JSONObject)pendingPurcOrdRemote.getPendingInvoice(loginId,fromDate,toDate, dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -20,17 +20,15 @@ public class PendingPOServlet extends HttpServlet ...@@ -20,17 +20,15 @@ public class PendingPOServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
doPost(request, response); doPost(request, response);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
PendingPurcOrderRemote pendingPurcOrderRemote = null; PendingPurcOrderRemote pendingPurcOrderRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String loginId = ""; String loginId = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
...@@ -45,6 +43,8 @@ public class PendingPOServlet extends HttpServlet ...@@ -45,6 +43,8 @@ public class PendingPOServlet extends HttpServlet
System.out.println( "loginId is =" + loginId ); System.out.println( "loginId is =" + loginId );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingPurcOrderRemote = (PendingPurcOrderRemote)context.lookup("ibase/PendingPurcOrder/remote"); pendingPurcOrderRemote = (PendingPurcOrderRemote)context.lookup("ibase/PendingPurcOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingPurcOrderRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)pendingPurcOrderRemote.getPendingPO(loginId,dataSourceName); JSONObject jsonObjData = (JSONObject)pendingPurcOrderRemote.getPendingPO(loginId,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -23,15 +23,14 @@ public class PendingPOSummaryServlet extends HttpServlet ...@@ -23,15 +23,14 @@ public class PendingPOSummaryServlet extends HttpServlet
{ {
doPost(request, response); doPost(request, response);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
PendingPurcOrderRemote custInfoRemote = null; PendingPurcOrderRemote custInfoRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String loginId = ""; String loginId = "";
try try
{ {
...@@ -48,6 +47,8 @@ public class PendingPOSummaryServlet extends HttpServlet ...@@ -48,6 +47,8 @@ public class PendingPOSummaryServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
custInfoRemote = (PendingPurcOrderRemote)context.lookup("ibase/PendingPurcOrder/remote"); custInfoRemote = (PendingPurcOrderRemote)context.lookup("ibase/PendingPurcOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
custInfoRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)custInfoRemote.getPendingPOSummary(loginId,dataSourceName); JSONObject jsonObjData = (JSONObject)custInfoRemote.getPendingPOSummary(loginId,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -28,9 +28,9 @@ public class PendingPOValueServlet extends HttpServlet ...@@ -28,9 +28,9 @@ public class PendingPOValueServlet extends HttpServlet
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
PendingPurcOrderRemote pendingPurcOrderRemote = null; PendingPurcOrderRemote pendingPurcOrderRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
String loginId = ""; String loginId = "";
try try
{ {
...@@ -42,12 +42,14 @@ public class PendingPOValueServlet extends HttpServlet ...@@ -42,12 +42,14 @@ public class PendingPOValueServlet extends HttpServlet
{ {
loginId="CPATIL"; loginId="CPATIL";
}*/ }*/
dataSourceName =request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
System.out.println( "loginId is =" + loginId ); System.out.println( "loginId is =" + loginId );
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
pendingPurcOrderRemote = (PendingPurcOrderRemote)context.lookup("ibase/PendingPurcOrder/remote"); pendingPurcOrderRemote = (PendingPurcOrderRemote)context.lookup("ibase/PendingPurcOrder/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
pendingPurcOrderRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject)pendingPurcOrderRemote.getPendingPOValue(loginId,dataSourceName); JSONObject jsonObjData = (JSONObject)pendingPurcOrderRemote.getPendingPOValue(loginId,dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -20,30 +20,32 @@ public class SavingOpportunityServlet extends HttpServlet ...@@ -20,30 +20,32 @@ public class SavingOpportunityServlet extends HttpServlet
{ {
doPost(request, response); doPost(request, response);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{ {
AcctPayableRemote acctPayableRemote = null; AcctPayableRemote acctPayableRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
/*Added session by Nikhil On dated 13 June 2016*/
dataSourceName = request.getParameter("dataSourceName"); HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
/*Ended session by Nikhil On dated 13 June 2016*/
dataSourceName = request.getParameter("dataSourceName");
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
acctPayableRemote = (AcctPayableRemote) context.lookup("ibase/AcctPayable/remote"); acctPayableRemote = (AcctPayableRemote) context.lookup("ibase/AcctPayable/remote");
JSONObject jsonObjData = (JSONObject) acctPayableRemote.getSavingOpportunity(dataSourceName); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
acctPayableRemote.setUserInfo(userInfo);
JSONObject jsonObjData = (JSONObject) acctPayableRemote.getSavingOpportunity(dataSourceName);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); outputStream.flush();
outputStream.close(); outputStream.close();
System.out.println(" Final data set for SavingOpportunityServlet build the Graph is===" + jsonObjData); System.out.println(" Final data set for SavingOpportunityServlet build the Graph is===" + jsonObjData);
} catch (Exception e) } catch (Exception e)
{ {
System.out.println("Exception : SavingOpportunityServlet :doPost(HttpServletRequest request, HttpServletResponse response) :" + e); System.out.println("Exception : SavingOpportunityServlet :doPost(HttpServletRequest request, HttpServletResponse response) :" + e);
......
package ibase.dashboard.wms.ejb; package ibase.dashboard.wms.ejb;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
import javax.ejb.Stateless; import javax.ejb.Stateless;
/** /**
...@@ -22,20 +22,21 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe ...@@ -22,20 +22,21 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe
public EORLocationStock() public EORLocationStock()
{ {
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
public String getEORLocPhyArea() throws RemoteException, ITMException public String getEORLocPhyArea() throws RemoteException, ITMException
{ {
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver(); StringBuffer xmlData = null;
StringBuffer xmlData = null;
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:16062016 by Nikhil*/
conn = getConnection();
sql = "select distinct loc_phy_area from location order by loc_phy_area "; sql = "select distinct loc_phy_area from location order by loc_phy_area ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -90,12 +91,13 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe ...@@ -90,12 +91,13 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe
ResultSet rs = null; ResultSet rs = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
String selectedArea = ""; String selectedArea = "";
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
sql = " select distinct loc_phy_area from location order by loc_phy_area "; sql = " select distinct loc_phy_area from location order by loc_phy_area ";
...@@ -142,32 +144,33 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe ...@@ -142,32 +144,33 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe
public String getEORLocDtl(String locPhyArea, String siteCode, String locationRange, String expDate, String reTestDate, String occupiedRack) throws RemoteException, ITMException public String getEORLocDtl(String locPhyArea, String siteCode, String locationRange, String expDate, String reTestDate, String occupiedRack) throws RemoteException, ITMException
{ {
String sql = ""; String sql = "";
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null, pstmt1 = null; PreparedStatement pstmt = null, pstmt1 = null;
ConnDriver connDriver = new ConnDriver(); StringBuffer xmlData = null;
StringBuffer xmlData = null; String previousRow = "";
String previousRow = ""; String previousStack = "";
String previousStack = ""; String currentRow = "";
String currentRow = ""; String cuurentStack = "";
String cuurentStack = ""; String locationCode = " ";
String locationCode = " "; StringBuffer sqlStr = null;
StringBuffer sqlStr = null; int count = 0;
int count = 0; String locCode = "";
String locCode = "";
//String sysDate = "sysdate()"; //String sysDate = "sysdate()";
String sysDate = "sysdate"; String sysDate = "sysdate";
final String yseString = "Yes"; final String yseString = "Yes";
final String noString = "No"; final String noString = "No";
try try
{ {
System.out.println(" occupiedRack =" + occupiedRack); System.out.println(" occupiedRack =" + occupiedRack);
//sysDate = "sysdate"; //sysDate = "sysdate";
sqlStr = new StringBuffer(); sqlStr = new StringBuffer();
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
if (locationRange != null && locationRange.trim().length() > 0) if (locationRange != null && locationRange.trim().length() > 0)
{ {
locCode = "AND loc_code like '" + locationRange + "%'"; locCode = "AND loc_code like '" + locationRange + "%'";
...@@ -371,17 +374,18 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe ...@@ -371,17 +374,18 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe
System.out.println(" in getSiteCode method os EORLocationStock"); System.out.println(" in getSiteCode method os EORLocationStock");
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver(); StringBuffer xmlData = null;
StringBuffer xmlData = null; String siteCode = "";
String siteCode = "";
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); /*conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
// sql = "select distinct loc_phy_area from location order by loc_phy_area "; // sql = "select distinct loc_phy_area from location order by loc_phy_area ";
sql = "SELECT VAR_VALUE FROM DISPARM WHERE PRD_CODE='999999' AND VAR_NAME='SITE_CODE'"; sql = "SELECT VAR_VALUE FROM DISPARM WHERE PRD_CODE='999999' AND VAR_NAME='SITE_CODE'";
System.out.println(" sql is =" + sql); System.out.println(" sql is =" + sql);
......
package ibase.dashboard.wms.ejb; package ibase.dashboard.wms.ejb;
import ibase.dashboard.Report.Utility.DashboardUtility; import ibase.dashboard.Report.Utility.DashboardUtility;
import ibase.system.config.ConnDriver; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@Stateless @Stateless
...@@ -23,25 +20,25 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo ...@@ -23,25 +20,25 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo
public WMS3PLDashboard() public WMS3PLDashboard()
{ {
} }
E12GenericUtility e12GenericUtility = new E12GenericUtility();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public JSONObject getOrderStatusSummary(String siteCode, String dataSourceName) throws RemoteException, ITMException public JSONObject getOrderStatusSummary(String siteCode, String dataSourceName) throws RemoteException, ITMException
{ {
JSONObject rawDataOrderStatusSumJson = new JSONObject(); JSONObject rawDataOrderStatusSumJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println("********** In WMS3PLDashboard : getOrderStatusSummary Method ****************** "); System.out.println("********** In WMS3PLDashboard : getOrderStatusSummary Method ****************** ");
System.out.println("************* dataSourceName :"+dataSourceName); System.out.println("************* dataSourceName :"+dataSourceName);
conn= connDriver.getConnectDB(dataSourceName); /*conn= connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
DashboardUtility dashboardUtility = new DashboardUtility(); DashboardUtility dashboardUtility = new DashboardUtility();
if(siteCode.length() == 0) if(siteCode.length() == 0)
...@@ -192,17 +189,18 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo ...@@ -192,17 +189,18 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo
{ {
JSONObject rawDataOrderStatusDtlJson = new JSONObject(); JSONObject rawDataOrderStatusDtlJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println("********** In WMS3PLDashboard : getOrderStatusDetail Method ****************** "); System.out.println("********** In WMS3PLDashboard : getOrderStatusDetail Method ****************** ");
conn= connDriver.getConnectDB(dataSourceName); /*conn= connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:14062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
double totalCircle=629; double totalCircle=629;
DashboardUtility dashboardUtility = new DashboardUtility(); DashboardUtility dashboardUtility = new DashboardUtility();
...@@ -471,21 +469,21 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo ...@@ -471,21 +469,21 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo
{ {
JSONObject rawDataShpmentEffiJson = new JSONObject(); JSONObject rawDataShpmentEffiJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
String delay_time = ""; String delay_time = "";
String on_time = ""; String on_time = "";
double percntVal = 0.0; double percntVal = 0.0;
double percentage=0.0,totalCircle=629,dashOffSet=0; double percentage = 0.0,totalCircle=629,dashOffSet=0;
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println("********** In WMS3PLDashboard : getShipmentEfficiencySummary Method ****************** "); System.out.println("********** In WMS3PLDashboard : getShipmentEfficiencySummary Method ****************** ");
conn= connDriver.getConnectDB(dataSourceName); /*conn= connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:16062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
DashboardUtility dashboardUtility = new DashboardUtility(); DashboardUtility dashboardUtility = new DashboardUtility();
if(siteCode.length() == 0) if(siteCode.length() == 0)
...@@ -597,17 +595,18 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo ...@@ -597,17 +595,18 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo
{ {
JSONObject rawDataOrdStatusDueDateWiseJson = new JSONObject(); JSONObject rawDataOrdStatusDueDateWiseJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
double percentage=0.0,totalCircle=629,dashOffSet=0; double percentage=0.0,totalCircle=629,dashOffSet=0;
try try
{ {
System.out.println("********** In WMS3PLDashboard : getOrderStatusDueDateWiseSummary Method ****************** "); System.out.println("********** In WMS3PLDashboard : getOrderStatusDueDateWiseSummary Method ****************** ");
conn= connDriver.getConnectDB(dataSourceName); /*conn= connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:16062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
DashboardUtility dashboardUtility = new DashboardUtility(); DashboardUtility dashboardUtility = new DashboardUtility();
if(siteCode.length() == 0) if(siteCode.length() == 0)
...@@ -713,17 +712,18 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo ...@@ -713,17 +712,18 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo
{ {
JSONObject rawDataSalesOrderWiseDetailJson = new JSONObject(); JSONObject rawDataSalesOrderWiseDetailJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println("********** In WMS3PLDashboard : getSalesOrderWiseDetail Method ****************** "); System.out.println("********** In WMS3PLDashboard : getSalesOrderWiseDetail Method ****************** ");
conn= connDriver.getConnectDB(dataSourceName); /*conn= connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null; */
/*add new code for connection DB on dated:16062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
sql = "Select sorder.site_code, sorder.sale_order , count(sorddet.line_no) No_Of_Item,sorder.tot_amt as Total_Order_Value," + sql = "Select sorder.site_code, sorder.sale_order , count(sorddet.line_no) No_Of_Item,sorder.tot_amt as Total_Order_Value," +
...@@ -784,17 +784,17 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo ...@@ -784,17 +784,17 @@ public class WMS3PLDashboard extends ValidatorEJB implements WMS3PLDashboardRemo
{ {
JSONObject rawDataOrderStatusDtlJson = new JSONObject(); JSONObject rawDataOrderStatusDtlJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try try
{ {
System.out.println("********** In WMS3PLDashboard : getPickShipSummary Method ****************** "); System.out.println("********** In WMS3PLDashboard : getPickShipSummary Method ****************** ");
conn= connDriver.getConnectDB(dataSourceName); /*conn= connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;*/
/*add new code for connection DB on dated:16062016 by Nikhil*/
conn = getConnection();
int count = 0; int count = 0;
DashboardUtility dashboardUtility = new DashboardUtility(); DashboardUtility dashboardUtility = new DashboardUtility();
if(siteCode.length() == 0) if(siteCode.length() == 0)
......
...@@ -2,11 +2,8 @@ package ibase.dashboard.wms.ejb; ...@@ -2,11 +2,8 @@ package ibase.dashboard.wms.ejb;
import ibase.webitm.ejb.ValidatorRemote; import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import javax.ejb.Remote; import javax.ejb.Remote;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@Remote @Remote
......
...@@ -3,16 +3,14 @@ package ibase.dashboard.wms.servlet; ...@@ -3,16 +3,14 @@ package ibase.dashboard.wms.servlet;
import ibase.dashboard.wms.ejb.WMS3PLDashboardRemote; import ibase.dashboard.wms.ejb.WMS3PLDashboardRemote;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
public class OrderStatusDetailServlet extends HttpServlet public class OrderStatusDetailServlet extends HttpServlet
...@@ -39,6 +37,8 @@ public class OrderStatusDetailServlet extends HttpServlet ...@@ -39,6 +37,8 @@ public class OrderStatusDetailServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = request.getParameter("siteCode"); siteCode = request.getParameter("siteCode");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
...@@ -46,7 +46,9 @@ public class OrderStatusDetailServlet extends HttpServlet ...@@ -46,7 +46,9 @@ public class OrderStatusDetailServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote"); wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote");
jsonObjData = (JSONObject) wms3PLDashboardRemote.getOrderStatusDetail(siteCode, dataSourceName); /*setUserInfo(userInfo) for DB connection on dated:14062016*/
wms3PLDashboardRemote.setUserInfo(userInfo);
jsonObjData = (JSONObject) wms3PLDashboardRemote.getOrderStatusDetail(dataSourceName,siteCode );
outputStream = response.getOutputStream(); outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); outputStream.flush();
......
...@@ -12,6 +12,7 @@ import javax.servlet.ServletException; ...@@ -12,6 +12,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -39,6 +40,8 @@ public class OrderStatusDueDateWiseSummaryServlet extends HttpServlet ...@@ -39,6 +40,8 @@ public class OrderStatusDueDateWiseSummaryServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = request.getParameter("siteCode"); siteCode = request.getParameter("siteCode");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
...@@ -46,6 +49,8 @@ public class OrderStatusDueDateWiseSummaryServlet extends HttpServlet ...@@ -46,6 +49,8 @@ public class OrderStatusDueDateWiseSummaryServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote"); wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
wms3PLDashboardRemote.setUserInfo(userInfo);
jsonObjData = (JSONObject) wms3PLDashboardRemote.getOrderStatusDueDateWiseSummary(siteCode, dataSourceName); jsonObjData = (JSONObject) wms3PLDashboardRemote.getOrderStatusDueDateWiseSummary(siteCode, dataSourceName);
outputStream = response.getOutputStream(); outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -12,6 +12,7 @@ import javax.servlet.ServletException; ...@@ -12,6 +12,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -39,6 +40,8 @@ public class OrderStatusSummaryServlet extends HttpServlet ...@@ -39,6 +40,8 @@ public class OrderStatusSummaryServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = request.getParameter("siteCode"); siteCode = request.getParameter("siteCode");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
...@@ -46,6 +49,8 @@ public class OrderStatusSummaryServlet extends HttpServlet ...@@ -46,6 +49,8 @@ public class OrderStatusSummaryServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote"); wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
wms3PLDashboardRemote.setUserInfo(userInfo);
jsonObjData = (JSONObject) wms3PLDashboardRemote.getOrderStatusSummary(siteCode, dataSourceName); jsonObjData = (JSONObject) wms3PLDashboardRemote.getOrderStatusSummary(siteCode, dataSourceName);
outputStream = response.getOutputStream(); outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -12,6 +12,7 @@ import javax.servlet.ServletException; ...@@ -12,6 +12,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -39,6 +40,8 @@ public class PickShipSummaryServlet extends HttpServlet ...@@ -39,6 +40,8 @@ public class PickShipSummaryServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = request.getParameter("siteCode"); siteCode = request.getParameter("siteCode");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
...@@ -46,6 +49,8 @@ public class PickShipSummaryServlet extends HttpServlet ...@@ -46,6 +49,8 @@ public class PickShipSummaryServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote"); wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
wms3PLDashboardRemote.setUserInfo(userInfo);
jsonObjData = (JSONObject) wms3PLDashboardRemote.getPickShipSummary(siteCode, dataSourceName); jsonObjData = (JSONObject) wms3PLDashboardRemote.getPickShipSummary(siteCode, dataSourceName);
outputStream = response.getOutputStream(); outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -12,6 +12,7 @@ import javax.servlet.ServletException; ...@@ -12,6 +12,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -39,6 +40,8 @@ public class SalesOrderWiseDetailServlet extends HttpServlet ...@@ -39,6 +40,8 @@ public class SalesOrderWiseDetailServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = request.getParameter("siteCode"); siteCode = request.getParameter("siteCode");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
...@@ -46,6 +49,8 @@ public class SalesOrderWiseDetailServlet extends HttpServlet ...@@ -46,6 +49,8 @@ public class SalesOrderWiseDetailServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote"); wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
wms3PLDashboardRemote.setUserInfo(userInfo);
jsonObjData = (JSONObject) wms3PLDashboardRemote.getSalesOrderWiseDetail(siteCode, dataSourceName); jsonObjData = (JSONObject) wms3PLDashboardRemote.getSalesOrderWiseDetail(siteCode, dataSourceName);
outputStream = response.getOutputStream(); outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
...@@ -12,6 +12,7 @@ import javax.servlet.ServletException; ...@@ -12,6 +12,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
...@@ -39,6 +40,8 @@ public class ShipmentEfficiencySummaryServlet extends HttpServlet ...@@ -39,6 +40,8 @@ public class ShipmentEfficiencySummaryServlet extends HttpServlet
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = request.getParameter("siteCode"); siteCode = request.getParameter("siteCode");
dataSourceName = request.getParameter("dataSourceName"); dataSourceName = request.getParameter("dataSourceName");
...@@ -46,6 +49,8 @@ public class ShipmentEfficiencySummaryServlet extends HttpServlet ...@@ -46,6 +49,8 @@ public class ShipmentEfficiencySummaryServlet extends HttpServlet
context = new InitialContext(appConnectParm.getProperty()); context = new InitialContext(appConnectParm.getProperty());
wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote"); wms3PLDashboardRemote = (WMS3PLDashboardRemote) context.lookup("ibase/WMS3PLDashboard/remote");
/*setUserInfo(userInfo) for DB connection on dated:14062016*/
wms3PLDashboardRemote.setUserInfo(userInfo);
jsonObjData = (JSONObject) wms3PLDashboardRemote.getShipmentEfficiencySummary(siteCode, dataSourceName); jsonObjData = (JSONObject) wms3PLDashboardRemote.getShipmentEfficiencySummary(siteCode, dataSourceName);
outputStream = response.getOutputStream(); outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment