Commit 7eaa70ff authored by dkasliwal's avatar dkasliwal

Change SQL in WIPStatus, PendingQCPurchase, PendingQCWorkOrder EJB, for Graph, Grid Excel

Add Code Graph and Grid, Excel PDF for Manual QC Order In PendingQC Purchase EJB,
schedule mail with 3 file attached in PendingQCPurchase and 2 file with PendingQCWorkOrder.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98672 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 295a3f52
package ibase.dashboard.mfg.bean;
import ibase.scheduler.utility.interfaces.Schedule;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.webitm.utility.ITMException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.awt.Desktop;
import java.net.URI;
public class PendingQCPurchaseSchedule implements Schedule
{
public String schedule(HashMap map) throws Exception
{
System.out.println(schedule((String) map.get("PROCESS_NAME")));
return schedule((String) map.get("PROCESS_NAME"));
}
public String schedule(String schedule) throws Exception
{
System.out.println("inside PendingQCPurchaseSchedule.........");
this.runSchedule();
return schedule;
}
public String schedulePriority(String arg0) throws Exception
{
return null;
}
private void runSchedule() throws ITMException
{
// Add new code on dated 10/01/2013
String sql = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
String userID = "";
String uri = "";
String finalURI = "";
List<String> sendFinalURIList = null;
//add new variable on dated1/02/2013
String os = System.getProperty("os.name").toLowerCase();
String browserPathForLinex = "";
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sendFinalURIList = new ArrayList<String>();
sql = "select user_id,uri from dashboard_comp where uri like '%ExportExample/GwtDashboardPage.html?metadataname=pendingqcpurchase%'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
while (rs.next())
{
userID = rs.getString("user_id").trim();
uri = rs.getString("uri").trim();
finalURI = CommonConstants.TOMCAT_HOME + uri +"&EMP_MAILCODE="+ userID;
System.out.println("direct uri from dashboard_comp for PendingQCPurchaseSchedule =" + uri);
System.out.println("User id is for PendingQCPurchaseSchedule =" + userID);
System.out.println("Final url for PendingQCPurchaseSchedule including userID+uri =" + finalURI);
sendFinalURIList.add(finalURI.trim());
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
if (os.indexOf("win") >= 0)
{
System.out.println("Start Window Section part execution for PendingQCPurchaseSchedule");
if (Desktop.isDesktopSupported())
{
Desktop desktop = Desktop.getDesktop();
for (String resourcePath : sendFinalURIList)
{
try
{
desktop.browse(new URI(resourcePath));
Thread.sleep(90000);
System.out.println("End run on browser through window insde PendingQCPurchaseSchedule ");
} catch (Exception e)
{
e.printStackTrace();
}
}
}
System.out.println("End of Window Machine section part execution PendingQCPurchaseSchedule");
}
/* Ended Added new code for windows palform */
if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0)
{
browserPathForLinex = "/usr/bin/firefox";
System.out.println("path of firefox inside PendingQCPurchaseSchedule"+browserPathForLinex);
for (String resourcePath : sendFinalURIList)
{
callURL(browserPathForLinex, resourcePath); //call synchronized method
}
}
}// end try block
catch (Exception e)
{
e.printStackTrace();
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception e)
{
e.printStackTrace();
System.out.println("ibase.dashboard.mfg.bean: PendingQCPurchaseSchedule :runSchedule() " + e.getMessage());
}
}
}
synchronized void callURL(String browserPath, String resourcePath)
{
try
{
int second = (int) (System.currentTimeMillis() / 1000) % 60;
System.out.println("View for Time when next URL are comming in PendingQCPurchaseSchedule===" + second);
Runtime.getRuntime().exec(new String[]
{ browserPath, resourcePath });
Thread.sleep(90000);
} catch (Exception e)
{
System.out.println("exception in PendingQCPurchaseSchedule for callURL " + e.getMessage());
}
}
// This method call for check null
private String checkNull(String input)
{
if (input == null)
{
input = "";
} else
{
input = input.trim();
}
return input;
}
}
package ibase.dashboard.mfg.bean;
import ibase.scheduler.utility.interfaces.Schedule;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.webitm.utility.ITMException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.awt.Desktop;
import java.net.URI;
public class PendingQCReceiptSchedule implements Schedule
{
public String schedule(HashMap map) throws Exception
{
System.out.println(schedule((String) map.get("PROCESS_NAME")));
return schedule((String) map.get("PROCESS_NAME"));
}
public String schedule(String schedule) throws Exception
{
System.out.println("inside PendingQCReceiptSchedule.........");
this.runSchedule();
return schedule;
}
public String schedulePriority(String arg0) throws Exception
{
return null;
}
private void runSchedule() throws ITMException
{
// Add new code on dated 10/01/2013
String sql = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
String userID = "";
String uri = "";
String finalURI = "";
List<String> sendFinalURIList = null;
//add new variable on dated1/02/2013
String os = System.getProperty("os.name").toLowerCase();
String browserPathForLinex = "";
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sendFinalURIList = new ArrayList<String>();
sql = "select user_id,uri from dashboard_comp where uri like '%ExportExample/GwtDashboardPage.html?metadataname=pendingqcreceipt%'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
while (rs.next())
{
userID = rs.getString("user_id").trim();
uri = rs.getString("uri").trim();
finalURI = CommonConstants.TOMCAT_HOME + uri +"&EMP_MAILCODE="+ userID;
System.out.println("direct uri from dashboard_comp for PendingQCReceiptSchedule =" + uri);
System.out.println("User id is for PendingQCReceiptSchedule =" + userID);
System.out.println("Final url for PendingQCReceiptSchedule including userID+uri =" + finalURI);
sendFinalURIList.add(finalURI.trim());
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
if (os.indexOf("win") >= 0)
{
System.out.println("Start Window Section part execution for PendingQCReceiptSchedule");
if (Desktop.isDesktopSupported())
{
Desktop desktop = Desktop.getDesktop();
for (String resourcePath : sendFinalURIList)
{
try
{
desktop.browse(new URI(resourcePath));
Thread.sleep(90000);
System.out.println("End run on browser through window insde PendingQCReceiptSchedule ");
} catch (Exception e)
{
e.printStackTrace();
}
}
}
System.out.println("End of Window Machine section part execution PendingQCReceiptSchedule");
}
/* Ended Added new code for windows palform */
if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0)
{
browserPathForLinex = "/usr/bin/firefox";
System.out.println("path of firefox inside PendingQCReceiptSchedule"+browserPathForLinex);
for (String resourcePath : sendFinalURIList)
{
callURL(browserPathForLinex, resourcePath); //call synchronized method
}
}
}// end try block
catch (Exception e)
{
e.printStackTrace();
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception e)
{
e.printStackTrace();
System.out.println("ibase.dashboard.mfg.bean: PendingQCReceiptSchedule :runSchedule() " + e.getMessage());
}
}
}
synchronized void callURL(String browserPath, String resourcePath)
{
try
{
int second = (int) (System.currentTimeMillis() / 1000) % 60;
System.out.println("View for Time when next URL are comming in PendingQCReceiptSchedule===" + second);
Runtime.getRuntime().exec(new String[]
{ browserPath, resourcePath });
Thread.sleep(90000);
} catch (Exception e)
{
System.out.println("exception in PendingQCReceiptSchedule for callURL " + e.getMessage());
}
}
// This method call for check null
private String checkNull(String input)
{
if (input == null)
{
input = "";
} else
{
input = input.trim();
}
return input;
}
}
......@@ -10,8 +10,10 @@ import org.json.simple.JSONObject;
@Local
public interface PendingQCPurchaseOrderLocal
{
public JSONObject getPendingQCOrderPurchase(String itemSer, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingQCOrderPurchaseGrid(String itemSer, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingQCOrderPurchase(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingQCOrderPurchaseGrid(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingManualQCOrder(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingManualQCOrderGrid(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public String getPDFByScheduler(String rptTitle,String remark,String userID, String imgName, String city, String siteCode) throws RemoteException, ITMException;
}
......@@ -10,8 +10,10 @@ import org.json.simple.JSONObject;
@Remote
public interface PendingQCPurchaseOrderRemote
{
public JSONObject getPendingQCOrderPurchase(String itemSer, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingQCOrderPurchaseGrid(String itemSer, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingQCOrderPurchase(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingQCOrderPurchaseGrid(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingManualQCOrder(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public JSONObject getPendingManualQCOrderGrid(String geoLocation, String siteCode, String dataSourceName)throws RemoteException, ITMException;
public String getPDFByScheduler(String rptTitle,String remark,String userID, String imgName, String city, String siteCode) throws RemoteException, ITMException;
}
......@@ -313,7 +313,7 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
catValues.put(noDays,valueForGraph);
catValuesPDF.put(noDays, statusArrStr);
}
if(!("").equals(prvsubType1) && ! prvsubType1.equals(subType1))
else if(!("").equals(prvsubType1) && ! prvsubType1.equals(subType1))
{
rowData.put("month",cnt);
rowData.put("product_category",prvsubType1);
......@@ -332,8 +332,8 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
}
if(cnt==sortedGraphDataMap.size())
{
rowData.put("month",cnt);
rowData.put("product_category",prvsubType1);
rowData.put("month",++cnt);
rowData.put("product_category",subType1);
rowData.put("category_value",catValues);
rowData.put("value_pdf",catValuesPDF);
rawDataWIPStatusDtlJson.put(count, rowData);
......@@ -861,7 +861,7 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
currDate = simpleDateFormat.format(calendar.getTime());
document = new Document();
//rptTitle = rptTitle+"-"+currDate;
rptTitle = rptTitle+" ("+siteCode+")"+" Plant Open Work Order Status as on " +currDate;
rptTitle = city+" ("+siteCode+")"+" Plant Open Work Order Status as on " +currDate;
System.out.println("rptTitle in WIPStatus getPDFByScheduler :"+rptTitle);
......@@ -1069,11 +1069,11 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
System.out.println("No of Users for WIPStatus.getPDFByScheduler city = "+city+" --- toMailId ="+toMailId +"AND According to the ccMailId ======="+ccMailId+"---- bccAddress == "+bccAddress);
}
/*toMailId = "Julian.Soares@sunpharma.com,Bhaumik.Joshi@sunpharma.com,Jigar.Gohil@sunpharma.com,Prachi.Joshi@sunpharma.com";
ccMailId = "dhanendra.kasliwal@baseinformation.com";
/*toMailId = "Julian.Soares@sunpharma.com,Bhaumik.Joshi@sunpharma.com,Jigar.Gohil@sunpharma.com";
ccMailId = "dhanendra.kasliwal@baseinformation.com,birendra.pandey@baseinformation.com";
bccAddress = "";*/
/*toMailId = "nikhil.sawalakhe@baseinformation.com";
/*toMailId = "birendra.pandey@baseinformation.com";
ccMailId = "dhanendra.kasliwal@baseinformation.com";
bccAddress = "";*/
......@@ -1192,18 +1192,18 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
HSSFSheet sheet = wb.createSheet("Excel Sheet");
HSSFRow rowhead = sheet.createRow(0);
HSSFCellStyle cellStyleC=wb.createCellStyle() ;
cellStyleC.setAlignment(HSSFCellStyle.ALIGN_CENTER);
HSSFCellStyle cellStyleLeft=wb.createCellStyle() ;
cellStyleLeft.setAlignment(HSSFCellStyle.ALIGN_LEFT);
HSSFCellStyle cellStyleSR=wb.createCellStyle() ;
cellStyleSR.setAlignment(HSSFCellStyle.ALIGN_CENTER);
HSSFCellStyle cellStyleRight=wb.createCellStyle() ;
cellStyleRight.setAlignment(HSSFCellStyle.ALIGN_RIGHT);
HSSFFont font=wb.createFont();
font.setFontName("Calibri");
font.setFontHeightInPoints((short)10);
cellStyleC.setFont(font);
cellStyleSR.setFont(font);
cellStyleLeft.setFont(font);
cellStyleRight.setFont(font);
/*sql="SELECT a.site_code__mfg AS SITE_CODE, a.WORK_ORDER, a.wo_release_date AS REL_DATE, TRUNC (TRUNC (SYSDATE) - a.wo_release_date) AS NO_OF_DAYS, " +
" a.ORDER_TYPE, a.bom_sub_type AS SUB_TYPE, a.ITEM_CODE, b.ITEM_PARNT, b.descr AS ITEM_NAME, a.UNIT, a.lot_no AS BATCH_NO, " +
......@@ -1223,7 +1223,7 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
" AND a.work_order_status = 'R' AND b.stk_opt = '2' AND a.bom_sub_type <> 'CLEANING' " +
" AND a.wo_release_date <= TRUNC (SYSDATE) ORDER BY a.item_code, a.lot_no";*/
sql="SELECT A.SITE_CODE__MFG AS SITE_CODE, A.WORK_ORDER, A.WO_RELEASE_DATE AS REL_DATE, TRUNC(TRUNC(SYSDATE) - A.WO_RELEASE_DATE) AS NO_OF_DAYS, " +
sql="SELECT A.SITE_CODE__MFG AS SITE_CODE, A.WORK_ORDER, to_char(A.WO_RELEASE_DATE,'dd/mm/yy') AS REL_DATE, TRUNC(TRUNC(SYSDATE) - A.WO_RELEASE_DATE) AS NO_OF_DAYS, " +
"A.ORDER_TYPE, A.BOM_SUB_TYPE AS SUB_TYPE, A.ITEM_CODE, B.ITEM_PARNT, B.DESCR AS ITEM_NAME, A.UNIT, A.LOT_NO AS BATCH_NO, " +
"A.CURRENT_BATCH_SIZE, A.PRODUCTION_QTY, ((A.CURRENT_BATCH_SIZE * A.STD_YIELD_PERC/100) - A.PRODUCTION_QTY) AS WIP," +
" A.WORK_ORDER_STATUS, A.STD_YIELD_PERC, A.ACTUAL_YIELD, A.ACTUAL_PROD_VALUE AS BATCH_COST, QORDER_NO, " +
......@@ -1233,7 +1233,7 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
"FROM DWH_PRODUCTION A, ITEM B ,SITE S WHERE A.ITEM_CODE = B.ITEM_CODE " +
"AND A.SITE_CODE__MFG in("+siteCode+") " +
"AND A.WORK_ORDER_STATUS = 'R' AND B.STK_OPT = '2' AND A.BOM_SUB_TYPE <> 'CLEANING' AND a.site_code__mfg = s.site_code " +
"AND s.city IN ("+city+") AND A.WO_RELEASE_DATE <= TRUNC(SYSDATE) ORDER BY A.ITEM_CODE, A.LOT_NO";
"AND s.city IN ("+city+") AND A.WO_RELEASE_DATE <= TRUNC(SYSDATE) ORDER BY A.WO_RELEASE_DATE";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
......@@ -1252,16 +1252,44 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
{
for(int i=1;i<=columncount;i++)
{
createCell(wb, rowhead, i-1,cellStyleC, rsmtdt.getColumnLabel(i), "String");
createCell(wb, rowhead, i-1,cellStyleLeft, rsmtdt.getColumnLabel(i), "String");
}
flag=false;
index++;
row = sheet.createRow(index);
}
for(int i=1;i<=columncount;i++)
/*for(int i=1;i<=columncount;i++)
{
createCell(wb,row, i-1,cellStyleC,checkNull(rs.getString(i)).trim(),"String");
}
}*/
createCell(wb,row, 0,cellStyleLeft,checkNull(rs.getString(1)).trim(),"String"); //SITE_CODE
createCell(wb,row, 1,cellStyleLeft,checkNull(rs.getString(2)).trim(),"String"); //WORK_ORDER
createCell(wb,row, 2,cellStyleLeft,checkNull(rs.getString(3)).trim(),"String"); //REL_DATE
createCell(wb,row, 3,cellStyleRight,checkZero(rs.getString(4)).trim(),"String"); //NO_OF_DAYS
createCell(wb,row, 4,cellStyleLeft,checkNull(rs.getString(5)).trim(),"String"); //ORDER_TYPE
createCell(wb,row, 5,cellStyleLeft,checkNull(rs.getString(6)).trim(),"String"); //SUB_TYPE
createCell(wb,row, 6,cellStyleLeft,checkNull(rs.getString(7)).trim(),"String"); //ITEM_CODE
createCell(wb,row, 7,cellStyleLeft,checkNull(rs.getString(8)).trim(),"String"); //ITEM_PARNT
createCell(wb,row, 8,cellStyleLeft,checkNull(rs.getString(9)).trim(),"String"); //ITEM_NAME
createCell(wb,row, 9,cellStyleLeft,checkNull(rs.getString(10)).trim(),"String"); //UNIT
createCell(wb,row, 10,cellStyleLeft,checkNull(rs.getString(11)).trim(),"String"); //BATCH_NO
createCell(wb,row, 11,cellStyleLeft,checkNull(rs.getString(12)).trim(),"String"); //CURRENT_BATCH_SIZE
createCell(wb,row, 12,cellStyleRight,checkZero(rs.getString(13)).trim(),"Number"); //PRODUCTION_QTY
createCell(wb,row, 13,cellStyleRight,checkZero(rs.getString(14)).trim(),"Number"); //WIP
createCell(wb,row, 14,cellStyleLeft,checkNull(rs.getString(15)).trim(),"String"); //WORK_ORDER_STATUS
createCell(wb,row, 15,cellStyleRight,checkZero(rs.getString(16)).trim(),"String"); //STD_YIELD_PERC
createCell(wb,row, 16,cellStyleRight,checkZero(rs.getString(17)).trim(),"String"); //ACTUAL_YIELD
createCell(wb,row, 17,cellStyleRight,checkZero(rs.getString(18)).trim(),"Number"); //BATCH_COST
createCell(wb,row, 18,cellStyleLeft,checkNull(rs.getString(19)).trim(),"String"); //QORDER_NO
createCell(wb,row, 19,cellStyleLeft,checkNull(rs.getString(20)).trim(),"String"); //STATUS
index++;
}
......@@ -1314,7 +1342,7 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
{
cellStyle.setDataFormat((short)2);
cell = row.createCell((short) column, HSSFCell.CELL_TYPE_NUMERIC);
cell.setCellValue(Double.parseDouble(data.trim()));
cell.setCellValue(Double.parseDouble(data));
}
cell.setCellStyle(cellStyle);
}
......@@ -1331,4 +1359,16 @@ public class WIPStatus extends ValidatorEJB implements WIPStatusLocal, WIPStatus
}
}
private String checkZero(String str)
{
if(str == null || str.equals(null) || str.equalsIgnoreCase(""))
{
return "0";
}
else
{
return str ;
}
}
}
\ No newline at end of file
package ibase.dashboard.mfg.servlet;
import ibase.dashboard.mfg.ejb.PendingQCPurchaseOrderRemote;
import ibase.system.config.AppConnectParm;
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 org.json.simple.JSONObject;
public class PendingManualQCOrderGridServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
PendingQCPurchaseOrderRemote pendingQCOrderRemote = null;
InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = "";
String siteCode = "";
String geoLocation = "";
try
{
System.out.println("in PendingManualQCOrderGridServlet " );
response.setContentType("application/xml");
dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation");
geoLocation = geoLocation.replace("@", "&");
System.out.println("in PendingManualQCOrderGridServlet SiteCode :"+siteCode+"----geoLocation :"+geoLocation);
context = new InitialContext(appConnectParm.getProperty());
pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote");
JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingManualQCOrderGrid(geoLocation,siteCode,dataSourceName);
OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush();
outputStream.close();
System.out.println(" in servlet Final data set for PendingManualQCOrderGridServlet build the Graph is===" + jsonObjData);
} catch (Exception e)
{
System.out.println("Exception : PendingManualQCOrderGridServlet :doPost(HttpServletRequest request, HttpServletResponse response) :" + e);
try
{
throw new ITMException(e);
} catch (ITMException e1)
{
e1.printStackTrace();
}
}
}
}
\ No newline at end of file
package ibase.dashboard.mfg.servlet;
import ibase.dashboard.mfg.ejb.PendingQCPurchaseOrderRemote;
import ibase.system.config.AppConnectParm;
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 PendingManualQCOrderServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
PendingQCPurchaseOrderRemote pendingQCOrderRemote = null;
InitialContext context = null;
AppConnectParm appConnectParm = new AppConnectParm();
String dataSourceName = "";
String siteCode = "";
String geoLocation = "";
try
{
System.out.println("in PendingManualQCOrderServlet " );
response.setContentType("application/xml");
dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation");
geoLocation = geoLocation.replace("@", "&");
System.out.println("in PendingQCOrderPurchaseServlet SiteCode :"+siteCode+"----geoLocation :"+geoLocation);
context = new InitialContext(appConnectParm.getProperty());
pendingQCOrderRemote = (PendingQCPurchaseOrderRemote) context.lookup("ibase/PendingQCPurchaseOrder/remote");
JSONObject jsonObjData = (JSONObject) pendingQCOrderRemote.getPendingManualQCOrder(geoLocation,siteCode,dataSourceName);
OutputStream outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush();
outputStream.close();
System.out.println(" in servlet Final data set for PendingManualQCOrderServlet build the Graph is===" + jsonObjData);
} catch (Exception e)
{
System.out.println("Exception : PendingManualQCOrderServlet :doPost(HttpServletRequest request, HttpServletResponse response) :" + e);
try
{
throw new ITMException(e);
} catch (ITMException e1)
{
e1.printStackTrace();
}
}
}
}
\ No newline at end of file
......@@ -41,7 +41,7 @@ public class PendingQCOrderPurchaseGridServlet extends HttpServlet
dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation");
geoLocation = geoLocation.replace("@", "&");
System.out.println("in PendingQCOrderPurchaseGridServlet SiteCode :"+siteCode+"----geoLocation :"+geoLocation);
......
......@@ -44,7 +44,7 @@ public class PendingQCOrderPurchaseServlet extends HttpServlet
dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation");
geoLocation = geoLocation.replace("@", "&");
session.setAttribute("geoLocation", geoLocation);
session.setAttribute("siteCode", siteCode);
......
......@@ -41,7 +41,7 @@ public class PendingQCWorkOrderGridServlet extends HttpServlet
dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation");
geoLocation = geoLocation.replace("@", "&");
System.out.println("in PendingQCWorkOrderGridServlet SiteCode :"+siteCode+"----geoLocation :"+geoLocation);
......
......@@ -45,7 +45,7 @@ public class PendingQCWorkOrderServlet extends HttpServlet
dataSourceName = request.getParameter("dataSourceName");
siteCode = request.getParameter("sitecode");
geoLocation = request.getParameter("geoLocation");
geoLocation = geoLocation.replace("@", "&");
session.setAttribute("geoLocation", geoLocation);
session.setAttribute("siteCode", siteCode);
......
......@@ -40,7 +40,7 @@ public class WIPStatusGridServlet extends HttpServlet
/*HttpSession session = request.getSession(true);
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
loginId = userInfo.getLoginCode();*/
city = request.getParameter("city");
city = request.getParameter("city").replace("@", "&");
siteCode = request.getParameter("siteCode");
System.out.println("in WIPStatusGridServlet city :"+city+"====siteCode :"+siteCode);
dataSourceName = request.getParameter("dataSourceName");
......
......@@ -37,7 +37,7 @@ public class WIPStatusServlet extends HttpServlet
{
response.setContentType("application/xml");
HttpSession session = request.getSession(true);
city = request.getParameter("city");
city = request.getParameter("city").replace("@", "&");
siteCode = request.getParameter("siteCode");
dataSourceName = request.getParameter("dataSourceName");
System.out.println("in WIPStatusServlet city :"+city);
......
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