Commit ceecd1f5 authored by ssarkar's avatar ssarkar

changed by sumit on 25/03/13 for bug of deallocation IN REpl Iss Conf


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92872 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1b2ccc25
......@@ -1140,8 +1140,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmt.close();pstmt = null;
//Changed by sumit on 11/09/12 updating wave_status of pick_order of wave_task_det start.
updateSql = " UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'C' WHERE STATUS = ? AND REF_ID IN (SELECT REPL_ORDER FROM REPL_ORD_DET WHERE PICK_ORDER = ? )";
pstmt = conn.prepareStatement(updateSql);
//updateSql = " UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'C' WHERE STATUS = ? AND REF_ID IN (SELECT REPL_ORDER FROM REPL_ORD_DET WHERE PICK_ORDER = ? )";
/*pstmt = conn.prepareStatement(updateSql);
pstmt.setString(1, "N");
pstmt.setString(2, replOrder);
updCnt = pstmt.executeUpdate();
......@@ -1149,7 +1149,47 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
{
System.out.println( updCnt + " wave_task rows updated successfully" );
}
pstmt.close();pstmt = null;
pstmt.close();pstmt = null;*/
String updReplOrd = "";
updateSql = " UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'C' WHERE STATUS = ? AND REF_ID = ? ";
pstmt = conn.prepareStatement(updateSql);
updateSql = "SELECT REPL_ORDER FROM REPL_ORD_DET WHERE PICK_ORDER = ?";
PreparedStatement replPstmt = null;
replPstmt = conn.prepareStatement(updateSql);
replPstmt.setString(1, replOrder);
rs = replPstmt.executeQuery();
while( rs.next())
{
updReplOrd = rs.getString(1);
replStatus = isAllDependentTaskConfForRepl( updReplOrd, conn);
updCnt = 0;
if("Y".equalsIgnoreCase(replStatus))
{
pstmt.setString(1, "N");
pstmt.setString(2, updReplOrd);
updCnt = pstmt.executeUpdate();
pstmt.clearParameters();
}
if( updCnt > 0 )
{
System.out.println( updCnt + " wave_task rows updated successfully" );
}
}
if( rs != null )
{
rs.close(); rs = null;
}
if( replPstmt!= null)
{
replPstmt.close();
replPstmt = null;
}
if( pstmt != null )
{
pstmt.close(); pstmt = null;
}
//Changed By Pragyan 28/02/13 To check all the pick status
/*updateSql = " UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'C' WHERE STATUS = ? AND REF_ID IN (SELECT PICK_ORDER FROM PICK_ORD_DET WHERE REPL_ORDER = ? )";
......@@ -1628,5 +1668,59 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
return status;
}
//Changed by sumit on 21/02/13 checking whether all repl is confirmed or not end.
//Changed by sumit on 25/03/13 checking whether all repl is confirmed or not start.
private String isAllDependentTaskConfForRepl(String pickOrder , Connection conn) throws ITMException
{
String sql = "";
String status = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
sql = " SELECT STATUS, REF_ID FROM WAVE_TASK_DET WHERE REF_ID IN ("
+ " SELECT PICK_ORDER FROM REPL_ORD_DET WHERE REPL_ORDER = ?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, pickOrder);
rs = pstmt.executeQuery();
while(rs.next())
{
status = rs.getString("STATUS");
System.out.println(" status of repl_order ["+rs.getString("REF_ID")+"] is ["+status+"]");
if( "N".equalsIgnoreCase(status))
{
return status;
}
}
rs.close(); rs= null;
pstmt.close(); pstmt = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(pstmt != null)
{
pstmt.close(); pstmt = null;
}
if( rs != null)
{
rs.close(); rs = null;
}
}
catch(Exception ex)
{
ex.printStackTrace();
throw new ITMException(ex);
}
}
return status;
}
//Changed by sumit on 25/03/13 checking whether all repl is confirmed or not end.
}
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