Commit f140cf3c authored by bpandey's avatar bpandey

change the sql for geoLocation Droup Down list


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93790 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 93445bfe
...@@ -27,10 +27,6 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production ...@@ -27,10 +27,6 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
List<String> listDate =null; List<String> listDate =null;
StringBuffer xmlDataForGeo = null; StringBuffer xmlDataForGeo = null;
StringBuffer xmlDataForUnit = null; StringBuffer xmlDataForUnit = null;
String initGeoLocation =""; String initGeoLocation ="";
String initUnitForm =""; String initUnitForm ="";
public ProductionVsBudgetReport() throws RemoteException, ITMException public ProductionVsBudgetReport() throws RemoteException, ITMException
...@@ -43,6 +39,10 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production ...@@ -43,6 +39,10 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
listDate = new ArrayList<String>(); listDate = new ArrayList<String>();
String firstDateofMonth="";
String lstDateofMonth="";
Calendar cal=null;
SimpleDateFormat sdf=null;
try try
{ {
...@@ -62,10 +62,26 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production ...@@ -62,10 +62,26 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
pstmt = null; pstmt = null;
rs = null; rs = null;
//coding for generate geoLocation combo box with unit_form /**
Code for get first n last date of month date 17/10/13 */
cal = Calendar.getInstance();
sdf=new SimpleDateFormat("dd-MMM-yy");
cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
lstDateofMonth=sdf.format(cal.getTime());
cal = Calendar.getInstance();
//cal.add(cal.MONTH,-1);
cal.set(Calendar.DATE, cal.getActualMinimum(Calendar.DATE));
firstDateofMonth= sdf.format(cal.getTime());
//coding for generate geoLocation combo box
//sql ="select fld_value, descr from gencodes where FLD_NAME='GEO_LOC' and mod_name='X' ";
sql="select fld_value, descr from gencodes where fld_name = 'GEO_LOC' and mod_name = 'X' and fld_value in (select distinct geo_loc from site where site_code in (select distinct site_code from dwh_production_day_events where tran_date between ? and ? and ref_ser ='W-RCP'))";
sql ="select fld_value, descr from gencodes where FLD_NAME='GEO_LOC' and mod_name='X' ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, firstDateofMonth);
pstmt.setString(2, lstDateofMonth);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
xmlDataForGeo = new StringBuffer("<?xml version=\"1.0\"?><Root>"); xmlDataForGeo = new StringBuffer("<?xml version=\"1.0\"?><Root>");
int count=1; int count=1;
...@@ -200,12 +216,14 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production ...@@ -200,12 +216,14 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
month = new SimpleDateFormat("MMM").format(calendar.getTime()); month = new SimpleDateFormat("MMM").format(calendar.getTime());
// change on item changes of GeoLocation code // change on item changes of GeoLocation code
initGeoLocation="'"+initGeoLocation+"'";
initUnitForm="'"+initUnitForm+"'";
if((geoLoc!=null && geoLoc.trim().length()>0)&& (unitForm!=null && unitForm.trim().length()>0)){ if((geoLoc!=null && geoLoc.trim().length()>0)&& (unitForm!=null && unitForm.trim().length()>0)){
initGeoLocation =geoLoc; initGeoLocation =geoLoc;
initUnitForm =unitForm; initUnitForm =unitForm;
System.out.println("select geoLoc inside in java ==="+geoLoc +"selected unitForm inside in java =="+unitForm);
} }
System.out.println("select Final initGeoLocation inside in java ==="+initGeoLocation +"selected initUnitForm inside in java =="+initUnitForm);
/*sql = "select geo_loc, unit__form,to_char (tran_date,'DD') as tran_date, day_quantity, pyr_cumqty,cum_budqty "+ /*sql = "select geo_loc, unit__form,to_char (tran_date,'DD') as tran_date, day_quantity, pyr_cumqty,cum_budqty "+
"from ("+ "from ("+
...@@ -560,9 +578,4 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production ...@@ -560,9 +578,4 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
} }
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