Commit 1920f27f authored by mkhan's avatar mkhan

generate and xtraparam in schedular for loginsite chguser chgterm


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91167 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 931fa618
...@@ -44,7 +44,7 @@ public class FinChargeCalcPrc implements Schedule ...@@ -44,7 +44,7 @@ public class FinChargeCalcPrc implements Schedule
//String addlValue = ""; //String addlValue = "";
Timestamp frDate = null ,currDate=null,addlValueTm =null;//addlValue = null; Timestamp frDate = null ,currDate=null,addlValueTm =null;//addlValue = null;
SimpleDateFormat currAppdate = null; SimpleDateFormat currAppdate = null;
String lsFromdateStr ="",siteCode = "",retString="",xtraParams="",despid = "",addlValueMinFin="",varValueMinFin="",addlValueStr="",frDateStr = ""; String lsFromdateStr ="",siteCode = "",retString="",despid = "",addlValueMinFin="",varValueMinFin="",addlValueStr="",frDateStr = "";
Timestamp lsFromdateDt = null,dateValue = null,addlValue=null; Timestamp lsFromdateDt = null,dateValue = null,addlValue=null;
ArrayList paramListArr = new ArrayList(); ArrayList paramListArr = new ArrayList();
double timdifferance = 0.00; double timdifferance = 0.00;
...@@ -52,6 +52,7 @@ public class FinChargeCalcPrc implements Schedule ...@@ -52,6 +52,7 @@ public class FinChargeCalcPrc implements Schedule
filterString = new StringBuffer(); filterString = new StringBuffer();
StringTokenizer stringTokenizer = null; StringTokenizer stringTokenizer = null;
String varName = ""; String varName = "";
String chgUse = "";
try try
{ {
if( conn == null ) if( conn == null )
...@@ -60,7 +61,7 @@ public class FinChargeCalcPrc implements Schedule ...@@ -60,7 +61,7 @@ public class FinChargeCalcPrc implements Schedule
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false); conn.setAutoCommit(false);
} }
//System.out.println(" scheduleParamXML [" + scheduleParamXML + "]"); System.out.println(" scheduleParamXML [" + scheduleParamXML + "]");
Document userInfoDom = new ibase.utility.GenericUtility().parseString( scheduleParamXML ); Document userInfoDom = new ibase.utility.GenericUtility().parseString( scheduleParamXML );
NodeList paramList = userInfoDom.getElementsByTagName( "SCHEDULE" ); NodeList paramList = userInfoDom.getElementsByTagName( "SCHEDULE" );
Node currDetail = null ; Node currDetail = null ;
...@@ -70,7 +71,17 @@ public class FinChargeCalcPrc implements Schedule ...@@ -70,7 +71,17 @@ public class FinChargeCalcPrc implements Schedule
{ {
currDetail = paramList.item(paramCnt); currDetail = paramList.item(paramCnt);
siteCode = currDetail.getAttributes().getNamedItem("id").getNodeValue(); siteCode = currDetail.getAttributes().getNamedItem("id").getNodeValue();
} }
//start code 08/10/09
chgUse = userInfoDom.getElementsByTagName( "loginCode" ).item(0).getFirstChild().getNodeValue();
//System.out.println("loginCodeBase>>>"+loginCodeBase);
//end code 08/10/09
// code to be migrate for itmdefault // code to be migrate for itmdefault
java.sql.Timestamp drnoteDate = new java.sql.Timestamp( System.currentTimeMillis() ); java.sql.Timestamp drnoteDate = new java.sql.Timestamp( System.currentTimeMillis() );
drnoteDateStr = genericUtility.getValidDateString(drnoteDate.toString(),genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat()); drnoteDateStr = genericUtility.getValidDateString(drnoteDate.toString(),genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat());
...@@ -228,6 +239,8 @@ public class FinChargeCalcPrc implements Schedule ...@@ -228,6 +239,8 @@ public class FinChargeCalcPrc implements Schedule
// end of code // end of code
//sql = "select site_code from site " ; //sql = "select site_code from site " ;
//sql= "select * from disAUTONEARCHARGESITE //sql= "select * from disAUTONEARCHARGESITE
String xtraParams = getXtraParams( userInfoDom , siteCode , conn );
System.out.println("xtraParams"+xtraParams);
sql = " SELECT VAR_VALUE FROM FINPARM WHERE PRD_CODE='999999' AND VAR_NAME='AUTOFINCHARGESITE' " ; sql = " SELECT VAR_VALUE FROM FINPARM WHERE PRD_CODE='999999' AND VAR_NAME='AUTOFINCHARGESITE' " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -258,7 +271,9 @@ public class FinChargeCalcPrc implements Schedule ...@@ -258,7 +271,9 @@ public class FinChargeCalcPrc implements Schedule
filterString.append("\n"); filterString.append("\n");
System.out.println("frDateStr>>>2>>>>>"+frDateStr); System.out.println("frDateStr>>>2>>>>>"+frDateStr);
System.out.println("Data sent ["+filterString.toString() + "]"); System.out.println("Data sent ["+filterString.toString() + "]");
retString = callNvo( filterString.toString(), "finance_charge_calc", "pr_default_1", conn ); // added chgUse in callNvo() on 08/10/09 for xtrapram
retString = callNvo( filterString.toString(), "finance_charge_calc", "pr_default_1",xtraParams, conn );
// end
filterString.setLength(0); filterString.setLength(0);
} }
...@@ -270,7 +285,7 @@ public class FinChargeCalcPrc implements Schedule ...@@ -270,7 +285,7 @@ public class FinChargeCalcPrc implements Schedule
return ""; return "";
} // end of schedule } // end of schedule
public String callNvo( String filterData, String objName, String serviceCode, Connection conn ) throws ITMException public String callNvo( String filterData, String objName, String serviceCode,String xtraParams , Connection conn ) throws ITMException
{ {
String methodName = ""; String methodName = "";
...@@ -278,7 +293,7 @@ public class FinChargeCalcPrc implements Schedule ...@@ -278,7 +293,7 @@ public class FinChargeCalcPrc implements Schedule
String serviceURI = ""; String serviceURI = "";
String actionURI = ""; String actionURI = "";
String selectSql = ""; String selectSql = "";
String businessObj = "",xtraParams = ""; String businessObj = "";
PreparedStatement pStmt = null; PreparedStatement pStmt = null;
ResultSet rs = null; ResultSet rs = null;
try try
...@@ -384,4 +399,60 @@ public class FinChargeCalcPrc implements Schedule ...@@ -384,4 +399,60 @@ public class FinChargeCalcPrc implements Schedule
} }
return timestamp; return timestamp;
} }
private String getXtraParams(Document userInfoDom ,String siteCode , Connection conn )throws Exception
{
StringBuffer xtraParamsBuff = new StringBuffer();
PreparedStatement pstmt =null;
ResultSet rs = null;
String XTRA_PARAMS_SEPARATOR = "~~";
String loginCode="",loginEmpCode="",loginSiteCode="",entityCode="",profileId="",userType="";
String runMode="",chgTerm="",chgUser="",remoteHost="",sql="", charEnc="";
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);
pstmt.setString(1,loginCode);
//pstmt.setString(2,siteCode);
//pstmt.setString(3,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
loginEmpCode = rs.getString("emp_code")==null?"":rs.getString("emp_code");
entityCode = rs.getString("entity_code")==null?"":rs.getString("entity_code");
profileId = rs.getString("PROFILE_ID")==null?"":rs.getString("PROFILE_ID");
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;
rs.close();
rs=null;
xtraParamsBuff.append("loginCode=" + loginCode);
xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("loginEmpCode=" + loginEmpCode);
xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("loginSiteCode=" + siteCode);
xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("entityCode=" + entityCode);
xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("profileId=" + profileId);
xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("userType=" + userType);
xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("runMode=I");
//xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("user_lang=" + this.user_lang);
//xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("user_country=" + this.user_country);
xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("charEnc=" +charEnc );
xtraParamsBuff.append(XTRA_PARAMS_SEPARATOR).append("termId="+remoteHost);
// 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