Commit a66d064b authored by sghate's avatar sghate

*Done Changes on SiteStanPayTbl Master Component.

SiteStanPayTbl.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204881 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e3cdf2b7
package ibase.webitm.ejb.adm; package ibase.webitm.ejb.adm;
//modified by Shital on 30/07/2019 [Start]
import ibase.system.config.ConnDriver; //import ibase.system.config.ConnDriver;
//modified by Shital on 30/07/2019 [End]
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility; //modified by Shital on 30/07/2019 [Start]
//import ibase.webitm.utility.GenericUtility;
//modified by Shital on 30/07/2019 [End]
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;
import java.sql.ResultSet; import java.sql.ResultSet;
import javax.ejb.Stateless;
//modified by Shital on 30/07/2019 [Start]
//import javax.ejb.Stateless;
//modified by Shital on 30/07/2019 [End]
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;
//modified by Shital on 30/07/2019 [Start]
//@Stateless
//modified by Shital on 30/07/2019 [End]
@Stateless
public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ,SiteStanPayTblRemote public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ,SiteStanPayTblRemote
{ {
//modified by Shital on 30/07/2019 [Start]
E12GenericUtility genericUtility = new E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
//modified by Shital on 30/07/2019 [End]
public String wfValData() throws RemoteException,ITMException public String wfValData() throws RemoteException,ITMException
{ {
...@@ -27,7 +41,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -27,7 +41,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
System.out.println("Came Inside 1 wfValData:::"); System.out.println("Came Inside 1 wfValData:::");
GenericUtility genericUtility = GenericUtility.getInstance(); //modified by Shital on 30/07/2019 [Start]
//GenericUtility genericUtility = GenericUtility.getInstance();
//modified by Shital on 30/07/2019 [End]
Document dom = null; Document dom = null;
Document dom1 = null; Document dom1 = null;
...@@ -70,7 +86,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -70,7 +86,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
System.out.println("Exception : [SiteStanPayTbl][wfValData(String xmlString)] : ==>\n"+e.getMessage()); System.out.println("Exception : [SiteStanPayTbl][wfValData(String xmlString)] : ==>\n"+e.getMessage());
e.printStackTrace(); e.printStackTrace();
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
//modified by Shital on 30/07/2019 [Start]
throw new ITMException(e);
//modified by Shital on 30/07/2019 [End]
} }
return (errString); return (errString);
} }
...@@ -80,12 +98,16 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -80,12 +98,16 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
System.out.println("Came Inside 2 wfValData:::"); System.out.println("Came Inside 2 wfValData:::");
String errString = ""; String errString = "";
Connection conn = null; Connection conn = null;
//modified by Shital on 30/07/2019 [Start]
GenericUtility genericUtility = GenericUtility.getInstance(); //GenericUtility genericUtility = GenericUtility.getInstance();
//modified by Shital on 30/07/2019 [End]
try try
{ {
ConnDriver connDriver = new ConnDriver(); //modified by Shital on 30/07/2019 [Start]
conn = connDriver.getConnectDB("Driver"); //ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB("Driver");
conn = getConnection();
//modified by Shital on 30/07/2019 [End]
conn.setAutoCommit(false); conn.setAutoCommit(false);
errString = wfValData( dom, dom1, dom2, objContext, editFlag, xtraParams,conn); errString = wfValData( dom, dom1, dom2, objContext, editFlag, xtraParams,conn);
...@@ -94,6 +116,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -94,6 +116,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
{ {
e.printStackTrace(); e.printStackTrace();
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
//modified by Shital on 30/07/2019 [Start]
throw new ITMException(e);
//modified by Shital on 30/07/2019 [End]
} }
finally finally
{ {
...@@ -107,6 +132,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -107,6 +132,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
} }
catch(Exception e1) catch(Exception e1)
{ {
//modified by Shital on 30/07/2019 [Start]
e1.printStackTrace();
//modified by Shital on 30/07/2019 [End]
System.out.println( "Exception : [SiteStanPayTbl][wfValData(String xmlString)] : ==>\n"+e1.getMessage()); System.out.println( "Exception : [SiteStanPayTbl][wfValData(String xmlString)] : ==>\n"+e1.getMessage());
throw new ITMException(e1); throw new ITMException(e1);
} }
...@@ -128,7 +156,8 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -128,7 +156,8 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
int count = 0; int count = 0;
int ctr,currentFormNo=0; int ctr = 0;
int currentFormNo = 0;
int childNodeListLength; int childNodeListLength;
String siteCode = ""; String siteCode = "";
...@@ -136,8 +165,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -136,8 +165,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
String stanCode = ""; String stanCode = "";
String payTable = ""; String payTable = "";
//modified by Shital on 30/07/2019 [Start]
GenericUtility genericUtility = GenericUtility.getInstance(); //GenericUtility genericUtility = GenericUtility.getInstance();
//modified by Shital on 30/07/2019 [End]
try try
{ {
...@@ -163,13 +193,20 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -163,13 +193,20 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase("site_code")) if (childNodeName.equalsIgnoreCase("site_code"))
{ {
siteCode = getColumnValue("site_code",dom1,objContext); //modified by Shital on 30/07/2019 [Start]
//siteCode = getColumnValue("site_code",dom1,objContext);
siteCode = checkNull(genericUtility.getColumnValue("site_code",dom1,objContext));
//modified by Shital on 30/07/2019 [End]
System.out.println("value of site_code:::: "+siteCode); System.out.println("value of site_code:::: "+siteCode);
System.out.println("Inside validation of site_code "); System.out.println("Inside validation of site_code ");
if ((childNode.getFirstChild() == null)||(childNode.getFirstChild() != null && childNode.getFirstChild().getNodeValue() == null)) if ((childNode.getFirstChild() == null)||(childNode.getFirstChild() != null && childNode.getFirstChild().getNodeValue() == null))
{ {
System.out.println("site code null"); System.out.println("site code null");
errString = getErrorString("site_code","VMSITENULL",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("site_code","VMSITENULL",userId);
errString = itmDBAccessEJB.getErrorString("site_code", "VMSITENULL", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
else else
...@@ -197,21 +234,31 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -197,21 +234,31 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
if(count == 0) if(count == 0)
{ {
System.out.println("Site_code is not valid"); System.out.println("Site_code is not valid");
errString = getErrorString("site_code","VMSITEINVD",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("site_code","VMSITEINVD",userId);
errString = itmDBAccessEJB.getErrorString("site_code", "VMSITEINVD", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
} }
} //END IF (site_code) } //END IF (site_code)
else if (childNodeName.equalsIgnoreCase("state_code")) else if (childNodeName.equalsIgnoreCase("state_code"))
{ {
stateCode = getColumnValue("state_code",dom1,objContext); //modified by Shital on 30/07/2019 [Start]
//stateCode = getColumnValue("state_code",dom1,objContext);
stateCode = checkNull(genericUtility.getColumnValue("state_code",dom1,objContext));
//modified by Shital on 30/07/2019 [Start]
System.out.println("value of state_code:::: "+stateCode); System.out.println("value of state_code:::: "+stateCode);
System.out.println("Inside validation of state_code "); System.out.println("Inside validation of state_code ");
if ((childNode.getFirstChild() == null)||(childNode.getFirstChild() != null && childNode.getFirstChild().getNodeValue() == null)) if ((childNode.getFirstChild() == null)||(childNode.getFirstChild() != null && childNode.getFirstChild().getNodeValue() == null))
{ {
System.out.println("state code null"); System.out.println("state code null");
errString = getErrorString("state_code","VMSTATNULL",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("state_code","VMSTATNULL",userId);
errString = itmDBAccessEJB.getErrorString("state_code", "VMSTATNULL", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
else else
...@@ -239,26 +286,38 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -239,26 +286,38 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
if(count == 0) if(count == 0)
{ {
System.out.println("State_code is not valid"); System.out.println("State_code is not valid");
errString = getErrorString("state_code","VMSTATINVD",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("state_code","VMSTATINVD",userId);
errString = itmDBAccessEJB.getErrorString("state_code", "VMSTATINVD", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
} }
} //END IF (state_code) } //END IF (state_code)
else if (childNodeName.equalsIgnoreCase("stan_code")) else if (childNodeName.equalsIgnoreCase("stan_code"))
{ {
stanCode = getColumnValue("stan_code",dom1,objContext); //modified by Shital on 30/07/2019 [Start]
stateCode = getColumnValue("state_code",dom1,objContext); //stanCode = getColumnValue("stan_code",dom1,objContext);
//stateCode = getColumnValue("state_code",dom1,objContext);
stanCode = checkNull(genericUtility.getColumnValue("stan_code",dom1,objContext));
stateCode = checkNull(genericUtility.getColumnValue("state_code",dom1,objContext));
//modified by Shital on 30/07/2019 [End]
System.out.println("value of stan_code:::: "+stanCode); System.out.println("value of stan_code:::: "+stanCode);
System.out.println("value of state_code:::: "+stateCode); System.out.println("value of state_code:::: "+stateCode);
System.out.println("Inside validation of stan_code "); System.out.println("Inside validation of stan_code ");
if ((childNode.getFirstChild() == null)||(childNode.getFirstChild() != null && childNode.getFirstChild().getNodeValue() == null)) if ((childNode.getFirstChild() == null)||(childNode.getFirstChild() != null && childNode.getFirstChild().getNodeValue() == null))
{ {
System.out.println("station code null"); System.out.println("station code null");
errString = getErrorString("stan_code","VMSTANNULL",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("stan_code","VMSTANNULL",userId);
errString = itmDBAccessEJB.getErrorString("stan_code", "VMSTANNULL", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
else if(stateCode != null && (stanCode != null && stanCode.trim().length()>0))
else if(stateCode != null && (stanCode != null && stanCode.trim().length() > 0))
{ {
// To check stan code is present or not // To check stan code is present or not
sql = "SELECT COUNT(*) AS COUNT FROM STATION WHERE STAN_CODE = ?" ; sql = "SELECT COUNT(*) AS COUNT FROM STATION WHERE STAN_CODE = ?" ;
...@@ -283,11 +342,14 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -283,11 +342,14 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
if(count == 0) if(count == 0)
{ {
System.out.println("Stan_code is not valid"); System.out.println("Stan_code is not valid");
errString = getErrorString("stan_code","VMSTANINVD",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("stan_code","VMSTANINVD",userId);
errString = itmDBAccessEJB.getErrorString("stan_code", "VMSTANINVD", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
sql = "SELECT COUNT(*) AS COUNT FROM STATION WHERE STAN_CODE = ? AND STATE_CODE = ?" ; sql = "SELECT COUNT(*) AS COUNT FROM STATION WHERE STAN_CODE = ? AND STATE_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stanCode); pstmt.setString(1,stanCode);
pstmt.setString(2,stateCode); pstmt.setString(2,stateCode);
...@@ -310,15 +372,23 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -310,15 +372,23 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
if(count == 0) if(count == 0)
{ {
System.out.println("Stan_code is not valid"); System.out.println("Stan_code is not valid");
errString = getErrorString("stan_code","VMSTANSTCD",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("stan_code","VMSTANSTCD",userId);
errString = itmDBAccessEJB.getErrorString("stan_code", "VMSTANSTCD", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
} }
//Added by Hemlata[17/07/2014][to validate duplicate entry for SITE_STAN_PAYTBL][start] //Added by Hemlata[17/07/2014][to validate duplicate entry for SITE_STAN_PAYTBL][start]
//Added by Radheshyam[01/03/2014][to validate duplicate entry for SITE_STAN_PAYTBL][start] //Added by Radheshyam[01/03/2014][to validate duplicate entry for SITE_STAN_PAYTBL][start]
siteCode = getColumnValue("site_code",dom1,objContext); //modified by Shital on 30/07/2019 [Start]
stateCode = getColumnValue("state_code",dom1,objContext); //siteCode = getColumnValue("site_code",dom1,objContext);
stanCode = getColumnValue("stan_code",dom1,objContext); //stateCode = getColumnValue("state_code",dom1,objContext);
//stanCode = getColumnValue("stan_code",dom1,objContext);
siteCode = checkNull(genericUtility.getColumnValue("site_code",dom1,objContext));
stateCode = checkNull(genericUtility.getColumnValue("state_code",dom1,objContext));
stanCode = checkNull(genericUtility.getColumnValue("stan_code",dom1,objContext));
//modified by Shital on 30/07/2019 [End]
System.out.println("value of count in siteCode:::: "+siteCode); System.out.println("value of count in siteCode:::: "+siteCode);
System.out.println("value of count in stateCode:::: "+stateCode); System.out.println("value of count in stateCode:::: "+stateCode);
System.out.println("value of count in stan_code:::: "+stanCode); System.out.println("value of count in stan_code:::: "+stanCode);
...@@ -347,24 +417,33 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -347,24 +417,33 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
{ {
System.out.println("Duplicate Entries"); System.out.println("Duplicate Entries");
//errString = getErrorString("stan_code","VMSTANDUPL",userId); //errString = getErrorString("stan_code","VMSTANDUPL",userId);
errString = getErrorString("stan_code","VMSTNPTBL1",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("stan_code","VMSTNPTBL1",userId);
errString = itmDBAccessEJB.getErrorString("stan_code", "VMSTNPTBL1", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
//Added by Radheshyam[01/03/2014][to validate duplicate entry for SITE_STAN_PAYTBL][End] //Added by Radheshyam[01/03/2014][to validate duplicate entry for SITE_STAN_PAYTBL][End]
// Added by Hemlata[17/07/2014][to validate duplicate entry for SITE_STAN_PAYTBL][End] // Added by Hemlata[17/07/2014][to validate duplicate entry for SITE_STAN_PAYTBL][End]
} }
//END IF (stan_code) //END IF (stan_code)
else if (childNodeName.equalsIgnoreCase("pay_table")) else if (childNodeName.equalsIgnoreCase("pay_table"))
{ {
payTable = getColumnValue("pay_table",dom1,objContext); //modified by Shital on 30/07/2019 [Start]
//payTable = getColumnValue("pay_table",dom1,objContext)
payTable = checkNull(genericUtility.getColumnValue("pay_table",dom1,objContext));
//modified by Shital on 30/07/2019 [End]
System.out.println("value of pay_table:::: "+payTable); System.out.println("value of pay_table:::: "+payTable);
System.out.println("Inside validation of pay_table "); System.out.println("Inside validation of pay_table ");
if ((childNode.getFirstChild() == null)||(childNode.getFirstChild() != null && childNode.getFirstChild().getNodeValue() == null)) if ((childNode.getFirstChild() == null)||(childNode.getFirstChild() != null && childNode.getFirstChild().getNodeValue() == null))
{ {
System.out.println("pay_tabel null"); System.out.println("pay_tabel null");
errString = getErrorString("pay_table","VMPAYTBNUL",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("pay_table","VMPAYTBNUL",userId);
errString = itmDBAccessEJB.getErrorString("pay_table", "VMPAYTBNUL", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
else else
...@@ -392,7 +471,10 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -392,7 +471,10 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
if(count == 0) if(count == 0)
{ {
System.out.println("Pay table is not valid"); System.out.println("Pay table is not valid");
errString = getErrorString("pay_table","VMPTBLINVD",userId); //modified by Shital on 30/07/2019 [Start]
//errString = getErrorString("pay_table","VMPTBLINVD",userId);
errString = itmDBAccessEJB.getErrorString("pay_table", "VMPTBLINVD", userId, "", conn);
//modified by Shital on 30/07/2019 [End]
break; break;
} }
} }
...@@ -405,6 +487,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -405,6 +487,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
}//END TRY }//END TRY
catch(Exception e) catch(Exception e)
{ {
//modified by Shital on 30/07/2019 [Start]
e.printStackTrace();
//modified by Shital on 30/07/2019 [End]
System.out.println("Exception ::"+ e.getMessage()); System.out.println("Exception ::"+ e.getMessage());
throw new ITMException(e); throw new ITMException(e);
} }
...@@ -412,11 +497,30 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -412,11 +497,30 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
{ {
try try
{ {
//modified by Shital on 30/07/2019 [Start]
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (conn != null)
{
conn.close();
conn = null;
}
//modified by Shital on 30/07/2019 [End]
} }
catch(Exception d) catch(Exception d)
{ {
//modified by Shital on 30/07/2019 [Start]
d.printStackTrace();
throw new ITMException(d);
//modified by Shital on 30/07/2019 [End]
} }
} }
System.out.println("ErrString ::"+ errString); System.out.println("ErrString ::"+ errString);
...@@ -429,21 +533,23 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -429,21 +533,23 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
Document dom1 = null; Document dom1 = null;
Document dom2 = null; Document dom2 = null;
String errString = null; String errString = null;
GenericUtility genericUtility = GenericUtility.getInstance(); //modified by Shital on 30/07/2019 [Start]
//GenericUtility genericUtility = GenericUtility.getInstance();
//modified by Shital on 30/07/2019 [End]
try try
{ {
System.out.println("xmlString ["+xmlString+"]"); System.out.println("xmlString ["+xmlString+"]");
System.out.println("xmlString1 ["+xmlString1+"]"); System.out.println("xmlString1 ["+xmlString1+"]");
System.out.println("xmlString2 ["+xmlString2+"]"); System.out.println("xmlString2 ["+xmlString2+"]");
if (xmlString != null && xmlString.trim().length()!=0) if (xmlString != null && xmlString.trim().length() != 0)
{ {
dom = genericUtility.parseString(xmlString); dom = genericUtility.parseString(xmlString);
} }
if (xmlString1 != null && xmlString1.trim().length()!=0) if (xmlString1 != null && xmlString1.trim().length() != 0)
{ {
dom1 = genericUtility.parseString(xmlString1); dom1 = genericUtility.parseString(xmlString1);
} }
if (xmlString2 != null && xmlString2.trim().length()!=0) if (xmlString2 != null && xmlString2.trim().length() != 0)
{ {
dom2 = genericUtility.parseString(xmlString2); dom2 = genericUtility.parseString(xmlString2);
} }
...@@ -452,8 +558,14 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -452,8 +558,14 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
} }
catch (Exception e) catch (Exception e)
{ {
//modified by Shital on 30/07/2019 [Start]
e.printStackTrace();
//modified by Shital on 30/07/2019 [End]
System.out.println ( "Exception :SiteStanPayTbl :" + e.getMessage() + ":" ); System.out.println ( "Exception :SiteStanPayTbl :" + e.getMessage() + ":" );
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
//modified by Shital on 30/07/2019 [Start]
throw new ITMException(e);
//modified by Shital on 30/07/2019 [End]
} }
System.out.println ( "returning from SiteStanPayTbl " ); System.out.println ( "returning from SiteStanPayTbl " );
return errString; return errString;
...@@ -462,7 +574,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -462,7 +574,9 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); //modified by Shital on 30/07/2019 [Start]
//ConnDriver connDriver = new ConnDriver();
//modified by Shital on 30/07/2019 [End]
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
...@@ -471,13 +585,25 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -471,13 +585,25 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
String stateDescr = ""; String stateDescr = "";
String stanDescr = ""; String stanDescr = "";
String payTableDescr = ""; String payTableDescr = "";
String loginSite = "";
String siteCode = "";
String stateCode = "";
String payTable = "";
String stanCode = "";
StringBuffer valueXmlString = new StringBuffer(); StringBuffer valueXmlString = new StringBuffer();
int currentFormNo = 0; int currentFormNo = 0;
GenericUtility genericUtility = GenericUtility.getInstance(); //modified by Shital on 30/07/2019 [Start]
//GenericUtility genericUtility = GenericUtility.getInstance();
//modified by Shital on 30/07/2019 [End]
AdmCommon admCommon = new AdmCommon();
try try
{ {
conn = connDriver.getConnectDB("Driver"); //modified by Shital on 30/07/2019 [Start]
//conn = connDriver.getConnectDB("Driver");
conn = getConnection();
//modified by Shital on 30/07/2019 [End]
conn.setAutoCommit(false); conn.setAutoCommit(false);
if(objContext != null && objContext.trim().length() > 0) if(objContext != null && objContext.trim().length() > 0)
...@@ -496,6 +622,8 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -496,6 +622,8 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
String objNameDefault = ""; String objNameDefault = "";
switch (currentFormNo) switch (currentFormNo)
{ {
case 1: case 1:
...@@ -504,20 +632,21 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -504,20 +632,21 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
valueXmlString.append("<Detail1>\r\n"); valueXmlString.append("<Detail1>\r\n");
if(currentColumn.trim().equalsIgnoreCase("itm_default")) if(currentColumn.trim().equalsIgnoreCase("itm_default"))
{ {
String loginSite = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSite"); //modified by Shital on 30/07/2019 [Start]
//String loginSite = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSite");
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSite"));
//modified by Shital on 30/07/2019 [End]
sql = null; sql = null;
siteDescr = ""; siteDescr = "";
sql = "SELECT DESCR FROM SITE WHERE SITE_CODE = ?";
sql = "SELECT DESCR FROM SITE WHERE SITE_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,loginSite); pstmt.setString(1,loginSite);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next()) if( rs.next())
{ {
siteDescr = checkNull(rs.getString("DESCR")); siteDescr = checkNull(rs.getString("DESCR"));
} }
if( rs != null ) if( rs != null )
{ {
rs.close(); rs.close();
...@@ -528,32 +657,38 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -528,32 +657,38 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
valueXmlString.append("<site_code><![CDATA[").append(loginSite).append("]]></site_code>\r\n"); valueXmlString.append("<site_code><![CDATA[").append(loginSite).append("]]></site_code>\r\n");
valueXmlString.append("<site_descr><![CDATA[").append(siteDescr).append("]]></site_descr>\r\n"); valueXmlString.append("<site_descr><![CDATA[").append(siteDescr).append("]]></site_descr>\r\n");
valueXmlString.append("<stan_code><![CDATA[").append(" ").append("]]></stan_code>\r\n"); valueXmlString.append("<stan_code><![CDATA[").append(" ").append("]]></stan_code>\r\n");
//modified by Shital on 30/07/2019 [Start]
admCommon.setNodeValue(dom, "site_code", loginSite);
admCommon.setNodeValue(dom, "site_descr", siteDescr);
admCommon.setNodeValue(dom, "stan_code", " ");
//modified by Shital on 30/07/2019 [End]
} }
else if (currentColumn.trim().equalsIgnoreCase("site_code")) else if (currentColumn.trim().equalsIgnoreCase("site_code"))
{ {
System.out.println("Current column is"+currentColumn); System.out.println("Current column is"+currentColumn);
System.out.println("INSIDE site_code"); System.out.println("INSIDE site_code");
String siteCode = getColumnValue("site_code",dom,"1"); //modified by Shital on 30/07/2019 [Start]
//String siteCode = getColumnValue("site_code",dom,"1");
siteCode = checkNull(genericUtility.getColumnValue("site_code",dom,"1"));
//modified by Shital on 30/07/2019 [End]
System.out.println("value of site_code:::::"+siteCode); System.out.println("value of site_code:::::"+siteCode);
if(siteCode != null && siteCode.length() > 0) if(siteCode != null && siteCode.length() > 0)
{ {
sql = null; sql = null;
sql = "SELECT DESCR FROM SITE WHERE SITE_CODE = ?";
sql = "SELECT DESCR FROM SITE WHERE SITE_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode); pstmt.setString(1,siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next()) if( rs.next())
{ {
siteDescr = checkNull(rs.getString("DESCR")); siteDescr = checkNull(rs.getString("DESCR"));
} }
if( rs != null ) if( rs != null )
{ {
rs.close(); rs.close();
...@@ -564,35 +699,41 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -564,35 +699,41 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
valueXmlString.append("<site_descr><![CDATA[").append(siteDescr).append("]]></site_descr>\r\n"); valueXmlString.append("<site_descr><![CDATA[").append(siteDescr).append("]]></site_descr>\r\n");
//modified by Shital on 30/07/2019 [Start]
admCommon.setNodeValue(dom, "site_descr", siteDescr);
//modified by Shital on 30/07/2019 [End]
} }
else else
{ {
valueXmlString.append("<site_descr><![CDATA[").append("").append("]]></site_descr>\r\n"); valueXmlString.append("<site_descr><![CDATA[").append("").append("]]></site_descr>\r\n");
//modified by Shital on 30/07/2019 [Start]
admCommon.setNodeValue(dom, "site_descr", "");
//modified by Shital on 30/07/2019 [End]
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("state_code")) else if (currentColumn.trim().equalsIgnoreCase("state_code"))
{ {
System.out.println("Current column is"+currentColumn); System.out.println("Current column is"+currentColumn);
System.out.println("INSIDE state_code"); System.out.println("INSIDE state_code");
String stateCode = getColumnValue("state_code",dom,"1"); //modified by Shital on 30/07/2019 [Start]
//String stateCode = getColumnValue("state_code",dom,"1");
stateCode = checkNull(genericUtility.getColumnValue("state_code",dom,"1"));
//modified by Shital on 30/07/2019 [End]
System.out.println("value of state_code:::::"+stateCode); System.out.println("value of state_code:::::"+stateCode);
if(stateCode != null && stateCode.length() > 0) if(stateCode != null && stateCode.length() > 0)
{ {
sql = null; sql = null;
sql = "SELECT DESCR FROM STATE WHERE STATE_CODE = ?"; sql = "SELECT DESCR FROM STATE WHERE STATE_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stateCode); pstmt.setString(1,stateCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next()) if( rs.next())
{ {
stateDescr = checkNull(rs.getString("DESCR")); stateDescr = checkNull(rs.getString("DESCR"));
} }
if( rs != null ) if( rs != null )
{ {
rs.close(); rs.close();
...@@ -603,37 +744,41 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -603,37 +744,41 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
valueXmlString.append("<state_descr><![CDATA[").append(stateDescr).append("]]></state_descr>\r\n"); valueXmlString.append("<state_descr><![CDATA[").append(stateDescr).append("]]></state_descr>\r\n");
//modified by Shital on 30/07/2019 [Start]
admCommon.setNodeValue(dom, "state_descr", stateDescr);
//modified by Shital on 30/07/2019 [End]
} }
else else
{ {
valueXmlString.append("<state_descr><![CDATA[").append("").append("]]></state_descr>\r\n"); valueXmlString.append("<state_descr><![CDATA[").append("").append("]]></state_descr>\r\n");
//modified by Shital on 30/07/2019 [Start]
admCommon.setNodeValue(dom, "state_descr", "");
//modified by Shital on 30/07/2019 [End]
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("stan_code")) else if (currentColumn.trim().equalsIgnoreCase("stan_code"))
{ {
System.out.println("Current column is"+currentColumn); System.out.println("Current column is"+currentColumn);
System.out.println("INSIDE stan_code"); System.out.println("INSIDE stan_code");
String stanCode = getColumnValue("stan_code",dom,"1"); //modified by Shital on 30/07/2019 [Start]
//String stanCode = genericUtility.getColumnValue("stan_code",dom,"1");
stanCode = checkNull(genericUtility.getColumnValue("stan_code",dom,"1"));
//modified by Shital on 30/07/2019 [End]
System.out.println("value of site_code:::::"+stanCode); System.out.println("value of site_code:::::"+stanCode);
if(stanCode != null && stanCode.length() > 0) if(stanCode != null && stanCode.length() > 0)
{ {
sql = null; sql = null;
sql = "SELECT DESCR FROM STATION WHERE STAN_CODE = ?"; sql = "SELECT DESCR FROM STATION WHERE STAN_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,stanCode); pstmt.setString(1,stanCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next()) if( rs.next())
{ {
stanDescr = checkNull(rs.getString("DESCR")); stanDescr = checkNull(rs.getString("DESCR"));
} }
if( rs != null ) if( rs != null )
{ {
rs.close(); rs.close();
...@@ -644,37 +789,41 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -644,37 +789,41 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
valueXmlString.append("<station_descr><![CDATA[").append(stanDescr).append("]]></station_descr>\r\n"); valueXmlString.append("<station_descr><![CDATA[").append(stanDescr).append("]]></station_descr>\r\n");
//modified by Shital on 30/07/2019 [Start]
admCommon.setNodeValue(dom, "station_descr",stanDescr);
//modified by Shital on 30/07/2019 [End]
} }
else else
{ {
valueXmlString.append("<station_descr><![CDATA[").append("").append("]]></station_descr>\r\n"); valueXmlString.append("<station_descr><![CDATA[").append("").append("]]></station_descr>\r\n");
//modified by Shital on 30/07/2019 [Start]
admCommon.setNodeValue(dom, "station_descr","");
//modified by Shital on 30/07/2019 [End]
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("pay_table")) else if (currentColumn.trim().equalsIgnoreCase("pay_table"))
{ {
System.out.println("Current column is"+currentColumn); System.out.println("Current column is"+currentColumn);
System.out.println("INSIDE pay_table"); System.out.println("INSIDE pay_table");
String payTable = getColumnValue("pay_table",dom,"1"); //modified by Shital on 30/07/2019 [Start]
//String payTable = checkNull(getColumnValue("pay_table",dom,"1"));
payTable = checkNull(genericUtility.getColumnValue("pay_table",dom,"1"));
//modified by Shital on 30/07/2019 [End]
System.out.println("value of site_code:::::"+payTable); System.out.println("value of site_code:::::"+payTable);
if(payTable != null && payTable.length() > 0) if(payTable != null && payTable.length() > 0)
{ {
sql = null; sql = null;
sql = "SELECT DESCR FROM PAYTABLE WHERE PAY_TABLE = ?"; sql = "SELECT DESCR FROM PAYTABLE WHERE PAY_TABLE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,payTable); pstmt.setString(1,payTable);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next()) if( rs.next())
{ {
payTableDescr = checkNull(rs.getString("DESCR")); payTableDescr = checkNull(rs.getString("DESCR"));
} }
if( rs != null ) if( rs != null )
{ {
rs.close(); rs.close();
...@@ -686,20 +835,27 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -686,20 +835,27 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
pstmt = null; pstmt = null;
} }
valueXmlString.append("<paytable_descr><![CDATA[").append(payTableDescr).append("]]></paytable_descr>\r\n"); valueXmlString.append("<paytable_descr><![CDATA[").append(payTableDescr).append("]]></paytable_descr>\r\n");
//modified by Shital on 30/07/2019 [Start]
admCommon.setNodeValue(dom, "paytable_descr",payTableDescr);
//modified by Shital on 30/07/2019 [End]
} }
else else
{ {
valueXmlString.append("<paytable_descr><![CDATA[").append("").append("]]></paytable_descr>\r\n"); valueXmlString.append("<paytable_descr><![CDATA[").append("").append("]]></paytable_descr>\r\n");
//modified by Shital on 30/07/2019 [Start]
admCommon.setNodeValue(dom, "paytable_descr","");
//modified by Shital on 30/07/2019 [End]
} }
} }
valueXmlString.append("</Detail1>\r\n"); valueXmlString.append("</Detail1>\r\n");
break; break;
}//END OF SWITCH }//END OF SWITCH
}//END OF TRY }//END OF TRY
catch(Exception e) catch(Exception e)
{ {
//modified by Shital on 30/07/2019 [Start]
e.printStackTrace();
//modified by Shital on 30/07/2019 [End]
System.out.println("Exception in SiteStanPayTbl::"+ e.getMessage()); System.out.println("Exception in SiteStanPayTbl::"+ e.getMessage());
throw new ITMException(e); throw new ITMException(e);
} }
...@@ -722,10 +878,12 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -722,10 +878,12 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
conn.close(); conn.close();
conn = null; conn = null;
} }
} }
catch(Exception e1) catch(Exception e1)
{ {
//modified by Shital on 30/07/2019 [Start]
e1.printStackTrace();
//modified by Shital on 30/07/2019 [End]
System.out.println("Exception in SiteStanPayTbl::"+ e1.getMessage()); System.out.println("Exception in SiteStanPayTbl::"+ e1.getMessage());
throw new ITMException(e1); throw new ITMException(e1);
} }
...@@ -733,7 +891,6 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal ...@@ -733,7 +891,6 @@ public class SiteStanPayTbl extends ValidatorEJB implements SiteStanPayTblLocal
valueXmlString.append("</Root>\r\n"); valueXmlString.append("</Root>\r\n");
System.out.println("valueXmlString"+valueXmlString.toString()); System.out.println("valueXmlString"+valueXmlString.toString());
return valueXmlString.toString(); return valueXmlString.toString();
}//END OF ITEMCHANGE }//END OF ITEMCHANGE
private String checkNull( String input ) private String checkNull( String input )
......
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