Commit 4a3ee48c authored by ssalve's avatar ssalve

Sarita: Done changes in FixedAssetTransf.java class to perform validation for...

Sarita: Done changes in FixedAssetTransf.java class to perform validation for different site_code__to and site_code__from for different fin_entity on 17 JUL 18

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187645 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 801eb8e1
......@@ -9,6 +9,7 @@ import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Map;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
......@@ -143,6 +144,45 @@ conn = getConnection();
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
//Added by sarita to check for finentity for site_code__to and site_code__from should not be different if site codes are different. on 16 JULY 18 [START]
else
{
String siteCodeTo = "", sql = "";
HashSet<String> siteData = new HashSet<String>();
siteCodeTo = checkNull(genericUtility.getColumnValue("site_code__to",dom));
System.out.println("siteCodeFrom ["+siteCodeFrom+"] \t siteCodeTo ["+siteCodeTo+"]");
if((siteCodeTo != null && siteCodeTo.trim().length() > 0) && ((siteCodeFrom.trim()).equalsIgnoreCase(siteCodeTo.trim()) == false))
{
sql = "select fin_entity from site where site_code in (? , ?)";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, siteCodeTo);
pstmt.setString(2, siteCodeFrom);
rs=pstmt.executeQuery();
while(rs.next())
{
siteData.add(checkNull(rs.getString("fin_entity")));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("Value of HashSet<siteData> : ["+siteData+"]");
if((siteData != null) && (siteData.size() > 1))
{
errCode = "INVFINENT"; //Fin entity should be same for different site_code__from and site_code__to.
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
//Added by sarita to check for finentity for site_code__to and site_code__from should not be different if site codes are different. on 16 JULY 18 [END]
// sql ="select "
}
}
......
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