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
......@@ -24,13 +24,9 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
/**
* Default constructor.
*/
List<String> listDate =null;
List<String> listDate =null;
StringBuffer xmlDataForGeo = null;
StringBuffer xmlDataForUnit = null;
String initGeoLocation ="";
String initUnitForm ="";
public ProductionVsBudgetReport() throws RemoteException, ITMException
......@@ -43,6 +39,10 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
listDate = new ArrayList<String>();
String firstDateofMonth="";
String lstDateofMonth="";
Calendar cal=null;
SimpleDateFormat sdf=null;
try
{
......@@ -62,10 +62,26 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
pstmt = 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.setString(1, firstDateofMonth);
pstmt.setString(2, lstDateofMonth);
rs = pstmt.executeQuery();
xmlDataForGeo = new StringBuffer("<?xml version=\"1.0\"?><Root>");
int count=1;
......@@ -199,13 +215,15 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
year =calendar.get(Calendar.YEAR);
month = new SimpleDateFormat("MMM").format(calendar.getTime());
// change on item changes of GeoLocation code
initGeoLocation="'"+initGeoLocation+"'";
initUnitForm="'"+initUnitForm+"'";
if((geoLoc!=null && geoLoc.trim().length()>0)&& (unitForm!=null && unitForm.trim().length()>0)){
initGeoLocation =geoLoc;
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 "+
"from ("+
......@@ -557,12 +575,7 @@ public class ProductionVsBudgetReport extends ValidatorEJB implements Production
this.initUnitForm = initUnitForm;
}
}
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