Commit 8f1effd9 authored by pjain's avatar pjain

reolIssueConf.java file change by Dhanraj as per pragan sir.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95369 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3f0e1c2a
......@@ -187,7 +187,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
//Changed by sumit on 27/09/12 initialize itmVolumeMap object
itmVolumeMap = new HashMap();
sql = "SELECT CONFIRMED, REPL_ORDER FROM REPL_ISS_HDR WHERE TRAN_ID = ?";
//Changed by Pragyan on 27/06/14 for update nowait.start
/*sql = "SELECT CONFIRMED, REPL_ORDER FROM REPL_ISS_HDR WHERE TRAN_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
......@@ -197,7 +198,29 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
replOrder = rs.getString( "REPL_ORDER" );
}
rs.close();rs = null;
pstmt.close();pstmt = null;
pstmt.close();pstmt = null;*/
//sql = "SELECT CONFIRMED, REPL_ORDER FROM REPL_ISS_HDR WHERE TRAN_ID = ?";
sql = "SELECT CONFIRMED, REPL_ORDER FROM REPL_ISS_HDR WHERE TRAN_ID = ? FOR UPDATE NOWAIT";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
confirmed = rs.getString( "CONFIRMED" );
replOrder = rs.getString( "REPL_ORDER" );
}
else
{
retString = itmDBAccess.getErrorString("","VTLCKERR","");
}
if (retString != null && retString.trim().length() > 0)
{
isError = true;
return retString;
}
//Changed by Pragyan on 27/06/14 for update nowait end.
// 16/10/11 manoharan
if (confirmed == null)
{
......@@ -665,6 +688,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
else
{
retString = itmDBAccess.getErrorString("","RECNOTSORA","");
//Changed by Pragyan on 27/06/14 to check isError true .start
isError = true;
return retString;
}
rs1.close();
......@@ -752,6 +777,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
}
else
{
//Changed by Pragyan on 27/06/14 to check isError true .start
isError = true;
throw new Exception(" Update fail in sordalloc");
}
pstmtUpd.close(); pstmtUpd = null;
......@@ -868,6 +895,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
}
else
{
//Changed by Pragyan on 27/06/14 to check isError true
isError = true;
throw new Exception(" INSERTION FAIL IN SORDALLOC TABLE");
}
pstmtUpd.close(); pstmtUpd = null;
......@@ -1012,6 +1041,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
}
else
{
//Changed by Pragyan on 27/06/14 to check isError true
isError = true;
throw new Exception(" Update fail in sordalloc");
}
pstmtUpd.close(); pstmtUpd = null;
......@@ -1062,6 +1093,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
}
else
{
//Changed by Pragyan on 27/06/14 to check isError true
isError = true;
throw new Exception(" INSERTION FAIL IN SORDALLOC TABLE");
}
pstmtUpd.close(); pstmtUpd = null;
......@@ -1098,6 +1131,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
}
else
{
//Changed by Pragyan on 27/06/14 to check isError true
isError = true;
throw new Exception(" Update fail in sordalloc");
}
pstmtUpd.close(); pstmtUpd = null;
......@@ -1133,7 +1168,20 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmtReplUpd.setString(3, replOrder);
pstmtReplUpd.setInt(4, replOrderLineNo);
int updCntRepl = pstmtReplUpd.executeUpdate();
//Changed by Pragyan on 27/06/14 to check isError true .start
if(updCntRepl > 0)
{
System.out.println("Updating Replenishment change in location and lot sl ["+updCntRepl+"]");
}
else
{
//Changed by Pragyan on 27/06/14 to check isError true
isError = true;
throw new Exception(" Update REPL_ORD_DET Location cod to "+locCodeTo+" and Lot Sl["+lotSlNew+"]replOrder["+replOrder+"]Repl Order Line No["+replOrderLineNo+"] update Fail");
}
//Changed by Pragyan on 27/06/14 to check isError true .end
if(pstmtReplUpd != null)
{
......@@ -1238,7 +1286,9 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
}//while(rs.next())
rs.close();rs = null;
pstmt.close();pstmt = null;
if ( retString == null || retString.trim().length() == 0 )
//Changed by Pragyan on 27/06/14 to check isError true .start
//if ( retString == null || retString.trim().length() == 0 )
if ( !isError && (retString == null || retString.trim().length() == 0) )
{
// //added by kunal mandhre on 06/JUN/12 - WM1ESUN007
// updateSql = "update pick_ord_det set lot_sl__new = ? where pick_order = ? and line_no = ? ";
......@@ -1267,8 +1317,15 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
if( updCnt > 0 )
{
System.out.println( updCnt + " rows updated successfully" );
System.out.println(" Update REPL_ISS_DET CONFIRMED = 'Y',CONF_DATE["+currDate+"] and EMP_CODE__APRV["+empCode+"] update count["+updCnt+"]");
}
//Changed by Pragyan on 27/06/14 to check isError true .start
else
{
isError = true;
throw new Exception(" Update REPL_ISS_DET CONFIRMED = 'Y',CONF_DATE["+currDate+"] and EMP_CODE__APRV["+empCode+"] update Fail");
}
//Changed by Pragyan on 27/06/14 to check isError true .end
pstmt.close();pstmt = null;
//changed by Rohan on 21-03-13 for update actual qty to zero when scan is confirm.start
......@@ -1303,6 +1360,13 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
{
System.out.println("Repl Order"+replOrder1+"Line no"+lineNo1+"Update with actual qty 0");
}
//Changed by Pragyan on 27/06/14 to check isError true .start
else
{
isError = true;
throw new Exception(" Update REPL_ORD_DET ACTUAL_QTY = 'Y',REPL_ORDER["+replOrder1+"] and LINE_NO["+lineNo1+"] update Fail");
}
//Changed by Pragyan on 27/06/14 to check isError true .end
pstmt.clearParameters();
}
......@@ -1336,8 +1400,16 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
if( updCnt > 0 )
{
System.out.println( updCnt + " rows updated successfully" );
System.out.println(" Update WAVE_TASK_DET STATUS = 'Y',WAVE_STATUS = 'V' REPL_ORDER ["+replOrder+"] update COUNT["+updCnt+"]");
}
//Changed by Pragyan on 27/06/14 to check isError true .start
else
{
isError = true;
throw new Exception(" Update WAVE_TASK_DET STATUS = 'Y',WAVE_STATUS = 'V' REPL_ORDER ["+replOrder+"] update Fail");
}
//Changed by Pragyan on 27/06/14 to check isError true .end
pstmt.close();pstmt = null;
//Changed by sumit on 31/07/12 for updating wave_status for next task start.
......@@ -1582,10 +1654,20 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
invAllocTrace = null;
System.out.println("manohar 18/09/12 conStat [" + conStat + "] isError [" + isError + "]");
if( !isError && conStat == true )
{
//Changed by Pragyan on 27/06/14 to check if issue confirmation .start
if(isReplIssConfirmed(tranId,conn))
{
conn.commit();// For committing the transaction update
retString = itmDBAccess.getErrorString("","REPISSCONF","");
}
else
{
conn.rollback();
retString = itmDBAccess.getErrorString("","VTRISSNCNF","");
}
//Changed by Pragyan on 27/06/14 for to check if issue confirmation.end
}
//changed by chaitali 12/11/11
//else
else if(conStat == true || isError)
......@@ -1593,6 +1675,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
conn.rollback();
}
if(rs != null )
{
rs.close();
......@@ -2179,4 +2262,65 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
return mainStr;
}
//Changed By Pragyan 17-APR-14 To return error string for Hold Qty from the stock.end
//Changed by Pragyan on 27/06/14 to check replenishment issue confirmation status.start
private boolean isReplIssConfirmed(String tranID , Connection conn) throws ITMException
{
String sql = "";
String confirmFlag = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
boolean isCofirmed = false;
try
{
sql = " SELECT CONFIRMED FROM REPL_ISS_HDR WHERE TRAN_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranID);
rs = pstmt.executeQuery();
while(rs.next())
{
confirmFlag = rs.getString("CONFIRMED");
System.out.println(" confirmFlag of repl_iss is ["+confirmFlag+"]");
if( "Y".equalsIgnoreCase(confirmFlag))
{
return isCofirmed = true;
}
else
{
return isCofirmed;
}
}
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 isCofirmed;
}
//Changed by Pragyan on 27/06/14 to check replenishment issue confirmation status.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