Commit 1cfb0706 authored by abibave's avatar abibave

Request Id : W16KJOH00

Source Files for Admin plan dashboard.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104967 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 440ac252
This diff is collapsed.
package ibase.dashboard.sfa.ejb;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
import org.json.simple.JSONObject;
@Local
public interface AdminPlanLocal extends ValidatorLocal
{
public JSONObject getAdminPlanSummary(String dataSourceName,String loginId,String salePersons, String loginEmpCode) throws RemoteException, ITMException;
public JSONObject getAdminPlanDetail(String dataSourceName,String loginId,String salePersons,String loginEmpCode,String period,String fromDate,String toDate, String spCode,String prvSpCode) throws RemoteException, ITMException;
public JSONObject getSalePersPlanDetail(String dataSourceName, String loginId,String loginEmpCode,String period,String fromDate,String toDate, String spCode,String prvSpCode) throws RemoteException, ITMException;
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Remote;
import org.json.simple.JSONObject;
@Remote
public interface AdminPlanRemote extends ValidatorRemote
{
public JSONObject getAdminPlanSummary(String dataSourceName,String loginId,String salePersons, String loginEmpCode) throws RemoteException, ITMException;
public JSONObject getAdminPlanDetail(String dataSourceName,String loginId,String salePersons,String loginEmpCode,String period,String fromDate,String toDate, String spCode,String prvSpCode) throws RemoteException, ITMException;
public JSONObject getSalePersPlanDetail(String dataSourceName, String loginId,String loginEmpCode,String period,String fromDate,String toDate, String spCode,String prvSpCode) throws RemoteException, ITMException;
}
package ibase.dashboard.sfa.servlet;
import ibase.dashboard.sfa.ejb.AdminPlanRemote;
import ibase.system.config.AppConnectParm;
import ibase.utility.UserInfoBean;
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 AdminPlanDetailServlet 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
{
AdminPlanRemote adminPlanRemote = null;
InitialContext context = null;
AppConnectParm appConnectParm = null;
String dataSourceName = "";
String loginId = "",loginEmpCode = "",salePersons = "",period = "";
String fromDate = "",toDate = "",spCode = "",prvSpCode = "";
HttpSession session = null;
JSONObject jsonObjData = null;
OutputStream outputStream = null;
UserInfoBean userInfo = null;
try
{
response.setContentType("application/xml");
session = request.getSession(true);
appConnectParm = new AppConnectParm();
userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
loginId = userInfo.getLoginCode();
loginEmpCode = userInfo.getEmpCode();
salePersons = request.getParameter("salePersons");
period = request.getParameter("period");
fromDate = request.getParameter("fromDate");
toDate = request.getParameter("toDate");
spCode = request.getParameter("spCode");
prvSpCode = request.getParameter("prvSpCode");
dataSourceName = request.getParameter("dataSourceName");
context = new InitialContext(appConnectParm.getProperty());
adminPlanRemote = (AdminPlanRemote) context.lookup("ibase/AdminPlan/remote");
jsonObjData = (JSONObject) adminPlanRemote.getAdminPlanDetail(dataSourceName,loginId,salePersons,loginEmpCode,period,fromDate,toDate,spCode,prvSpCode);
outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush();
outputStream.close();
System.out.println(" Final data set for AdminPlanDetailServlet build the Graph is===" + jsonObjData);
}
catch (Exception e)
{
System.out.println("Exception : AdminPlanDetailServlet :doPost() :"+ e);
try
{
throw new ITMException(e);
}
catch (ITMException e1)
{
e1.printStackTrace();
}
}
}
}
\ No newline at end of file
package ibase.dashboard.sfa.servlet;
import ibase.dashboard.sfa.ejb.AdminPlanRemote;
import ibase.system.config.AppConnectParm;
import ibase.utility.UserInfoBean;
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 AdminPlanSPDetailServlet 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
{
AdminPlanRemote adminPlanRemote = null;
InitialContext context = null;
AppConnectParm appConnectParm = null;
String dataSourceName = "";
String loginId = "",loginEmpCode = "",period = "";
String fromDate = "",toDate = "",spCode = "",prvSpCode = "";
HttpSession session = null;
JSONObject jsonObjData = null;
OutputStream outputStream = null;
UserInfoBean userInfo = null;
try
{
response.setContentType("application/xml");
session = request.getSession(true);
appConnectParm = new AppConnectParm();
userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
loginId = userInfo.getLoginCode();
loginEmpCode = userInfo.getEmpCode();
period = request.getParameter("period");
fromDate = request.getParameter("fromDate");
toDate = request.getParameter("toDate");
spCode = request.getParameter("spCode");
prvSpCode = request.getParameter("prvSpCode");
dataSourceName = request.getParameter("dataSourceName");
context = new InitialContext(appConnectParm.getProperty());
adminPlanRemote = (AdminPlanRemote) context.lookup("ibase/AdminPlan/remote");
jsonObjData = (JSONObject) adminPlanRemote.getSalePersPlanDetail(dataSourceName,loginId,loginEmpCode,period,fromDate,toDate,spCode,prvSpCode);
outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush();
outputStream.close();
System.out.println(" Final data set for AdminPlanSPDetailServlet build the Graph is===" + jsonObjData);
}
catch (Exception e)
{
System.out.println("Exception : AdminPlanSPDetailServlet :doPost() :"+ e);
try
{
throw new ITMException(e);
}
catch (ITMException e1)
{
e1.printStackTrace();
}
}
}
}
\ No newline at end of file
package ibase.dashboard.sfa.servlet;
import ibase.dashboard.sfa.ejb.AdminPlanRemote;
import ibase.system.config.AppConnectParm;
import ibase.utility.UserInfoBean;
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 AdminPlanServlet 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
{
AdminPlanRemote adminPlanRemote = null;
InitialContext context = null;
AppConnectParm appConnectParm = null;
String dataSourceName = "";
String loginId = "", salePersons = "", loginEmpCode = "";
HttpSession session = null;
JSONObject jsonObjData = null;
OutputStream outputStream = null;
UserInfoBean userInfo = null;
try
{
response.setContentType("application/xml");
session = request.getSession(true);
appConnectParm = new AppConnectParm();
userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
loginId = userInfo.getLoginCode();
loginEmpCode = userInfo.getEmpCode();
salePersons = request.getParameter("salePersons");
dataSourceName = request.getParameter("dataSourceName");
System.out.println("loginId = "+loginId+"sales person = "+salePersons);
context = new InitialContext(appConnectParm.getProperty());
adminPlanRemote = (AdminPlanRemote) context.lookup("ibase/AdminPlan/remote");
jsonObjData = (JSONObject) adminPlanRemote.getAdminPlanSummary(dataSourceName,loginId,salePersons,loginEmpCode);
outputStream = response.getOutputStream();
outputStream.write(jsonObjData.toString().getBytes());
outputStream.flush();
outputStream.close();
System.out.println(" Final data set for AdminPlanServlet build the Graph is===" + jsonObjData);
}
catch (Exception e)
{
System.out.println("Exception : AdminPlanServlet :doPost() :"+ e);
try
{
throw new ITMException(e);
}
catch (ITMException e1)
{
e1.printStackTrace();
}
}
}
}
\ No newline at end of file
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