Commit 0d74d481 authored by dchattar's avatar dchattar

FI1BALL002 - changes done in SiteCode,SiteCodeFor & SiteCodeJV field


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91544 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 54a027e6
...@@ -63,8 +63,10 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote ...@@ -63,8 +63,10 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote
public String wfValData(Document dom, Document dom1, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException public String wfValData(Document dom, Document dom1, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
NodeList parentNodeList = null; NodeList parentNodeList = null;
NodeList parentNodeList1 = null;
NodeList childNodeList = null; NodeList childNodeList = null;
Node parentNode = null; Node parentNode = null;
Node parentNode1 = null;
Node childNode = null; Node childNode = null;
int ctr=0; int ctr=0;
int cnt = 0; int cnt = 0;
...@@ -93,6 +95,7 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote ...@@ -93,6 +95,7 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote
String currCode = ""; String currCode = "";
String tranDate = ""; String tranDate = "";
String revDate = ""; String revDate = "";
String siteCodeFor = "";
Date tranPdate = null; Date tranPdate = null;
ArrayList<String> errList = new ArrayList<String>(); ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>(); ArrayList<String> errFields = new ArrayList<String>();
...@@ -220,6 +223,40 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote ...@@ -220,6 +223,40 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote
} }
else if(getObjName(parentNode)!=null && (getObjName(parentNode).trim().equalsIgnoreCase("journal_oth_site")) && (childNodeName.equalsIgnoreCase("site_code__for")))
{
siteCodeFor = genericUtility.getColumnValue("site_code__for", dom);
if(siteCodeFor == null || (siteCodeFor.length() == 0))
{
errList.add("VMSITECOD");
errFields.add(childNodeName.toLowerCase());
}
if(siteCodeFor != null && (siteCodeFor.trim().length()!= 0))
{
sql = " select count(*) from site where site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCodeFor);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
if(cnt == 0)
{
errCode = "VMSITE1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
else if(childNodeName.equalsIgnoreCase("tran_date")) else if(childNodeName.equalsIgnoreCase("tran_date"))
{ {
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
...@@ -400,6 +437,8 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote ...@@ -400,6 +437,8 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote
case 2 : parentNodeList = dom.getElementsByTagName("Detail2"); case 2 : parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
parentNodeList1 = dom1.getElementsByTagName("Detail1");
parentNode1 = parentNodeList1.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr ++) for(ctr = 0; ctr < childNodeListLength; ctr ++)
...@@ -478,7 +517,10 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote ...@@ -478,7 +517,10 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote
//added for validating JV Site Code //added for validating JV Site Code
else if(getObjName(parentNode)!=null && (getObjName(parentNode).trim().equalsIgnoreCase("journal_oth_site")) && (childNodeName.equalsIgnoreCase("site_code__jv"))) else if(getObjName(parentNode)!=null && (getObjName(parentNode).trim().equalsIgnoreCase("journal_oth_site")) && (childNodeName.equalsIgnoreCase("site_code__jv")))
{ {
System.out.println("Inside------------------------------------------ getobj");
siteCodeJv = genericUtility.getColumnValue("site_code__jv", dom); siteCodeJv = genericUtility.getColumnValue("site_code__jv", dom);
siteCodeFor = genericUtility.getColumnValue("site_code__for", dom1);
siteCode = genericUtility.getColumnValue("site_code", dom1);
if(siteCodeJv == null || (siteCodeJv.trim().length() == 0 )) if(siteCodeJv == null || (siteCodeJv.trim().length() == 0 ))
{ {
errList.add("VMSITECOD"); errList.add("VMSITECOD");
...@@ -505,7 +547,15 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote ...@@ -505,7 +547,15 @@ public class JvVal extends ValidatorEJB implements JvValLocal, JvValRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(errCode == null || errCode.trim().length() == 0)
{
if(siteCodeJv != null && siteCode != null && siteCodeFor != null && !(siteCodeJv.trim().equalsIgnoreCase(siteCode.trim())) && !(siteCodeJv.trim().equalsIgnoreCase(siteCodeFor.trim())))
{
errCode = "VTSITEWRNG";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
} }
......
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