Commit 7344fcd8 authored by pjain's avatar pjain

Issue tracker No 389,404,396 point merge by Dhanraj(change by pragyan sir)


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95534 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7cdba561
......@@ -98,6 +98,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
HashMap replIss = new HashMap();
Set ptcnSET = new HashSet(); //
ITMDBAccessEJB itmdbAccess = new ITMDBAccessEJB();
try
{
conn.setAutoCommit(false);
......@@ -616,7 +617,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
while( it.hasNext())
{
tempPTCN = it.next().toString();
System.out.println(" tempPTCN --> ["+tempPTCN+"]");
System.out.println(" tempPTCN --> ["+tempPTCN+"]ptcn["+ptcn);
//Changed by sumit on 04/06/13 updating WAVE_STATUS_ORG to re-print label start
pstmt.setString(1, "N");
......@@ -629,14 +630,22 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
//Changed by sumit on 04/06/13 updating WAVE_STATUS_ORG to re-print label end.
ConsolidatToDoc conToDoc = new ConsolidatToDoc();
errString = conToDoc.process(ptcn, conn,xtraParams);
//errString = conToDoc.process(ptcn, conn,xtraParams);
errString = conToDoc.process(tempPTCN, conn,xtraParams);
if ( errString != null && errString.trim().length() > 0 )
{
isError = true;
return errString;
}
//Changed By Pragyan 02-JUL-14 (Issue tracker No 396)To update status as C if consolidated to doc called.start
else
{
updateWaveStatusDespatch(tempPTCN,conn);
}
//Changed By Pragyan 02-JUL-14 (Issue tracker No 396)To get proper count from pick order and pick line no.
}
}
//Changed by sumit on 04/06/13 closing prepared statement start
if(pstmt != null)
......@@ -2321,6 +2330,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
updateWaveStatusTasks(currentReplOrder, "R", conn);
}
pstmt.close(); pstmt = null;
}
......@@ -2402,6 +2412,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{
isParentUpd = true;
System.out.println(" WAVE_TASK_DET updated succesfully ");
updateWaveStatusTasks(parentReplOrder, "R", conn);
}
pstmt.close(); pstmt = null;
}
......@@ -2452,6 +2463,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
updateWaveStatusTasks(currentReplOrder, "R", conn);
}
pstmt.close(); pstmt = null;
}
......@@ -2475,6 +2487,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
updateWaveStatusTasks(parentReplOrder, "R", conn);
}
pstmt.close(); pstmt = null;
}
......@@ -2526,6 +2539,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
updateWaveStatusTasks(parentReplOrder, "R", conn);
}
pstmt.close(); pstmt = null;
......@@ -2548,6 +2562,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
updateWaveStatusTasks(supRerplOrder, "R", conn);
}
pstmt.close(); pstmt = null;
......@@ -2724,6 +2739,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
updateWaveStatusTasks(currentReplOrder, "R", conn);
}
pstmt.close(); pstmt = null;
}
......@@ -2772,6 +2788,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
updateWaveStatusTasks(parentReplOrder, "R", conn);
}
pstmt.close(); pstmt = null;
......@@ -2790,6 +2807,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
pstmt.setString(1, currentReplOrder);
if ( pstmt.executeUpdate() > 0 )
{
updateWaveStatusTasks(currentReplOrder, "R", conn);
System.out.println(" WAVE_TASK_DET updated succesfully ");
}
pstmt.close(); pstmt = null;
......@@ -3099,6 +3117,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if(update > 0 )
{
System.out.println(refId+ " WAVE_TASK_DET is updated susessfully ");
updateWaveStatusTasks(refId, "P", conn);
}
if("M".equalsIgnoreCase(pickType))
......@@ -3187,6 +3207,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
pstmt.close(); pstmt = null;
if(update > 0 )
{
updateWaveStatusTasks(refId, "P", conn);
System.out.println(refId+ " WAVE_TASK_DET is updated susessfully ");
}
......@@ -3216,6 +3237,11 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refId);
update = pstmt.executeUpdate();
if(update > 0)
{
updateWaveStatusTasks(refId, "R", conn);
}
}
}
}
......@@ -3815,6 +3841,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if ( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_TASK_DET updated succesfully ");
updateWaveStatusTasks(refId, "R", conn);
}
pstmt.close(); pstmt = null;
......@@ -4062,4 +4089,203 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
return updatecount;
}
//changed by sankara on 21/06/14 update sorder ship_status from pick deallocation end.
//Changed By Pragyan 02-JUL-14 (Issue tracker No 396)To update status as C if consolidated to doc called.start
private int updateWaveStatusDespatch(String PTCN, Connection conn) throws ITMException
{
String sql = "", sql1 = "";
String waveId = "";
String saleOrder = "";
PreparedStatement pstmt = null;
ResultSet rs = null, rs1 = null;
int updateCount = 0;
int count = 0;
try
{
sql = "SELECT COUNT(*) FROM WAVE_TASK_DET WHERE PTCN = ? AND REF_SER <> 'S-DSP' AND STATUS = 'N'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, PTCN);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if( count == 0)
{
sql = "UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'C' WHERE PTCN = ? AND REF_SER = 'S-DSP' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, PTCN);
updateCount = pstmt.executeUpdate();
if(updateCount > 0)
{
System.out.println("Despatch Has been updated as created["+updateCount+"]");
}
else
{
System.out.println("Despatch Has Not been updated as created["+updateCount+"]");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e2)
{
e2.printStackTrace();
throw new ITMException(e2);
}
}
return updateCount;
}
private int updateWaveStatusTasks(String refID,String taskType, Connection conn) throws ITMException
{
String sql = "", sql1 = "";
String waveId = "";
String saleOrder = "";
PreparedStatement pstmt = null;
ResultSet rs = null, rs1 = null;
int updateCount = 0;
int COUNT = 0;
try
{
if("R".equalsIgnoreCase(taskType))
{
sql = "SELECT COUNT(*) AS COUNT " +
" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND (CASE WHEN CANCEL_MODE IS NULL THEN 'N' ELSE CANCEL_MODE END) = 'N'";
}
else if("P".equalsIgnoreCase(taskType))
{
sql = "SELECT (QUANTITY - CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END ) AS COUNT " +
" FROM PICK_ORD_DET WHERE PICK_ORDER = ?";
}
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refID);
rs = pstmt.executeQuery();
if(rs.next())
{
COUNT = rs.getInt(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if( COUNT > 0)
{
sql = "UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'V' WHERE REF_ID = ? ";
}
else
{
sql = "UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'W' WHERE REF_ID = ? ";
}
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refID);
updateCount = pstmt.executeUpdate();
if(updateCount > 0)
{
System.out.println("Task Has been updated as ["+sql+"]");
}
else
{
System.out.println("sql Not been updated as created["+sql+"]");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e2)
{
e2.printStackTrace();
throw new ITMException(e2);
}
}
return updateCount;
}
//Changed By Pragyan 02-JUL-14 (Issue tracker No 396)To update status as C if consolidated to doc called.start
}
......@@ -905,13 +905,16 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal,
//changed by sankara on 05/06/14 validation for pick dealloc start.
if ( "C".equalsIgnoreCase(pickType) || "M".equalsIgnoreCase(pickType) || "A".equalsIgnoreCase(pickType) )
{
System.out.println("pickOrder:::::"+pickOrder);
System.out.println("lineNoPick:::::"+lineNoPick);
System.out.println("pickOrder::::: Changed By Pragyan["+pickOrder+"]");
System.out.println("lineNoPick:::::Changed By Pragyan["+lineNoPick+"]");
int pickCount = 0;
sql = " SELECT COUNT(*) AS COUNT FROM PICK_ORD_DET PO, PICK_ISS_HDR PH, PICK_ISS_DET PT WHERE PT.PICK_ORDER = PO.PICK_ORDER " +
" AND PT.LINE_NO__ORD = PO.LINE_NO AND PT.PICK_ORDER = PH.PICK_ORDER AND PH.CONFIRMED = 'N' AND ( PO.STATUS <>'C' OR PO.STATUS IS NULL ) " +
" AND (PO.QUANTITY - (CASE WHEN PO.DEALLOC_QTY IS NULL THEN 0 ELSE PO.DEALLOC_QTY END )) > 0 " +
" AND PT.PICK_ORDER = ? AND PT.LINE_NO = ? " ;
//Changed By Pragyan 02-JUL-14 (Issue tracker No 404)To get proper count from pick order and pick line no.
//" AND PT.PICK_ORDER = ? AND PT.LINE_NO = ? " ;
" AND PO.PICK_ORDER = ? AND PO.LINE_NO = ? " ;
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, pickOrder);
pstmt1.setString(2, lineNoPick);
......
......@@ -281,6 +281,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pickOrder = checkNullAndTrim(rs.getString( "PICK_ORDER" ));
lineNoPick = rs.getInt( "LINE_NO__PICK" );
orderType = checkNullAndTrim(rs.getString( "ORDER_TYPE" ));
//Changed By Pragyan 02-JUL-14 Stock To Dock not working for Repl
replOrderLineNo = rs.getInt("ORDER_lINE_NO");
// 09/02/13 manoharan actual quantity (balance quantity) is updated in multiples of number of cases so this has to be taken as the total pick quantity
//Changed by sumit sarkar on 25/07/12 getting actual value from repl_ord_det
//actualQty = rs.getInt( "ACTUAL_QTY" );
......@@ -288,8 +290,10 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
//Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock.start
if (!"D".equals(orderType) && !"H".equals(orderType) && !"L".equals(orderType))
{
//Changed By Pragyan 02-JUL-14 Stock To Dock not working for Repl
//Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock.end
replOrderLineNo = rs.getInt("ORDER_lINE_NO");
//replOrderLineNo = rs.getInt("ORDER_lINE_NO");
if(!"".equalsIgnoreCase(orderType) && ("Q".equals(orderType) || "T".equals(orderType) || "P".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) ))
{
......@@ -596,7 +600,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
/*sql = " SELECT * FROM PICK_ORD_DET P WHERE P.REPL_ORDER = ? AND P.LINE_NO__REPL = ? " +
" AND FN_IS_VALID_PICK_ORDER(P.PICK_ORDER) = 'Y'";*/
sql = "SELECT * FROM PICK_ORD_DET P WHERE P.REPL_ORDER = ? AND P.LINE_NO__REPL =? "
sql = " SELECT * FROM PICK_ORD_DET P WHERE P.REPL_ORDER = ? AND P.LINE_NO__REPL =? "
+ " AND FN_IS_VALID_PICK_ORDER(P.PICK_ORDER) = 'Y' AND (QUANTITY -(CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END)) > 0 "
+ " UNION ALL "
+ " SELECT * FROM PICK_ORD_DET WHERE (REPL_ORDER, LINE_NO__REPL) IN ( "
......
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