Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
webitm-fin-advSupp-20
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ketan Patil
webitm-fin-advSupp-20
Commits
93c51074
Commit
93c51074
authored
May 26, 2022
by
Ketan Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added by Pravin for Wildfly20
parent
7b36e911
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
197 additions
and
0 deletions
+197
-0
ibase/webitm/ejb/fin/advfield/AdvanceVoucherReject.java
ibase/webitm/ejb/fin/advfield/AdvanceVoucherReject.java
+197
-0
No files found.
ibase/webitm/ejb/fin/advfield/AdvanceVoucherReject.java
0 → 100644
View file @
93c51074
package
ibase
.
webitm
.
ejb
.
fin
.
advfield
;
import
java.rmi.RemoteException
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
ibase.ejb.CommonDBAccessEJB
;
import
ibase.system.config.ConnDriver
;
import
ibase.utility.E12GenericUtility
;
import
ibase.utility.UserInfoBean
;
import
ibase.webitm.ejb.ActionHandlerEJB
;
import
ibase.webitm.ejb.ITMDBAccessEJB
;
import
ibase.webitm.utility.ITMException
;
@javax
.
ejb
.
Stateless
public
class
AdvanceVoucherReject
extends
ActionHandlerEJB
implements
AdvanceVoucherRejectLocal
,
AdvanceVoucherRejectRemote
{
private
UserInfoBean
userInfoBean
=
null
;
public
UserInfoBean
getUserInfoBean
()
{
return
userInfoBean
;
}
public
void
setUserInfoBean
(
UserInfoBean
userInfoBean
)
{
this
.
userInfoBean
=
userInfoBean
;
}
public
String
reject
()
throws
RemoteException
,
ITMException
{
return
""
;
}
public
String
reject
(
String
tranId
,
String
xtraParams
,
String
forcedFlag
,
String
userInfo
)
throws
RemoteException
,
ITMException
//added by Ramagya On 10/08/2020[added userInfo parameter]
{
String
result
=
""
;
try
{
System
.
out
.
println
(
"AdvanceVoucherReject>>reject>>userInfo>>"
+
userInfo
);
setUserInfoBean
(
new
UserInfoBean
(
userInfo
));
System
.
out
.
println
(
"Reject Advance Voucher..."
);
result
=
rejectCashVoucher
(
tranId
,
xtraParams
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Exception ::"
+
e
.
getMessage
());
throw
new
ITMException
(
e
);
}
return
result
;
}
private
String
rejectCashVoucher
(
String
tranId
,
String
xtraParams
)
throws
RemoteException
,
Exception
,
ITMException
{
Connection
conn
=
null
;
PreparedStatement
pstmt
=
null
;
ResultSet
rs
=
null
;
String
sql
=
""
;
String
empLogin
=
""
,
returnValue
=
""
,
signRemrk
=
""
;
String
errorString
=
""
;
E12GenericUtility
e12GenericUtilityObj
=
new
E12GenericUtility
();
ITMDBAccessEJB
itmDBAccessEJB
=
new
ITMDBAccessEJB
();
ConnDriver
connDriver
=
new
ConnDriver
();
try
{
empLogin
=
e12GenericUtilityObj
.
getValueFromXTRA_PARAMS
(
xtraParams
,
"loginCode"
);
System
.
out
.
println
(
"empLogin--advanceVocuherConfirm---["
+
empLogin
+
"]"
);
ibase
.
utility
.
UserInfoBean
userInfo
=
null
;
if
(
getUserInfoBean
()
==
null
)
{
CommonDBAccessEJB
commonDBAccessEJB
=
new
CommonDBAccessEJB
();
userInfo
=
commonDBAccessEJB
.
createUserInfo
(
empLogin
);
}
if
(
userInfo
==
null
)
{
userInfo
=
getUserInfoBean
();
}
System
.
out
.
println
(
"@@ras::::UserInfo=> "
+
userInfo
);
conn
=
connDriver
.
getConnectDB
(
userInfo
==
null
?
"Driver"
:
userInfo
.
getTransDB
());
conn
.
setAutoCommit
(
false
);
sql
=
"select SIGN_REMARKS from OBJ_SIGN_TRANS a where REF_ID =? and "
+
" line_no = (select max(LINE_NO) from OBJ_SIGN_TRANS B where B.REF_ID = A.REF_ID )"
;
//sql="select SIGN_REMARKS from OBJ_SIGN_TRANS where ref_id =? and sign_status='R'";
//sql = "SELECT EMAIL_ID_OFF FROM obj WHERE EMP_CODE = ?" ;
System
.
out
.
println
(
"*****getValueFromRefTable******* DESCR QUERY IS "
+
sql
);
pstmt
=
conn
.
prepareStatement
(
sql
);
pstmt
.
setString
(
1
,
tranId
);
rs
=
pstmt
.
executeQuery
();
System
.
out
.
println
(
"*****get Value From EMPLOYEE Table******* DESCR QUERY IS "
+
sql
);
if
(
rs
.
next
())
{
returnValue
=
rs
.
getString
(
"SIGN_REMARKS"
);
System
.
out
.
println
(
"*************Return VALUE IS*******"
+
returnValue
);
}
signRemrk
=
returnValue
.
toUpperCase
();
System
.
out
.
println
(
"*************Return VALUE IS*signRemrk******"
+
signRemrk
);
if
(
rs
!=
null
)
{
rs
.
close
();
rs
=
null
;
}
if
(
pstmt
!=
null
)
{
pstmt
.
close
();
pstmt
=
null
;
}
// sql="update OBJ_SIGN_TRANS set SIGN_REMARKS=? where ref_id =? and sign_status='R'";
sql
=
" update OBJ_SIGN_TRANS A set SIGN_REMARKS=? where ref_id =? and sign_status='R' and "
+
"line_no = (select max(LINE_NO) from OBJ_SIGN_TRANS B where B.REF_ID = A.REF_ID )"
;
System
.
out
.
println
(
"sql-->"
+
sql
);
pstmt
=
conn
.
prepareStatement
(
sql
);
pstmt
.
setString
(
1
,
signRemrk
);
pstmt
.
setString
(
2
,
tranId
);
int
cnt1
=
pstmt
.
executeUpdate
();
System
.
out
.
println
(
"----- Rows To Be Updated ......"
+
cnt1
);
if
(
cnt1
>
0
)
{
//conn.commit();
System
.
out
.
println
(
"OBJ_SIGN_TRANS status updated"
);
}
pstmt
.
close
();
pstmt
=
null
;
sql
=
"update cash_voucher set status=? where tran_id = ?"
;
System
.
out
.
println
(
"sql-->"
+
sql
);
pstmt
=
conn
.
prepareStatement
(
sql
);
pstmt
.
setString
(
1
,
"O"
);
pstmt
.
setString
(
2
,
tranId
);
int
cnt
=
pstmt
.
executeUpdate
();
System
.
out
.
println
(
"----- Rows To Be Updated ......"
+
cnt
);
if
(
cnt
>
0
)
{
//conn.commit();
System
.
out
.
println
(
"cash_voucher status updated"
);
}
pstmt
.
close
();
pstmt
=
null
;
}
catch
(
Exception
e
)
{
conn
.
rollback
();
System
.
out
.
println
(
"Exception :: [CashVoucherRejectEJB] EXCEPTION"
+
e
.
getMessage
());
// return itmDBAccessEJB.getErrorString("","VTADHOC1","","",conn);
}
finally
{
try
{
if
(
pstmt
!=
null
)
{
pstmt
.
close
();
pstmt
=
null
;
}
if
(
conn
!=
null
)
{
conn
.
commit
();
conn
.
close
();
conn
=
null
;
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Exception inside finally"
+
e
.
getMessage
());
conn
.
rollback
();
return
itmDBAccessEJB
.
getErrorString
(
""
,
"VTADHOC1"
,
""
,
""
,
conn
);
}
}
// END OF finally
return
errorString
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment