Commit 865a934b authored by ssarkar's avatar ssarkar

changed by sumit on 23/03/13 for bug of deallocation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92864 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8418e148
......@@ -515,15 +515,17 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
catch(Exception e)
{
isError = true;
try
/*try
{
conn.rollback();
}
catch(Exception e1)
{
e1.printStackTrace();
}
}*/
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
finally
......@@ -532,7 +534,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{
System.out.println("isError =["+isError+"]");
if ( !(isError) && conStat == true )
/*if ( !(isError) && conStat == true )
{
System.out.println("Commiting and Closing Connection..........");
conn.commit();
......@@ -542,7 +544,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{
conn.rollback();
}
}*/
if (rs != null )
{
......@@ -553,13 +555,13 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
pstmt.close();
pstmt = null;
}
if( conn != null && conStat == true && !conn.isClosed() )
/*if( conn != null && conStat == true && !conn.isClosed() )
{
System.out.println(" commiting connection ");
conn.commit();
conn.close();
conn = null;
}
}*/
}
catch( Exception e)
......@@ -2003,7 +2005,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if( quantity == 0 && recordFound)
{
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? ";
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y',ACTUAL_QTY = 0 WHERE REPL_ORDER = ? AND LINE_NO = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currentReplOrder);
pstmt.setInt(2, replOrderLine);
......@@ -2031,70 +2033,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
boolean recordFound = false;
System.out.println(" inside repl deallocation pickTye["+pickTye+"]");
if( "S".equalsIgnoreCase(pickTye))
{
sql = " SELECT (QUANTITY - CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END ) AS QUANTITY " +
" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, parentReplOrder);
pstmt.setInt(2, parentReplOrdLine);
rs = pstmt.executeQuery();
if( rs.next())
{
recordFound = true;
quantity = rs.getDouble("QUANTITY");
}
else
{
recordFound = false;
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
if( quantity == 0 && recordFound)
{
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, parentReplOrder);
pstmt.setInt(2, parentReplOrdLine);
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" REPL_ORD_DET updated succesfully ");
}
pstmt.close(); pstmt = null;
sql = "UPDATE WAVE_TASK_DET SET STATUS = 'Y' WHERE REF_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, parentReplOrder);
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
}
pstmt.close(); pstmt = null;
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currentReplOrder);
pstmt.setInt(2, replOrderLine);
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" REPL_ORD_DET updated succesfully ");
}
pstmt.close(); pstmt = null;
sql = "UPDATE WAVE_TASK_DET SET STATUS = 'Y' WHERE REF_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currentReplOrder);
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
}
pstmt.close(); pstmt = null;
}
}
else
{
////////////// FOR PSO TASK CANCELLING IF NO DEPENDANCY START
sql = " SELECT (QUANTITY - CASE WHEN ACTUAL_QTY IS NULL THEN 0 ELSE ACTUAL_QTY END ) AS QUANTITY " +
" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
......@@ -2118,7 +2057,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{
if( "DSO".equalsIgnoreCase(invStat) )
{
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? ";
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y',ACTUAL_QTY = 0 WHERE REPL_ORDER = ? AND LINE_NO = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, parentReplOrder);
pstmt.setInt(2, parentReplOrdLine);
......@@ -2158,7 +2097,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
}
else if( "PSO".equalsIgnoreCase(invStat) )
{
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? ";
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y',ACTUAL_QTY = 0 WHERE REPL_ORDER = ? AND LINE_NO = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, parentReplOrder);
pstmt.setInt(2, parentReplOrdLine);
......@@ -2179,52 +2118,13 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
}
}
////////////// FOR PSO TASK CANCELLING IF NO DEPENDANCY END
}
}
if( supRerplOrder.trim().length() > 0 )
{
boolean recordFound = false;
System.out.println(" inside DSO repl deallocation pickTye["+pickTye+"]");
if( "S".equalsIgnoreCase(pickTye))
{
sql = " SELECT (QUANTITY - CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END ) AS QUANTITY " +
" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, supRerplOrder);
pstmt.setInt(2, supReplLine);
rs = pstmt.executeQuery();
if( rs.next())
{
recordFound = true;
quantity = rs.getDouble("QUANTITY");
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
if( quantity == 0 && recordFound )
{
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, supRerplOrder);
pstmt.setInt(2, supReplLine);
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" REPL_ORD_DET updated succesfully ");
}
pstmt.close(); pstmt = null;
sql = "UPDATE WAVE_TASK_DET SET STATUS = 'Y' WHERE REF_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, supRerplOrder);
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
}
pstmt.close(); pstmt = null;
}
}
else
{
////////////// FOR DSO TASK CANCELLING IF NO DEPENDANCY START
sql = " SELECT (QUANTITY - CASE WHEN ACTUAL_QTY IS NULL THEN 0 ELSE ACTUAL_QTY END ) AS QUANTITY " +
" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
......@@ -2269,7 +2169,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
///////////////////////////////////////////////
System.out.println(" DSO repl deallocating ");
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? ";
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y',ACTUAL_QTY = 0 WHERE REPL_ORDER = ? AND LINE_NO = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, supRerplOrder);
pstmt.setInt(2, supReplLine);
......@@ -2292,7 +2192,6 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
}
////////////// FOR DSO TASK CANCELLING IF NO DEPENDANCY END
}
}
// this below task is usefull for stock to dock case end
}
......
......@@ -941,10 +941,10 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal,
deallocArtConfLocal = (DeallocArtConfLocal)ctx.lookup("ibase/DeallocArtConf/local");
errString = deallocArtConfLocal.confirm(tranId, xtraParams, "", conn, false);
System.out.println(" ************ errString ******** ["+errString+"]");
if (errString.indexOf("VTSUCC1") > -1)
/*if (errString.trim().length() > 0)
{
errString = "";
}
}*/
}//try end
catch(Exception e)
......@@ -970,7 +970,7 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal,
System.out.println("Closing Connection....");
try
{
if (errString == null || errString.trim().length() == 0 || errString.contains("VTSUCC1"))
if (errString == null || errString.trim().length() == 0 )
{
conn.commit();
//errString="VTCOMPL";
......
......@@ -32084,6 +32084,56 @@ INSERT INTO system_service_args VALUES (
'AVIPRASH ',
'BASE216');
-- added by sumit on 22/03/13
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'INVDEALLQ5',
'Invalid location',
'Quantity can not be deallocated from PND location.',
'E',
'Y',
NULL,
NULL,
NULL,
TO_DATE('14-12-2012 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'BASE',
'BASE',
NULL,
NULL);
create or replace
function fn_wave_status(SI_WAVE_ID IN CHAR)
return CHAR IS STATUS CHAR;
CNT NUMBER;
CNT1 NUMBER;
BEGIN
BEGIN
SELECT count(*) INTO CNT FROM WAVE_TASK_DET WHERE WAVE_ID = SI_WAVE_ID;
SELECT count(*) INTO CNT1 FROM WAVE_TASK_DET WHERE WAVE_ID = SI_WAVE_ID AND STATUS = 'Y';
IF (CNT = cnt1 ) THEN
STATUS := 'Y';
ELSE
STATUS := 'N';
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
STATUS :='N';
END;
RETURN STATUS;
END;
commit;
......
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