Commit 2de677dc authored by smane's avatar smane

Changes done for update flag of confirmed column after successfully confirmation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98264 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 79d76569
...@@ -104,9 +104,29 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -104,9 +104,29 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
conn.setAutoCommit(false); conn.setAutoCommit(false);
connDriver = null; connDriver = null;
currDate = new Timestamp( System.currentTimeMillis() ); currDate = new Timestamp( System.currentTimeMillis() );
sql = "select tran_id, tran_date, site_code, cust_code, confirmed " /*sql = "select tran_id, tran_date, site_code, cust_code, confirmed "
+" from charge_back " +" from charge_back "
+" where tran_id = ? "; +" where tran_id = ? ";*/ // sql comment by sagar on 13/07/15
System.out.println(">>>>CommonConstants.DB_NAME:"+ CommonConstants.DB_NAME);
if("db2".equalsIgnoreCase(CommonConstants.DB_NAME)) // conditions is added by sagar on 13/07/15
{
sql = " select tran_id, tran_date, site_code, cust_code, confirmed "
+ " from charge_back where tran_id = ? for update ";
}
else if("mssql".equalsIgnoreCase(CommonConstants.DB_NAME))
{
sql = " select tran_id, tran_date, site_code, cust_code, confirmed "
+ " from charge_back (updlock) where tran_id = ? ";
}
else
{
System.out.println(">>>Oracle:");
sql = " select tran_id, tran_date, site_code, cust_code, confirmed "
+ " from charge_back where tran_id = ? for update nowait ";
}
System.out.println(">>>>ChrgBckLocConf sql:"+ sql);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString( 1, tranID ); pstmt.setString( 1, tranID );
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -178,7 +198,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -178,7 +198,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
pstmt.setTimestamp(3, sysDate); pstmt.setTimestamp(3, sysDate);
pstmt.setString( 4, tranID ); pstmt.setString( 4, tranID );
int chkupdt = pstmt.executeUpdate(); int chkupdt = pstmt.executeUpdate();
System.out.println("chkupdt==>"+chkupdt); System.out.println("chkupdt==>"+ chkupdt);
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
...@@ -187,6 +207,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -187,6 +207,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
String currAppdate = new SimpleDateFormat(genericUtility.getApplDateFormat()).format(currDate).toString(); String currAppdate = new SimpleDateFormat(genericUtility.getApplDateFormat()).format(currDate).toString();
currDate = Timestamp.valueOf(genericUtility.getValidDateString( currAppdate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0") ; currDate = Timestamp.valueOf(genericUtility.getValidDateString( currAppdate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0") ;
// end 02/07/13 manoharan time value to be removed // end 02/07/13 manoharan time value to be removed
if( chkupdt > 0) // condition is added by sagar on 13/07/15
{
returnString = createMiscCrnoteCback(currDate, "", siteCode, tranID, tranID, tranDate, tranDate, custCode, custCode, "Y", xtraParams, conn ); returnString = createMiscCrnoteCback(currDate, "", siteCode, tranID, tranID, tranDate, tranDate, custCode, custCode, "Y", xtraParams, conn );
if( returnString .equals("VTSUCC1") ) if( returnString .equals("VTSUCC1") )
{ {
...@@ -200,6 +222,12 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -200,6 +222,12 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
} }
returnString = itmDBAccessEJB.getErrorString("",errStr,userId); returnString = itmDBAccessEJB.getErrorString("",errStr,userId);
} }
else
{
System.out.println(">>>Record not updated for charge_back:");
returnString = itmDBAccessEJB.getErrorString("", "VTTRNCNFM2", userId);
}
}
catch(Exception e) catch(Exception e)
{ {
System.out.println("ChrgBckLocConfEJB..."+e.getMessage()); System.out.println("ChrgBckLocConfEJB..."+e.getMessage());
......
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