Commit 077270aa authored by caluka's avatar caluka

Changes done in E-Collection confirmation and submit


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97433 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 965bfebb
......@@ -64,15 +64,16 @@ public class EcollectionConf extends ActionHandlerEJB implements EcollectionConf
rs = null;
pstmt.close();
pstmt = null;
if(refNo == null || refNo.trim().length() == 0)
if ("S".equalsIgnoreCase(status))
{
errString = itmDBAccessLocal.getErrorString("","VTNULREFNO","");
}
else
if (refNo == null || refNo.trim().length() == 0)
{
errString = itmDBAccessLocal.getErrorString("", "VTNULREFNO", "");
} else
{
if ("Y".equalsIgnoreCase(confirmed))
{
errString = itmDBAccessLocal.getErrorString("","VTINVCONF2","");
errString = itmDBAccessLocal.getErrorString("", "VTINVCONF2", "");
} else
{
......@@ -85,8 +86,7 @@ public class EcollectionConf extends ActionHandlerEJB implements EcollectionConf
System.out.println(">>>>>>>>sysDate:" + sysDate);
System.out.println(">>>>>>>>loginEmpCode:" + loginEmpCode);
if ("S".equalsIgnoreCase(status))
{
sql = " update receipt_form set confirmed = 'Y',conf_date = ?, emp_code__aprv = ? ,status= 'C' where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, sysDate);
......@@ -97,25 +97,35 @@ public class EcollectionConf extends ActionHandlerEJB implements EcollectionConf
pstmt = null;
if (cnt > 0)
{
errString = itmDBAccessLocal.getErrorString("", "VCNFSUC1", "");
conn.commit();
} else
{
errString = itmDBAccessLocal.getErrorString("", "VTNCONFT", "");
}
}
}
} else
{
errString = itmDBAccessLocal.getErrorString("", "VTNSUBCON", "");
}
}
}
}
// end if errstrng
} catch (Exception e)
{
if(conn!=null)
{
try {
conn.rollback();
} catch (SQLException ex) {
e.printStackTrace();
throw new ITMException(e);
}
}
e.printStackTrace();
throw new ITMException(e);
}
......@@ -123,22 +133,11 @@ public class EcollectionConf extends ActionHandlerEJB implements EcollectionConf
{
try
{
if(errString != null && errString.trim().length() > 0)
{
System.out.println("--going to commit tranaction--");
if(errString.indexOf("VCNFSUC1") > -1)
if(conn != null && !conn.isClosed())
{
conn.commit();
System.out.println("--transaction commited--");
}
else
{
conn.rollback();
System.out.println("--transaction rollback--");
}
conn.close();
conn = null;
}
if(rs != null)
{
rs.close();
......@@ -148,8 +147,8 @@ public class EcollectionConf extends ActionHandlerEJB implements EcollectionConf
{
pstmt.close();
pstmt = null;
}
conn.close();
}
catch(Exception e)
{
......@@ -173,8 +172,6 @@ public class EcollectionConf extends ActionHandlerEJB implements EcollectionConf
ResultSet rs = null;
int cnt = 0;
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
//E12GenericUtility genericUtility= new E12GenericUtility();
try
{
......@@ -220,6 +217,7 @@ public class EcollectionConf extends ActionHandlerEJB implements EcollectionConf
if (cnt > 0)
{
errString = itmDBAccessLocal.getErrorString("", "VTSTATSUBM", "");
conn.commit();
} else
{
......@@ -231,38 +229,38 @@ public class EcollectionConf extends ActionHandlerEJB implements EcollectionConf
// end if errstrng
} catch (Exception e)
{
if(conn!=null)
{
try {
conn.rollback();
} catch (SQLException ex) {
e.printStackTrace();
throw new ITMException(e);
}
}
e.printStackTrace();
throw new ITMException(e);
} finally
{
try
{
if (errString != null && errString.trim().length() > 0)
if(conn != null && !conn.isClosed())
{
System.out.println("--going to commit tranaction--");
if (errString.indexOf("VTSTATSUBM") > -1)
{
conn.commit();
System.out.println("--transaction commited--");
} else
{
conn.rollback();
System.out.println("--transaction rollback--");
}
conn.close();
conn = null;
}
if (rs != null)
if(rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
} catch (Exception e)
{
System.out.println("Exception : " + e);
......
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