Commit f9dd0c0d authored by arawankar's avatar arawankar

Changes made in contactCommDashboard.java ,contactCommDashboardLocal and contactCommDashboardRemote


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@43789 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ff213af8
......@@ -25,7 +25,14 @@ public class ContactCommDashboard implements ContactCommDashboardLocal, ContactC
@SuppressWarnings("unchecked")
@Override
public JSONObject getCommunicationSchedule(String dataSourceName) throws RemoteException, ITMException
/*Modified by Anjali Rawankar on[10/05/2017][Start]
* [Purpose : Modify method declaration]
*/
//public JSONObject getCommunicationSchedule(String dataSourceName) throws RemoteException, ITMException
public JSONObject getCommunicationSchedule(String dataSourceName,String loginCode) throws RemoteException, ITMException
/*[Purpose : Modify method declaration]
* Modified by Anjali Rawankar on[10/05/2017][End]
*/
{
StringBuffer xmlString = null;
JSONObject rowDataBasicJsn = new JSONObject();
......@@ -43,15 +50,47 @@ public class ContactCommDashboard implements ContactCommDashboardLocal, ContactC
String firstName ="",lastName = "",emailAddr = "" ,mobileNo = "",sorgCode = "",sorgName = "",contactPerson = "";
try
{
xmlString = new StringBuffer("<table class='mtBackgroundWhite' border=''><tbody><tr>"
conn = connDriver.getConnectDB(dataSourceName);
/*Modified by Anjali Rawankar on [10/05/2017][start]
*[Purpose : xmlString initialize inside while loop]
*/
/*xmlString = new StringBuffer("<table class='mtBackgroundWhite' border=''><tbody><tr>"
+ "<th class='mtBackgroundWhite' style='width: 4%;'>Sales Person</th>"
+"<th class='mtBackgroundWhite' colspan='2' style='width: 4%;'> Date </th>"
+"<th class='mtBackgroundWhite' colspan='' style='width: 4%;'> Contact Person</th>"
+"<th class='mtBackgroundWhite' style='width: 4%;'>Orgnization</th>"
+"<th class='mtBackgroundWhite' style='width: 4%;'>Plan Detail</th>"
+"</tr>");
conn = connDriver.getConnectDB(dataSourceName);
/*[Purpose : xmlString initialize inside while loop]
*Modified by Anjali Rawankar on [10/05/2017][End]
*/
/*Modified by Anjali Rawankar on[10/05/2017][Start]
* [Purpose : Added where clause for sales_pers]
*/
/*sql = "SELECT (STR.FIRST_NAME||' '||STR.LAST_NAME) AS CONTACT_PERSON,"+
" STR.SORG_CODE, "+
" STR.EMAIL_ADDR, "+
" STR.MOBILE_NO, "+
" SP.SP_NAME, "+
" COM.COMM_PLAN_ID, "+
" COM.PLAN_DATE, "+
" COM.ACTIVITY_CODE, "+
" COM.COMM_ID, "+
" COM.RESULT_FLAG, "+
" COM.SALES_PERS, "+
" COM.SCON_CODE, "+
" TO_CHAR(COM.COMM_DATE,'DD-MM-YYYY')AS NEW_COMM_DATE, "+
" CASE COM.CONTACT_TYPE WHEN '1' THEN 'CALL' WHEN '2' THEN 'MAIL' WHEN '3' THEN 'MEETING' WHEN '4' "+
" THEN 'VIDEOCONFERENCING'WHEN '5' THEN 'OTHERS'END AS DESCR," +
" COM.PLAN_DETAIL," +
" COM.START_TIME," +
" COM.END_TIME "+
" FROM CONTACT_COMM_PLAN COM " +
" INNER JOIN STRG_CONTACT STR ON COM.SCON_CODE=STR.SCON_CODE " +
" INNER JOIN SALES_PERS SP ON COM.SALES_PERS=SP.SALES_PERS "+
" WHERE COMM_DATE >= SYSDATE ORDER BY SP.SP_NAME,NEW_COMM_DATE";*/
sql = "SELECT (STR.FIRST_NAME||' '||STR.LAST_NAME) AS CONTACT_PERSON,"+
" STR.SORG_CODE, "+
" STR.EMAIL_ADDR, "+
......@@ -73,12 +112,34 @@ public class ContactCommDashboard implements ContactCommDashboardLocal, ContactC
" FROM CONTACT_COMM_PLAN COM " +
" INNER JOIN STRG_CONTACT STR ON COM.SCON_CODE=STR.SCON_CODE " +
" INNER JOIN SALES_PERS SP ON COM.SALES_PERS=SP.SALES_PERS "+
" WHERE COMM_DATE >= SYSDATE ORDER BY SP.SP_NAME,NEW_COMM_DATE";
" WHERE COMM_DATE >= SYSDATE AND COM.SALES_PERS = ? "+
" ORDER BY SP.SP_NAME,NEW_COMM_DATE";
/*[Purpose : Added where clause for sales_pers]
* Modified by Anjali Rawankar on[10/05/2017][End]
*/
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);// Modified by Anjali Rawankar on[10/05/2017]
rs = pstmt.executeQuery();
while (rs.next())
{
/*Modified by Anjali Rawankar on[10/05/2017][Start]
* [Purpose : added table definition]
*/
count++;
if(count == 1)
{
xmlString = new StringBuffer("<table class='mtBackgroundWhite' border=''><tbody><tr>"
+ "<th class='mtBackgroundWhite' style='width: 4%;'>Sales Person</th>"
+"<th class='mtBackgroundWhite' colspan='2' style='width: 4%;'> Date </th>"
+"<th class='mtBackgroundWhite' colspan='' style='width: 4%;'> Contact Person</th>"
+"<th class='mtBackgroundWhite' style='width: 4%;'>Orgnization</th>"
+"<th class='mtBackgroundWhite' style='width: 4%;'>Plan Detail</th>"
+"</tr>");
}
/*[Purpose : added table definition]
* Modified by Anjali Rawankar on[10/05/2017][End]
*/
spName = checkNull(rs.getString("sp_name"));
System.out.println("Sales Person Name ::: [ "+ spName + " ]");
contactPerson = checkNull(rs.getString("contact_person"));
......@@ -99,6 +160,22 @@ public class ContactCommDashboard implements ContactCommDashboardLocal, ContactC
sorgName = rs1.getString("sorg_name");
System.out.println("Organization name :::: ["+sorgName+"]");
}
/*Modified by Anjali Rawankar on[10/05/2017][Start]
* [Purpose : close resultset and preparedstatment]
*/
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
/*[Purpose : close resultset and preparedstatment]
* Modified by Anjali Rawankar on[10/05/2017][End]
*/
xmlString.append("<tr><td class= 'cardHtmlTableBodyAlignLft' rowspan='3' style='width: 4%;'>"+spName+"</td>");
xmlString.append("<td colspan='2' class= 'cardHtmlTableBodyAlignLft' style='width: 4%;'>"+commDate+"</td> ");
xmlString.append("<td class= 'cardHtmlTableBodyAlignLft' style='width: 4%;'>"+contactPerson+"</td>");
......@@ -107,9 +184,20 @@ public class ContactCommDashboard implements ContactCommDashboardLocal, ContactC
xmlString.append("<tr><td ROWSPAN='2' colspan='2' class= 'cardHtmlTableBodyAlignLft' style='width: 4%;border-top: 1px solid transparent;vertical-align:top;'>From:"+checkNull(rs.getString("start_time"))+" To:"+checkNull(rs.getString("end_time"))+"</td> ");
xmlString.append("<td class= 'cardHtmlTableBodyAlignLft' style='width: 4%;border-top: 1px solid transparent;'>"+emailAddr+"</td></tr>");
xmlString.append("<tr><td class= 'cardHtmlTableBodyAlignLft' style='width: 4%;border-top: 1px solid transparent;'><img src='../webitm/images/Standard/tele-1-1.ico' style='width:10px;height:10px;'>"+mobileNo+"</td></tr>");
count++;
}
/*Modified by Anjali Rawankar on[10/05/2017][Start]
*[Purpose : else condition for table definition in case of data not available]
*/
if(count == 0)
{
xmlString = new StringBuffer("<table id='htmlTable' cellpadding='2'"+
"align='center'><tr><td align = 'center' class='gwt-ScrollTable'>No "+
"Data Found</td></tr></table>");
}
/*[Purpose : else condition for table definition in case of data not available]
*Modified by Anjali Rawankar on[10/05/2017][End]
*/
System.out.println("xmlString ::::[ "+xmlString+" ]");
xmlString.append("</tbody></table>");
rowData =new JSONObject();
......@@ -125,7 +213,6 @@ public class ContactCommDashboard implements ContactCommDashboardLocal, ContactC
rs.close();
rs = null;
}
}
catch (Exception e)
{
......
......@@ -8,6 +8,6 @@ import org.json.simple.JSONObject;
public interface ContactCommDashboardLocal
{
public JSONObject getCommunicationSchedule(String dataSourceName) throws RemoteException, ITMException;
public JSONObject getCommunicationSchedule(String dataSourceName,String loginCode) throws RemoteException, ITMException;
}
......@@ -10,6 +10,6 @@ import org.json.simple.JSONObject;
@Stateless
public interface ContactCommDashboardRemote
{
public JSONObject getCommunicationSchedule(String dataSourceName) throws RemoteException, ITMException;
public JSONObject getCommunicationSchedule(String dataSourceName,String loginCode) throws RemoteException, ITMException;
}
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