Commit a742bd72 authored by nkhan's avatar nkhan

[S15IBAS003] Updated Sources For Adding Validation From MSI And removing extra validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103417 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ec3d7d10
...@@ -117,12 +117,14 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -117,12 +117,14 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
if(childNodeName.equalsIgnoreCase("cr_term")) if(childNodeName.equalsIgnoreCase("cr_term"))
{ {
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom)); crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
//if(crTerm == null || crTerm.trim().length() == 0) // changed By Nasruddin 14/SEP/16 START
//{ if(crTerm == null || crTerm.trim().length() == 0)
// errCode = "VECRT2"; {
// errList.add(errCode); errCode = "VECRT2";
// errFields.add(childNodeName.toLowerCase()); errList.add(errCode);
//} errFields.add(childNodeName.toLowerCase());
}
// changed By Nasruddin 14/SEP/16 END
if(editFlag.equalsIgnoreCase("A") && crTerm != null && crTerm.trim().length() > 0) if(editFlag.equalsIgnoreCase("A") && crTerm != null && crTerm.trim().length() > 0)
{ {
sql = "select count(*) from crterm where cr_term = ?"; sql = "select count(*) from crterm where cr_term = ?";
...@@ -155,6 +157,32 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -155,6 +157,32 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
// changed By Nasruddin 14/SEP/16 Start
else
{
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
sql = "select count(1) from crterm where cr_term <> ? and descr = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,crTerm);
pstmt.setString(2, descr);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count > 0)
{
errCode = "VMDUPDESCR";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
// changed By Nasruddin 14/SEP/16 END
} }
else if(childNodeName.equalsIgnoreCase("start_from")) else if(childNodeName.equalsIgnoreCase("start_from"))
{ {
...@@ -181,7 +209,8 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -181,7 +209,8 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("min_day")) if(childNodeName.equalsIgnoreCase("min_day"))
{ {
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom)); //crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
crTerm = crTerm;
lineNo = checkNull(genericUtility.getColumnValue("line_no", dom)); lineNo = checkNull(genericUtility.getColumnValue("line_no", dom));
minDay = convertInt(genericUtility.getColumnValue("min_day", dom)); minDay = convertInt(genericUtility.getColumnValue("min_day", dom));
maxDay = convertInt(genericUtility.getColumnValue("max_day", dom)); maxDay = convertInt(genericUtility.getColumnValue("max_day", dom));
...@@ -258,18 +287,9 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -258,18 +287,9 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
} }
else else
{ {
/*select count(*) into :cnt from crtermfc
where cr_term = :mval and (min_day <> :mmin_day // Changed By Nasruddin 14/SEP/16 START
or min_cramt <> :mmin_cramt) and
max_day between :mmin_day and :mmax_day and
(min_cramt between :mmin_cramt and :mmax_cramt or
max_cramt between :mmin_cramt and :mmax_cramt) and
line_no <> :mval1 ;
if cnt > 0 then
// max range clashes in edit
errcode = 'VTCRTERM2'
sql = "select count(*) from crtermfc where cr_term = ? and " sql = "select count(*) from crtermfc where cr_term = ? and "
+" (min_day <> ? or min_cramt <> ?) and max_day between ? and ? and " +" (min_day <> ? or min_cramt <> ?) and max_day between ? and ? and "
+" (min_cramt between ? and ? or max_cramt between ? and ?) and " +" (min_cramt between ? and ? or max_cramt between ? and ?) and "
...@@ -300,8 +320,8 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -300,8 +320,8 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
*/
} }
// Changed By Nasruddin 14/SEP/16 END
} }
} }
} }
...@@ -347,6 +367,7 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -347,6 +367,7 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
pstmt = null; pstmt = null;
} }
} }
/*
else if(childNodeName.equalsIgnoreCase("fin_chg")) else if(childNodeName.equalsIgnoreCase("fin_chg"))
{ {
financialCharge = checkNull(genericUtility.getColumnValue("fin_chg", dom)); financialCharge = checkNull(genericUtility.getColumnValue("fin_chg", dom));
...@@ -357,7 +378,7 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -357,7 +378,7 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }*/
} }
break; break;
case 3 : case 3 :
......
...@@ -599,5 +599,4 @@ public class CustItemUpdateIC extends ValidatorEJB implements CustItemUpdateICLo ...@@ -599,5 +599,4 @@ public class CustItemUpdateIC extends ValidatorEJB implements CustItemUpdateICLo
return msgType; return msgType;
} }
} }
...@@ -12,7 +12,6 @@ import ibase.webitm.ejb.ValidatorEJB; ...@@ -12,7 +12,6 @@ import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon; import ibase.webitm.ejb.fin.FinCommon;
//import ibase.webitm.utility.GenericUtility; //import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
...@@ -20,9 +19,7 @@ import java.sql.ResultSet; ...@@ -20,9 +19,7 @@ import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
...@@ -99,6 +96,7 @@ implements CustomerLocal, CustomerRemote ...@@ -99,6 +96,7 @@ implements CustomerLocal, CustomerRemote
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
String commTable = "";//changed by Nasruddin [19/JUL/16 ] String commTable = "";//changed by Nasruddin [19/JUL/16 ]
String discList = "";
try try
{ {
this.finCommon = new FinCommon(); this.finCommon = new FinCommon();
...@@ -179,7 +177,9 @@ implements CustomerLocal, CustomerRemote ...@@ -179,7 +177,9 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("cust_name")) }
// Comment By Nkhan [16-SEP-16] START
/* else if (childNodeName.equalsIgnoreCase("cust_name"))
{ {
custName = this.genericUtility.getColumnValue("cust_name", dom); custName = this.genericUtility.getColumnValue("cust_name", dom);
...@@ -189,7 +189,8 @@ implements CustomerLocal, CustomerRemote ...@@ -189,7 +189,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("sh_name")) }
else if (childNodeName.equalsIgnoreCase("sh_name"))
{ {
shName = this.genericUtility.getColumnValue("sh_name", dom); shName = this.genericUtility.getColumnValue("sh_name", dom);
...@@ -199,7 +200,8 @@ implements CustomerLocal, CustomerRemote ...@@ -199,7 +200,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("available_yn")) }
else if (childNodeName.equalsIgnoreCase("available_yn"))
{ {
availableYn = this.genericUtility.getColumnValue("available_yn", dom); availableYn = this.genericUtility.getColumnValue("available_yn", dom);
...@@ -209,7 +211,8 @@ implements CustomerLocal, CustomerRemote ...@@ -209,7 +211,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("round")) }
else if (childNodeName.equalsIgnoreCase("round"))
{ {
round = this.genericUtility.getColumnValue("round", dom); round = this.genericUtility.getColumnValue("round", dom);
...@@ -219,7 +222,8 @@ implements CustomerLocal, CustomerRemote ...@@ -219,7 +222,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("round_to")) }
else if (childNodeName.equalsIgnoreCase("round_to"))
{ {
roundTo = this.genericUtility.getColumnValue("round_to", dom); roundTo = this.genericUtility.getColumnValue("round_to", dom);
...@@ -229,7 +233,8 @@ implements CustomerLocal, CustomerRemote ...@@ -229,7 +233,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("curr_code__frt")) }
else if (childNodeName.equalsIgnoreCase("curr_code__frt"))
{ {
currCodeFrt = this.genericUtility.getColumnValue("curr_code__frt", dom); currCodeFrt = this.genericUtility.getColumnValue("curr_code__frt", dom);
...@@ -239,7 +244,8 @@ implements CustomerLocal, CustomerRemote ...@@ -239,7 +244,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("curr_code__ins")) }
else if (childNodeName.equalsIgnoreCase("curr_code__ins"))
{ {
currCodeIns = this.genericUtility.getColumnValue("curr_code__ins", dom); currCodeIns = this.genericUtility.getColumnValue("curr_code__ins", dom);
...@@ -250,7 +256,8 @@ implements CustomerLocal, CustomerRemote ...@@ -250,7 +256,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("ignore_credit")) } Comment By Nkhan [16-SEP-16] END */
else if (childNodeName.equalsIgnoreCase("ignore_credit"))
{ {
ignoreCredit = this.genericUtility.getColumnValue("ignore_credit", dom); ignoreCredit = this.genericUtility.getColumnValue("ignore_credit", dom);
...@@ -264,13 +271,16 @@ implements CustomerLocal, CustomerRemote ...@@ -264,13 +271,16 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else }
else
{ {
errCode = "VMIGCRTNLL"; errCode = "VMIGCRTNLL";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("credit_lmt")) }
/* Comment By Nkhan [16-SEP-16] START
else if (childNodeName.equalsIgnoreCase("credit_lmt"))
{ {
creditLmt = this.genericUtility.getColumnValue("credit_lmt", dom); creditLmt = this.genericUtility.getColumnValue("credit_lmt", dom);
...@@ -280,7 +290,8 @@ implements CustomerLocal, CustomerRemote ...@@ -280,7 +290,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("ignore_days")) } Comment By Nkhan [16-SEP-16] END */
else if (childNodeName.equalsIgnoreCase("ignore_days"))
{ {
ignoreDays = this.genericUtility.getColumnValue("ignore_days", dom); ignoreDays = this.genericUtility.getColumnValue("ignore_days", dom);
...@@ -295,12 +306,13 @@ implements CustomerLocal, CustomerRemote ...@@ -295,12 +306,13 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("acct_code__adv")) }
else if (childNodeName.equalsIgnoreCase("acct_code__adv"))
{ {
acctCodeAdv = this.genericUtility.getColumnValue("acct_code__adv", dom); acctCodeAdv = this.genericUtility.getColumnValue("acct_code__adv", dom);
if (acctCodeAdv != null) //if (acctCodeAdv != null)
{ //{
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from accounts where acct_code =?"; sql = "select count(*) as cnt from accounts where acct_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -336,24 +348,29 @@ implements CustomerLocal, CustomerRemote ...@@ -336,24 +348,29 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else }
else
{ {
errCode = "VTACCTCD1"; errCode = "VTACCTCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else //}
/* Comment By Nasruddin [16-SEP-16] START
else
{ {
errCode = "VTACCTNLL";// Account adv null errCode = "VTACCTNLL";// Account adv null
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("cctr_code__adv")) Comment By Nasruddin [16-SEP-16] END*/
}
else if (childNodeName.equalsIgnoreCase("cctr_code__adv"))
{ {
cctrCodeAdv = this.genericUtility.getColumnValue("cctr_code__adv", dom); cctrCodeAdv = this.genericUtility.getColumnValue("cctr_code__adv", dom);
cnt = 0; cnt = 0;
if (cctrCodeAdv != null && cctrCodeAdv.trim().length() > 0) //if (cctrCodeAdv != null && cctrCodeAdv.trim().length() > 0)
{ //{
sql = "select count(*) as cnt from costctr where cctr_code =?"; sql = "select count(*) as cnt from costctr where cctr_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -374,14 +391,15 @@ implements CustomerLocal, CustomerRemote ...@@ -374,14 +391,15 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} //}
} else if (childNodeName.equalsIgnoreCase("group_code")) }
else if (childNodeName.equalsIgnoreCase("group_code"))
{ {
groupCode = this.genericUtility.getColumnValue("group_code", dom); groupCode = this.genericUtility.getColumnValue("group_code", dom);
custCode = this.genericUtility.getColumnValue("cust_code", dom); custCode = this.genericUtility.getColumnValue("cust_code", dom);
if (groupCode != null && groupCode.trim().length() > 0) //if (groupCode != null && groupCode.trim().length() > 0)
{ //{
if (!groupCode.equalsIgnoreCase(custCode)) if (!groupCode.equalsIgnoreCase(custCode))
{ {
cnt = 0; cnt = 0;
...@@ -417,13 +435,17 @@ implements CustomerLocal, CustomerRemote ...@@ -417,13 +435,17 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else //}
/* /Comment By Nasruddin [16-SEP-16] START
else
{ {
errCode = "VMGRPCNULL";// Group Code is null errCode = "VMGRPCNULL";// Group Code is null
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("cust_code__bil")) //Comment By Nasruddin [16-SEP-16] END*/
}
else if (childNodeName.equalsIgnoreCase("cust_code__bil"))
{ {
custCodeBil = this.genericUtility.getColumnValue("cust_code__bil", dom); custCodeBil = this.genericUtility.getColumnValue("cust_code__bil", dom);
custCode = this.genericUtility.getColumnValue("cust_code", dom); custCode = this.genericUtility.getColumnValue("cust_code", dom);
...@@ -439,13 +461,15 @@ implements CustomerLocal, CustomerRemote ...@@ -439,13 +461,15 @@ implements CustomerLocal, CustomerRemote
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if ((custCodeBil != null && custCodeBil.trim().length() > 0) && !("A".equalsIgnoreCase(keyFlag))) if ((custCodeBil.trim().length() == 0 || custCodeBil == null) && !("A".equalsIgnoreCase(keyFlag)))
//if ((custCodeBil != null && custCodeBil.trim().length() > 0) && !("A".equalsIgnoreCase(keyFlag))) // Comment By Nasruddin [16-SEP-16]
{ {
errCode = "VEBILLTO"; errCode = "VEBILLTO";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} else if (!custCodeBil.equalsIgnoreCase(custCode)) }
else if (!custCodeBil.equalsIgnoreCase(custCode))
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from customer where cust_code =?"; sql = "select count(*) as cnt from customer where cust_code =?";
...@@ -467,19 +491,23 @@ implements CustomerLocal, CustomerRemote ...@@ -467,19 +491,23 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (custCodeBil == null || custCodeBil.trim().length() <= 0) }
/* Comment By Nasruddin [16-SEP-16] START
else if (custCodeBil == null || custCodeBil.trim().length() <= 0)
{ {
errCode = "VMBLLTONLL";// Bill To is null errCode = "VMBLLTONLL";// Bill To is null
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("stan_code")) Comment By Nasruddin [16-SEP-16] END*/
}
else if (childNodeName.equalsIgnoreCase("stan_code"))
{ {
stanCode = this.genericUtility.getColumnValue("stan_code", dom); stanCode = this.genericUtility.getColumnValue("stan_code", dom);
cnt = 0; cnt = 0;
if (stanCode != null) //if (stanCode != null)
{ //{
sql = "select count(*) as cnt from station where stan_code =?"; sql = "select count(*) as cnt from station where stan_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, stanCode); pstmt.setString(1, stanCode);
...@@ -499,13 +527,18 @@ implements CustomerLocal, CustomerRemote ...@@ -499,13 +527,18 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else //}
/* Comment By Nasruddin [16-SEP-16] START
else
{ {
errCode = "VMSTNCDNLL"; errCode = "VMSTNCDNLL";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("terr_code")) Comment By Nasruddin [16-SEP-16] END*/
}
else if (childNodeName.equalsIgnoreCase("terr_code"))
{ {
terrCode = this.genericUtility.getColumnValue("terr_code", dom); terrCode = this.genericUtility.getColumnValue("terr_code", dom);
...@@ -532,7 +565,8 @@ implements CustomerLocal, CustomerRemote ...@@ -532,7 +565,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("state_code")) }
else if (childNodeName.equalsIgnoreCase("state_code"))
{ {
stateCode = this.genericUtility.getColumnValue("state_code", dom); stateCode = this.genericUtility.getColumnValue("state_code", dom);
...@@ -559,7 +593,8 @@ implements CustomerLocal, CustomerRemote ...@@ -559,7 +593,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("count_code")) }
else if (childNodeName.equalsIgnoreCase("count_code"))
{ {
countCode = this.genericUtility.getColumnValue("count_code", dom); countCode = this.genericUtility.getColumnValue("count_code", dom);
...@@ -586,7 +621,8 @@ implements CustomerLocal, CustomerRemote ...@@ -586,7 +621,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("cr_term")) }
else if (childNodeName.equalsIgnoreCase("cr_term"))
{ {
crTerm = this.genericUtility.getColumnValue("cr_term", dom); crTerm = this.genericUtility.getColumnValue("cr_term", dom);
...@@ -613,7 +649,8 @@ implements CustomerLocal, CustomerRemote ...@@ -613,7 +649,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("curr_code")) }
else if (childNodeName.equalsIgnoreCase("curr_code"))
{ {
currCode = this.genericUtility.getColumnValue("curr_code", dom); currCode = this.genericUtility.getColumnValue("curr_code", dom);
cnt = 0; cnt = 0;
...@@ -636,7 +673,8 @@ implements CustomerLocal, CustomerRemote ...@@ -636,7 +673,8 @@ implements CustomerLocal, CustomerRemote
errCode = "VTCURRCD1"; errCode = "VTCURRCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} else }
else
{ {
if (editFlag.equalsIgnoreCase("E")) if (editFlag.equalsIgnoreCase("E"))
{ {
...@@ -699,7 +737,8 @@ implements CustomerLocal, CustomerRemote ...@@ -699,7 +737,8 @@ implements CustomerLocal, CustomerRemote
} }
} }
} }
} else if (childNodeName.equalsIgnoreCase("acct_code__ar")) }
else if (childNodeName.equalsIgnoreCase("acct_code__ar"))
{ {
acctCodeAr = this.genericUtility.getColumnValue("acct_code__ar", dom); acctCodeAr = this.genericUtility.getColumnValue("acct_code__ar", dom);
...@@ -746,13 +785,18 @@ implements CustomerLocal, CustomerRemote ...@@ -746,13 +785,18 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else }
/* Comment By Nasruddin [16-SEP-16] START
else
{ {
errCode = "VMACCTNLL";// A/C Rec is null errCode = "VMACCTNLL";// A/C Rec is null
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("cctr_code__ar")) Comment By Nasruddin [16-SEP-16] END*/
}
else if (childNodeName.equalsIgnoreCase("cctr_code__ar"))
{ {
cctrCodeAr = this.genericUtility.getColumnValue("cctr_code__ar", dom); cctrCodeAr = this.genericUtility.getColumnValue("cctr_code__ar", dom);
...@@ -778,18 +822,22 @@ implements CustomerLocal, CustomerRemote ...@@ -778,18 +822,22 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else }
else
{ {
acctCodeAr = this.genericUtility.getColumnValue("acct_code__ar", dom); acctCodeAr = this.genericUtility.getColumnValue("acct_code__ar", dom);
if (acctCodeAr != null && acctCodeAr.trim().length() > 0) if (acctCodeAr != null && acctCodeAr.trim().length() > 0)
{ {
valueXmlString.append("<cctr_code__ar ><![CDATA[" + blankVar + "]]></cctr_code__ar>"); valueXmlString.append("<cctr_code__ar ><![CDATA[" + blankVar + "]]></cctr_code__ar>");
} }
/*Comment By Nasruddin [16-SEP-16] START
errCode = "VTCCTRNLL";// Cost Center null errCode = "VTCCTRNLL";// Cost Center null
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
Comment By Nasruddin [16-SEP-16] END*/
} }
} else if (childNodeName.equalsIgnoreCase("tax_class")) }
else if (childNodeName.equalsIgnoreCase("tax_class"))
{ {
taxClass = this.genericUtility.getColumnValue("tax_class", dom); taxClass = this.genericUtility.getColumnValue("tax_class", dom);
...@@ -816,7 +864,8 @@ implements CustomerLocal, CustomerRemote ...@@ -816,7 +864,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("tax_chap")) }
else if (childNodeName.equalsIgnoreCase("tax_chap"))
{ {
taxChap = this.genericUtility.getColumnValue("tax_chap", dom); taxChap = this.genericUtility.getColumnValue("tax_chap", dom);
...@@ -843,7 +892,8 @@ implements CustomerLocal, CustomerRemote ...@@ -843,7 +892,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("price_list")) }
else if (childNodeName.equalsIgnoreCase("price_list"))
{ {
priceList = this.genericUtility.getColumnValue("price_list", dom); priceList = this.genericUtility.getColumnValue("price_list", dom);
...@@ -870,7 +920,8 @@ implements CustomerLocal, CustomerRemote ...@@ -870,7 +920,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("price_list__clg")) }
else if (childNodeName.equalsIgnoreCase("price_list__clg"))
{ {
priceListClg = this.genericUtility.getColumnValue("price_list__clg", dom); priceListClg = this.genericUtility.getColumnValue("price_list__clg", dom);
...@@ -897,7 +948,8 @@ implements CustomerLocal, CustomerRemote ...@@ -897,7 +948,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("sales_pers")) }
else if (childNodeName.equalsIgnoreCase("sales_pers"))
{ {
salesPers = this.genericUtility.getColumnValue("sales_pers", dom); salesPers = this.genericUtility.getColumnValue("sales_pers", dom);
...@@ -923,13 +975,17 @@ implements CustomerLocal, CustomerRemote ...@@ -923,13 +975,17 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else }
/* Comment By Nasruddin [16-SEP-16] START
else
{ {
errCode = "VMSLPERNLL"; errCode = "VMSLPERNLL";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("sales_pers__1")) Comment By Nasruddin [16-SEP-16] END*/
}
else if (childNodeName.equalsIgnoreCase("sales_pers__1"))
{ {
salesPers1 = this.genericUtility.getColumnValue("sales_pers__1", dom); salesPers1 = this.genericUtility.getColumnValue("sales_pers__1", dom);
if (salesPers1 != null && salesPers1.trim().length() > 0) if (salesPers1 != null && salesPers1.trim().length() > 0)
...@@ -955,7 +1011,8 @@ implements CustomerLocal, CustomerRemote ...@@ -955,7 +1011,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("sales_pers__2")) }
else if (childNodeName.equalsIgnoreCase("sales_pers__2"))
{ {
salesPers2 = this.genericUtility.getColumnValue("sales_pers__2", dom); salesPers2 = this.genericUtility.getColumnValue("sales_pers__2", dom);
if (salesPers2 != null && salesPers2.trim().length() > 0) if (salesPers2 != null && salesPers2.trim().length() > 0)
...@@ -981,7 +1038,8 @@ implements CustomerLocal, CustomerRemote ...@@ -981,7 +1038,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("tran_code")) }
else if (childNodeName.equalsIgnoreCase("tran_code"))
{ {
tranCode = this.genericUtility.getColumnValue("tran_code", dom); tranCode = this.genericUtility.getColumnValue("tran_code", dom);
...@@ -1008,7 +1066,8 @@ implements CustomerLocal, CustomerRemote ...@@ -1008,7 +1066,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("site_code__rcp")) }
else if (childNodeName.equalsIgnoreCase("site_code__rcp"))
{ {
siteCodeRcp = this.genericUtility.getColumnValue("site_code__rcp", dom); siteCodeRcp = this.genericUtility.getColumnValue("site_code__rcp", dom);
...@@ -1035,19 +1094,23 @@ implements CustomerLocal, CustomerRemote ...@@ -1035,19 +1094,23 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("site_code")) }
else if (childNodeName.equalsIgnoreCase("site_code"))
{ {
siteCode = this.genericUtility.getColumnValue("site_code", dom); siteCode = this.genericUtility.getColumnValue("site_code", dom);
channelPartner = this.genericUtility.getColumnValue("channel_partner", dom); channelPartner = this.genericUtility.getColumnValue("channel_partner", dom);
if ("Y".equalsIgnoreCase(channelPartner) && (siteCode == null && siteCode.trim().length() <= 0)) if ("Y".equalsIgnoreCase(channelPartner) && (siteCode == null || siteCode.trim().length() <= 0))
//if ("Y".equalsIgnoreCase(channelPartner) && (siteCode == null && siteCode.trim().length() <= 0)) Comment By Nasruddin [16-SEP-16]
{ {
errCode = "VMSITECD1"; errCode = "VMSITECD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} else }
else
{ {
if ("N".equalsIgnoreCase(channelPartner) && (siteCode != null)) //if ("N".equalsIgnoreCase(channelPartner) && (siteCode != null)) Comment By Nasruddin
if ("N".equalsIgnoreCase(channelPartner) && (siteCode.trim().length() > 0))
{ {
errCode = "VNRSITE"; errCode = "VNRSITE";
errList.add(errCode); errList.add(errCode);
...@@ -1077,7 +1140,8 @@ implements CustomerLocal, CustomerRemote ...@@ -1077,7 +1140,8 @@ implements CustomerLocal, CustomerRemote
} }
} }
} }
} else if (childNodeName.equalsIgnoreCase("black_listing")) }
else if (childNodeName.equalsIgnoreCase("black_listing"))
{ {
blackListing = this.genericUtility.getColumnValue("black_listing", dom); blackListing = this.genericUtility.getColumnValue("black_listing", dom);
...@@ -1087,7 +1151,8 @@ implements CustomerLocal, CustomerRemote ...@@ -1087,7 +1151,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("contact_code")) }
else if (childNodeName.equalsIgnoreCase("contact_code"))
{ {
contactCode = this.genericUtility.getColumnValue("contact_code", dom); contactCode = this.genericUtility.getColumnValue("contact_code", dom);
...@@ -1111,11 +1176,13 @@ implements CustomerLocal, CustomerRemote ...@@ -1111,11 +1176,13 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("bank_code")) }
else if (childNodeName.equalsIgnoreCase("bank_code"))
{ {
bankCode = this.genericUtility.getColumnValue("bank_code", dom); bankCode = this.genericUtility.getColumnValue("bank_code", dom);
if (bankCode != null) // if (bankCode != null) Comment By Nasruddin [16-SEP-16]
if (bankCode != null && bankCode.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from bank where bank_code =?"; sql = "select count(*) as cnt from bank where bank_code =?";
...@@ -1138,7 +1205,8 @@ implements CustomerLocal, CustomerRemote ...@@ -1138,7 +1205,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("price_list__disc")) }
else if (childNodeName.equalsIgnoreCase("price_list__disc"))
{ {
priceListDisc = this.genericUtility.getColumnValue("price_list__disc", dom); priceListDisc = this.genericUtility.getColumnValue("price_list__disc", dom);
...@@ -1168,7 +1236,8 @@ implements CustomerLocal, CustomerRemote ...@@ -1168,7 +1236,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("sales_option")) }
else if (childNodeName.equalsIgnoreCase("sales_option"))
{ {
salesOption = this.genericUtility.getColumnValue("sales_option", dom); salesOption = this.genericUtility.getColumnValue("sales_option", dom);
...@@ -1178,11 +1247,12 @@ implements CustomerLocal, CustomerRemote ...@@ -1178,11 +1247,12 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("dlv_term")) }
else if (childNodeName.equalsIgnoreCase("dlv_term"))
{ {
dlvTerm = checkNull(this.genericUtility.getColumnValue("dlv_term", dom)); dlvTerm = checkNull(this.genericUtility.getColumnValue("dlv_term", dom));
System.out.println("@@@@@@@@@@@@@@@@@ added check null fro dlvterm@@@@@@@@@"+dlvTerm); System.out.println("@@@@@@@@@@@@@@@@@ added check null fro dlvterm@@@@@@@@@"+dlvTerm);
if (dlvTerm != null || dlvTerm.trim().length() > 0) if (dlvTerm != null && dlvTerm.trim().length() > 0)
{ {
cnt = 0; cnt = 0;
sql = "select count(*) as cnt from delivery_term where dlv_term =?"; sql = "select count(*) as cnt from delivery_term where dlv_term =?";
...@@ -1205,7 +1275,8 @@ implements CustomerLocal, CustomerRemote ...@@ -1205,7 +1275,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("loss_perc")) }
else if (childNodeName.equalsIgnoreCase("loss_perc"))
{ {
lossPerc = this.genericUtility.getColumnValue("loss_perc", dom); lossPerc = this.genericUtility.getColumnValue("loss_perc", dom);
...@@ -1219,7 +1290,8 @@ implements CustomerLocal, CustomerRemote ...@@ -1219,7 +1290,8 @@ implements CustomerLocal, CustomerRemote
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else if (childNodeName.equalsIgnoreCase("adhoc_repl_perc")) }
else if (childNodeName.equalsIgnoreCase("adhoc_repl_perc"))
{ {
adhocReplPerc = this.genericUtility.getColumnValue("adhoc_repl_perc", dom); adhocReplPerc = this.genericUtility.getColumnValue("adhoc_repl_perc", dom);
double adhocvalue = 0.00; double adhocvalue = 0.00;
...@@ -1237,11 +1309,13 @@ implements CustomerLocal, CustomerRemote ...@@ -1237,11 +1309,13 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("term_table__no")) }
else if (childNodeName.equalsIgnoreCase("term_table__no"))
{ {
termTableNo = this.genericUtility.getColumnValue("term_table__no", dom); termTableNo = this.genericUtility.getColumnValue("term_table__no", dom);
if (termTableNo != null) //if( termTableNo != null) Changed By Nasruddin [16-sep-16]
if (termTableNo != null && termTableNo.trim().length() > 0)
{ {
sql = "select count(1) as cnt from sale_term_table where term_table = ?"; sql = "select count(1) as cnt from sale_term_table where term_table = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1263,7 +1337,8 @@ implements CustomerLocal, CustomerRemote ...@@ -1263,7 +1337,8 @@ implements CustomerLocal, CustomerRemote
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else if (childNodeName.equalsIgnoreCase("emp_code__ord")) }
else if (childNodeName.equalsIgnoreCase("emp_code__ord"))
{ {
empCodeOrd = checkNull(this.genericUtility.getColumnValue("emp_code__ord", dom)); empCodeOrd = checkNull(this.genericUtility.getColumnValue("emp_code__ord", dom));
...@@ -1348,6 +1423,41 @@ implements CustomerLocal, CustomerRemote ...@@ -1348,6 +1423,41 @@ implements CustomerLocal, CustomerRemote
} }
}//Changed By Nasruddin khan [19/JUL/16] END }//Changed By Nasruddin khan [19/JUL/16] END
//Changed By Nasruddin khan [16/SEP/16] START
else if( childNodeName.equalsIgnoreCase("disc_list"))
{
discList = checkNull(this.genericUtility.getColumnValue("disc_list", dom));
if( discList != null && discList.trim().length() > 0){
cnt = 0;
sql = "select count(1) as cnt from disc_list where disc_list = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, discList);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt == 0)
{
errCode = "VTDISCLT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
//Changed By Nasruddin khan [16/SEP/16] END
// else if(childNodeName.equalsIgnoreCase("cust_code__pd")){ // else if(childNodeName.equalsIgnoreCase("cust_code__pd")){
// custCodePd = // custCodePd =
// checkNull(this.genericUtility.getColumnValue( // checkNull(this.genericUtility.getColumnValue(
......
...@@ -138,7 +138,35 @@ public class CustomerItem extends ValidatorEJB implements CustomerItemLocal,Cust ...@@ -138,7 +138,35 @@ public class CustomerItem extends ValidatorEJB implements CustomerItemLocal,Cust
errCode = "VTITEM1"; errCode = "VTITEM1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
// Changed By Nasruddin [9/SEP/16] Start
else
{
if("A".equals(editFlag) && errCode == null || errCode.trim().length() == 0)
{
custCode = genericUtility.getColumnValue("cust_code", dom);
sql = "select count(1) from customeritem where cust_code = ? and item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCode);
pstmt.setString(2, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "VTDUPENTRY";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
// Changed By Nasruddin [9/SEP/16] End
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
......
...@@ -73,6 +73,7 @@ public class CustomerSerCredit extends ValidatorEJB implements CustomerSerCredit ...@@ -73,6 +73,7 @@ public class CustomerSerCredit extends ValidatorEJB implements CustomerSerCredit
String errorType = ""; String errorType = "";
String childNodeName = null; String childNodeName = null;
String errString = ""; String errString = "";
String diskList = "";// Change By Nasruddin [9/SEP/16]
int ctr=0; int ctr=0;
int childNodeListLength; int childNodeListLength;
...@@ -288,7 +289,8 @@ public class CustomerSerCredit extends ValidatorEJB implements CustomerSerCredit ...@@ -288,7 +289,8 @@ public class CustomerSerCredit extends ValidatorEJB implements CustomerSerCredit
if(childNodeName.equalsIgnoreCase("dlv_term")) if(childNodeName.equalsIgnoreCase("dlv_term"))
{ {
dlvTerm = genericUtility.getColumnValue("dlv_term", dom); dlvTerm = genericUtility.getColumnValue("dlv_term", dom);
if(dlvTerm != null && salesPers2.trim().length() > 0) //if(dlvTerm != null && salesPers2.trim().length() > 0)
if(dlvTerm != null && dlvTerm.trim().length() > 0) // Changed By Nasruddin [9/SEP/16]
{ {
sql = "select count(*) from delivery_term where dlv_term = ?"; sql = "select count(*) from delivery_term where dlv_term = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -310,6 +312,33 @@ public class CustomerSerCredit extends ValidatorEJB implements CustomerSerCredit ...@@ -310,6 +312,33 @@ public class CustomerSerCredit extends ValidatorEJB implements CustomerSerCredit
pstmt = null; pstmt = null;
} }
} }
// Changed By Nasruddin Khan [09/SEP/16] Start
if(childNodeName.equalsIgnoreCase("disc_list"))
{
diskList = genericUtility.getColumnValue("disc_list", dom);
if(diskList != null && diskList.trim().length() > 0)
{
sql = "SELECT COUNT(1) FROM DISC_LIST WHERE DISC_LIST = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,diskList);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "VTDISCLT1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
// Changed By Nasruddin Khan [09/SEP/16] END
}//end of for }//end of for
int errListSize = errList.size(); int errListSize = errList.size();
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
package ibase.webitm.ejb.dis; package ibase.webitm.ejb.dis;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -89,6 +88,14 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -89,6 +88,14 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
String errorType = ""; String errorType = "";
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
// Changed By Nasruddin [16-SEP-16] START
String dlvTerm = "";
String keyFlag = "";
String modName = "w_dlv_term";
String itemCode = "";
Timestamp effDate = null, validUpTo = null;
String effDateStr = "", validUptoStr = "";
// Changed By Nasruddin [16-SEP-16] END
try try
{ {
System.out.println( "wfValData called" ); System.out.println( "wfValData called" );
...@@ -115,8 +122,60 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -115,8 +122,60 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
//Changed By Nasruddin [16-SEP-16] STart
if ( childNodeName.equalsIgnoreCase( "dlv_term" ) )
{
dlvTerm = genericUtility.getColumnValue("dlv_term", dom);
dlvTerm = dlvTerm == null ? "" : dlvTerm.trim();
System.out.println(":::: dlv Term [" + dlvTerm + "]");
sql = " select key_flag from TRANSETUP where TRAN_WINDOW = ? " ;
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, modName);
rs = pStmt.executeQuery();
if(rs.next())
{
keyFlag = rs.getString("key_flag");
}
pStmt.close();
pStmt = null;
rs.close();
rs = null;
if ( childNodeName.equalsIgnoreCase( "item_no" ) ) keyFlag = keyFlag == null ? "M" : keyFlag.trim();
if(keyFlag.equalsIgnoreCase("M") && dlvTerm.isEmpty() )
{
errCode = "VMCODNULL";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
else if("A".equalsIgnoreCase( editFlag ) )
{
int count = 0;
sql = "SELECT COUNT(1) as count FROM DELIVERY_TERM WHERE DLV_TERM = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, dlvTerm );
rs = pStmt.executeQuery();
if(rs.next())
{
count = rs.getInt("count");
}
pStmt.close();
pStmt = null;
rs.close();
rs = null;
if(count > 0)
{
errCode = "VMDUPL1";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}//Changed By Nasruddin [16-SEP-16] END
/* Comment By Nasruddin khan [ 16-SEP-16 ] START
else if ( childNodeName.equalsIgnoreCase( "item_no" ) )
{ {
if ( childNode.getFirstChild() == null ) if ( childNode.getFirstChild() == null )
{ {
...@@ -147,9 +206,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -147,9 +206,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
pStmt = null; pStmt = null;
} }
} }
Comment By Nasruddin khan [ 16-SEP-16 ] END */
else if ( childNodeName.equalsIgnoreCase( "item_parnt" ) ) else if ( childNodeName.equalsIgnoreCase( "item_parnt" ) )
{ {
/* Comment By Nasruddin khan [ 16-SEP-16 ] START
if ( childNode.getFirstChild() == null ) if ( childNode.getFirstChild() == null )
{ {
...@@ -157,10 +218,15 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -157,10 +218,15 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
else Comment By Nasruddin khan [ 16-SEP-16 ] END */
// Changed By Nasruddin [16-SEP-16] START
itemParnt = genericUtility.getColumnValue( "item_parnt", dom);
itemCode = genericUtility.getColumnValue( "item_code", dom);
if( itemParnt != null && itemParnt.trim().length() > 0 && (!(itemParnt).equalsIgnoreCase(itemCode)))
{ {
itemParnt = genericUtility.getColumnValue( "item_parnt", dom); sql = "SELECT COUNT(1) FROM ITEM WHERE ITEM_CODE = ";
sql = " SELECT COUNT(*) FROM item WHERE item_parnt = ? ";
pStmt = conn.prepareStatement( sql ); pStmt = conn.prepareStatement( sql );
pStmt.setString(1,itemParnt); pStmt.setString(1,itemParnt);
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
...@@ -178,25 +244,16 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -178,25 +244,16 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
rs.close(); rs.close();
rs = null; rs = null;
pStmt.close(); pStmt.close();
pStmt = null; pStmt = null;
} }
}
else if ( childNodeName.equalsIgnoreCase( "item_ser" ) )
{
if ( childNode.getFirstChild() == null )
{
errCode = "VMACTCDNUL"; /* Comment By Nasruddin khan [ 16-SEP-16 ] START
errList.add( errCode ); //else
errFields.add( childNodeName.toLowerCase() ); //{
} itemParnt = genericUtility.getColumnValue( "item_parnt", dom);
else sql = " SELECT COUNT(*) FROM item WHERE item_parnt = ? ";
{
itemSer = genericUtility.getColumnValue( "item_ser", dom, "1" );
sql = " select count(*) from itemser where item_ser = ? ";
pStmt = conn.prepareStatement( sql ); pStmt = conn.prepareStatement( sql );
pStmt.setString(1,itemSer); pStmt.setString(1,itemParnt);
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
if( rs.next() ) if( rs.next() )
{ {
...@@ -204,7 +261,8 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -204,7 +261,8 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
} }
if( cnt == 0 ) if( cnt == 0 )
{ {
errCode = "VTITSER1";
errCode = "VTITEMP1";
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
...@@ -212,11 +270,49 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -212,11 +270,49 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
rs = null; rs = null;
pStmt.close(); pStmt.close();
pStmt = null; pStmt = null;
Comment By Nasruddin khan [ 16-SEP-16 ] END */
//}
}
else if ( childNodeName.equalsIgnoreCase( "item_ser" ) )
{
/* Comment By Nasruddin khan [ 16-SEP-16 ] START
if ( childNode.getFirstChild() == null )
{
errCode = "VMACTCDNUL";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
Comment By Nasruddin khan [ 16-SEP-16 ] end */
//else
//{
itemSer = genericUtility.getColumnValue( "item_ser", dom, "1" );
sql = " select count(*) from itemser where item_ser = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString(1,itemSer);
rs = pStmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
if( cnt == 0 )
{
errCode = "VTITSER1";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
} }
rs.close();
rs = null;
pStmt.close();
pStmt = null;
//}
} }
else if ( childNodeName.equalsIgnoreCase( "unit" ) ) else if ( childNodeName.equalsIgnoreCase( "unit" ) )
{ {
/* Comment By Nasruddin khan [ 16-SEP-16 ] START
if ( childNode.getFirstChild() == null ) if ( childNode.getFirstChild() == null )
{ {
...@@ -225,9 +321,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -225,9 +321,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
else else
{ { Comment By Nasruddin khan [ 16-SEP-16 ] end */
unit = genericUtility.getColumnValue( "unit", dom); unit = genericUtility.getColumnValue( "unit", dom);
sql = " select count(*) from site where site_code = ? "; // Change By Nasruddin [16-sep-16]
// sql = " select count(*) from site where site_code = ? ";
sql = "SELECT COUNT(1) FROM UOM WHERE UNIT = ?";
pStmt = conn.prepareStatement( sql ); pStmt = conn.prepareStatement( sql );
pStmt.setString(1,unit); pStmt.setString(1,unit);
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
...@@ -245,11 +343,12 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -245,11 +343,12 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
rs = null; rs = null;
pStmt.close(); pStmt.close();
pStmt = null; pStmt = null;
} //}
} }
else if ( childNodeName.equalsIgnoreCase( "site_code" ) ) else if ( childNodeName.equalsIgnoreCase( "site_code" ) )
{ {
/* Comment By Nasruddin khan [ 16-SEP-16 ] START
if ( childNode.getFirstChild() == null ) if ( childNode.getFirstChild() == null )
{ {
...@@ -257,32 +356,40 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -257,32 +356,40 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
Comment By Nasruddin khan [ 16-SEP-16 ] END
else else
{ {*/
siteCode = genericUtility.getColumnValue( "site_code", dom);
sql = " select count(*) from site where site_code = ? "; siteCode = genericUtility.getColumnValue( "site_code", dom);
pStmt = conn.prepareStatement( sql ); // Changed By Nasruddin [16-sep-19] START
pStmt.setString(1,siteCode); if( siteCode.trim().length() > 0)
rs = pStmt.executeQuery();
if( rs.next() )
{ {
cnt = rs.getInt( 1 ); sql = " select count(*) from site where site_code = ? ";
} pStmt = conn.prepareStatement( sql );
if( cnt == 0 ) pStmt.setString(1,siteCode);
{ rs = pStmt.executeQuery();
errCode = "VTSITE1"; if( rs.next() )
errList.add( errCode ); {
errFields.add( childNodeName.toLowerCase() ); cnt = rs.getInt( 1 );
}
if( cnt == 0 )
{
errCode = "VTSITE1";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
} }
rs.close();
rs = null; //}
pStmt.close();
pStmt = null;
}
} }
else if ( childNodeName.equalsIgnoreCase( "loc_code" ) ) else if ( childNodeName.equalsIgnoreCase( "loc_code" ) )
{ {
/* Comment By Nasruddin [16-sep-19] START
if ( childNode.getFirstChild() == null ) if ( childNode.getFirstChild() == null )
{ {
errCode = "VMACTCDNUL"; errCode = "VMACTCDNUL";
...@@ -290,8 +397,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -290,8 +397,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
else else
{ Comment By Nasruddin [16-sep-19] END */
locCode = genericUtility.getColumnValue( "loc_code", dom);
// Changed By Nasruddin [16-sep-19]
if( locCode.trim().length() > 0)
{ {
locCode = genericUtility.getColumnValue( "loc_code", dom);
sql = " select count(*) from location where loc_code = ? "; sql = " select count(*) from location where loc_code = ? ";
pStmt = conn.prepareStatement( sql ); pStmt = conn.prepareStatement( sql );
pStmt.setString(1,locCode); pStmt.setString(1,locCode);
...@@ -312,11 +422,10 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -312,11 +422,10 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
pStmt = null; pStmt = null;
} }
} }
else if ( childNodeName.equalsIgnoreCase( "apr_code" ) ) else if ( childNodeName.equalsIgnoreCase( "apr_code" ) )
{ {
if ( childNode.getFirstChild() == null ) /* Comment By Nasruddin [16-sep-19] START
if ( childNode.getFirstChieffDateStrld() == null )
{ {
errCode = "VMACTCDNUL"; errCode = "VMACTCDNUL";
...@@ -324,8 +433,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -324,8 +433,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
else else
{ Comment By Nasruddin [16-sep-19] END */
aprCode = genericUtility.getColumnValue( "apr_code", dom);
// Changed By Nasruddin [16-sep-19]
if( aprCode.trim().length() > 0)
{ {
aprCode = genericUtility.getColumnValue( "apr_code", dom);
sql = " select count(*) from aprlev where apr_code = ? "; sql = " select count(*) from aprlev where apr_code = ? ";
pStmt = conn.prepareStatement( sql ); pStmt = conn.prepareStatement( sql );
pStmt.setString(1,aprCode.trim()); pStmt.setString(1,aprCode.trim());
...@@ -346,9 +458,9 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -346,9 +458,9 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
pStmt = null; pStmt = null;
} }
} }
else if ( childNodeName.equalsIgnoreCase( "tax_chap" ) ) else if ( childNodeName.equalsIgnoreCase( "tax_chap" ) )
{ {
/* Comment By Nasruddin [16-sep-19] START
if ( childNode.getFirstChild() == null ) if ( childNode.getFirstChild() == null )
{ {
errCode = "VMACTCDNUL"; errCode = "VMACTCDNUL";
...@@ -356,8 +468,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -356,8 +468,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
else else
{ Comment By Nasruddin [16-sep-19] END */
taxChap = genericUtility.getColumnValue( "tax_chap", dom);
//Changed By Nasruddin [16-SEP-16]
if( taxChap.trim().length() > 0)
{ {
taxChap = genericUtility.getColumnValue( "tax_chap", dom);
sql = " select count(*) from taxchap where tax_chap = ? "; sql = " select count(*) from taxchap where tax_chap = ? ";
pStmt = conn.prepareStatement( sql ); pStmt = conn.prepareStatement( sql );
pStmt.setString(1,taxChap.trim()); pStmt.setString(1,taxChap.trim());
...@@ -381,6 +496,7 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -381,6 +496,7 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
else if ( childNodeName.equalsIgnoreCase( "policy_no" ) ) else if ( childNodeName.equalsIgnoreCase( "policy_no" ) )
{ {
/* Comment By Nasruddin [16-sep-19] START
if ( childNode.getFirstChild() == null ) if ( childNode.getFirstChild() == null )
{ {
errCode = "VMACTCDNUL"; errCode = "VMACTCDNUL";
...@@ -389,7 +505,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -389,7 +505,11 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
} }
else else
{ {
policyNo = genericUtility.getColumnValue( "policy_no", dom); Comment By Nasruddin [16-sep-19] END */
policyNo = genericUtility.getColumnValue( "policy_no", dom);
// Changed By Nasruddin [16-SEP-16]
if( policyNo != null && policyNo.trim().length() > 0)
{
sql = " select count(*) from insurance where policy_no = ? "; sql = " select count(*) from insurance where policy_no = ? ";
pStmt = conn.prepareStatement( sql ); pStmt = conn.prepareStatement( sql );
pStmt.setString(1,policyNo.trim()); pStmt.setString(1,policyNo.trim());
...@@ -438,7 +558,9 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -438,7 +558,9 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
{ {
mval = genericUtility.getColumnValue( "dlv_term", dom1 ); mval = genericUtility.getColumnValue( "dlv_term", dom1 );
mval1 = genericUtility.getColumnValue( "line_no", dom1 ); mval1 = genericUtility.getColumnValue( "line_no", dom1 );
mmin_day = genericUtility.getColumnValue( "fldname", dom1 ); //Changed By Nasruddin [16-SEP-16]
//mmin_day = genericUtility.getColumnValue( "fldname", dom1 );
mmin_day = genericUtility.getColumnValue( "min_day", dom1 );
minDays=Integer.parseInt(minDay); minDays=Integer.parseInt(minDay);
mmax_day = genericUtility.getColumnValue( "max_day", dom1 ); mmax_day = genericUtility.getColumnValue( "max_day", dom1 );
maxDays=Integer.parseInt(maxDay); maxDays=Integer.parseInt(maxDay);
...@@ -454,10 +576,25 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -454,10 +576,25 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
} }
else else
{ {
sql="select count(*) from crtermfc where dlv_Term = dlvTerm and mmin_day between min_day and max_day and (mdate1 between eff_date and valid_upto or mdate2 between eff_date and valid_upto) and line_no <> mval1"; /* Changed By Nasruddin [16-sep-16] Start
minDay=genericUtility.getColumnValue( "min_day", dom); minDay=genericUtility.getColumnValue( "min_day", dom);
sql="select count(*) from crtermfc where dlv_Term = dlvTerm and mmin_day between min_day and max_day and (mdate1 between eff_date and valid_upto or mdate2 between eff_date and valid_upto) and line_no <> mval1";
pStmt = conn.prepareStatement( sql );
pStmt.setString(1, minDay); Changed By Nasruddin [16-sep-16] Start END*/
effDate = Timestamp.valueOf(genericUtility.getValidDateString(mdate1, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
validUpTo = Timestamp.valueOf(genericUtility.getValidDateString(mdate2, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
sql = " SELECT COUNT(1) FROM DLTERMFC " +
" WHERE DLV_TERM = ? " +
" AND ? BETWEEN MIN_DAY AND MAX_DAY " +
" AND (? BETWEEN EFF_DATE AND VALID_UPTO OR ? BETWEEN EFF_DATE AND VALID_UPTO)" +
" AND LINE_NO <> ?";
pStmt = conn.prepareStatement( sql ); pStmt = conn.prepareStatement( sql );
pStmt.setString(1,minDay); pStmt.setString(1, mval);
pStmt.setInt(2, minDays);
pStmt.setTimestamp(3, effDate);
pStmt.setTimestamp(4, validUpTo);
pStmt.setString(5, mval1);
// Changed By Nasruddin [16-sep-16] END
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
if( rs.next() ) if( rs.next() )
{ {
...@@ -471,13 +608,27 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -471,13 +608,27 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
} }
else else
{ {
/* Changed By Nasruddin [16-sep-16] Start
sql="select count(*) into cnt from dltermfc where dlv_term = mval and " + sql="select count(*) into cnt from dltermfc where dlv_term = mval and " +
"mmin_day between min_day and max_day and (eff_date between mdate1 and mdate2 " + "mmin_day between min_day and max_day and (eff_date between mdate1 and mdate2 " +
"or valid_upto between mdate1 and mdate2) and line_no <> :mval1 "; "or valid_upto between mdate1 and mdate2) and line_no <> :mval1 ";
pStmt = conn.prepareStatement( sql ); pStmt = conn.prepareStatement( sql );
pStmt.setString(1,minDay); pStmt.setString(1,minDay); Changed By Nasruddin [16-sep-16] Start END*/
sql = " SELECT COUNT(1) FROM DLTERMFC " +
" WHERE DLV_TERM = ? " +
" AND ? BETWEEN MIN_DAY AND MAX_DAY " +
" AND (EFF_DATE BETWEEN ? AND ? OR VALID_UPTO BETWEEN ? AND ?) AND LINE_NO <> ?";
pStmt = conn.prepareStatement( sql );
pStmt.setString(1, mval);
pStmt.setInt(2, minDays);
pStmt.setTimestamp(3, effDate);
pStmt.setTimestamp(4, validUpTo);
pStmt.setTimestamp(5, effDate);
pStmt.setTimestamp(6, validUpTo);
pStmt.setString(7, mval1);
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
// Changed By Nasruddin [16-sep-16] END
if( rs.next() ) if( rs.next() )
{ {
cnt = rs.getInt( 1 ); cnt = rs.getInt( 1 );
...@@ -494,6 +645,7 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -494,6 +645,7 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
} }
else if ( childNodeName.equalsIgnoreCase( "eff_date" ) ) else if ( childNodeName.equalsIgnoreCase( "eff_date" ) )
{ {
/* Comment BY Nasruddin [16/SEP/16] START
if ( childNode.getFirstChild() == null ) if ( childNode.getFirstChild() == null )
{ {
...@@ -501,9 +653,21 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -501,9 +653,21 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
Comment BY Nasruddin [16/SEP/16] END */
//Changed BY Nasruddin [16/SEP/16] START
effDateStr = genericUtility.getColumnValue("eff_date",dom);
if(effDateStr==null || effDateStr.trim().length()==0)
{
errCode = "VEDAT2";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
//Changed BY Nasruddin [16/SEP/16] END
} }
else if ( childNodeName.equalsIgnoreCase( "valid_upto" ) ) else if ( childNodeName.equalsIgnoreCase( "valid_upto" ) )
{ {
/* Comment BY Nasruddin [16/SEP/16] START
if ( childNode.getFirstChild() == null ) if ( childNode.getFirstChild() == null )
{ {
...@@ -511,10 +675,22 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli ...@@ -511,10 +675,22 @@ public class DeliveryTerm extends ValidatorEJB implements DeliveryTermLocal,Deli
errList.add( errCode ); errList.add( errCode );
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
Comment BY Nasruddin [16/SEP/16] END */
//Changed BY Nasruddin [16/SEP/16] START
validUptoStr = genericUtility.getColumnValue("valid_upto",dom);
if(validUptoStr == null || validUptoStr.trim().length()==0)
{
errCode = "VEDAT2";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
//Changed BY Nasruddin [16/SEP/16] END
} }
else if ( childNodeName.equalsIgnoreCase( "min_cramt" ) ) else if ( childNodeName.equalsIgnoreCase( "min_cramt" ) )
{ {
mmin_cramt=genericUtility.getColumnValue( "fldname", dom); //Changed By Nasruddin [16-SEP-16]
//mmin_cramt=genericUtility.getColumnValue( "fldname", dom);
mmin_cramt=genericUtility.getColumnValue( "min_cramt", dom);
mminCramt =Integer.parseInt(mmin_cramt); mminCramt =Integer.parseInt(mmin_cramt);
mmax_cramt=genericUtility.getColumnValue( "max_cramt", dom); mmax_cramt=genericUtility.getColumnValue( "max_cramt", dom);
mmaxCramt=Integer.parseInt(mmax_cramt); mmaxCramt=Integer.parseInt(mmax_cramt);
......
...@@ -101,8 +101,8 @@ public class DeptRate extends ValidatorEJB implements DeptRateLocal,DeptRateRemo ...@@ -101,8 +101,8 @@ public class DeptRate extends ValidatorEJB implements DeptRateLocal,DeptRateRemo
if(childNodeName.equalsIgnoreCase("item_code__depb")) if(childNodeName.equalsIgnoreCase("item_code__depb"))
{ {
itemCode = genericUtility.getColumnValue("item_code__depb", dom); itemCode = genericUtility.getColumnValue("item_code__depb", dom);
if(itemCode != null && itemCode.trim().length() > 0) //if(itemCode != null && itemCode.trim().length() > 0) Comment by nasruddin [16-sep-16]
{ //{
sql = "select count(*) from item where item_code = ?"; sql = "select count(*) from item where item_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode); pstmt.setString(1,itemCode);
...@@ -121,7 +121,7 @@ public class DeptRate extends ValidatorEJB implements DeptRateLocal,DeptRateRemo ...@@ -121,7 +121,7 @@ public class DeptRate extends ValidatorEJB implements DeptRateLocal,DeptRateRemo
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} //}
} }
else if(childNodeName.equalsIgnoreCase("valid_upto")) else if(childNodeName.equalsIgnoreCase("valid_upto"))
......
...@@ -114,22 +114,26 @@ public class DisparmMaster extends ValidatorEJB implements DisparmMasterLocal, ...@@ -114,22 +114,26 @@ public class DisparmMaster extends ValidatorEJB implements DisparmMasterLocal,
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++) { for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if ("var_name".equalsIgnoreCase(childNodeName)) { if ("var_name".equalsIgnoreCase(childNodeName))
if ((childNode.getFirstChild() == null)) { {
if ((childNode.getFirstChild() == null))
{
errList.add("VPBLKVRNM"); errList.add("VPBLKVRNM");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
} else { }
else
{
prd_code = checkNull(genericUtility.getColumnValue( prd_code = checkNull(genericUtility.getColumnValue("prd_code", curDom));
"prd_code", curDom)); var_name = checkNull(genericUtility.getColumnValue("var_name", curDom));
var_name = checkNull(genericUtility.getColumnValue(
"var_name", curDom));
if (editFlag.equalsIgnoreCase("A")) { if (editFlag.equalsIgnoreCase("A"))
{
sql = "select count(*) as COUNT from disparm where prd_code=? and var_name=?"; sql = "select count(*) as COUNT from disparm where prd_code=? and var_name=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -137,11 +141,13 @@ public class DisparmMaster extends ValidatorEJB implements DisparmMasterLocal, ...@@ -137,11 +141,13 @@ public class DisparmMaster extends ValidatorEJB implements DisparmMasterLocal,
pstmt.setString(2, var_name.trim()); pstmt.setString(2, var_name.trim());
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next())
{
count = rs.getInt("COUNT"); count = rs.getInt("COUNT");
} }
if (count > 0) { if (count > 0)
{
errList.add("VPINVVRNM"); errList.add("VPINVVRNM");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
...@@ -150,15 +156,19 @@ public class DisparmMaster extends ValidatorEJB implements DisparmMasterLocal, ...@@ -150,15 +156,19 @@ public class DisparmMaster extends ValidatorEJB implements DisparmMasterLocal,
} }
} }
} }
if ("prd_code".equalsIgnoreCase(childNodeName)) { if ("prd_code".equalsIgnoreCase(childNodeName))
if ((childNode.getFirstChild() == null)) { {
if ((childNode.getFirstChild() == null))
{
errList.add("VPBLKPRCD"); errList.add("VPBLKPRCD");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
} }
} }
if ("var_type".equalsIgnoreCase(childNodeName)) { if ("var_type".equalsIgnoreCase(childNodeName))
if ((childNode.getFirstChild() == null)) { {
if ((childNode.getFirstChild() == null))
{
errList.add("VPBLKVRTP"); errList.add("VPBLKVRTP");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
......
...@@ -89,10 +89,12 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio ...@@ -89,10 +89,12 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength(); childNodeLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeLength; ctr++) { for (ctr = 0; ctr < childNodeLength; ctr++)
{
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("tran_type")){ if(childNodeName.equalsIgnoreCase("tran_type"))
{
tranType = genericUtility.getColumnValue("tran_type", dom); tranType = genericUtility.getColumnValue("tran_type", dom);
tranType = tranType == null ? "" : tranType.trim(); tranType = tranType == null ? "" : tranType.trim();
System.out.println(":::: tran type" + tranType); System.out.println(":::: tran type" + tranType);
...@@ -100,7 +102,8 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio ...@@ -100,7 +102,8 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, modName); pstmt.setString(1, modName);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next())
{
keyFlag = rs.getString("key_flag"); keyFlag = rs.getString("key_flag");
} }
pstmt.close(); pstmt.close();
...@@ -109,16 +112,21 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio ...@@ -109,16 +112,21 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio
rs = null; rs = null;
keyFlag = keyFlag == null ? "M" : keyFlag.trim(); keyFlag = keyFlag == null ? "M" : keyFlag.trim();
if(keyFlag.equalsIgnoreCase("M") && tranType.isEmpty()){
errString = itmdbAccessEJB.getErrorString("tran_type", "VTBLTRATYP", userId); if(keyFlag.equalsIgnoreCase("M") && tranType.isEmpty() )
{
errString = itmdbAccessEJB.getErrorString("tran_type", "VMCODNULL", userId);
return errString; return errString;
}else if(editFlag.equalsIgnoreCase("A")){ }
else if(editFlag.equalsIgnoreCase("A"))
{
int count = 0; int count = 0;
sql = "select count(*) as count from distorder_type where tran_type = ? "; sql = "select count(*) as count from distorder_type where tran_type = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranType); pstmt.setString(1, tranType);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next())
{
count = rs.getInt("count"); count = rs.getInt("count");
} }
...@@ -127,189 +135,234 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio ...@@ -127,189 +135,234 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio
rs.close(); rs.close();
rs = null; rs = null;
if(count > 0){ if(count > 0)
{
errString = itmdbAccessEJB.getErrorString("tran_type", "VMDUPL1", userId); errString = itmdbAccessEJB.getErrorString("tran_type", "VMDUPL1", userId);
return errString; return errString;
} }
} }
} }
if(childNodeName.equalsIgnoreCase("loc_code__git")){ if(childNodeName.equalsIgnoreCase("loc_code__git"))
if(childNode.getFirstChild() != null) {
//if(childNode.getFirstChild() != null)
locCodeGit = genericUtility.getColumnValue("loc_code__git", dom); locCodeGit = genericUtility.getColumnValue("loc_code__git", dom);
System.out.println("::: loc code git" + locCodeGit); System.out.println("::: loc code git" + locCodeGit);
int count = 0; int count = 0;
sql = "select count(*) as count from location where loc_code = ? "; // Changed By Nasruddin [16-SEP-16]
pstmt = conn.prepareStatement(sql); if(locCodeGit != null)
pstmt.setString(1, locCodeGit.trim()); {
rs = pstmt.executeQuery(); sql = "select count(*) as count from location where loc_code = ? ";
if(rs.next()){ pstmt = conn.prepareStatement(sql);
count = rs.getInt("count"); pstmt.setString(1, locCodeGit.trim());
} rs = pstmt.executeQuery();
if(rs.next())
pstmt.close(); {
pstmt = null; count = rs.getInt("count");
rs.close(); }
rs = null;
pstmt.close();
if(count == 0){ pstmt = null;
errString = itmdbAccessEJB.getErrorString("loc_code__git","VMLOC6", userId); rs.close();
return errString; rs = null;
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("loc_code__git","VMLOC6", userId);
return errString;
}
} }
} }
if(childNodeName.equalsIgnoreCase("loc_code__gitbf")){ if(childNodeName.equalsIgnoreCase("loc_code__gitbf"))
if(childNode.getFirstChild() != null) {
//if(childNode.getFirstChild() != null)
locCodeGitBf = genericUtility.getColumnValue("loc_code__gitbf", dom); locCodeGitBf = genericUtility.getColumnValue("loc_code__gitbf", dom);
System.out.println(":::: loc code gitbf" + locCodeGitBf); System.out.println(":::: loc code gitbf" + locCodeGitBf);
int count = 0; int count = 0;
sql = "select count(*) as count from location where loc_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locCodeGitBf.trim());
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt("count");
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
if(count == 0){ // Changed By Nasruddin [16-SEP-16]
errString = itmdbAccessEJB.getErrorString("loc_code__gitbf","VMLOC6", userId); if(locCodeGitBf != null)
return errString; {
sql = "select count(*) as count from location where loc_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locCodeGitBf.trim());
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt("count");
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("loc_code__gitbf","VMLOC6", userId);
return errString;
}
} }
} }
if(childNodeName.equalsIgnoreCase("loc_code__cons")){ if(childNodeName.equalsIgnoreCase("loc_code__cons"))
if(childNode.getFirstChild() != null) {
//if(childNode.getFirstChild() != null)
locCodeCons = genericUtility.getColumnValue("loc_code__cons", dom); locCodeCons = genericUtility.getColumnValue("loc_code__cons", dom);
System.out.println(":::: loc code cons" + locCodeCons); System.out.println(":::: loc code cons" + locCodeCons);
int count = 0; int count = 0;
sql = "select count(*) as count from location where loc_code = ? "; // Changed By Nasruddin [16-SEP-16]
pstmt = conn.prepareStatement(sql); if(locCodeCons != null)
pstmt.setString(1, locCodeCons.trim()); {
rs = pstmt.executeQuery(); sql = "select count(*) as count from location where loc_code = ? ";
if(rs.next()){ pstmt = conn.prepareStatement(sql);
count = rs.getInt("count"); pstmt.setString(1, locCodeCons.trim());
} rs = pstmt.executeQuery();
if(rs.next())
pstmt.close(); {
pstmt = null; count = rs.getInt("count");
rs.close(); }
rs = null;
pstmt.close();
if(count == 0){ pstmt = null;
errString = itmdbAccessEJB.getErrorString("loc_code__cons","VMLOC6", userId); rs.close();
return errString; rs = null;
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("loc_code__cons","VMLOC6", userId);
return errString;
}
} }
} }
if(childNodeName.equalsIgnoreCase("tran_type__parent")){ if(childNodeName.equalsIgnoreCase("tran_type__parent"))
{
tranTypeParent = genericUtility.getColumnValue("tran_type__parent", dom); tranTypeParent = genericUtility.getColumnValue("tran_type__parent", dom);
tranTypeParent = tranTypeParent == null ? "" : tranTypeParent.trim(); tranTypeParent = tranTypeParent == null ? "" : tranTypeParent.trim();
System.out.println(":::: tran type parent" + tranTypeParent); System.out.println(":::: tran type parent" + tranTypeParent);
if(tranTypeParent.isEmpty()){ if(tranTypeParent.isEmpty())
errString = itmdbAccessEJB.getErrorString("tran_type__parent", "VTBLTRATYP", userId); {
//errString = itmdbAccessEJB.getErrorString("tran_type__parent", "VTBLTRATYP", userId); Comment By Nasruddin [16-sep-16]
errString = itmdbAccessEJB.getErrorString("tran_type__parent", "VMIPTT", userId);
return errString; return errString;
}else{ }
else
{
int count = 0; int count = 0;
sql = "select count(*) as count from distorder_type where tran_type = ? "; sql = "select count(*) as count from distorder_type where tran_type = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranTypeParent); pstmt.setString(1, tranTypeParent);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next())
{
count = rs.getInt("count"); count = rs.getInt("count");
} }
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
rs = null; rs = null;
if(tranType != tranTypeParent){ if(tranType != tranTypeParent)
{
if(count == 0){ if(count == 0)
errString = itmdbAccessEJB.getErrorString("tran_type__parent", "VTINVTRTYD", userId); {
// errString = itmdbAccessEJB.getErrorString("tran_type__parent", "VTINVTRTYD", userId); Comment By Nasruddin [16-sep-16]
errString = itmdbAccessEJB.getErrorString("tran_type__parent", "VMPTTND", userId);
return errString; return errString;
} }
} }
} }
} }
if(childNodeName.equalsIgnoreCase("dlv_term")){ if(childNodeName.equalsIgnoreCase("dlv_term"))
if(childNode.getFirstChild() != null){ {
//if(childNode.getFirstChild() != null)
//{
int count = 0; int count = 0;
deliveryTerm = genericUtility.getColumnValue("dlv_term", dom); deliveryTerm = genericUtility.getColumnValue("dlv_term", dom);
System.out.println(":::: delivery term" + deliveryTerm); // Changed By Nasruddin [16-Sep-16]
if(deliveryTerm != null && deliveryTerm.trim().length() > 0)
sql = "select count(*) as count from DELIVERY_TERM where dlv_term = ? "; {
pstmt = conn.prepareStatement(sql); System.out.println(":::: delivery term" + deliveryTerm);
pstmt.setString(1, deliveryTerm.trim());
rs = pstmt.executeQuery(); sql = "select count(*) as count from DELIVERY_TERM where dlv_term = ? ";
if(rs.next()){ pstmt = conn.prepareStatement(sql);
count = rs.getInt("count"); pstmt.setString(1, deliveryTerm.trim());
} rs = pstmt.executeQuery();
if(rs.next()){
pstmt.close(); count = rs.getInt("count");
pstmt = null; }
rs.close();
rs = null; pstmt.close();
pstmt = null;
if(count == 0){ rs.close();
errString = itmdbAccessEJB.getErrorString("dlv_term", "VMDLVTERM1", userId); rs = null;
return errString;
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("dlv_term", "VMDLVTERM1", userId);
return errString;
}
} }
} //}
} }
if(childNodeName.equalsIgnoreCase("loc_group__cons")){ if(childNodeName.equalsIgnoreCase("loc_group__cons"))
{
locGroupCons = genericUtility.getColumnValue("loc_group__cons", dom); locGroupCons = genericUtility.getColumnValue("loc_group__cons", dom);
locGroupCons = locGroupCons == null ? "" : locGroupCons.trim(); locGroupCons = locGroupCons == null ? "" : locGroupCons.trim();
System.out.println(":::: loc group cons" + locGroupCons); System.out.println(":::: loc group cons" + locGroupCons);
locCode = genericUtility.getColumnValue("loc_code__cons", dom); locCode = genericUtility.getColumnValue("loc_code__cons", dom);
locCode = locCode == null ? "" : locCode.trim(); locCode = locCode == null ? "" : locCode.trim();
System.out.println(":::: loc code" + locCode); System.out.println(":::: loc code" + locCode);
sql = "select loc_group from location where loc_code = ? "; sql = "select loc_group from location where loc_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locCode); pstmt.setString(1, locCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next())
{
locGroup = rs.getString("loc_group"); locGroup = rs.getString("loc_group");
} }
locGroup = locGroup == null ? "" : locGroup.trim(); locGroup = locGroup == null ? "" : locGroup.trim();
System.out.println(":::loc group" + locGroup); System.out.println(":::loc group" + locGroup);
/*pstmt.close(); /*pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
rs = null;*/ rs = null;*/
if(!locGroup.equalsIgnoreCase(locGroupCons)){ if(!locGroup.equalsIgnoreCase(locGroupCons))
{
errString = itmdbAccessEJB.getErrorString("loc_group__cons", "VMLOCGRCON", userId); errString = itmdbAccessEJB.getErrorString("loc_group__cons", "VMLOCGRCON", userId);
return errString; return errString;
} }
} }
if(childNodeName.equalsIgnoreCase("tax_class")){ if(childNodeName.equalsIgnoreCase("tax_class"))
{
taxClass = genericUtility.getColumnValue("tax_class", dom); taxClass = genericUtility.getColumnValue("tax_class", dom);
taxClass = taxClass == null ? "" : taxClass.trim(); taxClass = taxClass == null ? "" : taxClass.trim();
...@@ -317,47 +370,61 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio ...@@ -317,47 +370,61 @@ public class DistributionOrderTypeIC extends ValidatorEJB implements Distributio
System.out.println(":::tax class" + taxClass); System.out.println(":::tax class" + taxClass);
int count = 0; int count = 0;
sql = "select count(*) as count from taxclass where tax_class = ? "; // Changed By Nasruddin [16-sep-16]
pstmt = conn.prepareStatement(sql); if( taxClass != null && taxClass.trim().length() > 0)
pstmt.setString(1, taxClass); {
rs = pstmt.executeQuery(); sql = "select count(*) as count from taxclass where tax_class = ? ";
if(rs.next()){ pstmt = conn.prepareStatement(sql);
count = rs.getInt("count"); pstmt.setString(1, taxClass);
} rs = pstmt.executeQuery();
if(rs.next())
pstmt.close(); {
pstmt = null; count = rs.getInt("count");
rs.close(); }
rs = null;
if(count == 0){ pstmt.close();
errString = itmdbAccessEJB.getErrorString("tax_class", "VTTCLASS1", userId); pstmt = null;
return errString; rs.close();
rs = null;
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("tax_class", "VTTCLASS1", userId);
return errString;
}
} }
} }
if(childNodeName.equalsIgnoreCase("tax_env")){ if(childNodeName.equalsIgnoreCase("tax_env"))
{
taxEnv = genericUtility.getColumnValue("tax_env", dom); taxEnv = genericUtility.getColumnValue("tax_env", dom);
taxEnv = taxEnv == null ? "" : taxEnv.trim(); taxEnv = taxEnv == null ? "" : taxEnv.trim();
System.out.println(":::tax env" + taxEnv); System.out.println(":::tax env" + taxEnv);
int count = 0; int count = 0;
sql = "select count(*) as count from taxenv where tax_env = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, taxEnv);
rs = pstmt.executeQuery();
if(rs.next()){
count = rs.getInt("count");
}
pstmt.close(); //Changed By Nasruddin [16-sep-16]
pstmt = null; if( taxEnv != null && taxEnv.trim().length() > 0)
rs.close(); {
rs = null; sql = "select count(*) as count from taxenv where tax_env = ? ";
if(count == 0){ pstmt = conn.prepareStatement(sql);
errString = itmdbAccessEJB.getErrorString("tax_env", "VTTAXENV1", userId); pstmt.setString(1, taxEnv);
return errString; rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt("count");
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
if(count == 0)
{
errString = itmdbAccessEJB.getErrorString("tax_env", "VTTAXENV1", userId);
return errString;
}
} }
} }
} }
......
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