Commit 0a29e4a3 authored by smestry's avatar smestry

W15FSUN008, Updated class file for Palletization and Palletization Confirm, as per requirment.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99278 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 27ee64a2
......@@ -8,6 +8,7 @@ package ibase.webitm.ejb.wms;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
......@@ -76,12 +77,22 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
System.out.println("xtraParams ::::::::::::: " + xtraParams);
System.out.println("tranId----------->>["+tranId+"]");
String objName = getObjNameFromDom( dom, "objName", "1" );
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength----------->>["+childNodeListLength+"]");
if("palletization".equalsIgnoreCase(objName))
{
System.out.println("Calling confirm for palletization :::::::::::::::::::: ");
confirm(tranId, siteCode, conn1);
}
else
{
tranIdList = getTranId(siteCode, conn1);
for (ctr = 0; ctr < childNodeListLength; ctr++)
......@@ -90,6 +101,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
childNodeName = childNode.getNodeName();
System.out.println("childNodeName ------->>["+childNodeName+"]");
if("tran_id".equalsIgnoreCase(childNodeName))
{
//System.out.println("Inside tran_id ::::::::::: ");
......@@ -100,6 +112,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else if(!tranIdList.contains(tranId) && tranId.length() > 0)
{
System.out.println("Tran Id does not exist in pallet hdr :::::::::: ");
......@@ -110,11 +123,13 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
if(tranIdList.contains(tranId))
{
System.out.println("Calling confirm :::::::::::::::::::: ");
System.out.println("Calling confirm for palletization confirm menu :::::::::::::::::::: ");
confirm(tranId, siteCode, conn1);
}
}
}
}
int errListSize = errList.size();
cnt =0;
......@@ -149,7 +164,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
}
else
{
errStringXml = new StringBuffer( "" );
return getError(tranId, "VTTRANCONF", conn1);
}
errString = errStringXml.toString();
}
......@@ -596,6 +611,53 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
}
}
private String getError(String tranId, String Code, Connection conn) throws ITMException, Exception
{
String mainStr ="";
try
{
String errString = "";
errString = new ITMDBAccessEJB().getErrorString("",Code,"","",conn);
String begPart = errString.substring(0,errString.indexOf("<message>")+9);
String endDesc = errString.substring(errString.indexOf("</description>"));
mainStr= begPart+"Transaction confirmed."+"</message><description>";
mainStr= mainStr+"Transaction confirmed for Transaction ID : ["+tranId+"]."+endDesc;
System.out.println("mainStr:::::::::::::::::: "+mainStr);
begPart = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return mainStr;
}
private String getObjNameFromDom( Document dom, String attribute, String objContext ) throws RemoteException,ITMException
{
NodeList detailList = null;
Node currDetail = null, reqDetail = null;
String objName = "";
int detailListLength = 0;
try
{
detailList = dom.getElementsByTagName("Detail"+objContext);
detailListLength = detailList.getLength();
for (int ctr = 0; ctr < detailListLength; ctr++)
{
currDetail = detailList.item(ctr);
objName = currDetail.getAttributes().getNamedItem(attribute).getNodeValue();
}
}
catch ( Exception e )
{
throw new ITMException(e);
}
return objName;
}
}
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