Commit 6f6970d9 authored by smestry's avatar smestry

W15ESUN005, Changed by Sneha. Updated the Warehouse User Activity dashboard.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98489 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8765129a
package ibase.webitm.bean.wms; package ibase.webitm.bean.wms;
import ibase.webitm.ejb.wms.*; import ibase.webitm.ejb.wms.*;
import ibase.system.config.AppConnectParm;
import ibase.system.config.ConnDriver;
import ibase.webitm.utility.ITMException;
import java.io.Serializable;
import java.rmi.RemoteException;
import java.sql.PreparedStatement;
import javax.naming.InitialContext;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.ResultSet;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.io.Serializable; import java.io.Serializable;
...@@ -97,5 +109,25 @@ public class LocationStockOccuBean implements Serializable ...@@ -97,5 +109,25 @@ public class LocationStockOccuBean implements Serializable
return xmlData; return xmlData;
} }
//Changed by Sneha, for display of of site code on 18-07-2015, Request ID: D15DKAT009
public String getSiteCode()
{
String xmlData = "";
try
{
xmlData = locationStockOccupancyRemote.getSiteCode();
}
catch(Exception e)
{
System.out.println("Exception :ibase.dashboard.scm.bean::EORLocationStockBean:getLocPhyArea()"+e);
e.printStackTrace();
xmlData = null;
}
System.out.println("in EORLocationStockBean and getSiteCode()");
return xmlData;
}
//Changed by Sneha, for display of of site code on 18-07-2015, Request ID: D15DKAT009
} }
...@@ -39,10 +39,10 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -39,10 +39,10 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
System.out.println("Calling EJB getLocPhyArea ---------"); System.out.println("Calling EJB getLocPhyArea ---------");
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;
//Sneha
sql = "select distinct loc_phy_area from location where loc_phy_area is not null order by loc_phy_area "; //Changed by Sneha, for display of Lock Code on 16-07-2015, Request ID: W15ESUN005
//sql = "select distinct loc_phy_area from location order by loc_phy_area "; //sql = "select distinct loc_phy_area from location order by loc_phy_area ";
sql = "select distinct loc_phy_area from location where loc_phy_area is not null order by loc_phy_area ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
System.out.println("getLocPhyArea() ::::::::::::::: "); System.out.println("getLocPhyArea() ::::::::::::::: ");
...@@ -104,11 +104,10 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -104,11 +104,10 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
System.out.println("Calling EJB getSelectedArea ---------"); System.out.println("Calling EJB getSelectedArea ---------");
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;
//Sneha
sql = "select distinct loc_phy_area from location where loc_phy_area is not null order by loc_phy_area ";
//sql = " select distinct loc_phy_area from location order by loc_phy_area ";
//Changed by Sneha, for display of Lock Code on 16-07-2015, Request ID: W15ESUN005
//sql = " select distinct loc_phy_area from location order by loc_phy_area ";
sql = "select distinct loc_phy_area from location where loc_phy_area is not null order by loc_phy_area ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
System.out.println("getSelectedArea() ::::::::::::::: "); System.out.println("getSelectedArea() ::::::::::::::: ");
...@@ -258,29 +257,6 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -258,29 +257,6 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
xmlData.append("<hold_qty>").append("<![CDATA[" + rs1.getDouble("hold_qty") + "]]>").append("</hold_qty>"); xmlData.append("<hold_qty>").append("<![CDATA[" + rs1.getDouble("hold_qty") + "]]>").append("</hold_qty>");
//Changed by Sneha, for display of Lock Code on 16-07-2015, Request ID: D15DKAT009
if(rs1.getDouble("hold_qty") > 0.00)
{
sql = "Select regexp_replace((ddf_get_inv_lock_codes(?, ?, ?)), ',', ' ', "
+ "length((ddf_get_inv_lock_codes(?, ?, ?))) - 1) as lock_code from dual ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, rs1.getString("item_code"));
pstmt2.setString(2, rs1.getString("lot_no"));
pstmt2.setString(3, rs1.getString("lot_sl"));
pstmt2.setString(4, rs1.getString("item_code"));
pstmt2.setString(5, rs1.getString("lot_no"));
pstmt2.setString(6, rs1.getString("lot_sl"));
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
xmlData.append("<lock_code>").append("<![CDATA[" + checkNull(rs2.getString("lock_code")) + "]]>").append("</lock_code>");
}
pstmt2.close();
rs2.close();
}
//End by Sneha, for display of Lock Code on 16-07-2015, Request ID: D15DKAT009
xmlData.append("<alloc_qty>").append("<![CDATA[" + rs1.getDouble("alloc_qty") + "]]>").append("</alloc_qty>"); xmlData.append("<alloc_qty>").append("<![CDATA[" + rs1.getDouble("alloc_qty") + "]]>").append("</alloc_qty>");
if (rs1.getDate("mfg_date") != null) if (rs1.getDate("mfg_date") != null)
...@@ -307,6 +283,30 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -307,6 +283,30 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
xmlData.append("<retest_date>").append("<![CDATA[ ]]>").append("</retest_date>"); xmlData.append("<retest_date>").append("<![CDATA[ ]]>").append("</retest_date>");
} }
xmlData.append("<unit>").append("<![CDATA[" + rs1.getString("unit") + "]]>").append("</unit>"); xmlData.append("<unit>").append("<![CDATA[" + rs1.getString("unit") + "]]>").append("</unit>");
//Changed by Sneha, for display of Lock Code on 16-07-2015, Request ID: W15ESUN005
if(rs1.getDouble("hold_qty") > 0.00)
{
sql = "Select regexp_replace((ddf_get_inv_lock_codes(?, ?, ?)), ',', ' ', "
+ "length((ddf_get_inv_lock_codes(?, ?, ?))) - 1) as lock_code from dual ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, rs1.getString("item_code"));
pstmt2.setString(2, rs1.getString("lot_no"));
pstmt2.setString(3, rs1.getString("lot_sl"));
pstmt2.setString(4, rs1.getString("item_code"));
pstmt2.setString(5, rs1.getString("lot_no"));
pstmt2.setString(6, rs1.getString("lot_sl"));
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
xmlData.append("<lock_code>").append("<![CDATA[" + checkNull(rs2.getString("lock_code")) + "]]>").append("</lock_code>");
}
pstmt2.close();
rs2.close();
}
//End by Sneha, for display of Lock Code on 16-07-2015, Request ID: W15ESUN005
xmlData.append("</stock>"); xmlData.append("</stock>");
} }
...@@ -408,5 +408,79 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -408,5 +408,79 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
} }
return input; return input;
} }
@Override
public String getSiteCode() throws RemoteException, ITMException
{
System.out.println(" in getSiteCode method os LocationStockOccupancy ");
String sql = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData = null;
String siteCode = "";
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
// sql = "select distinct loc_phy_area from location order by loc_phy_area ";
sql = "SELECT VAR_VALUE FROM DISPARM WHERE PRD_CODE='999999' AND VAR_NAME='SITE_CODE'";
System.out.println(" sql is =" + sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next())
{
siteCode = rs.getString("VAR_VALUE");
}
String[] siteCodeArr = siteCode.split(",");
xmlData = new StringBuffer("<?xml version='1.0'?> <Root>");
xmlData.append("<Detail>");
for (int i = 0; i < siteCodeArr.length; i++)
{
xmlData.append("<SITE_CODE>").append("<![CDATA[" + siteCodeArr[i] + "]]>").append("</SITE_CODE>");
}
xmlData.append("</Detail>");
xmlData.append("</Root>");
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} catch (Exception e)
{
System.out.println("Exception :ibase.dashboard.wms.bean:LocationStockOccupancy:getSiteCode()" + e);
e.printStackTrace();
throw new ITMException(e);
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
System.out.println("xmlData.toString() in getSiteCode =" + xmlData.toString());
return xmlData.toString();
}
} }
...@@ -13,4 +13,7 @@ public interface LocationStockOccupancyLocal extends ValidatorLocal ...@@ -13,4 +13,7 @@ public interface LocationStockOccupancyLocal extends ValidatorLocal
public String getLocPhyArea() throws RemoteException, ITMException; public String getLocPhyArea() throws RemoteException, ITMException;
public String getLocDtl(String locPhyArea,String loginCode,String locationRange) throws RemoteException, ITMException; public String getLocDtl(String locPhyArea,String loginCode,String locationRange) throws RemoteException, ITMException;
public String getSelectedArea() throws RemoteException, ITMException; public String getSelectedArea() throws RemoteException, ITMException;
//Changed by Sneha, for display of of site code on 18-07-2015, Request ID: D15DKAT009
public String getSiteCode() throws RemoteException, ITMException;
//End by Sneha, for display of of site code on 18-07-2015, Request ID: D15DKAT009
} }
...@@ -13,5 +13,9 @@ public interface LocationStockOccupancyRemote extends ValidatorRemote ...@@ -13,5 +13,9 @@ public interface LocationStockOccupancyRemote extends ValidatorRemote
public String getLocPhyArea() throws RemoteException, ITMException; public String getLocPhyArea() throws RemoteException, ITMException;
public String getLocDtl(String locPhyArea,String loginCode,String locationRange) throws RemoteException, ITMException; public String getLocDtl(String locPhyArea,String loginCode,String locationRange) throws RemoteException, ITMException;
public String getSelectedArea() throws RemoteException, ITMException; public String getSelectedArea() throws RemoteException, ITMException;
//Changed by Sneha, for display of of site code on 18-07-2015, Request ID: D15DKAT009
public String getSiteCode() throws RemoteException, ITMException;
//End by Sneha, for display of of site code on 18-07-2015, Request ID: D15DKAT009
} }
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