Commit 3b177ffb authored by ngadkari's avatar ngadkari

NEW Rec_Pay transaction screen

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191269 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 50f92c0e
......@@ -29,7 +29,205 @@ public class PayRecXfrIC extends ValidatorEJB implements PayRecXfrICRemote, PayR
E12GenericUtility genericUtility = new E12GenericUtility();
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String retString = "";
try
{
if(xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length() > 0)
{
dom1 = genericUtility.parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length() > 0)
{
dom2 = genericUtility.parseString(xmlString2);
}
retString = wfValData(dom, dom1, dom2, objContext, editFlag, xtraParams);
System.out.println("retString:::"+retString);
}
catch(Exception e)
{
System.out.println("Exception in PayRecXfrIC wfValData :: " + getClass().getSimpleName() + "::"+ e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
return retString;
}
/**
* The public overloaded method takes a document as input and is used for the validation of required fields
* Returns validation string if exist otherwise returns null in XML format
* @param currFormDataDom contains the current form data as a document object model
* @param hdrDataDom contains all the header information
* @param allFormDataDom contains the field data of all the forms
* @param objContext represents form number
* @param editFlag represents the mode of transaction(A-Add or E-Edit)
* @param xtraParams contains additional information such as loginEmpCode,loginCode,chgTerm etc
*/
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
System.out.println("******* Inside PayRecXfrIC wfValData **********");
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
Connection conn = null;
E12GenericUtility genericUtility;
String errString = "", userId = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
try
{
int currentFormNo = 0, childNodeListLength = 0, ctr = 0, cnt = 0;
String childNodeName = "", errorType = "", errCode = "";
String saleOrder="", sundryCodeFr = "",sundryCodeTo = "";
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
conn = getConnection();
genericUtility = new E12GenericUtility();
//SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
//System.out.println("xtraParam----->>["+xtraParams+"]");
//System.out.println("editFlag ------------>>["+editFlag+"]");
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("sundry_code__fr"))
{
sundryCodeFr = checkNull(genericUtility.getColumnValue("sundry_code__fr", dom));
if (sundryCodeFr == null || sundryCodeFr.trim().length() == 0)
{
errList.add("VTSUPPNULL");
errFields.add(childNodeName.toLowerCase());
}
else if (sundryCodeFr != null && sundryCodeFr.trim().length() > 0)
{
sql = "SELECT COUNT(*) AS cnt FROM SUPPLIER WHERE SUPP_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sundryCodeFr);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
if (cnt == 0)
{
errList.add("VMSUP1");
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("sundry_code__to"))
{
sundryCodeFr = checkNull(genericUtility.getColumnValue("sundry_code__fr", dom));
sundryCodeTo = checkNull(genericUtility.getColumnValue("sundry_code__to", dom));
if (sundryCodeTo == null || sundryCodeTo.trim().length() == 0)
{
errList.add("VTSUPPNULL");
errFields.add(childNodeName.toLowerCase());
}
else if (!sundryCodeTo.trim().equals(sundryCodeFr.trim()))
{
errList.add("VMSUPPMIS");
errFields.add(childNodeName.toLowerCase());
}
}
//end
}//end of for loop
break;// end of switch
}// end of switch
int errListSize = errList.size();
int count = 0;
String errFldName = null;
if (errList != null && errListSize > 0)
{
for (count = 0; count < errListSize; count++) {
errCode = errList.get(count);
errFldName = errFields.get(count);
System.out.println(" testing :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 )
{
System.out.println ( "Exception: RecPayXfrIC: wfValData( Document currFormDataDom ): " + e.getMessage() + ":" );
e.printStackTrace();
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);
}
}
return errStringXml.toString();
}
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
......@@ -110,9 +308,9 @@ public class PayRecXfrIC extends ValidatorEJB implements PayRecXfrICRemote, PayR
System.out.println("----------- inside itm_default ---------------");
valueXmlString.append("<site_code>").append("<![CDATA[" + loginSite + "]]>").append("</site_code>");
valueXmlString.append("<tran_date>").append("<![CDATA[" + dateNow + "]]>").append("</tran_date>");
valueXmlString.append("<sundry_code__fr>").append("<![CDATA[" + ("00") + "]]>").append("</sundry_code__fr>");
/*valueXmlString.append("<sundry_code__fr>").append("<![CDATA[" + ("00") + "]]>").append("</sundry_code__fr>");
valueXmlString.append("<sundry_code__to>").append("<![CDATA[" + ("ZZ") + "]]>").append("</sundry_code__to>");
*/
}
valueXmlString.append("</Detail1>");
......
This diff is collapsed.
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import javax.ejb.Local;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
@Local
public interface RecPayTrfICLocal 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 javax.ejb.Remote;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
@Remote
public interface RecPayTrfICRemote 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;
}
This diff is collapsed.
package ibase.webitm.ejb.fin.adv;
import java.rmi.RemoteException;
import javax.ejb.Local;
import ibase.webitm.ejb.ActionHandlerLocal;
import ibase.webitm.utility.ITMException;
@Local
public interface RecPayTrfConfLocal extends ActionHandlerLocal
{
public String confirm(String tranID, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.fin.adv;
import java.rmi.RemoteException;
import javax.ejb.Remote;
import ibase.webitm.ejb.ActionHandlerRemote;
import ibase.webitm.utility.ITMException;
@Remote
public interface RecPayTrfConfRemote extends ActionHandlerRemote
{
public String confirm(String tranID, String xtraParams, String forcedFlag) 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