Commit 67e1d907 authored by nkhan's avatar nkhan

Added by Nasruddin khan


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102653 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5372d589
......@@ -96,6 +96,9 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
double maxAmount = 0.0;
double minAmount = 0.0;
double commPercentage = 0.0;
NodeList detailNodeList = null;
NodeList detail3childNodeList = null;
Node detail3parentNode = null;
try
{
......@@ -122,8 +125,8 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName ::["+childNodeName);
if(childNodeName.equalsIgnoreCase("comm_table") && ("A".equalsIgnoreCase(editFlag)) )
......@@ -161,7 +164,7 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
}
if(childNodeName.equalsIgnoreCase("descr") && ("A".equalsIgnoreCase(editFlag)) )
{
descr = genericUtility.getColumnValue("descr",dom);
System.out.println("descr === "+descr);
if(descr == null || descr.trim().length() == 0)
......@@ -190,14 +193,14 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
errString = itmDBAccessEJB.getErrorString("","VMDESCEXIS",userId);
break ;
}
}
}
if(childNodeName.equalsIgnoreCase("sh_descr") && ("A".equalsIgnoreCase(editFlag)) )
{
shDescr = genericUtility.getColumnValue("sh_descr",dom);
System.out.println("sh_descr === "+shDescr);
if(shDescr != null && shDescr.trim().length() > 0)
......@@ -223,16 +226,37 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
}
}
}
if (childNodeName.equalsIgnoreCase("comm_criteria"))
{
commCriteria = this.genericUtility.getColumnValue("comm_criteria", dom);
System.out.println("Commision Criteria [" + commCriteria);
if ((commCriteria != null) && (commCriteria.trim().length() > 0))
{
detailNodeList = dom2.getElementsByTagName("Detail3");
System.out.println("detailNodeList ::" + detailNodeList);
if ((detailNodeList != null) && (detailNodeList.getLength() > 0) && (commCriteria.equalsIgnoreCase("I")))
{
errString = itmDBAccessEJB.getErrorString("", "VTRECINCOM", userId);
break;
}
}
if ((commCriteria != null) && (commCriteria.trim().length() > 0))
{
detailNodeList = dom2.getElementsByTagName("Detail2");
if ((detailNodeList != null) && (detailNodeList.getLength() > 0) && (commCriteria.equalsIgnoreCase("V")))
{
errString = itmDBAccessEJB.getErrorString("", "VTRECINDET", userId);
break;
}
}
}
} // end for
break;
case 2:
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
......@@ -564,7 +588,81 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
System.out.println("errString befor break" +errString);
break;
}
String effdatestr = genericUtility.getColumnValue( "eff_date", dom ) != null ? genericUtility.getColumnValue( "eff_date", dom ) : null;
String vuptodatestr = genericUtility.getColumnValue( "valid_upto", dom ) != null ? genericUtility.getColumnValue( "valid_upto", dom ) : null;
//if(effdatestr != null && vuptodatestr!=null)
//{
String updateFlag ="";
String lineNo1 = genericUtility.getColumnValue( "line_no", dom ) != null ? genericUtility.getColumnValue( "line_no", dom ) : "";
lineNo1 = lineNo1.trim();
String lineNoDet="";
String effdateDet = null;
String valuptoDet = null;
System.out.println("lineNo1.......["+lineNo1+"] ");
System.out.println("effdatestr.......["+effdatestr+"] ");
System.out.println("vuptodatestr.......["+vuptodatestr+"] ");
//System.out.println("lineNo1.......["+lineNo1+"] ");
java.sql.Timestamp efDtDomTimeStp = null;
java.sql.Timestamp vuptodtDomTimeStp = null;
java.sql.Timestamp efDtDetTimeStp = null;
java.sql.Timestamp vuptodtDetTimeStp = null;
NodeList detail2List = dom2.getElementsByTagName("Detail3");
int detail2ListLen = detail2List.getLength();
for(int detail2Idx = 0; detail2Idx < detail2ListLen ; detail2Idx++ )
{
Node currDetail = detail2List.item( detail2Idx );
NodeList currDetNodes = currDetail.getChildNodes();
updateFlag = getNodeValue( currDetail, "updateFlag", true );
effdateDet = getNodeValue( currDetail, "eff_date", false );
valuptoDet = getNodeValue( currDetail, "valid_upto", false );
lineNoDet = getNodeValue( currDetail, "line_no", false );
System.out.println("updateFlag.......["+updateFlag+"] ");
System.out.println("effdateDet.......["+effdateDet+"] ");
System.out.println("lineNoDet.......["+lineNoDet+"] ");
if( (!lineNoDet.equals(lineNo1)) && (!updateFlag.equals("D") ) )
{
if( (effdateDet != null) && (valuptoDet != null) )
{
System.out.println("Inside first if condition.......");
efDtDomTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(effdatestr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
vuptodtDomTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(vuptodatestr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
efDtDetTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(effdateDet, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
vuptodtDetTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(valuptoDet, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
if( efDtDomTimeStp.compareTo ( efDtDetTimeStp ) >= 0 && efDtDomTimeStp.compareTo ( vuptodtDetTimeStp ) <= 0)
{
errString = itmDBAccessEJB.getErrorString("","VMEFVUTDAT",userId);
break ;
}
if( efDtDomTimeStp.compareTo ( efDtDetTimeStp ) <= 0 && vuptodtDomTimeStp.compareTo ( vuptodtDetTimeStp ) >= 0)
{
System.out.println(" vuptodtDetTimeStp ::"+vuptodtDetTimeStp);
errString = itmDBAccessEJB.getErrorString("","VMEFVUTDAT",userId);
break ;
}
if( vuptodtDomTimeStp.compareTo ( efDtDetTimeStp ) >= 0 && vuptodtDomTimeStp.compareTo ( vuptodtDetTimeStp ) < 0)
{
errString = itmDBAccessEJB.getErrorString("","VMEFVUTDAT",userId);
break ;
}
if( efDtDomTimeStp.compareTo ( efDtDetTimeStp ) == 0 || vuptodtDomTimeStp.compareTo ( vuptodtDetTimeStp ) == 0)
{
errString = itmDBAccessEJB.getErrorString("","VMEFVUTDAT",userId);
break ;
}
}
}
}
}
} //end eff_date
......@@ -594,7 +692,6 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
errString = itmDBAccessEJB.getErrorString("","INVEFDATE",userId);
break ;
}
}
else
{
......@@ -621,84 +718,7 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
errString = itmDBAccessEJB.getErrorString("","VTMINAMT",userId);
break ;
}
else
{
String effdatestr = genericUtility.getColumnValue( "eff_date", dom ) != null ? genericUtility.getColumnValue( "eff_date", dom ) : null;
String vuptodatestr = genericUtility.getColumnValue( "valid_upto", dom ) != null ? genericUtility.getColumnValue( "valid_upto", dom ) : null;
String updateFlag ="";
String lineNo1 = genericUtility.getColumnValue( "line_no", dom ) != null ? genericUtility.getColumnValue( "line_no", dom ) : "";
lineNo1 = lineNo1.trim();
String lineNoDet="";
String effdateDet = null;
String valuptoDet = null;
System.out.println("lineNo1.......["+lineNo1+"] ");
System.out.println("effdatestr.......["+effdatestr+"] ");
System.out.println("vuptodatestr.......["+vuptodatestr+"] ");
//System.out.println("lineNo1.......["+lineNo1+"] ");
java.sql.Timestamp efDtDomTimeStp = null;
java.sql.Timestamp vuptodtDomTimeStp = null;
java.sql.Timestamp efDtDetTimeStp = null;
java.sql.Timestamp vuptodtDetTimeStp = null;
NodeList detail2List = dom2.getElementsByTagName("Detail3");
int detail2ListLen = detail2List.getLength();
for(int detail2Idx = 0; detail2Idx < detail2ListLen ; detail2Idx++ )
{
Node currDetail = detail2List.item( detail2Idx );
NodeList currDetNodes = currDetail.getChildNodes();
updateFlag = getNodeValue( currDetail, "updateFlag", true );
effdateDet = getNodeValue( currDetail, "eff_date", false );
valuptoDet = getNodeValue( currDetail, "valid_upto", false );
lineNoDet = getNodeValue( currDetail, "line_no", false );
System.out.println("updateFlag.......["+updateFlag+"] ");
System.out.println("effdateDet.......["+effdateDet+"] ");
System.out.println("lineNoDet.......["+lineNoDet+"] ");
if( (!lineNoDet.equals(lineNo1)) && (!updateFlag.equals("D") ) )
{
if( (effdateDet != null) && (valuptoDet != null) )
{
System.out.println("Inside first if condition.......");
efDtDomTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(effdatestr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
vuptodtDomTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(vuptodatestr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
efDtDetTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(effdateDet, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
vuptodtDetTimeStp = Timestamp.valueOf(genericUtility.getValidDateString(valuptoDet, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
if( efDtDomTimeStp.compareTo ( efDtDetTimeStp ) >= 0 && efDtDomTimeStp.compareTo ( vuptodtDetTimeStp ) <= 0)
{
errString = itmDBAccessEJB.getErrorString("","INVEFDATE",userId);
break ;
}
if( efDtDomTimeStp.compareTo ( efDtDetTimeStp ) <= 0 && vuptodtDomTimeStp.compareTo ( vuptodtDetTimeStp ) >= 0)
{
errString = itmDBAccessEJB.getErrorString("","INVEFDATE",userId);
break ;
}
if( vuptodtDomTimeStp.compareTo ( efDtDetTimeStp ) >= 0 && vuptodtDomTimeStp.compareTo ( vuptodtDetTimeStp ) < 0)
{
errString = itmDBAccessEJB.getErrorString("","INVEFDATE",userId);
break ;
}
if( efDtDomTimeStp.compareTo ( efDtDetTimeStp ) == 0 || vuptodtDomTimeStp.compareTo ( vuptodtDetTimeStp ) == 0)
{
errString = itmDBAccessEJB.getErrorString("","INVEFDATE",userId);
break ;
}
/* if( deprDet.equals(deprtype) && assetCode.equalsIgnoreCase( assetDet ) )
{
errString = itmDBAccessEJB.getErrorString("depr_type","VTDEPRDUP",userId);
break ;
} */
}
}
}
}
} // end min_amt
else if(childNodeName.equalsIgnoreCase("max_amt")){ // start if max_amt
minAmount = Double.parseDouble(checkNllOrBlank(genericUtility.getColumnValue("min_amt",dom)));
......@@ -716,8 +736,6 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
break ;
}
} // end if max_amt
commCriteria = genericUtility.getColumnValue("comm_criteria", dom1);
System.out.println("commCriteria ::: ["+commCriteria);
if(commCriteria != null && commCriteria.trim().length()>0){
......@@ -728,11 +746,8 @@ public class CommissiondetIC extends ValidatorEJB implements CommissiondetICLoca
}
}
}
// changed by Nasruddin khan [19/JUL/16 D16DFOR001] END
break;
} //END switch
......
......@@ -245,5 +245,25 @@ values (
sysdate,
'BASE',
'BASE' );
insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,CHG_DATE,CHG_USER,CHG_TERM)
values ('VTRECINDET',
'INVALID COMMISION CRITEREA',
'Records Exsit in Detail Value Wise',
'E',
sysdate,
'BASE',
'BASE');
insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,CHG_DATE,CHG_USER,CHG_TERM)
values ('VTRECINCOM',
'INVALID COMMISION CRITEREA',
'Records Exsit in Detail Item Wise',
'E',
sysdate,
'BASE',
'BASE');
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