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;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import javax.ejb.Stateless;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
@Stateless
......@@ -20,7 +27,6 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
ibase.utility.E12GenericUtility genericUtility= new ibase.utility.E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
public String getData(String xmlString, String xmlString2, String xtraParams) throws RemoteException,ITMException
{
String rtrStr = "";
......@@ -37,7 +43,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
detailDom = genericUtility.parseString(xmlString2);
}
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)
{
......@@ -47,12 +53,12 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
}
return rtrStr;
}//END OF GETDATA(1)
public String getData(Document headerDom, Document detailDom, String xtraParams) throws RemoteException,ITMException
{
String resultString = "", errString= "";
String lsFrEmp = "",lsToEmp = "",lsFrSite = "",lsToSite = "",lsProcfr = "",lsProcto = "",
lsAdTtax = "",lsAdTpaid = "",lsPrd = "",userId = "";
lsAdTtax = "",lsAdTpaid = "",lsPrd = "",userId = "";
ResultSet rs = null;
PreparedStatement pstmt = null;
boolean isError = false;
......@@ -63,7 +69,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
{
System.out.println("Inside getData method ");
conn = getConnection();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
lsPrd = checkNullAndTrim(genericUtility.getColumnValue("acct_prd",headerDom));
lsFrEmp = checkNullAndTrim(genericUtility.getColumnValue("emp_code__fr",headerDom));
......@@ -72,7 +78,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
lsToSite = checkNullAndTrim(genericUtility.getColumnValue("site_code__to",headerDom));
lsProcfr = checkNullAndTrim(genericUtility.getColumnValue("proc_group__from",headerDom));
lsProcto = checkNullAndTrim(genericUtility.getColumnValue("proc_group__to",headerDom));
if(lsFrEmp == null || lsFrEmp.trim().length() == 0)
{
lsFrEmp = "0";
......@@ -100,54 +106,53 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
{
lsProcto = "ZZZZZ";
}
lsAdTtax = objAdmCommon.getEnv("999999","IYEAR",conn);
lsAdTpaid = objAdmCommon.getEnv("999999","IPAYABLE",conn);
System.out.println("Value of lsAdTtax ["+lsAdTtax+"] \t Value of lsAdTpaid ["+lsAdTpaid+"]");
if((lsAdTtax != null && lsAdTtax.trim().length() > 0) && (lsAdTtax.equalsIgnoreCase("NULLFOUND")))
{
errString = itmDBAccessEJB.getErrorString("","VSENVAR1","",userId,conn);
isError = true;
return errString;
}
if(lsAdTpaid != null && lsAdTpaid.trim().length() > 0 && (lsAdTpaid.equalsIgnoreCase("NULLFOUND")))
{
errString = itmDBAccessEJB.getErrorString("","VSENVAR1","",userId,conn);
isError = true;
return errString;
}
StringBuffer retTabSepStrBuff = new StringBuffer("<?xml version = \"1.0\"?>");
retTabSepStrBuff.append("<DocumentRoot>");
retTabSepStrBuff.append("<description>").append("Datawindow Root").append("</description>");
retTabSepStrBuff.append("<group0>");
retTabSepStrBuff.append("<description>").append("Group0 description").append("</description>");
retTabSepStrBuff.append("<Header0>");
sql = "select itcalhdr.acct_prd , " +
"employee.emp_code , " +
"employee.emp_fname || ' ' || employee.emp_mname || ' ' || employee.emp_lname as emp_name, " +
"employee.pay_site as site_code, " +
"employee.proc_group as proc_group, " +
"case when itcaldet1.amount is null then 0 else itcaldet1.amount end as itax, " +
"case when itcaldet2.amount is null then 0 else itcaldet2.amount end as taxpaid, " +
"(case when itcaldet1.amount is null then 0 else itcaldet1.amount end - case when itcaldet2.amount is null then 0 else itcaldet2.amount end) as itpayable " +
"from IT_CALCHDR itcalhdr, EMPLOYEE employee , IT_CALCDET itcaldet1 , IT_CALCDET itcaldet2 " +
"where (itcalhdr.emp_code = employee.emp_code) " +
"and itcalhdr.acct_prd = ? " +
"and case when itcalhdr.confirmed is null then 'N' else itcalhdr.confirmed end <> 'Y' " +
"and employee.emp_code between ? and ? " +
"and employee.pay_site between ? and ? " +
"and employee.proc_group between ? and ? " +
"and itcaldet1.emp_code = employee.emp_code " +
"and itcaldet1.acct_prd = ? " +
"and itcaldet1.ad_code = ? " +
"and itcaldet2.emp_code = employee.emp_code " +
"and itcaldet2.acct_prd = ? " +
"and itcaldet2.ad_code = ?";
sql = "select itcalhdr.acct_prd , " +
"employee.emp_code , " +
"employee.emp_fname || ' ' || employee.emp_mname || ' ' || employee.emp_lname as emp_name, " +
"employee.pay_site as site_code, " +
"employee.proc_group as proc_group, " +
"case when itcaldet1.amount is null then 0 else itcaldet1.amount end as itax, " +
"case when itcaldet2.amount is null then 0 else itcaldet2.amount end as taxpaid, " +
"(case when itcaldet1.amount is null then 0 else itcaldet1.amount end - case when itcaldet2.amount is null then 0 else itcaldet2.amount end) as itpayable " +
"from IT_CALCHDR itcalhdr, EMPLOYEE employee , IT_CALCDET itcaldet1 , IT_CALCDET itcaldet2 " +
"where (itcalhdr.emp_code = employee.emp_code) " +
"and itcalhdr.acct_prd = ? " +
"and case when itcalhdr.confirmed is null then 'N' else itcalhdr.confirmed end <> 'Y' " +
"and employee.emp_code between ? and ? " +
"and employee.pay_site between ? and ? " +
"and employee.proc_group between ? and ? " +
"and itcaldet1.emp_code = employee.emp_code " +
"and itcaldet1.acct_prd = ? " +
"and itcaldet1.ad_code = ? " +
"and itcaldet2.emp_code = employee.emp_code " +
"and itcaldet2.acct_prd = ? " +
"and itcaldet2.ad_code = ?";
System.out.println("sql..."+ sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,lsPrd );
......@@ -175,7 +180,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
retTabSepStrBuff.append("<itpayable>").append("<![CDATA[" + rs.getString("itpayable") + "]]>").append("</itpayable>\r\n");
retTabSepStrBuff.append("</Detail2>");
}
retTabSepStrBuff.append("</Header0>\r\n");
retTabSepStrBuff.append("</Header0>\r\n");
retTabSepStrBuff.append("</group0>\r\n");
retTabSepStrBuff.append("</DocumentRoot>\r\n");
if(rs != null)
......@@ -188,8 +193,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
pstmt.close();
pstmt=null;
}
resultString = retTabSepStrBuff.toString();
System.out.println("ResultString....." + resultString);
resultString = retTabSepStrBuff.toString(); System.out.println("ResultString....." + resultString);
}
catch (Exception e)
{
......@@ -200,6 +204,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
conn.rollback();
}
catch(Exception d) {throw new ITMException(d);}
throw new ITMException(e);
}
finally
{
......@@ -235,14 +240,16 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
}
return resultString;
}//END OF GETDATA(2)
public String process(String xmlString, String xmlString2, String xtraParams) throws RemoteException,ITMException
{
Document detailDom = null;
Document headerDom = null;
String retStr = "";
try
{
System.out.println("xmlString ::: ["+xmlString+"] \t xmlString2 ["+xmlString2+"]");
if(xmlString != null && xmlString.trim().length() > 0)
{
headerDom = genericUtility.parseString(xmlString);
......@@ -252,6 +259,7 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
detailDom = genericUtility.parseString(xmlString2);
}
retStr = process(headerDom, detailDom, xtraParams);
System.out.println("Process forEmpITConfPrc ::"+retStr);
}
catch (Exception e)
......@@ -260,12 +268,14 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
e.printStackTrace();
throw new ITMException(e);
}
return retStr;
}//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 errorCode = "";
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
......@@ -273,13 +283,23 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
int parentNodeListLength = 0 , childNodeListLength = 0,cnt1 = 0;
Connection conn = null;
boolean isError = false;
String succstring = "";
String succstring = "";
String succLine = "Successfully processed IT confirmation for below employee's :";
int totConfRec = 0 , totRejRec = 0 , totFinRec = 0;
int hdrNoEmp = 0;
String retStr = "",errMsg = "";
try
{
System.out.println("Inside process method [DETAIL DOM]"+genericUtility.serializeDom(detailDom)+"]");
conn = getConnection();
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();
hdrNoEmp = Integer.valueOf(genericUtility.getColumnValue("no_employee",headerDom));
System.out.println("hdrNoEmp is === ["+hdrNoEmp+"]" );
parentNodeList = detailDom.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength();
cnt1 = getNumOfNonDelDetail(detailDom,2);
......@@ -289,7 +309,8 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
errString = itmDBAccessEJB.getErrorString("","VTBLNKDTL","","",conn);
return errString;
}
System.out.println("9999["+genericUtility.serializeDom(headerDom)+"]");
for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++)
{
parentNode = parentNodeList.item(selectedRow);
......@@ -309,23 +330,24 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
accountPrd = childNode.getFirstChild().getNodeValue();
}
System.out.println("employeeCode is ["+employeeCode+"] \t accountPrd is ["+accountPrd+"]");
}
errString = gbfConfIt(accountPrd,employeeCode,xtraParams,conn);
System.out.println("errString is "+errString);
if((errString !=null && errString.trim().length() > 0 ) && (!(errString.contains("VTSUCC1"))))
}
errorCode = gbfConfIt(accountPrd,employeeCode,xtraParams,conn);
System.out.println("Value returned from gbfConfIt Method ["+errorCode+"]");
if((errorCode !=null && errorCode.trim().length() > 0 ) && (!(errorCode.contains("VTSUCC1"))))
{
totConfRec = totConfRec + 1;
isError = false;
succstring = succstring + employeeCode + "</br>";
}//end of if
}
else
{
totRejRec = totRejRec + 1;
isError = true;
return errString;
}
setNodeValue(headerDom, "noof_confirmed", String.valueOf(totConfRec));
setNodeValue(headerDom, "noof_rejected", String.valueOf(totConfRec));
}
succLine = succLine + succstring;
errString = getErrorXml(succLine);
System.out.println("errString--["+errString+"]");
System.out.println("Total Confirmed Count Values ["+totConfRec+"] \t Total Rejected Count Values ["+totRejRec+"] \t Total Selected Records ["+totFinRec+"] \n Final Return String ["+errString+"]");
totFinRec = totConfRec + totRejRec; System.out.println("totFinRec is ["+totFinRec+"]");
}//try end
catch(Exception e)
{
......@@ -339,9 +361,11 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
{
throw new ITMException(d);
}
throw new ITMException(e);
}
finally
{
System.out.println("Closing Connection....");
try
{
if(isError)
......@@ -351,22 +375,27 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
else
{
conn.commit();
}
if(conn != null)
{
conn.close();
conn = null;
}
}
}
catch(Exception e)
{
errString = e.getMessage();
e.printStackTrace();
throw new ITMException(e);
}
}
System.out.println("Error Message=>"+errString.toString());
return errString;
System.out.println("FINAL ["+(errorCode)+"]");
errMsg = "\n noof_confirmed are ["+totConfRec+"] \n noof_rejected are ["+totRejRec+"]";
retStr = getError(errMsg,errorCode,conn);
return retStr;
}//END OF PROCESS(2)
public String checkNullAndTrim( String inputVal )
private String checkNullAndTrim( String inputVal )
{
if ( inputVal == null )
{
......@@ -378,24 +407,36 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
}
return inputVal;
}
private java.sql.Time now()
{
return new java.sql.Time(System.currentTimeMillis());
}
public String gbfConfIt(String acctPrd , String empCode,String xtraParams,Connection conn) throws ITMException
private String gbfConfIt(String acctPrd , String empCode,String xtraParams,Connection conn) throws ITMException
{
String retString = "";
String sql = "",loginEmpCode="";
PreparedStatement pstmt = null;
SimpleDateFormat sdf1 = null;
java.sql.Timestamp currentDate = null,today = null;
UtilMethods utilMethod = new UtilMethods();
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()) ;
sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
currentDate = java.sql.Timestamp.valueOf(sdf1.format(today) + " 00:00:00.000");
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 = ? "
+ "where acct_prd = ? and emp_code = ?";
+ "where acct_prd = ? and emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,"Y");
pstmt.setString(2,loginEmpCode);
......@@ -410,13 +451,38 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
}
System.out.println("["+updateCnt+"] data updated in it_calchdr table");
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
{
retString = itmDBAccessEJB.getErrorString("","DS000","","",conn);
else
{
//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)
{
......@@ -427,8 +493,9 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
conn.rollback();
}
catch(Exception d) {
throw new ITMException(e);
throw new ITMException(e);
}
throw new ITMException(e);
}
finally
{
......@@ -446,10 +513,10 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
throw new ITMException(e);
}
}
return retString.toString();
}
public int getNumOfNonDelDetail(Document dom2,int detailNo)
return retString;
}//end of Method gbfConfIt
private int getNumOfNonDelDetail(Document dom2,int detailNo) throws ITMException
{
Node childNode = null;
NodeList updateList;
......@@ -463,11 +530,8 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
NodeList detailNoteList = dom2.getElementsByTagName("Detail"+detailNo);
for(int cnt = 0;cnt<detailNoteList.getLength();cnt++)
{
Node pNode=detailNoteList.item(cnt);
/*NodeList cNodeList=pNode.getChildNodes();
childNodeListLength = cNodeList.getLength();*/
Node pNode=detailNoteList.item(cnt);
childNodeName = pNode.getNodeName();
//System.out.println("pNode::["+pNode+"]"+"cNodeList::["+cNodeList+"]");
updateFlag = getAttributeVal(pNode,"updateFlag");
System.out.println("updateFlag [" + updateFlag + "]");
if(!updateFlag.equalsIgnoreCase("D"))
......@@ -481,11 +545,12 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
{
System.out.println("Exception : : getNumOfNonDelDetail :"+e);
e.printStackTrace();
throw new ITMException(e);
}
return cntr;
}
public String getAttributeVal(Node dom, String attribName )throws ITMException
}//End of Method getNumOfNonDelDetail
private String getAttributeVal(Node dom, String attribName )throws ITMException
{
String AttribValue = null;
try
......@@ -512,108 +577,51 @@ public class EmpITConfPrc extends ProcessEJB implements EmpITConfPrcLocal,EmpI
throw new ITMException(e);
}
return AttribValue;
}
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();
}//End of Method getAttributeVal
System.out.println("Modified error string"+errString);
}
catch (Exception ex)
{
ex.printStackTrace();
}
return errString;
}
private String getErrorXml(String retXml)
private static void setNodeValue( Document dom, String nodeName, String nodeVal ) throws Exception
{
System.out.println("retXml------["+ retXml + "]");
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
Node tempNode = dom.getElementsByTagName( nodeName ).item(0);
System.out.println("tempNode is ["+tempNode+"]");
if( tempNode != null )
{
if(retXml.indexOf("<root>") != -1 || retXml.indexOf("<Root>") != -1 )
if( tempNode.getFirstChild() == null )
{
System.out.println("Inside root condition......");
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))
{
description = genericUtility.getColumnValue("description", errDom);
System.out.println("description--["+description+"]");
}
}
retXml = getErrorXML(message, description, errId, "",msgType);
System.out.println("retXml----[" + retXml + "]");
CDATASection cDataSection = dom.createCDATASection( nodeVal );
tempNode.appendChild( cDataSection );
System.out.println("tempNode is 1["+tempNode+"]");
}
else
{
retXml = getErrorXML("Message", retXml, "VTCONFTRAN", "","P");
}
tempNode.getFirstChild().setNodeValue(nodeVal);
System.out.println("tempNode is 2["+tempNode+"]");
}
}
tempNode = null;
}//End of Method setNodeValue
private String getError(String errMsg, String Code, Connection conn) throws ITMException, Exception
{
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)
{
System.out.println("Exception from getErrorXml---["+ e.getMessage() +"]");
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