Commit c89e8e4d authored by jshinde's avatar jshinde

Request ID:W15GSUN001 Create transaction screen Pallet Request .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98783 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e02f0a33
This diff is collapsed.
/**
* Purpose:Create transaction screen Pallet Request, Request ID: W15GSUN001
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.ejb.ActionHandlerLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
@Local
public interface PalletReqConfLocal extends ActionHandlerLocal
{
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
}
/**
* Purpose:Create transaction screen Pallet Request, Request ID: W15GSUN001
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.ejb.ActionHandlerRemote;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
import java.rmi.RemoteException;
@Remote
public interface PalletReqConfRemote extends ActionHandlerRemote
{
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
}
/**
* Purpose:Create transaction screen Pallet Request, Request ID: W15GSUN001
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.utility.*;
import ibase.webitm.utility.wms.CommonWmsUtil;
import ibase.system.config.*;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.dis.*;
import ibase.webitm.ejb.fin.*;
import java.io.PrintStream;
import java.rmi.RemoteException;
import java.util.*;
import java.util.Date;
import java.text.*;
import java.sql.*;
import javax.ejb.*;
import ibase.webitm.ejb.MasterStatefulLocal;
import javax.naming.InitialContext;
import org.w3c.dom.Document;
@Stateless
public class PalletReqExpiryAct extends ActionHandlerEJB implements PalletReqExpiryActLocal , PalletReqExpiryActRemote
{
/**stockExpiry
* The public function is used to confirm a transaction corresponding to the tran id it takes as an argument
* @param : tranId
* @param : xtraParams
* @throws Exception
*/
public String actionHandler(String actionType, String xmlString,String xmlString1, String objContext, String xtraParams)
throws RemoteException, ITMException
{
Document dom = null;
Document dom1 = null;
String retString = null;
System.out.println("actionHandler:" +actionType);
GenericUtility genericUtility = GenericUtility.getInstance();
try {
if (xmlString != null && xmlString.trim().length() != 0)
{
System.out.println("XML String :" + xmlString);
dom = genericUtility.parseString(xmlString);
}
if (xmlString1 != null && xmlString1.trim().length() != 0)
{
System.out.println("XML String1 :" + xmlString1);
dom1 = genericUtility.parseString(xmlString1);
}
if (actionType.equalsIgnoreCase("EXPIRY"))
{
retString=stockExpiry( dom, dom1, "" , null,false );
}
if (actionType.equalsIgnoreCase("NEXPIRY"))
{
retString=stockNearExpiry( dom, dom1, "" , null,false );
}
System.out.println("actionType:" + actionType + ":");
} catch (Exception e)
{
System.out.println("Exception :PalletReqExpiryAct :actionHandler(String xmlString):" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("returning String from PalletReqExpiryAct : actionHandler" + retString);
return retString;
}
public String stockExpiry( Document dom,Document dom1, String forcedFlag , Connection conn, boolean conStat ) throws Exception
{
String sql = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
String palletNo = null,locCode = null ,status = null;
GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
StringBuffer xmlString = new StringBuffer("<Root>");
try
{
sql = " SELECT D.LOC_CODE AS PALLET_NO ,D.ITEM_CODE,D.SITE_CODE,D.LOT_NO,D.LOT_SL" + " FROM INV_HOLD_DET D,INV_HOLD I ,LOCATION L WHERE D.LOC_CODE=L.LOC_CODE AND I.TRAN_ID = D.TRAN_ID AND HOLD_STATUS != ?" + " AND LOCK_CODE = ?" + "AND L.INV_STAT=?";//EXP_LOCK
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "R");
pstmt.setString(2, "EXP_LOCK");
pstmt.setString(3, "AWMS");
rs = pstmt.executeQuery();
while(rs.next())
{
palletNo = checkNullAndTrim(rs.getString("PALLET_NO"));
String itemCode = checkNullAndTrim(rs.getString("ITEM_CODE"));
String siteCode = checkNullAndTrim(rs.getString("SITE_CODE"));
String lotNo = checkNullAndTrim(rs.getString("LOT_NO"));
String lotSl = checkNullAndTrim(rs.getString("LOT_SL"));
xmlString.append("<Detail>");
xmlString.append("<pallet_no>").append("<![CDATA[").append(palletNo).append("]]>").append("</pallet_no>");
xmlString.append("<item_code>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>");
xmlString.append("<site_code>").append("<![CDATA[").append(siteCode).append("]]>").append("</site_code>");
xmlString.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]>").append("</lot_no>");
xmlString.append("<lot_sl>").append("<![CDATA[").append(lotSl).append("]]>").append("</lot_sl>");
xmlString.append("</Detail>");
}
xmlString.append("</Root>");
rs.close();
pstmt.close();
}
catch (SQLException sqx)
{
System.out.println("The sqlException occure in PalletReqExpiryAct :" + sqx);
throw new ITMException(sqx);
} catch (Exception e)
{
System.out.println("The Exception occure in PalletReqExpiryAct :" + e);
throw new ITMException(e);
} finally
{
try
{
conn.close();
conn = null;
} catch (Exception e)
{
}
}
return xmlString.toString();
}
public String stockNearExpiry( Document dom,Document dom1, String forcedFlag , Connection conn, boolean conStat ) throws Exception
{
String locCode="", status="",palletNo = "";
StringBuffer xmlString = new StringBuffer("<Root>");
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
try
{
String sql = " SELECT D.LOC_CODE AS PALLET_NO ,D.ITEM_CODE,D.SITE_CODE,D.LOT_NO,D.LOT_SL" + " FROM INV_HOLD_DET D,INV_HOLD I ,LOCATION L WHERE D.LOC_CODE=L.LOC_CODE AND I.TRAN_ID = D.TRAN_ID AND HOLD_STATUS != ?" + " AND LOCK_CODE = ?" + "AND L.INV_STAT=?";//NEXP_LOCK
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "R");
pstmt.setString(2, "NEXP_LOCK");
pstmt.setString(3, "AWMS");
ResultSet rs = pstmt.executeQuery();
while(rs.next())
{
palletNo = checkNullAndTrim(rs.getString("PALLET_NO"));
String itemCode = checkNullAndTrim(rs.getString("ITEM_CODE"));
String siteCode = checkNullAndTrim(rs.getString("SITE_CODE"));
String lotNo = checkNullAndTrim(rs.getString("LOT_NO"));
String lotSl = checkNullAndTrim(rs.getString("LOT_SL"));
xmlString.append("<Detail>");
xmlString.append("<pallet_no>").append("<![CDATA[").append(palletNo).append("]]>").append("</pallet_no>");
xmlString.append("<item_code>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>");
xmlString.append("<site_code>").append("<![CDATA[").append(siteCode).append("]]>").append("</site_code>");
xmlString.append("<lot_no>").append("<![CDATA[").append(lotNo).append("]]>").append("</lot_no>");
xmlString.append("<lot_sl>").append("<![CDATA[").append(lotSl).append("]]>").append("</lot_sl>");
xmlString.append("</Detail>");
}
xmlString.append("</Root>");
rs.close();
pstmt.close();
}
catch (SQLException sqx)
{
System.out.println("The sqlException occure in PalletReqExpiryAct :" + sqx);
throw new ITMException(sqx);
}
catch (Exception e)
{
System.out.println("The Exception occure in PalletReqExpiryAct :" + e);
throw new ITMException(e);
}
finally
{
try
{
conn.close();
conn = null;
}
catch (Exception e)
{
}
}
return xmlString.toString();
}
private String checkNullAndTrim( String inputVal )
{
if ( inputVal == null )
{
inputVal = "";
}
else
{
inputVal = inputVal.trim();
}
return inputVal;
}
}
/**
* Purpose:Create transaction screen Pallet Request, Request ID: W15GSUN001
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.ejb.ActionHandlerLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
public interface PalletReqExpiryActLocal extends ActionHandlerLocal
{
public String actionHandler(String actionType, String xmlString, String xmlString1, String objContext, String xtraParams) throws RemoteException,ITMException;
}
/**
* Purpose:Create transaction screen Pallet Request, Request ID: W15GSUN001
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.ejb.ActionHandlerRemote;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
public interface PalletReqExpiryActRemote extends ActionHandlerRemote
{
public String actionHandler(String actionType, String xmlString, String xmlString1, String objContext, String xtraParams) throws RemoteException,ITMException;
}
This diff is collapsed.
/**
* Purpose:Create transaction screen Pallet Request, Request ID: W15GSUN001
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import javax.ejb.*;
@javax.ejb.Local
public interface PalletReqICLocal extends ValidatorLocal
{
public String wfValData() throws RemoteException, ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext,String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String xtraParams,String editFlag) throws RemoteException, ITMException;
public String itemChanged() throws RemoteException, ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged( Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String currentColumn,String editFlag, String xtraParams ) throws RemoteException,ITMException;
}
/**
* Purpose:Create transaction screen Pallet Request, Request ID: W15GSUN001
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import javax.ejb.*;
@javax.ejb.Remote
public interface PalletReqICRemote extends ValidatorRemote
{
public String wfValData() throws RemoteException, ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext,String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String xtraParams,String editFlag) throws RemoteException, ITMException;
public String itemChanged() throws RemoteException, ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged( Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String currentColumn,String editFlag, String xtraParams ) throws RemoteException,ITMException;
}
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