Commit 1be4434a authored by sshinde's avatar sshinde

Modify SQL Of WorkAllocation Summary added new column employee time spent


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99891 ce508802-f39f-4f6c-b175-0d175dae99d5
parent aebe9426
...@@ -60,6 +60,18 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -60,6 +60,18 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
SimpleDateFormat convertToDbDate = null; SimpleDateFormat convertToDbDate = null;
SimpleDateFormat simpleDateFormat = null; SimpleDateFormat simpleDateFormat = null;
Calendar calendar = null; Calendar calendar = null;
/*Start Added By sachin 13-Jan-16*/
String timeSpent="";
String stdCompTime="";
String openingRequest="";
String promisDurPrd="";
String receDurPrd="";
String delDurPrd="";
String cntWisePromise="";
String cntWrkGng="";
String noOfReq="";
/*End Added By sachin 13-Jan-16*/
try try
{ {
conn = connDriver.getConnectDB(dataSourceName); conn = connDriver.getConnectDB(dataSourceName);
...@@ -102,8 +114,19 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -102,8 +114,19 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
rowData.put("openingrequest", checkNull(rs.getString("opening_request"))); openingRequest= checkNull(rs.getString("opening_request"));
} }
/*Start modify Code by sachin on 13-Jan-16*/
if(openingRequest.trim().length()>0)
{
rowData.put("openingrequest", openingRequest);
}else
{
rowData.put("openingrequest", 0);
}
/*End modify Code by sachin on 13-Jan-16*/
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
...@@ -118,8 +141,18 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -118,8 +141,18 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
rowData.put("receiveduringprd", checkNull(rs.getString("rece_dur_prd"))); receDurPrd=checkNull(rs.getString("rece_dur_prd"));
}
/*Start modify Code by sachin on 13-Jan-16*/
if(receDurPrd.trim().length()>0)
{
rowData.put("receiveduringprd",receDurPrd);
}else
{
rowData.put("receiveduringprd", 0);
} }
/*End modify Code by sachin on 13-Jan-16*/
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
...@@ -134,11 +167,21 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -134,11 +167,21 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
pstmt.setTimestamp(2, toDateInTs); pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(3, empCode); pstmt.setString(3, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
rowData.put("promceduringprd", checkNull(rs.getString("proms_dur_prd"))); promisDurPrd= checkNull(rs.getString("proms_dur_prd"));
} }
/*Start modify Code by sachin on 13-Jan-16*/
if(promisDurPrd.trim().length()>0)
{
rowData.put("promceduringprd",promisDurPrd);
}else
{
rowData.put("promceduringprd", 0);
}
/*End modify Code by sachin on 13-Jan-16*/
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
...@@ -155,8 +198,18 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -155,8 +198,18 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
rowData.put("deliduringprd", checkNull(rs.getString("del_dur_prd"))); delDurPrd= checkNull(rs.getString("del_dur_prd"));
}
/*Start modify Code by sachin on 13-Jan-16*/
if(delDurPrd.trim().length()>0)
{
rowData.put("deliduringprd",delDurPrd);
}else
{
rowData.put("deliduringprd", 0);
} }
/*End modify Code by sachin on 13-Jan-16*/
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
...@@ -170,11 +223,21 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -170,11 +223,21 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
rowData.put("cntwitpromise", checkNull(rs.getString("cnt_wit_prom"))); cntWisePromise= checkNull(rs.getString("cnt_wit_prom"));
} }
/*Start modify Code by sachin on 13-Jan-16*/
if(cntWisePromise.trim().length()>0)
{
rowData.put("cntwitpromise",cntWisePromise);
}else
{
rowData.put("cntwitpromise", 0);
}
/*End modify Code by sachin on 13-Jan-16*/
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
...@@ -182,7 +245,17 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -182,7 +245,17 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
//--- Count on which work going on //--- Count on which work going on
sql = "select count(distinct r.req_id) as cnt_wrk_gng from ser_req_feedbk f, ser_request r where f.req_id = r.req_id and r.emp_code__assign = ? and f.EXECUT_DT between ? and ? "; //sql = "select count(distinct r.req_id) as cnt_wrk_gng from ser_req_feedbk f, ser_request r where f.req_id = r.req_id and r.emp_code__assign = ? and f.EXECUT_DT between ? and ? ";
/*
* Added by sachin on 13-Jan-15
*/
sql = "select count(distinct r.req_id) as cnt_wrk_gng from ser_req_feedbk f, ser_request r where f.req_id = r.req_id and r.emp_code__assign = ? and f.EXECUT_DT between ? and ? and r.comp_stat <> 'C'";
/*
End Added by sachin on 13-Jan-15
*/
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setTimestamp(2, frmDateInTs); pstmt.setTimestamp(2, frmDateInTs);
...@@ -191,9 +264,19 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -191,9 +264,19 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
rowData.put("cntwrkgoing", checkNull(rs.getString("cnt_wrk_gng"))); cntWrkGng=checkNull(rs.getString("cnt_wrk_gng"));
} }
/*Star modify Code by sachin on 13-Jan-16*/
if(cntWrkGng.trim().length()>0)
{
rowData.put("cntwrkgoing",cntWrkGng);
}else
{
rowData.put("cntwrkgoing", 0);
}
/*End modify Code by sachin on 13-Jan-16*/
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
...@@ -217,10 +300,28 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -217,10 +300,28 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
if (rs.next()) if (rs.next())
{ {
rowData.put("totalmanhrs", checkNull(rs.getString("time_spent"))); timeSpent=checkNull(rs.getString("time_spent"));
rowData.put("estimatedmanhrs", checkNull(rs.getString("STD_COMP_TIME"))); stdCompTime=checkNull(rs.getString("STD_COMP_TIME"));
}
/*Star Added Code by sachin on 13-Jan-16*/
if(timeSpent.trim().length()>0)
{
rowData.put("totalmanhrs", timeSpent);
}else
{
rowData.put("totalmanhrs", 0);
}
if(stdCompTime.trim().length()>0)
{
rowData.put("estimatedmanhrs", stdCompTime);
}else
{
rowData.put("estimatedmanhrs", 0);
} }
/*End Added Code by sachin on 13-Jan-16*/
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
...@@ -257,16 +358,23 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -257,16 +358,23 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
if (rs.next()) if (rs.next())
{ {
rowData.put("noreq", checkNull(rs.getString("no_req"))); noOfReq=checkNull(rs.getString("no_req"));
} }
if(noOfReq.trim().length()>0)
{
rowData.put("noreq",noOfReq);
}else
{
rowData.put("noreq", 0);
}
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
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(" getPendingReqSummary json is =" + rowDataPendingTaskJson);
} }
...@@ -449,7 +557,14 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -449,7 +557,14 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
// --- Count without a promised date // --- Count without a promised date
sql = "select count(1) cnt_wit_prom from ser_request where emp_code__assign = ? and COMP_STAT_DT is null"; // sql = "select count(1) cnt_wit_prom from ser_request where emp_code__assign = ? and COMP_STAT_DT is null";
/*Start Modify by sachin on 13 -Jan-16*/
sql = "select count(1) cnt_wit_prom from ser_request where emp_code__assign = ? and EXP_END_DATE is null";
/* End Modify by sachin on 13 -Jan-16*/
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
...@@ -470,7 +585,17 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -470,7 +585,17 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
//--- Count on which work going on //--- Count on which work going on
sql = "select count(distinct r.req_id) as cnt_wrk_gng from ser_req_feedbk f, ser_request r where f.req_id = r.req_id and r.emp_code__assign = ? and f.EXECUT_DT between ? and ? "; // sql = "select count(distinct r.req_id) as cnt_wrk_gng from ser_req_feedbk f, ser_request r where f.req_id = r.req_id and r.emp_code__assign = ? and f.EXECUT_DT between ? and ? ";
/*
* Added by sachin on 13-Jan-16
*/
sql = "select count(distinct r.req_id) as cnt_wrk_gng from ser_req_feedbk f, ser_request r where f.req_id = r.req_id and r.emp_code__assign = ? and f.EXECUT_DT between ? and ? and r.comp_stat <> 'C'";
/*
End Added by sachin on 13-Jan-16
*/
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
...@@ -551,6 +676,7 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -551,6 +676,7 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
if (rs.next()) if (rs.next())
{ {
rowData = new JSONObject(); rowData = new JSONObject();
rowData.put("descr","Closed" ); rowData.put("descr","Closed" );
rowData.put("count",checkNull(rs.getString("no_req")) ); rowData.put("count",checkNull(rs.getString("no_req")) );
...@@ -654,45 +780,8 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -654,45 +780,8 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
if( (empCode!=null && empCode.trim().length()>0) ) if( (empCode!=null && empCode.trim().length()>0) )
{ {
empCode = dashboardUtility.getCommaSeparated(empCode); empCode = dashboardUtility.getCommaSeparated(empCode);
/*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 ,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, "
+" c.cust_code, c.cust_name,r.dtl_descr, "
// +"-- fn_feedbk_time(sum(d.time_spent)) time_spent, "
+" (select min(di.PLANSTDATE) from ser_req_act_detl di, ser_req_act hi "
+" where hi.action_id = di.action_id "
+" and hi.req_id = r.req_id and di.emp_code = d.emp_code ) plan_start_date, "
+" (SELECT MIN(FD.START_DATE_ACTUAL) FROM SER_REQ_FEEDBKDTL FD, SER_REQ_FEEDBK FH "
+" where fd.feedbk_id = fh.feedbk_id and fh.req_id = r.req_id and fh.emp_code = d.emp_code) act_start_date, "
+" (select max(di.PLANENDDATE) from ser_req_act_detl di, ser_req_act hi "
+" where hi.action_id = di.action_id "
+" and hi.req_id = r.req_id "
+" AND DI.EMP_CODE = D.EMP_CODE "
+" ) 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 "
+" 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 "
+" where d.action_id = h.action_id "
+" and r.req_id = h.req_id "
+" AND R.CUST_CODE = C.CUST_CODE "
+" 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 "
+" AND ( RELIEVE_DATE IS NULL OR RELIEVE_DATE >= SYSDATE ))) OR (d.emp_code="+empCode+")) "
+ dateInpute
+" 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 "
+" GROUP BY E.EMP_FNAME || ' ' || E.EMP_LNAME,I.REQ_ID, I.DTL_DESCR,I.CUST_CODE, I.CUST_NAME, "
+" I.PLAN_START_DATE,I.ACT_START_DATE, I.PLAN_END_DATE,i.STD_TIME,i.ACTION_DETL "
+" ORDER BY I.PLAN_END_DATE asc ";*/
sql="Select e.emp_fname || ' ' || e.emp_lname Employee ,i.req_id, i.dtl_descr,i.cust_code, cc.cust_name, " /* sql="Select e.emp_fname || ' ' || e.emp_lname Employee ,i.req_id, i.dtl_descr,i.cust_code, cc.cust_name, "
+" sum(i.time_spent) time_spent, sum(i.emp_time_spent) emp_time_spent, i.plan_start_date,i.act_start_date, i.plan_end_date " +" sum(i.time_spent) time_spent, sum(i.emp_time_spent) emp_time_spent, i.plan_start_date,i.act_start_date, i.plan_end_date "
+" ,I.STD_TIME,I.ACTION_DETL " +" ,I.STD_TIME,I.ACTION_DETL "
+" from ( " +" from ( "
...@@ -732,7 +821,29 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -732,7 +821,29 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
+" where i.emp_code = e.emp_code " +" where i.emp_code = e.emp_code "
+" and cc.cust_code = i.cust_code " +" and cc.cust_code = i.cust_code "
+" group by e.emp_fname || ' ' || e.emp_lname, i.req_id, i.dtl_descr, i.cust_code, cc.cust_name, i.plan_start_date, i.act_start_date, i.plan_end_date, I.STD_TIME, I.ACTION_DETL " +" group by e.emp_fname || ' ' || e.emp_lname, i.req_id, i.dtl_descr, i.cust_code, cc.cust_name, i.plan_start_date, i.act_start_date, i.plan_end_date, I.STD_TIME, I.ACTION_DETL "
+" order by e.emp_fname || ' ' || e.emp_lname,i.req_id"; +" order by e.emp_fname || ' ' || e.emp_lname,i.req_id";*/
/**Change Sql For Emp Unit time by sachin on 13-Jan-16**/
sql="select e.emp_fname || ' ' || e.emp_lname Employee ,i.req_id, i.dtl_descr,i.cust_code, cc.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 from ( select d.emp_code, r.req_id," +
" r.cust_code,r.dtl_descr, (select min(di.PLANSTDATE) from ser_req_act_detl di, ser_req_act hi where hi.action_id = di.action_id " +
" and hi.req_id = r.req_id and di.emp_code = d.emp_code ) plan_start_date, (select min(fd.START_DATE_ACTUAL) from SER_REQ_FEEDBKDTL " +
" fd, SER_REQ_FEEDBK fh where fd.feedbk_id = fh.feedbk_id and fh.req_id = r.req_id and fh.emp_code = d.emp_code) act_start_date," +
" (select max(di.PLANENDDATE) from ser_req_act_detl di, ser_req_act hi where hi.action_id = di.action_id and hi.req_id = r.req_id " +
" and di.emp_code = d.emp_code ) plan_end_date, (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, (select fn_feedbk_time(sum(iiid.time_spent)) as dd from " +
" SER_REQ_FEEDBKDTL iiid, SER_REQ_FEEDBK iiih where iiid.feedbk_id = iiih.feedbk_id and iiih.req_id = r.req_id and " +
" iiid.action_id = h.action_id and iiid.action_code = d.action_code and iiih.emp_code = d.emp_code ) emp_time_spent from " +
" ser_request r, ser_req_act h, ser_req_act_detl d where d.action_id = h.action_id and r.req_id = h.req_id and r.comp_stat <> 'C' " +
" 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 AND ( RELIEVE_DATE IS NULL OR RELIEVE_DATE >= SYSDATE ))) or (d.emp_code = "+empCode+")) " + dateInpute +
" group by d.emp_code, r.req_id, r.cust_code, r.dtl_descr,d.action_code,h.action_id ) i, employee e, customer cc" +
" where i.emp_code = e.emp_code and cc.cust_code = i.cust_code group by e.emp_fname || ' ' || e.emp_lname,i.req_id, i.dtl_descr," +
" i.cust_code, cc.cust_name, i.plan_start_date,i.act_start_date, i.plan_end_date order by e.emp_fname || ' ' || e.emp_lname,i.req_id" ;
/**Change Sql For Emp Unit time by sachin on 13-Jan-16**/
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
if(dateInpute.trim().length()>0) if(dateInpute.trim().length()>0)
...@@ -786,9 +897,9 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -786,9 +897,9 @@ 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("hour_spent", checkNull(rs.getString("time_spent"))); rowData.put("hour_spent", checkNull(rs.getString("time_spent")));
/**Added by sachin on 7-Dec-15*/ /**Added by sachin on 7-Jan-16*/
rowData.put("emp_hour_spent", checkNull(rs.getString("emp_time_spent"))); rowData.put("emp_hour_spent", checkNull(rs.getString("emp_time_spent")));
/**End Addede by sachin on 7-Dec-15*/ /**End Addede by sachin on 7-Jan-16*/
rowDataEmpWrkAllJson.put(Integer.valueOf(count), rowData); rowDataEmpWrkAllJson.put(Integer.valueOf(count), rowData);
count++; count++;
...@@ -943,7 +1054,7 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -943,7 +1054,7 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
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);
//*Added New code by sachin on 7-Dec-15*/ //*Added New code by sachin on 7-Jan-16*/
compStat=checkNull(rs.getString("COMP_STAT")); compStat=checkNull(rs.getString("COMP_STAT"));
if(compStat.trim().length()>0) if(compStat.trim().length()>0)
{ {
...@@ -960,7 +1071,7 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -960,7 +1071,7 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rowData.put("req_status",compStat); rowData.put("req_status",compStat);
//*Added New code by sachin on 7-Dec-15*/ //*Added New code by sachin on 7-Jan-16*/
String comp_stat_dt=checkNull(rs.getString("comp_stat_dt")); String comp_stat_dt=checkNull(rs.getString("comp_stat_dt"));
...@@ -1131,22 +1242,18 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1131,22 +1242,18 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
&& (empCode!=null && empCode.trim().length()>0) ) && (empCode!=null && empCode.trim().length()>0) )
{ {
/*sql=" select distinct b.execut_dt,to_char(b.execut_dt,'day') as day "
+" from ser_req_feedbkdtl a, ser_req_feedbk b, ser_request "
+" WHERE A.FEEDBK_ID = B.FEEDBK_ID AND A.REQ_ID = SER_REQUEST.REQ_ID " // sql="select mydate from (SELECT TO_DATE(?, 'DD/MM/YY') - 1 + rownum AS mydate " +" FROM all_objects " +" WHERE TO_DATE(?, 'DD/MM/YY') - 1 + rownum <= TO_DATE(?, 'DD/MM/YY') " +" ) " +" where mydate not in " +" ( " +" select hol_date from holiday where hol_date >= TO_DATE(?, 'DD/MM/YY') " +" and hol_date <= 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') " /*Start Modify By sachin on 13-Jan-16*/
+" and trim(to_char(b.execut_dt,'day')) NOT in ('saturday','sunday') "
+" order by b.execut_dt ";*/
sql="select mydate from (SELECT TO_DATE(?, 'DD/MM/YY') - 1 + rownum AS mydate " sql="select mydate from (SELECT TO_DATE(?, 'DD/MM/YY') - 1 + rownum AS mydate "
+" FROM all_objects " +" FROM all_objects " +" WHERE TO_DATE(?, 'DD/MM/YY') - 1 + rownum < TO_DATE(?, 'DD/MM/YY') " +" ) "
+" WHERE TO_DATE(?, 'DD/MM/YY') - 1 + rownum <= TO_DATE(?, 'DD/MM/YY') " +" where mydate not in " +" ( " +" select hol_date from holiday where hol_date >= TO_DATE(?, 'DD/MM/YY') "
+" ) " +" and hol_date <= TO_DATE(?, 'DD/MM/YY') " +" )";
+" where mydate not in "
+" ( " /*End Modify By sachin on 13-Jan-16*/
+" select hol_date from holiday where hol_date >= TO_DATE(?, 'DD/MM/YY') "
+" and hol_date <= TO_DATE(?, 'DD/MM/YY') "
+" )";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,fromDate); pstmt.setString(1,fromDate);
...@@ -1346,11 +1453,11 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -1346,11 +1453,11 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
+" from ser_request r, ser_req_act ah, ser_req_act_detl ad, employee e " +" from ser_request r, ser_req_act ah, ser_req_act_detl ad, employee e "
+" where ah.action_id = ad.action_id " +" where ah.action_id = ad.action_id "
+" 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 ='C'"
+" 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 ";
......
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