Commit b374ad62 authored by Sumith's avatar Sumith

MT-55[Sumith]: Added reports

parent ef3dd39a
......@@ -62,36 +62,6 @@ public class ReportsController {
@Autowired
private TeamMatesBillingRepo teamMatesBillingRepo;
@RequestMapping(value = "/functioNalGroup", method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List> getEmployeeRole() throws MyTimeException {
Map m = new HashMap();
m.put("name", "ES");
m.put("y", "50");
Map m1 = new HashMap();
m1.put("name", "CI");
m1.put("y", "45");
Map m2 = new HashMap();
m2.put("name", "APPS");
m2.put("y", "5");
List l = new ArrayList();
l.add(m);
l.add(m1);
l.add(m2);
return new ResponseEntity<>(l, HttpStatus.OK);
}
/*
* [{ name: "ES", y: 20 }, { name: "CI", y: 12, sliced: true, selected: true
* }, { name: "APPS", y: 43 }]
*/
// [{"name":"ES","total":154},{"name":"ACI -
// QE","total":137},{"name":"","total":71},{"name":"ACI -
// Support","total":53},{"name":"APPS","total":46},{"name":"CI","total":40},{"name":"ACI
// - DevOps","total":37},{"name":"I&A","total":32},{"name":"PE","total":6}]
// [{ name: 'billable2222',data: [5, 3, 4, 7]}, {name: 'nonbillable',data:
// [2, 2, 3, 2]}, {name: 'Shadow', data: [3, 4, 4, 2]}]
@RequestMapping(value = "/getEmployeesByFunctionalGroup1",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
......@@ -356,14 +326,25 @@ public class ReportsController {
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<ProjectTeamMate>> fetchEmployeeDetailsByAccountBillability(
@RequestParam("account") String account,
@RequestParam("billabilityStatus") String billabilityStatus,
@RequestParam("reportDate") String reportDateString)
@RequestParam("billabilityStatus") String billabilityStatus)
throws MyTimeException {
List<ProjectTeamMate> empList = new ArrayList<>();
if (account != null && !account.isEmpty()) {
empList = projectService.findByAccountAndActiveAndBillableStatus(
account, true, billabilityStatus);
} else if (reportDateString != null && !reportDateString.isEmpty()) {
}
return new ResponseEntity<>(empList, HttpStatus.OK);
}
@RequestMapping(value = "/fetchEmployeeDetailsByDateBillability",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<BillingDetails>> fetchEmployeeDetailsByDateBillability(
@RequestParam("billabilityStatus") String billabilityStatus,
@RequestParam("reportDate") String reportDateString)
throws MyTimeException {
List<BillingDetails> empList = new ArrayList<>();
if (reportDateString != null && !reportDateString.isEmpty()) {
String pattern = "MM-dd-yyyy";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
Date reportDateValue = new Date();
......@@ -374,17 +355,20 @@ public class ReportsController {
e.printStackTrace();
}
Criteria status = Criteria.where("billableStatus")
.is(billabilityStatus);
Criteria criteriaV1 = Criteria.where("billingStartDate")
.lt(reportDateValue);
Criteria criteriaV21 = Criteria.where("billingEndDate").is(null);
Criteria criteriaV22 = Criteria.where("billingEndDate")
.gt(reportDateValue);
Criteria criteriaV221 = criteriaV1.orOperator(criteriaV21,
criteriaV22);
Criteria criteriaV221 = status.andOperator(
criteriaV1.orOperator(criteriaV21, criteriaV22));
Query query = new Query();
query.addCriteria(criteriaV221);
empList = mongoTemplate.find(query, ProjectTeamMate.class);
empList = mongoTemplate.find(query, BillingDetails.class);
}
return new ResponseEntity<>(empList, HttpStatus.OK);
}
}
\ No newline at end of file
......@@ -300,6 +300,7 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
menuItems.push({"menu" : "My Org","icon" : "fa fa-address-card-o fa-2x","path" : "templates/myOrg.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-book-o fa-2x","path" : "templates/profile.html"});
menuItems.push({"menu" : "Import Data","icon" : "fa fa-upload fa-2x","path" : "templates/exportData.html"});
menuItems.push({"menu" : "Reports","icon" : "fa fa-address-book-o fa-2x","path" : "templates/charts.html"});
}else{
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "My Team","icon" : "fa fa-futbol-o fa-2x","path" : "templates/myTeam.html"});
......
<html>
<html>
<body>
<div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;"
id="popupContainer" ng-controller="chartsController" ng-init="getMyTeamDetails()">
<div style="margin: 4% 0% 3% 64%;">
Report Type:
<select ng-model="reportId" ng-change="clickMe()" ng-options="report.Id as report.Name for report in reports"></select>
id="popupContainer" ng-controller="chartsController">
<div style="margin: 6% 0% -8% 61%">
Report Type:<select ng-model="reportId" ng-change="clickMe()" ng-options="report.Id as report.Name for report in reports"></select>
</div>
<hc-pie-chart style="width: 100%; padding: 3px 0px 0px 0px;" title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart>
<div >
<div class="row">
<div class="col-lg-12">
<p align="right" class="col-xs-1"
style="vertical-align: middle; font-weight: bold; font-size: 1.5em; margin-top: 8px; cursor: pointer;">
</p>
</div>
</div>
</div>
<div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12">
<div class="col-lg-1" style="float: left;padding-left:20px;">
</div>
<div class="col-lg-1"
style="cursor: pointer; float: right; right: 75px;">
</div>
</div>
<div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12" style="padding-top: 4%;margin-left:0px;">
<div class="row col-lg-12" style="padding-top: 4%;margin-left:0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid" style="width:99%;height:370px;margin-left:0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-exporter
class="myGrid" style="width:99%;height:224px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
</div>
</div>
</body>
......
<div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;"
id="popupContainer333" ng-controller="myController"
>
<md-button class="md-icon-button" ng-click="loadData(19)"> <i
class="fa fa-times fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left">ReportData</i> </md-button>
<hc-chart options="chartOptions">Placeholder for generic chart</hc-chart>
<hc-pie-chart1 title="Browser usage" data="pieData" callback-fn="loadData(45)" ">Placeholder for pie chart</hc-pie-chart>
</div>
\ No newline at end of file
<div class="md-padding" style="width: 100%; padding: 3px 0px 0px 0px;"
id="popupContainer333" ng-controller="Ctrl"
ng-init="loadData(29)">
<div class="container-fluid mainDivHeaderClass">
<div class="row">
<div class="col-lg-12">
<p align="center" class="col-xs-11"
style="vertical-align: middle; font-weight: bold; font-size: 30px;">Reports</p>
<p align="right" class="col-xs-1"
style="vertical-align: middle; font-weight: bold; font-size: 1.5em; margin-top: 8px; cursor: pointer;">
<i class="fa fa-refresh" aria-hidden="true"
ng-click="refreshPage()"></i>
</p>
</div>
</div>
</div>
<div class="row col-lg-12 col-xs-12">
<div class="row col-lg-12 col-xs-12">
<div class="col-lg-5 col-xs-6">
<p>
<b>Report</b>
</p>
</div>
<div class="col-lg-7 col-xs-6">
<p>
<b>:</b><md-select ng-model="report" md-selected-text="getReport()" id="report" ng-change="triggerRport()">
<md-optgroup label="report"> <md-option ng-value="report"
ng-repeat="report in reports">{{report}}</md-option> </md-optgroup> </md-select>
</p>
</div>
</div>
<div class="row col-lg-12" style="padding-top: 4%;margin-left:0px;">
<div><highchartxyz chart='{{renderChart}}'></highchartxyz></div>
</div>
<div class="row col-lg-12" style="padding-top: 4%;margin-left:0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid" style="width:99%;height:370px;margin-left:0px;">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
</div>
</div>
</div>
\ 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