Commit 76778325 authored by smestry's avatar smestry

Changed by Sneha. Updated the Warehouse User Activity dashboard.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98435 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0f724f2a
......@@ -22,7 +22,6 @@ public class LocationStockOccuBean implements Serializable
System.out.println("In LocationStockOccuBean ::::::::::");
locationStockOccupancyRemote = (LocationStockOccupancyRemote) ctx.lookup("ibase/LocationStockOccupancy/remote");
System.out.println("instance created");
}
catch(Exception e)
{
......
......@@ -14,5 +14,10 @@ import org.json.simple.JSONObject;
@Local
public interface ConsignmentDetailsLocal extends ValidatorLocal
{
public JSONObject getConsignmentDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException;
//public JSONObject getConsignmentDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException;
//Changed by Sneha on 21-07-2015, for date parameter Request ID: D15DKAT009
public JSONObject getConsignmentDetails(String dataSourceName, String siteCode, String fromDate, String toDate) throws RemoteException, ITMException;
//End by Sneha on 21-07-2015, for date parameter Request ID: D15DKAT009
}
......@@ -6,6 +6,8 @@
package ibase.webitm.ejb.wms;
import java.rmi.RemoteException;
import java.util.Date;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
......@@ -14,6 +16,9 @@ import org.json.simple.JSONObject;
@Remote
public interface ConsignmentDetailsRemote extends ValidatorRemote
{
public JSONObject getConsignmentDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException;
//public JSONObject getConsignmentDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException;
//Changed by Sneha on 21-07-2015, for date parameter Request ID: D15DKAT009
public JSONObject getConsignmentDetails(String dataSourceName, String siteCode, String fromDate, String toDate) throws RemoteException, ITMException;
//End by Sneha on 21-07-2015, for date parameter Request ID: D15DKAT009
}
/**
* Purpose: Dashboard for Inventory Occupancy, Reuest ID: D15DKAT008
* Author: Sneha Mestry
* Date: 15-07-2015
*/
package ibase.webitm.ejb.wms;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.ejb.Stateless;
import org.json.simple.JSONObject;
@Stateless
public class InventoryOccupancy extends ValidatorEJB implements InventoryOccupancyRemote, InventoryOccupancyLocal
{
public InventoryOccupancy()
{}
GenericUtility genericUtility = GenericUtility.getInstance();
//1.This is the main method to show the parent graph
@SuppressWarnings("unchecked")
public JSONObject getInventoryOccupancyDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException
{
JSONObject rawDataJson = new JSONObject();
JSONObject rowData = null;
String sql = "";
ResultSet rs = null;
PreparedStatement pstmt = null;
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
try
{
conn = connDriver.getConnectDB(dataSourceName);
connDriver = null;
int count = 0, total = 0, used = 0;
double percentage = 0, totalDso = 0, usedDso = 0, percentageDso = 0,
totalPso = 0, usedPso = 0, percentagePso = 0, totalCaspk = 0, usedCaspk = 0, percentageCaspk = 0,
totalActpk = 0, usedActpk = 0, percentageActpk = 0 ;
System.out.println(" ************** Overall ****************** ");
sql = "select count(distinct loc_code) AS TOTAL from location where site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
total = rs.getInt("TOTAL");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
sql = "select count(distinct loc_code) AS USED from stock where site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
used = rs.getInt("USED");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
percentage = (((double)used / (double)total) * 100) ;
rowData = new JSONObject();
rowData.put("descr", "Overall");
rowData.put("link", "");
rowData.put("total", total);
rowData.put("occupied", used);
rowData.put("value", Math.round(percentage));
rawDataJson.put(count, rowData);
System.out.println("rawDataJson for Overall :::::::::: " + rawDataJson);
count++;
System.out.println(" ************** DSO ****************** ");
sql = "select count(distinct loc_code) AS TOTAL_DSO from location where inv_stat = 'DSO' and site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
totalDso = rs.getInt("TOTAL_DSO");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
sql = "select count(distinct loc_code) AS USED_DSO from stock where inv_stat = 'DSO' and site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
usedDso = rs.getInt("USED_DSO");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
percentageDso = (((double)usedDso / (double)totalDso) * 100) ;
rowData = new JSONObject();
rowData.put("descr", "DSO");
rowData.put("link", "DSO");
rowData.put("total", totalDso);
rowData.put("occupied", usedDso);
rowData.put("value", Math.round(percentageDso));
rawDataJson.put(count, rowData);
System.out.println("rawDataJson for DSO :::::::::: " + rawDataJson);
count++;
System.out.println(" ************** PSO ****************** ");
sql = "select count(distinct loc_code) AS TOTAL_PSO from location where inv_stat = 'PSO' and site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
totalPso = rs.getInt("TOTAL_PSO");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
sql = "select count(distinct loc_code) AS USED_PSO from stock where inv_stat = 'PSO' and site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
usedPso = rs.getInt("USED_PSO");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
percentagePso = (((double)usedPso / (double)totalPso) * 100) ;
rowData = new JSONObject();
rowData.put("descr", "PSO");
rowData.put("link", "PSO");
rowData.put("total", totalPso);
rowData.put("occupied", usedPso);
rowData.put("value", Math.round(percentagePso));
rawDataJson.put(count, rowData);
System.out.println("rawDataJson for PSO :::::::::: " + rawDataJson);
count++;
System.out.println(" ************** CASPK ****************** ");
sql = "select count(distinct loc_code) AS TOTAL_CASPK from location where inv_stat = 'CASPK' and site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
totalCaspk = rs.getInt("TOTAL_CASPK");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
sql = "select count(distinct loc_code) AS USED_CASPK from stock where inv_stat = 'CASPK' and site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
usedCaspk = rs.getInt("USED_CASPK");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
percentageCaspk = (((double)usedCaspk / (double)totalCaspk) * 100) ;
rowData = new JSONObject();
rowData.put("descr", "Case Pick");
rowData.put("link", "CASPK");
rowData.put("total", totalCaspk);
rowData.put("occupied", usedCaspk);
rowData.put("value", Math.round(percentageCaspk));
rawDataJson.put(count, rowData);
System.out.println("rawDataJson for CASPK :::::::::: " + rawDataJson);
count++;
System.out.println(" ************** ACTPK ****************** ");
sql = "select count(distinct loc_code) AS TOTAL_ACTPK from location where inv_stat = 'ACTPK' and site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
totalActpk = rs.getInt("TOTAL_ACTPK");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
sql = "select count(distinct loc_code) AS USED_ACTPK from stock where inv_stat = 'ACTPK' and site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
usedActpk = rs.getInt("USED_ACTPK");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
percentageActpk = (((double)usedActpk / (double)totalActpk) * 100) ;
rowData = new JSONObject();
rowData.put("descr", "Active Pick");
rowData.put("link", "ACTPK");
rowData.put("total", totalActpk);
rowData.put("occupied", usedActpk);
rowData.put("value", Math.round(percentageActpk));
rawDataJson.put(count, rowData);
System.out.println("rawDataJson for ACTPK :::::::::: " + rawDataJson);
count++;
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if (conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception in :ReplTask.getReplTaskDetails(String dataSourceName, String siteCode):" + d.getMessage());
throw new ITMException(d);
}
}
return rawDataJson;
}
/*
private String checkNull(String str)
{
if(str == null)
{
return "0";
}
else
{
return str.trim();
}
}
*/
}
/**
* Purpose: Dashboard for Inventory Occupancy, Reuest ID: D15DKAT008
* Author: Sneha Mestry
* Date: 15-07-2015
*/
package ibase.webitm.ejb.wms;
import java.rmi.RemoteException;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local;
import org.json.simple.JSONObject;
@Local
public interface InventoryOccupancyLocal extends ValidatorLocal
{
public JSONObject getInventoryOccupancyDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException;
}
/**
* Purpose: Dashboard for Inventory Occupancy, Reuest ID: D15DKAT008
* Author: Sneha Mestry
* Date: 15-07-2015
*/
package ibase.webitm.ejb.wms;
import java.rmi.RemoteException;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
import org.json.simple.JSONObject;
@Remote
public interface InventoryOccupancyRemote extends ValidatorRemote
{
public JSONObject getInventoryOccupancyDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException;
}
......@@ -39,12 +39,13 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
System.out.println("Calling EJB getLocPhyArea ---------");
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sql = "select distinct loc_phy_area from location order by loc_phy_area ";
//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 ";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
System.out.println("getLocPhyArea() ::::::::::::::: ");
xmlData = new StringBuffer("<?xml version='1.0'?> <Root>");
while (rs.next())
{
......@@ -103,12 +104,14 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
System.out.println("Calling EJB getSelectedArea ---------");
conn = connDriver.getConnectDB("DriverITM");
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 ";
//sql = " select distinct loc_phy_area from location order by loc_phy_area ";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
System.out.println("getSelectedArea() ::::::::::::::: ");
if (rs.next())
{
selectedArea = this.checkNull(rs.getString("loc_phy_area"));
......@@ -146,12 +149,12 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
return selectedArea;
}
public String getLocDtl(String locPhyArea, String siteCode,String locationRange) throws RemoteException, ITMException
public String getLocDtl(String locPhyArea, String siteCode, String locationRange) throws RemoteException, ITMException
{
String sql = "";
ResultSet rs = null, rs1 = null;
ResultSet rs = null, rs1 = null, rs2 = null;
Connection conn = null;
PreparedStatement pstmt = null, pstmt1 = null;
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData = null;
String previousRow = "";
......@@ -161,23 +164,25 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
String locationCode = " ";
int count = 0;
String locCode="";
try
{
System.out.println("Calling EJB getLocDtl ---------");
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
if(locationRange!=null && locationRange.trim().length()>0){
if(locationRange!=null && locationRange.trim().length()>0)
{
locCode ="AND loc_code like '"+locationRange+"%'";
System.out.println("location Range from JSP ==="+locationRange);
}
sql = "select loc_code,loc_phy_row,loc_phy_col,loc_phy_stack from location where loc_phy_area = ? and site_code = ? "+locCode +" order by loc_phy_row, loc_phy_stack ,loc_phy_col";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locPhyArea);
pstmt.setString(2, siteCode);
rs = pstmt.executeQuery();
xmlData = new StringBuffer("<?xml version='1.0'?> <Root>");
xmlData.append("<loc_phy_area area =\"" + locPhyArea + "\">");
while (rs.next())
......@@ -192,7 +197,7 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
{
xmlData.append("</loc_phy_stack > ");
}
//Changed by Sachinn 03/07/15 bug fixing .start
//Changed by Sachin 03/07/15 bug fixing .start
/*if (count > 1 && !currentRow.equals(previousRow))
{
xmlData.append("</loc_phy_row > ");
......@@ -224,8 +229,6 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
}
//Changed by Sachinn 03/07/15 bug fixing .end
if (count == 1 || !previousStack.equals(cuurentStack))
{
previousStack = checkNull(rs.getString("loc_phy_stack"));
......@@ -235,7 +238,6 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
//Changed due to exp date<= sys date 30/06/15
//sql = "select s.item_code, s.site_code, s.loc_code, s.lot_no, s.lot_sl, s.exp_date, s.quantity, s.alloc_qty, s.hold_qty , s.mfg_date, s.exp_date, s.retest_date , i.descr, s.unit from stock s ,item i where s.quantity >0 and s.exp_date <= sysdate and s.item_code=i.item_code and s.loc_code =? and s.site_code =?";
sql = "select s.item_code, s.site_code, s.loc_code, s.lot_no, s.lot_sl, s.exp_date, s.quantity, s.alloc_qty, s.hold_qty , s.mfg_date, s.exp_date, s.retest_date , i.descr, s.unit from stock s ,item i where s.quantity >0 and s.item_code=i.item_code and s.loc_code =? and s.site_code =?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, locationCode);
pstmt1.setString(2, siteCode);
......@@ -255,6 +257,30 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
xmlData.append("<quantity>").append("<![CDATA[" + rs1.getDouble("quantity") + "]]>").append("</quantity>");
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>");
if (rs1.getDate("mfg_date") != null)
......@@ -349,6 +375,14 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
pstmt1.close();
pstmt1 = null;
//Changed by Sneha, for display of Lock Code on 16-07-2015, Request ID: D15DKAT009
if (rs2 != null)
rs2.close();
if (pstmt2 != null)
pstmt2.close();
//End by Sneha, for display of Lock Code on 16-07-2015, Request ID: D15DKAT009
conn.close();
conn = null;
}
......
......@@ -12,13 +12,18 @@ import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.HashSet;
import java.util.Iterator;
import javax.ejb.Stateless;
import org.json.simple.JSONObject;
@Stateless
public class UserActivity extends ValidatorEJB implements UserActivityRemote, UserActivityLocal
{
......@@ -29,28 +34,100 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
//1.This is the main method to show the parent graph
@SuppressWarnings("unchecked")
public JSONObject getUserActivityDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException
public JSONObject getUserActivityDetails(String dataSourceName, String siteCode, String fromDate, String toDate, String empCodeFrom, String empCodeTo) throws RemoteException, ITMException
{
JSONObject rawDataJson = new JSONObject();
JSONObject rowData = null;
String sql = "", sql1 = "", sql2 = "", sql3 = "", sql4 = "", sql5 = "", sql6 = "", sql7 = "";
ResultSet rs = null;
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null, pstmt3 = null, pstmt4 = null, pstmt5 = null, pstmt6 = null, pstmt7 = null;
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String emp = "", user = "", empCode = "", empName = "", total = "Total" ;
ResultSet rs = null;
PreparedStatement pstmt = null;
// Changed by Sneha Mestry on 29-07-2015, Request ID: W15DSUN014
String sql = "", empCode = "", empName = "", pickOrder = "", pickType = "", noArt = "", locCode = "",
inputDate = "";
Timestamp tranDateTo = null, tranDateFrom = null;
// End by Sneha Mestry on 29-07-2015, Request ID: W15DSUN014
/*
String sql = "", sql1 = "", sql2 = "", sql3 = "", sql4 = "", sql5 = "", sql6 = "", sql7 = "";
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null, pstmt3 = null, pstmt4 = null, pstmt5 = null, pstmt6 = null, pstmt7 = null;
String emp = "", user = "", total = "Total";
HashSet<String> empCodeList = new HashSet<String>();
HashSet<String> userList = new HashSet<String>();
*/
try
{
conn = connDriver.getConnectDB(dataSourceName);
connDriver = null;
int count = 0;
// Changed by Sneha Mestry on 29-07-2015, Request ID: W15DSUN014
String dbDateFormat = genericUtility.getDBDateFormat();
String simpleDateFormat = genericUtility.getApplDateFormat();
inputDate = genericUtility.getValidDateString(fromDate, simpleDateFormat, dbDateFormat);
System.out.println("inputDate fromDate :::::: " + inputDate);
tranDateFrom = Timestamp.valueOf(inputDate + " 00:00:00.0");
System.out.println("TimeStamp fromDate :::::: " + tranDateFrom);
inputDate = genericUtility.getValidDateString(toDate, simpleDateFormat, dbDateFormat);
System.out.println("inputDate fromDate :::::: " + inputDate);
tranDateTo = Timestamp.valueOf(inputDate + " 00:00:00.0");
System.out.println("TimeStamp toDate :::::: " + tranDateTo);
sql = "SELECT DDF_GET_EMP_NAME(PIH.EMP_CODE__APRV) AS EMP_NAME, PIH.EMP_CODE__APRV AS EMP_CODE__APRV, "
+ "COUNT(PID.PICK_ORDER) AS COUNT_PICK_ORDER, PIH.PICK_TYPE, "
+ "(CASE WHEN PIH.PICK_TYPE = 'A' THEN SUM(PID.QUANTITY) ELSE SUM(PID.NO_ART) END) AS SUM_NO_ART, "
+ "COUNT(PID.LOC_CODE) AS COUNT_LOC_CODE FROM PICK_ISS_HDR PIH, PICK_ISS_DET PID "
+ "WHERE PIH.EMP_CODE__APRV >= ? AND PIH.EMP_CODE__APRV <= ? AND PIH.TRAN_DATE >= ? AND PIH.TRAN_DATE <= ? "
+ "AND PIH.PICK_ORDER = PID.PICK_ORDER AND PIH.TRAN_ID=PID.TRAN_ID AND PIH.CONFIRMED ='Y' AND PIH.site_code = ? AND "
+ "INSTR(CASE WHEN pick_type = 'C' THEN Q'(C','M)' WHEN pick_type = 'A' THEN 'A' WHEN pick_type = 'B' THEN Q'(C','M','A)' END, "
+ "PIH.PICK_TYPE) > 0 GROUP BY PIH.EMP_CODE__APRV, PID.PICK_ORDER, PIH.PICK_TYPE ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeFrom);
pstmt.setString(2, empCodeTo);
pstmt.setTimestamp(3, tranDateFrom);
pstmt.setTimestamp(4, tranDateTo);
pstmt.setString(5, siteCode);
rs = pstmt.executeQuery();
while (rs.next())
{
empName = rs.getString(checkNull("EMP_NAME"));
empCode = rs.getString(checkNull("EMP_CODE__APRV"));
pickOrder = rs.getString(checkNull("COUNT_PICK_ORDER"));
pickType = rs.getString(checkNull("PICK_TYPE"));
noArt = rs.getString(checkNull("SUM_NO_ART"));
locCode = rs.getString(checkNull("COUNT_LOC_CODE"));
rowData = new JSONObject();
rowData.put("empName", empName);
rowData.put("empCode", empCode);
rowData.put("pickOrder", pickOrder);
rowData.put("picktype", pickType);
rowData.put("noArt", noArt);
rowData.put("locCode", locCode);
rawDataJson.put(count, rowData);
count++;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// End by Sneha Mestry on 29-07-2015, Request ID: W15DSUN014
/*
int count = 0, sum = 0, caseCount = 0, activeCount = 0, replCount = 0, masterPickCount = 0,
masterPackCount = 0, phyCount = 0, loadCount = 0;
// Sql for empCode and chg_user
sql = "select distinct(emp_code__aprv), chg_user from pick_iss_hdr where site_code = ? and emp_code__aprv is not null union "
/*sql = "select distinct(emp_code__aprv), chg_user from pick_iss_hdr where site_code = ? and emp_code__aprv is not null union "
+ "select distinct(emp_code__aprv), chg_user from pack_hdr where site_code = ? and emp_code__aprv is not null union "
+ "select distinct(emp_code__aprv), chg_user from repl_iss_hdr where site_code = ? and emp_code__aprv is not null union "
+ "select distinct(emp_code__user), chg_user from physcan where site_code = ? and emp_code__user is not null union "
......@@ -494,6 +571,7 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
rs = null;
}
rowData = new JSONObject();
rowData.put("empName", total);
rowData.put("caseCount", caseCount);
......@@ -511,7 +589,9 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
"Total replCount ::::::::::" + replCount + "Total masterPickCount ::::::::::: " +masterPickCount+
"Total masterPackCount ::::::::::" + masterPackCount + "Total phyCount ::::::::::: " +phyCount+
"Total loadCount ::::::::::" + loadCount + "Total ::::::::: " + sum);
}
}*/
}
catch (Exception e)
{
......@@ -522,12 +602,29 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
{
try
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if (conn != null)
{
conn.close();
conn = null;
}
/*
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(pstmt1 != null)
{
pstmt1.close();conn = null;
......@@ -570,6 +667,7 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
conn.close();
conn = null;
}
*/
}
catch (Exception d)
{
......
......@@ -13,5 +13,10 @@ import org.json.simple.JSONObject;
@Local
public interface UserActivityLocal extends ValidatorLocal
{
public JSONObject getUserActivityDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException;
// Changed by Sneha on 29-07-2015, Request ID: W15DSUN014
public JSONObject getUserActivityDetails(String dataSourceName, String siteCode, String fromDate, String toDate, String empCodeFrom, String empCodeTo) throws RemoteException, ITMException;
// End by Sneha on 29-07-2015, Request ID: W15DSUN014
/*
public JSONObject getUserActivityDetails(String dataSourceName, String siteCode, String fromDate, String toDate, String empCodeFrom, String empCodeTo) throws RemoteException, ITMException;
*/
}
......@@ -13,6 +13,10 @@ import org.json.simple.JSONObject;
@Remote
public interface UserActivityRemote extends ValidatorRemote
{
// Changed by Sneha on 29-07-2015, Request ID: W15DSUN014
public JSONObject getUserActivityDetails(String dataSourceName, String siteCode, String fromDate, String toDate, String empCodeFrom, String empCodeTo) throws RemoteException, ITMException;
// End by Sneha on 29-07-2015, Request ID: W15DSUN014
/*
public JSONObject getUserActivityDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException;
*/
}
......@@ -38,23 +38,34 @@ public class ConsignmentDetailsServlet extends HttpServlet
ConsignmentDetailsRemote consignmentDetailsRemote = null;
InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = "";
String dataSourceName = "", fromDate = "", toDate = "";
String siteCode = "";
try
{
response.setContentType("application/xml");
dataSourceName = request.getParameter("dataSourceName");
HttpSession session = request.getSession(true);
/*HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = userInfo.getSiteCode();
siteCode = userInfo.getSiteCode();*/
System.out.println(" siteCode :::::::::: " + siteCode);
//Changed by Sneha, for date parameter Request ID: D15DKAT009
fromDate = request.getParameter("fromDate");
toDate = request.getParameter("toDate");
System.out.println(" fromDate :::::::::: " + fromDate);
System.out.println(" toDate :::::::::: " + toDate);
//End by Sneha, for date parameter Request ID: D15DKAT009
context = new InitialContext(appConnectParm.getProperty());
consignmentDetailsRemote = (ConsignmentDetailsRemote) context.lookup("ibase/ConsignmentDetails/remote");
//Start by Sneha on 21-07-2015, Request ID: D15DKAT009
JSONObject jsonObjData = (JSONObject)consignmentDetailsRemote.getConsignmentDetails(dataSourceName, siteCode, fromDate, toDate);
//End by Sneha on 21-07-2015, Request ID: D15DKAT009
//Here invoke EJB define method
JSONObject jsonObjData = (JSONObject)consignmentDetailsRemote.getConsignmentDetails(dataSourceName, siteCode);
//JSONObject jsonObjData = (JSONObject)consignmentDetailsRemote.getConsignmentDetails(dataSourceName, siteCode);
OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush();
......
/**
* Purpose: Dashboard for Inventory Occupancy, Reuest ID: D15DKAT008
* Author: Sneha Mestry
* Date: 15-07-2015
*/
package ibase.webitm.servlet.wms;
import ibase.system.config.AppConnectParm;
import ibase.webitm.ejb.wms.InventoryOccupancyRemote;
import ibase.webitm.utility.ITMException;
import java.io.IOException;
import java.io.OutputStream;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject;
public class InventoryOccupancyServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
doPost(request, response);
}
@SuppressWarnings("unchecked")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
InventoryOccupancyRemote inventoryOccupancyRemote = null;
InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = "";
String siteCode = "TA821";
try
{
response.setContentType("application/xml");
dataSourceName = request.getParameter("dataSourceName");
HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = userInfo.getSiteCode();
System.out.println(" siteCode :::::::::: " + siteCode);
context = new InitialContext(appConnectParm.getProperty());
inventoryOccupancyRemote = (InventoryOccupancyRemote) context.lookup("ibase/InventoryOccupancy/remote");
//Here invoke EJB define method
JSONObject jsonObjData = (JSONObject)inventoryOccupancyRemote.getInventoryOccupancyDetails(dataSourceName, siteCode);
OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush();
outputStream.close();
System.out.println(" Final data set for InventoryOccupancyServlet build to Graph and Grid===" + jsonObjData);
}
catch (Exception e)
{
System.out.println("Exception in: InventoryOccupancyServlet :doPost(HttpServletRequest request, HttpServletResponse response) :" + e.getMessage());
try
{
throw new ITMException(e);
} catch (ITMException e1)
{
e1.printStackTrace();
}
}
}
}
......@@ -38,7 +38,7 @@ public class UserActivityServlet extends HttpServlet
UserActivityRemote userActivityRemote = null;
InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = "";
String dataSourceName = "", fromDate = "", toDate = "", empCodeFrom = "", empCodeTo = "";
String siteCode = "";
try
{
......@@ -50,11 +50,28 @@ public class UserActivityServlet extends HttpServlet
siteCode = userInfo.getSiteCode();
System.out.println(" siteCode :::::::::: " + siteCode);
// Start by Sneha on 29-07-2015, Request ID: W15DSUN014
fromDate = request.getParameter("fromDate");
toDate = request.getParameter("toDate");
empCodeFrom = request.getParameter("empCodeFrom");
empCodeTo = request.getParameter("empCodeTo");
System.out.println(" fromDate :::::::::: " + fromDate);
System.out.println(" toDate :::::::::: " + toDate);
System.out.println(" empCodeFrom :::::::::: " + empCodeFrom);
System.out.println(" empCodeTo :::::::::: " + empCodeTo);
// End by Sneha on 29-07-2015, Request ID: W15DSUN014
context = new InitialContext(appConnectParm.getProperty());
userActivityRemote = (UserActivityRemote) context.lookup("ibase/UserActivity/remote");
//Here invoke EJB define method
JSONObject jsonObjData = (JSONObject)userActivityRemote.getUserActivityDetails(dataSourceName, siteCode);
// Start by Sneha on 29-07-2015, Request ID: W15DSUN014
JSONObject jsonObjData = (JSONObject)userActivityRemote.getUserActivityDetails(dataSourceName, siteCode, fromDate, toDate, empCodeFrom, empCodeTo);
// End by Sneha on 29-07-2015, Request ID: W15DSUN014
//JSONObject jsonObjData = (JSONObject)userActivityRemote.getUserActivityDetails(dataSourceName, siteCode);
OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush();
......
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