Commit 08cb1b57 authored by ysawant's avatar ysawant

Changes done as per Framework and SRD in Loan Sheme Int rate

LoanSchemeIntRate.java
LoanSchemeIntRatePrs.java
d_loanscheme_int_rate21.srd
w_loanscheme_int_rate.sql


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204573 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ca7a9463
......@@ -6,14 +6,15 @@ import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
/**
......@@ -23,7 +24,6 @@ import ibase.webitm.utility.ITMException;
* CCF / Req ID : F16ASUN014
*
*/
@Stateless
public class LoanSchemeIntRate extends ValidatorEJB implements LoanSchemeIntRateLocal , LoanSchemeIntRateRemote
{
public String wfValData() throws RemoteException,ITMException
......@@ -38,12 +38,6 @@ public class LoanSchemeIntRate extends ValidatorEJB implements LoanSchemeIntRate
Document dom2 = null;
E12GenericUtility genericUtility = new E12GenericUtility();
String errString = "";
System.out.println( "LoanScheme:::wfValData:value of xmlString ["+xmlString+"]" );
System.out.println( "LoanScheme:::wfValDatavalue of xmlString1 ["+xmlString1+"]" );
System.out.println( "LoanScheme:::wfValDatavalue of xmlString2 ["+xmlString2+"]" );
System.out.println( "LoanScheme:::wfValData:objContext ..:: ["+objContext+"]" );
System.out.println( "LoanScheme:::wfValData:editFlag ..:: ["+editFlag+"]" );
System.out.println( "LoanScheme:::wfValData:xtraparams ..:: ["+xtraParams+"]" );
try
{
if( xmlString != null && xmlString.trim().length() != 0 )
......@@ -75,7 +69,6 @@ public class LoanSchemeIntRate extends ValidatorEJB implements LoanSchemeIntRate
{
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
......@@ -95,11 +88,17 @@ public class LoanSchemeIntRate extends ValidatorEJB implements LoanSchemeIntRate
float intRate = 0.0f;
java.util.Date currEffFromDate = null, currValidUptoDate = null;
Timestamp currEffFromTmstp = null;
ITMDBAccessEJB itmDbAcess=null;
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB( "DriverITM" );
//Modified by Yashwant on 12/07/2019[Start]
//ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB( "DriverITM" );
conn=getConnection();
itmDbAcess = new ITMDBAccessEJB();
//Modified by Yashwant on 12/07/2019[End]
userId = getValueFromXTRA_PARAMS( xtraParams,"loginCode" );
E12GenericUtility genericUtility = new E12GenericUtility();
......@@ -331,7 +330,12 @@ public class LoanSchemeIntRate extends ValidatorEJB implements LoanSchemeIntRate
errCode = (String) errList.get(i);
errFldName = (String) errFields.get(i);
System.out.println("LoanScheme:::wfValData:errListSize:::::::errCode .........."+errCode);
errString = getErrorString( errFldName, errCode, userId );
//Modified by Yashwant on 12/07/2019[Start]
//errString = getErrorString( errFldName, errCode, userId );
errString = itmDbAcess.getErrorString(errFldName, errCode, userId, "", conn);
//Modified by Yashwant on 12/07/2019[End]
System.out.println("LoanScheme:::wfValData:errListSize:::::::errString is : ::::>>>> " + errString);
msgType = errorType( conn , errCode );
if ( errString.length() > 0 )
......@@ -392,13 +396,6 @@ public class LoanSchemeIntRate extends ValidatorEJB implements LoanSchemeIntRate
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
System.out.println( "LoanScheme:::itemChanged:::value of xmlString ["+xmlString+"]" );
System.out.println( "LoanScheme:itemChanged:::value of xmlString ["+xmlString1+"]" );
System.out.println( "LoanScheme:itemChanged:::value of xmlString ["+xmlString2+"]" );
System.out.println( "LoanScheme:::itemChanged:::objContext ..:: ["+objContext+"]" );
System.out.println( "LoanScheme:::itemChanged:::currentColumn ..:: ["+currentColumn+"]" );
System.out.println( "LoanScheme:::itemChanged:::editFlag ..:: ["+editFlag+"]" );
if ( xmlString != null && xmlString.trim().length() != 0 )
{
dom = genericUtility.parseString( xmlString );
......@@ -440,8 +437,11 @@ public class LoanSchemeIntRate extends ValidatorEJB implements LoanSchemeIntRate
}
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB( "Driver" );
//Modified by Yashwant on 12/07/2019[Start]
//ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB( "Driver" );
conn=getConnection();
//Modified by Yashwant on 12/07/2019[End]
E12GenericUtility genericUtility = new E12GenericUtility();
valueXmlString = new StringBuffer( "<?xml version=\"1.0\"?><Root><header><editFlag>" );
valueXmlString.append(editFlag).append( "</editFlag></header>" );
......@@ -458,7 +458,8 @@ public class LoanSchemeIntRate extends ValidatorEJB implements LoanSchemeIntRate
{
schemeType = checkNull( genericUtility.getColumnValue( "scheme_type", dom ) );
sql = "SELECT DDF_GENCODE_DESC('SCHEME_TYPE','W_LOANSCHEME_INT_RATE',?, '') AS SCHEMETYPE_DESCR FROM DUAL";
pstmt = conn.prepareStatement( sql );
System.out.println("sql-------------"+sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString( 1, schemeType );
rs = pstmt.executeQuery();
if( rs.next() )
......
......@@ -7,8 +7,10 @@ import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.ejb.Stateless;
//import javax.ejb.Stateless;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.utility.E12GenericUtility;
import ibase.webitm.utility.ITMException;
......@@ -20,7 +22,7 @@ import ibase.webitm.utility.ITMException;
* Date : 29.04.2016
*
*/
@Stateless
public class LoanSchemeIntRatePrs extends ValidatorEJB implements LoanSchemeIntRatePrsLocal , LoanSchemeIntRatePrsRemote
{
public String preSave()throws RemoteException,ITMException
......@@ -41,6 +43,8 @@ public class LoanSchemeIntRatePrs extends ValidatorEJB implements LoanSchemeIntR
Timestamp calEffFromTmstp = null , effFromTmstp = null;
boolean errFound = false;
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
try
{
......@@ -50,22 +54,31 @@ public class LoanSchemeIntRatePrs extends ValidatorEJB implements LoanSchemeIntR
}
System.out.println( "LoanSchemePrs:::preSave:Inside presave event" );
SimpleDateFormat sdf = new SimpleDateFormat( genericUtility.getApplDateFormat() );
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if( "A".equalsIgnoreCase( editFlag ) )
{
effFromStr = checkNull( genericUtility.getColumnValue("eff_from", dom) );
schemeType = checkNull( genericUtility.getColumnValue("scheme_type", dom) );
System.out.println("effFromStr-------------------"+effFromStr);
System.out.println("schemeType-------------------"+schemeType);
if( effFromStr.length() > 0 )
{
System.out.println("effFromStr---------------------"+effFromStr.length());
try
{
effFromStrDate = sdf.parse( effFromStr );
effFromTmstp = java.sql.Timestamp.valueOf( genericUtility.getValidDateTimeString( effFromStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat() ) );
effFromTmstp = java.sql.Timestamp.valueOf( genericUtility.getValidDateTimeString( effFromStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()));
System.out.println("effFromStrDate---------------------"+effFromStrDate);
System.out.println("effFromTmstp---------------------"+effFromTmstp);
}
catch(Exception e)
{
errString = getErrorString("" , "VTLOANSCH8" , userId);
//Modified by Yashwant on 12/07/2019[Start]
//errString = getErrorString("" , "VTLOANSCH8" , userId);
errString=itmDBAccess.getErrorString("", "VTLOANSCH8", userId,"", conn);
//Modified by Yashwant on 12/07/2019[End]
}
sql = "SELECT COUNT(*) AS ROWCOUNT FROM LOANSCHEME_INT_RATE WHERE SCHEME_TYPE = ? AND ? BETWEEN EFF_FROM AND VALID_UPTO";
pstmt = conn.prepareStatement( sql ) ;
......@@ -77,12 +90,14 @@ public class LoanSchemeIntRatePrs extends ValidatorEJB implements LoanSchemeIntR
validUptoDtCnt = rs.getInt("ROWCOUNT");
}
close( pstmt, rs );
if( validUptoDtCnt > 0 )
System.out.println("validUptoDtCnt-----------------["+validUptoDtCnt+"]");
if(validUptoDtCnt > 0 )
{
System.out.println("validUptoDtCnt-----------------"+validUptoDtCnt);
if( effFromStrDate != null )
{
calEffFromDate = subDays( effFromStrDate );
System.out.println("calEffFromDate----------------"+calEffFromDate);
try
{
calEffFromStr = sdf.format( calEffFromDate );
......@@ -90,8 +105,12 @@ public class LoanSchemeIntRatePrs extends ValidatorEJB implements LoanSchemeIntR
}
catch(Exception e)
{
errString = getErrorString("" , "VTLOANSCH8" , userId);
//Modified by Yashwant on 12/07/2019[Start]
//errString = getErrorString("" , "VTLOANSCH8" , userId);
errString=itmDBAccess.getErrorString("", "VTLOANSCH8", userId,"", conn);
//Modified by Yashwant on 12/07/2019[End]
}
System.out.println("In preSave------------------------");
sql = "";
sql = "UPDATE LOANSCHEME_INT_RATE SET VALID_UPTO = ? WHERE SCHEME_TYPE = ? AND ? BETWEEN EFF_FROM AND VALID_UPTO";
pstmt = conn.prepareStatement(sql);
......
This diff is collapsed.
......@@ -19,7 +19,7 @@ table(column=(type=char(5) update=yes updatewhereclause=yes key=yes name=scheme_
retrieve="PBSELECT( VERSION(400) TABLE(NAME=~"loanscheme_int_rate~" ) COLUMN(NAME=~"loanscheme_int_rate.scheme_type~") COLUMN(NAME=~"loanscheme_int_rate.eff_from~") COLUMN(NAME=~"loanscheme_int_rate.valid_upto~") COMPUTE(NAME=~"DDF_GENCODE_DESC('SCHEME_TYPE','W_LOANSCHEME_INT_RATE',TRIM(Loanscheme_int_rate.scheme_type), '') AS scheme_type_descr~") COLUMN(NAME=~"loanscheme_int_rate.int_rate~") COLUMN(NAME=~"loanscheme_int_rate.remarks~") COLUMN(NAME=~"loanscheme_int_rate.add_date~") COLUMN(NAME=~"loanscheme_int_rate.add_user~") COLUMN(NAME=~"loanscheme_int_rate.add_term~") COLUMN(NAME=~"loanscheme_int_rate.chg_date~") COLUMN(NAME=~"loanscheme_int_rate.chg_user~") COLUMN(NAME=~"loanscheme_int_rate.chg_term~")WHERE( EXP1 =~"~~~"LOANSCHEME_INT_RATE~~~".~~~"SCHEME_TYPE~~~"~" OP =~"=~" EXP2 =~":scheme_type~" LOGIC =~"and~" ) WHERE( EXP1 =~"~~~"LOANSCHEME_INT_RATE~~~".~~~"EFF_FROM~~~"~" OP =~"=~" EXP2 =~":eff_from~" ) ) ARG(NAME = ~"scheme_type~" TYPE = string) ARG(NAME = ~"eff_from~" TYPE = date) " update="LOANSCHEME_INT_RATE" updatewhere=0 updatekeyinplace=no arguments=(("scheme_type", string),("eff_from", date)) )
groupbox(band=detail text="Basic"border="2" color="0" x="7" y="3" height="183" width="425" name=gb_1 visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="553648127" )
text(band=detail alignment="1" text="Scheme Type:" border="0" color="0" x="22" y="33" height="16" width="84" html.valueishtml="0" name=scheme_type_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=detail id=1 alignment="0" tabsequence=10 border="5" color="0" x="110" y="33" height="16" width="60" format="[general]" html.valueishtml="0" name=scheme_type visible="1" edit.limit=5 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=1 alignment="0" tabsequence=10 border="5" color="0" x="110" y="33" height="16" width="60" format="[general]" html.valueishtml="0" name=scheme_type visible="1" edit.limit=5 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=4 alignment="0" tabsequence=32766 border="5" color="255" x="174" y="33" height="16" width="218" format="[general]" html.valueishtml="0" name=scheme_type_descr visible="1" edit.limit=500 edit.case=any edit.focusrectangle=no edit.autoselect=no edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" )
text(band=detail alignment="1" text="Rate of Interest:" border="0" color="0" x="14" y="53" height="16" width="92" html.valueishtml="0" name=int_rate_t visible="1" font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=detail id=5 alignment="1" tabsequence=20 border="5" color="0" x="110" y="53" height="16" width="72" format="##.##" html.valueishtml="0" name=int_rate visible="1" editmask.useformat=yes editmask.mask="##.##" editmask.imemode=0 editmask.focusrectangle=no font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
......
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