Commit 8d5d84e4 authored by pjain's avatar pjain

chanegd by sankara on 21/06/14 updated deallocaartconf,deallocartprc for sale...

chanegd by sankara on 21/06/14 updated deallocaartconf,deallocartprc for sale order ship status and process fialure from pick dealoocation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95294 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3a77a145
...@@ -653,6 +653,14 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -653,6 +653,14 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
System.out.println("update status in carton_master sucessfully"); System.out.println("update status in carton_master sucessfully");
} }
//changed by sankara on 04/02/14 update carton_master status from pick deallocation end. //changed by sankara on 04/02/14 update carton_master status from pick deallocation end.
//changed by sankara on 21/06/14 update sale order ship status from pick deallocation start.
int shipstatuscount = updatesaleOrdershipStatus(saleOrder,ptcn,conn);
System.out.println("shipstatuscount::::"+shipstatuscount);
if( shipstatuscount > 0 )
{
System.out.println("shipstatuscount["+shipstatuscount+"]");
}
//changed by sankara on 21/06/14 update sale order ship status from pick deallocation end.
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -3436,8 +3444,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -3436,8 +3444,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
System.out.println(" REPL_ORD_DET updated succesfully"); System.out.println(" REPL_ORD_DET updated succesfully");
} }
pstmt.close(); pstmt = null; pstmt.close(); pstmt = null;
//changed by sankara on 21/06/14 not update confirmed in replisshdr start.
sql = " UPDATE REPL_ISS_HDR SET CONFIRMED ='Y', CONF_DATE = ? , EMP_CODE__APRV = ? WHERE REPL_ORDER = ? AND CONFIRMED = 'N'"; /*sql = " UPDATE REPL_ISS_HDR SET CONFIRMED ='Y', CONF_DATE = ? , EMP_CODE__APRV = ? WHERE REPL_ORDER = ? AND CONFIRMED = 'N'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, currDate); pstmt.setTimestamp(1, currDate);
pstmt.setString(2, empCode); pstmt.setString(2, empCode);
...@@ -3446,7 +3454,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -3446,7 +3454,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{ {
System.out.println(" confirmed sussccessfully "); System.out.println(" confirmed sussccessfully ");
} }
pstmt.close(); pstmt = null; pstmt.close(); pstmt = null;*/
//changed by sankara on 21/06/14 not update confirmed in replisshdr end.
//changed by sankara on 16/06/14 for wave_task_det status update from active repl start. //changed by sankara on 16/06/14 for wave_task_det status update from active repl start.
sql = " SELECT COUNT(*) AS COUNT FROM REPL_ORD_DET RO WHERE RO.REPL_ORDER = ? AND ( RO.CANCEL_MODE <> ? OR RO.CANCEL_MODE IS NULL ) " ; sql = " SELECT COUNT(*) AS COUNT FROM REPL_ORD_DET RO WHERE RO.REPL_ORDER = ? AND ( RO.CANCEL_MODE <> ? OR RO.CANCEL_MODE IS NULL ) " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -3934,4 +3943,97 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -3934,4 +3943,97 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
return update; return update;
} }
//changed by sankara on 04/02/14 update carton_master status from pick deallocation end. //changed by sankara on 04/02/14 update carton_master status from pick deallocation end.
//changed by sankara on 21/06/14 update sorder ship_status from pick deallocation start
private int updatesaleOrdershipStatus(String saleOrder,String ptcn,Connection conn) throws ITMException
{
System.out.println("sankara for ship status for inside method.............");
String sql = "",sql1 = "";
PreparedStatement pstmt = null,pstmt1= null;
ResultSet rs = null;
double allocqty = 0.0;
double despqty = 0.0;
String errString = "";
int updatecount = 0;
System.out.println("hai");
try
{
System.out.println("saleOrder::::::::"+saleOrder);
sql = " SELECT SUM(QTY_ALLOC) AS ALLOC_QTY, SUM(QTY_DESP) AS DESP_QTY FROM SORDITEM WHERE SALE_ORDER = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, saleOrder);
rs = pstmt.executeQuery();
if(rs.next())
{
allocqty = rs.getDouble("ALLOC_QTY");
System.out.println("allocqty:::::"+allocqty);
despqty = rs.getDouble("DESP_QTY");
System.out.println("despqty:::::"+despqty);
}
if(allocqty == 0 && despqty == 0 )
{
System.out.println("from sorditem.......");
sql1 = " UPDATE SORDER SET SHIP_STATUS = ? WHERE SALE_ORDER = ? AND SHIP_STATUS <> ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, "O");
pstmt1.setString(2, saleOrder);
pstmt1.setString(3, "C");
updatecount = pstmt1.executeUpdate();
if(updatecount > 0)
{
System.out.println("updatecount["+updatecount+ "saleOrder["+saleOrder+"]");
}
pstmt1.close();
pstmt1 = null;
}
else if( despqty > 0 )
{
sql1 = " UPDATE SORDER SET SHIP_STATUS = ? WHERE SALE_ORDER = ? AND SHIP_STATUS <> ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, "C");
pstmt1.setString(2, saleOrder);
pstmt1.setString(3, "C");
updatecount = pstmt1.executeUpdate();
if(updatecount > 0)
{
System.out.println(" SORDER UPDATE COUNT DESP EXIST["+updatecount+"]");
}
pstmt1.close();
pstmt1 = null;
}
System.out.println("sankara......");
}
catch(Exception e)
{
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
finally
{
try
{
if( rs != null )
{
rs.close(); rs = null;
}
if( pstmt != null )
{
pstmt.close(); pstmt = null;
}
if( pstmt1 != null )
{
pstmt1.close(); pstmt1 = null;
}
}
catch( Exception ex)
{
ex.printStackTrace();
errString = ex.getMessage();
throw new ITMException(ex);
}
}
return updatecount;
}
//changed by sankara on 21/06/14 update sorder ship_status from pick deallocation end.
} }
...@@ -1024,8 +1024,19 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal, ...@@ -1024,8 +1024,19 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal,
{ {
conn.rollback(); conn.rollback();
System.out.println("Inside Block for ErrOr Not Found---------------"); System.out.println("Inside Block for ErrOr Not Found---------------");
//changed by sankara on 21/06/14 display proper error details
String errorString = errString;
System.out.println("errorStringsankara:::::::::"+errorString);
errString="VTPRCERR"; errString="VTPRCERR";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn); errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
//changed by sankara on 21/06/14 display proper error details start.
if( errString.trim().length() > 0 )
{
System.out.println("calling our own ex method......");
errString = printExceptionMessage( errString, conn, errorString);
return errString;
}
//changed by sankara on 21/06/14 display proper error details end.
} }
//} //}
...@@ -2220,5 +2231,46 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal, ...@@ -2220,5 +2231,46 @@ public class DeallocArtPrc extends ProcessEJB implements WaveGenerationPrcLocal,
} }
return mainStr; return mainStr;
} }
//changed by sankara on 21/06/14 for display proper error details bug fixing start.
private String printExceptionMessage( String errString, Connection conn, String errorString) throws ITMException
{
String mainStr = "";
String errMessage = "";
String begPart = "";
String firstdescr = "";
String seconddescr = "";
String endDesc = "";
try
{
System.out.println("errString------->"+errString);
System.out.println("errorString::::::"+errorString);
if(errString != null && (errString.indexOf("</message>")+10 ) != -1 )
{
begPart = errString.substring(0,errString.indexOf("</message>")+10);
}
if(errString != null && errString.lastIndexOf("<description>") != -1 && (errString.indexOf("<description>")+13)!= 1 )
{
firstdescr = errString.substring(errString.lastIndexOf("<description>"), errString.indexOf("<description>")+13);
}
if(errorString !=null && (errorString.indexOf("<description>")+13) != -1 && errorString.indexOf("</description>") != -1 )
{
seconddescr = errorString.substring(errorString.indexOf("<description>")+13, errorString.indexOf("</description>"));
}
if(errString.indexOf("</description>") != -1)
{
endDesc = errString.substring(errString.indexOf("</description>"));
}
mainStr = begPart + firstdescr + seconddescr + endDesc ;
System.out.println("mainStr::::::::"+mainStr);
begPart = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return mainStr;
}
//changed by sankara on 21/06/14 for display proper error details bug fixing end.
//changed by sankara on 05/06/14 for pick deallocation end. //changed by sankara on 05/06/14 for pick deallocation end.
} }
\ No newline at end of file
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