Commit f5ba29bc authored by vvengurlekar's avatar vvengurlekar

EmpLeaveConf.java - changes done for leave updation in leavebal table

EmpLeaveConfLocal.java
EmpLeaveConfRemote.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@188633 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e620585c
......@@ -93,19 +93,34 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
}
public String confirm( String tranId, String xtraParams, String forcedFlag, Connection conn) throws RemoteException, ITMException
{
String retString = "";
try
{
retString = confirm( tranId, xtraParams, forcedFlag, 2, conn);
}
catch(Exception e)
{
System.out.println("Exception :EmpLeaveConf :confirm():" + e.getMessage() + ":");
retString = genericUtility.createErrorString(e);
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("String Returned from Confirmation :: [" + retString + "]");
return retString;
}
public String confirm( String tranId, String xtraParams, String forcedFlag, int commitFlag, Connection conn) throws RemoteException, ITMException
{
System.out.println("--------------confirm method of Empleave -------------");
ResultSet rs=null;
PreparedStatement pstmt = null;
String retString = "";
String errString = "",errCode = "";
HashMap hMap = new HashMap();
/*Modified by Anjali Rawankar on[22/08/2017][Start]
*[Added for itmDbAccess]
*/
AppConnectParm appConnect = null;
InitialContext initialCtx = null;
//Added & Commented by sarita to use object of ITMDBAccessEJB instead ITMDBAccessLocal on 20 JULY 18.[START]
//ITMDBAccessLocal itmDBAccess = null;
ITMDBAccessEJB itmDBAccess = null;
......@@ -157,7 +172,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
}
System.out.println("Calling Post Logic ");
retString = postLogic(tranId, tranId, 2, xtraParams, conn);
//retString = postLogic(tranId, tranId, 2, xtraParams, conn); commented and added by Varsha V on 24-Jul-18
retString = postLogic(tranId, tranId, commitFlag, xtraParams, conn);
System.out.println("return Error List of Post Logic :: "+this.errList);
......@@ -232,9 +248,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
this.proteusDataSource = null;
this.admCommon = null;
this.utilMethod = null;
//Added by sarita on 25 JULY 18 [START]
itmDBAccess = null;
//Added by sarita on 25 JULY 18 [END]
}
System.out.println("Error String Returned from Confirmation :: [" + errString + "]");
return errString;
......@@ -614,7 +627,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
}
else
{
errCode = leavesApprove(tranId,2,payrollOrVoucher,payrollPeriod,2,connectionObject);
//errCode = leavesApprove(tranId,2,payrollOrVoucher,payrollPeriod,2,connectionObject); commented and added by Varsha V on 24-Jul-18
errCode = leavesApprove(tranId,2,payrollOrVoucher,payrollPeriod,commit,connectionObject);
if (errCode != null && errCode.trim().length() > 0)
{
isError = true;
......@@ -3265,24 +3279,12 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
fVal4 = resultSet.getTimestamp("UPTO_DATE");
fVal5 = resultSet.getTimestamp("EXP_DATE");
fVal6 = resultSet.getDouble("BAL_DAYS");
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(noRows > 0)
{
if( ((fVal6 < 0) || (fVal6 == 0 && (fVal3.before(mDate1) || fVal3.equals(mDate1)))))
{
//continue;
continue;
}
if(fVal6 < nextBal)
{
......@@ -3430,9 +3432,22 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
nextBal = nextBal - updBal;
if(nextBal == 0)
{
//break;
break;
}
}
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if((errCode != null) && errCode.trim().length() > 0)
{
isError = true;
......@@ -4997,9 +5012,9 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
xmlString.append("<status>").append("<![CDATA[" + status + "]]>").append("</status>");
xmlString.append("<status_date>").append("<![CDATA[" + simpledf.format(statusDate) + "]]>").append("</status_date>");
xmlString.append("<remarks>").append("<![CDATA[" + remarks + "]]>").append("</remarks>");
xmlString.append("<appl_date>").append("<![CDATA[" + simpledf.format(applDate) + "]]>").append("</appl_date>");
xmlString.append("<start_time>").append("<![CDATA[" + simpledf.format(StartTime ) + "]]>").append("</start_time>");
xmlString.append("<end_time>").append("<![CDATA[" + simpledf.format(EndTime) + "]]>").append("</end_time>");
xmlString.append("<appl_date>").append("<![CDATA[" + (applDate!=null ? simpledf.format(applDate) : applDate) + "]]>").append("</appl_date>");
xmlString.append("<start_time>").append("<![CDATA[" + (StartTime!=null ? simpledf.format(StartTime ) : StartTime )+ "]]>").append("</start_time>");
xmlString.append("<end_time>").append("<![CDATA[" + (EndTime!=null ? simpledf.format(EndTime) : EndTime) + "]]>").append("</end_time>");
xmlString.append("</Detail1>");
xmlString.append("</header0>\r\n");
xmlString.append("</DocumentRoot>\r\n");
......
......@@ -17,4 +17,6 @@ public interface EmpLeaveConfLocal extends ActionHandlerLocal
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String confirm( String tranId, String xtraParams, String forcedFlag, Connection conn) throws RemoteException,ITMException;
public String confirm( String tranId, String xtraParams, String forcedFlag, int commitFlag, Connection conn) throws RemoteException, ITMException;
}
......@@ -13,4 +13,5 @@ public interface EmpLeaveConfRemote
{
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String confirm( String tranId, String xtraParams, String forcedFlag, Connection conn) throws RemoteException,ITMException;
public String confirm( String tranId, String xtraParams, String forcedFlag, int commitFlag, Connection conn) throws RemoteException, ITMException;
}
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