Commit 7734c976 authored by skumbhar's avatar skumbhar

Chandrakant component for SIP to commit when testing completed


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98331 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9efd75f5
package ibase.webitm.ejb.fin;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator;
import java.text.SimpleDateFormat;
import java.util.*;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.ejb.Stateless;
import java.sql.Timestamp;
@Stateless
public class SuppInfoUpdIC extends ValidatorEJB implements SuppInfoUpdICLocal, SuppInfoUpdICRemote
{
E12GenericUtility genericUtility = new E12GenericUtility();
CommonConstants commonConstants = new CommonConstants();
//method for validation
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
String errString = "";
System.out.println("wfValdata() called for SuppInfoAmdIC");
Document dom = null;
Document dom1 = null;
Document dom2 = null;
try
{
if (xmlString != null && xmlString.trim().length() > 0 )
{
dom = parseString(xmlString);
}
if (xmlString1 != null && xmlString1.trim().length() > 0 )
{
dom1 = parseString(xmlString1);
}
if (xmlString2 != null && xmlString2.trim().length() > 0 )
{
dom2 = parseString(xmlString2);
}
errString = wfValData(dom, dom1, dom2, objContext, editFlag, xtraParams);
}
catch(Exception e)
{
throw new ITMException(e);
}
return(errString);
}
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
String childNodeName = null;
String errString = "";
String errCode = "";
String userId = "";
String sql = "";
String errorType = "";
int cnt = 0;
int ctr=0;
int childNodeListLength;
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
Connection conn = null;
PreparedStatement pstmt = null ;
ResultSet rs = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
int currentFormNo =0,recCnt=0;
int noOfParent=0,ctr1=0;
int lineNoo = 0, count = 0, row = 0;
try
{
System.out.println("@@@@@@@@ SuppInfoAmdIC wfvaldata called");
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode");
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
switch(currentFormNo)
{
case 1 :
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("supp_code"))
{
}
} // end for
break; // case 1 end
}
int errListSize = errList.size();
cnt = 0;
String errFldName = null;
if(errList != null && errListSize > 0)
{
for(cnt = 0; cnt < errListSize; cnt ++)
{
errCode = errList.get(cnt);
errFldName = errFields.get(cnt);
System.out.println("errCode .........." + errCode);
errString = getErrorString(errFldName, errCode, userId);
errorType = errorType(conn , errCode);
if(errString.length() > 0)
{
String bifurErrString = errString.substring(errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>"));
bifurErrString = bifurErrString + errString.substring(errString.indexOf("</trace>") + 8, errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString);
errString = "";
}
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
errList.clear();
errList = null;
errFields.clear();
errFields = null;
errStringXml.append("</Errors> </Root> \r\n");
}
else
{
errStringXml = new StringBuffer("");
}
}
catch(Exception e)
{
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
finally
{
try
{
if(conn != null)
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
}
conn = null;
}
catch(Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
errString = errStringXml.toString();
return errString;
}//end of validation
private String isExist(String table, String field, String value,Connection conn) throws SQLException
{
String sql = "",retStr="";
PreparedStatement pstmt = null;
ResultSet rs = null ;
int cnt=0;
sql = " SELECT COUNT(1) FROM "+ table + " WHERE " + field + " = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,value);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt > 0)
{
retStr = "TRUE";
}
if( cnt == 0 )
{
retStr = "FALSE";
}
System.out.println("@@@@ isexist["+value+"]:::["+retStr+"]:::["+cnt+"]");
return retStr;
}
// method for item change
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
System.out.println("itemChanged() called for SuppInfoAmdIC");
String valueXmlString = "";
try
{
if(xmlString != null && xmlString.trim().length() > 0)
{
System.out.println("@@@@@@@@@@@@@@@ xmlString["+xmlString+"]");
dom = parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length() > 0)
{
// System.out.println("@@@@@@@@@@@@@@@ xmlString1["+xmlString1+"]");
dom1 = parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length() > 0)
{
// System.out.println("@@@@@@@@@@@@@@@ xmlString2["+xmlString2+"]");
dom2 = parseString(xmlString2);
}
valueXmlString = itemChanged(dom, dom1, dom2, objContext, currentColumn, editFlag, xtraParams);
}
catch(Exception e)
{
System.out.println("Exception : [SuppInfoAmdIC][itemChanged( String, String )] :==>\n" + e.getMessage());
}
return valueXmlString;
}
// method for item change
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
String childNodeName = null;
String sql = "";
StringBuffer valueXmlString = new StringBuffer();
int ctr = 0,cnt1 = 0,cnt=0;
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null ;
E12GenericUtility genericUtility = new E12GenericUtility();
ConnDriver connDriver = new ConnDriver();
int currentFormNo =0;
String columnValue="";
String tranId = "",suppCode ="",chqNameO ="",chqName ="",tele1O ="",tele1 ="",panNoO ="",siteCode="";
String panNo ="",exciseRefO ="",exciseRef ="",serTaxRegO ="",serTaxReg ="",taxRegO ="";
String taxReg ="",wfStatus ="",addUser = "",addTerm = "",chgUser = "",chgTerm = "";
Timestamp chgDate = null, statusDate = null, addDate = null, tranDate = null;
try
{
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String sysDate = sdf.format(currentDate.getTime());
System.out.println("Now the date is :=> " + sysDate);
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext.trim());
}
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>");
valueXmlString.append(editFlag).append("</editFlag> </header>");
System.out.println("**********ITEMCHANGE FOR CASE"+currentFormNo+"**************");
switch(currentFormNo)
{
case 1 :
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
ctr = 0;
valueXmlString.append("<Detail1>");
int childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equals(currentColumn))
{
if (childNode.getFirstChild()!= null)
{
columnValue = childNode.getFirstChild().getNodeValue().trim();
}
}
ctr++;
}
while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'");
if(currentColumn.trim().equalsIgnoreCase("itm_default"))
{
System.out.println("@@@@@@@@ itm_default called @@@@@@@@");
}
else if(currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{
System.out.println("@@@@@@@@ itm_defaultedit called @@@@@@@@");
chgTerm = getValueFromXTRA_PARAMS(xtraParams,"chgTerm");
chgUser = getValueFromXTRA_PARAMS(xtraParams,"chgUser");
System.out.println("@@@@@@@@@@@ chgTerm---"+chgTerm+"::::::::chgUser----"+chgUser+":::::");
suppCode = checkNull(genericUtility.getColumnValue("supp_code", dom));
System.out.println("@@@@@@@@ suppCode["+suppCode+"] @@@@@@@@");
sql = "select count(1) from supp_amd where supp_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,suppCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@@ cnt["+cnt+"]");
if( cnt > 0 )
{
sql = " Select TRAN_ID, TRAN_DATE, SUPP_CODE, CHQ_NAME_O, CHQ_NAME, TELE1_O, TELE1, PAN_NO_O, PAN_NO, " +
" EXCISE_REF_O, EXCISE_REF, SER_TAX_REG_O, SER_TAX_REG, TAX_REG_O , TAX_REG, WF_STATUS, " +
" STATUS_DATE , ADD_DATE , ADD_USER , ADD_TERM , CHG_DATE , CHG_USER , CHG_TERM " +
" from supp_amd where supp_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,suppCode);
rs = pstmt.executeQuery();
if(rs.next())
{
tranId = checkNull(rs.getString("TRAN_ID"));
suppCode = rs.getString("SUPP_CODE");
tranDate = rs.getTimestamp("TRAN_DATE");
chqNameO = rs.getString("CHQ_NAME_O");
chqName = rs.getString("CHQ_NAME");
tele1O = rs.getString("TELE1_O");
tele1 = rs.getString("TELE1");
panNoO = rs.getString("PAN_NO_O");
panNo = rs.getString("PAN_NO");
exciseRefO = rs.getString("EXCISE_REF_O");
exciseRef = rs.getString("EXCISE_REF");
serTaxRegO = rs.getString("SER_TAX_REG_O");
serTaxReg = rs.getString("SER_TAX_REG");
taxRegO = rs.getString("TAX_REG_O");
taxReg = rs.getString("TAX_REG");
wfStatus = rs.getString("WF_STATUS");
statusDate = rs.getTimestamp("STATUS_DATE");
addDate = rs.getTimestamp("ADD_DATE");
addUser = rs.getString("ADD_USER");
addTerm = rs.getString("ADD_TERM");
//chgDate = rs.getTimestamp("CHG_DATE");
//chgUser = rs.getString("CHG_USER");
//chgTerm = rs.getString("CHG_TERM");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<tran_id protect = \"1\" >").append("<![CDATA["+tranId+"]]>").append("</tran_id>");
valueXmlString.append("<tran_date protect = \"1\" >").append("<![CDATA["+tranDate+"]]>").append("</tran_date>");
valueXmlString.append("<supp_code protect = \"1\" >").append("<![CDATA["+suppCode+"]]>").append("</supp_code>");
valueXmlString.append("<chq_name protect = \"0\" >").append("<![CDATA["+chqName+"]]>").append("</chq_name>");
valueXmlString.append("<chq_name_o protect = \"1\" >").append("<![CDATA["+chqNameO+"]]>").append("</chq_name_o>");
valueXmlString.append("<tele1 protect = \"0\" >").append("<![CDATA["+tele1+"]]>").append("</tele1>");
valueXmlString.append("<tele1_o protect = \"1\" >").append("<![CDATA["+tele1O+"]]>").append("</tele1_o>");
valueXmlString.append("<pan_no protect = \"0\" >").append("<![CDATA["+panNo+"]]>").append("</pan_no>");
valueXmlString.append("<pan_no_o protect = \"1\" >").append("<![CDATA["+panNoO+"]]>").append("</pan_no_o>");
valueXmlString.append("<excise_ref protect = \"0\" >").append("<![CDATA["+exciseRef+"]]>").append("</excise_ref>");
valueXmlString.append("<excise_ref_o protect = \"1\" >").append("<![CDATA["+exciseRefO+"]]>").append("</excise_ref_o>");
valueXmlString.append("<ser_tax_reg protect = \"0\" >").append("<![CDATA["+serTaxReg+"]]>").append("</ser_tax_reg>");
valueXmlString.append("<ser_tax_reg_o protect = \"1\" >").append("<![CDATA["+serTaxRegO+"]]>").append("</ser_tax_reg_o>");
valueXmlString.append("<tax_reg protect = \"0\" >").append("<![CDATA["+taxReg+"]]>").append("</tax_reg>");
valueXmlString.append("<tax_reg_o protect = \"1\" >").append("<![CDATA["+taxRegO+"]]>").append("</tax_reg_o>");
valueXmlString.append("<wf_status protect = \"0\" >").append("<![CDATA["+wfStatus+"]]>").append("</wf_status>");
valueXmlString.append("<status_date protect = \"1\" >").append("<![CDATA["+statusDate+"]]>").append("</status_date>");
valueXmlString.append("<add_date protect = \"1\" >").append("<![CDATA["+addDate+"]]>").append("</add_date>");
valueXmlString.append("<add_user protect = \"1\" >").append("<![CDATA["+addUser+"]]>").append("</add_user>");
valueXmlString.append("<add_term protect = \"1\" >").append("<![CDATA["+addTerm+"]]>").append("</add_term>");
valueXmlString.append("<chg_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</chg_date>");
valueXmlString.append("<chg_user protect = \"1\" >").append("<![CDATA["+chgUser+"]]>").append("</chg_user>");
valueXmlString.append("<chg_term protect = \"1\" >").append("<![CDATA["+chgTerm+"]]>").append("</chg_term>");
}
else
{
// suppCode = checkNull(getCurrentSuppCode(dom.getElementsByTagName("Detail1").item(0)));
suppCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "entityCode" );
System.out.println("@@@@@@@@@ suppCode["+suppCode+"]");
String keyString="",keyCol="",tranSer1="";
sql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE lower(TRAN_WINDOW) = 'w_supp_info_amd' ";
System.out.println("keyStringQuery--------->>"+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
keyString = rs.getString(1);
keyCol = rs.getString(2);
tranSer1 = rs.getString(3);
}
rs.close();
rs=null;
pstmt.close();
pstmt =null;
System.out.println("keyString :"+ keyString);
System.out.println("keyCol :"+ keyCol);
System.out.println("tranSer1 :"+ tranSer1);
// System.out.println("woirType :"+ woirType);
String xmlValues = "";
String tranDateStr = getCurrdateAppFormat();
xmlValues ="<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>";
xmlValues = xmlValues + "<Header></Header>";
xmlValues = xmlValues + "<Detail1>";
xmlValues = xmlValues + "<tran_id></tran_id>";
xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>";
// xmlValues = xmlValues + "<woir_type>" + woirType + "</woir_type>";
xmlValues = xmlValues + "<tran_date>" + tranDateStr + "</tran_date>";
xmlValues = xmlValues +"</Detail1></Root>";
System.out.println("xmlValues :["+xmlValues+"]");
TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", commonConstants.DB_NAME);
tranId = tg.generateTranSeqID(tranSer1, keyCol, keyString, conn);
System.out.println("@@@@ generated tranId :["+tranId+"]");
sql = " select supp_code, chq_name, tele1,pan_no,excise_ref,ser_tax_reg,tax_reg " +
" from supplier where supp_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,suppCode);
rs = pstmt.executeQuery();
if(rs.next())
{
suppCode = checkNull(rs.getString("supp_code"));
chqName = checkNull(rs.getString("chq_name"));
tele1 = checkNull(rs.getString("tele1"));
panNo = checkNull(rs.getString("pan_no"));
exciseRef = checkNull(rs.getString("excise_ref"));
serTaxReg = checkNull(rs.getString("ser_tax_reg"));
taxReg = checkNull(rs.getString("tax_reg"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " insert into supp_amd ( tran_id, supp_code , chq_name_o, tele1_o,pan_no_o,excise_ref_o,ser_tax_reg_o," +
"tax_reg_o ) values (?,?,?,?,?,?,?,? ) ";
System.out.println("sql :"+sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
pstmt.setString(2,suppCode);
pstmt.setString(3,chqName);
pstmt.setString(4,tele1);
pstmt.setString(5,panNo);
pstmt.setString(6,exciseRef);
pstmt.setString(7,serTaxReg);
pstmt.setString(8,taxReg);
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
if( cnt>0)
{
System.out.println("@@@@@@ rec inserted ["+cnt+"]conn.commit()");
conn.commit();
}
}
valueXmlString.append("<tran_id protect = \"1\" >").append("<![CDATA["+tranId+"]]>").append("</tran_id>");
valueXmlString.append("<tran_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</tran_date>");
valueXmlString.append("<supp_code protect = \"1\" >").append("<![CDATA["+suppCode+"]]>").append("</supp_code>");
valueXmlString.append("<chq_name protect = \"0\" >").append("<![CDATA["+chqName+"]]>").append("</chq_name>");
valueXmlString.append("<chq_name_o protect = \"1\" >").append("<![CDATA["+chqName+"]]>").append("</chq_name_o>");
valueXmlString.append("<tele1 protect = \"0\" >").append("<![CDATA["+tele1+"]]>").append("</tele1>");
valueXmlString.append("<tele1_o protect = \"1\" >").append("<![CDATA["+tele1+"]]>").append("</tele1_o>");
valueXmlString.append("<pan_no protect = \"0\" >").append("<![CDATA["+panNo+"]]>").append("</pan_no>");
valueXmlString.append("<pan_no_o protect = \"1\" >").append("<![CDATA["+panNo+"]]>").append("</pan_no_o>");
valueXmlString.append("<excise_ref protect = \"0\" >").append("<![CDATA["+exciseRef+"]]>").append("</excise_ref>");
valueXmlString.append("<excise_ref_o protect = \"1\" >").append("<![CDATA["+exciseRef+"]]>").append("</excise_ref_o>");
valueXmlString.append("<ser_tax_reg protect = \"0\" >").append("<![CDATA["+serTaxReg+"]]>").append("</ser_tax_reg>");
valueXmlString.append("<ser_tax_reg_o protect = \"1\" >").append("<![CDATA["+serTaxReg+"]]>").append("</ser_tax_reg_o>");
valueXmlString.append("<tax_reg protect = \"0\" >").append("<![CDATA["+taxReg+"]]>").append("</tax_reg>");
valueXmlString.append("<tax_reg_o protect = \"1\" >").append("<![CDATA["+taxReg+"]]>").append("</tax_reg_o>");
valueXmlString.append("<wf_status protect = \"0\" >").append("O").append("</wf_status>");
valueXmlString.append("<status_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</status_date>");
valueXmlString.append("<add_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</add_date>");
valueXmlString.append("<add_user protect = \"1\" >").append("<![CDATA["+chgUser+"]]>").append("</add_user>");
valueXmlString.append("<add_term protect = \"1\" >").append("<![CDATA["+chgTerm+"]]>").append("</add_term>");
valueXmlString.append("<chg_date protect = \"1\" >").append("<![CDATA["+sysDate+"]]>").append("</chg_date>");
valueXmlString.append("<chg_user protect = \"1\" >").append("<![CDATA["+chgUser+"]]>").append("</chg_user>");
valueXmlString.append("<chg_term protect = \"1\" >").append("<![CDATA["+chgTerm+"]]>").append("</chg_term>");
}
// case 1 end
valueXmlString.append("</Detail1>");
break;
}
valueXmlString.append("</Root>");
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception ::"+ e.getMessage());
throw new ITMException(e);
}
finally
{
try
{
if(conn != null)
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
}
conn = null;
}
catch(Exception d)
{
d.printStackTrace();
}
}
return valueXmlString.toString();
}
private String setDescription(String descr, String table,String field, String value,Connection conn) throws SQLException
{
PreparedStatement pstmt = null;
ResultSet rs = null ;
String sql="";
System.out.println("@@@@@@@@table["+table+"]:::field["+field+"]::value["+value+"]");
sql = "select "+ descr +" from "+ table +" where " + field + " = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, value);
rs = pstmt.executeQuery();
if(rs.next())
{
descr = checkNull( rs.getString(1));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.print("========>::descr["+descr+"]");
return descr;
}
private String checkNull(String input)
{
if(input == null)
{
input = "";
}
return input;
}
private String getCurrdateAppFormat()
{
String s = "";
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
java.util.Date date = null;
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
System.out.println(genericUtility.getDBDateFormat());
SimpleDateFormat simpledateformat = new SimpleDateFormat(genericUtility.getDBDateFormat());
date = simpledateformat.parse(timestamp.toString());
timestamp = Timestamp.valueOf(simpledateformat.format(date).toString() + " 00:00:00.0");
s = (new SimpleDateFormat(genericUtility.getApplDateFormat())).format(timestamp).toString();
}
catch(Exception exception)
{
System.out.println("Exception in getCurrdateAppFormat " + exception.getMessage());
}
return s;
}
private String getCurrentSuppCode(Node currDetail)
{
NodeList currDetailList = null;
String entityCode = "", nodeName = "";
int currDetailListLength = 0;
currDetailList = currDetail.getChildNodes();
currDetailListLength = currDetailList.getLength();
for (int i = 0; i < currDetailListLength; i++)
{
nodeName = currDetailList.item(i).getNodeName();
System.out.println("@@@@@@@@@@@@@@ nodeName["+nodeName+"]");
if (nodeName.equalsIgnoreCase("entityCode"))
{
entityCode = currDetailList.item(i).getFirstChild().getNodeValue();
System.out.println("@@@@@@@@@@@@@@ entityCode["+entityCode+"]");
break;
}
}
System.out.println("@@@@@@@@@@@@@@ entityCode["+entityCode+"]");
return entityCode;
}
private String errorType(Connection conn , String errorCode)
{
String msgType = "";
PreparedStatement pstmt = null ;
ResultSet rs = null;
try
{
String sql = "SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,errorCode);
rs = pstmt.executeQuery();
while(rs.next())
{
msgType = checkNull( rs.getString("MSG_TYPE"));
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
return msgType;
}
}
\ No newline at end of file
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local;
@Local
public interface SuppInfoUpdICLocal extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, 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;
}
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
@Remote
public interface SuppInfoUpdICRemote extends ValidatorRemote
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, 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;
}
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