Commit 231e873f authored by smestry's avatar smestry

W15FSUN008, Create transaction screen Palletization and palletization Confirm for AWMS.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98794 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 31923cc5
......@@ -57,7 +57,6 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{
System.out.println("::::::::::::::::: Inside postSave for palletization confirm :::::::::::::::: ");
System.out.println("::::::::::::::::: Inside if loop for connection :::::::::::::::: ");
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
......@@ -395,9 +394,78 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
return tranId;
}
/*
public HashMap getInterface2Data(String itemCode, Connection conn, String siteCode) throws ITMException, SQLException
{
HashMap hm = new HashMap();
PreparedStatement pstmt=null;
ResultSet rs = null;
String sql = "";
String familyGrp = "", qcType = "", stroPref = "";
try
{
sql = "SELECT LOC_ZONE__PREF, PROC_MTH, ANALYSIS_CLASS FROM SITEITEM WHERE ITEM_CODE = ? and site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
familyGrp = rs.getString("LOC_ZONE__PREF");
qcType = rs.getString("PROC_MTH");
stroPref = rs.getString("ANALYSIS_CLASS");
}
rs.close();rs = null;
pstmt.close();pstmt = null;
sql = "SELECT LOC_ZONE__PREF, PROC_MTH, ANALYSIS_CLASS FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
if(familyGrp == null || familyGrp.length() <= 0)
{
familyGrp = rs.getString("LOC_ZONE__PREF");
}
if(qcType == null || qcType.length() <= 0)
{
qcType = rs.getString("PROC_MTH");
}
if(stroPref == null || stroPref.length() <= 0)
{
stroPref = rs.getString("ANALYSIS_CLASS");
}
}
rs.close();rs = null;
pstmt.close();pstmt = null;
hm.put("LOC_ZONE__PREF", familyGrp);
hm.put("PROC_MTH", qcType);
hm.put("ANALYSIS_CLASS", stroPref);
}
catch(Exception e)
{
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
}
return hm;
}
*/
private void confirm( String tranId, String siteCode, Connection conn ) throws ITMException, SQLException
{
String errString = "", sql = "", interfaceTranId = "", tranDate = "", objName = "", invStat = "", available = "";
String errString = "", sql = "", interfaceTranId = "", tranDate = "", objName = "", invStat = "", available = "", familyGrp = "", qcType = "",
stroPref = "";
double quantity = 0, holdQuantity = 0;
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null, pstmt3 = null;
ResultSet rs = null, rs1 = null, rs2 = null, rs3 = null;
......@@ -431,7 +499,6 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
pstmt.setTimestamp(2, new Timestamp(System.currentTimeMillis()));
pstmt.setString(3, tranId);
pstmt.executeUpdate();
System.out.println("Confirmed the transaction in pallet_hdr table for tran_id ::::::::: " + tranId);
pstmt.close();
pstmt = null;
......@@ -444,11 +511,13 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
while(rs.next())
{
sql = "select hold_qty from stock where quantity > 0 and site_code = ? and loc_code = ? and "
+ "item_code = ? ";
+ "item_code = ? and lot_no = ? and lot_sl = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, rs.getString("SITE_CODE"));
pstmt1.setString(2, rs.getString("LOC_CODE"));
pstmt1.setString(3, rs.getString("ITEM_CODE"));
pstmt1.setString(4, rs.getString("LOT_NO"));
pstmt1.setString(5, rs.getString("LOT_SL"));
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
......@@ -459,8 +528,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
pstmt1 = null;
rs1.close();
rs1 = null;
if(holdQuantity > 0)
if(holdQuantity >= 0)
{
System.out.println("inside hold quantity greater than zero :::::::::::::::::: ");
......@@ -505,62 +574,23 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
System.out.println("invStat in 3rd if::::::::::::: " + invStat);
}
}
System.out.println("invStat final ::::::::::::: " + invStat);
/*sql = "select available from invstat where inv_stat = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, rs.getString("INV_STAT"));
rs1 = pstmt1.executeQuery();
if (rs1.next())
else
{
available = checkNullAndTrim(rs1.getString("available"));
}
System.out.println("available ::::::::::::: " + available);
pstmt1.close();
pstmt1 = null;
rs1.close();
rs1 = null;*/
/*
sql = "select sum(quantity) as QTY, sum(hold_qty) as HOLD_QTY from stock where quantity > 0 and site_code = ? and loc_code = ? and "
+ "item_code = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, rs.getString("SITE_CODE"));
pstmt1.setString(2, rs.getString("LOC_CODE"));
pstmt1.setString(3, rs.getString("ITEM_CODE"));
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
quantity = rs1.getDouble("QTY");
holdQuantity = rs1.getDouble("HOLD_QTY");
}
System.out.println("quantity ::::::::::::: " + quantity);
System.out.println("holdQuantity ::::::::::::: " + holdQuantity);
pstmt1.close();
pstmt1 = null;
rs1.close();
rs1 = null;*/
/*
if("Y".equalsIgnoreCase(available) && quantity == holdQuantity)
{
System.out.println("invStat in 1st if ::::::::::::: " + invStat);
invStat = "H";
}
else if("Y".equalsIgnoreCase(available))
{
System.out.println("invStat in 2nd if::::::::::::: " + invStat);
invStat = "A";
System.out.println("inside else :::::::::::::::::: ");
}
else if(quantity == holdQuantity)
{
System.out.println("invStat in 3rd if ::::::::::::: " + invStat);
invStat = "H";
}*/
System.out.println("invStat final ::::::::::::: " + invStat);
interfaceTranId = generateTranTd("w_interface2", tranDate, siteCode, conn);
System.out.println("interface2TranId ::::::::::::: " + interfaceTranId);
HashMap hm = new HashMap();
/*HashMap hm1 = new HashMap();
hm1 = getInterface2Data(rs.getString("ITEM_CODE"), conn, siteCode);
familyGrp = (String) hm1.get("LOC_ZONE__PREF");
qcType = (String) hm1.get("PROC_MTH");
stroPref = (String) hm1.get("ANALYSIS_CLASS");*/
hm.put("IN_OUT", "I");
hm.put("ERR_COD", "");
......@@ -590,7 +620,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
hm.put("REF_LINE_NO", "");
interfaceArrList.add(hm);
}
commonWmsUtility.updateAwmsInterface(interfaceArrList, conn);
System.out.println("Inserted into interface2 table ::::::::::::: ");
......
This diff is collapsed.
/**
* PURPOSE : Local Interface for PalletizationConfIC component
* AUTHOR : Sneha Mestry
* DATE : 12-10-2015
*/
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 PalletizationConfICLocal 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 currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String xtraParams) 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 : Remote Interface for PalletizationConfIC component
* AUTHOR : Sneha Mestry
* DATE : 12-10-2015
*/
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 PalletizationConfICRemote 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 currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String xtraParams) 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