Commit f8795e81 authored by caluka's avatar caluka

Entry start date greater than to date validation added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100382 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0b518cb8
......@@ -113,6 +113,7 @@ public class PrdTableGenIC extends ValidatorEJB implements PrdTableGenICLocal, P
Timestamp fromDate=null,tooDate=null,entryStartDt=null,entryEndDt=null;
String divisionList="",frmDateList="", toDateList="",toDateListNull="",frmDateListNull="",toDateListInvalid="",frmDateListInvalid="";
String entryStartDtListNull="",entryStartDtListInvalid="",entryEndDtListInvalid="",entryEndDtListNull="",entryStartDtList="";
String ToDateEntryStrtList="";
ArrayList divisionLst = new ArrayList();
boolean validateFlag=false;
String retString="",begPart="",endPart="",mainStr="";
......@@ -325,6 +326,7 @@ public class PrdTableGenIC extends ValidatorEJB implements PrdTableGenICLocal, P
} else if(childNodeName.equalsIgnoreCase("entry_start_dt"))
{
entryStartDtStr = genericUtility.getColumnValue("entry_start_dt", dom);
toDate = genericUtility.getColumnValue("to_date", dom);
if(entryStartDtStr==null || entryStartDtStr.trim().length()==0)
{
errCode = "VTSTDTNULL";
......@@ -342,6 +344,20 @@ public class PrdTableGenIC extends ValidatorEJB implements PrdTableGenICLocal, P
errFields.add(childNodeName.toLowerCase());
break;
}
if((toDate!=null && toDate.trim().length()>0) && (isDateValid(toDate)==true))
{
entryStartDt = Timestamp.valueOf(genericUtility.getValidDateString(entryStartDtStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
tooDate = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
if(entryStartDt.compareTo(tooDate)<=0)
{
System.out.println(" entryStartDt is less than To date");
errCode = "INVSTDT3";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
}
}
}else if(childNodeName.equalsIgnoreCase("entry_end_dt"))
......@@ -633,6 +649,24 @@ public class PrdTableGenIC extends ValidatorEJB implements PrdTableGenICLocal, P
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if((toDate!=null && toDate.trim().length()>0) && (isDateValid(toDate)==true))
{
entryStartDt = Timestamp.valueOf(genericUtility.getValidDateString(entryStartDtStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
tooDate = Timestamp.valueOf(genericUtility.getValidDateString(toDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("entryStartDt>>"+entryStartDt);
System.out.println("tooDate>>"+tooDate);
if(entryStartDt.compareTo(tooDate)<=0)
{
ToDateEntryStrtList=ToDateEntryStrtList+" "+prdTblNo+",";
System.out.println("ToDateEntryStrtList===="+ToDateEntryStrtList);
errCode = "INVSTDT3";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
if(entryEndDtStr==null || entryEndDtStr.trim().length()==0)
......@@ -768,6 +802,20 @@ public class PrdTableGenIC extends ValidatorEJB implements PrdTableGenICLocal, P
*/
//Start Added by chandrashekar on 16-feb-2016
if(errCode.equals("INVSTDT3"))
{
if( ToDateEntryStrtList != null && ToDateEntryStrtList.trim().length() > 0 )
{
ToDateEntryStrtList = ToDateEntryStrtList.substring(0, ToDateEntryStrtList.length()-1);
}
System.out.println("@@@@@@@ ToDateEntryStrtList["+ToDateEntryStrtList+"]");
retString=errString;
begPart = retString.substring( 0, errString.indexOf("]]></description>") );
endPart = retString.substring( errString.indexOf("]]></description>"), errString.length() );
mainStr = begPart + ToDateEntryStrtList + endPart;
errString = mainStr;
}
if(errCode.equals("VTSTDTNULL"))
{
if( entryStartDtListNull != null && entryStartDtListNull.trim().length() > 0 )
......
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