Commit 0d6156cc authored by manohar's avatar manohar

change done by Navin at SU merged


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91326 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b7a3ffa8
/*******************************************
Title ExpiryProcess
Developed Date 3/9/2009
Modified By Ashwin on 05-Aug-10
// For Getting Processing Sites from Schedulers ActualParameter Instead of DISPARM
********************************************/
package ibase.webitm.ejb.sys;
import java.util.*;
......@@ -33,6 +34,7 @@ public class ExpiryProcess implements Schedule
}
public String schedule( String scheduleParamXML )throws RemoteException, ITMException
{
System.out.println("\n\n\n\n\n ::::::::::::::::::: ExpiryProcess :::::::::::::::::::::::");
PreparedStatement pstmt = null ;
ResultSet rs = null ;
Connection conn=null;
......@@ -54,7 +56,6 @@ public class ExpiryProcess implements Schedule
StringTokenizer stringTokenizer = null;
String varName = "";
double timdifferance = 0.00;
try
{
......@@ -75,6 +76,36 @@ public class ExpiryProcess implements Schedule
currDetail = paramList.item(paramCnt);
siteCode = currDetail.getAttributes().getNamedItem("id").getNodeValue();
}
//----- Changes Start By Ashwin On 05-Aug-10 - Begin
NodeList parentNodeList = null,childNodeList = null;
Node parentNode = null,childNode = null;
String DisparmSites = "";
int childNodeListLength = 0;
String childNodeName = null;
parentNodeList = userInfoDom.getElementsByTagName("ACTUALPARAMETERS");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(int ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName!=null && !"#text".equalsIgnoreCase(childNodeName))
{
if(ctr==0)
{
DisparmSites=childNode.getFirstChild().getNodeValue();
}
}
}
System.out.println("\n\n :::: Disparm Sites["+DisparmSites+"]");
//----- Changes End By Ashwin On 05-Aug-10 - End
// code to be migrate
java.sql.Timestamp drnoteDate = new java.sql.Timestamp( System.currentTimeMillis() );
drnoteDateStr = genericUtility.getValidDateString(drnoteDate.toString(),genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat());
......@@ -125,7 +156,10 @@ public class ExpiryProcess implements Schedule
pstmt = null;
// end of code
//sql = "select site_code from site " ;
sql = " SELECT VAR_VALUE FROM DISPARM WHERE PRD_CODE='999999' AND VAR_NAME = 'AUTONEARCHARGESITE' " ;
//-- Commented By Ashwin On 05-Aug-10 - Begin
// So as to get Sites from scheduler ActualParameter Instead of DISPLARM
/*sql = " SELECT VAR_VALUE FROM DISPARM WHERE PRD_CODE='999999' AND VAR_NAME = 'AUTONEARCHARGESITE' " ;
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -137,9 +171,12 @@ public class ExpiryProcess implements Schedule
rs=null;
pstmt = null;
stringTokenizer = new StringTokenizer(varName ,",");
*/
//Changes Done by Ashwin On 05-Aug-10 - End
stringTokenizer = new StringTokenizer(DisparmSites ,",");
while(stringTokenizer.hasMoreElements())
{
filterString.append(stringTokenizer.nextToken()).append("\t");
filterString.append(drnoteDateStr).append("\t");
filterString.append("00").append("\t");
......@@ -165,18 +202,15 @@ public class ExpiryProcess implements Schedule
retString = callNvo( fltrArg.toString(), "near_expiry", "pr_default_1", conn );
filterString.setLength(0);
}
}
catch(Exception e)
{
e.printStackTrace();
}
return "";
} // end of schedule
public String callNvo( String filterData, String objName, String serviceCode, Connection conn ) throws ITMException
{
String methodName = "";
String retString = "";
String serviceURI = "";
......@@ -218,13 +252,13 @@ public class ExpiryProcess implements Schedule
serviceURI = rs.getString( "SERVICE_URI" );
methodName = rs.getString( "METHOD_NAME" );
}
actionURI = "http://NvoServiceurl.org/" + methodName;
actionURI = "http://NvoServiceurl.org/"+methodName;
System.out.println("\n actionURI :: "+actionURI);
Service service = new Service();
Call call = ( Call )service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
call.setOperationName( new javax.xml.namespace.QName( "http://NvoServiceurl.org", methodName ) );
call.setOperationName( new javax.xml.namespace.QName("http://NvoServiceurl.org", methodName ) );
call.setUseSOAPAction(true);
call.setSOAPActionURI(actionURI);
Object[] aobj = new Object[4];
......@@ -262,13 +296,10 @@ public class ExpiryProcess implements Schedule
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{ e.printStackTrace();}
}
return retString ;
}
}
\ No newline at end of file
/*******************************************
Developed Date 3/9/2009
Modified By Ashwin on 05-Aug-10
// For Getting Processing Sites from Scheduler's ActualParameter Instead of FINPARM
********************************************/
package ibase.webitm.ejb.sys;
import java.util.*;
......@@ -27,10 +27,13 @@ public class FinChargeCalcPrc implements Schedule
ibase.utility.GenericUtility genericUtility = new ibase.utility.GenericUtility();
public String schedule( HashMap map )throws RemoteException, ITMException
{
return "";
}
public String schedule( String scheduleParamXML )throws RemoteException, ITMException
{
System.out.println("\n\n::::: FinChargeCalcPrc ::::::::: ");
System.out.println("\n\n::::: INside scheduleParamXML [" + scheduleParamXML + "]");
PreparedStatement pstmt = null ;
ResultSet rs = null ;
Connection conn=null;
......@@ -63,6 +66,37 @@ public class FinChargeCalcPrc implements Schedule
}
System.out.println(" scheduleParamXML [" + scheduleParamXML + "]");
Document userInfoDom = new ibase.utility.GenericUtility().parseString( scheduleParamXML );
//----- Changes Start By Ashwin 31/07/10 - Begin
NodeList parentNodeList = null,childNodeList = null;
Node parentNode = null,childNode = null;
String finSites = "";
int childNodeListLength = 0;
String childNodeName = null;
parentNodeList = userInfoDom.getElementsByTagName("ACTUALPARAMETERS");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(int ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName!=null && !"#text".equalsIgnoreCase(childNodeName))
{
if(ctr==0)
{
finSites=childNode.getFirstChild().getNodeValue();
}
}
}
System.out.println("\n\n :::: finSites["+finSites+"]");
//----- Changes End By Ashwin 31/07/10 - End
NodeList paramList = userInfoDom.getElementsByTagName( "SCHEDULE" );
Node currDetail = null ;
int noOfParam = paramList.getLength();
......@@ -77,9 +111,6 @@ public class FinChargeCalcPrc implements Schedule
chgUse = userInfoDom.getElementsByTagName( "loginCode" ).item(0).getFirstChild().getNodeValue();
//System.out.println("loginCodeBase>>>"+loginCodeBase);
//end code 08/10/09
// code to be migrate for itmdefault
......@@ -240,7 +271,8 @@ public class FinChargeCalcPrc implements Schedule
//sql = "select site_code from site " ;
//sql= "select * from disAUTONEARCHARGESITE
String xtraParams = getXtraParams( userInfoDom , siteCode , conn );
System.out.println("xtraParams"+xtraParams);
System.out.println("xtraParams...\n"+xtraParams);
/*Changes Done By ashwin on 31/07/10 - Begin
sql = " SELECT VAR_VALUE FROM FINPARM WHERE PRD_CODE='999999' AND VAR_NAME='AUTOFINCHARGESITE' " ;
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
......@@ -252,7 +284,12 @@ public class FinChargeCalcPrc implements Schedule
pstmt.close();
rs=null;
pstmt = null;
stringTokenizer = new StringTokenizer(varName ,",");
stringTokenizer = new StringTokenizer(varName ,",");*/
//Changes Done By ashwin on31/07/10 - End
//So as to get Sites from scheduler ActualParameter Instead of FINPARM
stringTokenizer = new StringTokenizer(finSites ,",");
//Changes Done By ashwin on 7/31/2010
while(stringTokenizer.hasMoreElements())
{
filterString.append(stringTokenizer.nextToken()).append("\t");
......@@ -276,18 +313,15 @@ public class FinChargeCalcPrc implements Schedule
// end
filterString.setLength(0);
}
}
catch(Exception e)
{
e.printStackTrace();
}
return "";
} // end of schedule
public String callNvo( String filterData, String objName, String serviceCode,String xtraParams , Connection conn ) throws ITMException
{
String methodName = "";
String retString = "";
String serviceURI = "";
......@@ -298,7 +332,6 @@ public class FinChargeCalcPrc implements Schedule
ResultSet rs = null;
try
{
//businessObj = "nvo_bo_finance_charge_calc";
selectSql = "SELECT comp_name FROM SYSTEM_EVENTS WHERE OBJ_NAME = ? AND service_code = ? ";
//System.out.println("\nselectSql :: "+selectSql);
......@@ -310,7 +343,7 @@ public class FinChargeCalcPrc implements Schedule
{
businessObj = rs.getString( "comp_name" );
}
System.out.println("\businessObj :: "+businessObj);
System.out.println("\n businessObj :: ["+businessObj+"]");
rs.close();
rs=null;
pStmt.close();
......@@ -329,15 +362,15 @@ public class FinChargeCalcPrc implements Schedule
rs=null;
pStmt.close();
pStmt = null;
System.out.println("\n serviceURI :: "+serviceURI);
System.out.println("\n methodName :: "+methodName);
actionURI = "http://NvoServiceurl.org/" + methodName;
System.out.println("\n actionURI :: "+actionURI);
System.out.println("\n serviceURI :: ["+serviceURI+"]");
System.out.println("\n methodName :: ["+methodName+"]");
actionURI = "http://NvoServiceurl.org/"+methodName;
System.out.println("\n actionURI :: ["+actionURI+"]");
Service service = new Service();
Call call = ( Call )service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
call.setOperationName( new javax.xml.namespace.QName( "http://NvoServiceurl.org", methodName ) );
call.setOperationName( new javax.xml.namespace.QName("http://NvoServiceurl.org", methodName ) );
call.setUseSOAPAction(true);
call.setSOAPActionURI(actionURI);
Object[] aobj = new Object[4];
......@@ -365,7 +398,7 @@ public class FinChargeCalcPrc implements Schedule
{
try
{
if (pStmt != null )
if(pStmt != null )
{
pStmt.close();
pStmt = null;
......@@ -411,9 +444,6 @@ public class FinChargeCalcPrc implements Schedule
loginCode = userInfoDom.getElementsByTagName( "loginCode" ).item(0).getFirstChild().getNodeValue();
charEnc = userInfoDom.getElementsByTagName( "charEnc" ).item(0).getFirstChild().getNodeValue();
remoteHost = userInfoDom.getElementsByTagName( "remoteHost" ).item(0).getFirstChild().getNodeValue();
System.out.println("remoteHost"+remoteHost);
System.out.println("charEnc"+charEnc);
System.out.println("loginCode"+loginCode);
sql="select emp_code,entity_code,profile_id,user_type,chg_term,chg_user from users where code = ? ";
pstmt=conn.prepareStatement(sql);
......@@ -429,9 +459,6 @@ public class FinChargeCalcPrc implements Schedule
userType = rs.getString("USER_TYPE")==null?"":rs.getString("USER_TYPE");
chgTerm = rs.getString("CHG_TERM")==null?"":rs.getString("CHG_TERM");
chgUser = rs.getString("CHG_USER")==null?"":rs.getString("CHG_USER");
}
pstmt.close();
pstmt=null;
......@@ -452,7 +479,5 @@ public class FinChargeCalcPrc implements Schedule
// changes by madhup 10/02/07
xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("chgTerm=" + chgTerm);
return xtraParamsBuff.toString();
}
}
\ 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