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 ...@@ -22,7 +22,6 @@ public class LocationStockOccuBean implements Serializable
System.out.println("In LocationStockOccuBean ::::::::::"); System.out.println("In LocationStockOccuBean ::::::::::");
locationStockOccupancyRemote = (LocationStockOccupancyRemote) ctx.lookup("ibase/LocationStockOccupancy/remote"); locationStockOccupancyRemote = (LocationStockOccupancyRemote) ctx.lookup("ibase/LocationStockOccupancy/remote");
System.out.println("instance created"); System.out.println("instance created");
} }
catch(Exception e) catch(Exception e)
{ {
......
...@@ -15,6 +15,7 @@ import java.rmi.RemoteException; ...@@ -15,6 +15,7 @@ import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.Format; import java.text.Format;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
...@@ -34,7 +35,11 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai ...@@ -34,7 +35,11 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai
//1.This is the main method to show the parent graph //1.This is the main method to show the parent graph
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
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
{ {
JSONObject rawDataJson = new JSONObject(); JSONObject rawDataJson = new JSONObject();
JSONObject rowData = null; JSONObject rowData = null;
...@@ -43,21 +48,449 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai ...@@ -43,21 +48,449 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Connection conn = null; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
String shipment = "", cases = "", weight = "", tasks = "", order = "", week = ""; String shipment = "", cases = "", weight = "", tasks = "", order = "", week = "", distWeight = "", distCases = "",
consumeWeight = "", consumeCases = "", totalWeight = "", totalCases = "", inputDate = "", date = "";
//Changed by Sneha on 21-07-2015, Request ID: D15DKAT009
Timestamp shipDate = null;
Date fromDateCurMonth = null, toDateCurMonth = null, firstDate = null, lastDate = null;
//End by Sneha on 21-07-2015, Request ID: D15DKAT009
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;
int count = 0; int count = 0;
Date dt1 = null, dt2 = null, dt3 = null, dt4 = null;
String week1Date = "", week2Date = "", week3Date = "", week4Date = "", distWeight = "", distCases = "", consumeWeight = "",
consumeCases = "", totalWeight = "", totalCases = "";
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
Calendar cal1 = Calendar.getInstance();
//Changed by Sneha on 21-07-2015, Request ID: D15DKAT009
SimpleDateFormat dbDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
Format formatter = new SimpleDateFormat("dd-MMM-yy");
if(fromDate.equals(null) || toDate.equals(null) || fromDate.equals("") || toDate.equals(""))
{
fromDateCurMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, 1);
fromDateCurMonth = cal.getTime();
System.out.println("1st date of current month :::::::::: " + fromDateCurMonth);
toDateCurMonth = cal1.getTime();
cal1.add(Calendar.DATE, + 1);
toDateCurMonth = cal1.getTime();
System.out.println("Added 1day in current date :::::::::: " + toDateCurMonth);
while(fromDateCurMonth.before(toDateCurMonth))
{
inputDate = dbDateFormat.format(cal.getTime());
shipDate = Timestamp.valueOf(inputDate + " 00:00:00.0");
System.out.println("TimeStamp Date :::::: " + shipDate);
// no of shipment
sql = "select count(shipment_id) from shipment where site_code = ? and confirmed = 'Y' and "
+ "shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
shipment = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// no of cases
sql = "select sum(despatchdet.no_art) from despatchdet despatchdet ,despatch despatch, ship_docs ship_docs, shipment shipment "
+ "where despatch.site_code = ? and despatch.desp_id = despatchdet.desp_id and ship_docs.ref_id = despatchdet.desp_id "
+ "and despatch.desp_id = ship_docs.ref_id and ship_docs.ref_ser ='S-DSP' and ship_docs.shipment_id = shipment.shipment_id "
+ "and ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
cases = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// no of weight
sql = "select sum(despatchdet.gross_weight) from despatchdet despatchdet ,despatch despatch, ship_docs ship_docs, shipment shipment "
+ "where despatch.site_code = ? and despatch.desp_id = despatchdet.desp_id and ship_docs.ref_id = despatchdet.desp_id and "
+ "despatch.desp_id = ship_docs.ref_id and ship_docs.ref_ser ='S-DSP' and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
weight = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// sum of weight and no of cases for D-ISS
sql = "select sum(case when distord_issdet.gross_weight is null then 0 else distord_issdet.gross_weight end), "
+ "sum(case when distord_issdet.no_art is null then 0 else distord_issdet.no_art end) from distord_iss distord_iss, "
+ "distord_issdet distord_issdet, ship_docs ship_docs, shipment shipment where ship_docs.ref_ser ='D-ISS' and "
+ "shipment.confirmed = 'Y' and ship_docs.ref_id = distord_iss.tran_id and distord_issdet.tran_id = distord_iss.tran_id and "
+ "distord_issdet.tran_id = ship_docs.ref_id and ship_docs.shipment_id = shipment.shipment_id and shipment.site_code = ? and "
+ "shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
distWeight = checkNull(rs.getString(1));
distCases = checkNull(rs.getString(2));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// sum of weight and no of cases for C-ISS
sql = "select sum(case when consume_iss.gross_weight is null then 0 else consume_iss.gross_weight end), "
+ "sum(case when consume_iss_det.no_art is null then 0 else consume_iss_det.no_art end) from consume_iss consume_iss, "
+ "consume_iss_det consume_iss_det, ship_docs ship_docs, shipment shipment where ship_docs.ref_ser ='C-ISS' and "
+ "shipment.confirmed = 'Y' and consume_iss_det.cons_issue = consume_iss.cons_issue and ship_docs.ref_id = consume_iss.cons_issue "
+ "and consume_iss_det.cons_issue = ship_docs.ref_id and ship_docs.shipment_id = shipment.shipment_id and shipment.site_code = ? "
+ "and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
consumeWeight = checkNull(rs.getString(1));
consumeCases = checkNull(rs.getString(2));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
//no of tasks performed
sql = "select COUNT(*) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det where "
+ "shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
tasks = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// no of order process
sql = "select COUNT(distinct wave_task_det.ptcn) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det "
+ "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
order = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// Sum of weight and Total count of Cases
totalWeight = weight + distWeight + consumeWeight;
totalCases = cases + distCases + consumeCases;
date = formatter.format(fromDateCurMonth);
rowData = new JSONObject();
rowData.put("date", date);
rowData.put("shipment", shipment);
rowData.put("cases", totalCases);
rowData.put("weight", totalWeight);
rowData.put("tasks", tasks);
rowData.put("order", order);
rawDataJson.put(count, rowData);
count++;
cal.add(Calendar.DATE, + 1);
fromDateCurMonth = cal.getTime();
System.out.println("Added 1day in current date :::::: " + fromDateCurMonth);
}
}
else
{
firstDate = simpleDateFormat.parse(fromDate);
lastDate = simpleDateFormat.parse(toDate);
cal1.setTime(lastDate);
cal1.add(Calendar.DATE, + 1);
lastDate = cal1.getTime();
System.out.println("Added 1day to To_Date :::::::::: " + lastDate);
while(firstDate.before(lastDate))
{
cal.setTime(firstDate);
inputDate = dbDateFormat.format(cal.getTime());
shipDate = Timestamp.valueOf(inputDate + " 00:00:00.0");
System.out.println("Shipment Date :::::: " + shipDate);
// no of shipment for parameter date
sql = "select count(shipment_id) from shipment where site_code = ? and confirmed = 'Y' and "
+ "shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
shipment = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// no of cases for parameter date
sql = "select sum(despatchdet.no_art) from despatchdet despatchdet ,despatch despatch, ship_docs ship_docs, shipment shipment "
+ "where despatch.site_code = ? and despatch.desp_id = despatchdet.desp_id and ship_docs.ref_id = despatchdet.desp_id "
+ "and despatch.desp_id = ship_docs.ref_id and ship_docs.ref_ser ='S-DSP' and ship_docs.shipment_id = shipment.shipment_id "
+ "and ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
cases = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// no of weight
sql = "select sum(despatchdet.gross_weight) from despatchdet despatchdet ,despatch despatch, ship_docs ship_docs, shipment shipment "
+ "where despatch.site_code = ? and despatch.desp_id = despatchdet.desp_id and ship_docs.ref_id = despatchdet.desp_id and "
+ "despatch.desp_id = ship_docs.ref_id and ship_docs.ref_ser ='S-DSP' and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
weight = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// sum of weight and no of cases for D-ISS
sql = "select sum(case when distord_issdet.gross_weight is null then 0 else distord_issdet.gross_weight end), "
+ "sum(case when distord_issdet.no_art is null then 0 else distord_issdet.no_art end) from distord_iss distord_iss, "
+ "distord_issdet distord_issdet, ship_docs ship_docs, shipment shipment where ship_docs.ref_ser ='D-ISS' and "
+ "shipment.confirmed = 'Y' and ship_docs.ref_id = distord_iss.tran_id and distord_issdet.tran_id = distord_iss.tran_id and "
+ "distord_issdet.tran_id = ship_docs.ref_id and ship_docs.shipment_id = shipment.shipment_id and shipment.site_code = ? and "
+ "shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
distWeight = checkNull(rs.getString(1));
distCases = checkNull(rs.getString(2));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// sum of weight and no of cases for C-ISS
sql = "select sum(case when consume_iss.gross_weight is null then 0 else consume_iss.gross_weight end), "
+ "sum(case when consume_iss_det.no_art is null then 0 else consume_iss_det.no_art end) from consume_iss consume_iss, "
+ "consume_iss_det consume_iss_det, ship_docs ship_docs, shipment shipment where ship_docs.ref_ser ='C-ISS' and "
+ "shipment.confirmed = 'Y' and consume_iss_det.cons_issue = consume_iss.cons_issue and ship_docs.ref_id = consume_iss.cons_issue "
+ "and consume_iss_det.cons_issue = ship_docs.ref_id and ship_docs.shipment_id = shipment.shipment_id and shipment.site_code = ? "
+ "and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
consumeWeight = checkNull(rs.getString(1));
consumeCases = checkNull(rs.getString(2));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
//no of tasks performed
sql = "select COUNT(*) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det where "
+ "shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
tasks = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// no of order process
sql = "select COUNT(distinct wave_task_det.ptcn) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det "
+ "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setTimestamp(2, shipDate);
rs = pstmt.executeQuery();
if (rs.next())
{
order = checkNull(rs.getString(1));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
// Sum of weight and Total count of Cases
totalWeight = weight + distWeight + consumeWeight;
totalCases = cases + distCases + consumeCases;
date = formatter.format(firstDate);
rowData = new JSONObject();
rowData.put("date", date);
rowData.put("shipment", shipment);
rowData.put("cases", totalCases);
rowData.put("weight", totalWeight);
rowData.put("tasks", tasks);
rowData.put("order", order);
rawDataJson.put(count, rowData);
count++;
cal.add(Calendar.DATE, + 1);
firstDate = cal.getTime();
System.out.println("Added 1day in current date :::::: " + firstDate);
}
}
//End by Sneha on 21-07-2015, Request ID: D15DKAT009
/*
Date dt1 = null, dt2 = null, dt3 = null, dt4 = null;
String week1Date = "", week2Date = "", week3Date = "", week4Date = "", ;
Format formatter = new SimpleDateFormat("dd-MMM-yy"); Format formatter = new SimpleDateFormat("dd-MMM-yy");
// 1st week date // 1st week date
cal.add(Calendar.DATE, - 7); cal.add(Calendar.DATE, -1);cal.add(Calendar.DATE, -1);
//cal.add(Calendar.DATE, + 7); //cal.add(Calendar.DATE, + 7);
//cal.add(Calendar.MONTH, - 2); //cal.add(Calendar.MONTH, - 2);
dt1 = cal.getTime(); dt1 = cal.getTime();
...@@ -81,7 +514,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai ...@@ -81,7 +514,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai
dt4 = cal.getTime(); dt4 = cal.getTime();
week4Date = formatter.format(dt4); week4Date = formatter.format(dt4);
System.out.println("4th week date ::::::: " + week4Date); System.out.println("4th week date ::::::: " + week4Date);
System.out.println(" ************** 1st week ****************** "); System.out.println(" ************** 1st week ****************** ");
// no of shipment for 1st week // no of shipment for 1st week
sql = "select count(shipment_id) from shipment where site_code = ? and confirmed = 'Y' and " sql = "select count(shipment_id) from shipment where site_code = ? and confirmed = 'Y' and "
...@@ -239,7 +672,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai ...@@ -239,7 +672,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai
} }
// no of order process for 1st week // no of order process for 1st week
sql = "select COUNT(distinct wave_task_det.SALE_ORDER) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det " sql = "select COUNT(distinct wave_task_det.ptcn) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det "
+ "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and " + "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date > ? "; + "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date > ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -442,7 +875,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai ...@@ -442,7 +875,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai
} }
// no of order process for 2nd week // no of order process for 2nd week
sql = "select COUNT(distinct wave_task_det.SALE_ORDER) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det " sql = "select COUNT(distinct wave_task_det.ptcn) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det "
+ "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and " + "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date between ? and ? "; + "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date between ? and ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -649,7 +1082,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai ...@@ -649,7 +1082,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai
} }
// no of order process for 3rd week // no of order process for 3rd week
sql = "select COUNT(distinct wave_task_det.SALE_ORDER) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det " sql = "select COUNT(distinct wave_task_det.ptcn) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det "
+ "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and " + "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date between ? and ? "; + "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date between ? and ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -852,7 +1285,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai ...@@ -852,7 +1285,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai
} }
// no of order process for 4th week // no of order process for 4th week
sql = "select COUNT(distinct wave_task_det.SALE_ORDER) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det " sql = "select COUNT(distinct wave_task_det.ptcn) from ship_docs ship_docs, shipment shipment, wave_task_det wave_task_det "
+ "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and " + "where shipment.site_code = ? and ship_docs.ptcn = wave_task_det.ptcn and ship_docs.shipment_id = shipment.shipment_id and "
+ "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date between ? and ? "; + "ship_docs.ref_ser ='S-DSP' and shipment.confirmed = 'Y' and shipment.shipment_date between ? and ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -891,7 +1324,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai ...@@ -891,7 +1324,7 @@ public class ConsignmentDetails extends ValidatorEJB implements ConsignmentDetai
count++; count++;
System.out.println("3rd Week data in rowData :::::::::: " + rowData); System.out.println("3rd Week data in rowData :::::::::: " + rowData);
System.out.println("3rd Week data in rawDataJson :::::::::: " + rawDataJson); System.out.println("3rd Week data in rawDataJson :::::::::: " + rawDataJson);
*/
} }
catch (Exception e) catch (Exception e)
{ {
......
...@@ -14,5 +14,10 @@ import org.json.simple.JSONObject; ...@@ -14,5 +14,10 @@ import org.json.simple.JSONObject;
@Local @Local
public interface ConsignmentDetailsLocal extends ValidatorLocal 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 @@ ...@@ -6,6 +6,8 @@
package ibase.webitm.ejb.wms; package ibase.webitm.ejb.wms;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.Date;
import ibase.webitm.ejb.ValidatorRemote; import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; import javax.ejb.Remote;
...@@ -14,6 +16,9 @@ import org.json.simple.JSONObject; ...@@ -14,6 +16,9 @@ import org.json.simple.JSONObject;
@Remote @Remote
public interface ConsignmentDetailsRemote extends ValidatorRemote 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 ...@@ -39,12 +39,13 @@ 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 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 ";
//sql = "select distinct loc_phy_area from location order by loc_phy_area ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
System.out.println("getLocPhyArea() ::::::::::::::: ");
xmlData = new StringBuffer("<?xml version='1.0'?> <Root>"); xmlData = new StringBuffer("<?xml version='1.0'?> <Root>");
while (rs.next()) while (rs.next())
{ {
...@@ -103,12 +104,14 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -103,12 +104,14 @@ 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 "; //sql = " select distinct loc_phy_area from location order by loc_phy_area ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
System.out.println("getSelectedArea() ::::::::::::::: ");
if (rs.next()) if (rs.next())
{ {
selectedArea = this.checkNull(rs.getString("loc_phy_area")); selectedArea = this.checkNull(rs.getString("loc_phy_area"));
...@@ -146,12 +149,12 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -146,12 +149,12 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
return selectedArea; 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 = ""; String sql = "";
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null, rs2 = null;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null, pstmt1 = null; PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null;
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData = null; StringBuffer xmlData = null;
String previousRow = ""; String previousRow = "";
...@@ -161,23 +164,25 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -161,23 +164,25 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
String locationCode = " "; String locationCode = " ";
int count = 0; int count = 0;
String locCode=""; String locCode="";
try try
{ {
System.out.println("Calling EJB getLocDtl ---------"); System.out.println("Calling EJB getLocDtl ---------");
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;
if(locationRange!=null && locationRange.trim().length()>0){ if(locationRange!=null && locationRange.trim().length()>0)
{
locCode ="AND loc_code like '"+locationRange+"%'"; locCode ="AND loc_code like '"+locationRange+"%'";
System.out.println("location Range from JSP ==="+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"; 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 = conn.prepareStatement(sql);
pstmt.setString(1, locPhyArea); pstmt.setString(1, locPhyArea);
pstmt.setString(2, siteCode); pstmt.setString(2, siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
xmlData = new StringBuffer("<?xml version='1.0'?> <Root>"); xmlData = new StringBuffer("<?xml version='1.0'?> <Root>");
xmlData.append("<loc_phy_area area =\"" + locPhyArea + "\">"); xmlData.append("<loc_phy_area area =\"" + locPhyArea + "\">");
while (rs.next()) while (rs.next())
...@@ -192,7 +197,7 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -192,7 +197,7 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
{ {
xmlData.append("</loc_phy_stack > "); 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)) /*if (count > 1 && !currentRow.equals(previousRow))
{ {
xmlData.append("</loc_phy_row > "); xmlData.append("</loc_phy_row > ");
...@@ -223,8 +228,6 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -223,8 +228,6 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
} }
} }
//Changed by Sachinn 03/07/15 bug fixing .end //Changed by Sachinn 03/07/15 bug fixing .end
if (count == 1 || !previousStack.equals(cuurentStack)) if (count == 1 || !previousStack.equals(cuurentStack))
{ {
...@@ -235,7 +238,6 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -235,7 +238,6 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
//Changed due to exp date<= sys date 30/06/15 //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.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 =?"; 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 = conn.prepareStatement(sql);
pstmt1.setString(1, locationCode); pstmt1.setString(1, locationCode);
pstmt1.setString(2, siteCode); pstmt1.setString(2, siteCode);
...@@ -255,6 +257,30 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -255,6 +257,30 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
xmlData.append("<quantity>").append("<![CDATA[" + rs1.getDouble("quantity") + "]]>").append("</quantity>"); xmlData.append("<quantity>").append("<![CDATA[" + rs1.getDouble("quantity") + "]]>").append("</quantity>");
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)
...@@ -348,7 +374,15 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc ...@@ -348,7 +374,15 @@ public class LocationStockOccupancy extends ValidatorEJB implements LocationStoc
if (pstmt1 != null) if (pstmt1 != null)
pstmt1.close(); pstmt1.close();
pstmt1 = null; 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.close();
conn = null; conn = null;
} }
......
...@@ -56,9 +56,10 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -56,9 +56,10 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
System.out.println(" ************** Replenishments ****************** "); System.out.println(" ************** Replenishments ****************** ");
// Replenishments Created Count // Replenishments Created Count
sql = " SELECT COUNT(DISTINCT RH.REPL_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, REPL_ORD_HDR RH, REPL_ORD_DET RT " + //created sql = " SELECT COUNT(DISTINCT RH.REPL_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, REPL_ORD_HDR RH, REPL_ORD_DET RT " //created
" WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = RH.REPL_ORDER AND WT.WAVE_STATUS ='C' AND WT.STATUS ='N' AND RH.REPL_ORDER = RT.REPL_ORDER " + + " WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = RH.REPL_ORDER AND WT.WAVE_STATUS ='C' AND WT.STATUS ='N' AND RH.REPL_ORDER = RT.REPL_ORDER "
" AND RH.REPL_ORDER = RT.REPL_ORDER AND W.CANCEL ='N' AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) AND RH.ORDER_TYPE NOT IN ('E','Q','T','P','I') "; + " AND RH.REPL_ORDER = RT.REPL_ORDER AND W.CANCEL ='N' AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) AND RH.ORDER_TYPE NOT IN "
+ " ('E','Q','T','P','I','V') ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -77,10 +78,11 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -77,10 +78,11 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Replenishments Pending Count // Replenishments Pending Count
sql = " SELECT COUNT (DISTINCT RH.REPL_ORDER) AS COUNT FROM REPL_ORD_HDR RH, WAVE_TASK W, WAVE_TASK_DET WT, REPL_ORD_DET RT" + sql = " SELECT COUNT (DISTINCT RH.REPL_ORDER) AS COUNT FROM REPL_ORD_HDR RH, WAVE_TASK W, WAVE_TASK_DET WT, REPL_ORD_DET RT"
" WHERE W.WAVE_ID = WT.WAVE_ID AND RH.REPL_ORDER = WT.REF_ID AND WT.STATUS = 'N' "+ + " WHERE W.WAVE_ID = WT.WAVE_ID AND RH.REPL_ORDER = WT.REF_ID AND WT.STATUS = 'N' "
" AND WT.WAVE_STATUS = 'W' AND RT.REPL_ORDER = RH.REPL_ORDER AND W.CANCEL = 'N' AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) " + + " AND WT.WAVE_STATUS = 'W' AND RT.REPL_ORDER = RH.REPL_ORDER AND W.CANCEL = 'N' AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) "
" AND RH.ORDER_TYPE NOT IN ('E','Q','T','P','I') " ; + " AND RH.ORDER_TYPE NOT IN ('E','Q','T','P','I','V') " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -99,10 +101,11 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -99,10 +101,11 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Replenishments Verfied Count // Replenishments Verfied Count
sql = " SELECT COUNT (DISTINCT RH.REPL_ORDER) AS COUNT FROM REPL_ORD_HDR RH, REPL_ORD_DET RT, WAVE_TASK W, WAVE_TASK_DET WT, " + //verified sql = " SELECT COUNT (DISTINCT RH.REPL_ORDER) AS COUNT FROM REPL_ORD_HDR RH, REPL_ORD_DET RT, WAVE_TASK W, WAVE_TASK_DET WT, " //verified
" REPL_ISS_HDR RIH, REPL_ISS_DET RIT WHERE RH.REPL_ORDER = RT.REPL_ORDER AND W.WAVE_ID = WT.WAVE_ID AND RH.REPL_ORDER = RIT.REPL_ORDER "+ + " REPL_ISS_HDR RIH, REPL_ISS_DET RIT WHERE RH.REPL_ORDER = RT.REPL_ORDER AND W.WAVE_ID = WT.WAVE_ID AND RH.REPL_ORDER = RIT.REPL_ORDER "
" AND RH.REPL_ORDER = RIH.REPL_ORDER AND RH.REPL_ORDER = WT.REF_ID AND RIH.CONFIRMED ='Y' AND WT.WAVE_STATUS ='V' " + + " AND RH.REPL_ORDER = RIH.REPL_ORDER AND RH.REPL_ORDER = WT.REF_ID AND RIH.CONFIRMED ='Y' AND WT.WAVE_STATUS ='V' "
" AND W.CANCEL ='N' AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) AND RH.ORDER_TYPE NOT IN ('E','Q','T','P','I') "; + " AND W.CANCEL ='N' AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) AND RH.ORDER_TYPE NOT IN "
+ " ('E','Q','T','P','I','V') ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -136,9 +139,10 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -136,9 +139,10 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
System.out.println(" ************** Active Replenishments ****************** "); System.out.println(" ************** Active Replenishments ****************** ");
// Active Repl Created Count // Active Repl Created Count
sql = " SELECT COUNT( DISTINCT RH.REPL_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, REPL_ORD_HDR RH, REPL_ORD_DET RT " + //created sql = " SELECT COUNT( DISTINCT RH.REPL_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, REPL_ORD_HDR RH, REPL_ORD_DET RT " //created
" WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = RH.REPL_ORDER AND RH.REPL_ORDER = RT.REPL_ORDER AND ( RT.CANCEL_MODE = 'N' OR RT.CANCEL_MODE IS NULL ) " + + " WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = RH.REPL_ORDER AND RH.REPL_ORDER = RT.REPL_ORDER AND ( RT.CANCEL_MODE = 'N' OR RT.CANCEL_MODE IS NULL ) "
" AND W.CANCEL ='N' AND WT.STATUS ='N' AND WT.WAVE_STATUS ='C' AND RH.ORDER_TYPE IN ('E','Q','T','P','I') "; + " AND W.CANCEL ='N' AND WT.STATUS ='N' AND WT.WAVE_STATUS ='C' AND RH.ORDER_TYPE IN "
+ " ('E','Q','T','P','I','V') ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -157,9 +161,10 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -157,9 +161,10 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Active Replenishments Pending Count // Active Replenishments Pending Count
sql = " SELECT COUNT ( DISTINCT RH.REPL_ORDER) AS COUNT FROM REPL_ORD_HDR RH, WAVE_TASK W, WAVE_TASK_DET WT, REPL_ORD_DET RT" + sql = " SELECT COUNT ( DISTINCT RH.REPL_ORDER) AS COUNT FROM REPL_ORD_HDR RH, WAVE_TASK W, WAVE_TASK_DET WT, REPL_ORD_DET RT"
" WHERE W.WAVE_ID = WT.WAVE_ID AND RH.REPL_ORDER = WT.REF_ID AND RH.REPL_ORDER = RT.REPL_ORDER AND WT.STATUS = 'N' " + + " WHERE W.WAVE_ID = WT.WAVE_ID AND RH.REPL_ORDER = WT.REF_ID AND RH.REPL_ORDER = RT.REPL_ORDER AND WT.STATUS = 'N' "
" AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) AND W.CANCEL ='N' AND WT.WAVE_STATUS = 'W' AND RH.ORDER_TYPE IN ('E','Q','T','P','I') " ; + " AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) AND W.CANCEL ='N' AND WT.WAVE_STATUS = 'W' AND"
+ " RH.ORDER_TYPE IN ('E','Q','T','P','I','V') " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -178,10 +183,11 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -178,10 +183,11 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Active Replenishments Verified Count // Active Replenishments Verified Count
sql = " SELECT COUNT ( DISTINCT RH.REPL_ORDER) AS COUNT FROM REPL_ORD_HDR RH, REPL_ORD_DET RT, WAVE_TASK W, WAVE_TASK_DET WT, " + //verified sql = " SELECT COUNT ( DISTINCT RH.REPL_ORDER) AS COUNT FROM REPL_ORD_HDR RH, REPL_ORD_DET RT, WAVE_TASK W, WAVE_TASK_DET WT, " //verified
" REPL_ISS_HDR RIH, REPL_ISS_DET RIT WHERE RH.REPL_ORDER = RT.REPL_ORDER AND W.WAVE_ID = WT.WAVE_ID AND RH.REPL_ORDER = RIT.REPL_ORDER "+ + " REPL_ISS_HDR RIH, REPL_ISS_DET RIT WHERE RH.REPL_ORDER = RT.REPL_ORDER AND W.WAVE_ID = WT.WAVE_ID AND RH.REPL_ORDER = RIT.REPL_ORDER "
" AND RH.REPL_ORDER = RIH.REPL_ORDER AND RH.REPL_ORDER = WT.REF_ID AND RIH.CONFIRMED ='Y' AND WT.WAVE_STATUS ='V' " + + " AND RH.REPL_ORDER = RIH.REPL_ORDER AND RH.REPL_ORDER = WT.REF_ID AND RIH.CONFIRMED ='Y' AND WT.WAVE_STATUS ='V' "
" AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) AND W.CANCEL ='N' AND RH.ORDER_TYPE IN ('E','Q','T','P','I') "; + " AND (RT.CANCEL_MODE ='N' OR RT.CANCEL_MODE IS NULL) AND W.CANCEL ='N' AND RH.ORDER_TYPE IN "
+ " ('E','Q','T','P','I','V') ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -214,9 +220,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -214,9 +220,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
System.out.println(" ************** Picking ****************** "); System.out.println(" ************** Picking ****************** ");
// Picking Created Count // Picking Created Count
sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH, PICK_ORD_DET PT, ITEM I WHERE W.WAVE_ID = WT.WAVE_ID "+ sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH, PICK_ORD_DET PT, ITEM I WHERE W.WAVE_ID = WT.WAVE_ID "
" AND WT.REF_ID = PH.PICK_ORDER AND PT.ITEM_CODE = I.ITEM_CODE AND PT.PICK_ORDER = WT.REF_ID AND WT.SALE_ORDER = PT.SALE_ORDER AND (I.HAZARDOUS ='N' OR I.HAZARDOUS IS NULL ) AND WT.WAVE_STATUS ='C' AND WT.STATUS ='N' " + + " AND WT.REF_ID = PH.PICK_ORDER AND PT.ITEM_CODE = I.ITEM_CODE AND PT.PICK_ORDER = WT.REF_ID AND WT.SALE_ORDER = PT.SALE_ORDER AND (I.HAZARDOUS ='N' OR I.HAZARDOUS IS NULL ) AND WT.WAVE_STATUS ='C' AND WT.STATUS ='N' "
" AND W.CANCEL ='N' AND WT.REF_SER IN('C-PICK','M-PICK','P-PICK') "; + " AND W.CANCEL ='N' AND WT.REF_SER IN('C-PICK','M-PICK','P-PICK') ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -235,9 +241,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -235,9 +241,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Picking Pending Count // Picking Pending Count
sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM PICK_ORD_HDR PH, PICK_ORD_DET PT, WAVE_TASK W, WAVE_TASK_DET WT, ITEM I WHERE W.WAVE_ID = WT.WAVE_ID " + sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM PICK_ORD_HDR PH, PICK_ORD_DET PT, WAVE_TASK W, WAVE_TASK_DET WT, ITEM I WHERE W.WAVE_ID = WT.WAVE_ID "
" AND PH.PICK_ORDER = WT.REF_ID AND PT.ITEM_CODE = I.ITEM_CODE AND PT.PICK_ORDER = WT.REF_ID AND WT.SALE_ORDER = PT.SALE_ORDER AND (I.HAZARDOUS ='N' OR I.HAZARDOUS IS NULL) AND WT.STATUS = 'N' AND W.CANCEL ='N' " + + " AND PH.PICK_ORDER = WT.REF_ID AND PT.ITEM_CODE = I.ITEM_CODE AND PT.PICK_ORDER = WT.REF_ID AND WT.SALE_ORDER = PT.SALE_ORDER AND (I.HAZARDOUS ='N' OR I.HAZARDOUS IS NULL) AND WT.STATUS = 'N' AND W.CANCEL ='N' "
" AND WT.WAVE_STATUS = 'W' AND WT.REF_SER IN('C-PICK','M-PICK','P-PICK') "; + " AND WT.WAVE_STATUS = 'W' AND WT.REF_SER IN('C-PICK','M-PICK','P-PICK') ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -256,9 +262,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -256,9 +262,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Picking Verified Count // Picking Verified Count
sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM PICK_ORD_HDR PH, PICK_ORD_DET PT, WAVE_TASK W, WAVE_TASK_DET WT, PICK_ISS_HDR PIH, PICK_ISS_DET PIT, ITEM I " + sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM PICK_ORD_HDR PH, PICK_ORD_DET PT, WAVE_TASK W, WAVE_TASK_DET WT, PICK_ISS_HDR PIH, PICK_ISS_DET PIT, ITEM I "
" WHERE W.WAVE_ID = WT.WAVE_ID AND PH.PICK_ORDER = PIT.PICK_ORDER AND PH.PICK_ORDER = PIH.PICK_ORDER AND PH.PICK_ORDER = WT.REF_ID " + + " WHERE W.WAVE_ID = WT.WAVE_ID AND PH.PICK_ORDER = PIT.PICK_ORDER AND PH.PICK_ORDER = PIH.PICK_ORDER AND PH.PICK_ORDER = WT.REF_ID "
" AND PT.ITEM_CODE = I.ITEM_CODE AND WT.SALE_ORDER = PT.SALE_ORDER AND (I.HAZARDOUS ='N' OR I.HAZARDOUS IS NULL) AND PIH.CONFIRMED ='Y' AND W.CANCEL ='N' AND WT.REF_SER IN('C-PICK','M-PICK','P-PICK') AND WT.WAVE_STATUS = 'V' " ; + " AND PT.ITEM_CODE = I.ITEM_CODE AND WT.SALE_ORDER = PT.SALE_ORDER AND (I.HAZARDOUS ='N' OR I.HAZARDOUS IS NULL) AND PIH.CONFIRMED ='Y' AND W.CANCEL ='N' AND WT.REF_SER IN('C-PICK','M-PICK','P-PICK') AND WT.WAVE_STATUS = 'V' " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -291,8 +297,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -291,8 +297,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
System.out.println(" ************** Active Pick ****************** "); System.out.println(" ************** Active Pick ****************** ");
//Active Pick Create Count //Active Pick Create Count
sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH, PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID "+ sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH, PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID "
" AND WT.REF_ID = PH.PICK_ORDER AND PH.PICK_ORDER = PT.PICK_ORDER AND W.CANCEL ='N' AND WT.STATUS ='N' AND WT.WAVE_STATUS ='C' AND WT.REF_SER IN('A-PICK') "; + " AND WT.REF_ID = PH.PICK_ORDER AND PH.PICK_ORDER = PT.PICK_ORDER AND W.CANCEL ='N' AND WT.STATUS ='N' AND WT.WAVE_STATUS ='C' AND WT.REF_SER IN('A-PICK') ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -311,8 +317,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -311,8 +317,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Active Pick Pending Count // Active Pick Pending Count
sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM PICK_ORD_HDR PH, WAVE_TASK W, WAVE_TASK_DET WT,PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID AND PH.PICK_ORDER = WT.REF_ID " + sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM PICK_ORD_HDR PH, WAVE_TASK W, WAVE_TASK_DET WT,PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID AND PH.PICK_ORDER = WT.REF_ID "
" AND PH.PICK_ORDER = PT.PICK_ORDER AND W.CANCEL ='N' AND WT.STATUS = 'N' AND WT.WAVE_STATUS = 'W' AND WT.REF_SER IN ('A-PICK') " ; + " AND PH.PICK_ORDER = PT.PICK_ORDER AND W.CANCEL ='N' AND WT.STATUS = 'N' AND WT.WAVE_STATUS = 'W' AND WT.REF_SER IN ('A-PICK') " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -331,9 +337,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -331,9 +337,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Active Pick Verified Count // Active Pick Verified Count
sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM PICK_ORD_HDR PH, PICK_ORD_DET PT, WAVE_TASK W, WAVE_TASK_DET WT, PICK_ISS_HDR PIH, PICK_ISS_DET PIT " + sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM PICK_ORD_HDR PH, PICK_ORD_DET PT, WAVE_TASK W, WAVE_TASK_DET WT, PICK_ISS_HDR PIH, PICK_ISS_DET PIT "
" WHERE PH.PICK_ORDER = PT.PICK_ORDER AND W.WAVE_ID = WT.WAVE_ID AND PH.PICK_ORDER = PIT.PICK_ORDER AND PH.PICK_ORDER = PIH.PICK_ORDER AND PH.PICK_ORDER = WT.REF_ID " + + " WHERE PH.PICK_ORDER = PT.PICK_ORDER AND W.WAVE_ID = WT.WAVE_ID AND PH.PICK_ORDER = PIT.PICK_ORDER AND PH.PICK_ORDER = PIH.PICK_ORDER AND PH.PICK_ORDER = WT.REF_ID "
" AND W.CANCEL ='N' AND PIH.CONFIRMED ='Y' AND WT.REF_SER IN ('A-PICK') AND WT.WAVE_STATUS = 'V' " ; + " AND W.CANCEL ='N' AND PIH.CONFIRMED ='Y' AND WT.REF_SER IN ('A-PICK') AND WT.WAVE_STATUS = 'V' " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -366,8 +372,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -366,8 +372,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
System.out.println(" ************** Master Pack ****************** "); System.out.println(" ************** Master Pack ****************** ");
//Master Pack Create Count. //Master Pack Create Count.
sql = " SELECT COUNT (DISTINCT PH.TRAN_ID) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PACK_HDR PH WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = PH.TRAN_ID " + sql = " SELECT COUNT (DISTINCT PH.TRAN_ID) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PACK_HDR PH WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = PH.TRAN_ID "
" AND WT.STATUS ='N' AND W.CANCEL ='N' AND WT.REF_SER IN ('M-PACK') AND WT.WAVE_STATUS ='C' " ; + " AND WT.STATUS ='N' AND W.CANCEL ='N' AND WT.REF_SER IN ('M-PACK') AND WT.WAVE_STATUS ='C' " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -386,8 +392,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -386,8 +392,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Master Pack Pending Count. // Master Pack Pending Count.
sql = " SELECT COUNT(DISTINCT WT.REF_ID) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PACK_HDR PH WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = PH.TRAN_ID " + sql = " SELECT COUNT(DISTINCT WT.REF_ID) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PACK_HDR PH WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = PH.TRAN_ID "
" AND WT.REF_SER IN ('M-PACK') AND WT.STATUS ='N' AND W.CANCEL ='N' AND WT.WAVE_STATUS ='W' " ; + " AND WT.REF_SER IN ('M-PACK') AND WT.STATUS ='N' AND W.CANCEL ='N' AND WT.WAVE_STATUS ='W' " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -406,8 +412,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -406,8 +412,8 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Master Pack Verify Count. // Master Pack Verify Count.
sql = " SELECT COUNT(DISTINCT WT.REF_ID) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PACK_HDR PH WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = PH.TRAN_ID " + sql = " SELECT COUNT(DISTINCT WT.REF_ID) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PACK_HDR PH WHERE W.WAVE_ID = WT.WAVE_ID AND WT.REF_ID = PH.TRAN_ID "
" AND WT.REF_SER IN ('M-PACK') AND WT.STATUS ='Y' AND W.CANCEL ='N' AND WT.WAVE_STATUS ='V' " ; + " AND WT.REF_SER IN ('M-PACK') AND WT.STATUS ='Y' AND W.CANCEL ='N' AND WT.WAVE_STATUS ='V' " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -440,9 +446,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -440,9 +446,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
System.out.println(" ************** Hazmet Case Pick ****************** "); System.out.println(" ************** Hazmet Case Pick ****************** ");
// Hazmet Case Pick Create Count // Hazmet Case Pick Create Count
sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH,ITEM I,PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID " + sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH,ITEM I,PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID "
" AND WT.REF_ID = PH.PICK_ORDER AND PH.PICK_ORDER = PT.PICK_ORDER AND PT.ITEM_CODE = I.ITEM_CODE AND I.HAZARDOUS ='Y' AND WT.WAVE_STATUS ='C' " + + " AND WT.REF_ID = PH.PICK_ORDER AND PH.PICK_ORDER = PT.PICK_ORDER AND PT.ITEM_CODE = I.ITEM_CODE AND I.HAZARDOUS ='Y' AND WT.WAVE_STATUS ='C' "
" AND WT.STATUS = 'N' AND WT.REF_SER IN('C-PICK') " ; + " AND WT.STATUS = 'N' AND WT.REF_SER IN('C-PICK') " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -461,9 +467,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -461,9 +467,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Hazmet Case Pick Pending Count // Hazmet Case Pick Pending Count
sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH,ITEM I,PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID " + sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH,ITEM I,PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID "
" AND WT.REF_ID = PH.PICK_ORDER AND PH.PICK_ORDER = PT.PICK_ORDER AND PT.ITEM_CODE = I.ITEM_CODE AND I.HAZARDOUS ='Y' AND WT.WAVE_STATUS ='W' " + + " AND WT.REF_ID = PH.PICK_ORDER AND PH.PICK_ORDER = PT.PICK_ORDER AND PT.ITEM_CODE = I.ITEM_CODE AND I.HAZARDOUS ='Y' AND WT.WAVE_STATUS ='W' "
" AND WT.STATUS ='N' AND WT.REF_SER IN('C-PICK') " ; + " AND WT.STATUS ='N' AND WT.REF_SER IN('C-PICK') " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -482,9 +488,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -482,9 +488,9 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
} }
// Hazmet Case Pick Verify Count // Hazmet Case Pick Verify Count
sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH,ITEM I,PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID " + sql = " SELECT COUNT ( DISTINCT PH.PICK_ORDER) AS COUNT FROM WAVE_TASK W, WAVE_TASK_DET WT, PICK_ORD_HDR PH,ITEM I,PICK_ORD_DET PT WHERE W.WAVE_ID = WT.WAVE_ID "
" AND WT.REF_ID = PH.PICK_ORDER AND PH.PICK_ORDER = PT.PICK_ORDER AND PT.ITEM_CODE = I.ITEM_CODE AND I.HAZARDOUS ='Y' AND WT.WAVE_STATUS ='V' " + + " AND WT.REF_ID = PH.PICK_ORDER AND PH.PICK_ORDER = PT.PICK_ORDER AND PT.ITEM_CODE = I.ITEM_CODE AND I.HAZARDOUS ='Y' AND WT.WAVE_STATUS ='V' "
" AND WT.REF_SER IN('C-PICK') " ; + " AND WT.REF_SER IN('C-PICK') " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
...@@ -504,7 +510,7 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task ...@@ -504,7 +510,7 @@ public class TaskDetails extends ValidatorEJB implements TaskDetailsRemote, Task
int totalhazmetcasepicks = hazmetCreateCount + hazmetVerifyCount + hazmetPendingCount ; int totalhazmetcasepicks = hazmetCreateCount + hazmetVerifyCount + hazmetPendingCount ;
rowData = new JSONObject(); rowData = new JSONObject();
assignTask = "Hazmet Case Pick"; assignTask = "Hazmat Case Pick";
rowData.put("assignTask", assignTask); rowData.put("assignTask", assignTask);
rowData.put("created", hazmetCreateCount); rowData.put("created", hazmetCreateCount);
rowData.put("pending", hazmetPendingCount); rowData.put("pending", hazmetPendingCount);
......
...@@ -12,13 +12,18 @@ import ibase.webitm.utility.ITMException; ...@@ -12,13 +12,18 @@ import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
@Stateless @Stateless
public class UserActivity extends ValidatorEJB implements UserActivityRemote, UserActivityLocal public class UserActivity extends ValidatorEJB implements UserActivityRemote, UserActivityLocal
{ {
...@@ -29,28 +34,100 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us ...@@ -29,28 +34,100 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
//1.This is the main method to show the parent graph //1.This is the main method to show the parent graph
@SuppressWarnings("unchecked") @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 rawDataJson = new JSONObject();
JSONObject rowData = null; 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; Connection conn = null;
ConnDriver connDriver = new ConnDriver(); 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> empCodeList = new HashSet<String>();
HashSet<String> userList = new HashSet<String>(); HashSet<String> userList = new HashSet<String>();
*/
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; 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, int count = 0, sum = 0, caseCount = 0, activeCount = 0, replCount = 0, masterPickCount = 0,
masterPackCount = 0, phyCount = 0, loadCount = 0; masterPackCount = 0, phyCount = 0, loadCount = 0;
// Sql for empCode and chg_user // 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 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__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 " + "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 ...@@ -494,6 +571,7 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
rs = null; rs = null;
} }
rowData = new JSONObject(); rowData = new JSONObject();
rowData.put("empName", total); rowData.put("empName", total);
rowData.put("caseCount", caseCount); rowData.put("caseCount", caseCount);
...@@ -511,7 +589,9 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us ...@@ -511,7 +589,9 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
"Total replCount ::::::::::" + replCount + "Total masterPickCount ::::::::::: " +masterPickCount+ "Total replCount ::::::::::" + replCount + "Total masterPickCount ::::::::::: " +masterPickCount+
"Total masterPackCount ::::::::::" + masterPackCount + "Total phyCount ::::::::::: " +phyCount+ "Total masterPackCount ::::::::::" + masterPackCount + "Total phyCount ::::::::::: " +phyCount+
"Total loadCount ::::::::::" + loadCount + "Total ::::::::: " + sum); "Total loadCount ::::::::::" + loadCount + "Total ::::::::: " + sum);
}
}*/
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -522,12 +602,29 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us ...@@ -522,12 +602,29 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
{ {
try try
{ {
if(pstmt != null) if(pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; 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) if(pstmt1 != null)
{ {
pstmt1.close();conn = null; pstmt1.close();conn = null;
...@@ -569,7 +666,8 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us ...@@ -569,7 +666,8 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
{ {
conn.close(); conn.close();
conn = null; conn = null;
} }
*/
} }
catch (Exception d) catch (Exception d)
{ {
...@@ -594,5 +692,5 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us ...@@ -594,5 +692,5 @@ public class UserActivity extends ValidatorEJB implements UserActivityRemote, Us
} }
} }
} }
...@@ -13,5 +13,10 @@ import org.json.simple.JSONObject; ...@@ -13,5 +13,10 @@ import org.json.simple.JSONObject;
@Local @Local
public interface UserActivityLocal extends ValidatorLocal 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; ...@@ -13,6 +13,10 @@ import org.json.simple.JSONObject;
@Remote @Remote
public interface UserActivityRemote extends ValidatorRemote 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; public JSONObject getUserActivityDetails(String dataSourceName, String siteCode) throws RemoteException, ITMException;
*/
} }
...@@ -38,23 +38,34 @@ public class ConsignmentDetailsServlet extends HttpServlet ...@@ -38,23 +38,34 @@ public class ConsignmentDetailsServlet extends HttpServlet
ConsignmentDetailsRemote consignmentDetailsRemote = null; ConsignmentDetailsRemote consignmentDetailsRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "", fromDate = "", toDate = "";
String siteCode = ""; String siteCode = "";
try try
{ {
response.setContentType("application/xml"); response.setContentType("application/xml");
dataSourceName = request.getParameter("dataSourceName"); 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"); ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = userInfo.getSiteCode(); siteCode = userInfo.getSiteCode();*/
System.out.println(" siteCode :::::::::: " + siteCode); 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()); context = new InitialContext(appConnectParm.getProperty());
consignmentDetailsRemote = (ConsignmentDetailsRemote) context.lookup("ibase/ConsignmentDetails/remote"); 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 //Here invoke EJB define method
JSONObject jsonObjData = (JSONObject)consignmentDetailsRemote.getConsignmentDetails(dataSourceName, siteCode); //JSONObject jsonObjData = (JSONObject)consignmentDetailsRemote.getConsignmentDetails(dataSourceName, siteCode);
OutputStream outputStream = response.getOutputStream(); OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); 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 ...@@ -38,7 +38,7 @@ public class UserActivityServlet extends HttpServlet
UserActivityRemote userActivityRemote = null; UserActivityRemote userActivityRemote = null;
InitialContext context = null; InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm(); AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = ""; String dataSourceName = "", fromDate = "", toDate = "", empCodeFrom = "", empCodeTo = "";
String siteCode = ""; String siteCode = "";
try try
{ {
...@@ -49,12 +49,29 @@ public class UserActivityServlet extends HttpServlet ...@@ -49,12 +49,29 @@ public class UserActivityServlet extends HttpServlet
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO"); ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
siteCode = userInfo.getSiteCode(); siteCode = userInfo.getSiteCode();
System.out.println(" siteCode :::::::::: " + siteCode); 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()); context = new InitialContext(appConnectParm.getProperty());
userActivityRemote = (UserActivityRemote) context.lookup("ibase/UserActivity/remote"); userActivityRemote = (UserActivityRemote) context.lookup("ibase/UserActivity/remote");
//Here invoke EJB define method //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 outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes()); outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush(); 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