Commit 843b6188 authored by ssarkar's avatar ssarkar

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


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92858 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 58f577b8
...@@ -331,7 +331,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -331,7 +331,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
//System.out.println(" locCode ["+locCode+"] lotNo ["+lotNo+"] lotSl ["+lotSl+"]"); //System.out.println(" locCode ["+locCode+"] lotNo ["+lotNo+"] lotSl ["+lotSl+"]");
isReplDone = true; isReplDone = true;
updateReplOrder(currentReplOrder,currReplOrdLine, siteCode, itemCode, locCodeTo, lotNo, lotSl, DeallocQty, conn, isReplDone, replOrder,replOrderLine, "", 0); updateReplOrder(currentReplOrder,currReplOrdLine, siteCode, itemCode, locCodeTo, lotNo, lotSl, DeallocQty, conn, isReplDone, "",0, "", 0);
updatePickOrder(pickOrder, pickLineNo, DeallocQty, conn, isPickIssueDone,pPickType); updatePickOrder(pickOrder, pickLineNo, DeallocQty, conn, isPickIssueDone,pPickType);
updateReplOrderForActive(pPickType, currentReplOrder,currReplOrdLine, empCode, conn); updateReplOrderForActive(pPickType, currentReplOrder,currReplOrdLine, empCode, conn);
} }
...@@ -363,7 +363,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -363,7 +363,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if("Y".equalsIgnoreCase(confirmed)) if("Y".equalsIgnoreCase(confirmed))
{ {
isReplDone = true; isReplDone = true;
updateReplOrder(currentReplOrder,currReplOrdLine, siteCode, itemCode, locCodeTo, lotNo, lotSl, DeallocQty, conn, isReplDone, replOrder,replOrderLine,supRerplOrder, supReplLine); updateReplOrder(currentReplOrder,currReplOrdLine, siteCode, itemCode, locCodeTo, lotNo, lotSl, DeallocQty, conn, isReplDone, replOrder,replOrderLine,"", 0);
updatePickOrder(pickOrder, pickLineNo, DeallocQty, conn, isPickIssueDone,pPickType); updatePickOrder(pickOrder, pickLineNo, DeallocQty, conn, isPickIssueDone,pPickType);
updateReplOrderForActive(pPickType, currentReplOrder,currReplOrdLine, empCode, conn); updateReplOrderForActive(pPickType, currentReplOrder,currReplOrdLine, empCode, conn);
} }
...@@ -1207,7 +1207,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -1207,7 +1207,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
} }
else if( isReplDone && parentReplOrder.trim().length() == 0) else if( isReplDone && parentReplOrder.trim().length() == 0)
{ {
sql = "UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL"; /*sql = "UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty ); pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, currentReplOrder); pstmt.setString(2, currentReplOrder);
...@@ -1231,10 +1231,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -1231,10 +1231,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{ {
System.out.println(currentReplOrder+" repl_order updated successfully "); System.out.println(currentReplOrder+" repl_order updated successfully ");
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;*/
} }
else if( !isReplDone && parentReplOrder.trim().length() > 0) else if( !isReplDone && parentReplOrder.trim().length() > 0 && supRerplOrder.trim().length() == 0)
{ {
sql = "UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL "; sql = "UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1302,11 +1302,37 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -1302,11 +1302,37 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
} }
else if( isReplDone && parentReplOrder.trim().length() > 0) else if( isReplDone && parentReplOrder.trim().length() > 0 && supRerplOrder.trim().length() == 0)
{ {
sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL "; sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty ); pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, currentReplOrder);
pstmt.setInt(3, replOrderLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order of REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
sql = "UPDATE REPL_ORD_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, currentReplOrder);
pstmt.setInt(3, replOrderLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order OF REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
/*sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, parentReplOrder); pstmt.setString(2, parentReplOrder);
pstmt.setInt(3, parentReplOrdLine); pstmt.setInt(3, parentReplOrdLine);
//pstmt2.setInt(3, pickLineNo); //pstmt2.setInt(3, pickLineNo);
...@@ -1328,12 +1354,67 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -1328,12 +1354,67 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{ {
System.out.println(currentReplOrder+" repl_order of REPL_ISS_DET updated successfully "); System.out.println(currentReplOrder+" repl_order of REPL_ISS_DET updated successfully ");
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null; */
} }
if( !isReplDone && supRerplOrder.trim().length() > 0 ) if( !isReplDone && supRerplOrder.trim().length() > 0 )
{ {
sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, currentReplOrder);
pstmt.setInt(3, replOrderLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order of REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
sql = "UPDATE REPL_ORD_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, currentReplOrder);
pstmt.setInt(3, replOrderLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order OF REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
////////////////for pnd
sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, parentReplOrder);
pstmt.setInt(3, parentReplOrdLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order of REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
sql = "UPDATE REPL_ORD_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, parentReplOrder);
pstmt.setInt(3, parentReplOrdLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order OF REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
/////for dso repl
sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL "; sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty ); pstmt.setDouble(1, DeallocQty );
...@@ -1347,7 +1428,21 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -1347,7 +1428,21 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
sql = "UPDATE REPL_ISS_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO__ORD = ? "; sql = "UPDATE REPL_ORD_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, supRerplOrder);
pstmt.setInt(3, supReplLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order OF REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
/*sql = "UPDATE REPL_ISS_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO__ORD = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty ); pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, supRerplOrder); pstmt.setString(2, supRerplOrder);
...@@ -1358,13 +1453,67 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -1358,13 +1453,67 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{ {
System.out.println(supRerplOrder+" repl_order of REPL_ISS_DET updated successfully "); System.out.println(supRerplOrder+" repl_order of REPL_ISS_DET updated successfully ");
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null; */
} }
else if ( isReplDone && supRerplOrder.trim().length() > 0 ) else if ( isReplDone && supRerplOrder.trim().length() > 0 )
{ {
sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL "; sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty ); pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, currentReplOrder);
pstmt.setInt(3, replOrderLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order of REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
sql = "UPDATE REPL_ORD_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, currentReplOrder);
pstmt.setInt(3, replOrderLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order OF REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
////////////////for pnd
sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, parentReplOrder);
pstmt.setInt(3, parentReplOrdLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order of REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
sql = "UPDATE REPL_ORD_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, parentReplOrder);
pstmt.setInt(3, parentReplOrdLine);
//pstmt2.setInt(3, pickLineNo);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(parentReplOrder+" repl_order OF REPL_ORD_DET updated successfully ");
}
pstmt.close();pstmt = null;
/*sql = " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, supRerplOrder); pstmt.setString(2, supRerplOrder);
pstmt.setInt(3, supReplLine); pstmt.setInt(3, supReplLine);
//pstmt2.setInt(3, pickLineNo); //pstmt2.setInt(3, pickLineNo);
...@@ -1386,7 +1535,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -1386,7 +1535,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{ {
System.out.println(supRerplOrder+" repl_order of REPL_ISS_DET updated successfully "); System.out.println(supRerplOrder+" repl_order of REPL_ISS_DET updated successfully ");
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;*/
} }
if( parentReplOrder.trim().length() > 0 ) if( parentReplOrder.trim().length() > 0 )
......
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