Commit 0e83c276 authored by sshinde's avatar sshinde

Added OR Condition in Request Efficiency,WorkAllocation summary and...

Added OR Condition in Request Efficiency,WorkAllocation summary and MissingFeedback Dashboard also add new column  in WorkAllocation Summary


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99847 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f1f44478
...@@ -77,7 +77,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -77,7 +77,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
fromDate = simpleDateFormat.format(calendar.getTime()); fromDate = simpleDateFormat.format(calendar.getTime());
frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("getPendingReqSummary default date ,when user dont enter date, From Date="+frmDateInTs+"To Date="+toDateInTs);
} }
else else
{ {
...@@ -86,7 +85,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -86,7 +85,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
simpleDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); simpleDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat());
frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("getPendingReqSummary Date : From Date: "+frmDateInTs+" To Date: "+toDateInTs);
} }
/* For Opening Request * */ /* For Opening Request * */
if((frmDateInTs!=null && frmDateInTs.toString().length()>0) if((frmDateInTs!=null && frmDateInTs.toString().length()>0)
...@@ -263,7 +261,7 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -263,7 +261,7 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rs = null; rs = null;
rowDataPendingTaskJson.put(Integer.valueOf(0), rowData); rowDataPendingTaskJson.put(Integer.valueOf(0), rowData);
System.out.println(" rowDataPendingTaskJson is =" + rowDataPendingTaskJson); //System.out.println(" rowDataPendingTaskJson is =" + rowDataPendingTaskJson);
} }
...@@ -334,14 +332,12 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -334,14 +332,12 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
{ {
simpleDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); simpleDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat());
calendar = Calendar.getInstance(); calendar = Calendar.getInstance();
System.out.println("In Management Dashboard Pending Request Graph: ");
toDate = simpleDateFormat.format(calendar.getTime()); toDate = simpleDateFormat.format(calendar.getTime());
calendar = Calendar.getInstance(); calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
fromDate = simpleDateFormat.format(calendar.getTime()); fromDate = simpleDateFormat.format(calendar.getTime());
frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("get default date ,when user not entering date from GUI in TS format: From Date="+frmDateInTs+"To Date="+toDateInTs);
} }
else else
{ {
...@@ -350,7 +346,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -350,7 +346,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
simpleDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); simpleDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat());
frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("Get Date from input in TS format : From Date: "+frmDateInTs+" To Date: "+toDateInTs);
} }
...@@ -557,7 +552,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -557,7 +552,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rs.close(); rs.close();
rs = null; rs = null;
} }
System.out.println(" rowDataPendingTaskJson is =" + rowDataPendingTaskJson);
} catch (Exception e) } catch (Exception e)
{ {
...@@ -644,15 +638,13 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -644,15 +638,13 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
//simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); //simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); frmDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTs = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println ("getWorkAlloSummary Date from input in TS format : From Date: "+frmDateInTs+" To Date: "+toDateInTs);
dateInpute =" and to_date(h.TRAN_DATE) >= ? AND TO_DATE(H.TRAN_DATE) <= ?"; dateInpute =" and to_date(h.TRAN_DATE) >= ? AND TO_DATE(H.TRAN_DATE) <= ?";
} }
System.out.println("get default date ,when user not entering date from GUI in TS format: From Date="+frmDateInTs+"To Date="+toDateInTs);
if( (empCode!=null && empCode.trim().length()>0) ) if( (empCode!=null && empCode.trim().length()>0) )
{ {
sql = " SELECT E.EMP_FNAME || ' ' || E.EMP_LNAME EMPLOYEE ,I.REQ_ID, I.DTL_DESCR AS REQ_DESCR, " sql = " SELECT E.EMP_FNAME || ' ' || E.EMP_LNAME EMPLOYEE ,I.REQ_ID, I.DTL_DESCR AS REQ_DESCR, "
+" I.CUST_CODE, I.CUST_NAME, SUM(I.TIME_SPENT) as time_spent , I.PLAN_START_DATE,I.ACT_START_DATE, " +" I.CUST_CODE, I.CUST_NAME, SUM(I.TIME_SPENT) as time_spent ,SUM(I.EMP_TIME_SPENT) as emp_time_spent , I.PLAN_START_DATE,I.ACT_START_DATE, "
+" I.PLAN_END_DATE,I.STD_TIME,I.ACTION_DETL FROM (select d.emp_code, r.req_id, " +" I.PLAN_END_DATE,I.STD_TIME,I.ACTION_DETL FROM (select d.emp_code, r.req_id, "
+" c.cust_code, c.cust_name,r.dtl_descr, " +" c.cust_code, c.cust_name,r.dtl_descr, "
// +"-- fn_feedbk_time(sum(d.time_spent)) time_spent, " // +"-- fn_feedbk_time(sum(d.time_spent)) time_spent, "
...@@ -667,14 +659,21 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -667,14 +659,21 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
+" AND DI.EMP_CODE = D.EMP_CODE " +" AND DI.EMP_CODE = D.EMP_CODE "
+" ) PLAN_END_DATE,d.STD_TIME,d.ACTION_DETL, " +" ) PLAN_END_DATE,d.STD_TIME,d.ACTION_DETL, "
+" (select fn_feedbk_time(sum(iid.time_spent)) from SER_REQ_FEEDBKDTL iid,SER_REQ_FEEDBK iih " +" (select fn_feedbk_time(sum(iid.time_spent)) from SER_REQ_FEEDBKDTL iid,SER_REQ_FEEDBK iih "
+" where iid.feedbk_id = iih.feedbk_id and iih.req_id = r.req_id) time_spent " +" where iid.feedbk_id = iih.feedbk_id and iih.req_id = r.req_id) time_spent , "
/**Start Added by sachin on 7-Dec-15*/
+" (select fn_feedbk_time(sum(iid.time_spent)) from SER_REQ_FEEDBKDTL iid,SER_REQ_FEEDBK iih, ser_req_act_detl ad, ser_req_act ah "
+" where iid.feedbk_id = iih.feedbk_id and iih.req_id = r.req_id and ah.action_id = ad.action_id and ah.req_id = iih.req_id and "
+" iih.emp_code = ad.emp_code and iid.action_id = ad.action_id and iid.action_code = iid.action_code ) emp_time_spent "
/**Ebd Added by sachin on 7-Dec-15*/
+" from ser_request r, customer c, ser_req_act h, ser_req_act_detl d " +" from ser_request r, customer c, ser_req_act h, ser_req_act_detl d "
+" where d.action_id = h.action_id " +" where d.action_id = h.action_id "
+" and r.req_id = h.req_id " +" and r.req_id = h.req_id "
+" AND R.CUST_CODE = C.CUST_CODE " +" AND R.CUST_CODE = C.CUST_CODE "
+" AND d.emp_code in (select emp_code FROM EMPLOYEE START WITH EMP_CODE = "+empCode+" " +" AND ((d.emp_code in (select emp_code FROM EMPLOYEE START WITH EMP_CODE = "+empCode+" "
+" CONNECT BY PRIOR EMP_CODE = REPORT_TO AND REPORT_TO IS NOT NULL " +" CONNECT BY PRIOR EMP_CODE = REPORT_TO AND REPORT_TO IS NOT NULL "
+" AND ( RELIEVE_DATE IS NULL OR RELIEVE_DATE >= SYSDATE )) " +" AND ( RELIEVE_DATE IS NULL OR RELIEVE_DATE >= SYSDATE ))) OR (d.emp_code="+empCode+")) "
+ dateInpute + dateInpute
+" group by d.emp_code, r.req_id, c.cust_code, c.cust_name, r.dtl_descr,d.STD_TIME,d.ACTION_DETL " +" group by d.emp_code, r.req_id, c.cust_code, c.cust_name, r.dtl_descr,d.STD_TIME,d.ACTION_DETL "
+" ) i, employee e WHERE I.EMP_CODE = E.EMP_CODE " +" ) i, employee e WHERE I.EMP_CODE = E.EMP_CODE "
...@@ -732,11 +731,15 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -732,11 +731,15 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rowData.put("act_descr", checkNull(rs.getString("ACTION_DETL"))); rowData.put("act_descr", checkNull(rs.getString("ACTION_DETL")));
rowData.put("est_man_hour", checkNull(rs.getString("STD_TIME"))); rowData.put("est_man_hour", checkNull(rs.getString("STD_TIME")));
rowData.put("hour_spent", checkNull(rs.getString("time_spent"))); rowData.put("hour_spent", checkNull(rs.getString("time_spent")));
/**Added by sachin on 7-Dec-15*/
rowData.put("emp_hour_spent", checkNull(rs.getString("emp_time_spent")));
/**End Addede by sachin on 7-Dec-15*/
rowDataEmpWrkAllJson.put(Integer.valueOf(count), rowData); rowDataEmpWrkAllJson.put(Integer.valueOf(count), rowData);
count++; count++;
} }
} }
System.out.println(" rowDataEmpWrkAllJson is =" + rowDataEmpWrkAllJson);
} catch (Exception e) } catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
...@@ -792,11 +795,11 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -792,11 +795,11 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
Timestamp toDateInTS=null; Timestamp toDateInTS=null;
double deviation=0.0,stdTime=0.0,actTime=0.0; double deviation=0.0,stdTime=0.0,actTime=0.0;
double totDeviation=0.0,totStdTime=0.0,totActTime=0.0; double totDeviation=0.0,totStdTime=0.0,totActTime=0.0;
int onTimeCtr=0,posTimeCtr=0,negTimeCtr=0;
SimpleDateFormat simpleDateFormat = null; SimpleDateFormat simpleDateFormat = null;
SimpleDateFormat convertToDbDate=null; SimpleDateFormat convertToDbDate=null;
Calendar calendar=null; Calendar calendar=null;
DashboardUtility dashboardUtility=null; DashboardUtility dashboardUtility=null;
String compStat="";
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); conn = connDriver.getConnectDB(dataSourceName);
...@@ -818,7 +821,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -818,7 +821,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
fromDate = simpleDateFormat.format(calendar.getTime()); fromDate = simpleDateFormat.format(calendar.getTime());
fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("getReqEfficiencySummary default date ,when user dnt enter date : From Date="+fromDate+"To Date="+toDate);
} }
else else
{ {
...@@ -827,7 +829,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -827,7 +829,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
//simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); //simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("getReqEfficiencySummary Date : From Date: "+fromDateInTS+" To Date: "+toDateInTS);
} }
if((fromDateInTS!=null && fromDateInTS.toString().length()>0) && (toDateInTS!=null && toDateInTS.toString().length()>0) if((fromDateInTS!=null && fromDateInTS.toString().length()>0) && (toDateInTS!=null && toDateInTS.toString().length()>0)
&& (empCode!=null && empCode.trim().length()>0) ) && (empCode!=null && empCode.trim().length()>0) )
...@@ -858,11 +859,12 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -858,11 +859,12 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
+" and ah.req_id = r.req_id " +" and ah.req_id = r.req_id "
+" AND E.EMP_CODE = ad.EMP_CODE " +" AND E.EMP_CODE = ad.EMP_CODE "
+" and r.comp_stat_dt >= ? and r.comp_stat_dt <= ? "//--? +" and r.comp_stat_dt >= ? and r.comp_stat_dt <= ? "//--?
+" AND ad.emp_code in (select emp_code FROM EMPLOYEE START WITH EMP_CODE = "+empCode+" " +" AND ((ad.emp_code in (select emp_code FROM EMPLOYEE START WITH EMP_CODE = "+empCode+" "
+" CONNECT BY PRIOR EMP_CODE = REPORT_TO AND REPORT_TO IS NOT NULL " +" CONNECT BY PRIOR EMP_CODE = REPORT_TO AND REPORT_TO IS NOT NULL "
+" AND ( RELIEVE_DATE IS NULL OR RELIEVE_DATE >= SYSDATE )) " +" AND ( RELIEVE_DATE IS NULL OR RELIEVE_DATE >= SYSDATE )) ) OR (ad.emp_code="+empCode+"))"
+" group by r.req_id,r.dtl_descr, ad.action_detl, r.COMP_STAT,e.emp_fname || ' ' || e.emp_lname, ad.STD_TIME ,r.comp_stat_dt " + +" group by r.req_id,r.dtl_descr, ad.action_detl, r.COMP_STAT,e.emp_fname || ' ' || e.emp_lname, ad.STD_TIME ,r.comp_stat_dt "
" order by r.comp_stat_dt desc "; + " order by r.comp_stat_dt desc ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,fromDateInTS); pstmt.setTimestamp(1,fromDateInTS);
...@@ -886,7 +888,26 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -886,7 +888,26 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rowData.put("est_man_hour", checkNull(rs.getString("STD_TIME"))); rowData.put("est_man_hour", checkNull(rs.getString("STD_TIME")));
rowData.put("act_man_hour", checkNull(rs.getString("ACTUAL_TIME"))); rowData.put("act_man_hour", checkNull(rs.getString("ACTUAL_TIME")));
rowData.put("deviation", ""+deviation); rowData.put("deviation", ""+deviation);
rowData.put("req_status",checkNull(rs.getString("COMP_STAT")));
//*Added New code by sachin on 7-Dec-15*/
compStat=checkNull(rs.getString("COMP_STAT"));
if(compStat.trim().length()>0)
{
if("C".equalsIgnoreCase(compStat))
{
compStat="CLOSED";
}else
{
compStat="PENDING";
}
}
//rowData.put("req_status",checkNull(rs.getString("COMP_STAT")));
rowData.put("req_status",compStat);
//*Added New code by sachin on 7-Dec-15*/
String comp_stat_dt=checkNull(rs.getString("comp_stat_dt")); String comp_stat_dt=checkNull(rs.getString("comp_stat_dt"));
if(!comp_stat_dt.equals(null) && comp_stat_dt.trim().length()>0) if(!comp_stat_dt.equals(null) && comp_stat_dt.trim().length()>0)
...@@ -960,7 +981,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -960,7 +981,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rowData.put("time_lag_descr", "Before Time"); rowData.put("time_lag_descr", "Before Time");
rowDataEmpReqEffJson.put(Integer.valueOf(count), rowData);*/ rowDataEmpReqEffJson.put(Integer.valueOf(count), rowData);*/
} }
System.out.println(" rowDataEmpReqEffJson is =" + rowDataEmpReqEffJson);
} catch (Exception e) } catch (Exception e)
{ {
...@@ -1018,7 +1038,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1018,7 +1038,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
LinkedHashMap<String, List<String> > empMap = new LinkedHashMap<String, List<String>>(); LinkedHashMap<String, List<String> > empMap = new LinkedHashMap<String, List<String>>();
List<String> empList= new ArrayList<String>(); List<String> empList= new ArrayList<String>();
DateFormat originalFormat = new SimpleDateFormat("dd/MM/yy"); DateFormat originalFormat = new SimpleDateFormat("dd/MM/yy");
String preEmpCode="";
int count=0; int count=0;
List<String> valueList=null; List<String> valueList=null;
StringBuilder excDate=null; StringBuilder excDate=null;
...@@ -1047,13 +1066,11 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1047,13 +1066,11 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
fromDate = simpleDateFormat.format(calendar.getTime()); fromDate = simpleDateFormat.format(calendar.getTime());
fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("get default date ,when user dnt enter date : From Date="+fromDate+"To Date="+toDate);
} }
else else
{ {
fromDateInTS =java.sql.Timestamp.valueOf(convrtToTimStmDate.format(originalFormat.parse(fromDate)).toString() + " 00:00:00.0"); fromDateInTS =java.sql.Timestamp.valueOf(convrtToTimStmDate.format(originalFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTS=java.sql.Timestamp.valueOf(convrtToTimStmDate.format(originalFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTS=java.sql.Timestamp.valueOf(convrtToTimStmDate.format(originalFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("Get Date from input : From Date: "+fromDate+" To Date: "+toDate);
} }
if((fromDateInTS!=null && fromDateInTS.toString().length()>0) if((fromDateInTS!=null && fromDateInTS.toString().length()>0)
&& (toDateInTS!=null && toDateInTS.toString().length()>0) && (toDateInTS!=null && toDateInTS.toString().length()>0)
...@@ -1092,7 +1109,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1092,7 +1109,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rs=null; rs=null;
pstmt.close(); pstmt.close();
pstmt=null; pstmt=null;
System.out.println("executeDayList: "+executeDayList);
sql=" select c.emp_fname || ' ' || c.emp_lname || '' emp_name, c.emp_code emp_code ,b.execut_dt as execut_dt " sql=" select c.emp_fname || ' ' || c.emp_lname || '' emp_name, c.emp_code emp_code ,b.execut_dt as execut_dt "
+" from ser_req_feedbkdtl a, ser_req_feedbk b, employee c, ser_request " +" from ser_req_feedbkdtl a, ser_req_feedbk b, employee c, ser_request "
...@@ -1100,13 +1116,14 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1100,13 +1116,14 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
+" AND B.EMP_CODE = C.EMP_CODE " +" AND B.EMP_CODE = C.EMP_CODE "
+" AND TO_DATE( B.EXECUT_DT, 'DD/MM/YY' ) >= TO_DATE (?, 'DD/MM/YY') " +" AND TO_DATE( B.EXECUT_DT, 'DD/MM/YY' ) >= TO_DATE (?, 'DD/MM/YY') "
+" AND TO_DATE( B.EXECUT_DT, 'DD/MM/YY' ) <= TO_DATE(?, 'DD/MM/YY') " +" AND TO_DATE( B.EXECUT_DT, 'DD/MM/YY' ) <= TO_DATE(?, 'DD/MM/YY') "
+" and c.emp_code in ( select EMP_CODE FROM EMPLOYEE START WITH EMP_CODE = ? CONNECT BY PRIOR EMP_CODE = REPORT_TO " +" and ((c.emp_code in ( select EMP_CODE FROM EMPLOYEE START WITH EMP_CODE = ? CONNECT BY PRIOR EMP_CODE = REPORT_TO "
+" AND REPORT_TO IS NOT NULL AND ( RELIEVE_DATE IS NULL OR RELIEVE_DATE >= SYSDATE ) ) " +" AND REPORT_TO IS NOT NULL AND ( RELIEVE_DATE IS NULL OR RELIEVE_DATE >= SYSDATE ) ))OR (c.emp_code = ? ) ) "
+" order by emp_name,b.execut_dt "; +" order by emp_name,b.execut_dt ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,fromDate); pstmt.setString(1,fromDate);
pstmt.setString(2,toDate); pstmt.setString(2,toDate);
pstmt.setString(3,empCode); pstmt.setString(3,empCode);
pstmt.setString(4,empCode);
//pstmt.setTimestamp(2,toDateInTS); //pstmt.setTimestamp(2,toDateInTS);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
...@@ -1126,7 +1143,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1126,7 +1143,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
empMap.put(empCode, empList); empMap.put(empCode, empList);
} }
} }
System.out.println("empMap in feddback missing: "+empMap);
rs.close(); rs.close();
pstmt.close(); pstmt.close();
for (String keyMap : empMap.keySet()) for (String keyMap : empMap.keySet())
...@@ -1163,7 +1179,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1163,7 +1179,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
count++; count++;
} }
} }
System.out.println(" rowDataMissingFeedbackJson is =" + rowDataMissingFeedbackJson);
} catch (Exception e) } catch (Exception e)
{ {
...@@ -1228,7 +1243,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1228,7 +1243,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
conn = connDriver.getConnectDB(dataSourceName); conn = connDriver.getConnectDB(dataSourceName);
connDriver = null; connDriver = null;
convertToDbDate = new SimpleDateFormat(genericUtility.getDBDateFormat()); convertToDbDate = new SimpleDateFormat(genericUtility.getDBDateFormat());
System.out.println("In Management Dashboard Req Efficiency Pie chart: ");
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
empCode=dashboardUtility.getCommaSeparated(empCode); empCode=dashboardUtility.getCommaSeparated(empCode);
simpleDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat()); simpleDateFormat = new SimpleDateFormat( genericUtility.getApplDateFormat());
...@@ -1242,7 +1256,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1242,7 +1256,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
fromDate = simpleDateFormat.format(calendar.getTime()); fromDate = simpleDateFormat.format(calendar.getTime());
fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("getReqEfficiencySummaryPie default date ,when user dnt enter date : From Date="+fromDate+"To Date="+toDate);
} }
else else
{ {
...@@ -1250,7 +1263,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1250,7 +1263,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0"); fromDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(fromDate)).toString() + " 00:00:00.0");
toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0"); toDateInTS = java.sql.Timestamp.valueOf(convertToDbDate.format(simpleDateFormat.parse(toDate)).toString() + " 00:00:00.0");
System.out.println("getReqEfficiencySummaryPie Date : From Date: "+fromDateInTS+" To Date: "+toDateInTS);
} }
if((fromDateInTS!=null && fromDateInTS.toString().length()>0) && (toDateInTS!=null && toDateInTS.toString().length()>0) if((fromDateInTS!=null && fromDateInTS.toString().length()>0) && (toDateInTS!=null && toDateInTS.toString().length()>0)
&& (empCode!=null && empCode.trim().length()>0) ) && (empCode!=null && empCode.trim().length()>0) )
...@@ -1356,7 +1368,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1356,7 +1368,6 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rowData.put("time_lag_descr", "Before Time"); rowData.put("time_lag_descr", "Before Time");
rowDataEmpReqEffJson.put(Integer.valueOf(count), rowData); rowDataEmpReqEffJson.put(Integer.valueOf(count), rowData);
} }
System.out.println(" rowDataEmpReqEffJsonPie is =" + rowDataEmpReqEffJson);
} catch (Exception e) } catch (Exception e)
{ {
......
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