Commit 27cf4084 authored by msingh's avatar msingh

Changed by Manish on 27/06/16


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102135 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0c5dfa58
...@@ -77,6 +77,10 @@ public class MiscPayConfSch implements Schedule ...@@ -77,6 +77,10 @@ public class MiscPayConfSch implements Schedule
String strToWrite=""; String strToWrite="";
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
String currTime = null; String currTime = null;
String epayNoDays="";
int noOfDays=0;
Date fromDate=null;
Timestamp fromDateDB=null;
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
currTime = sdf1.format(new Timestamp(System.currentTimeMillis())).toString(); currTime = sdf1.format(new Timestamp(System.currentTimeMillis())).toString();
currTime = currTime.replaceAll("-",""); currTime = currTime.replaceAll("-","");
...@@ -123,9 +127,35 @@ public class MiscPayConfSch implements Schedule ...@@ -123,9 +127,35 @@ public class MiscPayConfSch implements Schedule
Timestamp newsysDate = java.sql.Timestamp.valueOf( sdf1.format(currentDate)+" 00:00:00.0"); Timestamp newsysDate = java.sql.Timestamp.valueOf( sdf1.format(currentDate)+" 00:00:00.0");
System.out.println(">>>> newsysDate is:"+newsysDate); System.out.println(">>>> newsysDate is:"+newsysDate);
queryString = "SELECT TRAN_ID FROM MISC_PAYMENT WHERE CONFIRMED='N' AND WF_STATUS='S' AND REF_DATE= ? "; java.util.Date todayDate=new java.util.Date();
// Code added by Sagar on 25/11/15 Start
FinCommon finCommon=new FinCommon();
UtilMethods utilmethod = new UtilMethods();
epayNoDays = checkNull(finCommon.getFinparams("999999", "EPAY_NO_DAYS", conn));
System.out.println(">>>>epayNoDays:"+epayNoDays);
//Retrive no of days from finparam, If it is not null then minus noofdays from current date and set as from date, Other wise noofdays is null then set current date.
if(epayNoDays!=null && epayNoDays.trim().length() > 0 && !"NULLFOUND".equals(epayNoDays) )
{
noOfDays= Integer.parseInt(epayNoDays);
fromDate = utilmethod.RelativeDate(currentDate, -noOfDays);
System.out.println(">>>fromDate:"+fromDate);
}
else
{
fromDate= currentDate;
}
fromDateDB = java.sql.Timestamp.valueOf(sdf1.format(fromDate)+" 00:00:00.0");
System.out.println(">>>>>fromDateDB:"+fromDateDB);
System.out.println(">>>>>newsysDate:"+newsysDate);
// Code added by Sagar on 25/11/15 End
//queryString = "SELECT TRAN_ID FROM MISC_PAYMENT WHERE CONFIRMED='N' AND WF_STATUS='S' AND REF_DATE= ? "; // Comment added by Sagar on 25/11/15
queryString = "SELECT TRAN_ID FROM MISC_PAYMENT WHERE CONFIRMED='N' AND WF_STATUS='S' AND REF_DATE BETWEEN ? AND ? ";
pstmt = conn.prepareStatement(queryString); pstmt = conn.prepareStatement(queryString);
pstmt.setTimestamp(1, newsysDate ); pstmt.setTimestamp(1, fromDateDB );
pstmt.setTimestamp(2, newsysDate );
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
...@@ -375,5 +405,13 @@ public class MiscPayConfSch implements Schedule ...@@ -375,5 +405,13 @@ public class MiscPayConfSch implements Schedule
} }
catch(Exception exWm){exWm.printStackTrace();} catch(Exception exWm){exWm.printStackTrace();}
} }
private String checkNull(String input)
{
if (input == null)
{
input = "";
}
return input.trim();
}
} }
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