Commit 2517721e authored by ngadkari's avatar ngadkari

Request ID-D17KGTP015 Change in existing stock transfer order and New screen...

Request ID-D17KGTP015 Change in existing stock transfer order and New screen for consumption and capitalization of material

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@181706 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3c94c9ae
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.naming.InitialContext;
import ibase.planner.utility.ITMException;
import ibase.system.config.AppConnectParm;
import ibase.webitm.ejb.MasterStatefulLocal;
import ibase.webitm.ejb.dis.*;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
public class AssetInstall {
E12GenericUtility genericUtility=new E12GenericUtility();
String tranId;
public String assetInstallData (String tranId,Connection conn,String xtraParams,ArrayList <String> assetInstallList)throws RemoteException, ITMException, SQLException, ibase.webitm.utility.ITMException
{
String userId,siteCode;
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
siteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
String resString= "";
try
{
System.out.println("-----------INSIDEassetInstallData------- ");
for (String eachtran:assetInstallList) {
resString= saveData( siteCode, eachtran ,userId, conn);
if( resString==null)
{
continue;
}
else {
return resString;
}
}
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception assetInstallData:==>");
throw new ITMException(e);
}
return resString;
}
private String saveData(String siteCode,String xmlString,String userId, Connection conn) throws ITMException
{
System.out.println("saving data...........");
InitialContext ctx = null;
String retString = null;
MasterStatefulLocal masterStateful = null; // for ejb3
try
{
AppConnectParm appConnect = new AppConnectParm();
ctx = new InitialContext(appConnect.getProperty());
masterStateful = (MasterStatefulLocal)ctx.lookup("ibase/MasterStatefulEJB/local");
System.out.println("-----------masterStateful------- " + masterStateful);
String [] authencate = new String[2];
authencate[0] = userId;
authencate[1] = "";
System.out.println("xmlString to masterstateful [" + xmlString + "]");
retString = masterStateful.processRequest(authencate, siteCode, true, xmlString,true,conn);
if (retString.indexOf("Success") > -1)
{
System.out.println("retString.indexOf(Success) > -1)");
String[] arrayForTranId = retString.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
tranId = arrayForTranId[1].substring(0,endIndex);
//retString ="";
System.out.println("@@@@@@3: retString ["+retString + "]");
System.out.println("Credit Note TranID------>>>["+tranId+"]");
if(tranId != null && tranId.trim().length() > 0)
{
System.out.println("tran_id generated successfully----------[" + tranId + "]");
retString = null;
}
}
}
catch(ITMException itme)
{
System.out.println("ITMException :AssetInstall :saveData :==>");
throw itme;
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception :AssetInstall :saveData :==>");
throw new ITMException(e);
}
return retString;
}
}
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