Commit b42c9304 authored by ssalve's avatar ssalve

Sarita : Committed on 08MARCH2019

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@198175 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f0fd0972
...@@ -4,14 +4,21 @@ import java.rmi.RemoteException; ...@@ -4,14 +4,21 @@ 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 java.sql.SQLException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.HashMap;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.w3c.dom.CDATASection;
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;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB; import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
@Stateless @Stateless
...@@ -20,7 +27,6 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -20,7 +27,6 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
ibase.utility.E12GenericUtility genericUtility= new ibase.utility.E12GenericUtility(); ibase.utility.E12GenericUtility genericUtility= new ibase.utility.E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
public String getData(String xmlString, String xmlString2, String xtraParams) throws RemoteException,ITMException public String getData(String xmlString, String xmlString2, String xtraParams) throws RemoteException,ITMException
{ {
String rtrStr = ""; String rtrStr = "";
...@@ -37,7 +43,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -37,7 +43,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
detailDom = genericUtility.parseString(xmlString2); detailDom = genericUtility.parseString(xmlString2);
} }
rtrStr = getData(headerDom, detailDom, xtraParams); rtrStr = getData(headerDom, detailDom, xtraParams);
System.out.println("Inside getDate returnString is :::"+rtrStr); System.out.println("Inside getDate returnString is 8888:::"+rtrStr);
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -110,7 +116,6 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -110,7 +116,6 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
errString = itmDBAccessEJB.getErrorString("","VSENVAR1","",userId,conn); errString = itmDBAccessEJB.getErrorString("","VSENVAR1","",userId,conn);
isError = true; isError = true;
return errString; return errString;
} }
if(lsAdTpaid != null && lsAdTpaid.trim().length() > 0 && (lsAdTpaid.equalsIgnoreCase("NULLFOUND"))) if(lsAdTpaid != null && lsAdTpaid.trim().length() > 0 && (lsAdTpaid.equalsIgnoreCase("NULLFOUND")))
...@@ -188,8 +193,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -188,8 +193,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
pstmt.close(); pstmt.close();
pstmt=null; pstmt=null;
} }
resultString = retTabSepStrBuff.toString(); resultString = retTabSepStrBuff.toString(); System.out.println("ResultString....." + resultString);
System.out.println("ResultString....." + resultString);
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -200,6 +204,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -200,6 +204,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
conn.rollback(); conn.rollback();
} }
catch(Exception d) {throw new ITMException(d);} catch(Exception d) {throw new ITMException(d);}
throw new ITMException(e);
} }
finally finally
{ {
...@@ -241,8 +246,10 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -241,8 +246,10 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
Document detailDom = null; Document detailDom = null;
Document headerDom = null; Document headerDom = null;
String retStr = ""; String retStr = "";
try try
{ {
System.out.println("xmlString ::: ["+xmlString+"] \t xmlString2 ["+xmlString2+"]");
if(xmlString != null && xmlString.trim().length() > 0) if(xmlString != null && xmlString.trim().length() > 0)
{ {
headerDom = genericUtility.parseString(xmlString); headerDom = genericUtility.parseString(xmlString);
...@@ -252,6 +259,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -252,6 +259,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
detailDom = genericUtility.parseString(xmlString2); detailDom = genericUtility.parseString(xmlString2);
} }
retStr = process(headerDom, detailDom, xtraParams); retStr = process(headerDom, detailDom, xtraParams);
System.out.println("Process forEmpITConfPrc ::"+retStr); System.out.println("Process forEmpITConfPrc ::"+retStr);
} }
catch (Exception e) catch (Exception e)
...@@ -260,12 +268,14 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -260,12 +268,14 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
return retStr; return retStr;
}//END OF PROCESS (1) }//END OF PROCESS (1)
public String process(Document headerDom, Document detailDom, String xtraParams) throws RemoteException,ITMException public String process(Document headerDom, Document detailDom, String xtraParams) throws Exception
{ {
String errString="",childNodeName="",employeeCode = "",accountPrd = ""; String errString="",childNodeName="",employeeCode = "",accountPrd = "";
String errorCode = "";
NodeList parentNodeList = null; NodeList parentNodeList = null;
NodeList childNodeList = null; NodeList childNodeList = null;
Node parentNode = null; Node parentNode = null;
...@@ -275,11 +285,21 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -275,11 +285,21 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
boolean isError = false; boolean isError = false;
String succstring = ""; String succstring = "";
String succLine = "Successfully processed IT confirmation for below employee's :"; String succLine = "Successfully processed IT confirmation for below employee's :";
int totConfRec = 0 , totRejRec = 0 , totFinRec = 0;
int hdrNoEmp = 0;
String retStr = "",errMsg = "";
try try
{ {
System.out.println("Inside process method [DETAIL DOM]"+genericUtility.serializeDom(detailDom)+"]"); setNodeValue(headerDom, "noof_confirmed", "0");
setNodeValue(headerDom, "noof_rejected", "0");
System.out.println("Inside process method [HEADER DOM]"+genericUtility.serializeDom(headerDom)+"\n Inside process method [DETAIL DOM]"+genericUtility.serializeDom(detailDom));
conn = getConnection(); conn = getConnection();
hdrNoEmp = Integer.valueOf(genericUtility.getColumnValue("no_employee",headerDom));
System.out.println("hdrNoEmp is === ["+hdrNoEmp+"]" );
parentNodeList = detailDom.getElementsByTagName("Detail2"); parentNodeList = detailDom.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength(); parentNodeListLength = parentNodeList.getLength();
cnt1 = getNumOfNonDelDetail(detailDom,2); cnt1 = getNumOfNonDelDetail(detailDom,2);
...@@ -290,6 +310,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -290,6 +310,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
return errString; return errString;
} }
System.out.println("9999["+genericUtility.serializeDom(headerDom)+"]");
for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++) for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++)
{ {
parentNode = parentNodeList.item(selectedRow); parentNode = parentNodeList.item(selectedRow);
...@@ -310,22 +331,23 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -310,22 +331,23 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
} }
System.out.println("employeeCode is ["+employeeCode+"] \t accountPrd is ["+accountPrd+"]"); System.out.println("employeeCode is ["+employeeCode+"] \t accountPrd is ["+accountPrd+"]");
} }
errString = gbfConfIt(accountPrd,employeeCode,xtraParams,conn); errorCode = gbfConfIt(accountPrd,employeeCode,xtraParams,conn);
System.out.println("errString is "+errString); System.out.println("Value returned from gbfConfIt Method ["+errorCode+"]");
if((errString !=null && errString.trim().length() > 0 ) && (!(errString.contains("VTSUCC1")))) if((errorCode !=null && errorCode.trim().length() > 0 ) && (!(errorCode.contains("VTSUCC1"))))
{ {
totConfRec = totConfRec + 1;
isError = false; isError = false;
succstring = succstring + employeeCode + "</br>"; }
}//end of if
else else
{ {
totRejRec = totRejRec + 1;
isError = true; isError = true;
return errString;
} }
setNodeValue(headerDom, "noof_confirmed", String.valueOf(totConfRec));
setNodeValue(headerDom, "noof_rejected", String.valueOf(totConfRec));
} }
succLine = succLine + succstring; System.out.println("Total Confirmed Count Values ["+totConfRec+"] \t Total Rejected Count Values ["+totRejRec+"] \t Total Selected Records ["+totFinRec+"] \n Final Return String ["+errString+"]");
errString = getErrorXml(succLine); totFinRec = totConfRec + totRejRec; System.out.println("totFinRec is ["+totFinRec+"]");
System.out.println("errString--["+errString+"]");
}//try end }//try end
catch(Exception e) catch(Exception e)
{ {
...@@ -339,9 +361,11 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -339,9 +361,11 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
{ {
throw new ITMException(d); throw new ITMException(d);
} }
throw new ITMException(e);
} }
finally finally
{ {
System.out.println("Closing Connection....");
try try
{ {
if(isError) if(isError)
...@@ -351,6 +375,9 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -351,6 +375,9 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
else else
{ {
conn.commit(); conn.commit();
}
if(conn != null)
{
conn.close(); conn.close();
conn = null; conn = null;
} }
...@@ -359,14 +386,16 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -359,14 +386,16 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
{ {
errString = e.getMessage(); errString = e.getMessage();
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e);
} }
} }
System.out.println("Error Message=>"+errString.toString()); System.out.println("FINAL ["+(errorCode)+"]");
return errString; errMsg = "\n noof_confirmed are ["+totConfRec+"] \n noof_rejected are ["+totRejRec+"]";
retStr = getError(errMsg,errorCode,conn);
return retStr;
}//END OF PROCESS(2) }//END OF PROCESS(2)
public String checkNullAndTrim( String inputVal ) private String checkNullAndTrim( String inputVal )
{ {
if ( inputVal == null ) if ( inputVal == null )
{ {
...@@ -379,20 +408,32 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -379,20 +408,32 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
return inputVal; return inputVal;
} }
public String gbfConfIt(String acctPrd , String empCode,String xtraParams,Connection conn) throws ITMException private java.sql.Time now()
{
return new java.sql.Time(System.currentTimeMillis());
}
private String gbfConfIt(String acctPrd , String empCode,String xtraParams,Connection conn) throws ITMException
{ {
String retString = ""; String retString = "";
String sql = "",loginEmpCode=""; String sql = "",loginEmpCode="";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
SimpleDateFormat sdf1 = null; SimpleDateFormat sdf1 = null;
java.sql.Timestamp currentDate = null,today = null; java.sql.Timestamp currentDate = null,today = null;
UtilMethods utilMethod = new UtilMethods();
try try
{ {
java.sql.Date todayDt = new java.sql.Date(System.currentTimeMillis());
System.out.println("13["+todayDt+"]");
/*currentDate = utilMethod.dateTime(utilMethod.todaySqlDate(),utilMethod.now());
System.out.println("Current Date is ==== ["+currentDate+"]");*/
today = new java.sql.Timestamp(System.currentTimeMillis()) ; today = new java.sql.Timestamp(System.currentTimeMillis()) ;
sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat()); sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
currentDate = java.sql.Timestamp.valueOf(sdf1.format(today) + " 00:00:00.000"); currentDate = java.sql.Timestamp.valueOf(sdf1.format(today) + " 00:00:00.000");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"); loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
System.out.println("loginEmpCode is ==="+loginEmpCode); System.out.println("loginEmpCode is ==="+loginEmpCode + "currentDate is ===" +currentDate);
sql = "update it_calchdr set confirmed = ? , emp_code__aprv = ?, conf_date = ? " sql = "update it_calchdr set confirmed = ? , emp_code__aprv = ?, conf_date = ? "
+ "where acct_prd = ? and emp_code = ?"; + "where acct_prd = ? and emp_code = ?";
...@@ -411,12 +452,37 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -411,12 +452,37 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
System.out.println("["+updateCnt+"] data updated in it_calchdr table"); System.out.println("["+updateCnt+"] data updated in it_calchdr table");
if(updateCnt > 0) if(updateCnt > 0)
{ {
retString = itmDBAccessEJB.getErrorString("","VPSUCC1","","",conn); //Added by sarita on 24 OCT 2018 to set Confirmed and rejected Records [START]
/* if (detlList != null)
{
for (int cntr = 0; cntr < detlList.getLength(); cntr++)
{
Element tblQty = detailDom.createElement("noof_confirmed");
tblQty.appendChild(detailDom.createTextNode(String.valueOf(updateCnt)));
detlList.item(cntr).appendChild(tblQty);
}
}
//Added by sarita on 24 OCT 2018 to set Confirmed and rejected Records [END]*/
//retString = itmDBAccessEJB.getErrorString("","VPSUCC1","","",conn);
retString = "VPSUCC1";
} }
else else
{ {
retString = itmDBAccessEJB.getErrorString("","DS000","","",conn); //retString = itmDBAccessEJB.getErrorString("","DS000","","",conn);
retString = "DS000";
} }
/*else
{
//Added by sarita on 24 OCT 2018 to set Confirmed and rejected Records [START]
for (int cntr = 0; cntr < detlList.getLength(); cntr++)
{
Element tblQty = detailDom.createElement("noof_rejected");
tblQty.appendChild(detailDom.createTextNode(String.valueOf(updateCnt)));
detlList.item(cntr).appendChild(tblQty);
}
//Added by sarita on 24 OCT 2018 to set Confirmed and rejected Records [END]
retString = itmDBAccessEJB.getErrorString("","DS000","","",conn);
}*/
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -429,6 +495,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -429,6 +495,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
catch(Exception d) { catch(Exception d) {
throw new ITMException(e); throw new ITMException(e);
} }
throw new ITMException(e);
} }
finally finally
{ {
...@@ -446,10 +513,10 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -446,10 +513,10 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
throw new ITMException(e); throw new ITMException(e);
} }
} }
return retString.toString(); return retString;
} }//end of Method gbfConfIt
public int getNumOfNonDelDetail(Document dom2,int detailNo) private int getNumOfNonDelDetail(Document dom2,int detailNo) throws ITMException
{ {
Node childNode = null; Node childNode = null;
NodeList updateList; NodeList updateList;
...@@ -464,10 +531,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -464,10 +531,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
for(int cnt = 0;cnt<detailNoteList.getLength();cnt++) for(int cnt = 0;cnt<detailNoteList.getLength();cnt++)
{ {
Node pNode=detailNoteList.item(cnt); Node pNode=detailNoteList.item(cnt);
/*NodeList cNodeList=pNode.getChildNodes();
childNodeListLength = cNodeList.getLength();*/
childNodeName = pNode.getNodeName(); childNodeName = pNode.getNodeName();
//System.out.println("pNode::["+pNode+"]"+"cNodeList::["+cNodeList+"]");
updateFlag = getAttributeVal(pNode,"updateFlag"); updateFlag = getAttributeVal(pNode,"updateFlag");
System.out.println("updateFlag [" + updateFlag + "]"); System.out.println("updateFlag [" + updateFlag + "]");
if(!updateFlag.equalsIgnoreCase("D")) if(!updateFlag.equalsIgnoreCase("D"))
...@@ -481,11 +545,12 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -481,11 +545,12 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
{ {
System.out.println("Exception : : getNumOfNonDelDetail :"+e); System.out.println("Exception : : getNumOfNonDelDetail :"+e);
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e);
} }
return cntr; return cntr;
} }//End of Method getNumOfNonDelDetail
public String getAttributeVal(Node dom, String attribName )throws ITMException private String getAttributeVal(Node dom, String attribName )throws ITMException
{ {
String AttribValue = null; String AttribValue = null;
try try
...@@ -512,108 +577,51 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI ...@@ -512,108 +577,51 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
throw new ITMException(e); throw new ITMException(e);
} }
return AttribValue; return AttribValue;
} }//End of Method getAttributeVal
public String getErrorXML(String message,String messageValue,String errorId, String traceInfo ,String type) throws RemoteException,ITMException
{
System.out.println("getErrorXML..........");
String errString = "";
try
{
errString = "";
StringBuffer valueXmlErrorString = new StringBuffer( "<?xml version=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n<Errors>\r\n" );
valueXmlErrorString.append("<error id=\"").append(errorId).append("\" type=\""+type+"\"").append(" column_name=\"description\"").append(">");
//valueXmlErrorString.append("<message><![CDATA[").append(message).append("]]></message>\r\n");
valueXmlErrorString.append("<message><![CDATA[").append(message).append("]]></message>\r\n");
valueXmlErrorString.append("<description><![CDATA[").append(messageValue).append("]]></description>\r\n");
valueXmlErrorString.append("<type>"+type+"</type>\r\n");
valueXmlErrorString.append("<option></option>\r\n");
valueXmlErrorString.append("<time></time>\r\n");
valueXmlErrorString.append("<alarm></alarm>\r\n");
valueXmlErrorString.append("<source></source>\r\n");
valueXmlErrorString.append("<trace>Error : "+traceInfo+" </trace>\r\n");
valueXmlErrorString.append("<redirect>1</redirect>\r\n");
valueXmlErrorString.append("</error>\r\n");
valueXmlErrorString.append("</Errors>\r\n");
valueXmlErrorString.append("</Header>\r\n");
valueXmlErrorString.append( "</Root>\r\n" );
System.out.println( "\n****valueXmlErrorString :" + valueXmlErrorString.toString() + ":********" );
errString =valueXmlErrorString.toString();
System.out.println("Modified error string"+errString); private static void setNodeValue( Document dom, String nodeName, String nodeVal ) throws Exception
}
catch (Exception ex)
{ {
ex.printStackTrace(); Node tempNode = dom.getElementsByTagName( nodeName ).item(0);
} System.out.println("tempNode is ["+tempNode+"]");
return errString; if( tempNode != null )
}
private String getErrorXml(String retXml)
{ {
System.out.println("retXml------["+ retXml + "]"); if( tempNode.getFirstChild() == null )
E12GenericUtility genericUtility = null;
NodeList parentNodeList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node childNode = null;
String childNodeName = "";
String message = "";
String description = "";
String errId = "";
String msgType = "";
int childNodeLength = 0;
int ctr=0;
try
{ {
if(retXml.indexOf("<root>") != -1 || retXml.indexOf("<Root>") != -1 ) CDATASection cDataSection = dom.createCDATASection( nodeVal );
{ tempNode.appendChild( cDataSection );
System.out.println("Inside root condition......"); System.out.println("tempNode is 1["+tempNode+"]");
genericUtility = new E12GenericUtility();
Document errDom = genericUtility.parseString(retXml);
parentNodeList = errDom.getElementsByTagName("root");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if("error".equalsIgnoreCase(childNodeName))
{
errId = childNode.getAttributes().getNamedItem("id").getNodeValue();
System.out.println("Error code -----["+ errId +"]");
msgType = childNode.getAttributes().getNamedItem("type").getNodeValue();
System.out.println("msgType--["+msgType+"]");
}
else if("message".equalsIgnoreCase(childNodeName))
{
message = genericUtility.getColumnValue("message", errDom);
System.out.println("message--["+message+"]");
} }
else if("description".equalsIgnoreCase(childNodeName)) else
{ {
description = genericUtility.getColumnValue("description", errDom); tempNode.getFirstChild().setNodeValue(nodeVal);
System.out.println("description--["+description+"]"); System.out.println("tempNode is 2["+tempNode+"]");
}
} }
retXml = getErrorXML(message, description, errId, "",msgType);
System.out.println("retXml----[" + retXml + "]");
} }
else tempNode = null;
}//End of Method setNodeValue
private String getError(String errMsg, String Code, Connection conn) throws ITMException, Exception
{ {
retXml = getErrorXML("Message", retXml, "VTCONFTRAN", "","P"); String mainStr ="";
} try
{
String errString = "";
errString = new ITMDBAccessEJB().getErrorString("",Code,"","",conn);
System.out.println("Origional ErrorString is =====> <"+errString+">");
String begPart = errString.substring(0,errString.indexOf("</description>"));
String endDesc = errString.substring(errString.indexOf("</description>"),errString.length());
System.out.println("begPart ["+begPart+"] \t endDesc ["+endDesc+"]");
mainStr = checkNullAndTrim(begPart) + errMsg + checkNullAndTrim(endDesc);
System.out.println("mainStr:::::::::::::::::: "+mainStr);
//begPart = null;
//mainStr = errString;
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception from getErrorXml---["+ e.getMessage() +"]");
e.printStackTrace(); e.printStackTrace();
return retXml; throw new ITMException(e);
} }
return retXml; return mainStr;
} }
//Added by sarita on 24 OCT 2018 to set Confirmed and rejected Records [END]
} }
\ No newline at end of file
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