Commit 5ef27216 authored by bpandey's avatar bpandey

Add as HOLD button with hrf link 'ShipmentDetails'


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93166 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b55b2b01
...@@ -3,6 +3,7 @@ package ibase.webitm.ejb.dis.adv; ...@@ -3,6 +3,7 @@ package ibase.webitm.ejb.dis.adv;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.*; import java.util.*;
import java.sql.*; import java.sql.*;
import java.sql.Date;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import org.w3c.dom.*; import org.w3c.dom.*;
import javax.ejb.*; import javax.ejb.*;
...@@ -18,6 +19,9 @@ import ibase.webitm.ejb.dis.*; //13-07-10 ...@@ -18,6 +19,9 @@ import ibase.webitm.ejb.dis.*; //13-07-10
import javax.xml.transform.*; import javax.xml.transform.*;
import javax.xml.transform.dom.*; import javax.xml.transform.dom.*;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
import com.borland.enterprise.xml.toolkit.impl.ear.v1_3.std.Java;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer; import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
...@@ -28,7 +32,8 @@ import javax.xml.transform.TransformerConfigurationException; ...@@ -28,7 +32,8 @@ import javax.xml.transform.TransformerConfigurationException;
@Stateless // added for ejb3 @Stateless // added for ejb3
public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, DespatchActRemote public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, DespatchActRemote
{ {
ibase.webitm.utility.GenericUtility genericUtility = ibase.webitm.utility.GenericUtility.getInstance(); ibase.webitm.utility.GenericUtility genericUtility = ibase.webitm.utility.GenericUtility.getInstance();
String currentActionType="",packInstrStock="",packInstrInvPackRcp=""; String currentActionType="",packInstrStock="",packInstrInvPackRcp="";
/*public void ejbCreate() throws RemoteException, CreateException /*public void ejbCreate() throws RemoteException, CreateException
...@@ -58,6 +63,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D ...@@ -58,6 +63,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
Document dom = null; Document dom = null;
try try
{ {
System.out.println("Call method =Action handler");
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
if(xmlString != null && xmlString.trim().length()!=0) if(xmlString != null && xmlString.trim().length()!=0)
{ {
...@@ -76,7 +82,124 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D ...@@ -76,7 +82,124 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
} }
return retString; return retString;
} }
//Call new method actionHandler with three parameters by Birendra Pandey
public String actionHandler(String tranId, String forcedFlag,String xtraParams) throws RemoteException,ITMException
{
String retString = "";
System.out.println("Call new method actionHandler with three parameters");
System.out.println("Tran_ID="+tranId);
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String status="";
String confirmed="";
int upcount=0;
String sql="";
java.sql.Timestamp currDate=new java.sql.Timestamp(System.currentTimeMillis());
System.out.println("GET TIME===="+currDate);
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
try {
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
sql="SELECT STATUS,CONFIRMED FROM DESPATCH WHERE DESP_ID= ?";
// (STATUS='O' OR STATUS=NULL) AND (CONFIRMED='N' OR CONFIRMED=NULL) AND;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if ( rs.next() )
{
status = rs.getString("STATUS");
confirmed = rs.getString("CONFIRMED");
}
status =((status==null)?"":status.trim());
confirmed =((confirmed==null)?"":confirmed.trim());
rs.close();
rs=null;
pstmt.close();
pstmt=null;
if ((status.equalsIgnoreCase("O") || status.equalsIgnoreCase("")) && (confirmed.equalsIgnoreCase("N") || confirmed.equalsIgnoreCase("")) )
{
sql="UPDATE DESPATCH SET STATUS='H',status_date= ? WHERE DESP_ID= ?";
pstmt =conn.prepareStatement(sql);
pstmt.setTimestamp(1,currDate);
pstmt.setString(2,tranId);
upcount =pstmt.executeUpdate();
if(upcount>0){
retString = itmDBAccess.getErrorString("","VTREORG4 ","","",conn);
}
else{
retString = itmDBAccess.getErrorString("","VTENTNOTF ","","",conn);
}
}
else
{
retString = itmDBAccess.getErrorString("","INVTR","","",conn);
}
}
catch(SQLException e)
{
System.out.println("Exception : Dispatch : actionHandler " +e.getMessage());
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
throw new ITMException(e);
}
catch (Exception e)
{
System.out.println("Exception : Dispatch : actionHandler " +e.getMessage());
try {
conn.rollback();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
throw new ITMException(e);
}
finally
{
try
{
conn.close();
conn = null;
rs.close();
rs = null;
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if( rs != null)
{
rs.close();
rs = null;
}
}
catch(Exception e){}
}
return retString;
}
//End of method actionHandler with three parameters
public String actionHandler(String actionType, String xmlString, String xmlString1, String objContext, String xtraParams) throws RemoteException,ITMException public String actionHandler(String actionType, String xmlString, String xmlString1, String objContext, String xtraParams) throws RemoteException,ITMException
{ {
Document dom = null; Document dom = null;
...@@ -126,6 +249,8 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D ...@@ -126,6 +249,8 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
retString = actionPacking(dom, dom1, objContext, xtraParams); retString = actionPacking(dom, dom1, objContext, xtraParams);
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -1955,7 +2080,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D ...@@ -1955,7 +2080,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
+"AND INV_PACK_RCP.LOT_NO = STOCK.LOT_NO " +"AND INV_PACK_RCP.LOT_NO = STOCK.LOT_NO "
+"AND INV_PACK_RCP.LOT_SL = STOCK.LOT_SL " +"AND INV_PACK_RCP.LOT_SL = STOCK.LOT_SL "
+"AND INV_PACK.ORDER_NO IN(" +orderNo+") " +"AND INV_PACK.ORDER_NO IN(" +orderNo+") "
+"AND INV_PACK.ORDER_TYPE in ('S','I') " +"AND INV_PACK.ORDER_TYPE = 'I' "
+"AND INV_PACK.CONFIRMED = 'Y' " +"AND INV_PACK.CONFIRMED = 'Y' "
+"AND STOCK.QUANTITY >= INV_PACK_RCP.QUANTITY " +"AND STOCK.QUANTITY >= INV_PACK_RCP.QUANTITY "
+"ORDER BY INV_PACK.TRAN_DATE ,INV_PACK.TRAN_ID,INV_PACK_RCP.LINE_NO ASC "; +"ORDER BY INV_PACK.TRAN_DATE ,INV_PACK.TRAN_ID,INV_PACK_RCP.LINE_NO ASC ";
......
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